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,
107 .clkin = 24, /* musb CLKIN in MHZ */
110 static struct musb_hdrc_platform_data musb_plat = {
111 #if defined(CONFIG_USB_MUSB_OTG)
113 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
115 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
116 .mode = MUSB_PERIPHERAL,
118 .config = &musb_config,
121 static u64 musb_dmamask = ~(u32)0;
123 static struct platform_device musb_device = {
124 .name = "musb-blackfin",
127 .dma_mask = &musb_dmamask,
128 .coherent_dma_mask = 0xffffffff,
129 .platform_data = &musb_plat,
131 .num_resources = ARRAY_SIZE(musb_resources),
132 .resource = musb_resources,
136 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
137 static struct mtd_partition partition_info[] = {
139 .name = "linux kernel(nand)",
141 .size = 4 * 1024 * 1024,
144 .name = "file system(nand)",
145 .offset = MTDPART_OFS_APPEND,
146 .size = MTDPART_SIZ_FULL,
150 static struct bf5xx_nand_platform bf5xx_nand_platform = {
151 .data_width = NFC_NWIDTH_8,
152 .partitions = partition_info,
153 .nr_partitions = ARRAY_SIZE(partition_info),
158 static struct resource bf5xx_nand_resources[] = {
161 .end = NFC_DATA_RD + 2,
162 .flags = IORESOURCE_MEM,
167 .flags = IORESOURCE_IRQ,
171 static struct platform_device bf5xx_nand_device = {
172 .name = "bf5xx-nand",
174 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
175 .resource = bf5xx_nand_resources,
177 .platform_data = &bf5xx_nand_platform,
182 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
183 static struct resource bfin_pcmcia_cf_resources[] = {
185 .start = 0x20310000, /* IO PORT */
187 .flags = IORESOURCE_MEM,
189 .start = 0x20311000, /* Attribute Memory */
191 .flags = IORESOURCE_MEM,
195 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
197 .start = 6, /* Card Detect PF6 */
199 .flags = IORESOURCE_IRQ,
203 static struct platform_device bfin_pcmcia_cf_device = {
204 .name = "bfin_cf_pcmcia",
206 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
207 .resource = bfin_pcmcia_cf_resources,
211 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
212 static struct platform_device rtc_device = {
218 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
219 #include <linux/smc91x.h>
221 static struct smc91x_platdata smc91x_info = {
222 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
223 .leda = RPC_LED_100_10,
224 .ledb = RPC_LED_TX_RX,
227 static struct resource smc91x_resources[] = {
229 .name = "smc91x-regs",
231 .end = 0x20300300 + 16,
232 .flags = IORESOURCE_MEM,
237 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
240 static struct platform_device smc91x_device = {
243 .num_resources = ARRAY_SIZE(smc91x_resources),
244 .resource = smc91x_resources,
246 .platform_data = &smc91x_info,
251 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
252 static struct resource dm9000_resources[] = {
255 .end = 0x203FB800 + 1,
256 .flags = IORESOURCE_MEM,
260 .end = 0x203FB804 + 1,
261 .flags = IORESOURCE_MEM,
266 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
270 static struct platform_device dm9000_device = {
273 .num_resources = ARRAY_SIZE(dm9000_resources),
274 .resource = dm9000_resources,
278 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
279 #include <linux/bfin_mac.h>
280 static const unsigned short bfin_mac_peripherals[] = P_RMII0;
282 static struct bfin_phydev_platform_data bfin_phydev_data[] = {
285 .irq = IRQ_MAC_PHYINT,
289 static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
291 .phydev_data = bfin_phydev_data,
292 .phy_mode = PHY_INTERFACE_MODE_RMII,
293 .mac_peripherals = bfin_mac_peripherals,
296 static struct platform_device bfin_mii_bus = {
297 .name = "bfin_mii_bus",
299 .platform_data = &bfin_mii_bus_data,
303 static struct platform_device bfin_mac_device = {
306 .platform_data = &bfin_mii_bus,
311 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
312 static struct resource net2272_bfin_resources[] = {
315 .end = 0x20300000 + 0x100,
316 .flags = IORESOURCE_MEM,
320 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
324 static struct platform_device net2272_bfin_device = {
327 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
328 .resource = net2272_bfin_resources,
332 #if defined(CONFIG_MTD_M25P80) \
333 || defined(CONFIG_MTD_M25P80_MODULE)
334 static struct mtd_partition bfin_spi_flash_partitions[] = {
336 .name = "bootloader(spi)",
339 .mask_flags = MTD_CAP_ROM
341 .name = "linux kernel(spi)",
342 .size = MTDPART_SIZ_FULL,
343 .offset = MTDPART_OFS_APPEND,
347 static struct flash_platform_data bfin_spi_flash_data = {
349 .parts = bfin_spi_flash_partitions,
350 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
354 /* SPI flash chip (m25p64) */
355 static struct bfin5xx_spi_chip spi_flash_chip_info = {
356 .enable_dma = 0, /* use dma transfer with this chip*/
360 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
361 static struct bfin5xx_spi_chip mmc_spi_chip_info = {
366 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
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 static struct spi_board_info bfin_spi_board_info[] __initdata = {
383 #if defined(CONFIG_MTD_M25P80) \
384 || defined(CONFIG_MTD_M25P80_MODULE)
386 /* the modalias must be the same as spi device driver name */
387 .modalias = "m25p80", /* Name of spi_driver for this device */
388 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
389 .bus_num = 0, /* Framework bus number */
390 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
391 .platform_data = &bfin_spi_flash_data,
392 .controller_data = &spi_flash_chip_info,
397 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
398 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
400 .modalias = "ad183x",
401 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
406 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
408 .modalias = "mmc_spi",
409 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
412 .controller_data = &mmc_spi_chip_info,
416 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
418 .modalias = "ad7877",
419 .platform_data = &bfin_ad7877_ts_info,
421 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
426 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
427 && defined(CONFIG_SND_SOC_WM8731_SPI)
429 .modalias = "wm8731",
430 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
436 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
438 .modalias = "spidev",
439 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
446 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
447 /* SPI controller data */
448 static struct bfin5xx_spi_master bfin_spi0_info = {
450 .enable_dma = 1, /* master has the ability to do dma transfer */
451 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
455 static struct resource bfin_spi0_resource[] = {
457 .start = SPI0_REGBASE,
458 .end = SPI0_REGBASE + 0xFF,
459 .flags = IORESOURCE_MEM,
464 .flags = IORESOURCE_DMA,
469 .flags = IORESOURCE_IRQ,
473 static struct platform_device bfin_spi0_device = {
475 .id = 0, /* Bus number */
476 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
477 .resource = bfin_spi0_resource,
479 .platform_data = &bfin_spi0_info, /* Passed to driver */
482 #endif /* spi master and devices */
484 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
485 static struct mtd_partition cm_partitions[] = {
487 .name = "bootloader(nor)",
491 .name = "linux kernel(nor)",
493 .offset = MTDPART_OFS_APPEND,
495 .name = "file system(nor)",
496 .size = MTDPART_SIZ_FULL,
497 .offset = MTDPART_OFS_APPEND,
501 static struct physmap_flash_data cm_flash_data = {
503 .parts = cm_partitions,
504 .nr_parts = ARRAY_SIZE(cm_partitions),
507 static unsigned cm_flash_gpios[] = { GPIO_PH9, GPIO_PG11 };
509 static struct resource cm_flash_resource[] = {
514 .flags = IORESOURCE_MEM,
516 .start = (unsigned long)cm_flash_gpios,
517 .end = ARRAY_SIZE(cm_flash_gpios),
518 .flags = IORESOURCE_IRQ,
522 static struct platform_device cm_flash_device = {
523 .name = "gpio-addr-flash",
526 .platform_data = &cm_flash_data,
528 .num_resources = ARRAY_SIZE(cm_flash_resource),
529 .resource = cm_flash_resource,
533 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
534 #ifdef CONFIG_SERIAL_BFIN_UART0
535 static struct resource bfin_uart0_resources[] = {
539 .flags = IORESOURCE_MEM,
542 .start = IRQ_UART0_TX,
544 .flags = IORESOURCE_IRQ,
547 .start = IRQ_UART0_RX,
549 .flags = IORESOURCE_IRQ,
552 .start = IRQ_UART0_ERROR,
553 .end = IRQ_UART0_ERROR,
554 .flags = IORESOURCE_IRQ,
557 .start = CH_UART0_TX,
559 .flags = IORESOURCE_DMA,
562 .start = CH_UART0_RX,
564 .flags = IORESOURCE_DMA,
568 static unsigned short bfin_uart0_peripherals[] = {
569 P_UART0_TX, P_UART0_RX, 0
572 static struct platform_device bfin_uart0_device = {
575 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
576 .resource = bfin_uart0_resources,
578 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
582 #ifdef CONFIG_SERIAL_BFIN_UART1
583 static struct resource bfin_uart1_resources[] = {
587 .flags = IORESOURCE_MEM,
590 .start = IRQ_UART1_TX,
592 .flags = IORESOURCE_IRQ,
595 .start = IRQ_UART1_RX,
597 .flags = IORESOURCE_IRQ,
600 .start = IRQ_UART1_ERROR,
601 .end = IRQ_UART1_ERROR,
602 .flags = IORESOURCE_IRQ,
605 .start = CH_UART1_TX,
607 .flags = IORESOURCE_DMA,
610 .start = CH_UART1_RX,
612 .flags = IORESOURCE_DMA,
614 #ifdef CONFIG_BFIN_UART1_CTSRTS
618 .flags = IORESOURCE_IO,
623 .flags = IORESOURCE_IO,
628 static unsigned short bfin_uart1_peripherals[] = {
629 P_UART1_TX, P_UART1_RX, 0
632 static struct platform_device bfin_uart1_device = {
635 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
636 .resource = bfin_uart1_resources,
638 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
644 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
645 #ifdef CONFIG_BFIN_SIR0
646 static struct resource bfin_sir0_resources[] = {
650 .flags = IORESOURCE_MEM,
653 .start = IRQ_UART0_RX,
654 .end = IRQ_UART0_RX+1,
655 .flags = IORESOURCE_IRQ,
658 .start = CH_UART0_RX,
659 .end = CH_UART0_RX+1,
660 .flags = IORESOURCE_DMA,
664 static struct platform_device bfin_sir0_device = {
667 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
668 .resource = bfin_sir0_resources,
671 #ifdef CONFIG_BFIN_SIR1
672 static struct resource bfin_sir1_resources[] = {
676 .flags = IORESOURCE_MEM,
679 .start = IRQ_UART1_RX,
680 .end = IRQ_UART1_RX+1,
681 .flags = IORESOURCE_IRQ,
684 .start = CH_UART1_RX,
685 .end = CH_UART1_RX+1,
686 .flags = IORESOURCE_DMA,
690 static struct platform_device bfin_sir1_device = {
693 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
694 .resource = bfin_sir1_resources,
699 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
700 static struct resource bfin_twi0_resource[] = {
702 .start = TWI0_REGBASE,
704 .flags = IORESOURCE_MEM,
709 .flags = IORESOURCE_IRQ,
713 static struct platform_device i2c_bfin_twi_device = {
714 .name = "i2c-bfin-twi",
716 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
717 .resource = bfin_twi0_resource,
721 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
722 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
724 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
727 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
729 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
733 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
735 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
740 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
741 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
742 static struct resource bfin_sport0_uart_resources[] = {
744 .start = SPORT0_TCR1,
745 .end = SPORT0_MRCS3+4,
746 .flags = IORESOURCE_MEM,
749 .start = IRQ_SPORT0_RX,
750 .end = IRQ_SPORT0_RX+1,
751 .flags = IORESOURCE_IRQ,
754 .start = IRQ_SPORT0_ERROR,
755 .end = IRQ_SPORT0_ERROR,
756 .flags = IORESOURCE_IRQ,
760 static unsigned short bfin_sport0_peripherals[] = {
761 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
762 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
765 static struct platform_device bfin_sport0_uart_device = {
766 .name = "bfin-sport-uart",
768 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
769 .resource = bfin_sport0_uart_resources,
771 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
775 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
776 static struct resource bfin_sport1_uart_resources[] = {
778 .start = SPORT1_TCR1,
779 .end = SPORT1_MRCS3+4,
780 .flags = IORESOURCE_MEM,
783 .start = IRQ_SPORT1_RX,
784 .end = IRQ_SPORT1_RX+1,
785 .flags = IORESOURCE_IRQ,
788 .start = IRQ_SPORT1_ERROR,
789 .end = IRQ_SPORT1_ERROR,
790 .flags = IORESOURCE_IRQ,
794 static unsigned short bfin_sport1_peripherals[] = {
795 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
796 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
799 static struct platform_device bfin_sport1_uart_device = {
800 .name = "bfin-sport-uart",
802 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
803 .resource = bfin_sport1_uart_resources,
805 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
811 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
812 #include <linux/input.h>
813 #include <linux/gpio_keys.h>
814 #include <linux/export.h>
816 static struct gpio_keys_button bfin_gpio_keys_table[] = {
817 {BTN_0, GPIO_PF14, 1, "gpio-keys: BTN0"},
820 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
821 .buttons = bfin_gpio_keys_table,
822 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
825 static struct platform_device bfin_device_gpiokeys = {
828 .platform_data = &bfin_gpio_keys_data,
833 static const unsigned int cclk_vlev_datasheet[] =
835 VRPAIR(VLEV_100, 400000000),
836 VRPAIR(VLEV_105, 426000000),
837 VRPAIR(VLEV_110, 500000000),
838 VRPAIR(VLEV_115, 533000000),
839 VRPAIR(VLEV_120, 600000000),
842 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
843 .tuple_tab = cclk_vlev_datasheet,
844 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
845 .vr_settling_time = 25 /* us */,
848 static struct platform_device bfin_dpmc = {
851 .platform_data = &bfin_dmpc_vreg_data,
855 static struct platform_device *cmbf527_devices[] __initdata = {
859 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
863 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
864 &bfin_pcmcia_cf_device,
867 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
871 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
872 &bfin_isp1760_device,
875 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
879 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
883 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
887 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
892 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
893 &net2272_bfin_device,
896 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
900 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
901 #ifdef CONFIG_SERIAL_BFIN_UART0
904 #ifdef CONFIG_SERIAL_BFIN_UART1
909 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
910 #ifdef CONFIG_BFIN_SIR0
913 #ifdef CONFIG_BFIN_SIR1
918 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
919 &i2c_bfin_twi_device,
922 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
923 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
924 &bfin_sport0_uart_device,
926 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
927 &bfin_sport1_uart_device,
931 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
932 &bfin_device_gpiokeys,
935 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
940 static int __init cm_init(void)
942 printk(KERN_INFO "%s(): registering device resources\n", __func__);
943 i2c_register_board_info(0, bfin_i2c_board_info,
944 ARRAY_SIZE(bfin_i2c_board_info));
945 platform_add_devices(cmbf527_devices, ARRAY_SIZE(cmbf527_devices));
946 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
950 arch_initcall(cm_init);
952 static struct platform_device *cmbf527_early_devices[] __initdata = {
953 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
954 #ifdef CONFIG_SERIAL_BFIN_UART0
957 #ifdef CONFIG_SERIAL_BFIN_UART1
962 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
963 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
964 &bfin_sport0_uart_device,
966 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
967 &bfin_sport1_uart_device,
972 void __init native_machine_early_platform_add_devices(void)
974 printk(KERN_INFO "register early platform devices\n");
975 early_platform_add_devices(cmbf527_early_devices,
976 ARRAY_SIZE(cmbf527_early_devices));
979 void native_machine_restart(char *cmd)
981 /* workaround reboot hang when booting from SPI */
982 if ((bfin_read_SYSCR() & 0x7) == 0x3)
983 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
986 void bfin_get_ether_addr(char *addr)
988 random_ether_addr(addr);
989 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
991 EXPORT_SYMBOL(bfin_get_ether_addr);