diff options
Diffstat (limited to 'arch/blackfin/mach-bf527/boards/cm_bf527.c')
| -rw-r--r-- | arch/blackfin/mach-bf527/boards/cm_bf527.c | 245 |
1 files changed, 183 insertions, 62 deletions
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c index 7ab0800e2914..ebe76d1e874a 100644 --- a/arch/blackfin/mach-bf527/boards/cm_bf527.c +++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
| 19 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
| 20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
| 21 | #include <linux/usb/sl811.h> | ||
| 22 | #include <linux/usb/musb.h> | 21 | #include <linux/usb/musb.h> |
| 23 | #include <asm/dma.h> | 22 | #include <asm/dma.h> |
| 24 | #include <asm/bfin5xx_spi.h> | 23 | #include <asm/bfin5xx_spi.h> |
| @@ -270,50 +269,6 @@ static struct platform_device dm9000_device = { | |||
| 270 | }; | 269 | }; |
| 271 | #endif | 270 | #endif |
| 272 | 271 | ||
| 273 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) | ||
| 274 | static struct resource sl811_hcd_resources[] = { | ||
| 275 | { | ||
| 276 | .start = 0x20340000, | ||
| 277 | .end = 0x20340000, | ||
| 278 | .flags = IORESOURCE_MEM, | ||
| 279 | }, { | ||
| 280 | .start = 0x20340004, | ||
| 281 | .end = 0x20340004, | ||
| 282 | .flags = IORESOURCE_MEM, | ||
| 283 | }, { | ||
| 284 | .start = CONFIG_USB_SL811_BFIN_IRQ, | ||
| 285 | .end = CONFIG_USB_SL811_BFIN_IRQ, | ||
| 286 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
| 287 | }, | ||
| 288 | }; | ||
| 289 | |||
| 290 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | ||
| 291 | void sl811_port_power(struct device *dev, int is_on) | ||
| 292 | { | ||
| 293 | gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS"); | ||
| 294 | gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on); | ||
| 295 | } | ||
| 296 | #endif | ||
| 297 | |||
| 298 | static struct sl811_platform_data sl811_priv = { | ||
| 299 | .potpg = 10, | ||
| 300 | .power = 250, /* == 500mA */ | ||
| 301 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | ||
| 302 | .port_power = &sl811_port_power, | ||
| 303 | #endif | ||
| 304 | }; | ||
| 305 | |||
| 306 | static struct platform_device sl811_hcd_device = { | ||
| 307 | .name = "sl811-hcd", | ||
| 308 | .id = 0, | ||
| 309 | .dev = { | ||
| 310 | .platform_data = &sl811_priv, | ||
| 311 | }, | ||
| 312 | .num_resources = ARRAY_SIZE(sl811_hcd_resources), | ||
| 313 | .resource = sl811_hcd_resources, | ||
| 314 | }; | ||
| 315 | #endif | ||
| 316 | |||
| 317 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) | 272 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
| 318 | static struct platform_device bfin_mii_bus = { | 273 | static struct platform_device bfin_mii_bus = { |
| 319 | .name = "bfin_mii_bus", | 274 | .name = "bfin_mii_bus", |
| @@ -384,8 +339,8 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = { | |||
| 384 | }; | 339 | }; |
| 385 | #endif | 340 | #endif |
| 386 | 341 | ||
| 387 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ | 342 | #if defined(CONFIG_SND_BLACKFIN_AD183X) \ |
| 388 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | 343 | || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE) |
| 389 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | 344 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
| 390 | .enable_dma = 0, | 345 | .enable_dma = 0, |
| 391 | .bits_per_word = 16, | 346 | .bits_per_word = 16, |
| @@ -462,8 +417,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
| 462 | }, | 417 | }, |
| 463 | #endif | 418 | #endif |
| 464 | 419 | ||
| 465 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ | 420 | #if defined(CONFIG_SND_BLACKFIN_AD183X) \ |
| 466 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | 421 | || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE) |
| 467 | { | 422 | { |
| 468 | .modalias = "ad1836", | 423 | .modalias = "ad1836", |
| 469 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | 424 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| @@ -603,30 +558,105 @@ static struct platform_device cm_flash_device = { | |||
| 603 | #endif | 558 | #endif |
| 604 | 559 | ||
| 605 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 560 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 606 | static struct resource bfin_uart_resources[] = { | ||
| 607 | #ifdef CONFIG_SERIAL_BFIN_UART0 | 561 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 562 | static struct resource bfin_uart0_resources[] = { | ||
| 608 | { | 563 | { |
| 609 | .start = 0xFFC00400, | 564 | .start = UART0_THR, |
| 610 | .end = 0xFFC004FF, | 565 | .end = UART0_GCTL+2, |
| 611 | .flags = IORESOURCE_MEM, | 566 | .flags = IORESOURCE_MEM, |
| 612 | }, | 567 | }, |
| 568 | { | ||
| 569 | .start = IRQ_UART0_RX, | ||
| 570 | .end = IRQ_UART0_RX+1, | ||
| 571 | .flags = IORESOURCE_IRQ, | ||
| 572 | }, | ||
| 573 | { | ||
| 574 | .start = IRQ_UART0_ERROR, | ||
| 575 | .end = IRQ_UART0_ERROR, | ||
| 576 | .flags = IORESOURCE_IRQ, | ||
| 577 | }, | ||
| 578 | { | ||
| 579 | .start = CH_UART0_TX, | ||
| 580 | .end = CH_UART0_TX, | ||
| 581 | .flags = IORESOURCE_DMA, | ||
| 582 | }, | ||
| 583 | { | ||
| 584 | .start = CH_UART0_RX, | ||
| 585 | .end = CH_UART0_RX, | ||
| 586 | .flags = IORESOURCE_DMA, | ||
| 587 | }, | ||
| 588 | }; | ||
| 589 | |||
| 590 | unsigned short bfin_uart0_peripherals[] = { | ||
| 591 | P_UART0_TX, P_UART0_RX, 0 | ||
| 592 | }; | ||
| 593 | |||
| 594 | static struct platform_device bfin_uart0_device = { | ||
| 595 | .name = "bfin-uart", | ||
| 596 | .id = 0, | ||
| 597 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
| 598 | .resource = bfin_uart0_resources, | ||
| 599 | .dev = { | ||
| 600 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
| 601 | }, | ||
| 602 | }; | ||
| 613 | #endif | 603 | #endif |
| 614 | #ifdef CONFIG_SERIAL_BFIN_UART1 | 604 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 605 | static struct resource bfin_uart1_resources[] = { | ||
| 615 | { | 606 | { |
| 616 | .start = 0xFFC02000, | 607 | .start = UART1_THR, |
| 617 | .end = 0xFFC020FF, | 608 | .end = UART1_GCTL+2, |
| 618 | .flags = IORESOURCE_MEM, | 609 | .flags = IORESOURCE_MEM, |
| 619 | }, | 610 | }, |
| 611 | { | ||
| 612 | .start = IRQ_UART1_RX, | ||
| 613 | .end = IRQ_UART1_RX+1, | ||
| 614 | .flags = IORESOURCE_IRQ, | ||
| 615 | }, | ||
| 616 | { | ||
| 617 | .start = IRQ_UART1_ERROR, | ||
| 618 | .end = IRQ_UART1_ERROR, | ||
| 619 | .flags = IORESOURCE_IRQ, | ||
| 620 | }, | ||
| 621 | { | ||
| 622 | .start = CH_UART1_TX, | ||
| 623 | .end = CH_UART1_TX, | ||
| 624 | .flags = IORESOURCE_DMA, | ||
| 625 | }, | ||
| 626 | { | ||
| 627 | .start = CH_UART1_RX, | ||
| 628 | .end = CH_UART1_RX, | ||
| 629 | .flags = IORESOURCE_DMA, | ||
| 630 | }, | ||
| 631 | #ifdef CONFIG_BFIN_UART1_CTSRTS | ||
| 632 | { /* CTS pin */ | ||
| 633 | .start = GPIO_PF9, | ||
| 634 | .end = GPIO_PF9, | ||
| 635 | .flags = IORESOURCE_IO, | ||
| 636 | }, | ||
| 637 | { /* RTS pin */ | ||
| 638 | .start = GPIO_PF10, | ||
| 639 | .end = GPIO_PF10, | ||
| 640 | .flags = IORESOURCE_IO, | ||
| 641 | }, | ||
| 620 | #endif | 642 | #endif |
| 621 | }; | 643 | }; |
| 622 | 644 | ||
| 623 | static struct platform_device bfin_uart_device = { | 645 | unsigned short bfin_uart1_peripherals[] = { |
| 646 | P_UART1_TX, P_UART1_RX, 0 | ||
| 647 | }; | ||
| 648 | |||
| 649 | static struct platform_device bfin_uart1_device = { | ||
| 624 | .name = "bfin-uart", | 650 | .name = "bfin-uart", |
| 625 | .id = 1, | 651 | .id = 1, |
| 626 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 652 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
| 627 | .resource = bfin_uart_resources, | 653 | .resource = bfin_uart1_resources, |
| 654 | .dev = { | ||
| 655 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
| 656 | }, | ||
| 628 | }; | 657 | }; |
| 629 | #endif | 658 | #endif |
| 659 | #endif | ||
| 630 | 660 | ||
| 631 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 661 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| 632 | #ifdef CONFIG_BFIN_SIR0 | 662 | #ifdef CONFIG_BFIN_SIR0 |
| @@ -725,16 +755,75 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = { | |||
| 725 | }; | 755 | }; |
| 726 | 756 | ||
| 727 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 757 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 758 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
| 759 | static struct resource bfin_sport0_uart_resources[] = { | ||
| 760 | { | ||
| 761 | .start = SPORT0_TCR1, | ||
| 762 | .end = SPORT0_MRCS3+4, | ||
| 763 | .flags = IORESOURCE_MEM, | ||
| 764 | }, | ||
| 765 | { | ||
| 766 | .start = IRQ_SPORT0_RX, | ||
| 767 | .end = IRQ_SPORT0_RX+1, | ||
| 768 | .flags = IORESOURCE_IRQ, | ||
| 769 | }, | ||
| 770 | { | ||
| 771 | .start = IRQ_SPORT0_ERROR, | ||
| 772 | .end = IRQ_SPORT0_ERROR, | ||
| 773 | .flags = IORESOURCE_IRQ, | ||
| 774 | }, | ||
| 775 | }; | ||
| 776 | |||
| 777 | unsigned short bfin_sport0_peripherals[] = { | ||
| 778 | P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, | ||
| 779 | P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0 | ||
| 780 | }; | ||
| 781 | |||
| 728 | static struct platform_device bfin_sport0_uart_device = { | 782 | static struct platform_device bfin_sport0_uart_device = { |
| 729 | .name = "bfin-sport-uart", | 783 | .name = "bfin-sport-uart", |
| 730 | .id = 0, | 784 | .id = 0, |
| 785 | .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources), | ||
| 786 | .resource = bfin_sport0_uart_resources, | ||
| 787 | .dev = { | ||
| 788 | .platform_data = &bfin_sport0_peripherals, /* Passed to driver */ | ||
| 789 | }, | ||
| 790 | }; | ||
| 791 | #endif | ||
| 792 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
| 793 | static struct resource bfin_sport1_uart_resources[] = { | ||
| 794 | { | ||
| 795 | .start = SPORT1_TCR1, | ||
| 796 | .end = SPORT1_MRCS3+4, | ||
| 797 | .flags = IORESOURCE_MEM, | ||
| 798 | }, | ||
| 799 | { | ||
| 800 | .start = IRQ_SPORT1_RX, | ||
| 801 | .end = IRQ_SPORT1_RX+1, | ||
| 802 | .flags = IORESOURCE_IRQ, | ||
| 803 | }, | ||
| 804 | { | ||
| 805 | .start = IRQ_SPORT1_ERROR, | ||
| 806 | .end = IRQ_SPORT1_ERROR, | ||
| 807 | .flags = IORESOURCE_IRQ, | ||
| 808 | }, | ||
| 809 | }; | ||
| 810 | |||
| 811 | unsigned short bfin_sport1_peripherals[] = { | ||
| 812 | P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, | ||
| 813 | P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0 | ||
| 731 | }; | 814 | }; |
| 732 | 815 | ||
| 733 | static struct platform_device bfin_sport1_uart_device = { | 816 | static struct platform_device bfin_sport1_uart_device = { |
| 734 | .name = "bfin-sport-uart", | 817 | .name = "bfin-sport-uart", |
| 735 | .id = 1, | 818 | .id = 1, |
| 819 | .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources), | ||
| 820 | .resource = bfin_sport1_uart_resources, | ||
| 821 | .dev = { | ||
| 822 | .platform_data = &bfin_sport1_peripherals, /* Passed to driver */ | ||
| 823 | }, | ||
| 736 | }; | 824 | }; |
| 737 | #endif | 825 | #endif |
| 826 | #endif | ||
| 738 | 827 | ||
| 739 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | 828 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 740 | #include <linux/input.h> | 829 | #include <linux/input.h> |
| @@ -795,10 +884,6 @@ static struct platform_device *cmbf527_devices[] __initdata = { | |||
| 795 | &rtc_device, | 884 | &rtc_device, |
| 796 | #endif | 885 | #endif |
| 797 | 886 | ||
| 798 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) | ||
| 799 | &sl811_hcd_device, | ||
| 800 | #endif | ||
| 801 | |||
| 802 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) | 887 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
| 803 | &bfin_isp1760_device, | 888 | &bfin_isp1760_device, |
| 804 | #endif | 889 | #endif |
| @@ -829,7 +914,12 @@ static struct platform_device *cmbf527_devices[] __initdata = { | |||
| 829 | #endif | 914 | #endif |
| 830 | 915 | ||
| 831 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 916 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 832 | &bfin_uart_device, | 917 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 918 | &bfin_uart0_device, | ||
| 919 | #endif | ||
| 920 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
| 921 | &bfin_uart1_device, | ||
| 922 | #endif | ||
| 833 | #endif | 923 | #endif |
| 834 | 924 | ||
| 835 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 925 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| @@ -846,9 +936,13 @@ static struct platform_device *cmbf527_devices[] __initdata = { | |||
| 846 | #endif | 936 | #endif |
| 847 | 937 | ||
| 848 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 938 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 939 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
| 849 | &bfin_sport0_uart_device, | 940 | &bfin_sport0_uart_device, |
| 941 | #endif | ||
| 942 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
| 850 | &bfin_sport1_uart_device, | 943 | &bfin_sport1_uart_device, |
| 851 | #endif | 944 | #endif |
| 945 | #endif | ||
| 852 | 946 | ||
| 853 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | 947 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 854 | &bfin_device_gpiokeys, | 948 | &bfin_device_gpiokeys, |
| @@ -871,6 +965,33 @@ static int __init cm_init(void) | |||
| 871 | 965 | ||
| 872 | arch_initcall(cm_init); | 966 | arch_initcall(cm_init); |
| 873 | 967 | ||
| 968 | static struct platform_device *cmbf527_early_devices[] __initdata = { | ||
| 969 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
| 970 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
| 971 | &bfin_uart0_device, | ||
| 972 | #endif | ||
| 973 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
| 974 | &bfin_uart1_device, | ||
| 975 | #endif | ||
| 976 | #endif | ||
| 977 | |||
| 978 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) | ||
| 979 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
| 980 | &bfin_sport0_uart_device, | ||
| 981 | #endif | ||
| 982 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
| 983 | &bfin_sport1_uart_device, | ||
| 984 | #endif | ||
| 985 | #endif | ||
| 986 | }; | ||
| 987 | |||
| 988 | void __init native_machine_early_platform_add_devices(void) | ||
| 989 | { | ||
| 990 | printk(KERN_INFO "register early platform devices\n"); | ||
| 991 | early_platform_add_devices(cmbf527_early_devices, | ||
| 992 | ARRAY_SIZE(cmbf527_early_devices)); | ||
| 993 | } | ||
| 994 | |||
| 874 | void native_machine_restart(char *cmd) | 995 | void native_machine_restart(char *cmd) |
| 875 | { | 996 | { |
| 876 | /* workaround reboot hang when booting from SPI */ | 997 | /* workaround reboot hang when booting from SPI */ |
