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/sl811.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
,
90 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
94 static struct musb_hdrc_config musb_config
= {
101 .gpio_vrsel
= GPIO_PF11
,
104 static struct musb_hdrc_platform_data musb_plat
= {
105 #if defined(CONFIG_USB_MUSB_OTG)
107 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
109 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
110 .mode
= MUSB_PERIPHERAL
,
112 .config
= &musb_config
,
115 static u64 musb_dmamask
= ~(u32
)0;
117 static struct platform_device musb_device
= {
121 .dma_mask
= &musb_dmamask
,
122 .coherent_dma_mask
= 0xffffffff,
123 .platform_data
= &musb_plat
,
125 .num_resources
= ARRAY_SIZE(musb_resources
),
126 .resource
= musb_resources
,
130 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
131 static struct mtd_partition partition_info
[] = {
133 .name
= "linux kernel(nand)",
135 .size
= 4 * 1024 * 1024,
138 .name
= "file system(nand)",
139 .offset
= MTDPART_OFS_APPEND
,
140 .size
= MTDPART_SIZ_FULL
,
144 static struct bf5xx_nand_platform bf5xx_nand_platform
= {
145 .page_size
= NFC_PG_SIZE_256
,
146 .data_width
= NFC_NWIDTH_8
,
147 .partitions
= partition_info
,
148 .nr_partitions
= ARRAY_SIZE(partition_info
),
153 static struct resource bf5xx_nand_resources
[] = {
156 .end
= NFC_DATA_RD
+ 2,
157 .flags
= IORESOURCE_MEM
,
162 .flags
= IORESOURCE_IRQ
,
166 static struct platform_device bf5xx_nand_device
= {
167 .name
= "bf5xx-nand",
169 .num_resources
= ARRAY_SIZE(bf5xx_nand_resources
),
170 .resource
= bf5xx_nand_resources
,
172 .platform_data
= &bf5xx_nand_platform
,
177 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
178 static struct resource bfin_pcmcia_cf_resources
[] = {
180 .start
= 0x20310000, /* IO PORT */
182 .flags
= IORESOURCE_MEM
,
184 .start
= 0x20311000, /* Attribute Memory */
186 .flags
= IORESOURCE_MEM
,
190 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
192 .start
= 6, /* Card Detect PF6 */
194 .flags
= IORESOURCE_IRQ
,
198 static struct platform_device bfin_pcmcia_cf_device
= {
199 .name
= "bfin_cf_pcmcia",
201 .num_resources
= ARRAY_SIZE(bfin_pcmcia_cf_resources
),
202 .resource
= bfin_pcmcia_cf_resources
,
206 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
207 static struct platform_device rtc_device
= {
213 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
214 #include <linux/smc91x.h>
216 static struct smc91x_platdata smc91x_info
= {
217 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
218 .leda
= RPC_LED_100_10
,
219 .ledb
= RPC_LED_TX_RX
,
222 static struct resource smc91x_resources
[] = {
224 .name
= "smc91x-regs",
226 .end
= 0x20300300 + 16,
227 .flags
= IORESOURCE_MEM
,
232 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
235 static struct platform_device smc91x_device
= {
238 .num_resources
= ARRAY_SIZE(smc91x_resources
),
239 .resource
= smc91x_resources
,
241 .platform_data
= &smc91x_info
,
246 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
247 static struct resource dm9000_resources
[] = {
250 .end
= 0x203FB800 + 1,
251 .flags
= IORESOURCE_MEM
,
255 .end
= 0x203FB804 + 1,
256 .flags
= IORESOURCE_MEM
,
261 .flags
= (IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHEDGE
),
265 static struct platform_device dm9000_device
= {
268 .num_resources
= ARRAY_SIZE(dm9000_resources
),
269 .resource
= dm9000_resources
,
273 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
274 static struct resource sl811_hcd_resources
[] = {
278 .flags
= IORESOURCE_MEM
,
282 .flags
= IORESOURCE_MEM
,
284 .start
= CONFIG_USB_SL811_BFIN_IRQ
,
285 .end
= CONFIG_USB_SL811_BFIN_IRQ
,
286 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
290 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
291 void sl811_port_power(struct device
*dev
, int is_on
)
293 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, "usb:SL811_VBUS");
294 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, is_on
);
298 static struct sl811_platform_data sl811_priv
= {
300 .power
= 250, /* == 500mA */
301 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
302 .port_power
= &sl811_port_power
,
306 static struct platform_device sl811_hcd_device
= {
310 .platform_data
= &sl811_priv
,
312 .num_resources
= ARRAY_SIZE(sl811_hcd_resources
),
313 .resource
= sl811_hcd_resources
,
317 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
318 static struct platform_device bfin_mii_bus
= {
319 .name
= "bfin_mii_bus",
322 static struct platform_device bfin_mac_device
= {
324 .dev
.platform_data
= &bfin_mii_bus
,
328 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
329 static struct resource net2272_bfin_resources
[] = {
332 .end
= 0x20300000 + 0x100,
333 .flags
= IORESOURCE_MEM
,
337 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
341 static struct platform_device net2272_bfin_device
= {
344 .num_resources
= ARRAY_SIZE(net2272_bfin_resources
),
345 .resource
= net2272_bfin_resources
,
349 #if defined(CONFIG_MTD_M25P80) \
350 || defined(CONFIG_MTD_M25P80_MODULE)
351 static struct mtd_partition bfin_spi_flash_partitions
[] = {
353 .name
= "bootloader(spi)",
356 .mask_flags
= MTD_CAP_ROM
358 .name
= "linux kernel(spi)",
359 .size
= MTDPART_SIZ_FULL
,
360 .offset
= MTDPART_OFS_APPEND
,
364 static struct flash_platform_data bfin_spi_flash_data
= {
366 .parts
= bfin_spi_flash_partitions
,
367 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
371 /* SPI flash chip (m25p64) */
372 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
373 .enable_dma
= 0, /* use dma transfer with this chip*/
378 #if defined(CONFIG_BFIN_SPI_ADC) \
379 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
381 static struct bfin5xx_spi_chip spi_adc_chip_info
= {
382 .enable_dma
= 1, /* use dma transfer with this chip*/
387 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
388 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
389 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
395 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
396 static struct bfin5xx_spi_chip mmc_spi_chip_info
= {
402 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
403 static struct bfin5xx_spi_chip spi_ad7877_chip_info
= {
408 static const struct ad7877_platform_data bfin_ad7877_ts_info
= {
410 .vref_delay_usecs
= 50, /* internal, no capacitor */
413 .pressure_max
= 1000,
415 .stopacq_polarity
= 1,
416 .first_conversion_delay
= 3,
417 .acquisition_time
= 1,
419 .pen_down_acc_interval
= 1,
423 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
424 && defined(CONFIG_SND_SOC_WM8731_SPI)
425 static struct bfin5xx_spi_chip spi_wm8731_chip_info
= {
431 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
432 static struct bfin5xx_spi_chip spidev_chip_info
= {
438 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
439 #if defined(CONFIG_MTD_M25P80) \
440 || defined(CONFIG_MTD_M25P80_MODULE)
442 /* the modalias must be the same as spi device driver name */
443 .modalias
= "m25p80", /* Name of spi_driver for this device */
444 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
445 .bus_num
= 0, /* Framework bus number */
446 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
447 .platform_data
= &bfin_spi_flash_data
,
448 .controller_data
= &spi_flash_chip_info
,
453 #if defined(CONFIG_BFIN_SPI_ADC) \
454 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
456 .modalias
= "bfin_spi_adc", /* Name of spi_driver for this device */
457 .max_speed_hz
= 6250000, /* max spi clock (SCK) speed in HZ */
458 .bus_num
= 0, /* Framework bus number */
459 .chip_select
= 1, /* Framework chip select. */
460 .platform_data
= NULL
, /* No spi_driver specific config */
461 .controller_data
= &spi_adc_chip_info
,
465 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
466 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
468 .modalias
= "ad1836",
469 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
471 .chip_select
= CONFIG_SND_BLACKFIN_SPI_PFBIT
,
472 .controller_data
= &ad1836_spi_chip_info
,
475 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
477 .modalias
= "mmc_spi",
478 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
481 .controller_data
= &mmc_spi_chip_info
,
485 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
487 .modalias
= "ad7877",
488 .platform_data
= &bfin_ad7877_ts_info
,
490 .max_speed_hz
= 12500000, /* max spi clock (SCK) speed in HZ */
493 .controller_data
= &spi_ad7877_chip_info
,
496 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
497 && defined(CONFIG_SND_SOC_WM8731_SPI)
499 .modalias
= "wm8731",
500 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
503 .controller_data
= &spi_wm8731_chip_info
,
507 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
509 .modalias
= "spidev",
510 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
513 .controller_data
= &spidev_chip_info
,
518 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
519 /* SPI controller data */
520 static struct bfin5xx_spi_master bfin_spi0_info
= {
522 .enable_dma
= 1, /* master has the ability to do dma transfer */
523 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
527 static struct resource bfin_spi0_resource
[] = {
529 .start
= SPI0_REGBASE
,
530 .end
= SPI0_REGBASE
+ 0xFF,
531 .flags
= IORESOURCE_MEM
,
536 .flags
= IORESOURCE_DMA
,
541 .flags
= IORESOURCE_IRQ
,
545 static struct platform_device bfin_spi0_device
= {
547 .id
= 0, /* Bus number */
548 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
549 .resource
= bfin_spi0_resource
,
551 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
554 #endif /* spi master and devices */
556 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
557 static struct mtd_partition cm_partitions
[] = {
559 .name
= "bootloader(nor)",
563 .name
= "linux kernel(nor)",
565 .offset
= MTDPART_OFS_APPEND
,
567 .name
= "file system(nor)",
568 .size
= MTDPART_SIZ_FULL
,
569 .offset
= MTDPART_OFS_APPEND
,
573 static struct physmap_flash_data cm_flash_data
= {
575 .parts
= cm_partitions
,
576 .nr_parts
= ARRAY_SIZE(cm_partitions
),
579 static unsigned cm_flash_gpios
[] = { GPIO_PH9
, GPIO_PG11
};
581 static struct resource cm_flash_resource
[] = {
586 .flags
= IORESOURCE_MEM
,
588 .start
= (unsigned long)cm_flash_gpios
,
589 .end
= ARRAY_SIZE(cm_flash_gpios
),
590 .flags
= IORESOURCE_IRQ
,
594 static struct platform_device cm_flash_device
= {
595 .name
= "gpio-addr-flash",
598 .platform_data
= &cm_flash_data
,
600 .num_resources
= ARRAY_SIZE(cm_flash_resource
),
601 .resource
= cm_flash_resource
,
605 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
606 #ifdef CONFIG_SERIAL_BFIN_UART0
607 static struct resource bfin_uart0_resources
[] = {
611 .flags
= IORESOURCE_MEM
,
614 .start
= IRQ_UART0_RX
,
615 .end
= IRQ_UART0_RX
+1,
616 .flags
= IORESOURCE_IRQ
,
619 .start
= IRQ_UART0_ERROR
,
620 .end
= IRQ_UART0_ERROR
,
621 .flags
= IORESOURCE_IRQ
,
624 .start
= CH_UART0_TX
,
626 .flags
= IORESOURCE_DMA
,
629 .start
= CH_UART0_RX
,
631 .flags
= IORESOURCE_DMA
,
635 unsigned short bfin_uart0_peripherals
[] = {
636 P_UART0_TX
, P_UART0_RX
, 0
639 static struct platform_device bfin_uart0_device
= {
642 .num_resources
= ARRAY_SIZE(bfin_uart0_resources
),
643 .resource
= bfin_uart0_resources
,
645 .platform_data
= &bfin_uart0_peripherals
, /* Passed to driver */
649 #ifdef CONFIG_SERIAL_BFIN_UART1
650 static struct resource bfin_uart1_resources
[] = {
654 .flags
= IORESOURCE_MEM
,
657 .start
= IRQ_UART1_RX
,
658 .end
= IRQ_UART1_RX
+1,
659 .flags
= IORESOURCE_IRQ
,
662 .start
= IRQ_UART1_ERROR
,
663 .end
= IRQ_UART1_ERROR
,
664 .flags
= IORESOURCE_IRQ
,
667 .start
= CH_UART1_TX
,
669 .flags
= IORESOURCE_DMA
,
672 .start
= CH_UART1_RX
,
674 .flags
= IORESOURCE_DMA
,
676 #ifdef CONFIG_BFIN_UART1_CTSRTS
680 .flags
= IORESOURCE_IO
,
685 .flags
= IORESOURCE_IO
,
690 unsigned short bfin_uart1_peripherals
[] = {
691 P_UART1_TX
, P_UART1_RX
, 0
694 static struct platform_device bfin_uart1_device
= {
697 .num_resources
= ARRAY_SIZE(bfin_uart1_resources
),
698 .resource
= bfin_uart1_resources
,
700 .platform_data
= &bfin_uart1_peripherals
, /* Passed to driver */
706 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
707 #ifdef CONFIG_BFIN_SIR0
708 static struct resource bfin_sir0_resources
[] = {
712 .flags
= IORESOURCE_MEM
,
715 .start
= IRQ_UART0_RX
,
716 .end
= IRQ_UART0_RX
+1,
717 .flags
= IORESOURCE_IRQ
,
720 .start
= CH_UART0_RX
,
721 .end
= CH_UART0_RX
+1,
722 .flags
= IORESOURCE_DMA
,
726 static struct platform_device bfin_sir0_device
= {
729 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
730 .resource
= bfin_sir0_resources
,
733 #ifdef CONFIG_BFIN_SIR1
734 static struct resource bfin_sir1_resources
[] = {
738 .flags
= IORESOURCE_MEM
,
741 .start
= IRQ_UART1_RX
,
742 .end
= IRQ_UART1_RX
+1,
743 .flags
= IORESOURCE_IRQ
,
746 .start
= CH_UART1_RX
,
747 .end
= CH_UART1_RX
+1,
748 .flags
= IORESOURCE_DMA
,
752 static struct platform_device bfin_sir1_device
= {
755 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
756 .resource
= bfin_sir1_resources
,
761 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
762 static struct resource bfin_twi0_resource
[] = {
764 .start
= TWI0_REGBASE
,
766 .flags
= IORESOURCE_MEM
,
771 .flags
= IORESOURCE_IRQ
,
775 static struct platform_device i2c_bfin_twi_device
= {
776 .name
= "i2c-bfin-twi",
778 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
779 .resource
= bfin_twi0_resource
,
783 static struct i2c_board_info __initdata bfin_i2c_board_info
[] = {
784 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
786 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
789 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
791 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
795 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
797 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
802 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
803 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
804 static struct resource bfin_sport0_uart_resources
[] = {
806 .start
= SPORT0_TCR1
,
807 .end
= SPORT0_MRCS3
+4,
808 .flags
= IORESOURCE_MEM
,
811 .start
= IRQ_SPORT0_RX
,
812 .end
= IRQ_SPORT0_RX
+1,
813 .flags
= IORESOURCE_IRQ
,
816 .start
= IRQ_SPORT0_ERROR
,
817 .end
= IRQ_SPORT0_ERROR
,
818 .flags
= IORESOURCE_IRQ
,
822 unsigned short bfin_sport0_peripherals
[] = {
823 P_SPORT0_TFS
, P_SPORT0_DTPRI
, P_SPORT0_TSCLK
, P_SPORT0_RFS
,
824 P_SPORT0_DRPRI
, P_SPORT0_RSCLK
, P_SPORT0_DRSEC
, P_SPORT0_DTSEC
, 0
827 static struct platform_device bfin_sport0_uart_device
= {
828 .name
= "bfin-sport-uart",
830 .num_resources
= ARRAY_SIZE(bfin_sport0_uart_resources
),
831 .resource
= bfin_sport0_uart_resources
,
833 .platform_data
= &bfin_sport0_peripherals
, /* Passed to driver */
837 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
838 static struct resource bfin_sport1_uart_resources
[] = {
840 .start
= SPORT1_TCR1
,
841 .end
= SPORT1_MRCS3
+4,
842 .flags
= IORESOURCE_MEM
,
845 .start
= IRQ_SPORT1_RX
,
846 .end
= IRQ_SPORT1_RX
+1,
847 .flags
= IORESOURCE_IRQ
,
850 .start
= IRQ_SPORT1_ERROR
,
851 .end
= IRQ_SPORT1_ERROR
,
852 .flags
= IORESOURCE_IRQ
,
856 unsigned short bfin_sport1_peripherals
[] = {
857 P_SPORT1_TFS
, P_SPORT1_DTPRI
, P_SPORT1_TSCLK
, P_SPORT1_RFS
,
858 P_SPORT1_DRPRI
, P_SPORT1_RSCLK
, P_SPORT1_DRSEC
, P_SPORT1_DTSEC
, 0
861 static struct platform_device bfin_sport1_uart_device
= {
862 .name
= "bfin-sport-uart",
864 .num_resources
= ARRAY_SIZE(bfin_sport1_uart_resources
),
865 .resource
= bfin_sport1_uart_resources
,
867 .platform_data
= &bfin_sport1_peripherals
, /* Passed to driver */
873 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
874 #include <linux/input.h>
875 #include <linux/gpio_keys.h>
877 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
878 {BTN_0
, GPIO_PF14
, 1, "gpio-keys: BTN0"},
881 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
882 .buttons
= bfin_gpio_keys_table
,
883 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
886 static struct platform_device bfin_device_gpiokeys
= {
889 .platform_data
= &bfin_gpio_keys_data
,
894 static const unsigned int cclk_vlev_datasheet
[] =
896 VRPAIR(VLEV_100
, 400000000),
897 VRPAIR(VLEV_105
, 426000000),
898 VRPAIR(VLEV_110
, 500000000),
899 VRPAIR(VLEV_115
, 533000000),
900 VRPAIR(VLEV_120
, 600000000),
903 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
904 .tuple_tab
= cclk_vlev_datasheet
,
905 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
906 .vr_settling_time
= 25 /* us */,
909 static struct platform_device bfin_dpmc
= {
912 .platform_data
= &bfin_dmpc_vreg_data
,
916 static struct platform_device
*cmbf527_devices
[] __initdata
= {
920 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
924 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
925 &bfin_pcmcia_cf_device
,
928 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
932 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
936 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
937 &bfin_isp1760_device
,
940 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
944 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
948 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
952 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
957 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
958 &net2272_bfin_device
,
961 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
965 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
966 #ifdef CONFIG_SERIAL_BFIN_UART0
969 #ifdef CONFIG_SERIAL_BFIN_UART1
974 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
975 #ifdef CONFIG_BFIN_SIR0
978 #ifdef CONFIG_BFIN_SIR1
983 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
984 &i2c_bfin_twi_device
,
987 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
988 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
989 &bfin_sport0_uart_device
,
991 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
992 &bfin_sport1_uart_device
,
996 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
997 &bfin_device_gpiokeys
,
1000 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
1005 static int __init
cm_init(void)
1007 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
1008 i2c_register_board_info(0, bfin_i2c_board_info
,
1009 ARRAY_SIZE(bfin_i2c_board_info
));
1010 platform_add_devices(cmbf527_devices
, ARRAY_SIZE(cmbf527_devices
));
1011 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
1015 arch_initcall(cm_init
);
1017 static struct platform_device
*cmbf527_early_devices
[] __initdata
= {
1018 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
1019 #ifdef CONFIG_SERIAL_BFIN_UART0
1022 #ifdef CONFIG_SERIAL_BFIN_UART1
1027 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
1028 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1029 &bfin_sport0_uart_device
,
1031 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1032 &bfin_sport1_uart_device
,
1037 void __init
native_machine_early_platform_add_devices(void)
1039 printk(KERN_INFO
"register early platform devices\n");
1040 early_platform_add_devices(cmbf527_early_devices
,
1041 ARRAY_SIZE(cmbf527_early_devices
));
1044 void native_machine_restart(char *cmd
)
1046 /* workaround reboot hang when booting from SPI */
1047 if ((bfin_read_SYSCR() & 0x7) == 0x3)
1048 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS
);
1051 void bfin_get_ether_addr(char *addr
)
1053 random_ether_addr(addr
);
1054 printk(KERN_WARNING
"%s:%s: Setting Ethernet MAC to a random one\n", __FILE__
, __func__
);
1056 EXPORT_SYMBOL(bfin_get_ether_addr
);