blob: 4d720f2aedba878d38e30af4cacbc239b062d7a0 [file] [log] [blame]
Stanislav Samsonov794d15b2008-06-22 22:45:10 +02001/*
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 */
Russell King2f8163b2011-07-26 10:53:52 +010010#include <linux/gpio.h>
Stanislav Samsonov794d15b2008-06-22 22:45:10 +020011#include <linux/kernel.h>
Lennert Buytenhekb95a13d2008-10-20 01:51:04 +020012#include <linux/irq.h>
Nicolas Pitrefdd8b072009-04-22 20:08:17 +010013#include <mach/bridge-regs.h>
Rob Herringce915742012-08-29 10:16:55 -050014#include <plat/orion-gpio.h>
Lennert Buytenhek6f088f12008-08-09 13:44:58 +020015#include <plat/irq.h>
Stanislav Samsonov794d15b2008-06-22 22:45:10 +020016#include "common.h"
17
Andrew Lunn278b45b2012-06-27 13:40:04 +020018static int __initdata gpio0_irqs[4] = {
19 IRQ_MV78XX0_GPIO_0_7,
20 IRQ_MV78XX0_GPIO_8_15,
21 IRQ_MV78XX0_GPIO_16_23,
22 IRQ_MV78XX0_GPIO_24_31,
23};
Lennert Buytenhekb95a13d2008-10-20 01:51:04 +020024
Stanislav Samsonov794d15b2008-06-22 22:45:10 +020025void __init mv78xx0_init_irq(void)
26{
27 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF));
28 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF));
Lennert Buytenhek1f8081f2008-08-26 16:04:05 +020029 orion_irq_init(64, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF));
Lennert Buytenhekb95a13d2008-10-20 01:51:04 +020030
31 /*
Lennert Buytenhek9eac6d02010-12-14 12:54:03 +010032 * Initialize gpiolib for GPIOs 0-31. (The GPIO interrupt mask
33 * registers for core #1 are at an offset of 0x18 from those of
34 * core #0.)
Lennert Buytenhekb95a13d2008-10-20 01:51:04 +020035 */
Andrew Lunn278b45b2012-06-27 13:40:04 +020036 orion_gpio_init(NULL, 0, 32, (void __iomem *)GPIO_VIRT_BASE,
Lennert Buytenhek9eac6d02010-12-14 12:54:03 +010037 mv78xx0_core_index() ? 0x18 : 0,
Andrew Lunn278b45b2012-06-27 13:40:04 +020038 IRQ_MV78XX0_GPIO_START, gpio0_irqs);
Stanislav Samsonov794d15b2008-06-22 22:45:10 +020039}