diff options
author | Philippe De Muyter <phdm@macqel.be> | 2010-09-01 09:23:28 -0400 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2010-10-20 20:17:30 -0400 |
commit | 8851338dd09ed3544bb9a427ae04f1c481ce5456 (patch) | |
tree | 62388a0d1b4f536c160ec54536c2bd5721f60774 /arch/m68knommu/platform | |
parent | aa108e4eae67c9aa6ad77e4fc17b044caffd135c (diff) |
m68knommu: add support for Coldfire 547x/548x interrupt controller
The Coldfire MCF547x/MCF548x have the same interrupt controller as
the MCF528x e.g., but only one, not two as in the MCF528x. Modify
intc-2.c to support only one interrupt controller if MCFICM_INTC1 is
not defined.
Signed-off-by: Philippe De Muyter <phdm@macqel.be>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68knommu/platform')
-rw-r--r-- | arch/m68knommu/platform/coldfire/intc-2.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/arch/m68knommu/platform/coldfire/intc-2.c b/arch/m68knommu/platform/coldfire/intc-2.c index a0c72ec8e6b5..c23046cc6564 100644 --- a/arch/m68knommu/platform/coldfire/intc-2.c +++ b/arch/m68knommu/platform/coldfire/intc-2.c | |||
@@ -1,9 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * intc-2.c | 2 | * intc-2.c |
3 | * | 3 | * |
4 | * General interrupt controller code for the many ColdFire version 2 cores | 4 | * General interrupt controller code for the many ColdFire cores that use |
5 | * that use the two region INTC interrupt controller. This includes the | 5 | * interrupt controllers with 63 interrupt sources, organized as 56 fully- |
6 | * 523x family, 5270, 5271, 5274, 5275, and the 528x families. | 6 | * programmable + 7 fixed-level interrupt sources. This includes the 523x |
7 | * family, the 5270, 5271, 5274, 5275, and the 528x family which have two such | ||
8 | * controllers, and the 547x and 548x families which have only one of them. | ||
7 | * | 9 | * |
8 | * (C) Copyright 2009, Greg Ungerer <gerg@snapgear.com> | 10 | * (C) Copyright 2009, Greg Ungerer <gerg@snapgear.com> |
9 | * | 11 | * |
@@ -23,21 +25,37 @@ | |||
23 | #include <asm/traps.h> | 25 | #include <asm/traps.h> |
24 | 26 | ||
25 | /* | 27 | /* |
26 | * Each vector needs a unique priority and level asscoiated with it. | 28 | * Bit definitions for the ICR family of registers. |
29 | */ | ||
30 | #define MCFSIM_ICR_LEVEL(l) ((l)<<3) /* Level l intr */ | ||
31 | #define MCFSIM_ICR_PRI(p) (p) /* Priority p intr */ | ||
32 | |||
33 | /* | ||
34 | * Each vector needs a unique priority and level associated with it. | ||
27 | * We don't really care so much what they are, we don't rely on the | 35 | * We don't really care so much what they are, we don't rely on the |
28 | * tranditional priority interrupt scheme of the m68k/ColdFire. | 36 | * traditional priority interrupt scheme of the m68k/ColdFire. |
29 | */ | 37 | */ |
30 | static u8 intc_intpri = 0x36; | 38 | static u8 intc_intpri = MCFSIM_ICR_LEVEL(6) | MCFSIM_ICR_PRI(6); |
39 | |||
40 | #ifdef MCFICM_INTC1 | ||
41 | #define NR_VECS 128 | ||
42 | #else | ||
43 | #define NR_VECS 64 | ||
44 | #endif | ||
31 | 45 | ||
32 | static void intc_irq_mask(unsigned int irq) | 46 | static void intc_irq_mask(unsigned int irq) |
33 | { | 47 | { |
34 | if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECBASE + 128)) { | 48 | if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECBASE + NR_VECS)) { |
35 | unsigned long imraddr; | 49 | unsigned long imraddr; |
36 | u32 val, imrbit; | 50 | u32 val, imrbit; |
37 | 51 | ||
38 | irq -= MCFINT_VECBASE; | 52 | irq -= MCFINT_VECBASE; |
39 | imraddr = MCF_IPSBAR; | 53 | imraddr = MCF_IPSBAR; |
54 | #ifdef MCFICM_INTC1 | ||
40 | imraddr += (irq & 0x40) ? MCFICM_INTC1 : MCFICM_INTC0; | 55 | imraddr += (irq & 0x40) ? MCFICM_INTC1 : MCFICM_INTC0; |
56 | #else | ||
57 | imraddr += MCFICM_INTC0; | ||
58 | #endif | ||
41 | imraddr += (irq & 0x20) ? MCFINTC_IMRH : MCFINTC_IMRL; | 59 | imraddr += (irq & 0x20) ? MCFINTC_IMRH : MCFINTC_IMRL; |
42 | imrbit = 0x1 << (irq & 0x1f); | 60 | imrbit = 0x1 << (irq & 0x1f); |
43 | 61 | ||
@@ -48,13 +66,17 @@ static void intc_irq_mask(unsigned int irq) | |||
48 | 66 | ||
49 | static void intc_irq_unmask(unsigned int irq) | 67 | static void intc_irq_unmask(unsigned int irq) |
50 | { | 68 | { |
51 | if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECBASE + 128)) { | 69 | if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECBASE + NR_VECS)) { |
52 | unsigned long intaddr, imraddr, icraddr; | 70 | unsigned long intaddr, imraddr, icraddr; |
53 | u32 val, imrbit; | 71 | u32 val, imrbit; |
54 | 72 | ||
55 | irq -= MCFINT_VECBASE; | 73 | irq -= MCFINT_VECBASE; |
56 | intaddr = MCF_IPSBAR; | 74 | intaddr = MCF_IPSBAR; |
75 | #ifdef MCFICM_INTC1 | ||
57 | intaddr += (irq & 0x40) ? MCFICM_INTC1 : MCFICM_INTC0; | 76 | intaddr += (irq & 0x40) ? MCFICM_INTC1 : MCFICM_INTC0; |
77 | #else | ||
78 | intaddr += MCFICM_INTC0; | ||
79 | #endif | ||
58 | imraddr = intaddr + ((irq & 0x20) ? MCFINTC_IMRH : MCFINTC_IMRL); | 80 | imraddr = intaddr + ((irq & 0x20) ? MCFINTC_IMRH : MCFINTC_IMRL); |
59 | icraddr = intaddr + MCFINTC_ICR0 + (irq & 0x3f); | 81 | icraddr = intaddr + MCFINTC_ICR0 + (irq & 0x3f); |
60 | imrbit = 0x1 << (irq & 0x1f); | 82 | imrbit = 0x1 << (irq & 0x1f); |
@@ -85,7 +107,9 @@ void __init init_IRQ(void) | |||
85 | 107 | ||
86 | /* Mask all interrupt sources */ | 108 | /* Mask all interrupt sources */ |
87 | __raw_writel(0x1, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL); | 109 | __raw_writel(0x1, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL); |
110 | #ifdef MCFICM_INTC1 | ||
88 | __raw_writel(0x1, MCF_IPSBAR + MCFICM_INTC1 + MCFINTC_IMRL); | 111 | __raw_writel(0x1, MCF_IPSBAR + MCFICM_INTC1 + MCFINTC_IMRL); |
112 | #endif | ||
89 | 113 | ||
90 | for (irq = 0; (irq < NR_IRQS); irq++) { | 114 | for (irq = 0; (irq < NR_IRQS); irq++) { |
91 | irq_desc[irq].status = IRQ_DISABLED; | 115 | irq_desc[irq].status = IRQ_DISABLED; |