diff options
author | John Crispin <blogic@openwrt.org> | 2012-08-16 04:09:20 -0400 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2012-08-22 18:08:17 -0400 |
commit | c2c9c788b91218bccbb9ac31539ffa577fe502bf (patch) | |
tree | c2e273e08a8c567d7f3909921e581451dcf313f7 /arch/mips/lantiq/irq.c | |
parent | 61fa969f27ec58296544bf94d058f3aa704cb8d9 (diff) |
MIPS: lantiq: timer irq can be different to 7
The SVIP SoC has its timer IRQ on a different IRQ than 7. Fix up the irq
code to be able to handle this.
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/4229/
Diffstat (limited to 'arch/mips/lantiq/irq.c')
-rw-r--r-- | arch/mips/lantiq/irq.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/mips/lantiq/irq.c b/arch/mips/lantiq/irq.c index a2699a70322b..0cec43dc3f60 100644 --- a/arch/mips/lantiq/irq.c +++ b/arch/mips/lantiq/irq.c | |||
@@ -84,6 +84,7 @@ static unsigned short ltq_eiu_irq[MAX_EIU] = { | |||
84 | static int exin_avail; | 84 | static int exin_avail; |
85 | static void __iomem *ltq_icu_membase[MAX_IM]; | 85 | static void __iomem *ltq_icu_membase[MAX_IM]; |
86 | static void __iomem *ltq_eiu_membase; | 86 | static void __iomem *ltq_eiu_membase; |
87 | static struct irq_domain *ltq_domain; | ||
87 | 88 | ||
88 | void ltq_disable_irq(struct irq_data *d) | 89 | void ltq_disable_irq(struct irq_data *d) |
89 | { | 90 | { |
@@ -219,10 +220,14 @@ DEFINE_HWx_IRQDISPATCH(2) | |||
219 | DEFINE_HWx_IRQDISPATCH(3) | 220 | DEFINE_HWx_IRQDISPATCH(3) |
220 | DEFINE_HWx_IRQDISPATCH(4) | 221 | DEFINE_HWx_IRQDISPATCH(4) |
221 | 222 | ||
223 | #if MIPS_CPU_TIMER_IRQ == 7 | ||
222 | static void ltq_hw5_irqdispatch(void) | 224 | static void ltq_hw5_irqdispatch(void) |
223 | { | 225 | { |
224 | do_IRQ(MIPS_CPU_TIMER_IRQ); | 226 | do_IRQ(MIPS_CPU_TIMER_IRQ); |
225 | } | 227 | } |
228 | #else | ||
229 | DEFINE_HWx_IRQDISPATCH(5) | ||
230 | #endif | ||
226 | 231 | ||
227 | #ifdef CONFIG_MIPS_MT_SMP | 232 | #ifdef CONFIG_MIPS_MT_SMP |
228 | void __init arch_init_ipiirq(int irq, struct irqaction *action) | 233 | void __init arch_init_ipiirq(int irq, struct irqaction *action) |
@@ -270,7 +275,7 @@ asmlinkage void plat_irq_dispatch(void) | |||
270 | unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; | 275 | unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; |
271 | unsigned int i; | 276 | unsigned int i; |
272 | 277 | ||
273 | if (pending & CAUSEF_IP7) { | 278 | if ((MIPS_CPU_TIMER_IRQ == 7) && (pending & CAUSEF_IP7)) { |
274 | do_IRQ(MIPS_CPU_TIMER_IRQ); | 279 | do_IRQ(MIPS_CPU_TIMER_IRQ); |
275 | goto out; | 280 | goto out; |
276 | } else { | 281 | } else { |
@@ -376,7 +381,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent) | |||
376 | set_vi_handler(7, ltq_hw5_irqdispatch); | 381 | set_vi_handler(7, ltq_hw5_irqdispatch); |
377 | } | 382 | } |
378 | 383 | ||
379 | irq_domain_add_linear(node, | 384 | ltq_domain = irq_domain_add_linear(node, |
380 | (MAX_IM * INT_NUM_IM_OFFSET) + MIPS_CPU_IRQ_CASCADE, | 385 | (MAX_IM * INT_NUM_IM_OFFSET) + MIPS_CPU_IRQ_CASCADE, |
381 | &irq_domain_ops, 0); | 386 | &irq_domain_ops, 0); |
382 | 387 | ||
@@ -401,12 +406,20 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent) | |||
401 | 406 | ||
402 | /* tell oprofile which irq to use */ | 407 | /* tell oprofile which irq to use */ |
403 | cp0_perfcount_irq = LTQ_PERF_IRQ; | 408 | cp0_perfcount_irq = LTQ_PERF_IRQ; |
409 | |||
410 | /* | ||
411 | * if the timer irq is not one of the mips irqs we need to | ||
412 | * create a mapping | ||
413 | */ | ||
414 | if (MIPS_CPU_TIMER_IRQ != 7) | ||
415 | irq_create_mapping(ltq_domain, MIPS_CPU_TIMER_IRQ); | ||
416 | |||
404 | return 0; | 417 | return 0; |
405 | } | 418 | } |
406 | 419 | ||
407 | unsigned int __cpuinit get_c0_compare_int(void) | 420 | unsigned int __cpuinit get_c0_compare_int(void) |
408 | { | 421 | { |
409 | return CP0_LEGACY_COMPARE_IRQ; | 422 | return MIPS_CPU_TIMER_IRQ; |
410 | } | 423 | } |
411 | 424 | ||
412 | static struct of_device_id __initdata of_irq_ids[] = { | 425 | static struct of_device_id __initdata of_irq_ids[] = { |