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/export.h>
12 #include <linux/platform_device.h>
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/partitions.h>
15 #include <linux/mtd/physmap.h>
16 #include <linux/spi/spi.h>
17 #include <linux/spi/flash.h>
18 #include <linux/etherdevice.h>
19 #include <linux/i2c.h>
20 #include <linux/irq.h>
21 #include <linux/interrupt.h>
22 #include <linux/usb/musb.h>
24 #include <asm/bfin5xx_spi.h>
25 #include <asm/reboot.h>
27 #include <asm/portmux.h>
29 #include <linux/spi/ad7877.h>
32 * Name the Board for the /proc/cpuinfo
34 const char bfin_board_name
[] = "Bluetechnix CM-BF527";
37 * Driver needs to know address, irq and flag pin.
40 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
41 #include <linux/usb/isp1760.h>
42 static struct resource bfin_isp1760_resources
[] = {
45 .end
= 0x203C0000 + 0x000fffff,
46 .flags
= IORESOURCE_MEM
,
51 .flags
= IORESOURCE_IRQ
,
55 static struct isp1760_platform_data isp1760_priv
= {
60 .dack_polarity_high
= 0,
61 .dreq_polarity_high
= 0,
64 static struct platform_device bfin_isp1760_device
= {
68 .platform_data
= &isp1760_priv
,
70 .num_resources
= ARRAY_SIZE(bfin_isp1760_resources
),
71 .resource
= bfin_isp1760_resources
,
75 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
76 static struct resource musb_resources
[] = {
80 .flags
= IORESOURCE_MEM
,
82 [1] = { /* general IRQ */
83 .start
= IRQ_USB_INT0
,
85 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
91 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
96 static struct musb_hdrc_config musb_config
= {
103 .gpio_vrsel
= GPIO_PF11
,
104 /* Some custom boards need to be active low, just set it to "0"
107 .gpio_vrsel_active
= 1,
108 .clkin
= 24, /* musb CLKIN in MHZ */
111 static struct musb_hdrc_platform_data musb_plat
= {
112 #if defined(CONFIG_USB_MUSB_OTG)
114 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
116 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
117 .mode
= MUSB_PERIPHERAL
,
119 .config
= &musb_config
,
122 static u64 musb_dmamask
= ~(u32
)0;
124 static struct platform_device musb_device
= {
125 .name
= "musb-blackfin",
128 .dma_mask
= &musb_dmamask
,
129 .coherent_dma_mask
= 0xffffffff,
130 .platform_data
= &musb_plat
,
132 .num_resources
= ARRAY_SIZE(musb_resources
),
133 .resource
= musb_resources
,
137 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
138 static struct mtd_partition partition_info
[] = {
140 .name
= "linux kernel(nand)",
142 .size
= 4 * 1024 * 1024,
145 .name
= "file system(nand)",
146 .offset
= MTDPART_OFS_APPEND
,
147 .size
= MTDPART_SIZ_FULL
,
151 static struct bf5xx_nand_platform bf5xx_nand_platform
= {
152 .data_width
= NFC_NWIDTH_8
,
153 .partitions
= partition_info
,
154 .nr_partitions
= ARRAY_SIZE(partition_info
),
159 static struct resource bf5xx_nand_resources
[] = {
162 .end
= NFC_DATA_RD
+ 2,
163 .flags
= IORESOURCE_MEM
,
168 .flags
= IORESOURCE_IRQ
,
172 static struct platform_device bf5xx_nand_device
= {
173 .name
= "bf5xx-nand",
175 .num_resources
= ARRAY_SIZE(bf5xx_nand_resources
),
176 .resource
= bf5xx_nand_resources
,
178 .platform_data
= &bf5xx_nand_platform
,
183 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
184 static struct resource bfin_pcmcia_cf_resources
[] = {
186 .start
= 0x20310000, /* IO PORT */
188 .flags
= IORESOURCE_MEM
,
190 .start
= 0x20311000, /* Attribute Memory */
192 .flags
= IORESOURCE_MEM
,
196 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
198 .start
= 6, /* Card Detect PF6 */
200 .flags
= IORESOURCE_IRQ
,
204 static struct platform_device bfin_pcmcia_cf_device
= {
205 .name
= "bfin_cf_pcmcia",
207 .num_resources
= ARRAY_SIZE(bfin_pcmcia_cf_resources
),
208 .resource
= bfin_pcmcia_cf_resources
,
212 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
213 static struct platform_device rtc_device
= {
219 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
220 #include <linux/smc91x.h>
222 static struct smc91x_platdata smc91x_info
= {
223 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
224 .leda
= RPC_LED_100_10
,
225 .ledb
= RPC_LED_TX_RX
,
228 static struct resource smc91x_resources
[] = {
230 .name
= "smc91x-regs",
232 .end
= 0x20300300 + 16,
233 .flags
= IORESOURCE_MEM
,
238 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
241 static struct platform_device smc91x_device
= {
244 .num_resources
= ARRAY_SIZE(smc91x_resources
),
245 .resource
= smc91x_resources
,
247 .platform_data
= &smc91x_info
,
252 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
253 static struct resource dm9000_resources
[] = {
256 .end
= 0x203FB800 + 1,
257 .flags
= IORESOURCE_MEM
,
261 .end
= 0x203FB804 + 1,
262 .flags
= IORESOURCE_MEM
,
267 .flags
= (IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHEDGE
),
271 static struct platform_device dm9000_device
= {
274 .num_resources
= ARRAY_SIZE(dm9000_resources
),
275 .resource
= dm9000_resources
,
279 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
280 #include <linux/bfin_mac.h>
281 static const unsigned short bfin_mac_peripherals
[] = P_RMII0
;
283 static struct bfin_phydev_platform_data bfin_phydev_data
[] = {
286 .irq
= IRQ_MAC_PHYINT
,
290 static struct bfin_mii_bus_platform_data bfin_mii_bus_data
= {
292 .phydev_data
= bfin_phydev_data
,
293 .phy_mode
= PHY_INTERFACE_MODE_RMII
,
294 .mac_peripherals
= bfin_mac_peripherals
,
297 static struct platform_device bfin_mii_bus
= {
298 .name
= "bfin_mii_bus",
300 .platform_data
= &bfin_mii_bus_data
,
304 static struct platform_device bfin_mac_device
= {
307 .platform_data
= &bfin_mii_bus
,
312 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
313 static struct resource net2272_bfin_resources
[] = {
316 .end
= 0x20300000 + 0x100,
317 .flags
= IORESOURCE_MEM
,
321 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
325 static struct platform_device net2272_bfin_device
= {
328 .num_resources
= ARRAY_SIZE(net2272_bfin_resources
),
329 .resource
= net2272_bfin_resources
,
333 #if defined(CONFIG_MTD_M25P80) \
334 || defined(CONFIG_MTD_M25P80_MODULE)
335 static struct mtd_partition bfin_spi_flash_partitions
[] = {
337 .name
= "bootloader(spi)",
340 .mask_flags
= MTD_CAP_ROM
342 .name
= "linux kernel(spi)",
343 .size
= MTDPART_SIZ_FULL
,
344 .offset
= MTDPART_OFS_APPEND
,
348 static struct flash_platform_data bfin_spi_flash_data
= {
350 .parts
= bfin_spi_flash_partitions
,
351 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
355 /* SPI flash chip (m25p64) */
356 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
357 .enable_dma
= 0, /* use dma transfer with this chip*/
361 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
362 static struct bfin5xx_spi_chip mmc_spi_chip_info
= {
367 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
368 static const struct ad7877_platform_data bfin_ad7877_ts_info
= {
370 .vref_delay_usecs
= 50, /* internal, no capacitor */
373 .pressure_max
= 1000,
375 .stopacq_polarity
= 1,
376 .first_conversion_delay
= 3,
377 .acquisition_time
= 1,
379 .pen_down_acc_interval
= 1,
383 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
384 #if defined(CONFIG_MTD_M25P80) \
385 || defined(CONFIG_MTD_M25P80_MODULE)
387 /* the modalias must be the same as spi device driver name */
388 .modalias
= "m25p80", /* Name of spi_driver for this device */
389 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
390 .bus_num
= 0, /* Framework bus number */
391 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
392 .platform_data
= &bfin_spi_flash_data
,
393 .controller_data
= &spi_flash_chip_info
,
398 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
399 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
401 .modalias
= "ad183x",
402 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
407 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
409 .modalias
= "mmc_spi",
410 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
413 .controller_data
= &mmc_spi_chip_info
,
417 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
419 .modalias
= "ad7877",
420 .platform_data
= &bfin_ad7877_ts_info
,
422 .max_speed_hz
= 12500000, /* max spi clock (SCK) speed in HZ */
427 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
428 && defined(CONFIG_SND_SOC_WM8731_SPI)
430 .modalias
= "wm8731",
431 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
437 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
439 .modalias
= "spidev",
440 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
447 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
448 /* SPI controller data */
449 static struct bfin5xx_spi_master bfin_spi0_info
= {
451 .enable_dma
= 1, /* master has the ability to do dma transfer */
452 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
456 static struct resource bfin_spi0_resource
[] = {
458 .start
= SPI0_REGBASE
,
459 .end
= SPI0_REGBASE
+ 0xFF,
460 .flags
= IORESOURCE_MEM
,
465 .flags
= IORESOURCE_DMA
,
470 .flags
= IORESOURCE_IRQ
,
474 static struct platform_device bfin_spi0_device
= {
476 .id
= 0, /* Bus number */
477 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
478 .resource
= bfin_spi0_resource
,
480 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
483 #endif /* spi master and devices */
485 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
486 static struct mtd_partition cm_partitions
[] = {
488 .name
= "bootloader(nor)",
492 .name
= "linux kernel(nor)",
494 .offset
= MTDPART_OFS_APPEND
,
496 .name
= "file system(nor)",
497 .size
= MTDPART_SIZ_FULL
,
498 .offset
= MTDPART_OFS_APPEND
,
502 static struct physmap_flash_data cm_flash_data
= {
504 .parts
= cm_partitions
,
505 .nr_parts
= ARRAY_SIZE(cm_partitions
),
508 static unsigned cm_flash_gpios
[] = { GPIO_PH9
, GPIO_PG11
};
510 static struct resource cm_flash_resource
[] = {
515 .flags
= IORESOURCE_MEM
,
517 .start
= (unsigned long)cm_flash_gpios
,
518 .end
= ARRAY_SIZE(cm_flash_gpios
),
519 .flags
= IORESOURCE_IRQ
,
523 static struct platform_device cm_flash_device
= {
524 .name
= "gpio-addr-flash",
527 .platform_data
= &cm_flash_data
,
529 .num_resources
= ARRAY_SIZE(cm_flash_resource
),
530 .resource
= cm_flash_resource
,
534 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
535 #ifdef CONFIG_SERIAL_BFIN_UART0
536 static struct resource bfin_uart0_resources
[] = {
540 .flags
= IORESOURCE_MEM
,
543 .start
= IRQ_UART0_TX
,
545 .flags
= IORESOURCE_IRQ
,
548 .start
= IRQ_UART0_RX
,
550 .flags
= IORESOURCE_IRQ
,
553 .start
= IRQ_UART0_ERROR
,
554 .end
= IRQ_UART0_ERROR
,
555 .flags
= IORESOURCE_IRQ
,
558 .start
= CH_UART0_TX
,
560 .flags
= IORESOURCE_DMA
,
563 .start
= CH_UART0_RX
,
565 .flags
= IORESOURCE_DMA
,
569 static unsigned short bfin_uart0_peripherals
[] = {
570 P_UART0_TX
, P_UART0_RX
, 0
573 static struct platform_device bfin_uart0_device
= {
576 .num_resources
= ARRAY_SIZE(bfin_uart0_resources
),
577 .resource
= bfin_uart0_resources
,
579 .platform_data
= &bfin_uart0_peripherals
, /* Passed to driver */
583 #ifdef CONFIG_SERIAL_BFIN_UART1
584 static struct resource bfin_uart1_resources
[] = {
588 .flags
= IORESOURCE_MEM
,
591 .start
= IRQ_UART1_TX
,
593 .flags
= IORESOURCE_IRQ
,
596 .start
= IRQ_UART1_RX
,
598 .flags
= IORESOURCE_IRQ
,
601 .start
= IRQ_UART1_ERROR
,
602 .end
= IRQ_UART1_ERROR
,
603 .flags
= IORESOURCE_IRQ
,
606 .start
= CH_UART1_TX
,
608 .flags
= IORESOURCE_DMA
,
611 .start
= CH_UART1_RX
,
613 .flags
= IORESOURCE_DMA
,
615 #ifdef CONFIG_BFIN_UART1_CTSRTS
619 .flags
= IORESOURCE_IO
,
624 .flags
= IORESOURCE_IO
,
629 static unsigned short bfin_uart1_peripherals
[] = {
630 P_UART1_TX
, P_UART1_RX
, 0
633 static struct platform_device bfin_uart1_device
= {
636 .num_resources
= ARRAY_SIZE(bfin_uart1_resources
),
637 .resource
= bfin_uart1_resources
,
639 .platform_data
= &bfin_uart1_peripherals
, /* Passed to driver */
645 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
646 #ifdef CONFIG_BFIN_SIR0
647 static struct resource bfin_sir0_resources
[] = {
651 .flags
= IORESOURCE_MEM
,
654 .start
= IRQ_UART0_RX
,
655 .end
= IRQ_UART0_RX
+1,
656 .flags
= IORESOURCE_IRQ
,
659 .start
= CH_UART0_RX
,
660 .end
= CH_UART0_RX
+1,
661 .flags
= IORESOURCE_DMA
,
665 static struct platform_device bfin_sir0_device
= {
668 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
669 .resource
= bfin_sir0_resources
,
672 #ifdef CONFIG_BFIN_SIR1
673 static struct resource bfin_sir1_resources
[] = {
677 .flags
= IORESOURCE_MEM
,
680 .start
= IRQ_UART1_RX
,
681 .end
= IRQ_UART1_RX
+1,
682 .flags
= IORESOURCE_IRQ
,
685 .start
= CH_UART1_RX
,
686 .end
= CH_UART1_RX
+1,
687 .flags
= IORESOURCE_DMA
,
691 static struct platform_device bfin_sir1_device
= {
694 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
695 .resource
= bfin_sir1_resources
,
700 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
701 static struct resource bfin_twi0_resource
[] = {
703 .start
= TWI0_REGBASE
,
705 .flags
= IORESOURCE_MEM
,
710 .flags
= IORESOURCE_IRQ
,
714 static struct platform_device i2c_bfin_twi_device
= {
715 .name
= "i2c-bfin-twi",
717 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
718 .resource
= bfin_twi0_resource
,
722 static struct i2c_board_info __initdata bfin_i2c_board_info
[] = {
723 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
725 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
728 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
730 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
734 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
736 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
741 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
742 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
743 static struct resource bfin_sport0_uart_resources
[] = {
745 .start
= SPORT0_TCR1
,
746 .end
= SPORT0_MRCS3
+4,
747 .flags
= IORESOURCE_MEM
,
750 .start
= IRQ_SPORT0_RX
,
751 .end
= IRQ_SPORT0_RX
+1,
752 .flags
= IORESOURCE_IRQ
,
755 .start
= IRQ_SPORT0_ERROR
,
756 .end
= IRQ_SPORT0_ERROR
,
757 .flags
= IORESOURCE_IRQ
,
761 static unsigned short bfin_sport0_peripherals
[] = {
762 P_SPORT0_TFS
, P_SPORT0_DTPRI
, P_SPORT0_TSCLK
, P_SPORT0_RFS
,
763 P_SPORT0_DRPRI
, P_SPORT0_RSCLK
, 0
766 static struct platform_device bfin_sport0_uart_device
= {
767 .name
= "bfin-sport-uart",
769 .num_resources
= ARRAY_SIZE(bfin_sport0_uart_resources
),
770 .resource
= bfin_sport0_uart_resources
,
772 .platform_data
= &bfin_sport0_peripherals
, /* Passed to driver */
776 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
777 static struct resource bfin_sport1_uart_resources
[] = {
779 .start
= SPORT1_TCR1
,
780 .end
= SPORT1_MRCS3
+4,
781 .flags
= IORESOURCE_MEM
,
784 .start
= IRQ_SPORT1_RX
,
785 .end
= IRQ_SPORT1_RX
+1,
786 .flags
= IORESOURCE_IRQ
,
789 .start
= IRQ_SPORT1_ERROR
,
790 .end
= IRQ_SPORT1_ERROR
,
791 .flags
= IORESOURCE_IRQ
,
795 static unsigned short bfin_sport1_peripherals
[] = {
796 P_SPORT1_TFS
, P_SPORT1_DTPRI
, P_SPORT1_TSCLK
, P_SPORT1_RFS
,
797 P_SPORT1_DRPRI
, P_SPORT1_RSCLK
, 0
800 static struct platform_device bfin_sport1_uart_device
= {
801 .name
= "bfin-sport-uart",
803 .num_resources
= ARRAY_SIZE(bfin_sport1_uart_resources
),
804 .resource
= bfin_sport1_uart_resources
,
806 .platform_data
= &bfin_sport1_peripherals
, /* Passed to driver */
812 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
813 #include <linux/input.h>
814 #include <linux/gpio_keys.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_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_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
);