2 * arch/arm/mach-dove/irq.c
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
10 #include <linux/init.h>
11 #include <linux/irq.h>
13 #include <asm/exception.h>
16 #include <plat/orion-gpio.h>
19 #include "bridge-regs.h"
22 static int __initdata gpio0_irqs
[4] = {
29 static int __initdata gpio1_irqs
[4] = {
36 static int __initdata gpio2_irqs
[4] = {
43 static void __iomem
*dove_irq_base
= IRQ_VIRT_BASE
;
45 static asmlinkage
void
46 __exception_irq_entry
dove_legacy_handle_irq(struct pt_regs
*regs
)
50 stat
= readl_relaxed(dove_irq_base
+ IRQ_CAUSE_LOW_OFF
);
51 stat
&= readl_relaxed(dove_irq_base
+ IRQ_MASK_LOW_OFF
);
53 unsigned int hwirq
= 1 + __fls(stat
);
54 handle_IRQ(hwirq
, regs
);
57 stat
= readl_relaxed(dove_irq_base
+ IRQ_CAUSE_HIGH_OFF
);
58 stat
&= readl_relaxed(dove_irq_base
+ IRQ_MASK_HIGH_OFF
);
60 unsigned int hwirq
= 33 + __fls(stat
);
61 handle_IRQ(hwirq
, regs
);
66 void __init
dove_init_irq(void)
68 orion_irq_init(1, IRQ_VIRT_BASE
+ IRQ_MASK_LOW_OFF
);
69 orion_irq_init(33, IRQ_VIRT_BASE
+ IRQ_MASK_HIGH_OFF
);
71 set_handle_irq(dove_legacy_handle_irq
);
74 * Initialize gpiolib for GPIOs 0-71.
76 orion_gpio_init(NULL
, 0, 32, DOVE_GPIO_LO_VIRT_BASE
, 0,
77 IRQ_DOVE_GPIO_START
, gpio0_irqs
);
79 orion_gpio_init(NULL
, 32, 32, DOVE_GPIO_HI_VIRT_BASE
, 0,
80 IRQ_DOVE_GPIO_START
+ 32, gpio1_irqs
);
82 orion_gpio_init(NULL
, 64, 8, DOVE_GPIO2_VIRT_BASE
, 0,
83 IRQ_DOVE_GPIO_START
+ 64, gpio2_irqs
);