Skip to content

Commit f28d7de

Browse files
shesselbaJason Cooper
authored andcommitted
ARM: orion: provide C-style interrupt handler for MULTI_IRQ_HANDLER
DT-enabled Marvell Kirkwood and Dove SoCs make use of an irqchip driver. As expected for irqchip drivers, it uses a C-style interrupt handler and therefore selects MULTI_IRQ_HANDLER. Now, compiling a kernel with both non-DT and DT support enabled, selecting MULTI_IRQ_HANDLER will break ASM irq handler used by non-DT boards. Therefore, we provide a C-style irq handler even for non-DT boards, if MULTI_IRQ_HANDLER is set. By installing the C-style irq handler in orion_irq_init this is transparent to all non-DT board files. While the regression report was filed on Marvell Kirkwood, also Marvell Dove non-DT boards are affected and fixed by this patch. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Ian Campbell <ijc@hellion.org.uk> Reported-by: Ian Campbell <ijc@hellion.org.uk> Cc: <stable@vger.kernel.org> # v3.12+ Fixes: 2326f04 ("ARM: kirkwood: convert to DT irqchip and clocksource") Fixes: f07d73e ("ARM: dove: convert to DT irqchip and clocksource") Acked-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
1 parent f8b94be commit f28d7de

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

arch/arm/plat-orion/irq.c

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,51 @@
1515
#include <linux/io.h>
1616
#include <linux/of_address.h>
1717
#include <linux/of_irq.h>
18+
#include <asm/exception.h>
1819
#include <plat/irq.h>
1920
#include <plat/orion-gpio.h>
21+
#include <mach/bridge-regs.h>
22+
23+
#ifdef CONFIG_MULTI_IRQ_HANDLER
24+
/*
25+
* Compiling with both non-DT and DT support enabled, will
26+
* break asm irq handler used by non-DT boards. Therefore,
27+
* we provide a C-style irq handler even for non-DT boards,
28+
* if MULTI_IRQ_HANDLER is set.
29+
*
30+
* Notes:
31+
* - this is prepared for Kirkwood and Dove only, update
32+
* accordingly if you add Orion5x or MV78x00.
33+
* - Orion5x uses different macro names and has only one
34+
* set of CAUSE/MASK registers.
35+
* - MV78x00 uses the same macro names but has a third
36+
* set of CAUSE/MASK registers.
37+
*
38+
*/
39+
40+
static void __iomem *orion_irq_base = IRQ_VIRT_BASE;
41+
42+
asmlinkage void
43+
__exception_irq_entry orion_legacy_handle_irq(struct pt_regs *regs)
44+
{
45+
u32 stat;
46+
47+
stat = readl_relaxed(orion_irq_base + IRQ_CAUSE_LOW_OFF);
48+
stat &= readl_relaxed(orion_irq_base + IRQ_MASK_LOW_OFF);
49+
if (stat) {
50+
unsigned int hwirq = __fls(stat);
51+
handle_IRQ(hwirq, regs);
52+
return;
53+
}
54+
stat = readl_relaxed(orion_irq_base + IRQ_CAUSE_HIGH_OFF);
55+
stat &= readl_relaxed(orion_irq_base + IRQ_MASK_HIGH_OFF);
56+
if (stat) {
57+
unsigned int hwirq = 32 + __fls(stat);
58+
handle_IRQ(hwirq, regs);
59+
return;
60+
}
61+
}
62+
#endif
2063

2164
void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
2265
{
@@ -35,6 +78,10 @@ void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
3578
ct->chip.irq_unmask = irq_gc_mask_set_bit;
3679
irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_MASK_CACHE,
3780
IRQ_NOREQUEST, IRQ_LEVEL | IRQ_NOPROBE);
81+
82+
#ifdef CONFIG_MULTI_IRQ_HANDLER
83+
set_handle_irq(orion_legacy_handle_irq);
84+
#endif
3885
}
3986

4087
#ifdef CONFIG_OF

0 commit comments

Comments
 (0)