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/kernel.h>
33 #include <linux/platform_device.h>
34 #include <linux/mtd/mtd.h>
35 #include <linux/mtd/nand.h>
36 #include <linux/mtd/partitions.h>
37 #include <linux/mtd/plat-ram.h>
38 #include <linux/mtd/physmap.h>
39 #include <linux/spi/spi.h>
40 #include <linux/spi/flash.h>
41 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
42 #include <linux/usb/isp1362.h>
44 #include <linux/ata_platform.h>
45 #include <linux/irq.h>
46 #include <linux/interrupt.h>
47 #include <linux/i2c.h>
48 #include <linux/usb/sl811.h>
50 #include <asm/bfin5xx_spi.h>
51 #include <asm/reboot.h>
52 #include <asm/portmux.h>
54 #include <linux/spi/ad7877.h>
57 * Name the Board for the /proc/cpuinfo
59 const char bfin_board_name[] = "ADDS-BF537-STAMP";
62 * Driver needs to know address, irq and flag pin.
65 #define ISP1761_BASE 0x203C0000
66 #define ISP1761_IRQ IRQ_PF7
68 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
69 static struct resource bfin_isp1761_resources[] = {
71 .name = "isp1761-regs",
72 .start = ISP1761_BASE + 0x00000000,
73 .end = ISP1761_BASE + 0x000fffff,
74 .flags = IORESOURCE_MEM,
79 .flags = IORESOURCE_IRQ,
83 static struct platform_device bfin_isp1761_device = {
86 .num_resources = ARRAY_SIZE(bfin_isp1761_resources),
87 .resource = bfin_isp1761_resources,
90 static struct platform_device *bfin_isp1761_devices[] = {
94 int __init bfin_isp1761_init(void)
96 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
98 printk(KERN_INFO "%s(): registering device resources\n", __func__);
99 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
101 return platform_add_devices(bfin_isp1761_devices, num_devices);
104 void __exit bfin_isp1761_exit(void)
106 platform_device_unregister(&bfin_isp1761_device);
109 arch_initcall(bfin_isp1761_init);
112 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
113 #include <linux/input.h>
114 #include <linux/gpio_keys.h>
116 static struct gpio_keys_button bfin_gpio_keys_table[] = {
117 {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"},
118 {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"},
119 {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"},
120 {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"},
123 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
124 .buttons = bfin_gpio_keys_table,
125 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
128 static struct platform_device bfin_device_gpiokeys = {
131 .platform_data = &bfin_gpio_keys_data,
136 static struct resource bfin_gpios_resources = {
138 .end = MAX_BLACKFIN_GPIOS - 1,
139 .flags = IORESOURCE_IRQ,
142 static struct platform_device bfin_gpios_device = {
143 .name = "simple-gpio",
146 .resource = &bfin_gpios_resources,
149 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
150 static struct resource bfin_pcmcia_cf_resources[] = {
152 .start = 0x20310000, /* IO PORT */
154 .flags = IORESOURCE_MEM,
156 .start = 0x20311000, /* Attribute Memory */
158 .flags = IORESOURCE_MEM,
162 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
164 .start = 6, /* Card Detect PF6 */
166 .flags = IORESOURCE_IRQ,
170 static struct platform_device bfin_pcmcia_cf_device = {
171 .name = "bfin_cf_pcmcia",
173 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
174 .resource = bfin_pcmcia_cf_resources,
178 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
179 static struct platform_device rtc_device = {
185 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
186 static struct resource smc91x_resources[] = {
188 .name = "smc91x-regs",
190 .end = 0x20300300 + 16,
191 .flags = IORESOURCE_MEM,
196 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
199 static struct platform_device smc91x_device = {
202 .num_resources = ARRAY_SIZE(smc91x_resources),
203 .resource = smc91x_resources,
207 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
208 static struct resource dm9000_resources[] = {
211 .end = 0x203FB800 + 8,
212 .flags = IORESOURCE_MEM,
217 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
221 static struct platform_device dm9000_device = {
224 .num_resources = ARRAY_SIZE(dm9000_resources),
225 .resource = dm9000_resources,
229 #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
230 static struct resource ax88180_resources[] = {
233 .end = 0x20300000 + 0x8000,
234 .flags = IORESOURCE_MEM,
239 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL),
243 static struct platform_device ax88180_device = {
246 .num_resources = ARRAY_SIZE(ax88180_resources),
247 .resource = ax88180_resources,
251 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
252 static struct resource sl811_hcd_resources[] = {
256 .flags = IORESOURCE_MEM,
260 .flags = IORESOURCE_MEM,
262 .start = CONFIG_USB_SL811_BFIN_IRQ,
263 .end = CONFIG_USB_SL811_BFIN_IRQ,
264 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
268 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
269 void sl811_port_power(struct device *dev, int is_on)
271 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
272 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
276 static struct sl811_platform_data sl811_priv = {
278 .power = 250, /* == 500mA */
279 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
280 .port_power = &sl811_port_power,
284 static struct platform_device sl811_hcd_device = {
288 .platform_data = &sl811_priv,
290 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
291 .resource = sl811_hcd_resources,
295 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
296 static struct resource isp1362_hcd_resources[] = {
300 .flags = IORESOURCE_MEM,
304 .flags = IORESOURCE_MEM,
306 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
307 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
308 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
312 static struct isp1362_platform_data isp1362_priv = {
317 .int_edge_triggered = 0,
318 .remote_wakeup_connected = 0,
319 .no_power_switching = 1,
320 .power_switching_mode = 0,
323 static struct platform_device isp1362_hcd_device = {
324 .name = "isp1362-hcd",
327 .platform_data = &isp1362_priv,
329 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
330 .resource = isp1362_hcd_resources,
334 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
335 static struct platform_device bfin_mac_device = {
340 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
341 static struct resource net2272_bfin_resources[] = {
344 .end = 0x20300000 + 0x100,
345 .flags = IORESOURCE_MEM,
349 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
353 static struct platform_device net2272_bfin_device = {
356 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
357 .resource = net2272_bfin_resources,
361 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
362 #ifdef CONFIG_MTD_PARTITIONS
363 const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
365 static struct mtd_partition bfin_plat_nand_partitions[] = {
367 .name = "linux kernel(nand)",
371 .name = "file system(nand)",
372 .size = MTDPART_SIZ_FULL,
373 .offset = MTDPART_OFS_APPEND,
378 #define BFIN_NAND_PLAT_CLE 2
379 #define BFIN_NAND_PLAT_ALE 1
380 static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
382 struct nand_chip *this = mtd->priv;
384 if (cmd == NAND_CMD_NONE)
388 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));
390 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));
393 #define BFIN_NAND_PLAT_READY GPIO_PF3
394 static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
396 return gpio_get_value(BFIN_NAND_PLAT_READY);
399 static struct platform_nand_data bfin_plat_nand_data = {
402 #ifdef CONFIG_MTD_PARTITIONS
403 .part_probe_types = part_probes,
404 .partitions = bfin_plat_nand_partitions,
405 .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
409 .cmd_ctrl = bfin_plat_nand_cmd_ctrl,
410 .dev_ready = bfin_plat_nand_dev_ready,
414 #define MAX(x, y) (x > y ? x : y)
415 static struct resource bfin_plat_nand_resources = {
417 .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
418 .flags = IORESOURCE_IO,
421 static struct platform_device bfin_async_nand_device = {
425 .resource = &bfin_plat_nand_resources,
427 .platform_data = &bfin_plat_nand_data,
431 static void bfin_plat_nand_init(void)
433 gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
436 static void bfin_plat_nand_init(void) {}
439 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
440 static struct mtd_partition stamp_partitions[] = {
442 .name = "bootloader(nor)",
446 .name = "linux kernel(nor)",
448 .offset = MTDPART_OFS_APPEND,
450 .name = "file system(nor)",
451 .size = 0x400000 - 0x40000 - 0xE0000 - 0x10000,
452 .offset = MTDPART_OFS_APPEND,
454 .name = "MAC Address(nor)",
455 .size = MTDPART_SIZ_FULL,
457 .mask_flags = MTD_WRITEABLE,
461 static struct physmap_flash_data stamp_flash_data = {
463 .parts = stamp_partitions,
464 .nr_parts = ARRAY_SIZE(stamp_partitions),
467 static struct resource stamp_flash_resource = {
470 .flags = IORESOURCE_MEM,
473 static struct platform_device stamp_flash_device = {
474 .name = "physmap-flash",
477 .platform_data = &stamp_flash_data,
480 .resource = &stamp_flash_resource,
484 #if defined(CONFIG_MTD_M25P80) \
485 || defined(CONFIG_MTD_M25P80_MODULE)
486 static struct mtd_partition bfin_spi_flash_partitions[] = {
488 .name = "bootloader(spi)",
491 .mask_flags = MTD_CAP_ROM
493 .name = "linux kernel(spi)",
495 .offset = MTDPART_OFS_APPEND,
497 .name = "file system(spi)",
498 .size = MTDPART_SIZ_FULL,
499 .offset = MTDPART_OFS_APPEND,
503 static struct flash_platform_data bfin_spi_flash_data = {
505 .parts = bfin_spi_flash_partitions,
506 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
510 /* SPI flash chip (m25p64) */
511 static struct bfin5xx_spi_chip spi_flash_chip_info = {
512 .enable_dma = 0, /* use dma transfer with this chip*/
517 #if defined(CONFIG_SPI_ADC_BF533) \
518 || defined(CONFIG_SPI_ADC_BF533_MODULE)
520 static struct bfin5xx_spi_chip spi_adc_chip_info = {
521 .enable_dma = 1, /* use dma transfer with this chip*/
526 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
527 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
528 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
534 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
535 static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
541 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
542 static struct bfin5xx_spi_chip spi_mmc_chip_info = {
548 #if defined(CONFIG_PBX)
549 static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
550 .ctl_reg = 0x4, /* send zero */
553 .cs_change_per_word = 1,
557 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
558 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
563 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
565 .vref_delay_usecs = 50, /* internal, no capacitor */
568 .pressure_max = 1000,
570 .stopacq_polarity = 1,
571 .first_conversion_delay = 3,
572 .acquisition_time = 1,
574 .pen_down_acc_interval = 1,
578 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
579 static struct bfin5xx_spi_chip spidev_chip_info = {
585 #if defined(CONFIG_MTD_DATAFLASH) \
586 || defined(CONFIG_MTD_DATAFLASH_MODULE)
588 static struct mtd_partition bfin_spi_dataflash_partitions[] = {
590 .name = "bootloader(spi)",
593 .mask_flags = MTD_CAP_ROM
595 .name = "linux kernel(spi)",
597 .offset = MTDPART_OFS_APPEND,
599 .name = "file system(spi)",
600 .size = MTDPART_SIZ_FULL,
601 .offset = MTDPART_OFS_APPEND,
605 static struct flash_platform_data bfin_spi_dataflash_data = {
606 .name = "SPI Dataflash",
607 .parts = bfin_spi_dataflash_partitions,
608 .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
612 static struct bfin5xx_spi_chip data_flash_chip_info = {
613 .enable_dma = 0, /* use dma transfer with this chip*/
618 static struct spi_board_info bfin_spi_board_info[] __initdata = {
619 #if defined(CONFIG_MTD_M25P80) \
620 || defined(CONFIG_MTD_M25P80_MODULE)
622 /* the modalias must be the same as spi device driver name */
623 .modalias = "m25p80", /* Name of spi_driver for this device */
624 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
625 .bus_num = 0, /* Framework bus number */
626 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
627 .platform_data = &bfin_spi_flash_data,
628 .controller_data = &spi_flash_chip_info,
632 #if defined(CONFIG_MTD_DATAFLASH) \
633 || defined(CONFIG_MTD_DATAFLASH_MODULE)
634 { /* DataFlash chip */
635 .modalias = "mtd_dataflash",
636 .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
637 .bus_num = 0, /* Framework bus number */
638 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
639 .platform_data = &bfin_spi_dataflash_data,
640 .controller_data = &data_flash_chip_info,
644 #if defined(CONFIG_SPI_ADC_BF533) \
645 || defined(CONFIG_SPI_ADC_BF533_MODULE)
647 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
648 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
649 .bus_num = 0, /* Framework bus number */
650 .chip_select = 1, /* Framework chip select. */
651 .platform_data = NULL, /* No spi_driver specific config */
652 .controller_data = &spi_adc_chip_info,
656 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
657 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
659 .modalias = "ad1836-spi",
660 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
662 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
663 .controller_data = &ad1836_spi_chip_info,
666 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
668 .modalias = "ad9960-spi",
669 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
672 .controller_data = &ad9960_spi_chip_info,
675 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
677 .modalias = "spi_mmc_dummy",
678 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
681 .platform_data = NULL,
682 .controller_data = &spi_mmc_chip_info,
686 .modalias = "spi_mmc",
687 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
689 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
690 .platform_data = NULL,
691 .controller_data = &spi_mmc_chip_info,
695 #if defined(CONFIG_PBX)
697 .modalias = "fxs-spi",
698 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
700 .chip_select = 8 - CONFIG_J11_JUMPER,
701 .controller_data = &spi_si3xxx_chip_info,
705 .modalias = "fxo-spi",
706 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
708 .chip_select = 8 - CONFIG_J19_JUMPER,
709 .controller_data = &spi_si3xxx_chip_info,
713 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
715 .modalias = "ad7877",
716 .platform_data = &bfin_ad7877_ts_info,
718 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
721 .controller_data = &spi_ad7877_chip_info,
724 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
726 .modalias = "spidev",
727 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
730 .controller_data = &spidev_chip_info,
735 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
736 /* SPI controller data */
737 static struct bfin5xx_spi_master bfin_spi0_info = {
739 .enable_dma = 1, /* master has the ability to do dma transfer */
740 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
744 static struct resource bfin_spi0_resource[] = {
746 .start = SPI0_REGBASE,
747 .end = SPI0_REGBASE + 0xFF,
748 .flags = IORESOURCE_MEM,
753 .flags = IORESOURCE_IRQ,
757 static struct platform_device bfin_spi0_device = {
759 .id = 0, /* Bus number */
760 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
761 .resource = bfin_spi0_resource,
763 .platform_data = &bfin_spi0_info, /* Passed to driver */
766 #endif /* spi master and devices */
768 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
769 static struct platform_device bfin_fb_device = {
770 .name = "bf537-lq035",
774 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
775 static struct platform_device bfin_fb_adv7393_device = {
776 .name = "bfin-adv7393",
780 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
781 static struct resource bfin_uart_resources[] = {
782 #ifdef CONFIG_SERIAL_BFIN_UART0
786 .flags = IORESOURCE_MEM,
789 #ifdef CONFIG_SERIAL_BFIN_UART1
793 .flags = IORESOURCE_MEM,
798 static struct platform_device bfin_uart_device = {
801 .num_resources = ARRAY_SIZE(bfin_uart_resources),
802 .resource = bfin_uart_resources,
806 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
807 static struct resource bfin_sir_resources[] = {
808 #ifdef CONFIG_BFIN_SIR0
812 .flags = IORESOURCE_MEM,
815 #ifdef CONFIG_BFIN_SIR1
819 .flags = IORESOURCE_MEM,
824 static struct platform_device bfin_sir_device = {
827 .num_resources = ARRAY_SIZE(bfin_sir_resources),
828 .resource = bfin_sir_resources,
832 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
833 static struct resource bfin_twi0_resource[] = {
835 .start = TWI0_REGBASE,
837 .flags = IORESOURCE_MEM,
842 .flags = IORESOURCE_IRQ,
846 static struct platform_device i2c_bfin_twi_device = {
847 .name = "i2c-bfin-twi",
849 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
850 .resource = bfin_twi0_resource,
854 #ifdef CONFIG_I2C_BOARDINFO
855 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
856 #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
858 I2C_BOARD_INFO("ad7142_joystick", 0x2C),
862 #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
864 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
867 #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
869 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
876 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
877 static struct platform_device bfin_sport0_uart_device = {
878 .name = "bfin-sport-uart",
882 static struct platform_device bfin_sport1_uart_device = {
883 .name = "bfin-sport-uart",
888 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
889 #define PATA_INT IRQ_PF5
891 static struct pata_platform_info bfin_pata_platform_data = {
893 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
896 static struct resource bfin_pata_resources[] = {
900 .flags = IORESOURCE_MEM,
905 .flags = IORESOURCE_MEM,
910 .flags = IORESOURCE_IRQ,
914 static struct platform_device bfin_pata_device = {
915 .name = "pata_platform",
917 .num_resources = ARRAY_SIZE(bfin_pata_resources),
918 .resource = bfin_pata_resources,
920 .platform_data = &bfin_pata_platform_data,
925 static const unsigned int cclk_vlev_datasheet[] =
927 VRPAIR(VLEV_085, 250000000),
928 VRPAIR(VLEV_090, 376000000),
929 VRPAIR(VLEV_095, 426000000),
930 VRPAIR(VLEV_100, 426000000),
931 VRPAIR(VLEV_105, 476000000),
932 VRPAIR(VLEV_110, 476000000),
933 VRPAIR(VLEV_115, 476000000),
934 VRPAIR(VLEV_120, 500000000),
935 VRPAIR(VLEV_125, 533000000),
936 VRPAIR(VLEV_130, 600000000),
939 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
940 .tuple_tab = cclk_vlev_datasheet,
941 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
942 .vr_settling_time = 25 /* us */,
945 static struct platform_device bfin_dpmc = {
948 .platform_data = &bfin_dmpc_vreg_data,
952 static struct platform_device *stamp_devices[] __initdata = {
956 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
957 &bfin_pcmcia_cf_device,
960 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
964 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
968 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
972 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
976 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
980 #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
984 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
988 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
989 &net2272_bfin_device,
992 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
996 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1000 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
1001 &bfin_fb_adv7393_device,
1004 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1008 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1012 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1013 &i2c_bfin_twi_device,
1016 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1017 &bfin_sport0_uart_device,
1018 &bfin_sport1_uart_device,
1021 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
1025 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1026 &bfin_device_gpiokeys,
1031 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
1032 &bfin_async_nand_device,
1035 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1036 &stamp_flash_device,
1040 static int __init stamp_init(void)
1042 printk(KERN_INFO "%s(): registering device resources\n", __func__);
1044 #ifdef CONFIG_I2C_BOARDINFO
1045 i2c_register_board_info(0, bfin_i2c_board_info,
1046 ARRAY_SIZE(bfin_i2c_board_info));
1049 bfin_plat_nand_init();
1050 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
1051 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
1053 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
1054 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
1060 arch_initcall(stamp_init);
1062 void native_machine_restart(char *cmd)
1064 /* workaround reboot hang when booting from SPI */
1065 if ((bfin_read_SYSCR() & 0x7) == 0x3)
1066 bfin_gpio_reset_spi0_ssel1();
1070 * Currently the MAC address is saved in Flash by U-Boot
1072 #define FLASH_MAC 0x203f0000
1073 void bfin_get_ether_addr(char *addr)
1075 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
1076 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
1078 EXPORT_SYMBOL(bfin_get_ether_addr);