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/i2c.h>
42 #include <linux/irq.h>
43 #include <linux/interrupt.h>
44 #include <linux/usb/sl811.h>
45 #include <linux/usb/musb.h>
48 #include <asm/bfin5xx_spi.h>
49 #include <asm/reboot.h>
51 #include <asm/portmux.h>
53 #include <linux/spi/ad7877.h>
56 * Name the Board for the /proc/cpuinfo
58 const char bfin_board_name[] = "ADDS-BF527-EZKIT";
61 * Driver needs to know address, irq and flag pin.
64 #define ISP1761_BASE 0x203C0000
65 #define ISP1761_IRQ IRQ_PF7
67 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
68 static struct resource bfin_isp1761_resources[] = {
70 .name = "isp1761-regs",
71 .start = ISP1761_BASE + 0x00000000,
72 .end = ISP1761_BASE + 0x000fffff,
73 .flags = IORESOURCE_MEM,
78 .flags = IORESOURCE_IRQ,
82 static struct platform_device bfin_isp1761_device = {
85 .num_resources = ARRAY_SIZE(bfin_isp1761_resources),
86 .resource = bfin_isp1761_resources,
89 static struct platform_device *bfin_isp1761_devices[] = {
93 int __init bfin_isp1761_init(void)
95 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
97 printk(KERN_INFO "%s(): registering device resources\n", __func__);
98 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
100 return platform_add_devices(bfin_isp1761_devices, num_devices);
103 void __exit bfin_isp1761_exit(void)
105 platform_device_unregister(&bfin_isp1761_device);
108 arch_initcall(bfin_isp1761_init);
111 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
112 static struct resource musb_resources[] = {
116 .flags = IORESOURCE_MEM,
118 [1] = { /* general IRQ */
119 .start = IRQ_USB_INT0,
121 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
123 [2] = { /* DMA IRQ */
124 .start = IRQ_USB_DMA,
126 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
130 static struct musb_hdrc_config musb_config = {
137 .gpio_vrsel = GPIO_PG13,
140 static struct musb_hdrc_platform_data musb_plat = {
141 #if defined(CONFIG_USB_MUSB_OTG)
143 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
145 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
146 .mode = MUSB_PERIPHERAL,
148 .config = &musb_config,
151 static u64 musb_dmamask = ~(u32)0;
153 static struct platform_device musb_device = {
157 .dma_mask = &musb_dmamask,
158 .coherent_dma_mask = 0xffffffff,
159 .platform_data = &musb_plat,
161 .num_resources = ARRAY_SIZE(musb_resources),
162 .resource = musb_resources,
166 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
168 static struct resource bf52x_t350mcqb_resources[] = {
170 .start = IRQ_PPI_ERROR,
171 .end = IRQ_PPI_ERROR,
172 .flags = IORESOURCE_IRQ,
176 static struct platform_device bf52x_t350mcqb_device = {
177 .name = "bfin-t350mcqb",
179 .num_resources = ARRAY_SIZE(bf52x_t350mcqb_resources),
180 .resource = bf52x_t350mcqb_resources,
184 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
185 static struct mtd_partition ezkit_partitions[] = {
187 .name = "bootloader(nor)",
191 .name = "linux kernel(nor)",
193 .offset = MTDPART_OFS_APPEND,
195 .name = "file system(nor)",
196 .size = MTDPART_SIZ_FULL,
197 .offset = MTDPART_OFS_APPEND,
201 static struct physmap_flash_data ezkit_flash_data = {
203 .parts = ezkit_partitions,
204 .nr_parts = ARRAY_SIZE(ezkit_partitions),
207 static struct resource ezkit_flash_resource = {
210 .flags = IORESOURCE_MEM,
213 static struct platform_device ezkit_flash_device = {
214 .name = "physmap-flash",
217 .platform_data = &ezkit_flash_data,
220 .resource = &ezkit_flash_resource,
224 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
225 static struct mtd_partition partition_info[] = {
227 .name = "linux kernel(nand)",
232 .name = "file system(nand)",
233 .offset = MTDPART_OFS_APPEND,
234 .size = MTDPART_SIZ_FULL,
238 static struct bf5xx_nand_platform bf5xx_nand_platform = {
239 .page_size = NFC_PG_SIZE_256,
240 .data_width = NFC_NWIDTH_8,
241 .partitions = partition_info,
242 .nr_partitions = ARRAY_SIZE(partition_info),
247 static struct resource bf5xx_nand_resources[] = {
250 .end = NFC_DATA_RD + 2,
251 .flags = IORESOURCE_MEM,
256 .flags = IORESOURCE_IRQ,
260 static struct platform_device bf5xx_nand_device = {
261 .name = "bf5xx-nand",
263 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
264 .resource = bf5xx_nand_resources,
266 .platform_data = &bf5xx_nand_platform,
271 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
272 static struct resource bfin_pcmcia_cf_resources[] = {
274 .start = 0x20310000, /* IO PORT */
276 .flags = IORESOURCE_MEM,
278 .start = 0x20311000, /* Attribute Memory */
280 .flags = IORESOURCE_MEM,
284 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
286 .start = 6, /* Card Detect PF6 */
288 .flags = IORESOURCE_IRQ,
292 static struct platform_device bfin_pcmcia_cf_device = {
293 .name = "bfin_cf_pcmcia",
295 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
296 .resource = bfin_pcmcia_cf_resources,
300 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
301 static struct platform_device rtc_device = {
307 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
308 static struct resource smc91x_resources[] = {
310 .name = "smc91x-regs",
312 .end = 0x20300300 + 16,
313 .flags = IORESOURCE_MEM,
318 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
321 static struct platform_device smc91x_device = {
324 .num_resources = ARRAY_SIZE(smc91x_resources),
325 .resource = smc91x_resources,
329 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
330 static struct resource dm9000_resources[] = {
333 .end = 0x203FB800 + 1,
334 .flags = IORESOURCE_MEM,
337 .start = 0x203FB800 + 4,
338 .end = 0x203FB800 + 5,
339 .flags = IORESOURCE_MEM,
344 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
348 static struct platform_device dm9000_device = {
351 .num_resources = ARRAY_SIZE(dm9000_resources),
352 .resource = dm9000_resources,
356 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
357 static struct resource sl811_hcd_resources[] = {
361 .flags = IORESOURCE_MEM,
365 .flags = IORESOURCE_MEM,
367 .start = CONFIG_USB_SL811_BFIN_IRQ,
368 .end = CONFIG_USB_SL811_BFIN_IRQ,
369 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
373 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
374 void sl811_port_power(struct device *dev, int is_on)
376 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
377 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
381 static struct sl811_platform_data sl811_priv = {
383 .power = 250, /* == 500mA */
384 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
385 .port_power = &sl811_port_power,
389 static struct platform_device sl811_hcd_device = {
393 .platform_data = &sl811_priv,
395 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
396 .resource = sl811_hcd_resources,
400 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
401 static struct resource isp1362_hcd_resources[] = {
405 .flags = IORESOURCE_MEM,
409 .flags = IORESOURCE_MEM,
411 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
412 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
413 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
417 static struct isp1362_platform_data isp1362_priv = {
422 .int_edge_triggered = 0,
423 .remote_wakeup_connected = 0,
424 .no_power_switching = 1,
425 .power_switching_mode = 0,
428 static struct platform_device isp1362_hcd_device = {
429 .name = "isp1362-hcd",
432 .platform_data = &isp1362_priv,
434 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
435 .resource = isp1362_hcd_resources,
439 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
440 static struct platform_device bfin_mac_device = {
445 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
446 static struct resource net2272_bfin_resources[] = {
449 .end = 0x20300000 + 0x100,
450 .flags = IORESOURCE_MEM,
454 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
458 static struct platform_device net2272_bfin_device = {
461 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
462 .resource = net2272_bfin_resources,
466 #if defined(CONFIG_MTD_M25P80) \
467 || defined(CONFIG_MTD_M25P80_MODULE)
468 static struct mtd_partition bfin_spi_flash_partitions[] = {
470 .name = "bootloader(spi)",
473 .mask_flags = MTD_CAP_ROM
475 .name = "linux kernel(spi)",
476 .size = MTDPART_SIZ_FULL,
477 .offset = MTDPART_OFS_APPEND,
481 static struct flash_platform_data bfin_spi_flash_data = {
483 .parts = bfin_spi_flash_partitions,
484 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
488 /* SPI flash chip (m25p64) */
489 static struct bfin5xx_spi_chip spi_flash_chip_info = {
490 .enable_dma = 0, /* use dma transfer with this chip*/
495 #if defined(CONFIG_SPI_ADC_BF533) \
496 || defined(CONFIG_SPI_ADC_BF533_MODULE)
498 static struct bfin5xx_spi_chip spi_adc_chip_info = {
499 .enable_dma = 1, /* use dma transfer with this chip*/
504 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
505 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
506 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
512 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
513 static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
519 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
520 static struct bfin5xx_spi_chip spi_mmc_chip_info = {
526 #if defined(CONFIG_PBX)
527 static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
528 .ctl_reg = 0x4, /* send zero */
531 .cs_change_per_word = 1,
535 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
536 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
541 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
543 .vref_delay_usecs = 50, /* internal, no capacitor */
546 .pressure_max = 1000,
548 .stopacq_polarity = 1,
549 .first_conversion_delay = 3,
550 .acquisition_time = 1,
552 .pen_down_acc_interval = 1,
556 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
557 && defined(CONFIG_SND_SOC_WM8731_SPI)
558 static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
564 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
565 static struct bfin5xx_spi_chip spidev_chip_info = {
571 static struct spi_board_info bfin_spi_board_info[] __initdata = {
572 #if defined(CONFIG_MTD_M25P80) \
573 || defined(CONFIG_MTD_M25P80_MODULE)
575 /* the modalias must be the same as spi device driver name */
576 .modalias = "m25p80", /* Name of spi_driver for this device */
577 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
578 .bus_num = 0, /* Framework bus number */
579 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
580 .platform_data = &bfin_spi_flash_data,
581 .controller_data = &spi_flash_chip_info,
586 #if defined(CONFIG_SPI_ADC_BF533) \
587 || defined(CONFIG_SPI_ADC_BF533_MODULE)
589 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
590 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
591 .bus_num = 0, /* Framework bus number */
592 .chip_select = 1, /* Framework chip select. */
593 .platform_data = NULL, /* No spi_driver specific config */
594 .controller_data = &spi_adc_chip_info,
598 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
599 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
601 .modalias = "ad1836-spi",
602 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
604 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
605 .controller_data = &ad1836_spi_chip_info,
608 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
610 .modalias = "ad9960-spi",
611 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
614 .controller_data = &ad9960_spi_chip_info,
617 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
619 .modalias = "spi_mmc_dummy",
620 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
623 .platform_data = NULL,
624 .controller_data = &spi_mmc_chip_info,
628 .modalias = "spi_mmc",
629 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
631 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
632 .platform_data = NULL,
633 .controller_data = &spi_mmc_chip_info,
637 #if defined(CONFIG_PBX)
639 .modalias = "fxs-spi",
640 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
642 .chip_select = 8 - CONFIG_J11_JUMPER,
643 .controller_data = &spi_si3xxx_chip_info,
647 .modalias = "fxo-spi",
648 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
650 .chip_select = 8 - CONFIG_J19_JUMPER,
651 .controller_data = &spi_si3xxx_chip_info,
655 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
657 .modalias = "ad7877",
658 .platform_data = &bfin_ad7877_ts_info,
660 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
663 .controller_data = &spi_ad7877_chip_info,
666 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
667 && defined(CONFIG_SND_SOC_WM8731_SPI)
669 .modalias = "wm8731",
670 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
673 .controller_data = &spi_wm8731_chip_info,
677 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
679 .modalias = "spidev",
680 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
683 .controller_data = &spidev_chip_info,
688 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
689 /* SPI controller data */
690 static struct bfin5xx_spi_master bfin_spi0_info = {
692 .enable_dma = 1, /* master has the ability to do dma transfer */
693 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
697 static struct resource bfin_spi0_resource[] = {
699 .start = SPI0_REGBASE,
700 .end = SPI0_REGBASE + 0xFF,
701 .flags = IORESOURCE_MEM,
706 .flags = IORESOURCE_IRQ,
710 static struct platform_device bfin_spi0_device = {
712 .id = 0, /* Bus number */
713 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
714 .resource = bfin_spi0_resource,
716 .platform_data = &bfin_spi0_info, /* Passed to driver */
719 #endif /* spi master and devices */
721 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
722 static struct platform_device bfin_fb_device = {
723 .name = "bf537-lq035",
727 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
728 static struct platform_device bfin_fb_adv7393_device = {
729 .name = "bfin-adv7393",
733 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
734 static struct resource bfin_uart_resources[] = {
735 #ifdef CONFIG_SERIAL_BFIN_UART0
739 .flags = IORESOURCE_MEM,
742 #ifdef CONFIG_SERIAL_BFIN_UART1
746 .flags = IORESOURCE_MEM,
751 static struct platform_device bfin_uart_device = {
754 .num_resources = ARRAY_SIZE(bfin_uart_resources),
755 .resource = bfin_uart_resources,
759 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
760 static struct resource bfin_sir_resources[] = {
761 #ifdef CONFIG_BFIN_SIR0
765 .flags = IORESOURCE_MEM,
768 #ifdef CONFIG_BFIN_SIR1
772 .flags = IORESOURCE_MEM,
777 static struct platform_device bfin_sir_device = {
780 .num_resources = ARRAY_SIZE(bfin_sir_resources),
781 .resource = bfin_sir_resources,
785 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
786 static struct resource bfin_twi0_resource[] = {
788 .start = TWI0_REGBASE,
790 .flags = IORESOURCE_MEM,
795 .flags = IORESOURCE_IRQ,
799 static struct platform_device i2c_bfin_twi_device = {
800 .name = "i2c-bfin-twi",
802 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
803 .resource = bfin_twi0_resource,
807 #ifdef CONFIG_I2C_BOARDINFO
808 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
809 #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
811 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
814 #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
816 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
823 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
824 static struct platform_device bfin_sport0_uart_device = {
825 .name = "bfin-sport-uart",
829 static struct platform_device bfin_sport1_uart_device = {
830 .name = "bfin-sport-uart",
835 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
836 #include <linux/input.h>
837 #include <linux/gpio_keys.h>
839 static struct gpio_keys_button bfin_gpio_keys_table[] = {
840 {BTN_0, GPIO_PG0, 1, "gpio-keys: BTN0"},
841 {BTN_1, GPIO_PG13, 1, "gpio-keys: BTN1"},
844 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
845 .buttons = bfin_gpio_keys_table,
846 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
849 static struct platform_device bfin_device_gpiokeys = {
852 .platform_data = &bfin_gpio_keys_data,
857 static struct resource bfin_gpios_resources = {
859 .end = MAX_BLACKFIN_GPIOS - 1,
860 .flags = IORESOURCE_IRQ,
863 static struct platform_device bfin_gpios_device = {
864 .name = "simple-gpio",
867 .resource = &bfin_gpios_resources,
870 static const unsigned int cclk_vlev_datasheet[] =
872 VRPAIR(VLEV_100, 400000000),
873 VRPAIR(VLEV_105, 426000000),
874 VRPAIR(VLEV_110, 500000000),
875 VRPAIR(VLEV_115, 533000000),
876 VRPAIR(VLEV_120, 600000000),
879 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
880 .tuple_tab = cclk_vlev_datasheet,
881 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
882 .vr_settling_time = 25 /* us */,
885 static struct platform_device bfin_dpmc = {
888 .platform_data = &bfin_dmpc_vreg_data,
892 static struct platform_device *stamp_devices[] __initdata = {
896 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
900 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
901 &bfin_pcmcia_cf_device,
904 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
908 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
912 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
916 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
920 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
924 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
928 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
932 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
933 &net2272_bfin_device,
936 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
940 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
944 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
945 &bf52x_t350mcqb_device,
948 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
949 &bfin_fb_adv7393_device,
952 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
956 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
960 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
961 &i2c_bfin_twi_device,
964 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
965 &bfin_sport0_uart_device,
966 &bfin_sport1_uart_device,
969 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
970 &bfin_device_gpiokeys,
973 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
980 static int __init stamp_init(void)
982 printk(KERN_INFO "%s(): registering device resources\n", __func__);
984 #ifdef CONFIG_I2C_BOARDINFO
985 i2c_register_board_info(0, bfin_i2c_board_info,
986 ARRAY_SIZE(bfin_i2c_board_info));
989 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
990 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
994 arch_initcall(stamp_init);
996 void native_machine_restart(char *cmd)
998 /* workaround reboot hang when booting from SPI */
999 if ((bfin_read_SYSCR() & 0x7) == 0x3)
1000 bfin_gpio_reset_spi0_ssel1();
1003 void bfin_get_ether_addr(char *addr)
1005 /* the MAC is stored in OTP memory page 0xDF */
1008 u32 (*otp_read)(u32 page, u32 flags, u64 *page_content) = (void *)0xEF00001A;
1010 ret = otp_read(0xDF, 0x00, &otp_mac);
1012 char *otp_mac_p = (char *)&otp_mac;
1013 for (ret = 0; ret < 6; ++ret)
1014 addr[ret] = otp_mac_p[5 - ret];
1017 EXPORT_SYMBOL(bfin_get_ether_addr);