xref: /linux/arch/arm/mach-mv78xx0/irq.c (revision 9429ec96c2718c0d1e3317cf60a87a0405223814)
1 /*
2  * arch/arm/mach-mv78xx0/irq.c
3  *
4  * MV78xx0 IRQ handling.
5  *
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.
9  */
10 #include <linux/gpio.h>
11 #include <linux/kernel.h>
12 #include <linux/irq.h>
13 #include <mach/bridge-regs.h>
14 #include <plat/irq.h>
15 #include "common.h"
16 
17 static int __initdata gpio0_irqs[4] = {
18 	IRQ_MV78XX0_GPIO_0_7,
19 	IRQ_MV78XX0_GPIO_8_15,
20 	IRQ_MV78XX0_GPIO_16_23,
21 	IRQ_MV78XX0_GPIO_24_31,
22 };
23 
24 void __init mv78xx0_init_irq(void)
25 {
26 	orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF));
27 	orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF));
28 	orion_irq_init(64, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF));
29 
30 	/*
31 	 * Initialize gpiolib for GPIOs 0-31.  (The GPIO interrupt mask
32 	 * registers for core #1 are at an offset of 0x18 from those of
33 	 * core #0.)
34 	 */
35 	orion_gpio_init(NULL, 0, 32, (void __iomem *)GPIO_VIRT_BASE,
36 			mv78xx0_core_index() ? 0x18 : 0,
37 			IRQ_MV78XX0_GPIO_START, gpio0_irqs);
38 }
39