diff options
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r-- | arch/arm/mach-kirkwood/irq.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/irq.c b/arch/arm/mach-kirkwood/irq.c index 2a97a2e4163c..2c47a8ad0e27 100644 --- a/arch/arm/mach-kirkwood/irq.c +++ b/arch/arm/mach-kirkwood/irq.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * License version 2. This program is licensed "as is" without any | 7 | * License version 2. This program is licensed "as is" without any |
8 | * warranty of any kind, whether express or implied. | 8 | * warranty of any kind, whether express or implied. |
9 | */ | 9 | */ |
10 | #include <asm/exception.h> | ||
10 | #include <linux/gpio.h> | 11 | #include <linux/gpio.h> |
11 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
12 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
@@ -30,11 +31,47 @@ static int __initdata gpio1_irqs[4] = { | |||
30 | 0, | 31 | 0, |
31 | }; | 32 | }; |
32 | 33 | ||
34 | #ifdef CONFIG_MULTI_IRQ_HANDLER | ||
35 | /* | ||
36 | * Compiling with both non-DT and DT support enabled, will | ||
37 | * break asm irq handler used by non-DT boards. Therefore, | ||
38 | * we provide a C-style irq handler even for non-DT boards, | ||
39 | * if MULTI_IRQ_HANDLER is set. | ||
40 | */ | ||
41 | |||
42 | static void __iomem *kirkwood_irq_base = IRQ_VIRT_BASE; | ||
43 | |||
44 | asmlinkage void | ||
45 | __exception_irq_entry kirkwood_legacy_handle_irq(struct pt_regs *regs) | ||
46 | { | ||
47 | u32 stat; | ||
48 | |||
49 | stat = readl_relaxed(kirkwood_irq_base + IRQ_CAUSE_LOW_OFF); | ||
50 | stat &= readl_relaxed(kirkwood_irq_base + IRQ_MASK_LOW_OFF); | ||
51 | if (stat) { | ||
52 | unsigned int hwirq = __fls(stat); | ||
53 | handle_IRQ(hwirq, regs); | ||
54 | return; | ||
55 | } | ||
56 | stat = readl_relaxed(kirkwood_irq_base + IRQ_CAUSE_HIGH_OFF); | ||
57 | stat &= readl_relaxed(kirkwood_irq_base + IRQ_MASK_HIGH_OFF); | ||
58 | if (stat) { | ||
59 | unsigned int hwirq = 32 + __fls(stat); | ||
60 | handle_IRQ(hwirq, regs); | ||
61 | return; | ||
62 | } | ||
63 | } | ||
64 | #endif | ||
65 | |||
33 | void __init kirkwood_init_irq(void) | 66 | void __init kirkwood_init_irq(void) |
34 | { | 67 | { |
35 | orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF); | 68 | orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF); |
36 | orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF); | 69 | orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF); |
37 | 70 | ||
71 | #ifdef CONFIG_MULTI_IRQ_HANDLER | ||
72 | set_handle_irq(kirkwood_legacy_handle_irq); | ||
73 | #endif | ||
74 | |||
38 | /* | 75 | /* |
39 | * Initialize gpiolib for GPIOs 0-49. | 76 | * Initialize gpiolib for GPIOs 0-49. |
40 | */ | 77 | */ |