Tzachi Perelstein | 3085de6 | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 1 | /* |
Lennert Buytenhek | 9dd0b19 | 2008-03-27 14:51:41 -0400 | [diff] [blame] | 2 | * arch/arm/mach-orion5x/irq.c |
Tzachi Perelstein | 3085de6 | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 3 | * |
| 4 | * Core IRQ functions for Marvell Orion System On Chip |
| 5 | * |
| 6 | * Maintainer: Tzachi Perelstein <tzachi@marvell.com> |
| 7 | * |
| 8 | * This file is licensed under the terms of the GNU General Public |
Lennert Buytenhek | 159ffb3 | 2008-03-27 14:51:41 -0400 | [diff] [blame] | 9 | * License version 2. This program is licensed "as is" without any |
Tzachi Perelstein | 3085de6 | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 10 | * warranty of any kind, whether express or implied. |
| 11 | */ |
| 12 | |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/init.h> |
| 15 | #include <linux/irq.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 16 | #include <linux/io.h> |
Tzachi Perelstein | 3085de6 | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 17 | #include <asm/gpio.h> |
Nicolas Pitre | fdd8b07 | 2009-04-22 20:08:17 +0100 | [diff] [blame] | 18 | #include <mach/bridge-regs.h> |
Lennert Buytenhek | 6f088f1 | 2008-08-09 13:44:58 +0200 | [diff] [blame] | 19 | #include <plat/irq.h> |
Tzachi Perelstein | 3085de6 | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 20 | #include "common.h" |
| 21 | |
Lennert Buytenhek | 0733231 | 2008-10-20 01:51:03 +0200 | [diff] [blame] | 22 | static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc) |
Tzachi Perelstein | f006661 | 2007-11-15 10:57:48 +0200 | [diff] [blame] | 23 | { |
Lennert Buytenhek | 9dd0b19 | 2008-03-27 14:51:41 -0400 | [diff] [blame] | 24 | BUG_ON(irq < IRQ_ORION5X_GPIO_0_7 || irq > IRQ_ORION5X_GPIO_24_31); |
Tzachi Perelstein | 3085de6 | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 25 | |
Lennert Buytenhek | 0733231 | 2008-10-20 01:51:03 +0200 | [diff] [blame] | 26 | orion_gpio_irq_handler((irq - IRQ_ORION5X_GPIO_0_7) << 3); |
Tzachi Perelstein | 3085de6 | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 27 | } |
| 28 | |
Lennert Buytenhek | 0733231 | 2008-10-20 01:51:03 +0200 | [diff] [blame] | 29 | void __init orion5x_init_irq(void) |
Tzachi Perelstein | 3085de6 | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 30 | { |
Lennert Buytenhek | 0733231 | 2008-10-20 01:51:03 +0200 | [diff] [blame] | 31 | orion_irq_init(0, (void __iomem *)MAIN_IRQ_MASK); |
Tzachi Perelstein | 3085de6 | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 32 | |
| 33 | /* |
Lennert Buytenhek | 9eac6d0 | 2010-12-14 12:54:03 +0100 | [diff] [blame] | 34 | * Initialize gpiolib for GPIOs 0-31. |
Tzachi Perelstein | 3085de6 | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 35 | */ |
Lennert Buytenhek | 9eac6d0 | 2010-12-14 12:54:03 +0100 | [diff] [blame] | 36 | orion_gpio_init(0, 32, GPIO_VIRT_BASE, 0, IRQ_ORION5X_GPIO_START); |
Thomas Gleixner | 6845664a | 2011-03-24 13:25:22 +0100 | [diff] [blame^] | 37 | irq_set_chained_handler(IRQ_ORION5X_GPIO_0_7, gpio_irq_handler); |
| 38 | irq_set_chained_handler(IRQ_ORION5X_GPIO_8_15, gpio_irq_handler); |
| 39 | irq_set_chained_handler(IRQ_ORION5X_GPIO_16_23, gpio_irq_handler); |
| 40 | irq_set_chained_handler(IRQ_ORION5X_GPIO_24_31, gpio_irq_handler); |
Tzachi Perelstein | 3085de6 | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 41 | } |