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>
50 #include <linux/spi/ad7877.h>
53 * Name the Board for the /proc/cpuinfo
55 const char bfin_board_name[] = "ADDS-BF537-STAMP";
58 * Driver needs to know address, irq and flag pin.
61 #define ISP1761_BASE 0x203C0000
62 #define ISP1761_IRQ IRQ_PF7
64 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
65 static struct resource bfin_isp1761_resources[] = {
67 .name = "isp1761-regs",
68 .start = ISP1761_BASE + 0x00000000,
69 .end = ISP1761_BASE + 0x000fffff,
70 .flags = IORESOURCE_MEM,
75 .flags = IORESOURCE_IRQ,
79 static struct platform_device bfin_isp1761_device = {
82 .num_resources = ARRAY_SIZE(bfin_isp1761_resources),
83 .resource = bfin_isp1761_resources,
86 static struct platform_device *bfin_isp1761_devices[] = {
90 int __init bfin_isp1761_init(void)
92 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
94 printk(KERN_INFO "%s(): registering device resources\n", __func__);
95 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
97 return platform_add_devices(bfin_isp1761_devices, num_devices);
100 void __exit bfin_isp1761_exit(void)
102 platform_device_unregister(&bfin_isp1761_device);
105 arch_initcall(bfin_isp1761_init);
108 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
109 #include <linux/input.h>
110 #include <linux/gpio_keys.h>
112 static struct gpio_keys_button bfin_gpio_keys_table[] = {
113 {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"},
114 {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"},
115 {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"},
116 {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"},
119 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
120 .buttons = bfin_gpio_keys_table,
121 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
124 static struct platform_device bfin_device_gpiokeys = {
127 .platform_data = &bfin_gpio_keys_data,
132 static struct resource bfin_gpios_resources = {
134 .end = MAX_BLACKFIN_GPIOS - 1,
135 .flags = IORESOURCE_IRQ,
138 static struct platform_device bfin_gpios_device = {
139 .name = "simple-gpio",
142 .resource = &bfin_gpios_resources,
145 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
146 static struct resource bfin_pcmcia_cf_resources[] = {
148 .start = 0x20310000, /* IO PORT */
150 .flags = IORESOURCE_MEM,
152 .start = 0x20311000, /* Attribute Memory */
154 .flags = IORESOURCE_MEM,
158 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
160 .start = 6, /* Card Detect PF6 */
162 .flags = IORESOURCE_IRQ,
166 static struct platform_device bfin_pcmcia_cf_device = {
167 .name = "bfin_cf_pcmcia",
169 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
170 .resource = bfin_pcmcia_cf_resources,
174 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
175 static struct platform_device rtc_device = {
181 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
182 static struct resource smc91x_resources[] = {
184 .name = "smc91x-regs",
186 .end = 0x20300300 + 16,
187 .flags = IORESOURCE_MEM,
192 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
195 static struct platform_device smc91x_device = {
198 .num_resources = ARRAY_SIZE(smc91x_resources),
199 .resource = smc91x_resources,
203 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
204 static struct resource dm9000_resources[] = {
207 .end = 0x203FB800 + 8,
208 .flags = IORESOURCE_MEM,
213 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
217 static struct platform_device dm9000_device = {
220 .num_resources = ARRAY_SIZE(dm9000_resources),
221 .resource = dm9000_resources,
225 #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
226 static struct resource ax88180_resources[] = {
229 .end = 0x20300000 + 0x8000,
230 .flags = IORESOURCE_MEM,
235 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL),
239 static struct platform_device ax88180_device = {
242 .num_resources = ARRAY_SIZE(ax88180_resources),
243 .resource = ax88180_resources,
247 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
248 static struct resource sl811_hcd_resources[] = {
252 .flags = IORESOURCE_MEM,
256 .flags = IORESOURCE_MEM,
258 .start = CONFIG_USB_SL811_BFIN_IRQ,
259 .end = CONFIG_USB_SL811_BFIN_IRQ,
260 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
264 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
265 void sl811_port_power(struct device *dev, int is_on)
267 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
268 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
272 static struct sl811_platform_data sl811_priv = {
274 .power = 250, /* == 500mA */
275 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
276 .port_power = &sl811_port_power,
280 static struct platform_device sl811_hcd_device = {
284 .platform_data = &sl811_priv,
286 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
287 .resource = sl811_hcd_resources,
291 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
292 static struct resource isp1362_hcd_resources[] = {
296 .flags = IORESOURCE_MEM,
300 .flags = IORESOURCE_MEM,
302 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
303 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
304 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
308 static struct isp1362_platform_data isp1362_priv = {
313 .int_edge_triggered = 0,
314 .remote_wakeup_connected = 0,
315 .no_power_switching = 1,
316 .power_switching_mode = 0,
319 static struct platform_device isp1362_hcd_device = {
320 .name = "isp1362-hcd",
323 .platform_data = &isp1362_priv,
325 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
326 .resource = isp1362_hcd_resources,
330 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
331 static struct platform_device bfin_mac_device = {
336 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
337 static struct resource net2272_bfin_resources[] = {
340 .end = 0x20300000 + 0x100,
341 .flags = IORESOURCE_MEM,
345 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
349 static struct platform_device net2272_bfin_device = {
352 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
353 .resource = net2272_bfin_resources,
357 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
358 static struct mtd_partition stamp_partitions[] = {
360 .name = "Bootloader",
366 .offset = MTDPART_OFS_APPEND,
369 .size = 0x400000 - 0x40000 - 0xE0000 - 0x10000,
370 .offset = MTDPART_OFS_APPEND,
372 .name = "MAC Address",
373 .size = MTDPART_SIZ_FULL,
375 .mask_flags = MTD_WRITEABLE,
379 static struct physmap_flash_data stamp_flash_data = {
381 .parts = stamp_partitions,
382 .nr_parts = ARRAY_SIZE(stamp_partitions),
385 static struct resource stamp_flash_resource = {
388 .flags = IORESOURCE_MEM,
391 static struct platform_device stamp_flash_device = {
392 .name = "physmap-flash",
395 .platform_data = &stamp_flash_data,
398 .resource = &stamp_flash_resource,
402 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
403 /* all SPI peripherals info goes here */
405 #if defined(CONFIG_MTD_M25P80) \
406 || defined(CONFIG_MTD_M25P80_MODULE)
407 static struct mtd_partition bfin_spi_flash_partitions[] = {
409 .name = "bootloader",
412 .mask_flags = MTD_CAP_ROM
416 .offset = MTDPART_OFS_APPEND,
418 .name = "file system",
419 .size = MTDPART_SIZ_FULL,
420 .offset = MTDPART_OFS_APPEND,
424 static struct flash_platform_data bfin_spi_flash_data = {
426 .parts = bfin_spi_flash_partitions,
427 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
431 /* SPI flash chip (m25p64) */
432 static struct bfin5xx_spi_chip spi_flash_chip_info = {
433 .enable_dma = 0, /* use dma transfer with this chip*/
438 #if defined(CONFIG_SPI_ADC_BF533) \
439 || defined(CONFIG_SPI_ADC_BF533_MODULE)
441 static struct bfin5xx_spi_chip spi_adc_chip_info = {
442 .enable_dma = 1, /* use dma transfer with this chip*/
447 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
448 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
449 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
455 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
456 static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
462 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
463 static struct bfin5xx_spi_chip spi_mmc_chip_info = {
469 #if defined(CONFIG_PBX)
470 static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
471 .ctl_reg = 0x4, /* send zero */
474 .cs_change_per_word = 1,
478 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
479 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
484 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
486 .vref_delay_usecs = 50, /* internal, no capacitor */
489 .pressure_max = 1000,
491 .stopacq_polarity = 1,
492 .first_conversion_delay = 3,
493 .acquisition_time = 1,
495 .pen_down_acc_interval = 1,
499 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
500 static struct bfin5xx_spi_chip spidev_chip_info = {
506 #if defined(CONFIG_MTD_DATAFLASH) \
507 || defined(CONFIG_MTD_DATAFLASH_MODULE)
509 static struct bfin5xx_spi_chip data_flash_chip_info = {
510 .enable_dma = 0, /* use dma transfer with this chip*/
515 static struct spi_board_info bfin_spi_board_info[] __initdata = {
516 #if defined(CONFIG_MTD_M25P80) \
517 || defined(CONFIG_MTD_M25P80_MODULE)
519 /* the modalias must be the same as spi device driver name */
520 .modalias = "m25p80", /* Name of spi_driver for this device */
521 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
522 .bus_num = 0, /* Framework bus number */
523 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
524 .platform_data = &bfin_spi_flash_data,
525 .controller_data = &spi_flash_chip_info,
529 #if defined(CONFIG_MTD_DATAFLASH) \
530 || defined(CONFIG_MTD_DATAFLASH_MODULE)
531 { /* DataFlash chip */
532 .modalias = "mtd_dataflash",
533 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
534 .bus_num = 0, /* Framework bus number */
535 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
536 .controller_data = &data_flash_chip_info,
540 #if defined(CONFIG_SPI_ADC_BF533) \
541 || defined(CONFIG_SPI_ADC_BF533_MODULE)
543 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
544 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
545 .bus_num = 0, /* Framework bus number */
546 .chip_select = 1, /* Framework chip select. */
547 .platform_data = NULL, /* No spi_driver specific config */
548 .controller_data = &spi_adc_chip_info,
552 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
553 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
555 .modalias = "ad1836-spi",
556 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
558 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
559 .controller_data = &ad1836_spi_chip_info,
562 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
564 .modalias = "ad9960-spi",
565 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
568 .controller_data = &ad9960_spi_chip_info,
571 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
573 .modalias = "spi_mmc_dummy",
574 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
577 .platform_data = NULL,
578 .controller_data = &spi_mmc_chip_info,
582 .modalias = "spi_mmc",
583 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
585 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
586 .platform_data = NULL,
587 .controller_data = &spi_mmc_chip_info,
591 #if defined(CONFIG_PBX)
593 .modalias = "fxs-spi",
594 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
596 .chip_select = 8 - CONFIG_J11_JUMPER,
597 .controller_data = &spi_si3xxx_chip_info,
601 .modalias = "fxo-spi",
602 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
604 .chip_select = 8 - CONFIG_J19_JUMPER,
605 .controller_data = &spi_si3xxx_chip_info,
609 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
611 .modalias = "ad7877",
612 .platform_data = &bfin_ad7877_ts_info,
614 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
617 .controller_data = &spi_ad7877_chip_info,
620 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
622 .modalias = "spidev",
623 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
626 .controller_data = &spidev_chip_info,
631 /* SPI controller data */
632 static struct bfin5xx_spi_master bfin_spi0_info = {
634 .enable_dma = 1, /* master has the ability to do dma transfer */
635 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
639 static struct resource bfin_spi0_resource[] = {
641 .start = SPI0_REGBASE,
642 .end = SPI0_REGBASE + 0xFF,
643 .flags = IORESOURCE_MEM,
648 .flags = IORESOURCE_IRQ,
652 static struct platform_device bfin_spi0_device = {
654 .id = 0, /* Bus number */
655 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
656 .resource = bfin_spi0_resource,
658 .platform_data = &bfin_spi0_info, /* Passed to driver */
661 #endif /* spi master and devices */
663 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
664 static struct platform_device bfin_fb_device = {
665 .name = "bf537-lq035",
669 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
670 static struct platform_device bfin_fb_adv7393_device = {
671 .name = "bfin-adv7393",
675 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
676 static struct resource bfin_uart_resources[] = {
677 #ifdef CONFIG_SERIAL_BFIN_UART0
681 .flags = IORESOURCE_MEM,
684 #ifdef CONFIG_SERIAL_BFIN_UART1
688 .flags = IORESOURCE_MEM,
693 static struct platform_device bfin_uart_device = {
696 .num_resources = ARRAY_SIZE(bfin_uart_resources),
697 .resource = bfin_uart_resources,
701 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
702 static struct resource bfin_sir_resources[] = {
703 #ifdef CONFIG_BFIN_SIR0
707 .flags = IORESOURCE_MEM,
710 #ifdef CONFIG_BFIN_SIR1
714 .flags = IORESOURCE_MEM,
719 static struct platform_device bfin_sir_device = {
722 .num_resources = ARRAY_SIZE(bfin_sir_resources),
723 .resource = bfin_sir_resources,
727 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
728 static struct resource bfin_twi0_resource[] = {
730 .start = TWI0_REGBASE,
732 .flags = IORESOURCE_MEM,
737 .flags = IORESOURCE_IRQ,
741 static struct platform_device i2c_bfin_twi_device = {
742 .name = "i2c-bfin-twi",
744 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
745 .resource = bfin_twi0_resource,
749 #ifdef CONFIG_I2C_BOARDINFO
750 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
751 #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
753 I2C_BOARD_INFO("ad7142_joystick", 0x2C),
754 .type = "ad7142_joystick",
758 #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
760 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
761 .type = "pcf8574_lcd",
764 #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
766 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
767 .type = "pcf8574_keypad",
774 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
775 static struct platform_device bfin_sport0_uart_device = {
776 .name = "bfin-sport-uart",
780 static struct platform_device bfin_sport1_uart_device = {
781 .name = "bfin-sport-uart",
786 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
789 static struct pata_platform_info bfin_pata_platform_data = {
791 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
794 static struct resource bfin_pata_resources[] = {
798 .flags = IORESOURCE_MEM,
803 .flags = IORESOURCE_MEM,
808 .flags = IORESOURCE_IRQ,
812 static struct platform_device bfin_pata_device = {
813 .name = "pata_platform",
815 .num_resources = ARRAY_SIZE(bfin_pata_resources),
816 .resource = bfin_pata_resources,
818 .platform_data = &bfin_pata_platform_data,
823 static struct platform_device *stamp_devices[] __initdata = {
824 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
825 &bfin_pcmcia_cf_device,
828 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
832 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
836 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
840 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
844 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
848 #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
852 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
856 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
857 &net2272_bfin_device,
860 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
864 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
868 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
869 &bfin_fb_adv7393_device,
872 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
876 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
880 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
881 &i2c_bfin_twi_device,
884 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
885 &bfin_sport0_uart_device,
886 &bfin_sport1_uart_device,
889 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
893 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
894 &bfin_device_gpiokeys,
899 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
904 static int __init stamp_init(void)
906 printk(KERN_INFO "%s(): registering device resources\n", __func__);
908 #ifdef CONFIG_I2C_BOARDINFO
909 i2c_register_board_info(0, bfin_i2c_board_info,
910 ARRAY_SIZE(bfin_i2c_board_info));
913 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
914 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
915 spi_register_board_info(bfin_spi_board_info,
916 ARRAY_SIZE(bfin_spi_board_info));
919 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
920 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
926 arch_initcall(stamp_init);
928 void native_machine_restart(char *cmd)
930 /* workaround reboot hang when booting from SPI */
931 if ((bfin_read_SYSCR() & 0x7) == 0x3)
932 bfin_gpio_reset_spi0_ssel1();
936 * Currently the MAC address is saved in Flash by U-Boot
938 #define FLASH_MAC 0x203f0000
939 void bfin_get_ether_addr(char *addr)
941 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
942 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
944 EXPORT_SYMBOL(bfin_get_ether_addr);