2 * Copyright 2004-2009 Analog Devices Inc.
3 * 2005 National ICT Australia (NICTA)
4 * Aidan Williams <aidan@nicta.com.au>
6 * Licensed under the GPL-2 or later.
9 #include <linux/device.h>
10 #include <linux/platform_device.h>
11 #include <linux/mtd/mtd.h>
12 #include <linux/mtd/partitions.h>
13 #include <linux/mtd/physmap.h>
14 #include <linux/spi/spi.h>
15 #include <linux/spi/flash.h>
16 #include <linux/irq.h>
17 #include <linux/i2c.h>
18 #include <linux/interrupt.h>
19 #include <linux/usb/musb.h>
20 #include <asm/bfin5xx_spi.h>
25 #include <asm/portmux.h>
26 #include <asm/bfin_sdh.h>
27 #include <mach/bf54x_keys.h>
28 #include <linux/input.h>
29 #include <linux/spi/ad7877.h>
32 * Name the Board for the /proc/cpuinfo
34 const char bfin_board_name[] = "ADI BF548-EZKIT";
37 * Driver needs to know address, irq and flag pin.
40 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
41 #include <linux/usb/isp1760.h>
42 static struct resource bfin_isp1760_resources[] = {
45 .end = 0x2C0C0000 + 0xfffff,
46 .flags = IORESOURCE_MEM,
51 .flags = IORESOURCE_IRQ,
55 static struct isp1760_platform_data isp1760_priv = {
60 .dack_polarity_high = 0,
61 .dreq_polarity_high = 0,
64 static struct platform_device bfin_isp1760_device = {
68 .platform_data = &isp1760_priv,
70 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
71 .resource = bfin_isp1760_resources,
75 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
77 #include <mach/bf54x-lq043.h>
79 static struct bfin_bf54xfb_mach_info bf54x_lq043_data = {
82 .xres = {480, 480, 480},
83 .yres = {272, 272, 272},
88 static struct resource bf54x_lq043_resources[] = {
90 .start = IRQ_EPPI0_ERR,
92 .flags = IORESOURCE_IRQ,
96 static struct platform_device bf54x_lq043_device = {
97 .name = "bf54x-lq043",
99 .num_resources = ARRAY_SIZE(bf54x_lq043_resources),
100 .resource = bf54x_lq043_resources,
102 .platform_data = &bf54x_lq043_data,
107 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
108 static const unsigned int bf548_keymap[] = {
109 KEYVAL(0, 0, KEY_ENTER),
110 KEYVAL(0, 1, KEY_HELP),
112 KEYVAL(0, 3, KEY_BACKSPACE),
113 KEYVAL(1, 0, KEY_TAB),
117 KEYVAL(2, 0, KEY_DOWN),
121 KEYVAL(3, 0, KEY_UP),
127 static struct bfin_kpad_platform_data bf54x_kpad_data = {
130 .keymap = bf548_keymap,
131 .keymapsize = ARRAY_SIZE(bf548_keymap),
133 .debounce_time = 5000, /* ns (5ms) */
134 .coldrive_time = 1000, /* ns (1ms) */
135 .keyup_test_interval = 50, /* ms (50ms) */
138 static struct resource bf54x_kpad_resources[] = {
142 .flags = IORESOURCE_IRQ,
146 static struct platform_device bf54x_kpad_device = {
147 .name = "bf54x-keys",
149 .num_resources = ARRAY_SIZE(bf54x_kpad_resources),
150 .resource = bf54x_kpad_resources,
152 .platform_data = &bf54x_kpad_data,
157 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
158 #include <asm/bfin_rotary.h>
160 static struct bfin_rotary_platform_data bfin_rotary_data = {
161 /*.rotary_up_key = KEY_UP,*/
162 /*.rotary_down_key = KEY_DOWN,*/
163 .rotary_rel_code = REL_WHEEL,
164 .rotary_button_key = KEY_ENTER,
165 .debounce = 10, /* 0..17 */
166 .mode = ROT_QUAD_ENC | ROT_DEBE,
169 static struct resource bfin_rotary_resources[] = {
173 .flags = IORESOURCE_IRQ,
177 static struct platform_device bfin_rotary_device = {
178 .name = "bfin-rotary",
180 .num_resources = ARRAY_SIZE(bfin_rotary_resources),
181 .resource = bfin_rotary_resources,
183 .platform_data = &bfin_rotary_data,
188 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
189 #include <linux/input/adxl34x.h>
190 static const struct adxl34x_platform_data adxl34x_info = {
194 .tap_threshold = 0x31,
195 .tap_duration = 0x10,
198 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
199 .act_axis_control = 0xFF,
200 .activity_threshold = 5,
201 .inactivity_threshold = 3,
202 .inactivity_time = 4,
203 .free_fall_threshold = 0x7,
204 .free_fall_time = 0x20,
206 .data_range = ADXL_FULL_RES,
209 .ev_code_x = ABS_X, /* EV_REL */
210 .ev_code_y = ABS_Y, /* EV_REL */
211 .ev_code_z = ABS_Z, /* EV_REL */
213 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
215 /* .ev_code_ff = KEY_F,*/ /* EV_KEY */
216 /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
217 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
218 .fifo_mode = ADXL_FIFO_STREAM,
219 .orientation_enable = ADXL_EN_ORIENTATION_3D,
220 .deadzone_angle = ADXL_DEADZONE_ANGLE_10p8,
221 .divisor_length = ADXL_LP_FILTER_DIVISOR_16,
222 /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
223 .ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C},
227 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
228 static struct platform_device rtc_device = {
234 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
235 static struct resource bfin_uart_resources[] = {
236 #ifdef CONFIG_SERIAL_BFIN_UART0
240 .flags = IORESOURCE_MEM,
243 #ifdef CONFIG_SERIAL_BFIN_UART1
247 .flags = IORESOURCE_MEM,
250 #ifdef CONFIG_SERIAL_BFIN_UART2
254 .flags = IORESOURCE_MEM,
257 #ifdef CONFIG_SERIAL_BFIN_UART3
261 .flags = IORESOURCE_MEM,
266 static struct platform_device bfin_uart_device = {
269 .num_resources = ARRAY_SIZE(bfin_uart_resources),
270 .resource = bfin_uart_resources,
274 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
275 #ifdef CONFIG_BFIN_SIR0
276 static struct resource bfin_sir0_resources[] = {
280 .flags = IORESOURCE_MEM,
283 .start = IRQ_UART0_RX,
284 .end = IRQ_UART0_RX+1,
285 .flags = IORESOURCE_IRQ,
288 .start = CH_UART0_RX,
289 .end = CH_UART0_RX+1,
290 .flags = IORESOURCE_DMA,
293 static struct platform_device bfin_sir0_device = {
296 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
297 .resource = bfin_sir0_resources,
300 #ifdef CONFIG_BFIN_SIR1
301 static struct resource bfin_sir1_resources[] = {
305 .flags = IORESOURCE_MEM,
308 .start = IRQ_UART1_RX,
309 .end = IRQ_UART1_RX+1,
310 .flags = IORESOURCE_IRQ,
313 .start = CH_UART1_RX,
314 .end = CH_UART1_RX+1,
315 .flags = IORESOURCE_DMA,
318 static struct platform_device bfin_sir1_device = {
321 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
322 .resource = bfin_sir1_resources,
325 #ifdef CONFIG_BFIN_SIR2
326 static struct resource bfin_sir2_resources[] = {
330 .flags = IORESOURCE_MEM,
333 .start = IRQ_UART2_RX,
334 .end = IRQ_UART2_RX+1,
335 .flags = IORESOURCE_IRQ,
338 .start = CH_UART2_RX,
339 .end = CH_UART2_RX+1,
340 .flags = IORESOURCE_DMA,
343 static struct platform_device bfin_sir2_device = {
346 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
347 .resource = bfin_sir2_resources,
350 #ifdef CONFIG_BFIN_SIR3
351 static struct resource bfin_sir3_resources[] = {
355 .flags = IORESOURCE_MEM,
358 .start = IRQ_UART3_RX,
359 .end = IRQ_UART3_RX+1,
360 .flags = IORESOURCE_IRQ,
363 .start = CH_UART3_RX,
364 .end = CH_UART3_RX+1,
365 .flags = IORESOURCE_DMA,
368 static struct platform_device bfin_sir3_device = {
371 .num_resources = ARRAY_SIZE(bfin_sir3_resources),
372 .resource = bfin_sir3_resources,
377 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
378 #include <linux/smsc911x.h>
380 static struct resource smsc911x_resources[] = {
382 .name = "smsc911x-memory",
384 .end = 0x24000000 + 0xFF,
385 .flags = IORESOURCE_MEM,
390 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
394 static struct smsc911x_platform_config smsc911x_config = {
395 .flags = SMSC911X_USE_32BIT,
396 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
397 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
398 .phy_interface = PHY_INTERFACE_MODE_MII,
401 static struct platform_device smsc911x_device = {
404 .num_resources = ARRAY_SIZE(smsc911x_resources),
405 .resource = smsc911x_resources,
407 .platform_data = &smsc911x_config,
412 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
413 static struct resource musb_resources[] = {
417 .flags = IORESOURCE_MEM,
419 [1] = { /* general IRQ */
420 .start = IRQ_USB_INT0,
422 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
424 [2] = { /* DMA IRQ */
425 .start = IRQ_USB_DMA,
427 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
431 static struct musb_hdrc_config musb_config = {
438 .gpio_vrsel = GPIO_PE7,
441 static struct musb_hdrc_platform_data musb_plat = {
442 #if defined(CONFIG_USB_MUSB_OTG)
444 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
446 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
447 .mode = MUSB_PERIPHERAL,
449 .config = &musb_config,
452 static u64 musb_dmamask = ~(u32)0;
454 static struct platform_device musb_device = {
458 .dma_mask = &musb_dmamask,
459 .coherent_dma_mask = 0xffffffff,
460 .platform_data = &musb_plat,
462 .num_resources = ARRAY_SIZE(musb_resources),
463 .resource = musb_resources,
467 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
468 unsigned short bfin_can_peripherals[] = {
469 P_CAN0_RX, P_CAN0_TX, 0
472 static struct resource bfin_can_resources[] = {
476 .flags = IORESOURCE_MEM,
479 .start = IRQ_CAN0_RX,
481 .flags = IORESOURCE_IRQ,
484 .start = IRQ_CAN0_TX,
486 .flags = IORESOURCE_IRQ,
489 .start = IRQ_CAN0_ERROR,
490 .end = IRQ_CAN0_ERROR,
491 .flags = IORESOURCE_IRQ,
495 static struct platform_device bfin_can_device = {
497 .num_resources = ARRAY_SIZE(bfin_can_resources),
498 .resource = bfin_can_resources,
500 .platform_data = &bfin_can_peripherals, /* Passed to driver */
505 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
506 static struct resource bfin_atapi_resources[] = {
510 .flags = IORESOURCE_MEM,
513 .start = IRQ_ATAPI_ERR,
514 .end = IRQ_ATAPI_ERR,
515 .flags = IORESOURCE_IRQ,
519 static struct platform_device bfin_atapi_device = {
520 .name = "pata-bf54x",
522 .num_resources = ARRAY_SIZE(bfin_atapi_resources),
523 .resource = bfin_atapi_resources,
527 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
528 static struct mtd_partition partition_info[] = {
530 .name = "linux kernel(nand)",
532 .size = 4 * 1024 * 1024,
535 .name = "file system(nand)",
536 .offset = MTDPART_OFS_APPEND,
537 .size = MTDPART_SIZ_FULL,
541 static struct bf5xx_nand_platform bf5xx_nand_platform = {
542 .page_size = NFC_PG_SIZE_256,
543 .data_width = NFC_NWIDTH_8,
544 .partitions = partition_info,
545 .nr_partitions = ARRAY_SIZE(partition_info),
550 static struct resource bf5xx_nand_resources[] = {
554 .flags = IORESOURCE_MEM,
559 .flags = IORESOURCE_IRQ,
563 static struct platform_device bf5xx_nand_device = {
564 .name = "bf5xx-nand",
566 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
567 .resource = bf5xx_nand_resources,
569 .platform_data = &bf5xx_nand_platform,
574 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
576 static struct bfin_sd_host bfin_sdh_data = {
578 .irq_int0 = IRQ_SDH_MASK0,
579 .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0},
582 static struct platform_device bf54x_sdh_device = {
586 .platform_data = &bfin_sdh_data,
591 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
592 static struct mtd_partition ezkit_partitions[] = {
594 .name = "bootloader(nor)",
598 .name = "linux kernel(nor)",
600 .offset = MTDPART_OFS_APPEND,
602 .name = "file system(nor)",
603 .size = MTDPART_SIZ_FULL,
604 .offset = MTDPART_OFS_APPEND,
608 static struct physmap_flash_data ezkit_flash_data = {
610 .parts = ezkit_partitions,
611 .nr_parts = ARRAY_SIZE(ezkit_partitions),
614 static struct resource ezkit_flash_resource = {
617 .flags = IORESOURCE_MEM,
620 static struct platform_device ezkit_flash_device = {
621 .name = "physmap-flash",
624 .platform_data = &ezkit_flash_data,
627 .resource = &ezkit_flash_resource,
631 #if defined(CONFIG_MTD_M25P80) \
632 || defined(CONFIG_MTD_M25P80_MODULE)
633 /* SPI flash chip (m25p16) */
634 static struct mtd_partition bfin_spi_flash_partitions[] = {
636 .name = "bootloader(spi)",
639 .mask_flags = MTD_CAP_ROM
641 .name = "linux kernel(spi)",
642 .size = MTDPART_SIZ_FULL,
643 .offset = MTDPART_OFS_APPEND,
647 static struct flash_platform_data bfin_spi_flash_data = {
649 .parts = bfin_spi_flash_partitions,
650 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
654 static struct bfin5xx_spi_chip spi_flash_chip_info = {
655 .enable_dma = 0, /* use dma transfer with this chip*/
660 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
661 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
662 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
668 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
669 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
674 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
676 .vref_delay_usecs = 50, /* internal, no capacitor */
679 .pressure_max = 1000,
681 .stopacq_polarity = 1,
682 .first_conversion_delay = 3,
683 .acquisition_time = 1,
685 .pen_down_acc_interval = 1,
689 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
690 static struct bfin5xx_spi_chip spidev_chip_info = {
696 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
697 static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
698 .enable_dma = 0, /* use dma transfer with this chip*/
703 static struct spi_board_info bfin_spi_board_info[] __initdata = {
704 #if defined(CONFIG_MTD_M25P80) \
705 || defined(CONFIG_MTD_M25P80_MODULE)
707 /* the modalias must be the same as spi device driver name */
708 .modalias = "m25p80", /* Name of spi_driver for this device */
709 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
710 .bus_num = 0, /* Framework bus number */
711 .chip_select = 1, /* SPI_SSEL1*/
712 .platform_data = &bfin_spi_flash_data,
713 .controller_data = &spi_flash_chip_info,
717 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
718 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
720 .modalias = "ad1836",
721 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
723 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
724 .controller_data = &ad1836_spi_chip_info,
727 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
729 .modalias = "ad7877",
730 .platform_data = &bfin_ad7877_ts_info,
731 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
732 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
735 .controller_data = &spi_ad7877_chip_info,
738 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
740 .modalias = "spidev",
741 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
744 .controller_data = &spidev_chip_info,
747 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
749 .modalias = "adxl34x",
750 .platform_data = &adxl34x_info,
752 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
755 .controller_data = &spi_adxl34x_chip_info,
760 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
762 static struct resource bfin_spi0_resource[] = {
764 .start = SPI0_REGBASE,
765 .end = SPI0_REGBASE + 0xFF,
766 .flags = IORESOURCE_MEM,
771 .flags = IORESOURCE_DMA,
776 .flags = IORESOURCE_IRQ,
781 static struct resource bfin_spi1_resource[] = {
783 .start = SPI1_REGBASE,
784 .end = SPI1_REGBASE + 0xFF,
785 .flags = IORESOURCE_MEM,
790 .flags = IORESOURCE_DMA,
795 .flags = IORESOURCE_IRQ,
799 /* SPI controller data */
800 static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
802 .enable_dma = 1, /* master has the ability to do dma transfer */
803 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
806 static struct platform_device bf54x_spi_master0 = {
808 .id = 0, /* Bus number */
809 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
810 .resource = bfin_spi0_resource,
812 .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
816 static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
818 .enable_dma = 1, /* master has the ability to do dma transfer */
819 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
822 static struct platform_device bf54x_spi_master1 = {
824 .id = 1, /* Bus number */
825 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
826 .resource = bfin_spi1_resource,
828 .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
831 #endif /* spi master and devices */
833 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
834 static struct resource bfin_twi0_resource[] = {
836 .start = TWI0_REGBASE,
837 .end = TWI0_REGBASE + 0xFF,
838 .flags = IORESOURCE_MEM,
843 .flags = IORESOURCE_IRQ,
847 static struct platform_device i2c_bfin_twi0_device = {
848 .name = "i2c-bfin-twi",
850 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
851 .resource = bfin_twi0_resource,
854 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
855 static struct resource bfin_twi1_resource[] = {
857 .start = TWI1_REGBASE,
858 .end = TWI1_REGBASE + 0xFF,
859 .flags = IORESOURCE_MEM,
864 .flags = IORESOURCE_IRQ,
868 static struct platform_device i2c_bfin_twi1_device = {
869 .name = "i2c-bfin-twi",
871 .num_resources = ARRAY_SIZE(bfin_twi1_resource),
872 .resource = bfin_twi1_resource,
877 static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
880 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
881 static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
882 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
884 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
887 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
889 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
893 #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
895 I2C_BOARD_INFO("adxl34x", 0x53),
897 .platform_data = (void *)&adxl34x_info,
903 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
904 #include <linux/gpio_keys.h>
906 static struct gpio_keys_button bfin_gpio_keys_table[] = {
907 {BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"},
908 {BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"},
909 {BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"},
910 {BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"},
913 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
914 .buttons = bfin_gpio_keys_table,
915 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
918 static struct platform_device bfin_device_gpiokeys = {
921 .platform_data = &bfin_gpio_keys_data,
926 static const unsigned int cclk_vlev_datasheet[] =
929 * Internal VLEV BF54XSBBC1533
930 ****temporarily using these values until data sheet is updated
932 VRPAIR(VLEV_085, 150000000),
933 VRPAIR(VLEV_090, 250000000),
934 VRPAIR(VLEV_110, 276000000),
935 VRPAIR(VLEV_115, 301000000),
936 VRPAIR(VLEV_120, 525000000),
937 VRPAIR(VLEV_125, 550000000),
938 VRPAIR(VLEV_130, 600000000),
941 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
942 .tuple_tab = cclk_vlev_datasheet,
943 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
944 .vr_settling_time = 25 /* us */,
947 static struct platform_device bfin_dpmc = {
950 .platform_data = &bfin_dmpc_vreg_data,
954 static struct platform_device *ezkit_devices[] __initdata = {
958 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
962 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
966 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
967 #ifdef CONFIG_BFIN_SIR0
970 #ifdef CONFIG_BFIN_SIR1
973 #ifdef CONFIG_BFIN_SIR2
976 #ifdef CONFIG_BFIN_SIR3
981 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
985 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
989 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
993 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
994 &bfin_isp1760_device,
997 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
1001 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
1005 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
1009 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
1013 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1018 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
1022 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
1023 &bfin_rotary_device,
1026 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1027 &i2c_bfin_twi0_device,
1028 #if !defined(CONFIG_BF542)
1029 &i2c_bfin_twi1_device,
1033 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1034 &bfin_device_gpiokeys,
1037 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1038 &ezkit_flash_device,
1042 static int __init ezkit_init(void)
1044 printk(KERN_INFO "%s(): registering device resources\n", __func__);
1046 i2c_register_board_info(0, bfin_i2c_board_info0,
1047 ARRAY_SIZE(bfin_i2c_board_info0));
1048 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1049 i2c_register_board_info(1, bfin_i2c_board_info1,
1050 ARRAY_SIZE(bfin_i2c_board_info1));
1053 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
1055 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
1060 arch_initcall(ezkit_init);