2 * linux/arch/sh/boards/se/7780/irq.c
4 * Copyright (C) 2006,2007 Nobuhiro Iwamatsu
6 * Hitachi UL SolutionEngine 7780 Support.
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
12 #include <linux/init.h>
13 #include <linux/irq.h>
14 #include <linux/interrupt.h>
15 #include <linux/irq.h>
17 #include <mach-se/mach/se7780.h>
19 #define INTC_BASE 0xffd00000
20 #define INTC_ICR1 (INTC_BASE+0x1c)
23 * Initialize IRQ setting
25 void __init init_se7780_IRQ(void)
27 /* enable all interrupt at FPGA */
28 ctrl_outw(0, FPGA_INTMSK1);
29 /* mask SM501 interrupt */
30 ctrl_outw((ctrl_inw(FPGA_INTMSK1) | 0x0002), FPGA_INTMSK1);
31 /* enable all interrupt at FPGA */
32 ctrl_outw(0, FPGA_INTMSK2);
34 /* set FPGA INTSEL register */
36 ctrl_outw( ((IRQPIN_SM501 << IRQPOS_SM501) |
37 (IRQPIN_SMC91CX << IRQPOS_SMC91CX)), FPGA_INTSEL1);
40 ctrl_outw(((IRQPIN_EXTINT4 << IRQPOS_EXTINT4) |
41 (IRQPIN_EXTINT3 << IRQPOS_EXTINT3) |
42 (IRQPIN_EXTINT2 << IRQPOS_EXTINT2) |
43 (IRQPIN_EXTINT1 << IRQPOS_EXTINT1)), FPGA_INTSEL2);
46 ctrl_outw((IRQPIN_PCCPW << IRQPOS_PCCPW), FPGA_INTSEL3);
48 plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-7 */
50 /* ICR1: detect low level(for 2ndcut) */
51 ctrl_outl(0xAAAA0000, INTC_ICR1);
54 * FPGA PCISEL register initialize
56 * CPU || SLOT1 | SLOT2 | S-ATA | USB
57 * -------------------------------------
58 * INTA || INTA | INTD | -- | INTB
59 * -------------------------------------
60 * INTB || INTB | INTA | -- | INTC
61 * -------------------------------------
62 * INTC || INTC | INTB | INTA | --
63 * -------------------------------------
64 * INTD || INTD | INTC | -- | INTA
65 * -------------------------------------
67 ctrl_outw(0x0013, FPGA_PCI_INTSEL1);
68 ctrl_outw(0xE402, FPGA_PCI_INTSEL2);