aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-dove
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-04-22 17:26:26 -0400
committerJason Cooper <jason@lakedaemon.net>2014-04-26 15:45:06 -0400
commitdeac3d874ea1e1ef50604cec33ddfb01edb0c976 (patch)
tree7524fce14d00fb8d76cb56ac453f36517889d3fd /arch/arm/mach-dove
parent0180ed45da5198e0e7362c56b3a107d3278666f6 (diff)
ARM: orion: switch to a per-platform handle_irq() function
Moving to the Device Tree implies having CONFIG_MULTI_IRQ_HANDLER enabled, even for non-DT platforms (if we want both DT and non-DT platforms to be supported in a single kernel). However, the common CONFIG_MULTI_IRQ_HANDLER handler for non-DT platforms in plat-orion/irq.c doesn't match the needs of Orion5x. Also, it doesn't make much sense for orion_irq_init() to register the multi-IRQ handler: orion_irq_init() is called once for each IRQ cause/mask tuple, while the multi-IRQ handler only needs to be registered once. To solve this problem, we move the multi-IRQ handle in per-platform code: mach-kirkwood/irq.c and mach-dove/irq.c. The Orion5x variant will be introduced in a followup commit. Of course, this code will ultimately be completely removed once all boards are converted to the Device Tree. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Link: https://lkml.kernel.org/r/1398202002-28530-23-git-send-email-thomas.petazzoni@free-electrons.com Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch/arm/mach-dove')
-rw-r--r--arch/arm/mach-dove/irq.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c
index bc4344aa1009..4a5a7aedcb76 100644
--- a/arch/arm/mach-dove/irq.c
+++ b/arch/arm/mach-dove/irq.c
@@ -108,6 +108,38 @@ static int __initdata gpio2_irqs[4] = {
108 0, 108 0,
109}; 109};
110 110
111#ifdef CONFIG_MULTI_IRQ_HANDLER
112/*
113 * Compiling with both non-DT and DT support enabled, will
114 * break asm irq handler used by non-DT boards. Therefore,
115 * we provide a C-style irq handler even for non-DT boards,
116 * if MULTI_IRQ_HANDLER is set.
117 */
118
119static void __iomem *dove_irq_base = IRQ_VIRT_BASE;
120
121static asmlinkage void
122__exception_irq_entry dove_legacy_handle_irq(struct pt_regs *regs)
123{
124 u32 stat;
125
126 stat = readl_relaxed(dove_irq_base + IRQ_CAUSE_LOW_OFF);
127 stat &= readl_relaxed(dove_irq_base + IRQ_MASK_LOW_OFF);
128 if (stat) {
129 unsigned int hwirq = __fls(stat);
130 handle_IRQ(hwirq, regs);
131 return;
132 }
133 stat = readl_relaxed(dove_irq_base + IRQ_CAUSE_HIGH_OFF);
134 stat &= readl_relaxed(dove_irq_base + IRQ_MASK_HIGH_OFF);
135 if (stat) {
136 unsigned int hwirq = 32 + __fls(stat);
137 handle_IRQ(hwirq, regs);
138 return;
139 }
140}
141#endif
142
111void __init dove_init_irq(void) 143void __init dove_init_irq(void)
112{ 144{
113 int i; 145 int i;
@@ -115,6 +147,10 @@ void __init dove_init_irq(void)
115 orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF); 147 orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF);
116 orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF); 148 orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF);
117 149
150#ifdef CONFIG_MULTI_IRQ_HANDLER
151 set_handle_irq(dove_legacy_handle_irq);
152#endif
153
118 /* 154 /*
119 * Initialize gpiolib for GPIOs 0-71. 155 * Initialize gpiolib for GPIOs 0-71.
120 */ 156 */