2 * File: arch/blackfin/mach-bf527/boards/ezkit.c
3 * Based on: arch/blackfin/mach-bf537/boards/stamp.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2008 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/i2c.h>
43 #include <linux/irq.h>
44 #include <linux/interrupt.h>
45 #include <linux/usb/sl811.h>
46 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
47 #include <linux/usb/musb.h>
51 #include <asm/bfin5xx_spi.h>
52 #include <asm/reboot.h>
54 #include <asm/portmux.h>
56 #include <linux/spi/ad7877.h>
59 * Name the Board for the /proc/cpuinfo
61 const char bfin_board_name[] = "ADDS-BF527-EZKIT";
64 * Driver needs to know address, irq and flag pin.
67 #define ISP1761_BASE 0x203C0000
68 #define ISP1761_IRQ IRQ_PF7
70 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
71 static struct resource bfin_isp1761_resources[] = {
73 .name = "isp1761-regs",
74 .start = ISP1761_BASE + 0x00000000,
75 .end = ISP1761_BASE + 0x000fffff,
76 .flags = IORESOURCE_MEM,
81 .flags = IORESOURCE_IRQ,
85 static struct platform_device bfin_isp1761_device = {
88 .num_resources = ARRAY_SIZE(bfin_isp1761_resources),
89 .resource = bfin_isp1761_resources,
92 static struct platform_device *bfin_isp1761_devices[] = {
96 int __init bfin_isp1761_init(void)
98 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
100 printk(KERN_INFO "%s(): registering device resources\n", __func__);
101 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
103 return platform_add_devices(bfin_isp1761_devices, num_devices);
106 void __exit bfin_isp1761_exit(void)
108 platform_device_unregister(&bfin_isp1761_device);
111 arch_initcall(bfin_isp1761_init);
114 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
115 static struct resource musb_resources[] = {
119 .flags = IORESOURCE_MEM,
121 [1] = { /* general IRQ */
122 .start = IRQ_USB_INT0,
124 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
126 [2] = { /* DMA IRQ */
127 .start = IRQ_USB_DMA,
129 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
133 static struct musb_hdrc_platform_data musb_plat = {
134 #if defined(CONFIG_USB_MUSB_OTG)
136 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
138 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
139 .mode = MUSB_PERIPHERAL,
144 static u64 musb_dmamask = ~(u32)0;
146 static struct platform_device musb_device = {
150 .dma_mask = &musb_dmamask,
151 .coherent_dma_mask = 0xffffffff,
152 .platform_data = &musb_plat,
154 .num_resources = ARRAY_SIZE(musb_resources),
155 .resource = musb_resources,
159 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
161 static struct resource bf52x_t350mcqb_resources[] = {
163 .start = IRQ_PPI_ERROR,
164 .end = IRQ_PPI_ERROR,
165 .flags = IORESOURCE_IRQ,
169 static struct platform_device bf52x_t350mcqb_device = {
170 .name = "bfin-t350mcqb",
172 .num_resources = ARRAY_SIZE(bf52x_t350mcqb_resources),
173 .resource = bf52x_t350mcqb_resources,
177 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
178 static struct mtd_partition ezkit_partitions[] = {
180 .name = "Bootloader",
186 .offset = MTDPART_OFS_APPEND,
189 .size = MTDPART_SIZ_FULL,
190 .offset = MTDPART_OFS_APPEND,
194 static struct physmap_flash_data ezkit_flash_data = {
196 .parts = ezkit_partitions,
197 .nr_parts = ARRAY_SIZE(ezkit_partitions),
200 static struct resource ezkit_flash_resource = {
203 .flags = IORESOURCE_MEM,
206 static struct platform_device ezkit_flash_device = {
207 .name = "physmap-flash",
210 .platform_data = &ezkit_flash_data,
213 .resource = &ezkit_flash_resource,
217 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
218 static struct mtd_partition partition_info[] = {
220 .name = "Linux Kernel",
225 .name = "File System",
226 .offset = MTDPART_OFS_APPEND,
227 .size = MTDPART_SIZ_FULL,
231 static struct bf5xx_nand_platform bf5xx_nand_platform = {
232 .page_size = NFC_PG_SIZE_256,
233 .data_width = NFC_NWIDTH_8,
234 .partitions = partition_info,
235 .nr_partitions = ARRAY_SIZE(partition_info),
240 static struct resource bf5xx_nand_resources[] = {
243 .end = NFC_DATA_RD + 2,
244 .flags = IORESOURCE_MEM,
249 .flags = IORESOURCE_IRQ,
253 static struct platform_device bf5xx_nand_device = {
254 .name = "bf5xx-nand",
256 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
257 .resource = bf5xx_nand_resources,
259 .platform_data = &bf5xx_nand_platform,
264 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
265 static struct resource bfin_pcmcia_cf_resources[] = {
267 .start = 0x20310000, /* IO PORT */
269 .flags = IORESOURCE_MEM,
271 .start = 0x20311000, /* Attribute Memory */
273 .flags = IORESOURCE_MEM,
277 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
279 .start = 6, /* Card Detect PF6 */
281 .flags = IORESOURCE_IRQ,
285 static struct platform_device bfin_pcmcia_cf_device = {
286 .name = "bfin_cf_pcmcia",
288 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
289 .resource = bfin_pcmcia_cf_resources,
293 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
294 static struct platform_device rtc_device = {
300 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
301 static struct resource smc91x_resources[] = {
303 .name = "smc91x-regs",
305 .end = 0x20300300 + 16,
306 .flags = IORESOURCE_MEM,
311 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
314 static struct platform_device smc91x_device = {
317 .num_resources = ARRAY_SIZE(smc91x_resources),
318 .resource = smc91x_resources,
322 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
323 static struct resource dm9000_resources[] = {
326 .end = 0x203FB800 + 8,
327 .flags = IORESOURCE_MEM,
332 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
336 static struct platform_device dm9000_device = {
339 .num_resources = ARRAY_SIZE(dm9000_resources),
340 .resource = dm9000_resources,
344 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
345 static struct resource sl811_hcd_resources[] = {
349 .flags = IORESOURCE_MEM,
353 .flags = IORESOURCE_MEM,
355 .start = CONFIG_USB_SL811_BFIN_IRQ,
356 .end = CONFIG_USB_SL811_BFIN_IRQ,
357 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
361 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
362 void sl811_port_power(struct device *dev, int is_on)
364 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
365 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
369 static struct sl811_platform_data sl811_priv = {
371 .power = 250, /* == 500mA */
372 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
373 .port_power = &sl811_port_power,
377 static struct platform_device sl811_hcd_device = {
381 .platform_data = &sl811_priv,
383 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
384 .resource = sl811_hcd_resources,
388 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
389 static struct resource isp1362_hcd_resources[] = {
393 .flags = IORESOURCE_MEM,
397 .flags = IORESOURCE_MEM,
399 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
400 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
401 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
405 static struct isp1362_platform_data isp1362_priv = {
410 .int_edge_triggered = 0,
411 .remote_wakeup_connected = 0,
412 .no_power_switching = 1,
413 .power_switching_mode = 0,
416 static struct platform_device isp1362_hcd_device = {
417 .name = "isp1362-hcd",
420 .platform_data = &isp1362_priv,
422 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
423 .resource = isp1362_hcd_resources,
427 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
428 static struct platform_device bfin_mac_device = {
433 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
434 static struct resource net2272_bfin_resources[] = {
437 .end = 0x20300000 + 0x100,
438 .flags = IORESOURCE_MEM,
442 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
446 static struct platform_device net2272_bfin_device = {
449 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
450 .resource = net2272_bfin_resources,
454 #if defined(CONFIG_MTD_M25P80) \
455 || defined(CONFIG_MTD_M25P80_MODULE)
456 static struct mtd_partition bfin_spi_flash_partitions[] = {
458 .name = "bootloader",
461 .mask_flags = MTD_CAP_ROM
463 .name = "linux kernel",
464 .size = MTDPART_SIZ_FULL,
465 .offset = MTDPART_OFS_APPEND,
469 static struct flash_platform_data bfin_spi_flash_data = {
471 .parts = bfin_spi_flash_partitions,
472 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
476 /* SPI flash chip (m25p64) */
477 static struct bfin5xx_spi_chip spi_flash_chip_info = {
478 .enable_dma = 0, /* use dma transfer with this chip*/
483 #if defined(CONFIG_SPI_ADC_BF533) \
484 || defined(CONFIG_SPI_ADC_BF533_MODULE)
486 static struct bfin5xx_spi_chip spi_adc_chip_info = {
487 .enable_dma = 1, /* use dma transfer with this chip*/
492 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
493 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
494 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
500 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
501 static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
507 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
508 static struct bfin5xx_spi_chip spi_mmc_chip_info = {
514 #if defined(CONFIG_PBX)
515 static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
516 .ctl_reg = 0x4, /* send zero */
519 .cs_change_per_word = 1,
523 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
524 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
529 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
531 .vref_delay_usecs = 50, /* internal, no capacitor */
534 .pressure_max = 1000,
536 .stopacq_polarity = 1,
537 .first_conversion_delay = 3,
538 .acquisition_time = 1,
540 .pen_down_acc_interval = 1,
544 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
545 && defined(CONFIG_SND_SOC_WM8731_SPI)
546 static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
552 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
553 static struct bfin5xx_spi_chip spidev_chip_info = {
559 static struct spi_board_info bfin_spi_board_info[] __initdata = {
560 #if defined(CONFIG_MTD_M25P80) \
561 || defined(CONFIG_MTD_M25P80_MODULE)
563 /* the modalias must be the same as spi device driver name */
564 .modalias = "m25p80", /* Name of spi_driver for this device */
565 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
566 .bus_num = 0, /* Framework bus number */
567 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
568 .platform_data = &bfin_spi_flash_data,
569 .controller_data = &spi_flash_chip_info,
574 #if defined(CONFIG_SPI_ADC_BF533) \
575 || defined(CONFIG_SPI_ADC_BF533_MODULE)
577 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
578 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
579 .bus_num = 0, /* Framework bus number */
580 .chip_select = 1, /* Framework chip select. */
581 .platform_data = NULL, /* No spi_driver specific config */
582 .controller_data = &spi_adc_chip_info,
586 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
587 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
589 .modalias = "ad1836-spi",
590 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
592 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
593 .controller_data = &ad1836_spi_chip_info,
596 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
598 .modalias = "ad9960-spi",
599 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
602 .controller_data = &ad9960_spi_chip_info,
605 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
607 .modalias = "spi_mmc_dummy",
608 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
611 .platform_data = NULL,
612 .controller_data = &spi_mmc_chip_info,
616 .modalias = "spi_mmc",
617 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
619 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
620 .platform_data = NULL,
621 .controller_data = &spi_mmc_chip_info,
625 #if defined(CONFIG_PBX)
627 .modalias = "fxs-spi",
628 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
630 .chip_select = 8 - CONFIG_J11_JUMPER,
631 .controller_data = &spi_si3xxx_chip_info,
635 .modalias = "fxo-spi",
636 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
638 .chip_select = 8 - CONFIG_J19_JUMPER,
639 .controller_data = &spi_si3xxx_chip_info,
643 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
645 .modalias = "ad7877",
646 .platform_data = &bfin_ad7877_ts_info,
648 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
651 .controller_data = &spi_ad7877_chip_info,
654 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
655 && defined(CONFIG_SND_SOC_WM8731_SPI)
657 .modalias = "wm8731",
658 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
661 .controller_data = &spi_wm8731_chip_info,
665 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
667 .modalias = "spidev",
668 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
671 .controller_data = &spidev_chip_info,
676 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
677 /* SPI controller data */
678 static struct bfin5xx_spi_master bfin_spi0_info = {
680 .enable_dma = 1, /* master has the ability to do dma transfer */
681 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
685 static struct resource bfin_spi0_resource[] = {
687 .start = SPI0_REGBASE,
688 .end = SPI0_REGBASE + 0xFF,
689 .flags = IORESOURCE_MEM,
694 .flags = IORESOURCE_IRQ,
698 static struct platform_device bfin_spi0_device = {
700 .id = 0, /* Bus number */
701 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
702 .resource = bfin_spi0_resource,
704 .platform_data = &bfin_spi0_info, /* Passed to driver */
707 #endif /* spi master and devices */
709 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
710 static struct platform_device bfin_fb_device = {
711 .name = "bf537-lq035",
715 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
716 static struct platform_device bfin_fb_adv7393_device = {
717 .name = "bfin-adv7393",
721 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
722 static struct resource bfin_uart_resources[] = {
723 #ifdef CONFIG_SERIAL_BFIN_UART0
727 .flags = IORESOURCE_MEM,
730 #ifdef CONFIG_SERIAL_BFIN_UART1
734 .flags = IORESOURCE_MEM,
739 static struct platform_device bfin_uart_device = {
742 .num_resources = ARRAY_SIZE(bfin_uart_resources),
743 .resource = bfin_uart_resources,
747 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
748 static struct resource bfin_sir_resources[] = {
749 #ifdef CONFIG_BFIN_SIR0
753 .flags = IORESOURCE_MEM,
756 #ifdef CONFIG_BFIN_SIR1
760 .flags = IORESOURCE_MEM,
765 static struct platform_device bfin_sir_device = {
768 .num_resources = ARRAY_SIZE(bfin_sir_resources),
769 .resource = bfin_sir_resources,
773 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
774 static struct resource bfin_twi0_resource[] = {
776 .start = TWI0_REGBASE,
778 .flags = IORESOURCE_MEM,
783 .flags = IORESOURCE_IRQ,
787 static struct platform_device i2c_bfin_twi_device = {
788 .name = "i2c-bfin-twi",
790 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
791 .resource = bfin_twi0_resource,
795 #ifdef CONFIG_I2C_BOARDINFO
796 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
797 #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
799 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
802 #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
804 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
811 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
812 static struct platform_device bfin_sport0_uart_device = {
813 .name = "bfin-sport-uart",
817 static struct platform_device bfin_sport1_uart_device = {
818 .name = "bfin-sport-uart",
823 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
826 static struct pata_platform_info bfin_pata_platform_data = {
828 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
831 static struct resource bfin_pata_resources[] = {
835 .flags = IORESOURCE_MEM,
840 .flags = IORESOURCE_MEM,
845 .flags = IORESOURCE_IRQ,
849 static struct platform_device bfin_pata_device = {
850 .name = "pata_platform",
852 .num_resources = ARRAY_SIZE(bfin_pata_resources),
853 .resource = bfin_pata_resources,
855 .platform_data = &bfin_pata_platform_data,
860 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
861 #include <linux/input.h>
862 #include <linux/gpio_keys.h>
864 static struct gpio_keys_button bfin_gpio_keys_table[] = {
865 {BTN_0, GPIO_PG0, 1, "gpio-keys: BTN0"},
866 {BTN_1, GPIO_PG13, 1, "gpio-keys: BTN1"},
869 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
870 .buttons = bfin_gpio_keys_table,
871 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
874 static struct platform_device bfin_device_gpiokeys = {
877 .platform_data = &bfin_gpio_keys_data,
882 static struct resource bfin_gpios_resources = {
884 .end = MAX_BLACKFIN_GPIOS - 1,
885 .flags = IORESOURCE_IRQ,
888 static struct platform_device bfin_gpios_device = {
889 .name = "simple-gpio",
892 .resource = &bfin_gpios_resources,
895 static const unsigned int cclk_vlev_datasheet[] =
897 VRPAIR(VLEV_100, 400000000),
898 VRPAIR(VLEV_105, 426000000),
899 VRPAIR(VLEV_110, 500000000),
900 VRPAIR(VLEV_115, 533000000),
901 VRPAIR(VLEV_120, 600000000),
904 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
905 .tuple_tab = cclk_vlev_datasheet,
906 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
907 .vr_settling_time = 25 /* us */,
910 static struct platform_device bfin_dpmc = {
913 .platform_data = &bfin_dmpc_vreg_data,
917 static struct platform_device *stamp_devices[] __initdata = {
921 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
925 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
926 &bfin_pcmcia_cf_device,
929 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
933 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
937 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
941 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
945 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
949 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
953 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
957 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
958 &net2272_bfin_device,
961 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
965 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
969 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
970 &bf52x_t350mcqb_device,
973 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
974 &bfin_fb_adv7393_device,
977 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
981 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
985 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
986 &i2c_bfin_twi_device,
989 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
990 &bfin_sport0_uart_device,
991 &bfin_sport1_uart_device,
994 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
998 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
999 &bfin_device_gpiokeys,
1002 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1003 &ezkit_flash_device,
1009 static int __init stamp_init(void)
1011 printk(KERN_INFO "%s(): registering device resources\n", __func__);
1013 #ifdef CONFIG_I2C_BOARDINFO
1014 i2c_register_board_info(0, bfin_i2c_board_info,
1015 ARRAY_SIZE(bfin_i2c_board_info));
1018 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
1019 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
1021 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
1022 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
1027 arch_initcall(stamp_init);
1029 void native_machine_restart(char *cmd)
1031 /* workaround reboot hang when booting from SPI */
1032 if ((bfin_read_SYSCR() & 0x7) == 0x3)
1033 bfin_gpio_reset_spi0_ssel1();
1036 void bfin_get_ether_addr(char *addr)
1038 /* the MAC is stored in OTP memory page 0xDF */
1041 u32 (*otp_read)(u32 page, u32 flags, u64 *page_content) = (void *)0xEF00001A;
1043 ret = otp_read(0xDF, 0x00, &otp_mac);
1045 char *otp_mac_p = (char *)&otp_mac;
1046 for (ret = 0; ret < 6; ++ret)
1047 addr[ret] = otp_mac_p[5 - ret];
1050 EXPORT_SYMBOL(bfin_get_ether_addr);