diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2012-11-17 08:57:15 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-11-21 12:57:42 -0500 |
commit | 197926108cc837474f8807678d6220bdce281620 (patch) | |
tree | 49f97a2bd9f5b7419f9634944eb4b227eaf87196 /arch/arm/mach-clps711x | |
parent | 99f04c8f69753e4032059eeb0c21197948e459f7 (diff) |
ARM: clps711x: Add FIQ interrupt handling
CLPS711X-target CPU can have a several FIQ interrupts. With this patch
we adds handling for a one which will be used for ALSA PCM later.
Since FIQ have a separate handler we only add "mask" and "unmask" calls
which will used for enable/disable_irq functions.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-clps711x')
-rw-r--r-- | arch/arm/mach-clps711x/common.c | 37 | ||||
-rw-r--r-- | arch/arm/mach-clps711x/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-clps711x/include/mach/clps711x.h | 3 |
3 files changed, 39 insertions, 3 deletions
diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c index 08420244c058..fcdcd91ea107 100644 --- a/arch/arm/mach-clps711x/common.c +++ b/arch/arm/mach-clps711x/common.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/clk-provider.h> | 30 | #include <linux/clk-provider.h> |
31 | 31 | ||
32 | #include <asm/exception.h> | 32 | #include <asm/exception.h> |
33 | #include <asm/mach/irq.h> | ||
33 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
34 | #include <asm/mach/time.h> | 35 | #include <asm/mach/time.h> |
35 | #include <asm/system_misc.h> | 36 | #include <asm/system_misc.h> |
@@ -91,7 +92,7 @@ static void int1_unmask(struct irq_data *d) | |||
91 | } | 92 | } |
92 | 93 | ||
93 | static struct irq_chip int1_chip = { | 94 | static struct irq_chip int1_chip = { |
94 | .name = "Interrupt Vector 1 ", | 95 | .name = "Interrupt Vector 1", |
95 | .irq_ack = int1_ack, | 96 | .irq_ack = int1_ack, |
96 | .irq_eoi = int1_eoi, | 97 | .irq_eoi = int1_eoi, |
97 | .irq_mask = int1_mask, | 98 | .irq_mask = int1_mask, |
@@ -128,13 +129,37 @@ static void int2_unmask(struct irq_data *d) | |||
128 | } | 129 | } |
129 | 130 | ||
130 | static struct irq_chip int2_chip = { | 131 | static struct irq_chip int2_chip = { |
131 | .name = "Interrupt Vector 2 ", | 132 | .name = "Interrupt Vector 2", |
132 | .irq_ack = int2_ack, | 133 | .irq_ack = int2_ack, |
133 | .irq_eoi = int2_eoi, | 134 | .irq_eoi = int2_eoi, |
134 | .irq_mask = int2_mask, | 135 | .irq_mask = int2_mask, |
135 | .irq_unmask = int2_unmask, | 136 | .irq_unmask = int2_unmask, |
136 | }; | 137 | }; |
137 | 138 | ||
139 | static void int3_mask(struct irq_data *d) | ||
140 | { | ||
141 | u32 intmr3; | ||
142 | |||
143 | intmr3 = clps_readl(INTMR3); | ||
144 | intmr3 &= ~(1 << (d->irq - 32)); | ||
145 | clps_writel(intmr3, INTMR3); | ||
146 | } | ||
147 | |||
148 | static void int3_unmask(struct irq_data *d) | ||
149 | { | ||
150 | u32 intmr3; | ||
151 | |||
152 | intmr3 = clps_readl(INTMR3); | ||
153 | intmr3 |= 1 << (d->irq - 32); | ||
154 | clps_writel(intmr3, INTMR3); | ||
155 | } | ||
156 | |||
157 | static struct irq_chip int3_chip = { | ||
158 | .name = "Interrupt Vector 3", | ||
159 | .irq_mask = int3_mask, | ||
160 | .irq_unmask = int3_unmask, | ||
161 | }; | ||
162 | |||
138 | static struct { | 163 | static struct { |
139 | int nr; | 164 | int nr; |
140 | struct irq_chip *chip; | 165 | struct irq_chip *chip; |
@@ -188,6 +213,14 @@ void __init clps711x_init_irq(void) | |||
188 | set_irq_flags(clps711x_irqdescs[i].nr, | 213 | set_irq_flags(clps711x_irqdescs[i].nr, |
189 | IRQF_VALID | IRQF_PROBE); | 214 | IRQF_VALID | IRQF_PROBE); |
190 | } | 215 | } |
216 | |||
217 | if (IS_ENABLED(CONFIG_FIQ)) { | ||
218 | init_FIQ(0); | ||
219 | irq_set_chip_and_handler(IRQ_DAIINT, &int3_chip, | ||
220 | handle_bad_irq); | ||
221 | set_irq_flags(IRQ_DAIINT, | ||
222 | IRQF_VALID | IRQF_PROBE | IRQF_NOAUTOEN); | ||
223 | } | ||
191 | } | 224 | } |
192 | 225 | ||
193 | inline u32 fls16(u32 x) | 226 | inline u32 fls16(u32 x) |
diff --git a/arch/arm/mach-clps711x/common.h b/arch/arm/mach-clps711x/common.h index 3c7f12cb81c1..b7c0c75c90c0 100644 --- a/arch/arm/mach-clps711x/common.h +++ b/arch/arm/mach-clps711x/common.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * Common bits. | 4 | * Common bits. |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #define CLPS711X_NR_IRQS (30) | 7 | #define CLPS711X_NR_IRQS (33) |
8 | #define CLPS711X_NR_GPIO (4 * 8 + 3) | 8 | #define CLPS711X_NR_GPIO (4 * 8 + 3) |
9 | #define CLPS711X_GPIO(prt, bit) ((prt) * 8 + (bit)) | 9 | #define CLPS711X_GPIO(prt, bit) ((prt) * 8 + (bit)) |
10 | 10 | ||
diff --git a/arch/arm/mach-clps711x/include/mach/clps711x.h b/arch/arm/mach-clps711x/include/mach/clps711x.h index 1f4728d414d7..01d1b9559710 100644 --- a/arch/arm/mach-clps711x/include/mach/clps711x.h +++ b/arch/arm/mach-clps711x/include/mach/clps711x.h | |||
@@ -298,4 +298,7 @@ | |||
298 | #define IRQ_UTXINT2 (16 + 12) | 298 | #define IRQ_UTXINT2 (16 + 12) |
299 | #define IRQ_URXINT2 (16 + 13) | 299 | #define IRQ_URXINT2 (16 + 13) |
300 | 300 | ||
301 | /* INTSR3 Interrupts */ | ||
302 | #define IRQ_DAIINT (32 + 0) | ||
303 | |||
301 | #endif /* __MACH_CLPS711X_H */ | 304 | #endif /* __MACH_CLPS711X_H */ |