]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/sh/boards/se/7780/irq.c
87491474600907cec7ced860f9ac5a7f284ca68c
[karo-tx-linux.git] / arch / sh / boards / se / 7780 / irq.c
1 /*
2  * linux/arch/sh/boards/se/7780/irq.c
3  *
4  * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
5  *
6  * Hitachi UL SolutionEngine 7780 Support.
7  *
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
10  * for more details.
11  */
12 #include <linux/init.h>
13 #include <linux/irq.h>
14 #include <linux/interrupt.h>
15 #include <asm/irq.h>
16 #include <asm/io.h>
17 #include <asm/se7780.h>
18
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 */
30 };
31
32 static struct intc2_desc intc2_irq_desc __read_mostly = {
33         .prio_base      = 0, /* N/A */
34         .msk_base       = 0xffd00044,
35         .mskclr_base    = 0xffd00064,
36
37         .intc2_data     = intc2_irq_table,
38         .nr_irqs        = ARRAY_SIZE(intc2_irq_table),
39
40         .chip = {
41                 .name   = "INTC2-se7780",
42         },
43 };
44
45 /*
46  * Initialize IRQ setting
47  */
48 void __init init_se7780_IRQ(void)
49 {
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);
56
57         /* set FPGA INTSEL register */
58         /* FPGA + 0x06 */
59         ctrl_outw( ((IRQPIN_SM501 << IRQPOS_SM501) |
60                 (IRQPIN_SMC91CX << IRQPOS_SMC91CX)), FPGA_INTSEL1);
61
62         /* FPGA + 0x08 */
63         ctrl_outw(((IRQPIN_EXTINT4 << IRQPOS_EXTINT4) |
64                 (IRQPIN_EXTINT3 << IRQPOS_EXTINT3) |
65                 (IRQPIN_EXTINT2 << IRQPOS_EXTINT2) |
66                 (IRQPIN_EXTINT1 << IRQPOS_EXTINT1)), FPGA_INTSEL2);
67
68         /* FPGA + 0x0A */
69         ctrl_outw((IRQPIN_PCCPW << IRQPOS_PCCPW), FPGA_INTSEL3);
70
71         register_intc2_controller(&intc2_irq_desc);
72 }