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>
47 #include <asm/bfin5xx_spi.h>
48 #include <asm/reboot.h>
50 #include <asm/portmux.h>
52 #include <linux/spi/ad7877.h>
55 * Name the Board for the /proc/cpuinfo
57 const char bfin_board_name[] = "ADDS-BF527-EZKIT";
60 * Driver needs to know address, irq and flag pin.
63 #define ISP1761_BASE 0x203C0000
64 #define ISP1761_IRQ IRQ_PF7
66 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
67 static struct resource bfin_isp1761_resources[] = {
69 .name = "isp1761-regs",
70 .start = ISP1761_BASE + 0x00000000,
71 .end = ISP1761_BASE + 0x000fffff,
72 .flags = IORESOURCE_MEM,
77 .flags = IORESOURCE_IRQ,
81 static struct platform_device bfin_isp1761_device = {
84 .num_resources = ARRAY_SIZE(bfin_isp1761_resources),
85 .resource = bfin_isp1761_resources,
88 static struct platform_device *bfin_isp1761_devices[] = {
92 int __init bfin_isp1761_init(void)
94 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
96 printk(KERN_INFO "%s(): registering device resources\n", __func__);
97 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
99 return platform_add_devices(bfin_isp1761_devices, num_devices);
102 void __exit bfin_isp1761_exit(void)
104 platform_device_unregister(&bfin_isp1761_device);
107 arch_initcall(bfin_isp1761_init);
110 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
111 static struct resource musb_resources[] = {
115 .flags = IORESOURCE_MEM,
117 [1] = { /* general IRQ */
118 .start = IRQ_USB_INT0,
120 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
122 [2] = { /* DMA IRQ */
123 .start = IRQ_USB_DMA,
125 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
129 static struct musb_hdrc_config musb_config = {
136 .gpio_vrsel = GPIO_PG13,
139 static struct musb_hdrc_platform_data musb_plat = {
140 #if defined(CONFIG_USB_MUSB_OTG)
142 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
144 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
145 .mode = MUSB_PERIPHERAL,
147 .config = &musb_config,
150 static u64 musb_dmamask = ~(u32)0;
152 static struct platform_device musb_device = {
156 .dma_mask = &musb_dmamask,
157 .coherent_dma_mask = 0xffffffff,
158 .platform_data = &musb_plat,
160 .num_resources = ARRAY_SIZE(musb_resources),
161 .resource = musb_resources,
165 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
167 static struct resource bf52x_t350mcqb_resources[] = {
169 .start = IRQ_PPI_ERROR,
170 .end = IRQ_PPI_ERROR,
171 .flags = IORESOURCE_IRQ,
175 static struct platform_device bf52x_t350mcqb_device = {
176 .name = "bfin-t350mcqb",
178 .num_resources = ARRAY_SIZE(bf52x_t350mcqb_resources),
179 .resource = bf52x_t350mcqb_resources,
183 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
184 static struct mtd_partition ezkit_partitions[] = {
186 .name = "bootloader(nor)",
190 .name = "linux kernel(nor)",
192 .offset = MTDPART_OFS_APPEND,
194 .name = "file system(nor)",
195 .size = MTDPART_SIZ_FULL,
196 .offset = MTDPART_OFS_APPEND,
200 static struct physmap_flash_data ezkit_flash_data = {
202 .parts = ezkit_partitions,
203 .nr_parts = ARRAY_SIZE(ezkit_partitions),
206 static struct resource ezkit_flash_resource = {
209 .flags = IORESOURCE_MEM,
212 static struct platform_device ezkit_flash_device = {
213 .name = "physmap-flash",
216 .platform_data = &ezkit_flash_data,
219 .resource = &ezkit_flash_resource,
223 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
224 static struct mtd_partition partition_info[] = {
226 .name = "linux kernel(nand)",
228 .size = 4 * 1024 * 1024,
231 .name = "file system(nand)",
232 .offset = MTDPART_OFS_APPEND,
233 .size = MTDPART_SIZ_FULL,
237 static struct bf5xx_nand_platform bf5xx_nand_platform = {
238 .page_size = NFC_PG_SIZE_256,
239 .data_width = NFC_NWIDTH_8,
240 .partitions = partition_info,
241 .nr_partitions = ARRAY_SIZE(partition_info),
246 static struct resource bf5xx_nand_resources[] = {
249 .end = NFC_DATA_RD + 2,
250 .flags = IORESOURCE_MEM,
255 .flags = IORESOURCE_IRQ,
259 static struct platform_device bf5xx_nand_device = {
260 .name = "bf5xx-nand",
262 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
263 .resource = bf5xx_nand_resources,
265 .platform_data = &bf5xx_nand_platform,
270 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
271 static struct resource bfin_pcmcia_cf_resources[] = {
273 .start = 0x20310000, /* IO PORT */
275 .flags = IORESOURCE_MEM,
277 .start = 0x20311000, /* Attribute Memory */
279 .flags = IORESOURCE_MEM,
283 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
285 .start = 6, /* Card Detect PF6 */
287 .flags = IORESOURCE_IRQ,
291 static struct platform_device bfin_pcmcia_cf_device = {
292 .name = "bfin_cf_pcmcia",
294 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
295 .resource = bfin_pcmcia_cf_resources,
299 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
300 static struct platform_device rtc_device = {
306 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
307 static struct resource smc91x_resources[] = {
309 .name = "smc91x-regs",
311 .end = 0x20300300 + 16,
312 .flags = IORESOURCE_MEM,
317 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
320 static struct platform_device smc91x_device = {
323 .num_resources = ARRAY_SIZE(smc91x_resources),
324 .resource = smc91x_resources,
328 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
329 static struct resource dm9000_resources[] = {
332 .end = 0x203FB800 + 1,
333 .flags = IORESOURCE_MEM,
336 .start = 0x203FB800 + 4,
337 .end = 0x203FB800 + 5,
338 .flags = IORESOURCE_MEM,
343 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
347 static struct platform_device dm9000_device = {
350 .num_resources = ARRAY_SIZE(dm9000_resources),
351 .resource = dm9000_resources,
355 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
356 static struct resource sl811_hcd_resources[] = {
360 .flags = IORESOURCE_MEM,
364 .flags = IORESOURCE_MEM,
366 .start = CONFIG_USB_SL811_BFIN_IRQ,
367 .end = CONFIG_USB_SL811_BFIN_IRQ,
368 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
372 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
373 void sl811_port_power(struct device *dev, int is_on)
375 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
376 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
380 static struct sl811_platform_data sl811_priv = {
382 .power = 250, /* == 500mA */
383 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
384 .port_power = &sl811_port_power,
388 static struct platform_device sl811_hcd_device = {
392 .platform_data = &sl811_priv,
394 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
395 .resource = sl811_hcd_resources,
399 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
400 static struct resource isp1362_hcd_resources[] = {
404 .flags = IORESOURCE_MEM,
408 .flags = IORESOURCE_MEM,
410 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
411 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
412 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
416 static struct isp1362_platform_data isp1362_priv = {
421 .int_edge_triggered = 0,
422 .remote_wakeup_connected = 0,
423 .no_power_switching = 1,
424 .power_switching_mode = 0,
427 static struct platform_device isp1362_hcd_device = {
428 .name = "isp1362-hcd",
431 .platform_data = &isp1362_priv,
433 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
434 .resource = isp1362_hcd_resources,
438 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
439 static struct platform_device bfin_mac_device = {
444 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
445 static struct resource net2272_bfin_resources[] = {
448 .end = 0x20300000 + 0x100,
449 .flags = IORESOURCE_MEM,
453 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
457 static struct platform_device net2272_bfin_device = {
460 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
461 .resource = net2272_bfin_resources,
465 #if defined(CONFIG_MTD_M25P80) \
466 || defined(CONFIG_MTD_M25P80_MODULE)
467 static struct mtd_partition bfin_spi_flash_partitions[] = {
469 .name = "bootloader(spi)",
472 .mask_flags = MTD_CAP_ROM
474 .name = "linux kernel(spi)",
475 .size = MTDPART_SIZ_FULL,
476 .offset = MTDPART_OFS_APPEND,
480 static struct flash_platform_data bfin_spi_flash_data = {
482 .parts = bfin_spi_flash_partitions,
483 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
487 /* SPI flash chip (m25p64) */
488 static struct bfin5xx_spi_chip spi_flash_chip_info = {
489 .enable_dma = 0, /* use dma transfer with this chip*/
494 #if defined(CONFIG_SPI_ADC_BF533) \
495 || defined(CONFIG_SPI_ADC_BF533_MODULE)
497 static struct bfin5xx_spi_chip spi_adc_chip_info = {
498 .enable_dma = 1, /* use dma transfer with this chip*/
503 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
504 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
505 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
511 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
512 static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
518 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
519 static struct bfin5xx_spi_chip spi_mmc_chip_info = {
525 #if defined(CONFIG_PBX)
526 static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
527 .ctl_reg = 0x4, /* send zero */
530 .cs_change_per_word = 1,
534 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
535 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
540 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
542 .vref_delay_usecs = 50, /* internal, no capacitor */
545 .pressure_max = 1000,
547 .stopacq_polarity = 1,
548 .first_conversion_delay = 3,
549 .acquisition_time = 1,
551 .pen_down_acc_interval = 1,
555 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
556 && defined(CONFIG_SND_SOC_WM8731_SPI)
557 static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
563 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
564 static struct bfin5xx_spi_chip spidev_chip_info = {
570 static struct spi_board_info bfin_spi_board_info[] __initdata = {
571 #if defined(CONFIG_MTD_M25P80) \
572 || defined(CONFIG_MTD_M25P80_MODULE)
574 /* the modalias must be the same as spi device driver name */
575 .modalias = "m25p80", /* Name of spi_driver for this device */
576 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
577 .bus_num = 0, /* Framework bus number */
578 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
579 .platform_data = &bfin_spi_flash_data,
580 .controller_data = &spi_flash_chip_info,
585 #if defined(CONFIG_SPI_ADC_BF533) \
586 || defined(CONFIG_SPI_ADC_BF533_MODULE)
588 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
589 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
590 .bus_num = 0, /* Framework bus number */
591 .chip_select = 1, /* Framework chip select. */
592 .platform_data = NULL, /* No spi_driver specific config */
593 .controller_data = &spi_adc_chip_info,
597 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
598 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
600 .modalias = "ad1836-spi",
601 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
603 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
604 .controller_data = &ad1836_spi_chip_info,
607 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
609 .modalias = "ad9960-spi",
610 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
613 .controller_data = &ad9960_spi_chip_info,
616 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
618 .modalias = "spi_mmc_dummy",
619 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
622 .platform_data = NULL,
623 .controller_data = &spi_mmc_chip_info,
627 .modalias = "spi_mmc",
628 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
630 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
631 .platform_data = NULL,
632 .controller_data = &spi_mmc_chip_info,
636 #if defined(CONFIG_PBX)
638 .modalias = "fxs-spi",
639 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
641 .chip_select = 8 - CONFIG_J11_JUMPER,
642 .controller_data = &spi_si3xxx_chip_info,
646 .modalias = "fxo-spi",
647 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
649 .chip_select = 8 - CONFIG_J19_JUMPER,
650 .controller_data = &spi_si3xxx_chip_info,
654 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
656 .modalias = "ad7877",
657 .platform_data = &bfin_ad7877_ts_info,
659 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
662 .controller_data = &spi_ad7877_chip_info,
665 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
666 && defined(CONFIG_SND_SOC_WM8731_SPI)
668 .modalias = "wm8731",
669 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
672 .controller_data = &spi_wm8731_chip_info,
676 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
678 .modalias = "spidev",
679 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
682 .controller_data = &spidev_chip_info,
687 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
688 /* SPI controller data */
689 static struct bfin5xx_spi_master bfin_spi0_info = {
691 .enable_dma = 1, /* master has the ability to do dma transfer */
692 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
696 static struct resource bfin_spi0_resource[] = {
698 .start = SPI0_REGBASE,
699 .end = SPI0_REGBASE + 0xFF,
700 .flags = IORESOURCE_MEM,
705 .flags = IORESOURCE_IRQ,
709 static struct platform_device bfin_spi0_device = {
711 .id = 0, /* Bus number */
712 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
713 .resource = bfin_spi0_resource,
715 .platform_data = &bfin_spi0_info, /* Passed to driver */
718 #endif /* spi master and devices */
720 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
721 static struct platform_device bfin_fb_device = {
722 .name = "bf537-lq035",
726 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
727 static struct platform_device bfin_fb_adv7393_device = {
728 .name = "bfin-adv7393",
732 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
733 static struct resource bfin_uart_resources[] = {
734 #ifdef CONFIG_SERIAL_BFIN_UART0
738 .flags = IORESOURCE_MEM,
741 #ifdef CONFIG_SERIAL_BFIN_UART1
745 .flags = IORESOURCE_MEM,
750 static struct platform_device bfin_uart_device = {
753 .num_resources = ARRAY_SIZE(bfin_uart_resources),
754 .resource = bfin_uart_resources,
758 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
759 static struct resource bfin_sir_resources[] = {
760 #ifdef CONFIG_BFIN_SIR0
764 .flags = IORESOURCE_MEM,
767 #ifdef CONFIG_BFIN_SIR1
771 .flags = IORESOURCE_MEM,
776 static struct platform_device bfin_sir_device = {
779 .num_resources = ARRAY_SIZE(bfin_sir_resources),
780 .resource = bfin_sir_resources,
784 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
785 static struct resource bfin_twi0_resource[] = {
787 .start = TWI0_REGBASE,
789 .flags = IORESOURCE_MEM,
794 .flags = IORESOURCE_IRQ,
798 static struct platform_device i2c_bfin_twi_device = {
799 .name = "i2c-bfin-twi",
801 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
802 .resource = bfin_twi0_resource,
806 #ifdef CONFIG_I2C_BOARDINFO
807 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
808 #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
810 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
813 #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
815 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
822 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
823 static struct platform_device bfin_sport0_uart_device = {
824 .name = "bfin-sport-uart",
828 static struct platform_device bfin_sport1_uart_device = {
829 .name = "bfin-sport-uart",
834 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
835 #include <linux/input.h>
836 #include <linux/gpio_keys.h>
838 static struct gpio_keys_button bfin_gpio_keys_table[] = {
839 {BTN_0, GPIO_PG0, 1, "gpio-keys: BTN0"},
840 {BTN_1, GPIO_PG13, 1, "gpio-keys: BTN1"},
843 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
844 .buttons = bfin_gpio_keys_table,
845 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
848 static struct platform_device bfin_device_gpiokeys = {
851 .platform_data = &bfin_gpio_keys_data,
856 #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
857 #include <linux/input.h>
858 #include <asm/bfin_rotary.h>
860 static struct bfin_rotary_platform_data bfin_rotary_data = {
861 /*.rotary_up_key = KEY_UP,*/
862 /*.rotary_down_key = KEY_DOWN,*/
863 .rotary_rel_code = REL_WHEEL,
864 .rotary_button_key = KEY_ENTER,
865 .debounce = 10, /* 0..17 */
866 .mode = ROT_QUAD_ENC | ROT_DEBE,
869 static struct resource bfin_rotary_resources[] = {
873 .flags = IORESOURCE_IRQ,
877 static struct platform_device bfin_rotary_device = {
878 .name = "bfin-rotary",
880 .num_resources = ARRAY_SIZE(bfin_rotary_resources),
881 .resource = bfin_rotary_resources,
883 .platform_data = &bfin_rotary_data,
888 static struct resource bfin_gpios_resources = {
890 .end = MAX_BLACKFIN_GPIOS - 1,
891 .flags = IORESOURCE_IRQ,
894 static struct platform_device bfin_gpios_device = {
895 .name = "simple-gpio",
898 .resource = &bfin_gpios_resources,
901 static const unsigned int cclk_vlev_datasheet[] =
903 VRPAIR(VLEV_100, 400000000),
904 VRPAIR(VLEV_105, 426000000),
905 VRPAIR(VLEV_110, 500000000),
906 VRPAIR(VLEV_115, 533000000),
907 VRPAIR(VLEV_120, 600000000),
910 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
911 .tuple_tab = cclk_vlev_datasheet,
912 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
913 .vr_settling_time = 25 /* us */,
916 static struct platform_device bfin_dpmc = {
919 .platform_data = &bfin_dmpc_vreg_data,
923 static struct platform_device *stamp_devices[] __initdata = {
927 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
931 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
932 &bfin_pcmcia_cf_device,
935 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
939 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
943 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
947 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
951 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
955 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
959 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
963 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
964 &net2272_bfin_device,
967 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
971 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
975 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
976 &bf52x_t350mcqb_device,
979 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
980 &bfin_fb_adv7393_device,
983 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
987 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
991 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
992 &i2c_bfin_twi_device,
995 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
996 &bfin_sport0_uart_device,
997 &bfin_sport1_uart_device,
1000 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1001 &bfin_device_gpiokeys,
1004 #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
1005 &bfin_rotary_device,
1008 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1009 &ezkit_flash_device,
1015 static int __init stamp_init(void)
1017 printk(KERN_INFO "%s(): registering device resources\n", __func__);
1019 #ifdef CONFIG_I2C_BOARDINFO
1020 i2c_register_board_info(0, bfin_i2c_board_info,
1021 ARRAY_SIZE(bfin_i2c_board_info));
1024 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
1025 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
1029 arch_initcall(stamp_init);
1031 void native_machine_restart(char *cmd)
1033 /* workaround reboot hang when booting from SPI */
1034 if ((bfin_read_SYSCR() & 0x7) == 0x3)
1035 bfin_gpio_reset_spi0_ssel1();
1038 void bfin_get_ether_addr(char *addr)
1040 /* the MAC is stored in OTP memory page 0xDF */
1043 u32 (*otp_read)(u32 page, u32 flags, u64 *page_content) = (void *)0xEF00001A;
1045 ret = otp_read(0xDF, 0x00, &otp_mac);
1047 char *otp_mac_p = (char *)&otp_mac;
1048 for (ret = 0; ret < 6; ++ret)
1049 addr[ret] = otp_mac_p[5 - ret];
1052 EXPORT_SYMBOL(bfin_get_ether_addr);