2 * Copyright 2004-2009 Analog Devices Inc.
3 * 2008-2009 Bluetechnix
4 * 2005 National ICT Australia (NICTA)
5 * Aidan Williams <aidan@nicta.com.au>
7 * Licensed under the GPL-2 or later.
10 #include <linux/device.h>
11 #include <linux/platform_device.h>
12 #include <linux/mtd/mtd.h>
13 #include <linux/mtd/partitions.h>
14 #include <linux/mtd/physmap.h>
15 #include <linux/spi/spi.h>
16 #include <linux/spi/flash.h>
17 #include <linux/etherdevice.h>
18 #include <linux/i2c.h>
19 #include <linux/irq.h>
20 #include <linux/interrupt.h>
21 #include <linux/usb/musb.h>
23 #include <asm/bfin5xx_spi.h>
24 #include <asm/reboot.h>
26 #include <asm/portmux.h>
28 #include <linux/spi/ad7877.h>
31 * Name the Board for the /proc/cpuinfo
33 const char bfin_board_name[] = "Bluetechnix CM-BF527";
36 * Driver needs to know address, irq and flag pin.
39 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
40 #include <linux/usb/isp1760.h>
41 static struct resource bfin_isp1760_resources[] = {
44 .end = 0x203C0000 + 0x000fffff,
45 .flags = IORESOURCE_MEM,
50 .flags = IORESOURCE_IRQ,
54 static struct isp1760_platform_data isp1760_priv = {
59 .dack_polarity_high = 0,
60 .dreq_polarity_high = 0,
63 static struct platform_device bfin_isp1760_device = {
67 .platform_data = &isp1760_priv,
69 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
70 .resource = bfin_isp1760_resources,
74 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
75 static struct resource musb_resources[] = {
79 .flags = IORESOURCE_MEM,
81 [1] = { /* general IRQ */
82 .start = IRQ_USB_INT0,
84 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
90 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
95 static struct musb_hdrc_config musb_config = {
102 .gpio_vrsel = GPIO_PF11,
103 /* Some custom boards need to be active low, just set it to "0"
106 .gpio_vrsel_active = 1,
109 static struct musb_hdrc_platform_data musb_plat = {
110 #if defined(CONFIG_USB_MUSB_OTG)
112 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
114 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
115 .mode = MUSB_PERIPHERAL,
117 .config = &musb_config,
120 static u64 musb_dmamask = ~(u32)0;
122 static struct platform_device musb_device = {
123 .name = "musb-blackfin",
126 .dma_mask = &musb_dmamask,
127 .coherent_dma_mask = 0xffffffff,
128 .platform_data = &musb_plat,
130 .num_resources = ARRAY_SIZE(musb_resources),
131 .resource = musb_resources,
135 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
136 static struct mtd_partition partition_info[] = {
138 .name = "linux kernel(nand)",
140 .size = 4 * 1024 * 1024,
143 .name = "file system(nand)",
144 .offset = MTDPART_OFS_APPEND,
145 .size = MTDPART_SIZ_FULL,
149 static struct bf5xx_nand_platform bf5xx_nand_platform = {
150 .data_width = NFC_NWIDTH_8,
151 .partitions = partition_info,
152 .nr_partitions = ARRAY_SIZE(partition_info),
157 static struct resource bf5xx_nand_resources[] = {
160 .end = NFC_DATA_RD + 2,
161 .flags = IORESOURCE_MEM,
166 .flags = IORESOURCE_IRQ,
170 static struct platform_device bf5xx_nand_device = {
171 .name = "bf5xx-nand",
173 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
174 .resource = bf5xx_nand_resources,
176 .platform_data = &bf5xx_nand_platform,
181 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
182 static struct resource bfin_pcmcia_cf_resources[] = {
184 .start = 0x20310000, /* IO PORT */
186 .flags = IORESOURCE_MEM,
188 .start = 0x20311000, /* Attribute Memory */
190 .flags = IORESOURCE_MEM,
194 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
196 .start = 6, /* Card Detect PF6 */
198 .flags = IORESOURCE_IRQ,
202 static struct platform_device bfin_pcmcia_cf_device = {
203 .name = "bfin_cf_pcmcia",
205 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
206 .resource = bfin_pcmcia_cf_resources,
210 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
211 static struct platform_device rtc_device = {
217 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
218 #include <linux/smc91x.h>
220 static struct smc91x_platdata smc91x_info = {
221 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
222 .leda = RPC_LED_100_10,
223 .ledb = RPC_LED_TX_RX,
226 static struct resource smc91x_resources[] = {
228 .name = "smc91x-regs",
230 .end = 0x20300300 + 16,
231 .flags = IORESOURCE_MEM,
236 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
239 static struct platform_device smc91x_device = {
242 .num_resources = ARRAY_SIZE(smc91x_resources),
243 .resource = smc91x_resources,
245 .platform_data = &smc91x_info,
250 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
251 static struct resource dm9000_resources[] = {
254 .end = 0x203FB800 + 1,
255 .flags = IORESOURCE_MEM,
259 .end = 0x203FB804 + 1,
260 .flags = IORESOURCE_MEM,
265 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
269 static struct platform_device dm9000_device = {
272 .num_resources = ARRAY_SIZE(dm9000_resources),
273 .resource = dm9000_resources,
277 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
278 #include <linux/bfin_mac.h>
279 static const unsigned short bfin_mac_peripherals[] = P_RMII0;
281 static struct bfin_phydev_platform_data bfin_phydev_data[] = {
284 .irq = IRQ_MAC_PHYINT,
288 static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
290 .phydev_data = bfin_phydev_data,
291 .phy_mode = PHY_INTERFACE_MODE_RMII,
292 .mac_peripherals = bfin_mac_peripherals,
295 static struct platform_device bfin_mii_bus = {
296 .name = "bfin_mii_bus",
298 .platform_data = &bfin_mii_bus_data,
302 static struct platform_device bfin_mac_device = {
305 .platform_data = &bfin_mii_bus,
310 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
311 static struct resource net2272_bfin_resources[] = {
314 .end = 0x20300000 + 0x100,
315 .flags = IORESOURCE_MEM,
319 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
323 static struct platform_device net2272_bfin_device = {
326 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
327 .resource = net2272_bfin_resources,
331 #if defined(CONFIG_MTD_M25P80) \
332 || defined(CONFIG_MTD_M25P80_MODULE)
333 static struct mtd_partition bfin_spi_flash_partitions[] = {
335 .name = "bootloader(spi)",
338 .mask_flags = MTD_CAP_ROM
340 .name = "linux kernel(spi)",
341 .size = MTDPART_SIZ_FULL,
342 .offset = MTDPART_OFS_APPEND,
346 static struct flash_platform_data bfin_spi_flash_data = {
348 .parts = bfin_spi_flash_partitions,
349 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
353 /* SPI flash chip (m25p64) */
354 static struct bfin5xx_spi_chip spi_flash_chip_info = {
355 .enable_dma = 0, /* use dma transfer with this chip*/
360 #if defined(CONFIG_BFIN_SPI_ADC) \
361 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
363 static struct bfin5xx_spi_chip spi_adc_chip_info = {
364 .enable_dma = 1, /* use dma transfer with this chip*/
369 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
370 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
371 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
377 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
378 static struct bfin5xx_spi_chip mmc_spi_chip_info = {
384 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
385 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
390 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
392 .vref_delay_usecs = 50, /* internal, no capacitor */
395 .pressure_max = 1000,
397 .stopacq_polarity = 1,
398 .first_conversion_delay = 3,
399 .acquisition_time = 1,
401 .pen_down_acc_interval = 1,
405 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
406 && defined(CONFIG_SND_SOC_WM8731_SPI)
407 static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
413 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
414 static struct bfin5xx_spi_chip spidev_chip_info = {
420 static struct spi_board_info bfin_spi_board_info[] __initdata = {
421 #if defined(CONFIG_MTD_M25P80) \
422 || defined(CONFIG_MTD_M25P80_MODULE)
424 /* the modalias must be the same as spi device driver name */
425 .modalias = "m25p80", /* Name of spi_driver for this device */
426 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
427 .bus_num = 0, /* Framework bus number */
428 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
429 .platform_data = &bfin_spi_flash_data,
430 .controller_data = &spi_flash_chip_info,
435 #if defined(CONFIG_BFIN_SPI_ADC) \
436 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
438 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
439 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
440 .bus_num = 0, /* Framework bus number */
441 .chip_select = 1, /* Framework chip select. */
442 .platform_data = NULL, /* No spi_driver specific config */
443 .controller_data = &spi_adc_chip_info,
447 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
448 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
450 .modalias = "ad183x",
451 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
454 .controller_data = &ad1836_spi_chip_info,
457 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
459 .modalias = "mmc_spi",
460 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
463 .controller_data = &mmc_spi_chip_info,
467 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
469 .modalias = "ad7877",
470 .platform_data = &bfin_ad7877_ts_info,
472 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
475 .controller_data = &spi_ad7877_chip_info,
478 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
479 && defined(CONFIG_SND_SOC_WM8731_SPI)
481 .modalias = "wm8731",
482 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
485 .controller_data = &spi_wm8731_chip_info,
489 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
491 .modalias = "spidev",
492 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
495 .controller_data = &spidev_chip_info,
500 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
501 /* SPI controller data */
502 static struct bfin5xx_spi_master bfin_spi0_info = {
504 .enable_dma = 1, /* master has the ability to do dma transfer */
505 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
509 static struct resource bfin_spi0_resource[] = {
511 .start = SPI0_REGBASE,
512 .end = SPI0_REGBASE + 0xFF,
513 .flags = IORESOURCE_MEM,
518 .flags = IORESOURCE_DMA,
523 .flags = IORESOURCE_IRQ,
527 static struct platform_device bfin_spi0_device = {
529 .id = 0, /* Bus number */
530 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
531 .resource = bfin_spi0_resource,
533 .platform_data = &bfin_spi0_info, /* Passed to driver */
536 #endif /* spi master and devices */
538 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
539 static struct mtd_partition cm_partitions[] = {
541 .name = "bootloader(nor)",
545 .name = "linux kernel(nor)",
547 .offset = MTDPART_OFS_APPEND,
549 .name = "file system(nor)",
550 .size = MTDPART_SIZ_FULL,
551 .offset = MTDPART_OFS_APPEND,
555 static struct physmap_flash_data cm_flash_data = {
557 .parts = cm_partitions,
558 .nr_parts = ARRAY_SIZE(cm_partitions),
561 static unsigned cm_flash_gpios[] = { GPIO_PH9, GPIO_PG11 };
563 static struct resource cm_flash_resource[] = {
568 .flags = IORESOURCE_MEM,
570 .start = (unsigned long)cm_flash_gpios,
571 .end = ARRAY_SIZE(cm_flash_gpios),
572 .flags = IORESOURCE_IRQ,
576 static struct platform_device cm_flash_device = {
577 .name = "gpio-addr-flash",
580 .platform_data = &cm_flash_data,
582 .num_resources = ARRAY_SIZE(cm_flash_resource),
583 .resource = cm_flash_resource,
587 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
588 #ifdef CONFIG_SERIAL_BFIN_UART0
589 static struct resource bfin_uart0_resources[] = {
593 .flags = IORESOURCE_MEM,
596 .start = IRQ_UART0_RX,
597 .end = IRQ_UART0_RX+1,
598 .flags = IORESOURCE_IRQ,
601 .start = IRQ_UART0_ERROR,
602 .end = IRQ_UART0_ERROR,
603 .flags = IORESOURCE_IRQ,
606 .start = CH_UART0_TX,
608 .flags = IORESOURCE_DMA,
611 .start = CH_UART0_RX,
613 .flags = IORESOURCE_DMA,
617 unsigned short bfin_uart0_peripherals[] = {
618 P_UART0_TX, P_UART0_RX, 0
621 static struct platform_device bfin_uart0_device = {
624 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
625 .resource = bfin_uart0_resources,
627 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
631 #ifdef CONFIG_SERIAL_BFIN_UART1
632 static struct resource bfin_uart1_resources[] = {
636 .flags = IORESOURCE_MEM,
639 .start = IRQ_UART1_RX,
640 .end = IRQ_UART1_RX+1,
641 .flags = IORESOURCE_IRQ,
644 .start = IRQ_UART1_ERROR,
645 .end = IRQ_UART1_ERROR,
646 .flags = IORESOURCE_IRQ,
649 .start = CH_UART1_TX,
651 .flags = IORESOURCE_DMA,
654 .start = CH_UART1_RX,
656 .flags = IORESOURCE_DMA,
658 #ifdef CONFIG_BFIN_UART1_CTSRTS
662 .flags = IORESOURCE_IO,
667 .flags = IORESOURCE_IO,
672 unsigned short bfin_uart1_peripherals[] = {
673 P_UART1_TX, P_UART1_RX, 0
676 static struct platform_device bfin_uart1_device = {
679 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
680 .resource = bfin_uart1_resources,
682 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
688 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
689 #ifdef CONFIG_BFIN_SIR0
690 static struct resource bfin_sir0_resources[] = {
694 .flags = IORESOURCE_MEM,
697 .start = IRQ_UART0_RX,
698 .end = IRQ_UART0_RX+1,
699 .flags = IORESOURCE_IRQ,
702 .start = CH_UART0_RX,
703 .end = CH_UART0_RX+1,
704 .flags = IORESOURCE_DMA,
708 static struct platform_device bfin_sir0_device = {
711 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
712 .resource = bfin_sir0_resources,
715 #ifdef CONFIG_BFIN_SIR1
716 static struct resource bfin_sir1_resources[] = {
720 .flags = IORESOURCE_MEM,
723 .start = IRQ_UART1_RX,
724 .end = IRQ_UART1_RX+1,
725 .flags = IORESOURCE_IRQ,
728 .start = CH_UART1_RX,
729 .end = CH_UART1_RX+1,
730 .flags = IORESOURCE_DMA,
734 static struct platform_device bfin_sir1_device = {
737 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
738 .resource = bfin_sir1_resources,
743 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
744 static struct resource bfin_twi0_resource[] = {
746 .start = TWI0_REGBASE,
748 .flags = IORESOURCE_MEM,
753 .flags = IORESOURCE_IRQ,
757 static struct platform_device i2c_bfin_twi_device = {
758 .name = "i2c-bfin-twi",
760 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
761 .resource = bfin_twi0_resource,
765 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
766 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
768 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
771 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
773 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
777 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
779 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
784 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
785 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
786 static struct resource bfin_sport0_uart_resources[] = {
788 .start = SPORT0_TCR1,
789 .end = SPORT0_MRCS3+4,
790 .flags = IORESOURCE_MEM,
793 .start = IRQ_SPORT0_RX,
794 .end = IRQ_SPORT0_RX+1,
795 .flags = IORESOURCE_IRQ,
798 .start = IRQ_SPORT0_ERROR,
799 .end = IRQ_SPORT0_ERROR,
800 .flags = IORESOURCE_IRQ,
804 unsigned short bfin_sport0_peripherals[] = {
805 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
806 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
809 static struct platform_device bfin_sport0_uart_device = {
810 .name = "bfin-sport-uart",
812 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
813 .resource = bfin_sport0_uart_resources,
815 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
819 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
820 static struct resource bfin_sport1_uart_resources[] = {
822 .start = SPORT1_TCR1,
823 .end = SPORT1_MRCS3+4,
824 .flags = IORESOURCE_MEM,
827 .start = IRQ_SPORT1_RX,
828 .end = IRQ_SPORT1_RX+1,
829 .flags = IORESOURCE_IRQ,
832 .start = IRQ_SPORT1_ERROR,
833 .end = IRQ_SPORT1_ERROR,
834 .flags = IORESOURCE_IRQ,
838 unsigned short bfin_sport1_peripherals[] = {
839 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
840 P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
843 static struct platform_device bfin_sport1_uart_device = {
844 .name = "bfin-sport-uart",
846 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
847 .resource = bfin_sport1_uart_resources,
849 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
855 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
856 #include <linux/input.h>
857 #include <linux/gpio_keys.h>
859 static struct gpio_keys_button bfin_gpio_keys_table[] = {
860 {BTN_0, GPIO_PF14, 1, "gpio-keys: BTN0"},
863 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
864 .buttons = bfin_gpio_keys_table,
865 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
868 static struct platform_device bfin_device_gpiokeys = {
871 .platform_data = &bfin_gpio_keys_data,
876 static const unsigned int cclk_vlev_datasheet[] =
878 VRPAIR(VLEV_100, 400000000),
879 VRPAIR(VLEV_105, 426000000),
880 VRPAIR(VLEV_110, 500000000),
881 VRPAIR(VLEV_115, 533000000),
882 VRPAIR(VLEV_120, 600000000),
885 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
886 .tuple_tab = cclk_vlev_datasheet,
887 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
888 .vr_settling_time = 25 /* us */,
891 static struct platform_device bfin_dpmc = {
894 .platform_data = &bfin_dmpc_vreg_data,
898 static struct platform_device *cmbf527_devices[] __initdata = {
902 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
906 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
907 &bfin_pcmcia_cf_device,
910 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
914 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
915 &bfin_isp1760_device,
918 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
922 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
926 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
930 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
935 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
936 &net2272_bfin_device,
939 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
943 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
944 #ifdef CONFIG_SERIAL_BFIN_UART0
947 #ifdef CONFIG_SERIAL_BFIN_UART1
952 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
953 #ifdef CONFIG_BFIN_SIR0
956 #ifdef CONFIG_BFIN_SIR1
961 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
962 &i2c_bfin_twi_device,
965 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
966 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
967 &bfin_sport0_uart_device,
969 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
970 &bfin_sport1_uart_device,
974 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
975 &bfin_device_gpiokeys,
978 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
983 static int __init cm_init(void)
985 printk(KERN_INFO "%s(): registering device resources\n", __func__);
986 i2c_register_board_info(0, bfin_i2c_board_info,
987 ARRAY_SIZE(bfin_i2c_board_info));
988 platform_add_devices(cmbf527_devices, ARRAY_SIZE(cmbf527_devices));
989 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
993 arch_initcall(cm_init);
995 static struct platform_device *cmbf527_early_devices[] __initdata = {
996 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
997 #ifdef CONFIG_SERIAL_BFIN_UART0
1000 #ifdef CONFIG_SERIAL_BFIN_UART1
1005 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
1006 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1007 &bfin_sport0_uart_device,
1009 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1010 &bfin_sport1_uart_device,
1015 void __init native_machine_early_platform_add_devices(void)
1017 printk(KERN_INFO "register early platform devices\n");
1018 early_platform_add_devices(cmbf527_early_devices,
1019 ARRAY_SIZE(cmbf527_early_devices));
1022 void native_machine_restart(char *cmd)
1024 /* workaround reboot hang when booting from SPI */
1025 if ((bfin_read_SYSCR() & 0x7) == 0x3)
1026 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
1029 void bfin_get_ether_addr(char *addr)
1031 random_ether_addr(addr);
1032 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
1034 EXPORT_SYMBOL(bfin_get_ether_addr);