diff options
author | Greg Ungerer <gerg@uclinux.org> | 2009-04-28 22:07:13 -0400 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2009-09-15 19:43:42 -0400 |
commit | 277c5e3e26cac45010f57a581c56476639b2cfa0 (patch) | |
tree | fbc4465582bba19a2045eb72c870cde044a5f558 /arch/m68knommu | |
parent | 1f946533bb562f5144752ea583cac45e9410fdaa (diff) |
m68knommu: general interrupt controller for ColdFire 532x parts
The ColdFire 532x family of parts uses 2 of the same INTC interrupt
controlers used in the ColdFire 520x family. So modify the code to
support both parts. The extra code for the second INTC controler in
the case of the 520x is easily optimized away to nothing.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68knommu')
-rw-r--r-- | arch/m68knommu/kernel/irq.c | 3 | ||||
-rw-r--r-- | arch/m68knommu/platform/coldfire/Makefile | 2 | ||||
-rw-r--r-- | arch/m68knommu/platform/coldfire/intc-simr.c | 24 |
3 files changed, 21 insertions, 8 deletions
diff --git a/arch/m68knommu/kernel/irq.c b/arch/m68knommu/kernel/irq.c index f9965d7ee7c5..93d567bbf33d 100644 --- a/arch/m68knommu/kernel/irq.c +++ b/arch/m68knommu/kernel/irq.c | |||
@@ -30,7 +30,8 @@ asmlinkage void do_IRQ(int irq, struct pt_regs *regs) | |||
30 | } | 30 | } |
31 | 31 | ||
32 | #if !defined(CONFIG_M520x) && !defined(CONFIG_M523x) && \ | 32 | #if !defined(CONFIG_M520x) && !defined(CONFIG_M523x) && \ |
33 | !defined(CONFIG_M527x) && !defined(CONFIG_M528x) | 33 | !defined(CONFIG_M527x) && !defined(CONFIG_M528x) && \ |
34 | !defined(CONFIG_M532x) | ||
34 | 35 | ||
35 | static struct irq_chip m_irq_chip = { | 36 | static struct irq_chip m_irq_chip = { |
36 | .name = "M68K-INTC", | 37 | .name = "M68K-INTC", |
diff --git a/arch/m68knommu/platform/coldfire/Makefile b/arch/m68knommu/platform/coldfire/Makefile index bce9a62d3a13..6c5f699cf145 100644 --- a/arch/m68knommu/platform/coldfire/Makefile +++ b/arch/m68knommu/platform/coldfire/Makefile | |||
@@ -24,7 +24,7 @@ obj-$(CONFIG_M527x) += pit.o intc-2.o | |||
24 | obj-$(CONFIG_M5272) += timers.o | 24 | obj-$(CONFIG_M5272) += timers.o |
25 | obj-$(CONFIG_M528x) += pit.o intc-2.o | 25 | obj-$(CONFIG_M528x) += pit.o intc-2.o |
26 | obj-$(CONFIG_M5307) += timers.o | 26 | obj-$(CONFIG_M5307) += timers.o |
27 | obj-$(CONFIG_M532x) += timers.o | 27 | obj-$(CONFIG_M532x) += timers.o intc-simr.o |
28 | obj-$(CONFIG_M5407) += timers.o | 28 | obj-$(CONFIG_M5407) += timers.o |
29 | 29 | ||
30 | obj-y += pinmux.o gpio.o | 30 | obj-y += pinmux.o gpio.o |
diff --git a/arch/m68knommu/platform/coldfire/intc-simr.c b/arch/m68knommu/platform/coldfire/intc-simr.c index 3b614a3508fc..86fc2047d7ac 100644 --- a/arch/m68knommu/platform/coldfire/intc-simr.c +++ b/arch/m68knommu/platform/coldfire/intc-simr.c | |||
@@ -20,20 +20,32 @@ | |||
20 | 20 | ||
21 | static void intc_irq_mask(unsigned int irq) | 21 | static void intc_irq_mask(unsigned int irq) |
22 | { | 22 | { |
23 | if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECBASE + 63)) | 23 | if (irq >= MCFINT_VECBASE) { |
24 | __raw_writeb(irq - MCFINT_VECBASE, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_SIMR); | 24 | if (irq < MCFINT_VECBASE + 64) |
25 | __raw_writeb(irq - MCFINT_VECBASE, MCFINTC0_SIMR); | ||
26 | else if ((irq < MCFINT_VECBASE + 128) && MCFINTC1_SIMR) | ||
27 | __raw_writeb(irq - MCFINT_VECBASE - 64, MCFINTC1_SIMR); | ||
28 | } | ||
25 | } | 29 | } |
26 | 30 | ||
27 | static void intc_irq_unmask(unsigned int irq) | 31 | static void intc_irq_unmask(unsigned int irq) |
28 | { | 32 | { |
29 | if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECBASE + 63)) | 33 | if (irq >= MCFINT_VECBASE) { |
30 | __raw_writeb(irq - MCFINT_VECBASE, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_CIMR); | 34 | if (irq < MCFINT_VECBASE + 64) |
35 | __raw_writeb(irq - MCFINT_VECBASE, MCFINTC0_CIMR); | ||
36 | else if ((irq < MCFINT_VECBASE + 128) && MCFINTC1_CIMR) | ||
37 | __raw_writeb(irq - MCFINT_VECBASE - 64, MCFINTC1_CIMR); | ||
38 | } | ||
31 | } | 39 | } |
32 | 40 | ||
33 | static int intc_irq_set_type(unsigned int irq, unsigned int type) | 41 | static int intc_irq_set_type(unsigned int irq, unsigned int type) |
34 | { | 42 | { |
35 | if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECBASE + 63)) | 43 | if (irq >= MCFINT_VECBASE) { |
36 | __raw_writeb(5, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + irq - MCFINT_VECBASE); | 44 | if (irq < MCFINT_VECBASE + 64) |
45 | __raw_writeb(5, MCFINTC0_ICR0 + irq - MCFINT_VECBASE); | ||
46 | else if ((irq < MCFINT_VECBASE) && MCFINTC1_ICR0) | ||
47 | __raw_writeb(5, MCFINTC1_ICR0 + irq - MCFINT_VECBASE - 64); | ||
48 | } | ||
37 | return 0; | 49 | return 0; |
38 | } | 50 | } |
39 | 51 | ||