9 #include <linux/device.h>
10 #include <linux/export.h>
17 #include <linux/i2c.h>
22 #include <linux/input.h>
25 #include <asm/reboot.h>
40 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
41 static struct resource musb_resources[] = {
70 .gpio_vrsel_active = 1,
75 #if defined(CONFIG_USB_MUSB_OTG)
77 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
79 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
82 .config = &musb_config,
85 static u64 musb_dmamask = ~(
u32)0;
88 .
name =
"musb-blackfin",
91 .dma_mask = &musb_dmamask,
92 .coherent_dma_mask = 0xffffffff,
93 .platform_data = &musb_plat,
96 .resource = musb_resources,
100 #if defined(CONFIG_FB_BFIN_RA158Z) || defined(CONFIG_FB_BFIN_RA158Z_MODULE)
101 static struct resource bf52x_ra158z_resources[] = {
110 .
name =
"bfin-ra158z",
112 .num_resources =
ARRAY_SIZE(bf52x_ra158z_resources),
113 .resource = bf52x_ra158z_resources,
117 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
120 .
name =
"bootloader(nor)",
124 .name =
"linux kernel(nor)",
128 .name =
"file system(nor)",
136 .parts = ad7160eval_partitions,
137 .nr_parts =
ARRAY_SIZE(ad7160eval_partitions),
140 static struct resource ad7160eval_flash_resource = {
147 .
name =
"physmap-flash",
150 .platform_data = &ad7160eval_flash_data,
153 .resource = &ad7160eval_flash_resource,
157 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
160 .name =
"linux kernel(nand)",
162 .size = 4 * 1024 * 1024,
165 .name =
"file system(nand)",
173 .partitions = partition_info,
179 static struct resource bf5xx_nand_resources[] = {
193 .
name =
"bf5xx-nand",
195 .num_resources =
ARRAY_SIZE(bf5xx_nand_resources),
196 .resource = bf5xx_nand_resources,
198 .platform_data = &bf5xx_nand_platform,
203 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
210 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
212 static const unsigned short bfin_mac_peripherals[] =
P_RMII0;
223 .phydev_data = bfin_phydev_data,
225 .mac_peripherals = bfin_mac_peripherals,
229 .
name =
"bfin_mii_bus",
231 .platform_data = &bfin_mii_bus_data,
238 .platform_data = &bfin_mii_bus,
244 #if defined(CONFIG_MTD_M25P80) \
245 || defined(CONFIG_MTD_M25P80_MODULE)
248 .
name =
"bootloader(spi)",
253 .name =
"linux kernel(spi)",
261 .parts = bfin_spi_flash_partitions,
262 .nr_parts =
ARRAY_SIZE(bfin_spi_flash_partitions),
272 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
278 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
281 .id = CONFIG_SND_BF5XX_SPORT_NUM,
286 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
289 .id = CONFIG_SND_BF5XX_SPORT_NUM,
295 #if defined(CONFIG_MTD_M25P80) \
296 || defined(CONFIG_MTD_M25P80_MODULE)
299 .modalias =
"m25p80",
300 .max_speed_hz = 25000000,
303 .platform_data = &bfin_spi_flash_data,
304 .controller_data = &spi_flash_chip_info,
308 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
309 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
311 .modalias =
"ad183x",
312 .max_speed_hz = 3125000,
317 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
319 .modalias =
"mmc_spi",
320 .max_speed_hz = 30000000,
323 .controller_data = &mmc_spi_chip_info,
327 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
329 .modalias =
"spidev",
330 .max_speed_hz = 3125000,
337 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
346 static struct resource bfin_spi0_resource[] = {
367 .num_resources =
ARRAY_SIZE(bfin_spi0_resource),
368 .resource = bfin_spi0_resource,
370 .platform_data = &bfin_spi0_info,
375 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
376 #ifdef CONFIG_SERIAL_BFIN_UART0
377 static struct resource bfin_uart0_resources[] = {
410 static unsigned short bfin_uart0_peripherals[] = {
417 .num_resources =
ARRAY_SIZE(bfin_uart0_resources),
418 .resource = bfin_uart0_resources,
420 .platform_data = &bfin_uart0_peripherals,
424 #ifdef CONFIG_SERIAL_BFIN_UART1
425 static struct resource bfin_uart1_resources[] = {
456 #ifdef CONFIG_BFIN_UART1_CTSRTS
470 static unsigned short bfin_uart1_peripherals[] = {
477 .num_resources =
ARRAY_SIZE(bfin_uart1_resources),
478 .resource = bfin_uart1_resources,
480 .platform_data = &bfin_uart1_peripherals,
486 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
487 #ifdef CONFIG_BFIN_SIR0
488 static struct resource bfin_sir0_resources[] = {
509 .num_resources =
ARRAY_SIZE(bfin_sir0_resources),
510 .resource = bfin_sir0_resources,
513 #ifdef CONFIG_BFIN_SIR1
514 static struct resource bfin_sir1_resources[] = {
535 .num_resources =
ARRAY_SIZE(bfin_sir1_resources),
536 .resource = bfin_sir1_resources,
541 #if defined(CONFIG_TOUCHSCREEN_AD7160) || defined(CONFIG_TOUCHSCREEN_AD7160_MODULE)
542 #include <linux/input/ad7160.h>
543 static const struct ad7160_platform_data bfin_ad7160_ts_info = {
548 .coord_pref = AD7160_ORIG_TOP_LEFT,
549 .first_touch_window = 5,
551 .event_cabs = AD7160_EMIT_ABS_MT_TRACKING_ID |
552 AD7160_EMIT_ABS_MT_PRESSURE |
553 AD7160_TRACKING_ID_ASCENDING,
554 .finger_act_ctrl = 0x64,
555 .haptic_effect1_ctrl = AD7160_HAPTIC_SLOT_A(60) |
556 AD7160_HAPTIC_SLOT_A_LVL_HIGH |
557 AD7160_HAPTIC_SLOT_B(60) |
558 AD7160_HAPTIC_SLOT_B_LVL_LOW,
560 .haptic_effect2_ctrl = AD7160_HAPTIC_SLOT_A(20) |
561 AD7160_HAPTIC_SLOT_A_LVL_HIGH |
562 AD7160_HAPTIC_SLOT_B(80) |
563 AD7160_HAPTIC_SLOT_B_LVL_LOW |
564 AD7160_HAPTIC_SLOT_C(120) |
565 AD7160_HAPTIC_SLOT_C_LVL_HIGH |
566 AD7160_HAPTIC_SLOT_D(30) |
567 AD7160_HAPTIC_SLOT_D_LVL_LOW,
571 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
574 static struct resource bfin_twi0_resource[] = {
588 .
name =
"i2c-bfin-twi",
590 .num_resources =
ARRAY_SIZE(bfin_twi0_resource),
591 .resource = bfin_twi0_resource,
593 .platform_data = &bfin_twi0_pins,
599 #if defined(CONFIG_TOUCHSCREEN_AD7160) || defined(CONFIG_TOUCHSCREEN_AD7160_MODULE)
603 .platform_data = (
void *)&bfin_ad7160_ts_info,
608 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
609 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
610 static struct resource bfin_sport0_uart_resources[] = {
628 static unsigned short bfin_sport0_peripherals[] = {
634 .
name =
"bfin-sport-uart",
636 .num_resources =
ARRAY_SIZE(bfin_sport0_uart_resources),
637 .resource = bfin_sport0_uart_resources,
639 .platform_data = &bfin_sport0_peripherals,
643 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
644 static struct resource bfin_sport1_uart_resources[] = {
662 static unsigned short bfin_sport1_peripherals[] = {
668 .
name =
"bfin-sport-uart",
670 .num_resources =
ARRAY_SIZE(bfin_sport1_uart_resources),
671 .resource = bfin_sport1_uart_resources,
673 .platform_data = &bfin_sport1_peripherals,
679 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
692 static struct resource bfin_rotary_resources[] = {
701 .
name =
"bfin-rotary",
703 .num_resources =
ARRAY_SIZE(bfin_rotary_resources),
704 .resource = bfin_rotary_resources,
706 .platform_data = &bfin_rotary_data,
711 static const unsigned int cclk_vlev_datasheet[] = {
720 .tuple_tab = cclk_vlev_datasheet,
722 .vr_settling_time = 25 ,
728 .platform_data = &bfin_dmpc_vreg_data,
736 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
740 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
744 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
748 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
753 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
757 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
758 #ifdef CONFIG_SERIAL_BFIN_UART0
761 #ifdef CONFIG_SERIAL_BFIN_UART1
766 #if defined(CONFIG_FB_BFIN_RA158Z) || defined(CONFIG_FB_BFIN_RA158Z_MODULE)
767 &bf52x_ra158z_device,
770 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
771 #ifdef CONFIG_BFIN_SIR0
774 #ifdef CONFIG_BFIN_SIR1
779 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
780 &i2c_bfin_twi_device,
783 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
784 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
785 &bfin_sport0_uart_device,
787 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
788 &bfin_sport1_uart_device,
792 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
796 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
797 &ad7160eval_flash_device,
800 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
804 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
809 static int __init ad7160eval_init(
void)
821 static struct platform_device *ad7160eval_early_devices[] __initdata = {
822 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
823 #ifdef CONFIG_SERIAL_BFIN_UART0
826 #ifdef CONFIG_SERIAL_BFIN_UART1
831 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
832 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
833 &bfin_sport0_uart_device,
835 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
836 &bfin_sport1_uart_device,
862 ret = otp_read(0xDF, 0x00, &otp_mac);
864 char *otp_mac_p = (
char *)&otp_mac;
865 for (ret = 0; ret < 6; ++
ret)
866 addr[ret] = otp_mac_p[5 - ret];