9 #include <linux/device.h>
17 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
21 #include <linux/i2c.h>
24 #include <asm/reboot.h>
33 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
43 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
52 static struct resource smc91x_resources[] = {
54 .
name =
"smc91x-regs",
56 .end = 0x20300300 + 16,
69 .resource = smc91x_resources,
71 .platform_data = &smc91x_info,
76 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
77 static struct resource net2272_bfin_resources[] = {
80 .end = 0x20300000 + 0x100,
95 .num_resources =
ARRAY_SIZE(net2272_bfin_resources),
96 .resource = net2272_bfin_resources,
100 #if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE)
103 .
name =
"bootloader(nor)",
107 .name =
"linux kernel(nor)",
111 .name =
"file system(nor)",
119 .parts = stamp_partitions,
123 static struct resource stamp_flash_resource[] = {
140 .
name =
"bfin-async-flash",
143 .platform_data = &stamp_flash_data,
145 .num_resources =
ARRAY_SIZE(stamp_flash_resource),
146 .resource = stamp_flash_resource,
150 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
153 .
name =
"bootloader(spi)",
158 .name =
"linux kernel(spi)",
162 .name =
"file system(spi)",
170 .parts = bfin_spi_flash_partitions,
171 .nr_parts =
ARRAY_SIZE(bfin_spi_flash_partitions),
181 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
182 #define MMC_SPI_CARD_DETECT_INT IRQ_PF5
183 static int bfin_mmc_spi_init(
struct device *
dev,
186 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
188 "mmc-spi-detect", data);
191 static void bfin_mmc_spi_exit(
struct device *dev,
void *
data)
193 free_irq(MMC_SPI_CARD_DETECT_INT, data);
197 .
init = bfin_mmc_spi_init,
198 .exit = bfin_mmc_spi_exit,
209 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
212 .modalias =
"m25p80",
213 .max_speed_hz = 25000000,
216 .platform_data = &bfin_spi_flash_data,
217 .controller_data = &spi_flash_chip_info,
222 #if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \
223 defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
225 .modalias =
"ad1836",
226 .max_speed_hz = 3125000,
229 .platform_data =
"ad1836",
234 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
236 .modalias =
"spidev",
237 .max_speed_hz = 3125000,
242 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
244 .modalias =
"mmc_spi",
245 .max_speed_hz = 20000000,
248 .platform_data = &bfin_mmc_spi_pdata,
249 .controller_data = &mmc_spi_chip_info,
255 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
257 static struct resource bfin_spi0_resource[] = {
285 .num_resources =
ARRAY_SIZE(bfin_spi0_resource),
286 .resource = bfin_spi0_resource,
288 .platform_data = &bfin_spi0_info,
293 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
294 #ifdef CONFIG_SERIAL_BFIN_UART0
295 static struct resource bfin_uart0_resources[] = {
328 static unsigned short bfin_uart0_peripherals[] = {
335 .num_resources =
ARRAY_SIZE(bfin_uart0_resources),
336 .resource = bfin_uart0_resources,
338 .platform_data = &bfin_uart0_peripherals,
344 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
345 #ifdef CONFIG_BFIN_SIR0
346 static struct resource bfin_sir0_resources[] = {
367 .num_resources =
ARRAY_SIZE(bfin_sir0_resources),
368 .resource = bfin_sir0_resources,
373 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
374 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
375 static struct resource bfin_sport0_uart_resources[] = {
393 static unsigned short bfin_sport0_peripherals[] = {
399 .
name =
"bfin-sport-uart",
401 .num_resources =
ARRAY_SIZE(bfin_sport0_uart_resources),
402 .resource = bfin_sport0_uart_resources,
404 .platform_data = &bfin_sport0_peripherals,
408 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
409 static struct resource bfin_sport1_uart_resources[] = {
427 static unsigned short bfin_sport1_peripherals[] = {
433 .
name =
"bfin-sport-uart",
435 .num_resources =
ARRAY_SIZE(bfin_sport1_uart_resources),
436 .resource = bfin_sport1_uart_resources,
438 .platform_data = &bfin_sport1_peripherals,
444 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
445 #include <linux/input.h>
455 .
buttons = bfin_gpio_keys_table,
462 .platform_data = &bfin_gpio_keys_data,
467 #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
473 .sda_is_open_drain = 0,
474 .scl_is_open_drain = 0,
482 .platform_data = &i2c_gpio_data,
488 #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
494 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
499 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
505 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
510 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
517 static const unsigned int cclk_vlev_datasheet[] =
532 .tuple_tab = cclk_vlev_datasheet,
534 .vr_settling_time = 25 ,
540 .platform_data = &bfin_dmpc_vreg_data,
544 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \
545 defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) \
546 || defined(CONFIG_SND_BF5XX_AC97) || \
547 defined(CONFIG_SND_BF5XX_AC97_MODULE)
551 #define SPORT_REQ(x) \
552 [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \
553 P_SPORT##x##_RFS, P_SPORT##x##_DRPRI, P_SPORT##x##_RSCLK, 0}
555 static const u16 bfin_snd_pin[][7] = {
562 .
pin_req = &bfin_snd_pin[0][0],
565 .pin_req = &bfin_snd_pin[1][0],
569 #define BFIN_SND_RES(x) \
572 .start = SPORT##x##_TCR1, \
573 .end = SPORT##x##_TCR1, \
574 .flags = IORESOURCE_MEM \
577 .start = CH_SPORT##x##_RX, \
578 .end = CH_SPORT##x##_RX, \
579 .flags = IORESOURCE_DMA, \
582 .start = CH_SPORT##x##_TX, \
583 .end = CH_SPORT##x##_TX, \
584 .flags = IORESOURCE_DMA, \
587 .start = IRQ_SPORT##x##_ERROR, \
588 .end = IRQ_SPORT##x##_ERROR, \
589 .flags = IORESOURCE_IRQ, \
593 static struct resource bfin_snd_resources[][4] = {
599 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
601 .
name =
"bfin-i2s-pcm-audio",
606 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
608 .
name =
"bfin-tdm-pcm-audio",
613 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
615 .
name =
"bfin-ac97-pcm-audio",
620 #if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
621 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
622 static const char *
const ad1836_link[] = {
627 .
name =
"bfin-snd-ad1836",
630 .platform_data = (
void *)ad1836_link,
635 #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || \
636 defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)
637 static const unsigned ad73311_gpio[] = {
642 .
name =
"bfin-snd-ad73311",
645 .platform_data = (
void *)ad73311_gpio,
650 #if defined(CONFIG_SND_SOC_AD73311) || defined(CONFIG_SND_SOC_AD73311_MODULE)
657 #if defined(CONFIG_SND_SOC_AD74111) || defined(CONFIG_SND_SOC_AD74111_MODULE)
664 #if defined(CONFIG_SND_BF5XX_SOC_I2S) || \
665 defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE)
668 .id = CONFIG_SND_BF5XX_SPORT_NUM,
670 ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
671 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
673 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
678 #if defined(CONFIG_SND_BF5XX_SOC_TDM) || \
679 defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE)
682 .id = CONFIG_SND_BF5XX_SPORT_NUM,
684 ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
685 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
687 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
692 #if defined(CONFIG_SND_BF5XX_SOC_AC97) || \
693 defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE)
696 .id = CONFIG_SND_BF5XX_SPORT_NUM,
698 ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
699 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
701 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
710 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
714 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
718 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
719 &net2272_bfin_device,
722 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
726 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
727 #ifdef CONFIG_SERIAL_BFIN_UART0
732 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
733 #ifdef CONFIG_BFIN_SIR0
738 #if defined(CONFIG_SERIAL_BFIN_SPORT) || \
739 defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
740 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
741 &bfin_sport0_uart_device,
743 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
744 &bfin_sport1_uart_device,
748 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
749 &bfin_device_gpiokeys,
752 #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
756 #if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE)
760 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
764 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
768 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
772 #if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \
773 defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
774 &bfin_ad1836_machine,
777 #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || \
778 defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)
779 &bfin_ad73311_machine,
782 #if defined(CONFIG_SND_SOC_AD73311) || defined(CONFIG_SND_SOC_AD73311_MODULE)
783 &bfin_ad73311_codec_device,
786 #if defined(CONFIG_SND_SOC_AD74111) || defined(CONFIG_SND_SOC_AD74111_MODULE)
787 &bfin_ad74111_codec_device,
790 #if defined(CONFIG_SND_BF5XX_SOC_I2S) || \
791 defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE)
795 #if defined(CONFIG_SND_BF5XX_SOC_TDM) || \
796 defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE)
800 #if defined(CONFIG_SND_BF5XX_SOC_AC97) || \
801 defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE)
806 static int __init net2272_init(
void)
808 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
841 static int __init stamp_init(
void)
854 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
868 pr_warning(
"unable to configure net2272; it probably won't work\n");
877 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
878 #ifdef CONFIG_SERIAL_BFIN_UART0
883 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
884 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
885 &bfin_sport0_uart_device,
887 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
888 &bfin_sport1_uart_device,