diff options
author | Andrew Bresticker <abrestic@chromium.org> | 2014-09-18 17:47:09 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-11-24 01:44:52 -0500 |
commit | 85f7cdacbb81db8c4cc8e474837eab1f0e4ff77b (patch) | |
tree | e03c8ec32a24209632b607657da0c8bbd6b28d31 /arch/mips/kernel/irq_cpu.c | |
parent | afe8dc254711b72ba8144295f4a8fcc66d30572d (diff) |
MIPS: Provide a generic plat_irq_dispatch
For platforms which boot with device-tree or have correctly chained
all external interrupt controllers, a generic plat_irq_dispatch() can
be used. Implement a plat_irq_dispatch() which simply handles all the
pending interrupts as reported by C0_Cause.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Qais Yousef <qais.yousef@imgtec.com>
Tested-by: Qais Yousef <qais.yousef@imgtec.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Bresticker <abrestic@chromium.org>
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Qais Yousef <qais.yousef@imgtec.com>
Cc: Jonas Gorski <jogo@openwrt.org>
Cc: John Crispin <blogic@openwrt.org>
Cc: David Daney <ddaney.cavm@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7801/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/irq_cpu.c')
-rw-r--r-- | arch/mips/kernel/irq_cpu.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/mips/kernel/irq_cpu.c b/arch/mips/kernel/irq_cpu.c index ca98a9f837d4..531b11cbc096 100644 --- a/arch/mips/kernel/irq_cpu.c +++ b/arch/mips/kernel/irq_cpu.c | |||
@@ -94,6 +94,24 @@ static struct irq_chip mips_mt_cpu_irq_controller = { | |||
94 | .irq_eoi = unmask_mips_irq, | 94 | .irq_eoi = unmask_mips_irq, |
95 | }; | 95 | }; |
96 | 96 | ||
97 | asmlinkage void __weak plat_irq_dispatch(void) | ||
98 | { | ||
99 | unsigned long pending = read_c0_cause() & read_c0_status() & ST0_IM; | ||
100 | int irq; | ||
101 | |||
102 | if (!pending) { | ||
103 | spurious_interrupt(); | ||
104 | return; | ||
105 | } | ||
106 | |||
107 | pending >>= CAUSEB_IP; | ||
108 | while (pending) { | ||
109 | irq = fls(pending) - 1; | ||
110 | do_IRQ(MIPS_CPU_IRQ_BASE + irq); | ||
111 | pending &= ~BIT(irq); | ||
112 | } | ||
113 | } | ||
114 | |||
97 | static int mips_cpu_intc_map(struct irq_domain *d, unsigned int irq, | 115 | static int mips_cpu_intc_map(struct irq_domain *d, unsigned int irq, |
98 | irq_hw_number_t hw) | 116 | irq_hw_number_t hw) |
99 | { | 117 | { |