Merge tag 'arc-4.5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
[deliverable/linux.git] / arch / arm / mach-orion5x / irq.c
CommitLineData
3085de6a 1/*
9dd0b194 2 * arch/arm/mach-orion5x/irq.c
3085de6a
TP
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
159ffb3a 9 * License version 2. This program is licensed "as is" without any
3085de6a
TP
10 * warranty of any kind, whether express or implied.
11 */
2f8163ba 12#include <linux/gpio.h>
3085de6a 13#include <linux/kernel.h>
3085de6a 14#include <linux/irq.h>
3904a393 15#include <linux/io.h>
ce91574c 16#include <plat/orion-gpio.h>
6f088f1d 17#include <plat/irq.h>
ab5ab9db 18#include <asm/exception.h>
c22c2c60 19#include "bridge-regs.h"
42366666 20#include "common.h"
3085de6a 21
278b45b0
AL
22static int __initdata gpio0_irqs[4] = {
23 IRQ_ORION5X_GPIO_0_7,
24 IRQ_ORION5X_GPIO_8_15,
25 IRQ_ORION5X_GPIO_16_23,
26 IRQ_ORION5X_GPIO_24_31,
27};
3085de6a 28
ab5ab9db
TP
29asmlinkage void
30__exception_irq_entry orion5x_legacy_handle_irq(struct pt_regs *regs)
31{
32 u32 stat;
33
34 stat = readl_relaxed(MAIN_IRQ_CAUSE);
35 stat &= readl_relaxed(MAIN_IRQ_MASK);
36 if (stat) {
5be9fc23 37 unsigned int hwirq = 1 + __fls(stat);
ab5ab9db
TP
38 handle_IRQ(hwirq, regs);
39 return;
40 }
41}
ab5ab9db 42
07332318 43void __init orion5x_init_irq(void)
3085de6a 44{
5be9fc23 45 orion_irq_init(1, MAIN_IRQ_MASK);
3085de6a 46
ab5ab9db 47 set_handle_irq(orion5x_legacy_handle_irq);
ab5ab9db 48
3085de6a 49 /*
9eac6d0a 50 * Initialize gpiolib for GPIOs 0-31.
3085de6a 51 */
3904a393 52 orion_gpio_init(NULL, 0, 32, GPIO_VIRT_BASE, 0,
278b45b0 53 IRQ_ORION5X_GPIO_START, gpio0_irqs);
3085de6a 54}
This page took 0.501354 seconds and 5 git commands to generate.