aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf537/boards/cm_bf537e.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/mach-bf537/boards/cm_bf537e.c')
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537e.c116
1 files changed, 110 insertions, 6 deletions
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537e.c b/arch/blackfin/mach-bf537/boards/cm_bf537e.c
index c85f4d770535..d35fc5fe4c2b 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537e.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537e.c
@@ -73,7 +73,7 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = {
73}; 73};
74#endif 74#endif
75 75
76#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 76#if defined(CONFIG_SND_BLACKFIN_AD183X) || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE)
77static struct bfin5xx_spi_chip ad1836_spi_chip_info = { 77static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
78 .enable_dma = 0, 78 .enable_dma = 0,
79 .bits_per_word = 16, 79 .bits_per_word = 16,
@@ -112,7 +112,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
112 }, 112 },
113#endif 113#endif
114 114
115#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 115#if defined(CONFIG_SND_BLACKFIN_AD183X) || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE)
116 { 116 {
117 .modalias = "ad1836", 117 .modalias = "ad1836",
118 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 118 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -329,8 +329,8 @@ static struct platform_device cm_flash_device = {
329#ifdef CONFIG_SERIAL_BFIN_UART0 329#ifdef CONFIG_SERIAL_BFIN_UART0
330static struct resource bfin_uart0_resources[] = { 330static struct resource bfin_uart0_resources[] = {
331 { 331 {
332 .start = 0xFFC00400, 332 .start = UART0_THR,
333 .end = 0xFFC004FF, 333 .end = UART0_GCTL+2,
334 .flags = IORESOURCE_MEM, 334 .flags = IORESOURCE_MEM,
335 }, 335 },
336 { 336 {
@@ -373,18 +373,25 @@ static struct resource bfin_uart0_resources[] = {
373#endif 373#endif
374}; 374};
375 375
376unsigned short bfin_uart0_peripherals[] = {
377 P_UART0_TX, P_UART0_RX, 0
378};
379
376static struct platform_device bfin_uart0_device = { 380static struct platform_device bfin_uart0_device = {
377 .name = "bfin-uart", 381 .name = "bfin-uart",
378 .id = 0, 382 .id = 0,
379 .num_resources = ARRAY_SIZE(bfin_uart0_resources), 383 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
380 .resource = bfin_uart0_resources, 384 .resource = bfin_uart0_resources,
385 .dev = {
386 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
387 },
381}; 388};
382#endif 389#endif
383#ifdef CONFIG_SERIAL_BFIN_UART1 390#ifdef CONFIG_SERIAL_BFIN_UART1
384static struct resource bfin_uart1_resources[] = { 391static struct resource bfin_uart1_resources[] = {
385 { 392 {
386 .start = 0xFFC02000, 393 .start = UART1_THR,
387 .end = 0xFFC020FF, 394 .end = UART1_GCTL+2,
388 .flags = IORESOURCE_MEM, 395 .flags = IORESOURCE_MEM,
389 }, 396 },
390 { 397 {
@@ -427,11 +434,18 @@ static struct resource bfin_uart1_resources[] = {
427#endif 434#endif
428}; 435};
429 436
437unsigned short bfin_uart1_peripherals[] = {
438 P_UART1_TX, P_UART1_RX, 0
439};
440
430static struct platform_device bfin_uart1_device = { 441static struct platform_device bfin_uart1_device = {
431 .name = "bfin-uart", 442 .name = "bfin-uart",
432 .id = 1, 443 .id = 1,
433 .num_resources = ARRAY_SIZE(bfin_uart1_resources), 444 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
434 .resource = bfin_uart1_resources, 445 .resource = bfin_uart1_resources,
446 .dev = {
447 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
448 },
435}; 449};
436#endif 450#endif
437#endif 451#endif
@@ -512,16 +526,75 @@ static struct platform_device i2c_bfin_twi_device = {
512#endif 526#endif
513 527
514#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 528#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
529#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
530static struct resource bfin_sport0_uart_resources[] = {
531 {
532 .start = SPORT0_TCR1,
533 .end = SPORT0_MRCS3+4,
534 .flags = IORESOURCE_MEM,
535 },
536 {
537 .start = IRQ_SPORT0_RX,
538 .end = IRQ_SPORT0_RX+1,
539 .flags = IORESOURCE_IRQ,
540 },
541 {
542 .start = IRQ_SPORT0_ERROR,
543 .end = IRQ_SPORT0_ERROR,
544 .flags = IORESOURCE_IRQ,
545 },
546};
547
548unsigned short bfin_sport0_peripherals[] = {
549 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
550 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
551};
552
515static struct platform_device bfin_sport0_uart_device = { 553static struct platform_device bfin_sport0_uart_device = {
516 .name = "bfin-sport-uart", 554 .name = "bfin-sport-uart",
517 .id = 0, 555 .id = 0,
556 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
557 .resource = bfin_sport0_uart_resources,
558 .dev = {
559 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
560 },
561};
562#endif
563#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
564static struct resource bfin_sport1_uart_resources[] = {
565 {
566 .start = SPORT1_TCR1,
567 .end = SPORT1_MRCS3+4,
568 .flags = IORESOURCE_MEM,
569 },
570 {
571 .start = IRQ_SPORT1_RX,
572 .end = IRQ_SPORT1_RX+1,
573 .flags = IORESOURCE_IRQ,
574 },
575 {
576 .start = IRQ_SPORT1_ERROR,
577 .end = IRQ_SPORT1_ERROR,
578 .flags = IORESOURCE_IRQ,
579 },
580};
581
582unsigned short bfin_sport1_peripherals[] = {
583 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
584 P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
518}; 585};
519 586
520static struct platform_device bfin_sport1_uart_device = { 587static struct platform_device bfin_sport1_uart_device = {
521 .name = "bfin-sport-uart", 588 .name = "bfin-sport-uart",
522 .id = 1, 589 .id = 1,
590 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
591 .resource = bfin_sport1_uart_resources,
592 .dev = {
593 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
594 },
523}; 595};
524#endif 596#endif
597#endif
525 598
526#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 599#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
527static struct platform_device bfin_mii_bus = { 600static struct platform_device bfin_mii_bus = {
@@ -633,9 +706,13 @@ static struct platform_device *cm_bf537e_devices[] __initdata = {
633#endif 706#endif
634 707
635#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 708#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
709#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
636 &bfin_sport0_uart_device, 710 &bfin_sport0_uart_device,
711#endif
712#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
637 &bfin_sport1_uart_device, 713 &bfin_sport1_uart_device,
638#endif 714#endif
715#endif
639 716
640#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 717#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
641 &isp1362_hcd_device, 718 &isp1362_hcd_device,
@@ -683,6 +760,33 @@ static int __init cm_bf537e_init(void)
683 760
684arch_initcall(cm_bf537e_init); 761arch_initcall(cm_bf537e_init);
685 762
763static struct platform_device *cm_bf537e_early_devices[] __initdata = {
764#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
765#ifdef CONFIG_SERIAL_BFIN_UART0
766 &bfin_uart0_device,
767#endif
768#ifdef CONFIG_SERIAL_BFIN_UART1
769 &bfin_uart1_device,
770#endif
771#endif
772
773#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
774#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
775 &bfin_sport0_uart_device,
776#endif
777#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
778 &bfin_sport1_uart_device,
779#endif
780#endif
781};
782
783void __init native_machine_early_platform_add_devices(void)
784{
785 printk(KERN_INFO "register early platform devices\n");
786 early_platform_add_devices(cm_bf537e_early_devices,
787 ARRAY_SIZE(cm_bf537e_early_devices));
788}
789
686void bfin_get_ether_addr(char *addr) 790void bfin_get_ether_addr(char *addr)
687{ 791{
688 random_ether_addr(addr); 792 random_ether_addr(addr);