2 * File: arch/blackfin/mach-bf537/boards/stamp.c
3 * Based on: arch/blackfin/mach-bf533/boards/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2006 Analog Devices Inc.
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31 #include <linux/device.h>
32 #include <linux/platform_device.h>
33 #include <linux/mtd/mtd.h>
34 #include <linux/mtd/partitions.h>
35 #include <linux/mtd/physmap.h>
36 #include <linux/spi/spi.h>
37 #include <linux/spi/flash.h>
38 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
39 #include <linux/usb/isp1362.h>
41 #include <linux/ata_platform.h>
42 #include <linux/irq.h>
43 #include <linux/interrupt.h>
44 #include <linux/i2c.h>
45 #include <linux/usb/sl811.h>
47 #include <asm/bfin5xx_spi.h>
48 #include <asm/reboot.h>
49 #include <asm/portmux.h>
51 #include <linux/spi/ad7877.h>
54 * Name the Board for the /proc/cpuinfo
56 const char bfin_board_name[] = "ADDS-BF537-STAMP";
59 * Driver needs to know address, irq and flag pin.
62 #define ISP1761_BASE 0x203C0000
63 #define ISP1761_IRQ IRQ_PF7
65 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
66 static struct resource bfin_isp1761_resources[] = {
68 .name = "isp1761-regs",
69 .start = ISP1761_BASE + 0x00000000,
70 .end = ISP1761_BASE + 0x000fffff,
71 .flags = IORESOURCE_MEM,
76 .flags = IORESOURCE_IRQ,
80 static struct platform_device bfin_isp1761_device = {
83 .num_resources = ARRAY_SIZE(bfin_isp1761_resources),
84 .resource = bfin_isp1761_resources,
87 static struct platform_device *bfin_isp1761_devices[] = {
91 int __init bfin_isp1761_init(void)
93 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
95 printk(KERN_INFO "%s(): registering device resources\n", __func__);
96 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
98 return platform_add_devices(bfin_isp1761_devices, num_devices);
101 void __exit bfin_isp1761_exit(void)
103 platform_device_unregister(&bfin_isp1761_device);
106 arch_initcall(bfin_isp1761_init);
109 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
110 #include <linux/input.h>
111 #include <linux/gpio_keys.h>
113 static struct gpio_keys_button bfin_gpio_keys_table[] = {
114 {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"},
115 {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"},
116 {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"},
117 {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"},
120 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
121 .buttons = bfin_gpio_keys_table,
122 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
125 static struct platform_device bfin_device_gpiokeys = {
128 .platform_data = &bfin_gpio_keys_data,
133 static struct resource bfin_gpios_resources = {
135 .end = MAX_BLACKFIN_GPIOS - 1,
136 .flags = IORESOURCE_IRQ,
139 static struct platform_device bfin_gpios_device = {
140 .name = "simple-gpio",
143 .resource = &bfin_gpios_resources,
146 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
147 static struct resource bfin_pcmcia_cf_resources[] = {
149 .start = 0x20310000, /* IO PORT */
151 .flags = IORESOURCE_MEM,
153 .start = 0x20311000, /* Attribute Memory */
155 .flags = IORESOURCE_MEM,
159 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
161 .start = 6, /* Card Detect PF6 */
163 .flags = IORESOURCE_IRQ,
167 static struct platform_device bfin_pcmcia_cf_device = {
168 .name = "bfin_cf_pcmcia",
170 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
171 .resource = bfin_pcmcia_cf_resources,
175 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
176 static struct platform_device rtc_device = {
182 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
183 static struct resource smc91x_resources[] = {
185 .name = "smc91x-regs",
187 .end = 0x20300300 + 16,
188 .flags = IORESOURCE_MEM,
193 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
196 static struct platform_device smc91x_device = {
199 .num_resources = ARRAY_SIZE(smc91x_resources),
200 .resource = smc91x_resources,
204 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
205 static struct resource dm9000_resources[] = {
208 .end = 0x203FB800 + 8,
209 .flags = IORESOURCE_MEM,
214 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
218 static struct platform_device dm9000_device = {
221 .num_resources = ARRAY_SIZE(dm9000_resources),
222 .resource = dm9000_resources,
226 #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
227 static struct resource ax88180_resources[] = {
230 .end = 0x20300000 + 0x8000,
231 .flags = IORESOURCE_MEM,
236 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL),
240 static struct platform_device ax88180_device = {
243 .num_resources = ARRAY_SIZE(ax88180_resources),
244 .resource = ax88180_resources,
248 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
249 static struct resource sl811_hcd_resources[] = {
253 .flags = IORESOURCE_MEM,
257 .flags = IORESOURCE_MEM,
259 .start = CONFIG_USB_SL811_BFIN_IRQ,
260 .end = CONFIG_USB_SL811_BFIN_IRQ,
261 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
265 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
266 void sl811_port_power(struct device *dev, int is_on)
268 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
269 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
273 static struct sl811_platform_data sl811_priv = {
275 .power = 250, /* == 500mA */
276 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
277 .port_power = &sl811_port_power,
281 static struct platform_device sl811_hcd_device = {
285 .platform_data = &sl811_priv,
287 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
288 .resource = sl811_hcd_resources,
292 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
293 static struct resource isp1362_hcd_resources[] = {
297 .flags = IORESOURCE_MEM,
301 .flags = IORESOURCE_MEM,
303 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
304 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
305 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
309 static struct isp1362_platform_data isp1362_priv = {
314 .int_edge_triggered = 0,
315 .remote_wakeup_connected = 0,
316 .no_power_switching = 1,
317 .power_switching_mode = 0,
320 static struct platform_device isp1362_hcd_device = {
321 .name = "isp1362-hcd",
324 .platform_data = &isp1362_priv,
326 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
327 .resource = isp1362_hcd_resources,
331 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
332 static struct platform_device bfin_mac_device = {
337 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
338 static struct resource net2272_bfin_resources[] = {
341 .end = 0x20300000 + 0x100,
342 .flags = IORESOURCE_MEM,
346 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
350 static struct platform_device net2272_bfin_device = {
353 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
354 .resource = net2272_bfin_resources,
358 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
359 static struct mtd_partition stamp_partitions[] = {
361 .name = "Bootloader",
367 .offset = MTDPART_OFS_APPEND,
370 .size = 0x400000 - 0x40000 - 0xE0000 - 0x10000,
371 .offset = MTDPART_OFS_APPEND,
373 .name = "MAC Address",
374 .size = MTDPART_SIZ_FULL,
376 .mask_flags = MTD_WRITEABLE,
380 static struct physmap_flash_data stamp_flash_data = {
382 .parts = stamp_partitions,
383 .nr_parts = ARRAY_SIZE(stamp_partitions),
386 static struct resource stamp_flash_resource = {
389 .flags = IORESOURCE_MEM,
392 static struct platform_device stamp_flash_device = {
393 .name = "physmap-flash",
396 .platform_data = &stamp_flash_data,
399 .resource = &stamp_flash_resource,
403 #if defined(CONFIG_MTD_M25P80) \
404 || defined(CONFIG_MTD_M25P80_MODULE)
405 static struct mtd_partition bfin_spi_flash_partitions[] = {
407 .name = "bootloader",
410 .mask_flags = MTD_CAP_ROM
414 .offset = MTDPART_OFS_APPEND,
416 .name = "file system",
417 .size = MTDPART_SIZ_FULL,
418 .offset = MTDPART_OFS_APPEND,
422 static struct flash_platform_data bfin_spi_flash_data = {
424 .parts = bfin_spi_flash_partitions,
425 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
429 /* SPI flash chip (m25p64) */
430 static struct bfin5xx_spi_chip spi_flash_chip_info = {
431 .enable_dma = 0, /* use dma transfer with this chip*/
436 #if defined(CONFIG_SPI_ADC_BF533) \
437 || defined(CONFIG_SPI_ADC_BF533_MODULE)
439 static struct bfin5xx_spi_chip spi_adc_chip_info = {
440 .enable_dma = 1, /* use dma transfer with this chip*/
445 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
446 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
447 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
453 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
454 static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
460 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
461 static struct bfin5xx_spi_chip spi_mmc_chip_info = {
467 #if defined(CONFIG_PBX)
468 static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
469 .ctl_reg = 0x4, /* send zero */
472 .cs_change_per_word = 1,
476 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
477 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
482 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
484 .vref_delay_usecs = 50, /* internal, no capacitor */
487 .pressure_max = 1000,
489 .stopacq_polarity = 1,
490 .first_conversion_delay = 3,
491 .acquisition_time = 1,
493 .pen_down_acc_interval = 1,
497 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
498 static struct bfin5xx_spi_chip spidev_chip_info = {
504 #if defined(CONFIG_MTD_DATAFLASH) \
505 || defined(CONFIG_MTD_DATAFLASH_MODULE)
507 static struct bfin5xx_spi_chip data_flash_chip_info = {
508 .enable_dma = 0, /* use dma transfer with this chip*/
513 static struct spi_board_info bfin_spi_board_info[] __initdata = {
514 #if defined(CONFIG_MTD_M25P80) \
515 || defined(CONFIG_MTD_M25P80_MODULE)
517 /* the modalias must be the same as spi device driver name */
518 .modalias = "m25p80", /* Name of spi_driver for this device */
519 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
520 .bus_num = 0, /* Framework bus number */
521 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
522 .platform_data = &bfin_spi_flash_data,
523 .controller_data = &spi_flash_chip_info,
527 #if defined(CONFIG_MTD_DATAFLASH) \
528 || defined(CONFIG_MTD_DATAFLASH_MODULE)
529 { /* DataFlash chip */
530 .modalias = "mtd_dataflash",
531 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
532 .bus_num = 0, /* Framework bus number */
533 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
534 .controller_data = &data_flash_chip_info,
538 #if defined(CONFIG_SPI_ADC_BF533) \
539 || defined(CONFIG_SPI_ADC_BF533_MODULE)
541 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
542 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
543 .bus_num = 0, /* Framework bus number */
544 .chip_select = 1, /* Framework chip select. */
545 .platform_data = NULL, /* No spi_driver specific config */
546 .controller_data = &spi_adc_chip_info,
550 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
551 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
553 .modalias = "ad1836-spi",
554 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
556 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
557 .controller_data = &ad1836_spi_chip_info,
560 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
562 .modalias = "ad9960-spi",
563 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
566 .controller_data = &ad9960_spi_chip_info,
569 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
571 .modalias = "spi_mmc_dummy",
572 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
575 .platform_data = NULL,
576 .controller_data = &spi_mmc_chip_info,
580 .modalias = "spi_mmc",
581 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
583 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
584 .platform_data = NULL,
585 .controller_data = &spi_mmc_chip_info,
589 #if defined(CONFIG_PBX)
591 .modalias = "fxs-spi",
592 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
594 .chip_select = 8 - CONFIG_J11_JUMPER,
595 .controller_data = &spi_si3xxx_chip_info,
599 .modalias = "fxo-spi",
600 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
602 .chip_select = 8 - CONFIG_J19_JUMPER,
603 .controller_data = &spi_si3xxx_chip_info,
607 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
609 .modalias = "ad7877",
610 .platform_data = &bfin_ad7877_ts_info,
612 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
615 .controller_data = &spi_ad7877_chip_info,
618 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
620 .modalias = "spidev",
621 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
624 .controller_data = &spidev_chip_info,
629 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
630 /* SPI controller data */
631 static struct bfin5xx_spi_master bfin_spi0_info = {
633 .enable_dma = 1, /* master has the ability to do dma transfer */
634 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
638 static struct resource bfin_spi0_resource[] = {
640 .start = SPI0_REGBASE,
641 .end = SPI0_REGBASE + 0xFF,
642 .flags = IORESOURCE_MEM,
647 .flags = IORESOURCE_IRQ,
651 static struct platform_device bfin_spi0_device = {
653 .id = 0, /* Bus number */
654 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
655 .resource = bfin_spi0_resource,
657 .platform_data = &bfin_spi0_info, /* Passed to driver */
660 #endif /* spi master and devices */
662 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
663 static struct platform_device bfin_fb_device = {
664 .name = "bf537-lq035",
668 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
669 static struct platform_device bfin_fb_adv7393_device = {
670 .name = "bfin-adv7393",
674 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
675 static struct resource bfin_uart_resources[] = {
676 #ifdef CONFIG_SERIAL_BFIN_UART0
680 .flags = IORESOURCE_MEM,
683 #ifdef CONFIG_SERIAL_BFIN_UART1
687 .flags = IORESOURCE_MEM,
692 static struct platform_device bfin_uart_device = {
695 .num_resources = ARRAY_SIZE(bfin_uart_resources),
696 .resource = bfin_uart_resources,
700 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
701 static struct resource bfin_sir_resources[] = {
702 #ifdef CONFIG_BFIN_SIR0
706 .flags = IORESOURCE_MEM,
709 #ifdef CONFIG_BFIN_SIR1
713 .flags = IORESOURCE_MEM,
718 static struct platform_device bfin_sir_device = {
721 .num_resources = ARRAY_SIZE(bfin_sir_resources),
722 .resource = bfin_sir_resources,
726 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
727 static struct resource bfin_twi0_resource[] = {
729 .start = TWI0_REGBASE,
731 .flags = IORESOURCE_MEM,
736 .flags = IORESOURCE_IRQ,
740 static struct platform_device i2c_bfin_twi_device = {
741 .name = "i2c-bfin-twi",
743 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
744 .resource = bfin_twi0_resource,
748 #ifdef CONFIG_I2C_BOARDINFO
749 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
750 #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
752 I2C_BOARD_INFO("ad7142_joystick", 0x2C),
756 #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
758 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
761 #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
763 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
770 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
771 static struct platform_device bfin_sport0_uart_device = {
772 .name = "bfin-sport-uart",
776 static struct platform_device bfin_sport1_uart_device = {
777 .name = "bfin-sport-uart",
782 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
785 static struct pata_platform_info bfin_pata_platform_data = {
787 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
790 static struct resource bfin_pata_resources[] = {
794 .flags = IORESOURCE_MEM,
799 .flags = IORESOURCE_MEM,
804 .flags = IORESOURCE_IRQ,
808 static struct platform_device bfin_pata_device = {
809 .name = "pata_platform",
811 .num_resources = ARRAY_SIZE(bfin_pata_resources),
812 .resource = bfin_pata_resources,
814 .platform_data = &bfin_pata_platform_data,
819 static const unsigned int cclk_vlev_datasheet[] =
821 VRPAIR(VLEV_085, 250000000),
822 VRPAIR(VLEV_090, 376000000),
823 VRPAIR(VLEV_095, 426000000),
824 VRPAIR(VLEV_100, 426000000),
825 VRPAIR(VLEV_105, 476000000),
826 VRPAIR(VLEV_110, 476000000),
827 VRPAIR(VLEV_115, 476000000),
828 VRPAIR(VLEV_120, 500000000),
829 VRPAIR(VLEV_125, 533000000),
830 VRPAIR(VLEV_130, 600000000),
833 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
834 .tuple_tab = cclk_vlev_datasheet,
835 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
836 .vr_settling_time = 25 /* us */,
839 static struct platform_device bfin_dpmc = {
842 .platform_data = &bfin_dmpc_vreg_data,
846 static struct platform_device *stamp_devices[] __initdata = {
850 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
851 &bfin_pcmcia_cf_device,
854 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
858 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
862 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
866 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
870 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
874 #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
878 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
882 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
883 &net2272_bfin_device,
886 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
890 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
894 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
895 &bfin_fb_adv7393_device,
898 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
902 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
906 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
907 &i2c_bfin_twi_device,
910 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
911 &bfin_sport0_uart_device,
912 &bfin_sport1_uart_device,
915 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
919 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
920 &bfin_device_gpiokeys,
925 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
930 static int __init stamp_init(void)
932 printk(KERN_INFO "%s(): registering device resources\n", __func__);
934 #ifdef CONFIG_I2C_BOARDINFO
935 i2c_register_board_info(0, bfin_i2c_board_info,
936 ARRAY_SIZE(bfin_i2c_board_info));
939 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
940 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
942 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
943 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
949 arch_initcall(stamp_init);
951 void native_machine_restart(char *cmd)
953 /* workaround reboot hang when booting from SPI */
954 if ((bfin_read_SYSCR() & 0x7) == 0x3)
955 bfin_gpio_reset_spi0_ssel1();
959 * Currently the MAC address is saved in Flash by U-Boot
961 #define FLASH_MAC 0x203f0000
962 void bfin_get_ether_addr(char *addr)
964 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
965 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
967 EXPORT_SYMBOL(bfin_get_ether_addr);