diff options
Diffstat (limited to 'arch/blackfin/mach-bf537/boards/tcm_bf537.c')
| -rw-r--r-- | arch/blackfin/mach-bf537/boards/tcm_bf537.c | 187 |
1 files changed, 175 insertions, 12 deletions
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c index 57163b65a4f..4f0a2e72ce4 100644 --- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c +++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c | |||
| @@ -74,7 +74,7 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = { | |||
| 74 | }; | 74 | }; |
| 75 | #endif | 75 | #endif |
| 76 | 76 | ||
| 77 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | 77 | #if defined(CONFIG_SND_BLACKFIN_AD183X) || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE) |
| 78 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | 78 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
| 79 | .enable_dma = 0, | 79 | .enable_dma = 0, |
| 80 | .bits_per_word = 16, | 80 | .bits_per_word = 16, |
| @@ -113,7 +113,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
| 113 | }, | 113 | }, |
| 114 | #endif | 114 | #endif |
| 115 | 115 | ||
| 116 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | 116 | #if defined(CONFIG_SND_BLACKFIN_AD183X) || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE) |
| 117 | { | 117 | { |
| 118 | .modalias = "ad1836", | 118 | .modalias = "ad1836", |
| 119 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | 119 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| @@ -327,25 +327,93 @@ static struct platform_device cm_flash_device = { | |||
| 327 | #endif | 327 | #endif |
| 328 | 328 | ||
| 329 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 329 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 330 | static struct resource bfin_uart_resources[] = { | 330 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 331 | static struct resource bfin_uart0_resources[] = { | ||
| 331 | { | 332 | { |
| 332 | .start = 0xFFC00400, | 333 | .start = UART0_THR, |
| 333 | .end = 0xFFC004FF, | 334 | .end = UART0_GCTL+2, |
| 334 | .flags = IORESOURCE_MEM, | 335 | .flags = IORESOURCE_MEM, |
| 335 | }, { | 336 | }, |
| 336 | .start = 0xFFC02000, | 337 | { |
| 337 | .end = 0xFFC020FF, | 338 | .start = IRQ_UART0_RX, |
| 339 | .end = IRQ_UART0_RX+1, | ||
| 340 | .flags = IORESOURCE_IRQ, | ||
| 341 | }, | ||
| 342 | { | ||
| 343 | .start = IRQ_UART0_ERROR, | ||
| 344 | .end = IRQ_UART0_ERROR, | ||
| 345 | .flags = IORESOURCE_IRQ, | ||
| 346 | }, | ||
| 347 | { | ||
| 348 | .start = CH_UART0_TX, | ||
| 349 | .end = CH_UART0_TX, | ||
| 350 | .flags = IORESOURCE_DMA, | ||
| 351 | }, | ||
| 352 | { | ||
| 353 | .start = CH_UART0_RX, | ||
| 354 | .end = CH_UART0_RX, | ||
| 355 | .flags = IORESOURCE_DMA, | ||
| 356 | }, | ||
| 357 | }; | ||
| 358 | |||
| 359 | unsigned short bfin_uart0_peripherals[] = { | ||
| 360 | P_UART0_TX, P_UART0_RX, 0 | ||
| 361 | }; | ||
| 362 | |||
| 363 | static struct platform_device bfin_uart0_device = { | ||
| 364 | .name = "bfin-uart", | ||
| 365 | .id = 0, | ||
| 366 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
| 367 | .resource = bfin_uart0_resources, | ||
| 368 | .dev = { | ||
| 369 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
| 370 | }, | ||
| 371 | }; | ||
| 372 | #endif | ||
| 373 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
| 374 | static struct resource bfin_uart1_resources[] = { | ||
| 375 | { | ||
| 376 | .start = UART1_THR, | ||
| 377 | .end = UART1_GCTL+2, | ||
| 338 | .flags = IORESOURCE_MEM, | 378 | .flags = IORESOURCE_MEM, |
| 339 | }, | 379 | }, |
| 380 | { | ||
| 381 | .start = IRQ_UART1_RX, | ||
| 382 | .end = IRQ_UART1_RX+1, | ||
| 383 | .flags = IORESOURCE_IRQ, | ||
| 384 | }, | ||
| 385 | { | ||
| 386 | .start = IRQ_UART1_ERROR, | ||
| 387 | .end = IRQ_UART1_ERROR, | ||
| 388 | .flags = IORESOURCE_IRQ, | ||
| 389 | }, | ||
| 390 | { | ||
| 391 | .start = CH_UART1_TX, | ||
| 392 | .end = CH_UART1_TX, | ||
| 393 | .flags = IORESOURCE_DMA, | ||
| 394 | }, | ||
| 395 | { | ||
| 396 | .start = CH_UART1_RX, | ||
| 397 | .end = CH_UART1_RX, | ||
| 398 | .flags = IORESOURCE_DMA, | ||
| 399 | }, | ||
| 400 | }; | ||
| 401 | |||
| 402 | unsigned short bfin_uart1_peripherals[] = { | ||
| 403 | P_UART1_TX, P_UART1_RX, 0 | ||
| 340 | }; | 404 | }; |
| 341 | 405 | ||
| 342 | static struct platform_device bfin_uart_device = { | 406 | static struct platform_device bfin_uart1_device = { |
| 343 | .name = "bfin-uart", | 407 | .name = "bfin-uart", |
| 344 | .id = 1, | 408 | .id = 1, |
| 345 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 409 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
| 346 | .resource = bfin_uart_resources, | 410 | .resource = bfin_uart1_resources, |
| 411 | .dev = { | ||
| 412 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
| 413 | }, | ||
| 347 | }; | 414 | }; |
| 348 | #endif | 415 | #endif |
| 416 | #endif | ||
| 349 | 417 | ||
| 350 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 418 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| 351 | #ifdef CONFIG_BFIN_SIR0 | 419 | #ifdef CONFIG_BFIN_SIR0 |
| @@ -425,16 +493,75 @@ static struct platform_device i2c_bfin_twi_device = { | |||
| 425 | #endif | 493 | #endif |
| 426 | 494 | ||
| 427 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 495 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 496 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
| 497 | static struct resource bfin_sport0_uart_resources[] = { | ||
| 498 | { | ||
| 499 | .start = SPORT0_TCR1, | ||
| 500 | .end = SPORT0_MRCS3+4, | ||
| 501 | .flags = IORESOURCE_MEM, | ||
| 502 | }, | ||
| 503 | { | ||
| 504 | .start = IRQ_SPORT0_RX, | ||
| 505 | .end = IRQ_SPORT0_RX+1, | ||
| 506 | .flags = IORESOURCE_IRQ, | ||
| 507 | }, | ||
| 508 | { | ||
| 509 | .start = IRQ_SPORT0_ERROR, | ||
| 510 | .end = IRQ_SPORT0_ERROR, | ||
| 511 | .flags = IORESOURCE_IRQ, | ||
| 512 | }, | ||
| 513 | }; | ||
| 514 | |||
| 515 | unsigned short bfin_sport0_peripherals[] = { | ||
| 516 | P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, | ||
| 517 | P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0 | ||
| 518 | }; | ||
| 519 | |||
| 428 | static struct platform_device bfin_sport0_uart_device = { | 520 | static struct platform_device bfin_sport0_uart_device = { |
| 429 | .name = "bfin-sport-uart", | 521 | .name = "bfin-sport-uart", |
| 430 | .id = 0, | 522 | .id = 0, |
| 523 | .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources), | ||
| 524 | .resource = bfin_sport0_uart_resources, | ||
| 525 | .dev = { | ||
| 526 | .platform_data = &bfin_sport0_peripherals, /* Passed to driver */ | ||
| 527 | }, | ||
| 528 | }; | ||
| 529 | #endif | ||
| 530 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
| 531 | static struct resource bfin_sport1_uart_resources[] = { | ||
| 532 | { | ||
| 533 | .start = SPORT1_TCR1, | ||
| 534 | .end = SPORT1_MRCS3+4, | ||
| 535 | .flags = IORESOURCE_MEM, | ||
| 536 | }, | ||
| 537 | { | ||
| 538 | .start = IRQ_SPORT1_RX, | ||
| 539 | .end = IRQ_SPORT1_RX+1, | ||
| 540 | .flags = IORESOURCE_IRQ, | ||
| 541 | }, | ||
| 542 | { | ||
| 543 | .start = IRQ_SPORT1_ERROR, | ||
| 544 | .end = IRQ_SPORT1_ERROR, | ||
| 545 | .flags = IORESOURCE_IRQ, | ||
| 546 | }, | ||
| 547 | }; | ||
| 548 | |||
| 549 | unsigned short bfin_sport1_peripherals[] = { | ||
| 550 | P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, | ||
| 551 | P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0 | ||
| 431 | }; | 552 | }; |
| 432 | 553 | ||
| 433 | static struct platform_device bfin_sport1_uart_device = { | 554 | static struct platform_device bfin_sport1_uart_device = { |
| 434 | .name = "bfin-sport-uart", | 555 | .name = "bfin-sport-uart", |
| 435 | .id = 1, | 556 | .id = 1, |
| 557 | .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources), | ||
| 558 | .resource = bfin_sport1_uart_resources, | ||
| 559 | .dev = { | ||
| 560 | .platform_data = &bfin_sport1_peripherals, /* Passed to driver */ | ||
| 561 | }, | ||
| 436 | }; | 562 | }; |
| 437 | #endif | 563 | #endif |
| 564 | #endif | ||
| 438 | 565 | ||
| 439 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) | 566 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
| 440 | static struct platform_device bfin_mii_bus = { | 567 | static struct platform_device bfin_mii_bus = { |
| @@ -524,7 +651,12 @@ static struct platform_device *cm_bf537_devices[] __initdata = { | |||
| 524 | #endif | 651 | #endif |
| 525 | 652 | ||
| 526 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 653 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 527 | &bfin_uart_device, | 654 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 655 | &bfin_uart0_device, | ||
| 656 | #endif | ||
| 657 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
| 658 | &bfin_uart1_device, | ||
| 659 | #endif | ||
| 528 | #endif | 660 | #endif |
| 529 | 661 | ||
| 530 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 662 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| @@ -541,9 +673,13 @@ static struct platform_device *cm_bf537_devices[] __initdata = { | |||
| 541 | #endif | 673 | #endif |
| 542 | 674 | ||
| 543 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 675 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 676 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
| 544 | &bfin_sport0_uart_device, | 677 | &bfin_sport0_uart_device, |
| 678 | #endif | ||
| 679 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
| 545 | &bfin_sport1_uart_device, | 680 | &bfin_sport1_uart_device, |
| 546 | #endif | 681 | #endif |
| 682 | #endif | ||
| 547 | 683 | ||
| 548 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | 684 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 549 | &isp1362_hcd_device, | 685 | &isp1362_hcd_device, |
| @@ -591,6 +727,33 @@ static int __init tcm_bf537_init(void) | |||
| 591 | 727 | ||
| 592 | arch_initcall(tcm_bf537_init); | 728 | arch_initcall(tcm_bf537_init); |
| 593 | 729 | ||
| 730 | static struct platform_device *cm_bf537_early_devices[] __initdata = { | ||
| 731 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
| 732 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
| 733 | &bfin_uart0_device, | ||
| 734 | #endif | ||
| 735 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
| 736 | &bfin_uart1_device, | ||
| 737 | #endif | ||
| 738 | #endif | ||
| 739 | |||
| 740 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) | ||
| 741 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
| 742 | &bfin_sport0_uart_device, | ||
| 743 | #endif | ||
| 744 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
| 745 | &bfin_sport1_uart_device, | ||
| 746 | #endif | ||
| 747 | #endif | ||
| 748 | }; | ||
| 749 | |||
| 750 | void __init native_machine_early_platform_add_devices(void) | ||
| 751 | { | ||
| 752 | printk(KERN_INFO "register early platform devices\n"); | ||
| 753 | early_platform_add_devices(cm_bf537_early_devices, | ||
| 754 | ARRAY_SIZE(cm_bf537_early_devices)); | ||
| 755 | } | ||
| 756 | |||
| 594 | void bfin_get_ether_addr(char *addr) | 757 | void bfin_get_ether_addr(char *addr) |
| 595 | { | 758 | { |
| 596 | random_ether_addr(addr); | 759 | random_ether_addr(addr); |
