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>
35 #ifdef CONFIG_BFIN527_EZKIT_V2
45 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
47 static struct resource bfin_isp1760_resources[] = {
50 .end = 0x203C0000 + 0x000fffff,
65 .dack_polarity_high = 0,
66 .dreq_polarity_high = 0,
73 .platform_data = &isp1760_priv,
75 .num_resources =
ARRAY_SIZE(bfin_isp1760_resources),
76 .resource = bfin_isp1760_resources,
80 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
81 static struct resource musb_resources[] = {
112 .gpio_vrsel_active = 1,
117 #if defined(CONFIG_USB_MUSB_HDRC) && defined(CONFIG_USB_GADGET_MUSB_HDRC)
119 #elif defined(CONFIG_USB_MUSB_HDRC)
121 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
124 .config = &musb_config,
127 static u64 musb_dmamask = ~(
u32)0;
130 .
name =
"musb-blackfin",
133 .dma_mask = &musb_dmamask,
134 .coherent_dma_mask = 0xffffffff,
135 .platform_data = &musb_plat,
138 .resource = musb_resources,
142 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
144 static struct resource bf52x_t350mcqb_resources[] = {
153 .
name =
"bfin-t350mcqb",
155 .num_resources =
ARRAY_SIZE(bf52x_t350mcqb_resources),
156 .resource = bf52x_t350mcqb_resources,
160 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
168 static struct resource bfin_lq035q1_resources[] = {
177 .
name =
"bfin-lq035q1",
179 .num_resources =
ARRAY_SIZE(bfin_lq035q1_resources),
180 .resource = bfin_lq035q1_resources,
182 .platform_data = &bfin_lq035q1_data,
187 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
190 .
name =
"bootloader(nor)",
194 .name =
"linux kernel(nor)",
198 .name =
"file system(nor)",
206 .parts = ezkit_partitions,
210 static struct resource ezkit_flash_resource = {
217 .
name =
"physmap-flash",
220 .platform_data = &ezkit_flash_data,
223 .resource = &ezkit_flash_resource,
227 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
230 .name =
"bootloader(nand)",
234 .name =
"linux kernel(nand)",
236 .size = 4 * 1024 * 1024,
239 .name =
"file system(nand)",
247 .partitions = partition_info,
253 static struct resource bf5xx_nand_resources[] = {
267 .
name =
"bf5xx-nand",
269 .num_resources =
ARRAY_SIZE(bf5xx_nand_resources),
270 .resource = bf5xx_nand_resources,
272 .platform_data = &bf5xx_nand_platform,
277 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
278 static struct resource bfin_pcmcia_cf_resources[] = {
299 .
name =
"bfin_cf_pcmcia",
301 .num_resources =
ARRAY_SIZE(bfin_pcmcia_cf_resources),
302 .resource = bfin_pcmcia_cf_resources,
306 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
313 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
322 static struct resource smc91x_resources[] = {
324 .
name =
"smc91x-regs",
326 .end = 0x20300300 + 16,
338 .num_resources =
ARRAY_SIZE(smc91x_resources),
339 .resource = smc91x_resources,
341 .platform_data = &smc91x_info,
346 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
347 static struct resource dm9000_resources[] = {
350 .end = 0x203FB800 + 1,
354 .start = 0x203FB800 + 4,
355 .end = 0x203FB800 + 5,
368 .num_resources =
ARRAY_SIZE(dm9000_resources),
369 .resource = dm9000_resources,
373 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
375 static const unsigned short bfin_mac_peripherals[] =
P_RMII0;
386 .phydev_data = bfin_phydev_data,
388 .mac_peripherals = bfin_mac_peripherals,
392 .
name =
"bfin_mii_bus",
394 .platform_data = &bfin_mii_bus_data,
401 .platform_data = &bfin_mii_bus,
406 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
407 static struct resource net2272_bfin_resources[] = {
410 .end = 0x20300000 + 0x100,
425 .num_resources =
ARRAY_SIZE(net2272_bfin_resources),
426 .resource = net2272_bfin_resources,
430 #if defined(CONFIG_MTD_M25P80) \
431 || defined(CONFIG_MTD_M25P80_MODULE)
434 .
name =
"bootloader(spi)",
439 .name =
"linux kernel(spi)",
447 .parts = bfin_spi_flash_partitions,
448 .nr_parts =
ARRAY_SIZE(bfin_spi_flash_partitions),
458 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
464 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
467 .vref_delay_usecs = 50,
470 .pressure_max = 1000,
472 .stopacq_polarity = 1,
473 .first_conversion_delay = 3,
474 .acquisition_time = 1,
476 .pen_down_acc_interval = 1,
480 #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
485 .pressure_max = 10000,
487 .first_conversion_delay = 3,
488 .acquisition_time = 1,
491 .pen_down_acc_interval = 255,
496 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \
497 defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
499 static const u16 bfin_snd_pin[][7] = {
508 .
pin_req = &bfin_snd_pin[0][0],
511 .pin_req = &bfin_snd_pin[1][0],
515 #define BFIN_SND_RES(x) \
518 .start = SPORT##x##_TCR1, \
519 .end = SPORT##x##_TCR1, \
520 .flags = IORESOURCE_MEM \
523 .start = CH_SPORT##x##_RX, \
524 .end = CH_SPORT##x##_RX, \
525 .flags = IORESOURCE_DMA, \
528 .start = CH_SPORT##x##_TX, \
529 .end = CH_SPORT##x##_TX, \
530 .flags = IORESOURCE_DMA, \
533 .start = IRQ_SPORT##x##_ERROR, \
534 .end = IRQ_SPORT##x##_ERROR, \
535 .flags = IORESOURCE_IRQ, \
539 static struct resource bfin_snd_resources[][4] = {
545 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
547 .
name =
"bfin-i2s-pcm-audio",
552 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
554 .
name =
"bfin-tdm-pcm-audio",
559 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
561 .
name =
"bfin-ac97-pcm-audio",
566 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
569 .id = CONFIG_SND_BF5XX_SPORT_NUM,
570 .num_resources =
ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
571 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
573 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
578 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
581 .id = CONFIG_SND_BF5XX_SPORT_NUM,
582 .num_resources =
ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
583 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
585 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
590 #if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
591 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
592 static const char *
const ad1836_link[] = {
597 .
name =
"bfin-snd-ad1836",
600 .platform_data = (
void *)ad1836_link,
606 #if defined(CONFIG_MTD_M25P80) \
607 || defined(CONFIG_MTD_M25P80_MODULE)
610 .modalias =
"m25p80",
611 .max_speed_hz = 25000000,
614 .platform_data = &bfin_spi_flash_data,
615 .controller_data = &spi_flash_chip_info,
620 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
621 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
623 .modalias =
"ad183x",
624 .max_speed_hz = 3125000,
627 .platform_data =
"ad1836",
631 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
633 .modalias =
"mmc_spi",
634 .max_speed_hz = 20000000,
637 .controller_data = &mmc_spi_chip_info,
642 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
644 .modalias =
"ad7877",
645 .platform_data = &bfin_ad7877_ts_info,
647 .max_speed_hz = 12500000,
652 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
654 .modalias =
"ad7879",
655 .platform_data = &bfin_ad7879_ts_info,
657 .max_speed_hz = 5000000,
663 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
665 .modalias =
"spidev",
666 .max_speed_hz = 3125000,
671 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
673 .modalias =
"bfin-lq035q1-spi",
674 .max_speed_hz = 20000000,
682 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
691 static struct resource bfin_spi0_resource[] = {
712 .num_resources =
ARRAY_SIZE(bfin_spi0_resource),
713 .resource = bfin_spi0_resource,
715 .platform_data = &bfin_spi0_info,
720 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
721 #ifdef CONFIG_SERIAL_BFIN_UART0
722 static struct resource bfin_uart0_resources[] = {
755 static unsigned short bfin_uart0_peripherals[] = {
762 .num_resources =
ARRAY_SIZE(bfin_uart0_resources),
763 .resource = bfin_uart0_resources,
765 .platform_data = &bfin_uart0_peripherals,
769 #ifdef CONFIG_SERIAL_BFIN_UART1
770 static struct resource bfin_uart1_resources[] = {
801 #ifdef CONFIG_BFIN_UART1_CTSRTS
815 static unsigned short bfin_uart1_peripherals[] = {
822 .num_resources =
ARRAY_SIZE(bfin_uart1_resources),
823 .resource = bfin_uart1_resources,
825 .platform_data = &bfin_uart1_peripherals,
831 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
832 #ifdef CONFIG_BFIN_SIR0
833 static struct resource bfin_sir0_resources[] = {
854 .num_resources =
ARRAY_SIZE(bfin_sir0_resources),
855 .resource = bfin_sir0_resources,
858 #ifdef CONFIG_BFIN_SIR1
859 static struct resource bfin_sir1_resources[] = {
880 .num_resources =
ARRAY_SIZE(bfin_sir1_resources),
881 .resource = bfin_sir1_resources,
886 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
889 static struct resource bfin_twi0_resource[] = {
903 .
name =
"i2c-bfin-twi",
905 .num_resources =
ARRAY_SIZE(bfin_twi0_resource),
906 .resource = bfin_twi0_resource,
908 .platform_data = &bfin_twi0_pins,
913 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
920 static struct led_info adp5520_leds[] = {
922 .
name =
"adp5520-led1",
923 .default_trigger =
"none",
930 .leds = adp5520_leds,
962 .keymap = adp5520_keymap,
972 .
leds = &adp5520_leds_data,
973 .keys = &adp5520_keys_data,
979 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
984 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
990 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
995 #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
999 .platform_data = (
void *)&bfin_ad7879_ts_info,
1002 #
if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1006 .platform_data = (
void *)&adp5520_pdev_data,
1009 #
if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
1014 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1019 #if defined(CONFIG_SND_SOC_ADAU1373) || defined(CONFIG_SND_SOC_ADAU1373_MODULE)
1026 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1027 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1028 static struct resource bfin_sport0_uart_resources[] = {
1046 static unsigned short bfin_sport0_peripherals[] = {
1052 .
name =
"bfin-sport-uart",
1054 .num_resources =
ARRAY_SIZE(bfin_sport0_uart_resources),
1055 .resource = bfin_sport0_uart_resources,
1057 .platform_data = &bfin_sport0_peripherals,
1061 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1062 static struct resource bfin_sport1_uart_resources[] = {
1080 static unsigned short bfin_sport1_peripherals[] = {
1086 .
name =
"bfin-sport-uart",
1088 .num_resources =
ARRAY_SIZE(bfin_sport1_uart_resources),
1089 .resource = bfin_sport1_uart_resources,
1091 .platform_data = &bfin_sport1_peripherals,
1097 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1106 .
buttons = bfin_gpio_keys_table,
1107 .nbuttons =
ARRAY_SIZE(bfin_gpio_keys_table),
1111 .
name =
"gpio-keys",
1113 .platform_data = &bfin_gpio_keys_data,
1118 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
1131 static struct resource bfin_rotary_resources[] = {
1140 .
name =
"bfin-rotary",
1142 .num_resources =
ARRAY_SIZE(bfin_rotary_resources),
1143 .resource = bfin_rotary_resources,
1145 .platform_data = &bfin_rotary_data,
1150 static const unsigned int cclk_vlev_datasheet[] =
1160 .tuple_tab = cclk_vlev_datasheet,
1162 .vr_settling_time = 25 ,
1166 .name =
"bfin dpmc",
1168 .platform_data = &bfin_dmpc_vreg_data,
1176 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
1180 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
1181 &bfin_pcmcia_cf_device,
1184 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1188 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1189 &bfin_isp1760_device,
1192 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
1196 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
1200 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
1204 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
1209 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
1210 &net2272_bfin_device,
1213 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
1217 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
1218 &bf52x_t350mcqb_device,
1221 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1222 &bfin_lq035q1_device,
1225 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1226 #ifdef CONFIG_SERIAL_BFIN_UART0
1229 #ifdef CONFIG_SERIAL_BFIN_UART1
1234 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1235 #ifdef CONFIG_BFIN_SIR0
1238 #ifdef CONFIG_BFIN_SIR1
1243 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1244 &i2c_bfin_twi_device,
1247 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1248 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1249 &bfin_sport0_uart_device,
1251 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1252 &bfin_sport1_uart_device,
1256 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1257 &bfin_device_gpiokeys,
1260 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
1261 &bfin_rotary_device,
1264 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1265 &ezkit_flash_device,
1268 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1272 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1276 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1280 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1284 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1288 #if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \
1289 defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
1290 &bfin_ad1836_machine,
1294 static int __init ezkit_init(
void)
1307 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
1308 #ifdef CONFIG_SERIAL_BFIN_UART0
1311 #ifdef CONFIG_SERIAL_BFIN_UART1
1316 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
1317 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1318 &bfin_sport0_uart_device,
1320 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1321 &bfin_sport1_uart_device,
1347 ret = otp_read(0xDF, 0x00, &otp_mac);
1349 char *otp_mac_p = (
char *)&otp_mac;
1350 for (ret = 0; ret < 6; ++
ret)
1351 addr[ret] = otp_mac_p[5 - ret];