diff options
author | Jonas Gorski <jogo@openwrt.org> | 2014-07-12 06:49:38 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-07-30 09:29:00 -0400 |
commit | 7a9fd14d4c4796d3b0d4aec9c91183560d201b4d (patch) | |
tree | dcd6e6a018858bf3b1ac15b7fe072f0623e86a61 /arch | |
parent | 3534b5ce0547790429d40b19bb444e099f6ba1cf (diff) |
MIPS: BCM63xx: Add cpu argument to dispatch internal
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: John Crispin <blogic@openwrt.org>
Cc: Maxime Bizon <mbizon@freebox.fr>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Gregory Fong <gregory.0xf0@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/7320/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/bcm63xx/irq.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/mips/bcm63xx/irq.c b/arch/mips/bcm63xx/irq.c index f467e447bb0e..53be291c3d94 100644 --- a/arch/mips/bcm63xx/irq.c +++ b/arch/mips/bcm63xx/irq.c | |||
@@ -19,9 +19,10 @@ | |||
19 | #include <bcm63xx_io.h> | 19 | #include <bcm63xx_io.h> |
20 | #include <bcm63xx_irq.h> | 20 | #include <bcm63xx_irq.h> |
21 | 21 | ||
22 | |||
22 | static u32 irq_stat_addr[2]; | 23 | static u32 irq_stat_addr[2]; |
23 | static u32 irq_mask_addr[2]; | 24 | static u32 irq_mask_addr[2]; |
24 | static void (*dispatch_internal)(void); | 25 | static void (*dispatch_internal)(int cpu); |
25 | static int is_ext_irq_cascaded; | 26 | static int is_ext_irq_cascaded; |
26 | static unsigned int ext_irq_count; | 27 | static unsigned int ext_irq_count; |
27 | static unsigned int ext_irq_start, ext_irq_end; | 28 | static unsigned int ext_irq_start, ext_irq_end; |
@@ -54,19 +55,20 @@ static inline void handle_internal(int intbit) | |||
54 | */ | 55 | */ |
55 | 56 | ||
56 | #define BUILD_IPIC_INTERNAL(width) \ | 57 | #define BUILD_IPIC_INTERNAL(width) \ |
57 | void __dispatch_internal_##width(void) \ | 58 | void __dispatch_internal_##width(int cpu) \ |
58 | { \ | 59 | { \ |
59 | u32 pending[width / 32]; \ | 60 | u32 pending[width / 32]; \ |
60 | unsigned int src, tgt; \ | 61 | unsigned int src, tgt; \ |
61 | bool irqs_pending = false; \ | 62 | bool irqs_pending = false; \ |
62 | static unsigned int i; \ | 63 | static unsigned int i[2]; \ |
64 | unsigned int *next = &i[cpu]; \ | ||
63 | \ | 65 | \ |
64 | /* read registers in reverse order */ \ | 66 | /* read registers in reverse order */ \ |
65 | for (src = 0, tgt = (width / 32); src < (width / 32); src++) { \ | 67 | for (src = 0, tgt = (width / 32); src < (width / 32); src++) { \ |
66 | u32 val; \ | 68 | u32 val; \ |
67 | \ | 69 | \ |
68 | val = bcm_readl(irq_stat_addr[0] + src * sizeof(u32)); \ | 70 | val = bcm_readl(irq_stat_addr[cpu] + src * sizeof(u32)); \ |
69 | val &= bcm_readl(irq_mask_addr[0] + src * sizeof(u32)); \ | 71 | val &= bcm_readl(irq_mask_addr[cpu] + src * sizeof(u32)); \ |
70 | pending[--tgt] = val; \ | 72 | pending[--tgt] = val; \ |
71 | \ | 73 | \ |
72 | if (val) \ | 74 | if (val) \ |
@@ -77,9 +79,9 @@ void __dispatch_internal_##width(void) \ | |||
77 | return; \ | 79 | return; \ |
78 | \ | 80 | \ |
79 | while (1) { \ | 81 | while (1) { \ |
80 | unsigned int to_call = i; \ | 82 | unsigned int to_call = *next; \ |
81 | \ | 83 | \ |
82 | i = (i + 1) & (width - 1); \ | 84 | *next = (*next + 1) & (width - 1); \ |
83 | if (pending[to_call / 32] & (1 << (to_call & 0x1f))) { \ | 85 | if (pending[to_call / 32] & (1 << (to_call & 0x1f))) { \ |
84 | handle_internal(to_call); \ | 86 | handle_internal(to_call); \ |
85 | break; \ | 87 | break; \ |
@@ -129,7 +131,7 @@ asmlinkage void plat_irq_dispatch(void) | |||
129 | if (cause & CAUSEF_IP1) | 131 | if (cause & CAUSEF_IP1) |
130 | do_IRQ(1); | 132 | do_IRQ(1); |
131 | if (cause & CAUSEF_IP2) | 133 | if (cause & CAUSEF_IP2) |
132 | dispatch_internal(); | 134 | dispatch_internal(0); |
133 | if (!is_ext_irq_cascaded) { | 135 | if (!is_ext_irq_cascaded) { |
134 | if (cause & CAUSEF_IP3) | 136 | if (cause & CAUSEF_IP3) |
135 | do_IRQ(IRQ_EXT_0); | 137 | do_IRQ(IRQ_EXT_0); |