2 * File: arch/blackfin/mach-bf548/boards/ezkit.c
3 * Based on: arch/blackfin/mach-bf537/boards/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2007 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 #include <linux/irq.h>
39 #include <linux/i2c.h>
40 #include <linux/interrupt.h>
41 #include <linux/usb/musb.h>
42 #include <asm/bfin5xx_spi.h>
47 #include <asm/portmux.h>
48 #include <asm/bfin_sdh.h>
49 #include <mach/bf54x_keys.h>
50 #include <linux/input.h>
51 #include <linux/spi/ad7877.h>
54 * Name the Board for the /proc/cpuinfo
56 const char bfin_board_name
[] = "ADI BF548-EZKIT";
59 * Driver needs to know address, irq and flag pin.
62 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
63 #include <linux/usb/isp1760.h>
64 static struct resource bfin_isp1760_resources
[] = {
67 .end
= 0x2C0C0000 + 0xfffff,
68 .flags
= IORESOURCE_MEM
,
73 .flags
= IORESOURCE_IRQ
,
77 static struct isp1760_platform_data isp1760_priv
= {
82 .dack_polarity_high
= 0,
83 .dreq_polarity_high
= 0,
86 static struct platform_device bfin_isp1760_device
= {
87 .name
= "isp1760-hcd",
90 .platform_data
= &isp1760_priv
,
92 .num_resources
= ARRAY_SIZE(bfin_isp1760_resources
),
93 .resource
= bfin_isp1760_resources
,
97 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
99 #include <mach/bf54x-lq043.h>
101 static struct bfin_bf54xfb_mach_info bf54x_lq043_data
= {
104 .xres
= {480, 480, 480},
105 .yres
= {272, 272, 272},
110 static struct resource bf54x_lq043_resources
[] = {
112 .start
= IRQ_EPPI0_ERR
,
113 .end
= IRQ_EPPI0_ERR
,
114 .flags
= IORESOURCE_IRQ
,
118 static struct platform_device bf54x_lq043_device
= {
119 .name
= "bf54x-lq043",
121 .num_resources
= ARRAY_SIZE(bf54x_lq043_resources
),
122 .resource
= bf54x_lq043_resources
,
124 .platform_data
= &bf54x_lq043_data
,
129 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
130 static const unsigned int bf548_keymap
[] = {
131 KEYVAL(0, 0, KEY_ENTER
),
132 KEYVAL(0, 1, KEY_HELP
),
134 KEYVAL(0, 3, KEY_BACKSPACE
),
135 KEYVAL(1, 0, KEY_TAB
),
139 KEYVAL(2, 0, KEY_DOWN
),
143 KEYVAL(3, 0, KEY_UP
),
149 static struct bfin_kpad_platform_data bf54x_kpad_data
= {
152 .keymap
= bf548_keymap
,
153 .keymapsize
= ARRAY_SIZE(bf548_keymap
),
155 .debounce_time
= 5000, /* ns (5ms) */
156 .coldrive_time
= 1000, /* ns (1ms) */
157 .keyup_test_interval
= 50, /* ms (50ms) */
160 static struct resource bf54x_kpad_resources
[] = {
164 .flags
= IORESOURCE_IRQ
,
168 static struct platform_device bf54x_kpad_device
= {
169 .name
= "bf54x-keys",
171 .num_resources
= ARRAY_SIZE(bf54x_kpad_resources
),
172 .resource
= bf54x_kpad_resources
,
174 .platform_data
= &bf54x_kpad_data
,
179 #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
180 #include <asm/bfin_rotary.h>
182 static struct bfin_rotary_platform_data bfin_rotary_data
= {
183 /*.rotary_up_key = KEY_UP,*/
184 /*.rotary_down_key = KEY_DOWN,*/
185 .rotary_rel_code
= REL_WHEEL
,
186 .rotary_button_key
= KEY_ENTER
,
187 .debounce
= 10, /* 0..17 */
188 .mode
= ROT_QUAD_ENC
| ROT_DEBE
,
191 static struct resource bfin_rotary_resources
[] = {
195 .flags
= IORESOURCE_IRQ
,
199 static struct platform_device bfin_rotary_device
= {
200 .name
= "bfin-rotary",
202 .num_resources
= ARRAY_SIZE(bfin_rotary_resources
),
203 .resource
= bfin_rotary_resources
,
205 .platform_data
= &bfin_rotary_data
,
210 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
211 #include <linux/input.h>
212 #include <linux/spi/adxl34x.h>
213 static const struct adxl34x_platform_data adxl34x_info
= {
217 .tap_threshold
= 0x31,
218 .tap_duration
= 0x10,
221 .tap_axis_control
= ADXL_TAP_X_EN
| ADXL_TAP_Y_EN
| ADXL_TAP_Z_EN
,
222 .act_axis_control
= 0xFF,
223 .activity_threshold
= 5,
224 .inactivity_threshold
= 3,
225 .inactivity_time
= 4,
226 .free_fall_threshold
= 0x7,
227 .free_fall_time
= 0x20,
229 .data_range
= ADXL_FULL_RES
,
232 .ev_code_x
= ABS_X
, /* EV_REL */
233 .ev_code_y
= ABS_Y
, /* EV_REL */
234 .ev_code_z
= ABS_Z
, /* EV_REL */
236 .ev_code_tap_x
= BTN_TOUCH
, /* EV_KEY */
237 .ev_code_tap_y
= BTN_TOUCH
, /* EV_KEY */
238 .ev_code_tap_z
= BTN_TOUCH
, /* EV_KEY */
240 /* .ev_code_ff = KEY_F,*/ /* EV_KEY */
241 /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
242 .power_mode
= ADXL_AUTO_SLEEP
| ADXL_LINK
,
243 .fifo_mode
= ADXL_FIFO_STREAM
,
247 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
248 static struct platform_device rtc_device
= {
254 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
255 static struct resource bfin_uart_resources
[] = {
256 #ifdef CONFIG_SERIAL_BFIN_UART0
260 .flags
= IORESOURCE_MEM
,
263 #ifdef CONFIG_SERIAL_BFIN_UART1
267 .flags
= IORESOURCE_MEM
,
270 #ifdef CONFIG_SERIAL_BFIN_UART2
274 .flags
= IORESOURCE_MEM
,
277 #ifdef CONFIG_SERIAL_BFIN_UART3
281 .flags
= IORESOURCE_MEM
,
286 static struct platform_device bfin_uart_device
= {
289 .num_resources
= ARRAY_SIZE(bfin_uart_resources
),
290 .resource
= bfin_uart_resources
,
294 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
295 #ifdef CONFIG_BFIN_SIR0
296 static struct resource bfin_sir0_resources
[] = {
300 .flags
= IORESOURCE_MEM
,
303 .start
= IRQ_UART0_RX
,
304 .end
= IRQ_UART0_RX
+1,
305 .flags
= IORESOURCE_IRQ
,
308 .start
= CH_UART0_RX
,
309 .end
= CH_UART0_RX
+1,
310 .flags
= IORESOURCE_DMA
,
313 static struct platform_device bfin_sir0_device
= {
316 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
317 .resource
= bfin_sir0_resources
,
320 #ifdef CONFIG_BFIN_SIR1
321 static struct resource bfin_sir1_resources
[] = {
325 .flags
= IORESOURCE_MEM
,
328 .start
= IRQ_UART1_RX
,
329 .end
= IRQ_UART1_RX
+1,
330 .flags
= IORESOURCE_IRQ
,
333 .start
= CH_UART1_RX
,
334 .end
= CH_UART1_RX
+1,
335 .flags
= IORESOURCE_DMA
,
338 static struct platform_device bfin_sir1_device
= {
341 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
342 .resource
= bfin_sir1_resources
,
345 #ifdef CONFIG_BFIN_SIR2
346 static struct resource bfin_sir2_resources
[] = {
350 .flags
= IORESOURCE_MEM
,
353 .start
= IRQ_UART2_RX
,
354 .end
= IRQ_UART2_RX
+1,
355 .flags
= IORESOURCE_IRQ
,
358 .start
= CH_UART2_RX
,
359 .end
= CH_UART2_RX
+1,
360 .flags
= IORESOURCE_DMA
,
363 static struct platform_device bfin_sir2_device
= {
366 .num_resources
= ARRAY_SIZE(bfin_sir2_resources
),
367 .resource
= bfin_sir2_resources
,
370 #ifdef CONFIG_BFIN_SIR3
371 static struct resource bfin_sir3_resources
[] = {
375 .flags
= IORESOURCE_MEM
,
378 .start
= IRQ_UART3_RX
,
379 .end
= IRQ_UART3_RX
+1,
380 .flags
= IORESOURCE_IRQ
,
383 .start
= CH_UART3_RX
,
384 .end
= CH_UART3_RX
+1,
385 .flags
= IORESOURCE_DMA
,
388 static struct platform_device bfin_sir3_device
= {
391 .num_resources
= ARRAY_SIZE(bfin_sir3_resources
),
392 .resource
= bfin_sir3_resources
,
397 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
398 #include <linux/smsc911x.h>
400 static struct resource smsc911x_resources
[] = {
402 .name
= "smsc911x-memory",
404 .end
= 0x24000000 + 0xFF,
405 .flags
= IORESOURCE_MEM
,
410 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
414 static struct smsc911x_platform_config smsc911x_config
= {
415 .flags
= SMSC911X_USE_32BIT
,
416 .irq_polarity
= SMSC911X_IRQ_POLARITY_ACTIVE_LOW
,
417 .irq_type
= SMSC911X_IRQ_TYPE_OPEN_DRAIN
,
418 .phy_interface
= PHY_INTERFACE_MODE_MII
,
421 static struct platform_device smsc911x_device
= {
424 .num_resources
= ARRAY_SIZE(smsc911x_resources
),
425 .resource
= smsc911x_resources
,
427 .platform_data
= &smsc911x_config
,
432 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
433 static struct resource musb_resources
[] = {
437 .flags
= IORESOURCE_MEM
,
439 [1] = { /* general IRQ */
440 .start
= IRQ_USB_INT0
,
442 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
444 [2] = { /* DMA IRQ */
445 .start
= IRQ_USB_DMA
,
447 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
451 static struct musb_hdrc_config musb_config
= {
458 .gpio_vrsel
= GPIO_PE7
,
461 static struct musb_hdrc_platform_data musb_plat
= {
462 #if defined(CONFIG_USB_MUSB_OTG)
464 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
466 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
467 .mode
= MUSB_PERIPHERAL
,
469 .config
= &musb_config
,
472 static u64 musb_dmamask
= ~(u32
)0;
474 static struct platform_device musb_device
= {
478 .dma_mask
= &musb_dmamask
,
479 .coherent_dma_mask
= 0xffffffff,
480 .platform_data
= &musb_plat
,
482 .num_resources
= ARRAY_SIZE(musb_resources
),
483 .resource
= musb_resources
,
487 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
488 static struct resource bfin_atapi_resources
[] = {
492 .flags
= IORESOURCE_MEM
,
495 .start
= IRQ_ATAPI_ERR
,
496 .end
= IRQ_ATAPI_ERR
,
497 .flags
= IORESOURCE_IRQ
,
501 static struct platform_device bfin_atapi_device
= {
502 .name
= "pata-bf54x",
504 .num_resources
= ARRAY_SIZE(bfin_atapi_resources
),
505 .resource
= bfin_atapi_resources
,
509 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
510 static struct mtd_partition partition_info
[] = {
512 .name
= "linux kernel(nand)",
514 .size
= 4 * 1024 * 1024,
517 .name
= "file system(nand)",
518 .offset
= MTDPART_OFS_APPEND
,
519 .size
= MTDPART_SIZ_FULL
,
523 static struct bf5xx_nand_platform bf5xx_nand_platform
= {
524 .page_size
= NFC_PG_SIZE_256
,
525 .data_width
= NFC_NWIDTH_8
,
526 .partitions
= partition_info
,
527 .nr_partitions
= ARRAY_SIZE(partition_info
),
532 static struct resource bf5xx_nand_resources
[] = {
536 .flags
= IORESOURCE_MEM
,
541 .flags
= IORESOURCE_IRQ
,
545 static struct platform_device bf5xx_nand_device
= {
546 .name
= "bf5xx-nand",
548 .num_resources
= ARRAY_SIZE(bf5xx_nand_resources
),
549 .resource
= bf5xx_nand_resources
,
551 .platform_data
= &bf5xx_nand_platform
,
556 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
558 static struct bfin_sd_host bfin_sdh_data
= {
560 .irq_int0
= IRQ_SDH_MASK0
,
561 .pin_req
= {P_SD_D0
, P_SD_D1
, P_SD_D2
, P_SD_D3
, P_SD_CLK
, P_SD_CMD
, 0},
564 static struct platform_device bf54x_sdh_device
= {
568 .platform_data
= &bfin_sdh_data
,
573 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
574 static struct mtd_partition ezkit_partitions
[] = {
576 .name
= "bootloader(nor)",
580 .name
= "linux kernel(nor)",
582 .offset
= MTDPART_OFS_APPEND
,
584 .name
= "file system(nor)",
585 .size
= MTDPART_SIZ_FULL
,
586 .offset
= MTDPART_OFS_APPEND
,
590 static struct physmap_flash_data ezkit_flash_data
= {
592 .parts
= ezkit_partitions
,
593 .nr_parts
= ARRAY_SIZE(ezkit_partitions
),
596 static struct resource ezkit_flash_resource
= {
599 .flags
= IORESOURCE_MEM
,
602 static struct platform_device ezkit_flash_device
= {
603 .name
= "physmap-flash",
606 .platform_data
= &ezkit_flash_data
,
609 .resource
= &ezkit_flash_resource
,
613 #if defined(CONFIG_MTD_M25P80) \
614 || defined(CONFIG_MTD_M25P80_MODULE)
615 /* SPI flash chip (m25p16) */
616 static struct mtd_partition bfin_spi_flash_partitions
[] = {
618 .name
= "bootloader(spi)",
621 .mask_flags
= MTD_CAP_ROM
623 .name
= "linux kernel(spi)",
624 .size
= MTDPART_SIZ_FULL
,
625 .offset
= MTDPART_OFS_APPEND
,
629 static struct flash_platform_data bfin_spi_flash_data
= {
631 .parts
= bfin_spi_flash_partitions
,
632 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
636 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
637 .enable_dma
= 0, /* use dma transfer with this chip*/
639 .cs_change_per_word
= 0,
643 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
644 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
645 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
651 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
652 static struct bfin5xx_spi_chip spi_ad7877_chip_info
= {
653 .cs_change_per_word
= 0,
658 static const struct ad7877_platform_data bfin_ad7877_ts_info
= {
660 .vref_delay_usecs
= 50, /* internal, no capacitor */
663 .pressure_max
= 1000,
665 .stopacq_polarity
= 1,
666 .first_conversion_delay
= 3,
667 .acquisition_time
= 1,
669 .pen_down_acc_interval
= 1,
673 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
674 static struct bfin5xx_spi_chip spidev_chip_info
= {
680 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
681 static struct bfin5xx_spi_chip spi_adxl34x_chip_info
= {
682 .enable_dma
= 0, /* use dma transfer with this chip*/
684 .cs_change_per_word
= 0,
688 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
689 #if defined(CONFIG_MTD_M25P80) \
690 || defined(CONFIG_MTD_M25P80_MODULE)
692 /* the modalias must be the same as spi device driver name */
693 .modalias
= "m25p80", /* Name of spi_driver for this device */
694 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
695 .bus_num
= 0, /* Framework bus number */
696 .chip_select
= 1, /* SPI_SSEL1*/
697 .platform_data
= &bfin_spi_flash_data
,
698 .controller_data
= &spi_flash_chip_info
,
702 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
703 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
705 .modalias
= "ad1836-spi",
706 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
708 .chip_select
= CONFIG_SND_BLACKFIN_SPI_PFBIT
,
709 .controller_data
= &ad1836_spi_chip_info
,
712 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
714 .modalias
= "ad7877",
715 .platform_data
= &bfin_ad7877_ts_info
,
716 .irq
= IRQ_PB4
, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
717 .max_speed_hz
= 12500000, /* max spi clock (SCK) speed in HZ */
720 .controller_data
= &spi_ad7877_chip_info
,
723 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
725 .modalias
= "spidev",
726 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
729 .controller_data
= &spidev_chip_info
,
732 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
734 .modalias
= "adxl34x",
735 .platform_data
= &adxl34x_info
,
737 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
740 .controller_data
= &spi_adxl34x_chip_info
,
745 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
747 static struct resource bfin_spi0_resource
[] = {
749 .start
= SPI0_REGBASE
,
750 .end
= SPI0_REGBASE
+ 0xFF,
751 .flags
= IORESOURCE_MEM
,
756 .flags
= IORESOURCE_DMA
,
761 .flags
= IORESOURCE_IRQ
,
766 static struct resource bfin_spi1_resource
[] = {
768 .start
= SPI1_REGBASE
,
769 .end
= SPI1_REGBASE
+ 0xFF,
770 .flags
= IORESOURCE_MEM
,
775 .flags
= IORESOURCE_DMA
,
780 .flags
= IORESOURCE_IRQ
,
784 /* SPI controller data */
785 static struct bfin5xx_spi_master bf54x_spi_master_info0
= {
787 .enable_dma
= 1, /* master has the ability to do dma transfer */
788 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
791 static struct platform_device bf54x_spi_master0
= {
793 .id
= 0, /* Bus number */
794 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
795 .resource
= bfin_spi0_resource
,
797 .platform_data
= &bf54x_spi_master_info0
, /* Passed to driver */
801 static struct bfin5xx_spi_master bf54x_spi_master_info1
= {
803 .enable_dma
= 1, /* master has the ability to do dma transfer */
804 .pin_req
= {P_SPI1_SCK
, P_SPI1_MISO
, P_SPI1_MOSI
, 0},
807 static struct platform_device bf54x_spi_master1
= {
809 .id
= 1, /* Bus number */
810 .num_resources
= ARRAY_SIZE(bfin_spi1_resource
),
811 .resource
= bfin_spi1_resource
,
813 .platform_data
= &bf54x_spi_master_info1
, /* Passed to driver */
816 #endif /* spi master and devices */
818 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
819 static struct resource bfin_twi0_resource
[] = {
821 .start
= TWI0_REGBASE
,
822 .end
= TWI0_REGBASE
+ 0xFF,
823 .flags
= IORESOURCE_MEM
,
828 .flags
= IORESOURCE_IRQ
,
832 static struct platform_device i2c_bfin_twi0_device
= {
833 .name
= "i2c-bfin-twi",
835 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
836 .resource
= bfin_twi0_resource
,
839 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
840 static struct resource bfin_twi1_resource
[] = {
842 .start
= TWI1_REGBASE
,
843 .end
= TWI1_REGBASE
+ 0xFF,
844 .flags
= IORESOURCE_MEM
,
849 .flags
= IORESOURCE_IRQ
,
853 static struct platform_device i2c_bfin_twi1_device
= {
854 .name
= "i2c-bfin-twi",
856 .num_resources
= ARRAY_SIZE(bfin_twi1_resource
),
857 .resource
= bfin_twi1_resource
,
862 static struct i2c_board_info __initdata bfin_i2c_board_info0
[] = {
865 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
866 static struct i2c_board_info __initdata bfin_i2c_board_info1
[] = {
867 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
869 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
872 #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
874 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
878 #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
880 I2C_BOARD_INFO("adxl34x", 0x53),
882 .platform_data
= (void *)&adxl34x_info
,
888 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
889 #include <linux/gpio_keys.h>
891 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
892 {BTN_0
, GPIO_PB8
, 1, "gpio-keys: BTN0"},
893 {BTN_1
, GPIO_PB9
, 1, "gpio-keys: BTN1"},
894 {BTN_2
, GPIO_PB10
, 1, "gpio-keys: BTN2"},
895 {BTN_3
, GPIO_PB11
, 1, "gpio-keys: BTN3"},
898 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
899 .buttons
= bfin_gpio_keys_table
,
900 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
903 static struct platform_device bfin_device_gpiokeys
= {
906 .platform_data
= &bfin_gpio_keys_data
,
911 static struct resource bfin_gpios_resources
= {
913 .end
= MAX_BLACKFIN_GPIOS
- 1,
914 .flags
= IORESOURCE_IRQ
,
917 static struct platform_device bfin_gpios_device
= {
918 .name
= "simple-gpio",
921 .resource
= &bfin_gpios_resources
,
924 static const unsigned int cclk_vlev_datasheet
[] =
927 * Internal VLEV BF54XSBBC1533
928 ****temporarily using these values until data sheet is updated
930 VRPAIR(VLEV_085
, 150000000),
931 VRPAIR(VLEV_090
, 250000000),
932 VRPAIR(VLEV_110
, 276000000),
933 VRPAIR(VLEV_115
, 301000000),
934 VRPAIR(VLEV_120
, 525000000),
935 VRPAIR(VLEV_125
, 550000000),
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
*ezkit_devices
[] __initdata
= {
956 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
960 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
964 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
965 #ifdef CONFIG_BFIN_SIR0
968 #ifdef CONFIG_BFIN_SIR1
971 #ifdef CONFIG_BFIN_SIR2
974 #ifdef CONFIG_BFIN_SIR3
979 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
983 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
987 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
991 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
992 &bfin_isp1760_device
,
995 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
999 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
1003 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
1007 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1012 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
1016 #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
1017 &bfin_rotary_device
,
1020 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1021 &i2c_bfin_twi0_device
,
1022 #if !defined(CONFIG_BF542)
1023 &i2c_bfin_twi1_device
,
1027 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1028 &bfin_device_gpiokeys
,
1033 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1034 &ezkit_flash_device
,
1038 static int __init
ezkit_init(void)
1040 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
1042 i2c_register_board_info(0, bfin_i2c_board_info0
,
1043 ARRAY_SIZE(bfin_i2c_board_info0
));
1044 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1045 i2c_register_board_info(1, bfin_i2c_board_info1
,
1046 ARRAY_SIZE(bfin_i2c_board_info1
));
1049 platform_add_devices(ezkit_devices
, ARRAY_SIZE(ezkit_devices
));
1051 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
1056 arch_initcall(ezkit_init
);