1 From 6e74b82aca08a5ecc4d2f0780254468659427e82 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Fri, 26 Apr 2013 12:03:15 +0200
4 Subject: [PATCH 08/10] MIPS: BCM63XX: wire up the second cpu's irq line
6 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
8 arch/mips/bcm63xx/irq.c | 44 +++++++++++++++++++++++++++++++++++++-------
9 1 file changed, 37 insertions(+), 7 deletions(-)
11 --- a/arch/mips/bcm63xx/irq.c
12 +++ b/arch/mips/bcm63xx/irq.c
13 @@ -102,11 +102,17 @@ static void __internal_irq_mask_##width(
14 unsigned reg = (irq / 32) ^ (width/32 - 1); \
15 unsigned bit = irq & 0x1f; \
16 unsigned long flags; \
19 spin_lock_irqsave(&ipic_lock, flags); \
20 - val = bcm_readl(irq_mask_addr[0] + reg * sizeof(u32)); \
21 - val &= ~(1 << bit); \
22 - bcm_writel(val, irq_mask_addr[0] + reg * sizeof(u32)); \
23 + for_each_present_cpu(cpu) { \
24 + if (!irq_mask_addr[cpu]) \
27 + val = bcm_readl(irq_mask_addr[cpu] + reg * sizeof(u32));\
28 + val &= ~(1 << bit); \
29 + bcm_writel(val, irq_mask_addr[cpu] + reg * sizeof(u32));\
31 spin_unlock_irqrestore(&ipic_lock, flags); \
34 @@ -116,11 +122,20 @@ static void __internal_irq_unmask_##widt
35 unsigned reg = (irq / 32) ^ (width/32 - 1); \
36 unsigned bit = irq & 0x1f; \
37 unsigned long flags; \
40 spin_lock_irqsave(&ipic_lock, flags); \
41 - val = bcm_readl(irq_mask_addr[0] + reg * sizeof(u32)); \
42 - val |= (1 << bit); \
43 - bcm_writel(val, irq_mask_addr[0] + reg * sizeof(u32)); \
44 + for_each_present_cpu(cpu) { \
45 + if (!irq_mask_addr[cpu]) \
48 + val = bcm_readl(irq_mask_addr[cpu] + reg * sizeof(u32));\
49 + if (cpu_online(cpu)) \
50 + val |= (1 << bit); \
52 + val &= ~(1 << bit); \
53 + bcm_writel(val, irq_mask_addr[cpu] + reg * sizeof(u32));\
55 spin_unlock_irqrestore(&ipic_lock, flags); \
58 @@ -145,7 +160,10 @@ asmlinkage void plat_irq_dispatch(void)
60 if (cause & CAUSEF_IP2)
62 - if (!is_ext_irq_cascaded) {
63 + if (is_ext_irq_cascaded) {
64 + if (cause & CAUSEF_IP3)
65 + dispatch_internal(1);
67 if (cause & CAUSEF_IP3)
69 if (cause & CAUSEF_IP4)
70 @@ -358,6 +376,14 @@ static struct irqaction cpu_ip2_cascade_
71 .flags = IRQF_NO_THREAD,
75 +static struct irqaction cpu_ip3_cascade_action = {
76 + .handler = no_action,
77 + .name = "cascade_ip3",
78 + .flags = IRQF_NO_THREAD,
82 static struct irqaction cpu_ext_cascade_action = {
84 .name = "cascade_extirq",
85 @@ -494,4 +520,8 @@ void __init arch_init_irq(void)
88 setup_irq(MIPS_CPU_IRQ_BASE + 2, &cpu_ip2_cascade_action);
90 + if (is_ext_irq_cascaded)
91 + setup_irq(MIPS_CPU_IRQ_BASE + 3, &cpu_ip3_cascade_action);