irq.c 1.2 KB
Newer Older
1
/*
2
 * arch/arm/mach-orion5x/irq.c
3 4 5 6 7 8
 *
 * Core IRQ functions for Marvell Orion System On Chip
 *
 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
 *
 * This file is licensed under the terms of the GNU General Public
9
 * License version 2.  This program is licensed "as is" without any
10 11 12 13 14 15
 * warranty of any kind, whether express or implied.
 */

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/irq.h>
16
#include <linux/io.h>
17
#include <asm/gpio.h>
18
#include <mach/bridge-regs.h>
19
#include <plat/irq.h>
20 21
#include "common.h"

22
static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
23
{
24
	BUG_ON(irq < IRQ_ORION5X_GPIO_0_7 || irq > IRQ_ORION5X_GPIO_24_31);
25

26
	orion_gpio_irq_handler((irq - IRQ_ORION5X_GPIO_0_7) << 3);
27 28
}

29
void __init orion5x_init_irq(void)
30
{
31
	orion_irq_init(0, (void __iomem *)MAIN_IRQ_MASK);
32 33

	/*
34
	 * Initialize gpiolib for GPIOs 0-31.
35
	 */
36
	orion_gpio_init(0, 32, GPIO_VIRT_BASE, 0, IRQ_ORION5X_GPIO_START);
37 38 39 40
	irq_set_chained_handler(IRQ_ORION5X_GPIO_0_7, gpio_irq_handler);
	irq_set_chained_handler(IRQ_ORION5X_GPIO_8_15, gpio_irq_handler);
	irq_set_chained_handler(IRQ_ORION5X_GPIO_16_23, gpio_irq_handler);
	irq_set_chained_handler(IRQ_ORION5X_GPIO_24_31, gpio_irq_handler);
41
}
新手
引导
客服 返回
顶部