Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Hirokazu Takata | 3264f97 | 2007-08-01 21:09:31 +0900 | [diff] [blame] | 2 | * linux/arch/m32r/platforms/opsput/setup.c |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
| 4 | * Setup routines for Renesas OPSPUT Board |
| 5 | * |
Hirokazu Takata | 316240f | 2005-07-07 17:59:32 -0700 | [diff] [blame] | 6 | * Copyright (c) 2002-2005 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * Hiroyuki Kondo, Hirokazu Takata, |
| 8 | * Hitoshi Yamamoto, Takeo Takahashi, Mamoru Sakugawa |
| 9 | * |
| 10 | * This file is subject to the terms and conditions of the GNU General |
| 11 | * Public License. See the file "COPYING" in the main directory of this |
| 12 | * archive for more details. |
| 13 | */ |
| 14 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #include <linux/irq.h> |
| 16 | #include <linux/kernel.h> |
| 17 | #include <linux/init.h> |
Russell King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 18 | #include <linux/platform_device.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
| 20 | #include <asm/system.h> |
| 21 | #include <asm/m32r.h> |
| 22 | #include <asm/io.h> |
| 23 | |
| 24 | /* |
| 25 | * OPSP Interrupt Control Unit (Level 1) |
| 26 | */ |
| 27 | #define irq2port(x) (M32R_ICU_CR1_PORTL + ((x - 1) * sizeof(unsigned long))) |
| 28 | |
Al Viro | c51d994 | 2005-08-23 22:47:22 +0100 | [diff] [blame] | 29 | icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | |
| 31 | static void disable_opsput_irq(unsigned int irq) |
| 32 | { |
| 33 | unsigned long port, data; |
| 34 | |
| 35 | port = irq2port(irq); |
| 36 | data = icu_data[irq].icucr|M32R_ICUCR_ILEVEL7; |
| 37 | outl(data, port); |
| 38 | } |
| 39 | |
| 40 | static void enable_opsput_irq(unsigned int irq) |
| 41 | { |
| 42 | unsigned long port, data; |
| 43 | |
| 44 | port = irq2port(irq); |
| 45 | data = icu_data[irq].icucr|M32R_ICUCR_IEN|M32R_ICUCR_ILEVEL6; |
| 46 | outl(data, port); |
| 47 | } |
| 48 | |
| 49 | static void mask_and_ack_opsput(unsigned int irq) |
| 50 | { |
| 51 | disable_opsput_irq(irq); |
| 52 | } |
| 53 | |
| 54 | static void end_opsput_irq(unsigned int irq) |
| 55 | { |
| 56 | enable_opsput_irq(irq); |
| 57 | } |
| 58 | |
| 59 | static unsigned int startup_opsput_irq(unsigned int irq) |
| 60 | { |
| 61 | enable_opsput_irq(irq); |
| 62 | return (0); |
| 63 | } |
| 64 | |
| 65 | static void shutdown_opsput_irq(unsigned int irq) |
| 66 | { |
| 67 | unsigned long port; |
| 68 | |
| 69 | port = irq2port(irq); |
| 70 | outl(M32R_ICUCR_ILEVEL7, port); |
| 71 | } |
| 72 | |
Thomas Gleixner | 189e91f | 2009-06-16 15:33:26 -0700 | [diff] [blame] | 73 | static struct irq_chip opsput_irq_type = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | { |
Thomas Gleixner | d1ea13c | 2010-09-23 18:40:07 +0200 | [diff] [blame] | 75 | .name = "OPSPUT-IRQ", |
Hirokazu Takata | 6f973b0 | 2005-06-21 17:16:13 -0700 | [diff] [blame] | 76 | .startup = startup_opsput_irq, |
| 77 | .shutdown = shutdown_opsput_irq, |
| 78 | .enable = enable_opsput_irq, |
| 79 | .disable = disable_opsput_irq, |
| 80 | .ack = mask_and_ack_opsput, |
| 81 | .end = end_opsput_irq |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | }; |
| 83 | |
| 84 | /* |
| 85 | * Interrupt Control Unit of PLD on OPSPUT (Level 2) |
| 86 | */ |
| 87 | #define irq2pldirq(x) ((x) - OPSPUT_PLD_IRQ_BASE) |
| 88 | #define pldirq2port(x) (unsigned long)((int)PLD_ICUCR1 + \ |
| 89 | (((x) - 1) * sizeof(unsigned short))) |
| 90 | |
| 91 | typedef struct { |
| 92 | unsigned short icucr; /* ICU Control Register */ |
| 93 | } pld_icu_data_t; |
| 94 | |
| 95 | static pld_icu_data_t pld_icu_data[OPSPUT_NUM_PLD_IRQ]; |
| 96 | |
| 97 | static void disable_opsput_pld_irq(unsigned int irq) |
| 98 | { |
| 99 | unsigned long port, data; |
| 100 | unsigned int pldirq; |
| 101 | |
| 102 | pldirq = irq2pldirq(irq); |
| 103 | // disable_opsput_irq(M32R_IRQ_INT1); |
| 104 | port = pldirq2port(pldirq); |
| 105 | data = pld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; |
| 106 | outw(data, port); |
| 107 | } |
| 108 | |
| 109 | static void enable_opsput_pld_irq(unsigned int irq) |
| 110 | { |
| 111 | unsigned long port, data; |
| 112 | unsigned int pldirq; |
| 113 | |
| 114 | pldirq = irq2pldirq(irq); |
| 115 | // enable_opsput_irq(M32R_IRQ_INT1); |
| 116 | port = pldirq2port(pldirq); |
| 117 | data = pld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; |
| 118 | outw(data, port); |
| 119 | } |
| 120 | |
| 121 | static void mask_and_ack_opsput_pld(unsigned int irq) |
| 122 | { |
| 123 | disable_opsput_pld_irq(irq); |
| 124 | // mask_and_ack_opsput(M32R_IRQ_INT1); |
| 125 | } |
| 126 | |
| 127 | static void end_opsput_pld_irq(unsigned int irq) |
| 128 | { |
| 129 | enable_opsput_pld_irq(irq); |
| 130 | end_opsput_irq(M32R_IRQ_INT1); |
| 131 | } |
| 132 | |
| 133 | static unsigned int startup_opsput_pld_irq(unsigned int irq) |
| 134 | { |
| 135 | enable_opsput_pld_irq(irq); |
| 136 | return (0); |
| 137 | } |
| 138 | |
| 139 | static void shutdown_opsput_pld_irq(unsigned int irq) |
| 140 | { |
| 141 | unsigned long port; |
| 142 | unsigned int pldirq; |
| 143 | |
| 144 | pldirq = irq2pldirq(irq); |
| 145 | // shutdown_opsput_irq(M32R_IRQ_INT1); |
| 146 | port = pldirq2port(pldirq); |
| 147 | outw(PLD_ICUCR_ILEVEL7, port); |
| 148 | } |
| 149 | |
Thomas Gleixner | 189e91f | 2009-06-16 15:33:26 -0700 | [diff] [blame] | 150 | static struct irq_chip opsput_pld_irq_type = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | { |
Thomas Gleixner | d1ea13c | 2010-09-23 18:40:07 +0200 | [diff] [blame] | 152 | .name = "OPSPUT-PLD-IRQ", |
Hirokazu Takata | 6f973b0 | 2005-06-21 17:16:13 -0700 | [diff] [blame] | 153 | .startup = startup_opsput_pld_irq, |
| 154 | .shutdown = shutdown_opsput_pld_irq, |
| 155 | .enable = enable_opsput_pld_irq, |
| 156 | .disable = disable_opsput_pld_irq, |
| 157 | .ack = mask_and_ack_opsput_pld, |
| 158 | .end = end_opsput_pld_irq |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 159 | }; |
| 160 | |
| 161 | /* |
| 162 | * Interrupt Control Unit of PLD on OPSPUT-LAN (Level 2) |
| 163 | */ |
| 164 | #define irq2lanpldirq(x) ((x) - OPSPUT_LAN_PLD_IRQ_BASE) |
| 165 | #define lanpldirq2port(x) (unsigned long)((int)OPSPUT_LAN_ICUCR1 + \ |
| 166 | (((x) - 1) * sizeof(unsigned short))) |
| 167 | |
| 168 | static pld_icu_data_t lanpld_icu_data[OPSPUT_NUM_LAN_PLD_IRQ]; |
| 169 | |
| 170 | static void disable_opsput_lanpld_irq(unsigned int irq) |
| 171 | { |
| 172 | unsigned long port, data; |
| 173 | unsigned int pldirq; |
| 174 | |
| 175 | pldirq = irq2lanpldirq(irq); |
| 176 | port = lanpldirq2port(pldirq); |
| 177 | data = lanpld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; |
| 178 | outw(data, port); |
| 179 | } |
| 180 | |
| 181 | static void enable_opsput_lanpld_irq(unsigned int irq) |
| 182 | { |
| 183 | unsigned long port, data; |
| 184 | unsigned int pldirq; |
| 185 | |
| 186 | pldirq = irq2lanpldirq(irq); |
| 187 | port = lanpldirq2port(pldirq); |
| 188 | data = lanpld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; |
| 189 | outw(data, port); |
| 190 | } |
| 191 | |
| 192 | static void mask_and_ack_opsput_lanpld(unsigned int irq) |
| 193 | { |
| 194 | disable_opsput_lanpld_irq(irq); |
| 195 | } |
| 196 | |
| 197 | static void end_opsput_lanpld_irq(unsigned int irq) |
| 198 | { |
| 199 | enable_opsput_lanpld_irq(irq); |
| 200 | end_opsput_irq(M32R_IRQ_INT0); |
| 201 | } |
| 202 | |
| 203 | static unsigned int startup_opsput_lanpld_irq(unsigned int irq) |
| 204 | { |
| 205 | enable_opsput_lanpld_irq(irq); |
| 206 | return (0); |
| 207 | } |
| 208 | |
| 209 | static void shutdown_opsput_lanpld_irq(unsigned int irq) |
| 210 | { |
| 211 | unsigned long port; |
| 212 | unsigned int pldirq; |
| 213 | |
| 214 | pldirq = irq2lanpldirq(irq); |
| 215 | port = lanpldirq2port(pldirq); |
| 216 | outw(PLD_ICUCR_ILEVEL7, port); |
| 217 | } |
| 218 | |
Thomas Gleixner | 189e91f | 2009-06-16 15:33:26 -0700 | [diff] [blame] | 219 | static struct irq_chip opsput_lanpld_irq_type = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | { |
Thomas Gleixner | d1ea13c | 2010-09-23 18:40:07 +0200 | [diff] [blame] | 221 | .name = "OPSPUT-PLD-LAN-IRQ", |
Hirokazu Takata | d93f7de | 2006-12-08 02:35:57 -0800 | [diff] [blame] | 222 | .startup = startup_opsput_lanpld_irq, |
| 223 | .shutdown = shutdown_opsput_lanpld_irq, |
| 224 | .enable = enable_opsput_lanpld_irq, |
| 225 | .disable = disable_opsput_lanpld_irq, |
| 226 | .ack = mask_and_ack_opsput_lanpld, |
| 227 | .end = end_opsput_lanpld_irq |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | }; |
| 229 | |
| 230 | /* |
| 231 | * Interrupt Control Unit of PLD on OPSPUT-LCD (Level 2) |
| 232 | */ |
| 233 | #define irq2lcdpldirq(x) ((x) - OPSPUT_LCD_PLD_IRQ_BASE) |
| 234 | #define lcdpldirq2port(x) (unsigned long)((int)OPSPUT_LCD_ICUCR1 + \ |
| 235 | (((x) - 1) * sizeof(unsigned short))) |
| 236 | |
| 237 | static pld_icu_data_t lcdpld_icu_data[OPSPUT_NUM_LCD_PLD_IRQ]; |
| 238 | |
| 239 | static void disable_opsput_lcdpld_irq(unsigned int irq) |
| 240 | { |
| 241 | unsigned long port, data; |
| 242 | unsigned int pldirq; |
| 243 | |
| 244 | pldirq = irq2lcdpldirq(irq); |
| 245 | port = lcdpldirq2port(pldirq); |
| 246 | data = lcdpld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; |
| 247 | outw(data, port); |
| 248 | } |
| 249 | |
| 250 | static void enable_opsput_lcdpld_irq(unsigned int irq) |
| 251 | { |
| 252 | unsigned long port, data; |
| 253 | unsigned int pldirq; |
| 254 | |
| 255 | pldirq = irq2lcdpldirq(irq); |
| 256 | port = lcdpldirq2port(pldirq); |
| 257 | data = lcdpld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; |
| 258 | outw(data, port); |
| 259 | } |
| 260 | |
| 261 | static void mask_and_ack_opsput_lcdpld(unsigned int irq) |
| 262 | { |
| 263 | disable_opsput_lcdpld_irq(irq); |
| 264 | } |
| 265 | |
| 266 | static void end_opsput_lcdpld_irq(unsigned int irq) |
| 267 | { |
| 268 | enable_opsput_lcdpld_irq(irq); |
| 269 | end_opsput_irq(M32R_IRQ_INT2); |
| 270 | } |
| 271 | |
| 272 | static unsigned int startup_opsput_lcdpld_irq(unsigned int irq) |
| 273 | { |
| 274 | enable_opsput_lcdpld_irq(irq); |
| 275 | return (0); |
| 276 | } |
| 277 | |
| 278 | static void shutdown_opsput_lcdpld_irq(unsigned int irq) |
| 279 | { |
| 280 | unsigned long port; |
| 281 | unsigned int pldirq; |
| 282 | |
| 283 | pldirq = irq2lcdpldirq(irq); |
| 284 | port = lcdpldirq2port(pldirq); |
| 285 | outw(PLD_ICUCR_ILEVEL7, port); |
| 286 | } |
| 287 | |
Thomas Gleixner | 189e91f | 2009-06-16 15:33:26 -0700 | [diff] [blame] | 288 | static struct irq_chip opsput_lcdpld_irq_type = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 289 | { |
| 290 | "OPSPUT-PLD-LCD-IRQ", |
| 291 | startup_opsput_lcdpld_irq, |
| 292 | shutdown_opsput_lcdpld_irq, |
| 293 | enable_opsput_lcdpld_irq, |
| 294 | disable_opsput_lcdpld_irq, |
| 295 | mask_and_ack_opsput_lcdpld, |
| 296 | end_opsput_lcdpld_irq |
| 297 | }; |
| 298 | |
| 299 | void __init init_IRQ(void) |
| 300 | { |
| 301 | #if defined(CONFIG_SMC91X) |
| 302 | /* INT#0: LAN controller on OPSPUT-LAN (SMC91C111)*/ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 303 | set_irq_chip(OPSPUT_LAN_IRQ_LAN, &opsput_lanpld_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 304 | lanpld_icu_data[irq2lanpldirq(OPSPUT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* "H" edge sense */ |
| 305 | disable_opsput_lanpld_irq(OPSPUT_LAN_IRQ_LAN); |
| 306 | #endif /* CONFIG_SMC91X */ |
| 307 | |
| 308 | /* MFT2 : system timer */ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 309 | set_irq_chip(M32R_IRQ_MFT2, &opsput_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 310 | icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; |
| 311 | disable_opsput_irq(M32R_IRQ_MFT2); |
| 312 | |
| 313 | /* SIO0 : receive */ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 314 | set_irq_chip(M32R_IRQ_SIO0_R, &opsput_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 315 | icu_data[M32R_IRQ_SIO0_R].icucr = 0; |
| 316 | disable_opsput_irq(M32R_IRQ_SIO0_R); |
| 317 | |
| 318 | /* SIO0 : send */ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 319 | set_irq_chip(M32R_IRQ_SIO0_S, &opsput_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 320 | icu_data[M32R_IRQ_SIO0_S].icucr = 0; |
| 321 | disable_opsput_irq(M32R_IRQ_SIO0_S); |
| 322 | |
| 323 | /* SIO1 : receive */ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 324 | set_irq_chip(M32R_IRQ_SIO1_R, &opsput_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 325 | icu_data[M32R_IRQ_SIO1_R].icucr = 0; |
| 326 | disable_opsput_irq(M32R_IRQ_SIO1_R); |
| 327 | |
| 328 | /* SIO1 : send */ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 329 | set_irq_chip(M32R_IRQ_SIO1_S, &opsput_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 330 | icu_data[M32R_IRQ_SIO1_S].icucr = 0; |
| 331 | disable_opsput_irq(M32R_IRQ_SIO1_S); |
| 332 | |
| 333 | /* DMA1 : */ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 334 | set_irq_chip(M32R_IRQ_DMA1, &opsput_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 335 | icu_data[M32R_IRQ_DMA1].icucr = 0; |
| 336 | disable_opsput_irq(M32R_IRQ_DMA1); |
| 337 | |
| 338 | #ifdef CONFIG_SERIAL_M32R_PLDSIO |
| 339 | /* INT#1: SIO0 Receive on PLD */ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 340 | set_irq_chip(PLD_IRQ_SIO0_RCV, &opsput_pld_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 341 | pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_RCV)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; |
| 342 | disable_opsput_pld_irq(PLD_IRQ_SIO0_RCV); |
| 343 | |
| 344 | /* INT#1: SIO0 Send on PLD */ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 345 | set_irq_chip(PLD_IRQ_SIO0_SND, &opsput_pld_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 346 | pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_SND)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; |
| 347 | disable_opsput_pld_irq(PLD_IRQ_SIO0_SND); |
| 348 | #endif /* CONFIG_SERIAL_M32R_PLDSIO */ |
| 349 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 350 | /* INT#1: CFC IREQ on PLD */ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 351 | set_irq_chip(PLD_IRQ_CFIREQ, &opsput_pld_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 352 | pld_icu_data[irq2pldirq(PLD_IRQ_CFIREQ)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* 'L' level sense */ |
| 353 | disable_opsput_pld_irq(PLD_IRQ_CFIREQ); |
| 354 | |
| 355 | /* INT#1: CFC Insert on PLD */ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 356 | set_irq_chip(PLD_IRQ_CFC_INSERT, &opsput_pld_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 357 | pld_icu_data[irq2pldirq(PLD_IRQ_CFC_INSERT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD00; /* 'L' edge sense */ |
| 358 | disable_opsput_pld_irq(PLD_IRQ_CFC_INSERT); |
| 359 | |
| 360 | /* INT#1: CFC Eject on PLD */ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 361 | set_irq_chip(PLD_IRQ_CFC_EJECT, &opsput_pld_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 362 | pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* 'H' edge sense */ |
| 363 | disable_opsput_pld_irq(PLD_IRQ_CFC_EJECT); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 364 | |
| 365 | /* |
| 366 | * INT0# is used for LAN, DIO |
| 367 | * We enable it here. |
| 368 | */ |
| 369 | icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11; |
| 370 | enable_opsput_irq(M32R_IRQ_INT0); |
| 371 | |
| 372 | /* |
| 373 | * INT1# is used for UART, MMC, CF Controller in FPGA. |
| 374 | * We enable it here. |
| 375 | */ |
| 376 | icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11; |
| 377 | enable_opsput_irq(M32R_IRQ_INT1); |
| 378 | |
| 379 | #if defined(CONFIG_USB) |
| 380 | outw(USBCR_OTGS, USBCR); /* USBCR: non-OTG */ |
| 381 | |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 382 | set_irq_chip(OPSPUT_LCD_IRQ_USB_INT1, &opsput_lcdpld_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 383 | lcdpld_icu_data[irq2lcdpldirq(OPSPUT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */ |
| 384 | disable_opsput_lcdpld_irq(OPSPUT_LCD_IRQ_USB_INT1); |
| 385 | #endif |
| 386 | /* |
| 387 | * INT2# is used for BAT, USB, AUDIO |
| 388 | * We enable it here. |
| 389 | */ |
| 390 | icu_data[M32R_IRQ_INT2].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; |
| 391 | enable_opsput_irq(M32R_IRQ_INT2); |
| 392 | |
Hirokazu Takata | 316240f | 2005-07-07 17:59:32 -0700 | [diff] [blame] | 393 | #if defined(CONFIG_VIDEO_M32R_AR) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 394 | /* |
| 395 | * INT3# is used for AR |
| 396 | */ |
Thomas Gleixner | 863018a | 2010-09-22 19:13:16 +0200 | [diff] [blame] | 397 | set_irq_chip(M32R_IRQ_INT3, &opsput_irq_type); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 398 | icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; |
| 399 | disable_opsput_irq(M32R_IRQ_INT3); |
Hirokazu Takata | 316240f | 2005-07-07 17:59:32 -0700 | [diff] [blame] | 400 | #endif /* CONFIG_VIDEO_M32R_AR */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 401 | } |
| 402 | |
Hirokazu Takata | 316240f | 2005-07-07 17:59:32 -0700 | [diff] [blame] | 403 | #if defined(CONFIG_SMC91X) |
| 404 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 405 | #define LAN_IOSTART 0x300 |
| 406 | #define LAN_IOEND 0x320 |
| 407 | static struct resource smc91x_resources[] = { |
| 408 | [0] = { |
| 409 | .start = (LAN_IOSTART), |
| 410 | .end = (LAN_IOEND), |
| 411 | .flags = IORESOURCE_MEM, |
| 412 | }, |
| 413 | [1] = { |
| 414 | .start = OPSPUT_LAN_IRQ_LAN, |
| 415 | .end = OPSPUT_LAN_IRQ_LAN, |
| 416 | .flags = IORESOURCE_IRQ, |
| 417 | } |
| 418 | }; |
| 419 | |
| 420 | static struct platform_device smc91x_device = { |
| 421 | .name = "smc91x", |
| 422 | .id = 0, |
| 423 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 424 | .resource = smc91x_resources, |
| 425 | }; |
Hirokazu Takata | 316240f | 2005-07-07 17:59:32 -0700 | [diff] [blame] | 426 | #endif |
| 427 | |
| 428 | #if defined(CONFIG_FB_S1D13XXX) |
| 429 | |
| 430 | #include <video/s1d13xxxfb.h> |
| 431 | #include <asm/s1d13806.h> |
| 432 | |
| 433 | static struct s1d13xxxfb_pdata s1d13xxxfb_data = { |
| 434 | .initregs = s1d13xxxfb_initregs, |
| 435 | .initregssize = ARRAY_SIZE(s1d13xxxfb_initregs), |
| 436 | .platform_init_video = NULL, |
| 437 | #ifdef CONFIG_PM |
| 438 | .platform_suspend_video = NULL, |
| 439 | .platform_resume_video = NULL, |
| 440 | #endif |
| 441 | }; |
| 442 | |
| 443 | static struct resource s1d13xxxfb_resources[] = { |
| 444 | [0] = { |
| 445 | .start = 0x10600000UL, |
| 446 | .end = 0x1073FFFFUL, |
| 447 | .flags = IORESOURCE_MEM, |
| 448 | }, |
| 449 | [1] = { |
| 450 | .start = 0x10400000UL, |
| 451 | .end = 0x104001FFUL, |
| 452 | .flags = IORESOURCE_MEM, |
| 453 | } |
| 454 | }; |
| 455 | |
| 456 | static struct platform_device s1d13xxxfb_device = { |
| 457 | .name = S1D_DEVICENAME, |
| 458 | .id = 0, |
| 459 | .dev = { |
| 460 | .platform_data = &s1d13xxxfb_data, |
| 461 | }, |
| 462 | .num_resources = ARRAY_SIZE(s1d13xxxfb_resources), |
| 463 | .resource = s1d13xxxfb_resources, |
| 464 | }; |
| 465 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 466 | |
| 467 | static int __init platform_init(void) |
| 468 | { |
Hirokazu Takata | 316240f | 2005-07-07 17:59:32 -0700 | [diff] [blame] | 469 | #if defined(CONFIG_SMC91X) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 470 | platform_device_register(&smc91x_device); |
Hirokazu Takata | 316240f | 2005-07-07 17:59:32 -0700 | [diff] [blame] | 471 | #endif |
| 472 | #if defined(CONFIG_FB_S1D13XXX) |
| 473 | platform_device_register(&s1d13xxxfb_device); |
| 474 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 475 | return 0; |
| 476 | } |
| 477 | arch_initcall(platform_init); |