diff options
Diffstat (limited to 'arch/blackfin/mach-bf537/boards/minotaur.c')
-rw-r--r-- | arch/blackfin/mach-bf537/boards/minotaur.c | 183 |
1 files changed, 173 insertions, 10 deletions
diff --git a/arch/blackfin/mach-bf537/boards/minotaur.c b/arch/blackfin/mach-bf537/boards/minotaur.c index 0da927252701..c489d602c590 100644 --- a/arch/blackfin/mach-bf537/boards/minotaur.c +++ b/arch/blackfin/mach-bf537/boards/minotaur.c | |||
@@ -211,25 +211,93 @@ static struct platform_device bfin_spi0_device = { | |||
211 | #endif /* spi master and devices */ | 211 | #endif /* spi master and devices */ |
212 | 212 | ||
213 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 213 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
214 | static struct resource bfin_uart_resources[] = { | 214 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
215 | static struct resource bfin_uart0_resources[] = { | ||
215 | { | 216 | { |
216 | .start = 0xFFC00400, | 217 | .start = UART0_THR, |
217 | .end = 0xFFC004FF, | 218 | .end = UART0_GCTL+2, |
218 | .flags = IORESOURCE_MEM, | 219 | .flags = IORESOURCE_MEM, |
219 | }, { | 220 | }, |
220 | .start = 0xFFC02000, | 221 | { |
221 | .end = 0xFFC020FF, | 222 | .start = IRQ_UART0_RX, |
223 | .end = IRQ_UART0_RX+1, | ||
224 | .flags = IORESOURCE_IRQ, | ||
225 | }, | ||
226 | { | ||
227 | .start = IRQ_UART0_ERROR, | ||
228 | .end = IRQ_UART0_ERROR, | ||
229 | .flags = IORESOURCE_IRQ, | ||
230 | }, | ||
231 | { | ||
232 | .start = CH_UART0_TX, | ||
233 | .end = CH_UART0_TX, | ||
234 | .flags = IORESOURCE_DMA, | ||
235 | }, | ||
236 | { | ||
237 | .start = CH_UART0_RX, | ||
238 | .end = CH_UART0_RX, | ||
239 | .flags = IORESOURCE_DMA, | ||
240 | }, | ||
241 | }; | ||
242 | |||
243 | unsigned short bfin_uart0_peripherals[] = { | ||
244 | P_UART0_TX, P_UART0_RX, 0 | ||
245 | }; | ||
246 | |||
247 | static struct platform_device bfin_uart0_device = { | ||
248 | .name = "bfin-uart", | ||
249 | .id = 0, | ||
250 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
251 | .resource = bfin_uart0_resources, | ||
252 | .dev = { | ||
253 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
254 | }, | ||
255 | }; | ||
256 | #endif | ||
257 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
258 | static struct resource bfin_uart1_resources[] = { | ||
259 | { | ||
260 | .start = UART1_THR, | ||
261 | .end = UART1_GCTL+2, | ||
222 | .flags = IORESOURCE_MEM, | 262 | .flags = IORESOURCE_MEM, |
223 | }, | 263 | }, |
264 | { | ||
265 | .start = IRQ_UART1_RX, | ||
266 | .end = IRQ_UART1_RX+1, | ||
267 | .flags = IORESOURCE_IRQ, | ||
268 | }, | ||
269 | { | ||
270 | .start = IRQ_UART1_ERROR, | ||
271 | .end = IRQ_UART1_ERROR, | ||
272 | .flags = IORESOURCE_IRQ, | ||
273 | }, | ||
274 | { | ||
275 | .start = CH_UART1_TX, | ||
276 | .end = CH_UART1_TX, | ||
277 | .flags = IORESOURCE_DMA, | ||
278 | }, | ||
279 | { | ||
280 | .start = CH_UART1_RX, | ||
281 | .end = CH_UART1_RX, | ||
282 | .flags = IORESOURCE_DMA, | ||
283 | }, | ||
284 | }; | ||
285 | |||
286 | unsigned short bfin_uart1_peripherals[] = { | ||
287 | P_UART1_TX, P_UART1_RX, 0 | ||
224 | }; | 288 | }; |
225 | 289 | ||
226 | static struct platform_device bfin_uart_device = { | 290 | static struct platform_device bfin_uart1_device = { |
227 | .name = "bfin-uart", | 291 | .name = "bfin-uart", |
228 | .id = 1, | 292 | .id = 1, |
229 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 293 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
230 | .resource = bfin_uart_resources, | 294 | .resource = bfin_uart1_resources, |
295 | .dev = { | ||
296 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
297 | }, | ||
231 | }; | 298 | }; |
232 | #endif | 299 | #endif |
300 | #endif | ||
233 | 301 | ||
234 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 302 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
235 | #ifdef CONFIG_BFIN_SIR0 | 303 | #ifdef CONFIG_BFIN_SIR0 |
@@ -309,16 +377,75 @@ static struct platform_device i2c_bfin_twi_device = { | |||
309 | #endif | 377 | #endif |
310 | 378 | ||
311 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 379 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
380 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
381 | static struct resource bfin_sport0_uart_resources[] = { | ||
382 | { | ||
383 | .start = SPORT0_TCR1, | ||
384 | .end = SPORT0_MRCS3+4, | ||
385 | .flags = IORESOURCE_MEM, | ||
386 | }, | ||
387 | { | ||
388 | .start = IRQ_SPORT0_RX, | ||
389 | .end = IRQ_SPORT0_RX+1, | ||
390 | .flags = IORESOURCE_IRQ, | ||
391 | }, | ||
392 | { | ||
393 | .start = IRQ_SPORT0_ERROR, | ||
394 | .end = IRQ_SPORT0_ERROR, | ||
395 | .flags = IORESOURCE_IRQ, | ||
396 | }, | ||
397 | }; | ||
398 | |||
399 | unsigned short bfin_sport0_peripherals[] = { | ||
400 | P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, | ||
401 | P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0 | ||
402 | }; | ||
403 | |||
312 | static struct platform_device bfin_sport0_uart_device = { | 404 | static struct platform_device bfin_sport0_uart_device = { |
313 | .name = "bfin-sport-uart", | 405 | .name = "bfin-sport-uart", |
314 | .id = 0, | 406 | .id = 0, |
407 | .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources), | ||
408 | .resource = bfin_sport0_uart_resources, | ||
409 | .dev = { | ||
410 | .platform_data = &bfin_sport0_peripherals, /* Passed to driver */ | ||
411 | }, | ||
412 | }; | ||
413 | #endif | ||
414 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
415 | static struct resource bfin_sport1_uart_resources[] = { | ||
416 | { | ||
417 | .start = SPORT1_TCR1, | ||
418 | .end = SPORT1_MRCS3+4, | ||
419 | .flags = IORESOURCE_MEM, | ||
420 | }, | ||
421 | { | ||
422 | .start = IRQ_SPORT1_RX, | ||
423 | .end = IRQ_SPORT1_RX+1, | ||
424 | .flags = IORESOURCE_IRQ, | ||
425 | }, | ||
426 | { | ||
427 | .start = IRQ_SPORT1_ERROR, | ||
428 | .end = IRQ_SPORT1_ERROR, | ||
429 | .flags = IORESOURCE_IRQ, | ||
430 | }, | ||
431 | }; | ||
432 | |||
433 | unsigned short bfin_sport1_peripherals[] = { | ||
434 | P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, | ||
435 | P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0 | ||
315 | }; | 436 | }; |
316 | 437 | ||
317 | static struct platform_device bfin_sport1_uart_device = { | 438 | static struct platform_device bfin_sport1_uart_device = { |
318 | .name = "bfin-sport-uart", | 439 | .name = "bfin-sport-uart", |
319 | .id = 1, | 440 | .id = 1, |
441 | .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources), | ||
442 | .resource = bfin_sport1_uart_resources, | ||
443 | .dev = { | ||
444 | .platform_data = &bfin_sport1_peripherals, /* Passed to driver */ | ||
445 | }, | ||
320 | }; | 446 | }; |
321 | #endif | 447 | #endif |
448 | #endif | ||
322 | 449 | ||
323 | static struct platform_device *minotaur_devices[] __initdata = { | 450 | static struct platform_device *minotaur_devices[] __initdata = { |
324 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) | 451 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
@@ -343,7 +470,12 @@ static struct platform_device *minotaur_devices[] __initdata = { | |||
343 | #endif | 470 | #endif |
344 | 471 | ||
345 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 472 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
346 | &bfin_uart_device, | 473 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
474 | &bfin_uart0_device, | ||
475 | #endif | ||
476 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
477 | &bfin_uart1_device, | ||
478 | #endif | ||
347 | #endif | 479 | #endif |
348 | 480 | ||
349 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 481 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
@@ -360,9 +492,13 @@ static struct platform_device *minotaur_devices[] __initdata = { | |||
360 | #endif | 492 | #endif |
361 | 493 | ||
362 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 494 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
495 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
363 | &bfin_sport0_uart_device, | 496 | &bfin_sport0_uart_device, |
497 | #endif | ||
498 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
364 | &bfin_sport1_uart_device, | 499 | &bfin_sport1_uart_device, |
365 | #endif | 500 | #endif |
501 | #endif | ||
366 | 502 | ||
367 | }; | 503 | }; |
368 | 504 | ||
@@ -380,6 +516,33 @@ static int __init minotaur_init(void) | |||
380 | 516 | ||
381 | arch_initcall(minotaur_init); | 517 | arch_initcall(minotaur_init); |
382 | 518 | ||
519 | static struct platform_device *minotaur_early_devices[] __initdata = { | ||
520 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
521 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
522 | &bfin_uart0_device, | ||
523 | #endif | ||
524 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
525 | &bfin_uart1_device, | ||
526 | #endif | ||
527 | #endif | ||
528 | |||
529 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) | ||
530 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
531 | &bfin_sport0_uart_device, | ||
532 | #endif | ||
533 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
534 | &bfin_sport1_uart_device, | ||
535 | #endif | ||
536 | #endif | ||
537 | }; | ||
538 | |||
539 | void __init native_machine_early_platform_add_devices(void) | ||
540 | { | ||
541 | printk(KERN_INFO "register early platform devices\n"); | ||
542 | early_platform_add_devices(minotaur_early_devices, | ||
543 | ARRAY_SIZE(minotaur_early_devices)); | ||
544 | } | ||
545 | |||
383 | void native_machine_restart(char *cmd) | 546 | void native_machine_restart(char *cmd) |
384 | { | 547 | { |
385 | /* workaround reboot hang when booting from SPI */ | 548 | /* workaround reboot hang when booting from SPI */ |