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 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
19 #include <linux/usb/isp1362.h>
21 #include <linux/i2c.h>
22 #include <linux/irq.h>
23 #include <linux/interrupt.h>
24 #include <linux/usb/sl811.h>
25 #include <linux/usb/musb.h>
27 #include <asm/bfin5xx_spi.h>
28 #include <asm/reboot.h>
30 #include <asm/portmux.h>
32 #include <linux/spi/ad7877.h>
35 * Name the Board for the /proc/cpuinfo
37 const char bfin_board_name
[] = "Bluetechnix CM-BF527";
40 * Driver needs to know address, irq and flag pin.
43 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
44 #include <linux/usb/isp1760.h>
45 static struct resource bfin_isp1760_resources
[] = {
48 .end
= 0x203C0000 + 0x000fffff,
49 .flags
= IORESOURCE_MEM
,
54 .flags
= IORESOURCE_IRQ
,
58 static struct isp1760_platform_data isp1760_priv
= {
63 .dack_polarity_high
= 0,
64 .dreq_polarity_high
= 0,
67 static struct platform_device bfin_isp1760_device
= {
68 .name
= "isp1760-hcd",
71 .platform_data
= &isp1760_priv
,
73 .num_resources
= ARRAY_SIZE(bfin_isp1760_resources
),
74 .resource
= bfin_isp1760_resources
,
78 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
79 static struct resource musb_resources
[] = {
83 .flags
= IORESOURCE_MEM
,
85 [1] = { /* general IRQ */
86 .start
= IRQ_USB_INT0
,
88 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
93 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
97 static struct musb_hdrc_config musb_config
= {
104 .gpio_vrsel
= GPIO_PF11
,
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_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
277 static struct resource sl811_hcd_resources
[] = {
281 .flags
= IORESOURCE_MEM
,
285 .flags
= IORESOURCE_MEM
,
287 .start
= CONFIG_USB_SL811_BFIN_IRQ
,
288 .end
= CONFIG_USB_SL811_BFIN_IRQ
,
289 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
293 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
294 void sl811_port_power(struct device
*dev
, int is_on
)
296 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, "usb:SL811_VBUS");
297 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, is_on
);
301 static struct sl811_platform_data sl811_priv
= {
303 .power
= 250, /* == 500mA */
304 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
305 .port_power
= &sl811_port_power
,
309 static struct platform_device sl811_hcd_device
= {
313 .platform_data
= &sl811_priv
,
315 .num_resources
= ARRAY_SIZE(sl811_hcd_resources
),
316 .resource
= sl811_hcd_resources
,
320 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
321 static struct resource isp1362_hcd_resources
[] = {
325 .flags
= IORESOURCE_MEM
,
329 .flags
= IORESOURCE_MEM
,
331 .start
= CONFIG_USB_ISP1362_BFIN_GPIO_IRQ
,
332 .end
= CONFIG_USB_ISP1362_BFIN_GPIO_IRQ
,
333 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
337 static struct isp1362_platform_data isp1362_priv
= {
342 .int_edge_triggered
= 0,
343 .remote_wakeup_connected
= 0,
344 .no_power_switching
= 1,
345 .power_switching_mode
= 0,
348 static struct platform_device isp1362_hcd_device
= {
349 .name
= "isp1362-hcd",
352 .platform_data
= &isp1362_priv
,
354 .num_resources
= ARRAY_SIZE(isp1362_hcd_resources
),
355 .resource
= isp1362_hcd_resources
,
359 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
360 static struct platform_device bfin_mii_bus
= {
361 .name
= "bfin_mii_bus",
364 static struct platform_device bfin_mac_device
= {
366 .dev
.platform_data
= &bfin_mii_bus
,
370 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
371 static struct resource net2272_bfin_resources
[] = {
374 .end
= 0x20300000 + 0x100,
375 .flags
= IORESOURCE_MEM
,
379 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
383 static struct platform_device net2272_bfin_device
= {
386 .num_resources
= ARRAY_SIZE(net2272_bfin_resources
),
387 .resource
= net2272_bfin_resources
,
391 #if defined(CONFIG_MTD_M25P80) \
392 || defined(CONFIG_MTD_M25P80_MODULE)
393 static struct mtd_partition bfin_spi_flash_partitions
[] = {
395 .name
= "bootloader(spi)",
398 .mask_flags
= MTD_CAP_ROM
400 .name
= "linux kernel(spi)",
401 .size
= MTDPART_SIZ_FULL
,
402 .offset
= MTDPART_OFS_APPEND
,
406 static struct flash_platform_data bfin_spi_flash_data
= {
408 .parts
= bfin_spi_flash_partitions
,
409 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
413 /* SPI flash chip (m25p64) */
414 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
415 .enable_dma
= 0, /* use dma transfer with this chip*/
420 #if defined(CONFIG_BFIN_SPI_ADC) \
421 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
423 static struct bfin5xx_spi_chip spi_adc_chip_info
= {
424 .enable_dma
= 1, /* use dma transfer with this chip*/
429 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
430 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
431 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
437 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
438 static struct bfin5xx_spi_chip mmc_spi_chip_info
= {
444 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
445 static struct bfin5xx_spi_chip spi_ad7877_chip_info
= {
450 static const struct ad7877_platform_data bfin_ad7877_ts_info
= {
452 .vref_delay_usecs
= 50, /* internal, no capacitor */
455 .pressure_max
= 1000,
457 .stopacq_polarity
= 1,
458 .first_conversion_delay
= 3,
459 .acquisition_time
= 1,
461 .pen_down_acc_interval
= 1,
465 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
466 && defined(CONFIG_SND_SOC_WM8731_SPI)
467 static struct bfin5xx_spi_chip spi_wm8731_chip_info
= {
473 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
474 static struct bfin5xx_spi_chip spidev_chip_info
= {
480 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
481 #if defined(CONFIG_MTD_M25P80) \
482 || defined(CONFIG_MTD_M25P80_MODULE)
484 /* the modalias must be the same as spi device driver name */
485 .modalias
= "m25p80", /* Name of spi_driver for this device */
486 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
487 .bus_num
= 0, /* Framework bus number */
488 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
489 .platform_data
= &bfin_spi_flash_data
,
490 .controller_data
= &spi_flash_chip_info
,
495 #if defined(CONFIG_BFIN_SPI_ADC) \
496 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
498 .modalias
= "bfin_spi_adc", /* Name of spi_driver for this device */
499 .max_speed_hz
= 6250000, /* max spi clock (SCK) speed in HZ */
500 .bus_num
= 0, /* Framework bus number */
501 .chip_select
= 1, /* Framework chip select. */
502 .platform_data
= NULL
, /* No spi_driver specific config */
503 .controller_data
= &spi_adc_chip_info
,
507 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
508 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
510 .modalias
= "ad1836",
511 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
513 .chip_select
= CONFIG_SND_BLACKFIN_SPI_PFBIT
,
514 .controller_data
= &ad1836_spi_chip_info
,
517 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
519 .modalias
= "mmc_spi",
520 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
523 .controller_data
= &mmc_spi_chip_info
,
527 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
529 .modalias
= "ad7877",
530 .platform_data
= &bfin_ad7877_ts_info
,
532 .max_speed_hz
= 12500000, /* max spi clock (SCK) speed in HZ */
535 .controller_data
= &spi_ad7877_chip_info
,
538 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
539 && defined(CONFIG_SND_SOC_WM8731_SPI)
541 .modalias
= "wm8731",
542 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
545 .controller_data
= &spi_wm8731_chip_info
,
549 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
551 .modalias
= "spidev",
552 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
555 .controller_data
= &spidev_chip_info
,
560 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
561 /* SPI controller data */
562 static struct bfin5xx_spi_master bfin_spi0_info
= {
564 .enable_dma
= 1, /* master has the ability to do dma transfer */
565 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
569 static struct resource bfin_spi0_resource
[] = {
571 .start
= SPI0_REGBASE
,
572 .end
= SPI0_REGBASE
+ 0xFF,
573 .flags
= IORESOURCE_MEM
,
578 .flags
= IORESOURCE_DMA
,
583 .flags
= IORESOURCE_IRQ
,
587 static struct platform_device bfin_spi0_device
= {
589 .id
= 0, /* Bus number */
590 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
591 .resource
= bfin_spi0_resource
,
593 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
596 #endif /* spi master and devices */
598 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
599 static struct mtd_partition cm_partitions
[] = {
601 .name
= "bootloader(nor)",
605 .name
= "linux kernel(nor)",
607 .offset
= MTDPART_OFS_APPEND
,
609 .name
= "file system(nor)",
610 .size
= MTDPART_SIZ_FULL
,
611 .offset
= MTDPART_OFS_APPEND
,
615 static struct physmap_flash_data cm_flash_data
= {
617 .parts
= cm_partitions
,
618 .nr_parts
= ARRAY_SIZE(cm_partitions
),
621 static unsigned cm_flash_gpios
[] = { GPIO_PH9
, GPIO_PG11
};
623 static struct resource cm_flash_resource
[] = {
628 .flags
= IORESOURCE_MEM
,
630 .start
= (unsigned long)cm_flash_gpios
,
631 .end
= ARRAY_SIZE(cm_flash_gpios
),
632 .flags
= IORESOURCE_IRQ
,
636 static struct platform_device cm_flash_device
= {
637 .name
= "gpio-addr-flash",
640 .platform_data
= &cm_flash_data
,
642 .num_resources
= ARRAY_SIZE(cm_flash_resource
),
643 .resource
= cm_flash_resource
,
647 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
648 static struct resource bfin_uart_resources
[] = {
649 #ifdef CONFIG_SERIAL_BFIN_UART0
653 .flags
= IORESOURCE_MEM
,
656 #ifdef CONFIG_SERIAL_BFIN_UART1
660 .flags
= IORESOURCE_MEM
,
665 static struct platform_device bfin_uart_device
= {
668 .num_resources
= ARRAY_SIZE(bfin_uart_resources
),
669 .resource
= bfin_uart_resources
,
673 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
674 #ifdef CONFIG_BFIN_SIR0
675 static struct resource bfin_sir0_resources
[] = {
679 .flags
= IORESOURCE_MEM
,
682 .start
= IRQ_UART0_RX
,
683 .end
= IRQ_UART0_RX
+1,
684 .flags
= IORESOURCE_IRQ
,
687 .start
= CH_UART0_RX
,
688 .end
= CH_UART0_RX
+1,
689 .flags
= IORESOURCE_DMA
,
693 static struct platform_device bfin_sir0_device
= {
696 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
697 .resource
= bfin_sir0_resources
,
700 #ifdef CONFIG_BFIN_SIR1
701 static struct resource bfin_sir1_resources
[] = {
705 .flags
= IORESOURCE_MEM
,
708 .start
= IRQ_UART1_RX
,
709 .end
= IRQ_UART1_RX
+1,
710 .flags
= IORESOURCE_IRQ
,
713 .start
= CH_UART1_RX
,
714 .end
= CH_UART1_RX
+1,
715 .flags
= IORESOURCE_DMA
,
719 static struct platform_device bfin_sir1_device
= {
722 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
723 .resource
= bfin_sir1_resources
,
728 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
729 static struct resource bfin_twi0_resource
[] = {
731 .start
= TWI0_REGBASE
,
733 .flags
= IORESOURCE_MEM
,
738 .flags
= IORESOURCE_IRQ
,
742 static struct platform_device i2c_bfin_twi_device
= {
743 .name
= "i2c-bfin-twi",
745 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
746 .resource
= bfin_twi0_resource
,
750 static struct i2c_board_info __initdata bfin_i2c_board_info
[] = {
751 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
753 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
756 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
758 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
762 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
764 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
769 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
770 static struct platform_device bfin_sport0_uart_device
= {
771 .name
= "bfin-sport-uart",
775 static struct platform_device bfin_sport1_uart_device
= {
776 .name
= "bfin-sport-uart",
781 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
782 #include <linux/input.h>
783 #include <linux/gpio_keys.h>
785 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
786 {BTN_0
, GPIO_PF14
, 1, "gpio-keys: BTN0"},
789 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
790 .buttons
= bfin_gpio_keys_table
,
791 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
794 static struct platform_device bfin_device_gpiokeys
= {
797 .platform_data
= &bfin_gpio_keys_data
,
802 static const unsigned int cclk_vlev_datasheet
[] =
804 VRPAIR(VLEV_100
, 400000000),
805 VRPAIR(VLEV_105
, 426000000),
806 VRPAIR(VLEV_110
, 500000000),
807 VRPAIR(VLEV_115
, 533000000),
808 VRPAIR(VLEV_120
, 600000000),
811 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
812 .tuple_tab
= cclk_vlev_datasheet
,
813 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
814 .vr_settling_time
= 25 /* us */,
817 static struct platform_device bfin_dpmc
= {
820 .platform_data
= &bfin_dmpc_vreg_data
,
824 static struct platform_device
*cmbf527_devices
[] __initdata
= {
828 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
832 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
833 &bfin_pcmcia_cf_device
,
836 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
840 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
844 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
848 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
849 &bfin_isp1760_device
,
852 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
856 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
860 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
864 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
869 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
870 &net2272_bfin_device
,
873 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
877 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
881 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
882 #ifdef CONFIG_BFIN_SIR0
885 #ifdef CONFIG_BFIN_SIR1
890 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
891 &i2c_bfin_twi_device
,
894 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
895 &bfin_sport0_uart_device
,
896 &bfin_sport1_uart_device
,
899 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
900 &bfin_device_gpiokeys
,
903 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
908 static int __init
cm_init(void)
910 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
911 i2c_register_board_info(0, bfin_i2c_board_info
,
912 ARRAY_SIZE(bfin_i2c_board_info
));
913 platform_add_devices(cmbf527_devices
, ARRAY_SIZE(cmbf527_devices
));
914 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
918 arch_initcall(cm_init
);
920 void native_machine_restart(char *cmd
)
922 /* workaround reboot hang when booting from SPI */
923 if ((bfin_read_SYSCR() & 0x7) == 0x3)
924 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS
);
927 void bfin_get_ether_addr(char *addr
)
929 random_ether_addr(addr
);
930 printk(KERN_WARNING
"%s:%s: Setting Ethernet MAC to a random one\n", __FILE__
, __func__
);
932 EXPORT_SYMBOL(bfin_get_ether_addr
);