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>
17 #include <asm/se7780.h>
19 static struct intc2_data intc2_irq_table[] = {
20 { 2, 0, 31, 0, 31, 3 }, /* daughter board EXTINT1 */
21 { 4, 0, 30, 0, 30, 3 }, /* daughter board EXTINT2 */
22 { 6, 0, 29, 0, 29, 3 }, /* daughter board EXTINT3 */
23 { 8, 0, 28, 0, 28, 3 }, /* SMC 91C111 (LAN) */
24 { 10, 0, 27, 0, 27, 3 }, /* daughter board EXTINT4 */
25 { 4, 0, 30, 0, 30, 3 }, /* daughter board EXTINT5 */
26 { 2, 0, 31, 0, 31, 3 }, /* daughter board EXTINT6 */
27 { 2, 0, 31, 0, 31, 3 }, /* daughter board EXTINT7 */
28 { 2, 0, 31, 0, 31, 3 }, /* daughter board EXTINT8 */
29 { 0 , 0, 24, 0, 24, 3 }, /* SM501 */
32 static struct intc2_desc intc2_irq_desc __read_mostly = {
33 .prio_base = 0, /* N/A */
34 .msk_base = 0xffd00044,
35 .mskclr_base = 0xffd00064,
37 .intc2_data = intc2_irq_table,
38 .nr_irqs = ARRAY_SIZE(intc2_irq_table),
41 .name = "INTC2-se7780",
46 * Initialize IRQ setting
48 void __init init_se7780_IRQ(void)
50 /* enable all interrupt at FPGA */
51 ctrl_outw(0, FPGA_INTMSK1);
52 /* mask SM501 interrupt */
53 ctrl_outw((ctrl_inw(FPGA_INTMSK1) | 0x0002), FPGA_INTMSK1);
54 /* enable all interrupt at FPGA */
55 ctrl_outw(0, FPGA_INTMSK2);
57 /* set FPGA INTSEL register */
59 ctrl_outw( ((IRQPIN_SM501 << IRQPOS_SM501) |
60 (IRQPIN_SMC91CX << IRQPOS_SMC91CX)), FPGA_INTSEL1);
63 ctrl_outw(((IRQPIN_EXTINT4 << IRQPOS_EXTINT4) |
64 (IRQPIN_EXTINT3 << IRQPOS_EXTINT3) |
65 (IRQPIN_EXTINT2 << IRQPOS_EXTINT2) |
66 (IRQPIN_EXTINT1 << IRQPOS_EXTINT1)), FPGA_INTSEL2);
69 ctrl_outw((IRQPIN_PCCPW << IRQPOS_PCCPW), FPGA_INTSEL3);
71 register_intc2_controller(&intc2_irq_desc);