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,
89 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
93 static struct musb_hdrc_config musb_config = {
100 .gpio_vrsel = GPIO_PF11,
101 /* Some custom boards need to be active low, just set it to "0"
104 .gpio_vrsel_active = 1,
107 static struct musb_hdrc_platform_data musb_plat = {
108 #if defined(CONFIG_USB_MUSB_OTG)
110 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
112 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
113 .mode = MUSB_PERIPHERAL,
115 .config = &musb_config,
118 static u64 musb_dmamask = ~(u32)0;
120 static struct platform_device musb_device = {
124 .dma_mask = &musb_dmamask,
125 .coherent_dma_mask = 0xffffffff,
126 .platform_data = &musb_plat,
128 .num_resources = ARRAY_SIZE(musb_resources),
129 .resource = musb_resources,
133 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
134 static struct mtd_partition partition_info[] = {
136 .name = "linux kernel(nand)",
138 .size = 4 * 1024 * 1024,
141 .name = "file system(nand)",
142 .offset = MTDPART_OFS_APPEND,
143 .size = MTDPART_SIZ_FULL,
147 static struct bf5xx_nand_platform bf5xx_nand_platform = {
148 .page_size = NFC_PG_SIZE_256,
149 .data_width = NFC_NWIDTH_8,
150 .partitions = partition_info,
151 .nr_partitions = ARRAY_SIZE(partition_info),
156 static struct resource bf5xx_nand_resources[] = {
159 .end = NFC_DATA_RD + 2,
160 .flags = IORESOURCE_MEM,
165 .flags = IORESOURCE_IRQ,
169 static struct platform_device bf5xx_nand_device = {
170 .name = "bf5xx-nand",
172 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
173 .resource = bf5xx_nand_resources,
175 .platform_data = &bf5xx_nand_platform,
180 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
181 static struct resource bfin_pcmcia_cf_resources[] = {
183 .start = 0x20310000, /* IO PORT */
185 .flags = IORESOURCE_MEM,
187 .start = 0x20311000, /* Attribute Memory */
189 .flags = IORESOURCE_MEM,
193 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
195 .start = 6, /* Card Detect PF6 */
197 .flags = IORESOURCE_IRQ,
201 static struct platform_device bfin_pcmcia_cf_device = {
202 .name = "bfin_cf_pcmcia",
204 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
205 .resource = bfin_pcmcia_cf_resources,
209 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
210 static struct platform_device rtc_device = {
216 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
217 #include <linux/smc91x.h>
219 static struct smc91x_platdata smc91x_info = {
220 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
221 .leda = RPC_LED_100_10,
222 .ledb = RPC_LED_TX_RX,
225 static struct resource smc91x_resources[] = {
227 .name = "smc91x-regs",
229 .end = 0x20300300 + 16,
230 .flags = IORESOURCE_MEM,
235 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
238 static struct platform_device smc91x_device = {
241 .num_resources = ARRAY_SIZE(smc91x_resources),
242 .resource = smc91x_resources,
244 .platform_data = &smc91x_info,
249 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
250 static struct resource dm9000_resources[] = {
253 .end = 0x203FB800 + 1,
254 .flags = IORESOURCE_MEM,
258 .end = 0x203FB804 + 1,
259 .flags = IORESOURCE_MEM,
264 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
268 static struct platform_device dm9000_device = {
271 .num_resources = ARRAY_SIZE(dm9000_resources),
272 .resource = dm9000_resources,
276 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
277 static struct platform_device bfin_mii_bus = {
278 .name = "bfin_mii_bus",
281 static struct platform_device bfin_mac_device = {
283 .dev.platform_data = &bfin_mii_bus,
287 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
288 static struct resource net2272_bfin_resources[] = {
291 .end = 0x20300000 + 0x100,
292 .flags = IORESOURCE_MEM,
296 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
300 static struct platform_device net2272_bfin_device = {
303 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
304 .resource = net2272_bfin_resources,
308 #if defined(CONFIG_MTD_M25P80) \
309 || defined(CONFIG_MTD_M25P80_MODULE)
310 static struct mtd_partition bfin_spi_flash_partitions[] = {
312 .name = "bootloader(spi)",
315 .mask_flags = MTD_CAP_ROM
317 .name = "linux kernel(spi)",
318 .size = MTDPART_SIZ_FULL,
319 .offset = MTDPART_OFS_APPEND,
323 static struct flash_platform_data bfin_spi_flash_data = {
325 .parts = bfin_spi_flash_partitions,
326 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
330 /* SPI flash chip (m25p64) */
331 static struct bfin5xx_spi_chip spi_flash_chip_info = {
332 .enable_dma = 0, /* use dma transfer with this chip*/
337 #if defined(CONFIG_BFIN_SPI_ADC) \
338 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
340 static struct bfin5xx_spi_chip spi_adc_chip_info = {
341 .enable_dma = 1, /* use dma transfer with this chip*/
346 #if defined(CONFIG_SND_BLACKFIN_AD183X) \
347 || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE)
348 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
354 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
355 static struct bfin5xx_spi_chip mmc_spi_chip_info = {
361 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
362 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
367 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
369 .vref_delay_usecs = 50, /* internal, no capacitor */
372 .pressure_max = 1000,
374 .stopacq_polarity = 1,
375 .first_conversion_delay = 3,
376 .acquisition_time = 1,
378 .pen_down_acc_interval = 1,
382 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
383 && defined(CONFIG_SND_SOC_WM8731_SPI)
384 static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
390 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
391 static struct bfin5xx_spi_chip spidev_chip_info = {
397 static struct spi_board_info bfin_spi_board_info[] __initdata = {
398 #if defined(CONFIG_MTD_M25P80) \
399 || defined(CONFIG_MTD_M25P80_MODULE)
401 /* the modalias must be the same as spi device driver name */
402 .modalias = "m25p80", /* Name of spi_driver for this device */
403 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
404 .bus_num = 0, /* Framework bus number */
405 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
406 .platform_data = &bfin_spi_flash_data,
407 .controller_data = &spi_flash_chip_info,
412 #if defined(CONFIG_BFIN_SPI_ADC) \
413 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
415 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
416 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
417 .bus_num = 0, /* Framework bus number */
418 .chip_select = 1, /* Framework chip select. */
419 .platform_data = NULL, /* No spi_driver specific config */
420 .controller_data = &spi_adc_chip_info,
424 #if defined(CONFIG_SND_BLACKFIN_AD183X) \
425 || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE)
427 .modalias = "ad1836",
428 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
430 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
431 .controller_data = &ad1836_spi_chip_info,
434 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
436 .modalias = "mmc_spi",
437 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
440 .controller_data = &mmc_spi_chip_info,
444 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
446 .modalias = "ad7877",
447 .platform_data = &bfin_ad7877_ts_info,
449 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
452 .controller_data = &spi_ad7877_chip_info,
455 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
456 && defined(CONFIG_SND_SOC_WM8731_SPI)
458 .modalias = "wm8731",
459 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
462 .controller_data = &spi_wm8731_chip_info,
466 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
468 .modalias = "spidev",
469 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
472 .controller_data = &spidev_chip_info,
477 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
478 /* SPI controller data */
479 static struct bfin5xx_spi_master bfin_spi0_info = {
481 .enable_dma = 1, /* master has the ability to do dma transfer */
482 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
486 static struct resource bfin_spi0_resource[] = {
488 .start = SPI0_REGBASE,
489 .end = SPI0_REGBASE + 0xFF,
490 .flags = IORESOURCE_MEM,
495 .flags = IORESOURCE_DMA,
500 .flags = IORESOURCE_IRQ,
504 static struct platform_device bfin_spi0_device = {
506 .id = 0, /* Bus number */
507 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
508 .resource = bfin_spi0_resource,
510 .platform_data = &bfin_spi0_info, /* Passed to driver */
513 #endif /* spi master and devices */
515 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
516 static struct mtd_partition cm_partitions[] = {
518 .name = "bootloader(nor)",
522 .name = "linux kernel(nor)",
524 .offset = MTDPART_OFS_APPEND,
526 .name = "file system(nor)",
527 .size = MTDPART_SIZ_FULL,
528 .offset = MTDPART_OFS_APPEND,
532 static struct physmap_flash_data cm_flash_data = {
534 .parts = cm_partitions,
535 .nr_parts = ARRAY_SIZE(cm_partitions),
538 static unsigned cm_flash_gpios[] = { GPIO_PH9, GPIO_PG11 };
540 static struct resource cm_flash_resource[] = {
545 .flags = IORESOURCE_MEM,
547 .start = (unsigned long)cm_flash_gpios,
548 .end = ARRAY_SIZE(cm_flash_gpios),
549 .flags = IORESOURCE_IRQ,
553 static struct platform_device cm_flash_device = {
554 .name = "gpio-addr-flash",
557 .platform_data = &cm_flash_data,
559 .num_resources = ARRAY_SIZE(cm_flash_resource),
560 .resource = cm_flash_resource,
564 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
565 #ifdef CONFIG_SERIAL_BFIN_UART0
566 static struct resource bfin_uart0_resources[] = {
570 .flags = IORESOURCE_MEM,
573 .start = IRQ_UART0_RX,
574 .end = IRQ_UART0_RX+1,
575 .flags = IORESOURCE_IRQ,
578 .start = IRQ_UART0_ERROR,
579 .end = IRQ_UART0_ERROR,
580 .flags = IORESOURCE_IRQ,
583 .start = CH_UART0_TX,
585 .flags = IORESOURCE_DMA,
588 .start = CH_UART0_RX,
590 .flags = IORESOURCE_DMA,
594 unsigned short bfin_uart0_peripherals[] = {
595 P_UART0_TX, P_UART0_RX, 0
598 static struct platform_device bfin_uart0_device = {
601 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
602 .resource = bfin_uart0_resources,
604 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
608 #ifdef CONFIG_SERIAL_BFIN_UART1
609 static struct resource bfin_uart1_resources[] = {
613 .flags = IORESOURCE_MEM,
616 .start = IRQ_UART1_RX,
617 .end = IRQ_UART1_RX+1,
618 .flags = IORESOURCE_IRQ,
621 .start = IRQ_UART1_ERROR,
622 .end = IRQ_UART1_ERROR,
623 .flags = IORESOURCE_IRQ,
626 .start = CH_UART1_TX,
628 .flags = IORESOURCE_DMA,
631 .start = CH_UART1_RX,
633 .flags = IORESOURCE_DMA,
635 #ifdef CONFIG_BFIN_UART1_CTSRTS
639 .flags = IORESOURCE_IO,
644 .flags = IORESOURCE_IO,
649 unsigned short bfin_uart1_peripherals[] = {
650 P_UART1_TX, P_UART1_RX, 0
653 static struct platform_device bfin_uart1_device = {
656 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
657 .resource = bfin_uart1_resources,
659 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
665 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
666 #ifdef CONFIG_BFIN_SIR0
667 static struct resource bfin_sir0_resources[] = {
671 .flags = IORESOURCE_MEM,
674 .start = IRQ_UART0_RX,
675 .end = IRQ_UART0_RX+1,
676 .flags = IORESOURCE_IRQ,
679 .start = CH_UART0_RX,
680 .end = CH_UART0_RX+1,
681 .flags = IORESOURCE_DMA,
685 static struct platform_device bfin_sir0_device = {
688 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
689 .resource = bfin_sir0_resources,
692 #ifdef CONFIG_BFIN_SIR1
693 static struct resource bfin_sir1_resources[] = {
697 .flags = IORESOURCE_MEM,
700 .start = IRQ_UART1_RX,
701 .end = IRQ_UART1_RX+1,
702 .flags = IORESOURCE_IRQ,
705 .start = CH_UART1_RX,
706 .end = CH_UART1_RX+1,
707 .flags = IORESOURCE_DMA,
711 static struct platform_device bfin_sir1_device = {
714 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
715 .resource = bfin_sir1_resources,
720 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
721 static struct resource bfin_twi0_resource[] = {
723 .start = TWI0_REGBASE,
725 .flags = IORESOURCE_MEM,
730 .flags = IORESOURCE_IRQ,
734 static struct platform_device i2c_bfin_twi_device = {
735 .name = "i2c-bfin-twi",
737 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
738 .resource = bfin_twi0_resource,
742 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
743 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
745 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
748 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
750 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
754 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
756 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
761 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
762 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
763 static struct resource bfin_sport0_uart_resources[] = {
765 .start = SPORT0_TCR1,
766 .end = SPORT0_MRCS3+4,
767 .flags = IORESOURCE_MEM,
770 .start = IRQ_SPORT0_RX,
771 .end = IRQ_SPORT0_RX+1,
772 .flags = IORESOURCE_IRQ,
775 .start = IRQ_SPORT0_ERROR,
776 .end = IRQ_SPORT0_ERROR,
777 .flags = IORESOURCE_IRQ,
781 unsigned short bfin_sport0_peripherals[] = {
782 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
783 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
786 static struct platform_device bfin_sport0_uart_device = {
787 .name = "bfin-sport-uart",
789 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
790 .resource = bfin_sport0_uart_resources,
792 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
796 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
797 static struct resource bfin_sport1_uart_resources[] = {
799 .start = SPORT1_TCR1,
800 .end = SPORT1_MRCS3+4,
801 .flags = IORESOURCE_MEM,
804 .start = IRQ_SPORT1_RX,
805 .end = IRQ_SPORT1_RX+1,
806 .flags = IORESOURCE_IRQ,
809 .start = IRQ_SPORT1_ERROR,
810 .end = IRQ_SPORT1_ERROR,
811 .flags = IORESOURCE_IRQ,
815 unsigned short bfin_sport1_peripherals[] = {
816 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
817 P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
820 static struct platform_device bfin_sport1_uart_device = {
821 .name = "bfin-sport-uart",
823 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
824 .resource = bfin_sport1_uart_resources,
826 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
832 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
833 #include <linux/input.h>
834 #include <linux/gpio_keys.h>
836 static struct gpio_keys_button bfin_gpio_keys_table[] = {
837 {BTN_0, GPIO_PF14, 1, "gpio-keys: BTN0"},
840 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
841 .buttons = bfin_gpio_keys_table,
842 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
845 static struct platform_device bfin_device_gpiokeys = {
848 .platform_data = &bfin_gpio_keys_data,
853 static const unsigned int cclk_vlev_datasheet[] =
855 VRPAIR(VLEV_100, 400000000),
856 VRPAIR(VLEV_105, 426000000),
857 VRPAIR(VLEV_110, 500000000),
858 VRPAIR(VLEV_115, 533000000),
859 VRPAIR(VLEV_120, 600000000),
862 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
863 .tuple_tab = cclk_vlev_datasheet,
864 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
865 .vr_settling_time = 25 /* us */,
868 static struct platform_device bfin_dpmc = {
871 .platform_data = &bfin_dmpc_vreg_data,
875 static struct platform_device *cmbf527_devices[] __initdata = {
879 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
883 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
884 &bfin_pcmcia_cf_device,
887 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
891 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
892 &bfin_isp1760_device,
895 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
899 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
903 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
907 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
912 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
913 &net2272_bfin_device,
916 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
920 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
921 #ifdef CONFIG_SERIAL_BFIN_UART0
924 #ifdef CONFIG_SERIAL_BFIN_UART1
929 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
930 #ifdef CONFIG_BFIN_SIR0
933 #ifdef CONFIG_BFIN_SIR1
938 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
939 &i2c_bfin_twi_device,
942 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
943 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
944 &bfin_sport0_uart_device,
946 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
947 &bfin_sport1_uart_device,
951 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
952 &bfin_device_gpiokeys,
955 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
960 static int __init cm_init(void)
962 printk(KERN_INFO "%s(): registering device resources\n", __func__);
963 i2c_register_board_info(0, bfin_i2c_board_info,
964 ARRAY_SIZE(bfin_i2c_board_info));
965 platform_add_devices(cmbf527_devices, ARRAY_SIZE(cmbf527_devices));
966 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
970 arch_initcall(cm_init);
972 static struct platform_device *cmbf527_early_devices[] __initdata = {
973 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
974 #ifdef CONFIG_SERIAL_BFIN_UART0
977 #ifdef CONFIG_SERIAL_BFIN_UART1
982 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
983 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
984 &bfin_sport0_uart_device,
986 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
987 &bfin_sport1_uart_device,
992 void __init native_machine_early_platform_add_devices(void)
994 printk(KERN_INFO "register early platform devices\n");
995 early_platform_add_devices(cmbf527_early_devices,
996 ARRAY_SIZE(cmbf527_early_devices));
999 void native_machine_restart(char *cmd)
1001 /* workaround reboot hang when booting from SPI */
1002 if ((bfin_read_SYSCR() & 0x7) == 0x3)
1003 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
1006 void bfin_get_ether_addr(char *addr)
1008 random_ether_addr(addr);
1009 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
1011 EXPORT_SYMBOL(bfin_get_ether_addr);