2 * linux/arch/m32r/kernel/setup_oaks32r.c
4 * Setup routines for OAKS32R Board
6 * Copyright (c) 2002-2004 Hiroyuki Kondo, Hirokazu Takata,
7 * Hitoshi Yamamoto, Mamoru Sakugawa
10 #include <linux/config.h>
11 #include <linux/irq.h>
12 #include <linux/kernel.h>
13 #include <linux/init.h>
15 #include <asm/system.h>
19 #define irq2port(x) (M32R_ICU_CR1_PORTL + ((x - 1) * sizeof(unsigned long)))
23 unsigned long icucr; /* ICU Control Register */
25 #endif /* CONFIG_SMP */
27 icu_data_t icu_data[NR_IRQS];
29 static void disable_oaks32r_irq(unsigned int irq)
31 unsigned long port, data;
34 data = icu_data[irq].icucr|M32R_ICUCR_ILEVEL7;
38 static void enable_oaks32r_irq(unsigned int irq)
40 unsigned long port, data;
43 data = icu_data[irq].icucr|M32R_ICUCR_IEN|M32R_ICUCR_ILEVEL6;
47 static void mask_and_ack_mappi(unsigned int irq)
49 disable_oaks32r_irq(irq);
52 static void end_oaks32r_irq(unsigned int irq)
54 enable_oaks32r_irq(irq);
57 static unsigned int startup_oaks32r_irq(unsigned int irq)
59 enable_oaks32r_irq(irq);
63 static void shutdown_oaks32r_irq(unsigned int irq)
68 outl(M32R_ICUCR_ILEVEL7, port);
71 static struct hw_interrupt_type oaks32r_irq_type =
82 void __init init_IRQ(void)
92 /* INT3 : LAN controller (RTL8019AS) */
93 irq_desc[M32R_IRQ_INT3].status = IRQ_DISABLED;
94 irq_desc[M32R_IRQ_INT3].handler = &oaks32r_irq_type;
95 irq_desc[M32R_IRQ_INT3].action = 0;
96 irq_desc[M32R_IRQ_INT3].depth = 1;
97 icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
98 disable_oaks32r_irq(M32R_IRQ_INT3);
99 #endif /* CONFIG_M32R_NE2000 */
101 /* MFT2 : system timer */
102 irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
103 irq_desc[M32R_IRQ_MFT2].handler = &oaks32r_irq_type;
104 irq_desc[M32R_IRQ_MFT2].action = 0;
105 irq_desc[M32R_IRQ_MFT2].depth = 1;
106 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
107 disable_oaks32r_irq(M32R_IRQ_MFT2);
109 #ifdef CONFIG_SERIAL_M32R_SIO
110 /* SIO0_R : uart receive data */
111 irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
112 irq_desc[M32R_IRQ_SIO0_R].handler = &oaks32r_irq_type;
113 irq_desc[M32R_IRQ_SIO0_R].action = 0;
114 irq_desc[M32R_IRQ_SIO0_R].depth = 1;
115 icu_data[M32R_IRQ_SIO0_R].icucr = 0;
116 disable_oaks32r_irq(M32R_IRQ_SIO0_R);
118 /* SIO0_S : uart send data */
119 irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
120 irq_desc[M32R_IRQ_SIO0_S].handler = &oaks32r_irq_type;
121 irq_desc[M32R_IRQ_SIO0_S].action = 0;
122 irq_desc[M32R_IRQ_SIO0_S].depth = 1;
123 icu_data[M32R_IRQ_SIO0_S].icucr = 0;
124 disable_oaks32r_irq(M32R_IRQ_SIO0_S);
126 /* SIO1_R : uart receive data */
127 irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED;
128 irq_desc[M32R_IRQ_SIO1_R].handler = &oaks32r_irq_type;
129 irq_desc[M32R_IRQ_SIO1_R].action = 0;
130 irq_desc[M32R_IRQ_SIO1_R].depth = 1;
131 icu_data[M32R_IRQ_SIO1_R].icucr = 0;
132 disable_oaks32r_irq(M32R_IRQ_SIO1_R);
134 /* SIO1_S : uart send data */
135 irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED;
136 irq_desc[M32R_IRQ_SIO1_S].handler = &oaks32r_irq_type;
137 irq_desc[M32R_IRQ_SIO1_S].action = 0;
138 irq_desc[M32R_IRQ_SIO1_S].depth = 1;
139 icu_data[M32R_IRQ_SIO1_S].icucr = 0;
140 disable_oaks32r_irq(M32R_IRQ_SIO1_S);
141 #endif /* CONFIG_SERIAL_M32R_SIO */