diff options
author | Greg Ungerer <gerg@uclinux.org> | 2009-05-19 00:38:08 -0400 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2009-09-15 19:43:50 -0400 |
commit | f2154bef817ac3d0ea67b52526fd8e88898b66f9 (patch) | |
tree | 3ffa5cf5c3ec82a59f75728a580bd9332a32ebee /arch/m68knommu/platform/coldfire/intc.c | |
parent | 5187995f0a9253e915dfee83684eae7b692213e6 (diff) |
m68knommu: merge old ColdFire interrupt controller masking macros
Currently the code that supports setting the old style ColdFire interrupt
controller mask registers is macros in the include files of each of the
CPU types. Merge all these into a set of real masking functions in the
old Coldfire interrupt controller code proper. All the macros are basically
the same (excepting a register size difference on really early parts).
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68knommu/platform/coldfire/intc.c')
-rw-r--r-- | arch/m68knommu/platform/coldfire/intc.c | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/arch/m68knommu/platform/coldfire/intc.c b/arch/m68knommu/platform/coldfire/intc.c index f7a61346ee25..88bffac50c67 100644 --- a/arch/m68knommu/platform/coldfire/intc.c +++ b/arch/m68knommu/platform/coldfire/intc.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * intc.c | 2 | * intc.c -- support for the old ColdFire interrupt controller |
3 | * | 3 | * |
4 | * (C) Copyright 2009, Greg Ungerer <gerg@snapgear.com> | 4 | * (C) Copyright 2009, Greg Ungerer <gerg@snapgear.com> |
5 | * | 5 | * |
@@ -27,6 +27,62 @@ | |||
27 | #define EIRQ7 31 | 27 | #define EIRQ7 31 |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * In the early version 2 core ColdFire parts the IMR register was 16 bits | ||
31 | * in size. Version 3 (and later version 2) core parts have a 32 bit | ||
32 | * sized IMR register. Provide some size independant methods to access the | ||
33 | * IMR register. | ||
34 | */ | ||
35 | #ifdef MCFSIM_IMR_IS_16BITS | ||
36 | |||
37 | void mcf_setimr(int index) | ||
38 | { | ||
39 | u16 imr; | ||
40 | imr = __raw_readw(MCF_MBAR + MCFSIM_IMR); | ||
41 | __raw_writew(imr | (0x1 << index), MCF_MBAR + MCFSIM_IMR); | ||
42 | } | ||
43 | |||
44 | void mcf_clrimr(int index) | ||
45 | { | ||
46 | u16 imr; | ||
47 | imr = __raw_readw(MCF_MBAR + MCFSIM_IMR); | ||
48 | __raw_writew(imr & ~(0x1 << index), MCF_MBAR + MCFSIM_IMR); | ||
49 | } | ||
50 | |||
51 | void mcf_maskimr(unsigned int mask) | ||
52 | { | ||
53 | u16 imr; | ||
54 | imr = __raw_readw(MCF_MBAR + MCFSIM_IMR); | ||
55 | imr |= mask; | ||
56 | __raw_writew(imr, MCF_MBAR + MCFSIM_IMR); | ||
57 | } | ||
58 | |||
59 | #else | ||
60 | |||
61 | void mcf_setimr(int index) | ||
62 | { | ||
63 | u32 imr; | ||
64 | imr = __raw_readl(MCF_MBAR + MCFSIM_IMR); | ||
65 | __raw_writel(imr | (0x1 << index), MCF_MBAR + MCFSIM_IMR); | ||
66 | } | ||
67 | |||
68 | void mcf_clrimr(int index) | ||
69 | { | ||
70 | u32 imr; | ||
71 | imr = __raw_readl(MCF_MBAR + MCFSIM_IMR); | ||
72 | __raw_writel(imr & ~(0x1 << index), MCF_MBAR + MCFSIM_IMR); | ||
73 | } | ||
74 | |||
75 | void mcf_maskimr(unsigned int mask) | ||
76 | { | ||
77 | u32 imr; | ||
78 | imr = __raw_readl(MCF_MBAR + MCFSIM_IMR); | ||
79 | imr |= mask; | ||
80 | __raw_writel(imr, MCF_MBAR + MCFSIM_IMR); | ||
81 | } | ||
82 | |||
83 | #endif | ||
84 | |||
85 | /* | ||
30 | * Interrupts can be "vectored" on the ColdFire cores that support this old | 86 | * Interrupts can be "vectored" on the ColdFire cores that support this old |
31 | * interrupt controller. That is, the device raising the interrupt can also | 87 | * interrupt controller. That is, the device raising the interrupt can also |
32 | * supply the vector number to interrupt through. The AVR register of the | 88 | * supply the vector number to interrupt through. The AVR register of the |
@@ -70,6 +126,7 @@ void __init init_IRQ(void) | |||
70 | int irq; | 126 | int irq; |
71 | 127 | ||
72 | init_vectors(); | 128 | init_vectors(); |
129 | mcf_maskimr(0xffffffff); | ||
73 | 130 | ||
74 | for (irq = 0; (irq < NR_IRQS); irq++) { | 131 | for (irq = 0; (irq < NR_IRQS); irq++) { |
75 | irq_desc[irq].status = IRQ_DISABLED; | 132 | irq_desc[irq].status = IRQ_DISABLED; |