2 * Copyright 2004-2009 Analog Devices Inc.
3 * 2005 National ICT Australia (NICTA)
4 * Aidan Williams <aidan@nicta.com.au>
6 * Licensed under the GPL-2 or later.
9 #include <linux/device.h>
10 #include <linux/platform_device.h>
11 #include <linux/mtd/mtd.h>
12 #include <linux/mtd/partitions.h>
13 #include <linux/mtd/physmap.h>
14 #include <linux/spi/spi.h>
15 #include <linux/spi/flash.h>
16 #include <linux/spi/mmc_spi.h>
17 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
18 #include <linux/usb/isp1362.h>
20 #include <linux/irq.h>
21 #include <linux/i2c.h>
23 #include <asm/bfin5xx_spi.h>
24 #include <asm/reboot.h>
25 #include <asm/portmux.h>
29 * Name the Board for the /proc/cpuinfo
31 const char bfin_board_name
[] = "ADI BF533-STAMP";
33 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
34 static struct platform_device rtc_device
= {
41 * Driver needs to know address, irq and flag pin.
43 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
44 #include <linux/smc91x.h>
46 static struct smc91x_platdata smc91x_info
= {
47 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
48 .leda
= RPC_LED_100_10
,
49 .ledb
= RPC_LED_TX_RX
,
52 static struct resource smc91x_resources
[] = {
54 .name
= "smc91x-regs",
56 .end
= 0x20300300 + 16,
57 .flags
= IORESOURCE_MEM
,
61 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
65 static struct platform_device smc91x_device
= {
68 .num_resources
= ARRAY_SIZE(smc91x_resources
),
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,
81 .flags
= IORESOURCE_MEM
,
84 .flags
= IORESOURCE_BUS
,
88 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
92 static struct platform_device net2272_bfin_device
= {
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)
101 static struct mtd_partition stamp_partitions
[] = {
103 .name
= "bootloader(nor)",
107 .name
= "linux kernel(nor)",
109 .offset
= MTDPART_OFS_APPEND
,
111 .name
= "file system(nor)",
112 .size
= MTDPART_SIZ_FULL
,
113 .offset
= MTDPART_OFS_APPEND
,
117 static struct physmap_flash_data stamp_flash_data
= {
119 .parts
= stamp_partitions
,
120 .nr_parts
= ARRAY_SIZE(stamp_partitions
),
123 static struct resource stamp_flash_resource
[] = {
128 .flags
= IORESOURCE_MEM
,
130 .start
= 0x7BB07BB0, /* AMBCTL0 setting when accessing flash */
131 .end
= 0x7BB07BB0, /* AMBCTL1 setting when accessing flash */
132 .flags
= IORESOURCE_MEM
,
135 .flags
= IORESOURCE_IRQ
,
139 static struct platform_device stamp_flash_device
= {
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)
151 static struct mtd_partition bfin_spi_flash_partitions
[] = {
153 .name
= "bootloader(spi)",
156 .mask_flags
= MTD_CAP_ROM
158 .name
= "linux kernel(spi)",
160 .offset
= MTDPART_OFS_APPEND
,
162 .name
= "file system(spi)",
163 .size
= MTDPART_SIZ_FULL
,
164 .offset
= MTDPART_OFS_APPEND
,
168 static struct flash_platform_data bfin_spi_flash_data
= {
170 .parts
= bfin_spi_flash_partitions
,
171 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
175 /* SPI flash chip (m25p64) */
176 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
177 .enable_dma
= 0, /* use dma transfer with this chip*/
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
,
184 irqreturn_t (*detect_int
)(int, void *), void *data
)
186 return request_irq(MMC_SPI_CARD_DETECT_INT
, detect_int
,
187 IRQF_TRIGGER_FALLING
| IRQF_TRIGGER_RISING
,
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
);
196 static struct mmc_spi_platform_data bfin_mmc_spi_pdata
= {
197 .init
= bfin_mmc_spi_init
,
198 .exit
= bfin_mmc_spi_exit
,
199 .detect_delay
= 100, /* msecs */
202 static struct bfin5xx_spi_chip mmc_spi_chip_info
= {
208 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
209 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
211 /* the modalias must be the same as spi device driver name */
212 .modalias
= "m25p80", /* Name of spi_driver for this device */
213 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
214 .bus_num
= 0, /* Framework bus number */
215 .chip_select
= 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
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, /* max spi clock (SCK) speed in HZ */
229 .platform_data
= "ad1836", /* only includes chip name for the moment */
234 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
236 .modalias
= "spidev",
237 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
242 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
244 .modalias
= "mmc_spi",
245 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
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
[] = {
259 .start
= SPI0_REGBASE
,
260 .end
= SPI0_REGBASE
+ 0xFF,
261 .flags
= IORESOURCE_MEM
,
266 .flags
= IORESOURCE_DMA
,
271 .flags
= IORESOURCE_IRQ
,
275 /* SPI controller data */
276 static struct bfin5xx_spi_master bfin_spi0_info
= {
278 .enable_dma
= 1, /* master has the ability to do dma transfer */
279 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
282 static struct platform_device bfin_spi0_device
= {
284 .id
= 0, /* Bus number */
285 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
286 .resource
= bfin_spi0_resource
,
288 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
291 #endif /* spi master and devices */
293 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
294 #ifdef CONFIG_SERIAL_BFIN_UART0
295 static struct resource bfin_uart0_resources
[] = {
297 .start
= BFIN_UART_THR
,
298 .end
= BFIN_UART_GCTL
+2,
299 .flags
= IORESOURCE_MEM
,
302 .start
= IRQ_UART0_TX
,
304 .flags
= IORESOURCE_IRQ
,
307 .start
= IRQ_UART0_RX
,
309 .flags
= IORESOURCE_IRQ
,
312 .start
= IRQ_UART0_ERROR
,
313 .end
= IRQ_UART0_ERROR
,
314 .flags
= IORESOURCE_IRQ
,
317 .start
= CH_UART0_TX
,
319 .flags
= IORESOURCE_DMA
,
322 .start
= CH_UART0_RX
,
324 .flags
= IORESOURCE_DMA
,
328 static unsigned short bfin_uart0_peripherals
[] = {
329 P_UART0_TX
, P_UART0_RX
, 0
332 static struct platform_device bfin_uart0_device
= {
335 .num_resources
= ARRAY_SIZE(bfin_uart0_resources
),
336 .resource
= bfin_uart0_resources
,
338 .platform_data
= &bfin_uart0_peripherals
, /* Passed to driver */
344 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
345 #ifdef CONFIG_BFIN_SIR0
346 static struct resource bfin_sir0_resources
[] = {
350 .flags
= IORESOURCE_MEM
,
353 .start
= IRQ_UART0_RX
,
354 .end
= IRQ_UART0_RX
+1,
355 .flags
= IORESOURCE_IRQ
,
358 .start
= CH_UART0_RX
,
359 .end
= CH_UART0_RX
+1,
360 .flags
= IORESOURCE_DMA
,
364 static struct platform_device bfin_sir0_device
= {
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
[] = {
377 .start
= SPORT0_TCR1
,
378 .end
= SPORT0_MRCS3
+4,
379 .flags
= IORESOURCE_MEM
,
382 .start
= IRQ_SPORT0_RX
,
383 .end
= IRQ_SPORT0_RX
+1,
384 .flags
= IORESOURCE_IRQ
,
387 .start
= IRQ_SPORT0_ERROR
,
388 .end
= IRQ_SPORT0_ERROR
,
389 .flags
= IORESOURCE_IRQ
,
393 static unsigned short bfin_sport0_peripherals
[] = {
394 P_SPORT0_TFS
, P_SPORT0_DTPRI
, P_SPORT0_TSCLK
, P_SPORT0_RFS
,
395 P_SPORT0_DRPRI
, P_SPORT0_RSCLK
, 0
398 static struct platform_device bfin_sport0_uart_device
= {
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
, /* Passed to driver */
408 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
409 static struct resource bfin_sport1_uart_resources
[] = {
411 .start
= SPORT1_TCR1
,
412 .end
= SPORT1_MRCS3
+4,
413 .flags
= IORESOURCE_MEM
,
416 .start
= IRQ_SPORT1_RX
,
417 .end
= IRQ_SPORT1_RX
+1,
418 .flags
= IORESOURCE_IRQ
,
421 .start
= IRQ_SPORT1_ERROR
,
422 .end
= IRQ_SPORT1_ERROR
,
423 .flags
= IORESOURCE_IRQ
,
427 static unsigned short bfin_sport1_peripherals
[] = {
428 P_SPORT1_TFS
, P_SPORT1_DTPRI
, P_SPORT1_TSCLK
, P_SPORT1_RFS
,
429 P_SPORT1_DRPRI
, P_SPORT1_RSCLK
, 0
432 static struct platform_device bfin_sport1_uart_device
= {
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
, /* Passed to driver */
444 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
445 #include <linux/input.h>
446 #include <linux/gpio_keys.h>
448 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
449 {BTN_0
, GPIO_PF5
, 0, "gpio-keys: BTN0"},
450 {BTN_1
, GPIO_PF6
, 0, "gpio-keys: BTN1"},
451 {BTN_2
, GPIO_PF8
, 0, "gpio-keys: BTN2"},
454 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
455 .buttons
= bfin_gpio_keys_table
,
456 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
459 static struct platform_device bfin_device_gpiokeys
= {
462 .platform_data
= &bfin_gpio_keys_data
,
467 #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
468 #include <linux/i2c-gpio.h>
470 static struct i2c_gpio_platform_data i2c_gpio_data
= {
473 .sda_is_open_drain
= 0,
474 .scl_is_open_drain
= 0,
478 static struct platform_device i2c_gpio_device
= {
482 .platform_data
= &i2c_gpio_data
,
487 static struct i2c_board_info __initdata bfin_i2c_board_info
[] = {
488 #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
490 I2C_BOARD_INFO("ad7142_joystick", 0x2C),
494 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
496 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
499 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
501 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
505 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
507 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
510 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
512 I2C_BOARD_INFO("ad5252", 0x2f),
517 static const unsigned int cclk_vlev_datasheet
[] =
519 VRPAIR(VLEV_085
, 250000000),
520 VRPAIR(VLEV_090
, 376000000),
521 VRPAIR(VLEV_095
, 426000000),
522 VRPAIR(VLEV_100
, 426000000),
523 VRPAIR(VLEV_105
, 476000000),
524 VRPAIR(VLEV_110
, 476000000),
525 VRPAIR(VLEV_115
, 476000000),
526 VRPAIR(VLEV_120
, 600000000),
527 VRPAIR(VLEV_125
, 600000000),
528 VRPAIR(VLEV_130
, 600000000),
531 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
532 .tuple_tab
= cclk_vlev_datasheet
,
533 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
534 .vr_settling_time
= 25 /* us */,
537 static struct platform_device bfin_dpmc
= {
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)
549 #include <asm/bfin_sport.h>
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] = {
560 static struct bfin_snd_platform_data bfin_snd_data
[] = {
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)
600 static struct platform_device bfin_i2s_pcm
= {
601 .name
= "bfin-i2s-pcm-audio",
606 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
607 static struct platform_device bfin_tdm_pcm
= {
608 .name
= "bfin-tdm-pcm-audio",
613 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
614 static struct platform_device bfin_ac97_pcm
= {
615 .name
= "bfin-ac97-pcm-audio",
620 #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || \
621 defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)
622 static const unsigned ad73311_gpio
[] = {
626 static struct platform_device bfin_ad73311_machine
= {
627 .name
= "bfin-snd-ad73311",
630 .platform_data
= (void *)ad73311_gpio
,
635 #if defined(CONFIG_SND_SOC_AD73311) || defined(CONFIG_SND_SOC_AD73311_MODULE)
636 static struct platform_device bfin_ad73311_codec_device
= {
642 #if defined(CONFIG_SND_SOC_AD74111) || defined(CONFIG_SND_SOC_AD74111_MODULE)
643 static struct platform_device bfin_ad74111_codec_device
= {
649 #if defined(CONFIG_SND_BF5XX_SOC_I2S) || \
650 defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE)
651 static struct platform_device bfin_i2s
= {
653 .id
= CONFIG_SND_BF5XX_SPORT_NUM
,
655 ARRAY_SIZE(bfin_snd_resources
[CONFIG_SND_BF5XX_SPORT_NUM
]),
656 .resource
= bfin_snd_resources
[CONFIG_SND_BF5XX_SPORT_NUM
],
658 .platform_data
= &bfin_snd_data
[CONFIG_SND_BF5XX_SPORT_NUM
],
663 #if defined(CONFIG_SND_BF5XX_SOC_TDM) || \
664 defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE)
665 static struct platform_device bfin_tdm
= {
667 .id
= CONFIG_SND_BF5XX_SPORT_NUM
,
669 ARRAY_SIZE(bfin_snd_resources
[CONFIG_SND_BF5XX_SPORT_NUM
]),
670 .resource
= bfin_snd_resources
[CONFIG_SND_BF5XX_SPORT_NUM
],
672 .platform_data
= &bfin_snd_data
[CONFIG_SND_BF5XX_SPORT_NUM
],
677 #if defined(CONFIG_SND_BF5XX_SOC_AC97) || \
678 defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE)
679 static struct platform_device bfin_ac97
= {
681 .id
= CONFIG_SND_BF5XX_SPORT_NUM
,
683 ARRAY_SIZE(bfin_snd_resources
[CONFIG_SND_BF5XX_SPORT_NUM
]),
684 .resource
= bfin_snd_resources
[CONFIG_SND_BF5XX_SPORT_NUM
],
686 .platform_data
= &bfin_snd_data
[CONFIG_SND_BF5XX_SPORT_NUM
],
691 static struct platform_device
*stamp_devices
[] __initdata
= {
695 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
699 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
703 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
704 &net2272_bfin_device
,
707 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
711 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
712 #ifdef CONFIG_SERIAL_BFIN_UART0
717 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
718 #ifdef CONFIG_BFIN_SIR0
723 #if defined(CONFIG_SERIAL_BFIN_SPORT) || \
724 defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
725 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
726 &bfin_sport0_uart_device
,
728 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
729 &bfin_sport1_uart_device
,
733 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
734 &bfin_device_gpiokeys
,
737 #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
741 #if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE)
745 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
749 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
753 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
757 #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || \
758 defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)
759 &bfin_ad73311_machine
,
762 #if defined(CONFIG_SND_SOC_AD73311) || defined(CONFIG_SND_SOC_AD73311_MODULE)
763 &bfin_ad73311_codec_device
,
766 #if defined(CONFIG_SND_SOC_AD74111) || defined(CONFIG_SND_SOC_AD74111_MODULE)
767 &bfin_ad74111_codec_device
,
770 #if defined(CONFIG_SND_BF5XX_SOC_I2S) || \
771 defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE)
775 #if defined(CONFIG_SND_BF5XX_SOC_TDM) || \
776 defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE)
780 #if defined(CONFIG_SND_BF5XX_SOC_AC97) || \
781 defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE)
786 static int __init
net2272_init(void)
788 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
791 /* Set PF0 to 0, PF1 to 1 make /AMS3 work properly */
792 ret
= gpio_request(GPIO_PF0
, "net2272");
796 ret
= gpio_request(GPIO_PF1
, "net2272");
802 ret
= gpio_request(GPIO_PF11
, "net2272");
809 gpio_direction_output(GPIO_PF0
, 0);
810 gpio_direction_output(GPIO_PF1
, 1);
812 /* Reset the USB chip */
813 gpio_direction_output(GPIO_PF11
, 0);
815 gpio_set_value(GPIO_PF11
, 1);
821 static int __init
stamp_init(void)
825 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
827 i2c_register_board_info(0, bfin_i2c_board_info
,
828 ARRAY_SIZE(bfin_i2c_board_info
));
830 ret
= platform_add_devices(stamp_devices
, ARRAY_SIZE(stamp_devices
));
834 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
836 * setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC.
837 * the bfin-async-map driver takes care of flipping between
838 * flash and ethernet when necessary.
840 ret
= gpio_request(GPIO_PF0
, "enet_cpld");
842 gpio_direction_output(GPIO_PF0
, 1);
848 pr_warning("unable to configure net2272; it probably won't work\n");
850 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
854 arch_initcall(stamp_init
);
856 static struct platform_device
*stamp_early_devices
[] __initdata
= {
857 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
858 #ifdef CONFIG_SERIAL_BFIN_UART0
863 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
864 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
865 &bfin_sport0_uart_device
,
867 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
868 &bfin_sport1_uart_device
,
873 void __init
native_machine_early_platform_add_devices(void)
875 printk(KERN_INFO
"register early platform devices\n");
876 early_platform_add_devices(stamp_early_devices
,
877 ARRAY_SIZE(stamp_early_devices
));
880 void native_machine_restart(char *cmd
)
882 /* workaround pull up on cpld / flash pin not being strong enough */
883 gpio_request(GPIO_PF0
, "flash_cpld");
884 gpio_direction_output(GPIO_PF0
, 0);