aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/lantiq/irq.c
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2012-08-16 04:09:20 -0400
committerJohn Crispin <blogic@openwrt.org>2012-08-22 18:08:17 -0400
commitc2c9c788b91218bccbb9ac31539ffa577fe502bf (patch)
treec2e273e08a8c567d7f3909921e581451dcf313f7 /arch/mips/lantiq/irq.c
parent61fa969f27ec58296544bf94d058f3aa704cb8d9 (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.c19
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] = {
84static int exin_avail; 84static int exin_avail;
85static void __iomem *ltq_icu_membase[MAX_IM]; 85static void __iomem *ltq_icu_membase[MAX_IM];
86static void __iomem *ltq_eiu_membase; 86static void __iomem *ltq_eiu_membase;
87static struct irq_domain *ltq_domain;
87 88
88void ltq_disable_irq(struct irq_data *d) 89void ltq_disable_irq(struct irq_data *d)
89{ 90{
@@ -219,10 +220,14 @@ DEFINE_HWx_IRQDISPATCH(2)
219DEFINE_HWx_IRQDISPATCH(3) 220DEFINE_HWx_IRQDISPATCH(3)
220DEFINE_HWx_IRQDISPATCH(4) 221DEFINE_HWx_IRQDISPATCH(4)
221 222
223#if MIPS_CPU_TIMER_IRQ == 7
222static void ltq_hw5_irqdispatch(void) 224static 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
229DEFINE_HWx_IRQDISPATCH(5)
230#endif
226 231
227#ifdef CONFIG_MIPS_MT_SMP 232#ifdef CONFIG_MIPS_MT_SMP
228void __init arch_init_ipiirq(int irq, struct irqaction *action) 233void __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
407unsigned int __cpuinit get_c0_compare_int(void) 420unsigned 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
412static struct of_device_id __initdata of_irq_ids[] = { 425static struct of_device_id __initdata of_irq_ids[] = {