• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * arch/arm/mach-kirkwood/irq.c
3  *
4  * Kirkwood 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 <linux/io.h>
14 #include <mach/bridge-regs.h>
15 #include <plat/orion-gpio.h>
16 #include <plat/irq.h>
17 #include "common.h"
18 
19 static int __initdata gpio0_irqs[4] = {
20 	IRQ_KIRKWOOD_GPIO_LOW_0_7,
21 	IRQ_KIRKWOOD_GPIO_LOW_8_15,
22 	IRQ_KIRKWOOD_GPIO_LOW_16_23,
23 	IRQ_KIRKWOOD_GPIO_LOW_24_31,
24 };
25 
26 static int __initdata gpio1_irqs[4] = {
27 	IRQ_KIRKWOOD_GPIO_HIGH_0_7,
28 	IRQ_KIRKWOOD_GPIO_HIGH_8_15,
29 	IRQ_KIRKWOOD_GPIO_HIGH_16_23,
30 	0,
31 };
32 
kirkwood_init_irq(void)33 void __init kirkwood_init_irq(void)
34 {
35 	orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF);
36 	orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF);
37 
38 	/*
39 	 * Initialize gpiolib for GPIOs 0-49.
40 	 */
41 	orion_gpio_init(NULL, 0, 32, GPIO_LOW_VIRT_BASE, 0,
42 			IRQ_KIRKWOOD_GPIO_START, gpio0_irqs);
43 	orion_gpio_init(NULL, 32, 18, GPIO_HIGH_VIRT_BASE, 0,
44 			IRQ_KIRKWOOD_GPIO_START + 32, gpio1_irqs);
45 }
46