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 IS_ENABLED(CONFIG_USB_ISP1760_HCD)
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 IS_ENABLED(CONFIG_USB_MUSB_HDRC)
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 IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
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 IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
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 IS_ENABLED(CONFIG_RTC_DRV_BFIN)
213 static struct platform_device rtc_device
= {
219 #if IS_ENABLED(CONFIG_SMC91X)
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 IS_ENABLED(CONFIG_DM9000)
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 IS_ENABLED(CONFIG_BFIN_MAC)
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 IS_ENABLED(CONFIG_USB_NET2272)
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 IS_ENABLED(CONFIG_MTD_M25P80)
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 IS_ENABLED(CONFIG_MMC_SPI)
361 static struct bfin5xx_spi_chip mmc_spi_chip_info
= {
366 #if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
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 IS_ENABLED(CONFIG_MTD_M25P80)
385 /* the modalias must be the same as spi device driver name */
386 .modalias
= "m25p80", /* Name of spi_driver for this device */
387 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
388 .bus_num
= 0, /* Framework bus number */
389 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
390 .platform_data
= &bfin_spi_flash_data
,
391 .controller_data
= &spi_flash_chip_info
,
396 #if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
398 .modalias
= "ad183x",
399 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
404 #if IS_ENABLED(CONFIG_MMC_SPI)
406 .modalias
= "mmc_spi",
407 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
410 .controller_data
= &mmc_spi_chip_info
,
414 #if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
416 .modalias
= "ad7877",
417 .platform_data
= &bfin_ad7877_ts_info
,
419 .max_speed_hz
= 12500000, /* max spi clock (SCK) speed in HZ */
424 #if IS_ENABLED(CONFIG_SND_SOC_WM8731) \
425 && defined(CONFIG_SND_SOC_WM8731_SPI)
427 .modalias
= "wm8731",
428 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
434 #if IS_ENABLED(CONFIG_SPI_SPIDEV)
436 .modalias
= "spidev",
437 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
444 #if IS_ENABLED(CONFIG_SPI_BFIN5XX)
445 /* SPI controller data */
446 static struct bfin5xx_spi_master bfin_spi0_info
= {
448 .enable_dma
= 1, /* master has the ability to do dma transfer */
449 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
453 static struct resource bfin_spi0_resource
[] = {
455 .start
= SPI0_REGBASE
,
456 .end
= SPI0_REGBASE
+ 0xFF,
457 .flags
= IORESOURCE_MEM
,
462 .flags
= IORESOURCE_DMA
,
467 .flags
= IORESOURCE_IRQ
,
471 static struct platform_device bfin_spi0_device
= {
473 .id
= 0, /* Bus number */
474 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
475 .resource
= bfin_spi0_resource
,
477 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
480 #endif /* spi master and devices */
482 #if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
483 static struct mtd_partition cm_partitions
[] = {
485 .name
= "bootloader(nor)",
489 .name
= "linux kernel(nor)",
491 .offset
= MTDPART_OFS_APPEND
,
493 .name
= "file system(nor)",
494 .size
= MTDPART_SIZ_FULL
,
495 .offset
= MTDPART_OFS_APPEND
,
499 static struct physmap_flash_data cm_flash_data
= {
501 .parts
= cm_partitions
,
502 .nr_parts
= ARRAY_SIZE(cm_partitions
),
505 static unsigned cm_flash_gpios
[] = { GPIO_PH9
, GPIO_PG11
};
507 static struct resource cm_flash_resource
[] = {
512 .flags
= IORESOURCE_MEM
,
514 .start
= (unsigned long)cm_flash_gpios
,
515 .end
= ARRAY_SIZE(cm_flash_gpios
),
516 .flags
= IORESOURCE_IRQ
,
520 static struct platform_device cm_flash_device
= {
521 .name
= "gpio-addr-flash",
524 .platform_data
= &cm_flash_data
,
526 .num_resources
= ARRAY_SIZE(cm_flash_resource
),
527 .resource
= cm_flash_resource
,
531 #if IS_ENABLED(CONFIG_SERIAL_BFIN)
532 #ifdef CONFIG_SERIAL_BFIN_UART0
533 static struct resource bfin_uart0_resources
[] = {
537 .flags
= IORESOURCE_MEM
,
540 .start
= IRQ_UART0_TX
,
542 .flags
= IORESOURCE_IRQ
,
545 .start
= IRQ_UART0_RX
,
547 .flags
= IORESOURCE_IRQ
,
550 .start
= IRQ_UART0_ERROR
,
551 .end
= IRQ_UART0_ERROR
,
552 .flags
= IORESOURCE_IRQ
,
555 .start
= CH_UART0_TX
,
557 .flags
= IORESOURCE_DMA
,
560 .start
= CH_UART0_RX
,
562 .flags
= IORESOURCE_DMA
,
566 static unsigned short bfin_uart0_peripherals
[] = {
567 P_UART0_TX
, P_UART0_RX
, 0
570 static struct platform_device bfin_uart0_device
= {
573 .num_resources
= ARRAY_SIZE(bfin_uart0_resources
),
574 .resource
= bfin_uart0_resources
,
576 .platform_data
= &bfin_uart0_peripherals
, /* Passed to driver */
580 #ifdef CONFIG_SERIAL_BFIN_UART1
581 static struct resource bfin_uart1_resources
[] = {
585 .flags
= IORESOURCE_MEM
,
588 .start
= IRQ_UART1_TX
,
590 .flags
= IORESOURCE_IRQ
,
593 .start
= IRQ_UART1_RX
,
595 .flags
= IORESOURCE_IRQ
,
598 .start
= IRQ_UART1_ERROR
,
599 .end
= IRQ_UART1_ERROR
,
600 .flags
= IORESOURCE_IRQ
,
603 .start
= CH_UART1_TX
,
605 .flags
= IORESOURCE_DMA
,
608 .start
= CH_UART1_RX
,
610 .flags
= IORESOURCE_DMA
,
612 #ifdef CONFIG_BFIN_UART1_CTSRTS
616 .flags
= IORESOURCE_IO
,
621 .flags
= IORESOURCE_IO
,
626 static unsigned short bfin_uart1_peripherals
[] = {
627 P_UART1_TX
, P_UART1_RX
, 0
630 static struct platform_device bfin_uart1_device
= {
633 .num_resources
= ARRAY_SIZE(bfin_uart1_resources
),
634 .resource
= bfin_uart1_resources
,
636 .platform_data
= &bfin_uart1_peripherals
, /* Passed to driver */
642 #if IS_ENABLED(CONFIG_BFIN_SIR)
643 #ifdef CONFIG_BFIN_SIR0
644 static struct resource bfin_sir0_resources
[] = {
648 .flags
= IORESOURCE_MEM
,
651 .start
= IRQ_UART0_RX
,
652 .end
= IRQ_UART0_RX
+1,
653 .flags
= IORESOURCE_IRQ
,
656 .start
= CH_UART0_RX
,
657 .end
= CH_UART0_RX
+1,
658 .flags
= IORESOURCE_DMA
,
662 static struct platform_device bfin_sir0_device
= {
665 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
666 .resource
= bfin_sir0_resources
,
669 #ifdef CONFIG_BFIN_SIR1
670 static struct resource bfin_sir1_resources
[] = {
674 .flags
= IORESOURCE_MEM
,
677 .start
= IRQ_UART1_RX
,
678 .end
= IRQ_UART1_RX
+1,
679 .flags
= IORESOURCE_IRQ
,
682 .start
= CH_UART1_RX
,
683 .end
= CH_UART1_RX
+1,
684 .flags
= IORESOURCE_DMA
,
688 static struct platform_device bfin_sir1_device
= {
691 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
692 .resource
= bfin_sir1_resources
,
697 #if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
698 static const u16 bfin_twi0_pins
[] = {P_TWI0_SCL
, P_TWI0_SDA
, 0};
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
,
719 .platform_data
= &bfin_twi0_pins
,
724 static struct i2c_board_info __initdata bfin_i2c_board_info
[] = {
725 #if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
727 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
730 #if IS_ENABLED(CONFIG_INPUT_PCF8574)
732 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
736 #if IS_ENABLED(CONFIG_FB_BFIN_7393)
738 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
743 #if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
744 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
745 static struct resource bfin_sport0_uart_resources
[] = {
747 .start
= SPORT0_TCR1
,
748 .end
= SPORT0_MRCS3
+4,
749 .flags
= IORESOURCE_MEM
,
752 .start
= IRQ_SPORT0_RX
,
753 .end
= IRQ_SPORT0_RX
+1,
754 .flags
= IORESOURCE_IRQ
,
757 .start
= IRQ_SPORT0_ERROR
,
758 .end
= IRQ_SPORT0_ERROR
,
759 .flags
= IORESOURCE_IRQ
,
763 static unsigned short bfin_sport0_peripherals
[] = {
764 P_SPORT0_TFS
, P_SPORT0_DTPRI
, P_SPORT0_TSCLK
, P_SPORT0_RFS
,
765 P_SPORT0_DRPRI
, P_SPORT0_RSCLK
, 0
768 static struct platform_device bfin_sport0_uart_device
= {
769 .name
= "bfin-sport-uart",
771 .num_resources
= ARRAY_SIZE(bfin_sport0_uart_resources
),
772 .resource
= bfin_sport0_uart_resources
,
774 .platform_data
= &bfin_sport0_peripherals
, /* Passed to driver */
778 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
779 static struct resource bfin_sport1_uart_resources
[] = {
781 .start
= SPORT1_TCR1
,
782 .end
= SPORT1_MRCS3
+4,
783 .flags
= IORESOURCE_MEM
,
786 .start
= IRQ_SPORT1_RX
,
787 .end
= IRQ_SPORT1_RX
+1,
788 .flags
= IORESOURCE_IRQ
,
791 .start
= IRQ_SPORT1_ERROR
,
792 .end
= IRQ_SPORT1_ERROR
,
793 .flags
= IORESOURCE_IRQ
,
797 static unsigned short bfin_sport1_peripherals
[] = {
798 P_SPORT1_TFS
, P_SPORT1_DTPRI
, P_SPORT1_TSCLK
, P_SPORT1_RFS
,
799 P_SPORT1_DRPRI
, P_SPORT1_RSCLK
, 0
802 static struct platform_device bfin_sport1_uart_device
= {
803 .name
= "bfin-sport-uart",
805 .num_resources
= ARRAY_SIZE(bfin_sport1_uart_resources
),
806 .resource
= bfin_sport1_uart_resources
,
808 .platform_data
= &bfin_sport1_peripherals
, /* Passed to driver */
814 #if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
815 #include <linux/input.h>
816 #include <linux/gpio_keys.h>
818 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
819 {BTN_0
, GPIO_PF14
, 1, "gpio-keys: BTN0"},
822 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
823 .buttons
= bfin_gpio_keys_table
,
824 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
827 static struct platform_device bfin_device_gpiokeys
= {
830 .platform_data
= &bfin_gpio_keys_data
,
835 static const unsigned int cclk_vlev_datasheet
[] =
837 VRPAIR(VLEV_100
, 400000000),
838 VRPAIR(VLEV_105
, 426000000),
839 VRPAIR(VLEV_110
, 500000000),
840 VRPAIR(VLEV_115
, 533000000),
841 VRPAIR(VLEV_120
, 600000000),
844 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
845 .tuple_tab
= cclk_vlev_datasheet
,
846 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
847 .vr_settling_time
= 25 /* us */,
850 static struct platform_device bfin_dpmc
= {
853 .platform_data
= &bfin_dmpc_vreg_data
,
857 static struct platform_device
*cmbf527_devices
[] __initdata
= {
861 #if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
865 #if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
866 &bfin_pcmcia_cf_device
,
869 #if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
873 #if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
874 &bfin_isp1760_device
,
877 #if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
881 #if IS_ENABLED(CONFIG_SMC91X)
885 #if IS_ENABLED(CONFIG_DM9000)
889 #if IS_ENABLED(CONFIG_BFIN_MAC)
894 #if IS_ENABLED(CONFIG_USB_NET2272)
895 &net2272_bfin_device
,
898 #if IS_ENABLED(CONFIG_SPI_BFIN5XX)
902 #if IS_ENABLED(CONFIG_SERIAL_BFIN)
903 #ifdef CONFIG_SERIAL_BFIN_UART0
906 #ifdef CONFIG_SERIAL_BFIN_UART1
911 #if IS_ENABLED(CONFIG_BFIN_SIR)
912 #ifdef CONFIG_BFIN_SIR0
915 #ifdef CONFIG_BFIN_SIR1
920 #if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
921 &i2c_bfin_twi_device
,
924 #if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
925 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
926 &bfin_sport0_uart_device
,
928 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
929 &bfin_sport1_uart_device
,
933 #if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
934 &bfin_device_gpiokeys
,
937 #if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
942 static int __init
cm_init(void)
944 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
945 i2c_register_board_info(0, bfin_i2c_board_info
,
946 ARRAY_SIZE(bfin_i2c_board_info
));
947 platform_add_devices(cmbf527_devices
, ARRAY_SIZE(cmbf527_devices
));
948 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
952 arch_initcall(cm_init
);
954 static struct platform_device
*cmbf527_early_devices
[] __initdata
= {
955 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
956 #ifdef CONFIG_SERIAL_BFIN_UART0
959 #ifdef CONFIG_SERIAL_BFIN_UART1
964 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
965 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
966 &bfin_sport0_uart_device
,
968 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
969 &bfin_sport1_uart_device
,
974 void __init
native_machine_early_platform_add_devices(void)
976 printk(KERN_INFO
"register early platform devices\n");
977 early_platform_add_devices(cmbf527_early_devices
,
978 ARRAY_SIZE(cmbf527_early_devices
));
981 void native_machine_restart(char *cmd
)
983 /* workaround reboot hang when booting from SPI */
984 if ((bfin_read_SYSCR() & 0x7) == 0x3)
985 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS
);
988 int bfin_get_ether_addr(char *addr
)
992 EXPORT_SYMBOL(bfin_get_ether_addr
);