diff options
author | Andrew Lunn <andrew@lunn.ch> | 2012-06-27 07:40:04 -0400 |
---|---|---|
committer | Andrew Lunn <andrew@lunn.ch> | 2012-07-27 10:48:14 -0400 |
commit | 278b45b06bf721b7cf5de67a0126786c60c720e6 (patch) | |
tree | 4e2a3af2527110f9328aebca560cf6c1cef32c1c /arch/arm/mach-mv78xx0 | |
parent | 89fb2d77d5daa821e3868ea59963f28249974840 (diff) |
ARM: Orion: DT support for IRQ and GPIO Controllers
Both IRQ and GPIO controllers can now be represented in DT. The IRQ
controllers are setup first, and then the GPIO controllers. Interrupts
for GPIO lines are placed directly after the main interrupts in the
interrupt space.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Josh Coombs <josh.coombs@gmail.com>
Tested-by: Simon Baatz <gmbnomis@gmail.com>
Diffstat (limited to 'arch/arm/mach-mv78xx0')
-rw-r--r-- | arch/arm/mach-mv78xx0/irq.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/arch/arm/mach-mv78xx0/irq.c b/arch/arm/mach-mv78xx0/irq.c index e421b701663b..eff9a750bbe2 100644 --- a/arch/arm/mach-mv78xx0/irq.c +++ b/arch/arm/mach-mv78xx0/irq.c | |||
@@ -9,19 +9,17 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/gpio.h> | 10 | #include <linux/gpio.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | ||
13 | #include <linux/pci.h> | ||
14 | #include <linux/irq.h> | 12 | #include <linux/irq.h> |
15 | #include <mach/bridge-regs.h> | 13 | #include <mach/bridge-regs.h> |
16 | #include <plat/irq.h> | 14 | #include <plat/irq.h> |
17 | #include "common.h" | 15 | #include "common.h" |
18 | 16 | ||
19 | static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 17 | static int __initdata gpio0_irqs[4] = { |
20 | { | 18 | IRQ_MV78XX0_GPIO_0_7, |
21 | BUG_ON(irq < IRQ_MV78XX0_GPIO_0_7 || irq > IRQ_MV78XX0_GPIO_24_31); | 19 | IRQ_MV78XX0_GPIO_8_15, |
22 | 20 | IRQ_MV78XX0_GPIO_16_23, | |
23 | orion_gpio_irq_handler((irq - IRQ_MV78XX0_GPIO_0_7) << 3); | 21 | IRQ_MV78XX0_GPIO_24_31, |
24 | } | 22 | }; |
25 | 23 | ||
26 | void __init mv78xx0_init_irq(void) | 24 | void __init mv78xx0_init_irq(void) |
27 | { | 25 | { |
@@ -34,11 +32,7 @@ void __init mv78xx0_init_irq(void) | |||
34 | * registers for core #1 are at an offset of 0x18 from those of | 32 | * registers for core #1 are at an offset of 0x18 from those of |
35 | * core #0.) | 33 | * core #0.) |
36 | */ | 34 | */ |
37 | orion_gpio_init(0, 32, GPIO_VIRT_BASE, | 35 | orion_gpio_init(NULL, 0, 32, (void __iomem *)GPIO_VIRT_BASE, |
38 | mv78xx0_core_index() ? 0x18 : 0, | 36 | mv78xx0_core_index() ? 0x18 : 0, |
39 | IRQ_MV78XX0_GPIO_START); | 37 | IRQ_MV78XX0_GPIO_START, gpio0_irqs); |
40 | irq_set_chained_handler(IRQ_MV78XX0_GPIO_0_7, gpio_irq_handler); | ||
41 | irq_set_chained_handler(IRQ_MV78XX0_GPIO_8_15, gpio_irq_handler); | ||
42 | irq_set_chained_handler(IRQ_MV78XX0_GPIO_16_23, gpio_irq_handler); | ||
43 | irq_set_chained_handler(IRQ_MV78XX0_GPIO_24_31, gpio_irq_handler); | ||
44 | } | 38 | } |