aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf533/boards/stamp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/mach-bf533/boards/stamp.c')
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c174
1 files changed, 164 insertions, 10 deletions
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index 6d68dcfa2da..c457eaa6023 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -184,7 +184,7 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = {
184}; 184};
185#endif 185#endif
186 186
187#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 187#if defined(CONFIG_SND_BLACKFIN_AD183X) || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE)
188static struct bfin5xx_spi_chip ad1836_spi_chip_info = { 188static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
189 .enable_dma = 0, 189 .enable_dma = 0,
190 .bits_per_word = 16, 190 .bits_per_word = 16,
@@ -251,7 +251,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
251 }, 251 },
252#endif 252#endif
253 253
254#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 254#if defined(CONFIG_SND_BLACKFIN_AD183X) || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE)
255 { 255 {
256 .modalias = "ad1836", 256 .modalias = "ad1836",
257 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 257 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -322,21 +322,50 @@ static struct platform_device bfin_spi0_device = {
322#endif /* spi master and devices */ 322#endif /* spi master and devices */
323 323
324#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 324#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
325static struct resource bfin_uart_resources[] = { 325#ifdef CONFIG_SERIAL_BFIN_UART0
326static struct resource bfin_uart0_resources[] = {
326 { 327 {
327 .start = 0xFFC00400, 328 .start = BFIN_UART_THR,
328 .end = 0xFFC004FF, 329 .end = BFIN_UART_GCTL+2,
329 .flags = IORESOURCE_MEM, 330 .flags = IORESOURCE_MEM,
330 }, 331 },
332 {
333 .start = IRQ_UART0_RX,
334 .end = IRQ_UART0_RX + 1,
335 .flags = IORESOURCE_IRQ,
336 },
337 {
338 .start = IRQ_UART0_ERROR,
339 .end = IRQ_UART0_ERROR,
340 .flags = IORESOURCE_IRQ,
341 },
342 {
343 .start = CH_UART0_TX,
344 .end = CH_UART0_TX,
345 .flags = IORESOURCE_DMA,
346 },
347 {
348 .start = CH_UART0_RX,
349 .end = CH_UART0_RX,
350 .flags = IORESOURCE_DMA,
351 },
331}; 352};
332 353
333static struct platform_device bfin_uart_device = { 354unsigned short bfin_uart0_peripherals[] = {
355 P_UART0_TX, P_UART0_RX, 0
356};
357
358static struct platform_device bfin_uart0_device = {
334 .name = "bfin-uart", 359 .name = "bfin-uart",
335 .id = 1, 360 .id = 0,
336 .num_resources = ARRAY_SIZE(bfin_uart_resources), 361 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
337 .resource = bfin_uart_resources, 362 .resource = bfin_uart0_resources,
363 .dev = {
364 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
365 },
338}; 366};
339#endif 367#endif
368#endif
340 369
341#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 370#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
342#ifdef CONFIG_BFIN_SIR0 371#ifdef CONFIG_BFIN_SIR0
@@ -368,16 +397,75 @@ static struct platform_device bfin_sir0_device = {
368#endif 397#endif
369 398
370#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 399#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
400#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
401static struct resource bfin_sport0_uart_resources[] = {
402 {
403 .start = SPORT0_TCR1,
404 .end = SPORT0_MRCS3+4,
405 .flags = IORESOURCE_MEM,
406 },
407 {
408 .start = IRQ_SPORT0_RX,
409 .end = IRQ_SPORT0_RX+1,
410 .flags = IORESOURCE_IRQ,
411 },
412 {
413 .start = IRQ_SPORT0_ERROR,
414 .end = IRQ_SPORT0_ERROR,
415 .flags = IORESOURCE_IRQ,
416 },
417};
418
419unsigned short bfin_sport0_peripherals[] = {
420 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
421 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
422};
423
371static struct platform_device bfin_sport0_uart_device = { 424static struct platform_device bfin_sport0_uart_device = {
372 .name = "bfin-sport-uart", 425 .name = "bfin-sport-uart",
373 .id = 0, 426 .id = 0,
427 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
428 .resource = bfin_sport0_uart_resources,
429 .dev = {
430 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
431 },
432};
433#endif
434#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
435static struct resource bfin_sport1_uart_resources[] = {
436 {
437 .start = SPORT1_TCR1,
438 .end = SPORT1_MRCS3+4,
439 .flags = IORESOURCE_MEM,
440 },
441 {
442 .start = IRQ_SPORT1_RX,
443 .end = IRQ_SPORT1_RX+1,
444 .flags = IORESOURCE_IRQ,
445 },
446 {
447 .start = IRQ_SPORT1_ERROR,
448 .end = IRQ_SPORT1_ERROR,
449 .flags = IORESOURCE_IRQ,
450 },
451};
452
453unsigned short bfin_sport1_peripherals[] = {
454 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
455 P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
374}; 456};
375 457
376static struct platform_device bfin_sport1_uart_device = { 458static struct platform_device bfin_sport1_uart_device = {
377 .name = "bfin-sport-uart", 459 .name = "bfin-sport-uart",
378 .id = 1, 460 .id = 1,
461 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
462 .resource = bfin_sport1_uart_resources,
463 .dev = {
464 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
465 },
379}; 466};
380#endif 467#endif
468#endif
381 469
382#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 470#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
383#include <linux/input.h> 471#include <linux/input.h>
@@ -474,6 +562,30 @@ static struct platform_device bfin_dpmc = {
474 }, 562 },
475}; 563};
476 564
565#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
566static struct platform_device bfin_i2s = {
567 .name = "bfin-i2s",
568 .id = CONFIG_SND_BF5XX_SPORT_NUM,
569 /* TODO: add platform data here */
570};
571#endif
572
573#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
574static struct platform_device bfin_tdm = {
575 .name = "bfin-tdm",
576 .id = CONFIG_SND_BF5XX_SPORT_NUM,
577 /* TODO: add platform data here */
578};
579#endif
580
581#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
582static struct platform_device bfin_ac97 = {
583 .name = "bfin-ac97",
584 .id = CONFIG_SND_BF5XX_SPORT_NUM,
585 /* TODO: add platform data here */
586};
587#endif
588
477static struct platform_device *stamp_devices[] __initdata = { 589static struct platform_device *stamp_devices[] __initdata = {
478 590
479 &bfin_dpmc, 591 &bfin_dpmc,
@@ -495,7 +607,9 @@ static struct platform_device *stamp_devices[] __initdata = {
495#endif 607#endif
496 608
497#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 609#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
498 &bfin_uart_device, 610#ifdef CONFIG_SERIAL_BFIN_UART0
611 &bfin_uart0_device,
612#endif
499#endif 613#endif
500 614
501#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 615#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
@@ -505,9 +619,13 @@ static struct platform_device *stamp_devices[] __initdata = {
505#endif 619#endif
506 620
507#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 621#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
622#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
508 &bfin_sport0_uart_device, 623 &bfin_sport0_uart_device,
624#endif
625#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
509 &bfin_sport1_uart_device, 626 &bfin_sport1_uart_device,
510#endif 627#endif
628#endif
511 629
512#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 630#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
513 &bfin_device_gpiokeys, 631 &bfin_device_gpiokeys,
@@ -520,6 +638,18 @@ static struct platform_device *stamp_devices[] __initdata = {
520#if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE) 638#if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE)
521 &stamp_flash_device, 639 &stamp_flash_device,
522#endif 640#endif
641
642#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
643 &bfin_i2s,
644#endif
645
646#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
647 &bfin_tdm,
648#endif
649
650#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
651 &bfin_ac97,
652#endif
523}; 653};
524 654
525static int __init stamp_init(void) 655static int __init stamp_init(void)
@@ -548,6 +678,30 @@ static int __init stamp_init(void)
548 678
549arch_initcall(stamp_init); 679arch_initcall(stamp_init);
550 680
681static struct platform_device *stamp_early_devices[] __initdata = {
682#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
683#ifdef CONFIG_SERIAL_BFIN_UART0
684 &bfin_uart0_device,
685#endif
686#endif
687
688#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
689#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
690 &bfin_sport0_uart_device,
691#endif
692#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
693 &bfin_sport1_uart_device,
694#endif
695#endif
696};
697
698void __init native_machine_early_platform_add_devices(void)
699{
700 printk(KERN_INFO "register early platform devices\n");
701 early_platform_add_devices(stamp_early_devices,
702 ARRAY_SIZE(stamp_early_devices));
703}
704
551void native_machine_restart(char *cmd) 705void native_machine_restart(char *cmd)
552{ 706{
553 /* workaround pull up on cpld / flash pin not being strong enough */ 707 /* workaround pull up on cpld / flash pin not being strong enough */