Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 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 | */ |
Russell King | 2f8163b | 2011-07-26 10:53:52 +0100 | [diff] [blame] | 10 | #include <linux/gpio.h> |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 11 | #include <linux/kernel.h> |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 12 | #include <linux/irq.h> |
Thomas Petazzoni | 060f3d1 | 2012-09-11 14:27:19 +0200 | [diff] [blame] | 13 | #include <linux/io.h> |
Nicolas Pitre | fdd8b07 | 2009-04-22 20:08:17 +0100 | [diff] [blame] | 14 | #include <mach/bridge-regs.h> |
Rob Herring | ce91574 | 2012-08-29 10:16:55 -0500 | [diff] [blame] | 15 | #include <plat/orion-gpio.h> |
Lennert Buytenhek | 6f088f1 | 2008-08-09 13:44:58 +0200 | [diff] [blame] | 16 | #include <plat/irq.h> |
Andrew Lunn | d1c925b | 2012-10-20 13:23:15 +0200 | [diff] [blame] | 17 | #include "common.h" |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 18 | |
Andrew Lunn | 278b45b | 2012-06-27 13:40:04 +0200 | [diff] [blame] | 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 | }; |
Lennert Buytenhek | 4c21343 | 2008-10-20 01:51:04 +0200 | [diff] [blame] | 25 | |
Andrew Lunn | 278b45b | 2012-06-27 13:40:04 +0200 | [diff] [blame] | 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 | }; |
Lennert Buytenhek | 4c21343 | 2008-10-20 01:51:04 +0200 | [diff] [blame] | 32 | |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 33 | void __init kirkwood_init_irq(void) |
| 34 | { |
Thomas Petazzoni | 060f3d1 | 2012-09-11 14:27:19 +0200 | [diff] [blame] | 35 | orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF); |
| 36 | orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF); |
Lennert Buytenhek | 4c21343 | 2008-10-20 01:51:04 +0200 | [diff] [blame] | 37 | |
| 38 | /* |
Lennert Buytenhek | 9eac6d0 | 2010-12-14 12:54:03 +0100 | [diff] [blame] | 39 | * Initialize gpiolib for GPIOs 0-49. |
Lennert Buytenhek | 4c21343 | 2008-10-20 01:51:04 +0200 | [diff] [blame] | 40 | */ |
Thomas Petazzoni | 060f3d1 | 2012-09-11 14:27:19 +0200 | [diff] [blame] | 41 | orion_gpio_init(NULL, 0, 32, GPIO_LOW_VIRT_BASE, 0, |
Andrew Lunn | 278b45b | 2012-06-27 13:40:04 +0200 | [diff] [blame] | 42 | IRQ_KIRKWOOD_GPIO_START, gpio0_irqs); |
Thomas Petazzoni | 060f3d1 | 2012-09-11 14:27:19 +0200 | [diff] [blame] | 43 | orion_gpio_init(NULL, 32, 18, GPIO_HIGH_VIRT_BASE, 0, |
Andrew Lunn | 278b45b | 2012-06-27 13:40:04 +0200 | [diff] [blame] | 44 | IRQ_KIRKWOOD_GPIO_START + 32, gpio1_irqs); |
Saeed Bishara | 651c74c | 2008-06-22 22:45:06 +0200 | [diff] [blame] | 45 | } |