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
[] = "ADI BF527-EZKIT";
60 * Driver needs to know address, irq and flag pin.
63 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
64 #include <linux/usb/isp1760.h>
65 static struct resource bfin_isp1760_resources
[] = {
68 .end
= 0x203C0000 + 0x000fffff,
69 .flags
= IORESOURCE_MEM
,
74 .flags
= IORESOURCE_IRQ
,
78 static struct isp1760_platform_data isp1760_priv
= {
83 .dack_polarity_high
= 0,
84 .dreq_polarity_high
= 0,
87 static struct platform_device bfin_isp1760_device
= {
88 .name
= "isp1760-hcd",
91 .platform_data
= &isp1760_priv
,
93 .num_resources
= ARRAY_SIZE(bfin_isp1760_resources
),
94 .resource
= bfin_isp1760_resources
,
98 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
99 static struct resource musb_resources
[] = {
103 .flags
= IORESOURCE_MEM
,
105 [1] = { /* general IRQ */
106 .start
= IRQ_USB_INT0
,
108 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
110 [2] = { /* DMA IRQ */
111 .start
= IRQ_USB_DMA
,
113 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
117 static struct musb_hdrc_config musb_config
= {
124 .gpio_vrsel
= GPIO_PG13
,
127 static struct musb_hdrc_platform_data musb_plat
= {
128 #if defined(CONFIG_USB_MUSB_OTG)
130 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
132 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
133 .mode
= MUSB_PERIPHERAL
,
135 .config
= &musb_config
,
138 static u64 musb_dmamask
= ~(u32
)0;
140 static struct platform_device musb_device
= {
144 .dma_mask
= &musb_dmamask
,
145 .coherent_dma_mask
= 0xffffffff,
146 .platform_data
= &musb_plat
,
148 .num_resources
= ARRAY_SIZE(musb_resources
),
149 .resource
= musb_resources
,
153 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
155 static struct resource bf52x_t350mcqb_resources
[] = {
157 .start
= IRQ_PPI_ERROR
,
158 .end
= IRQ_PPI_ERROR
,
159 .flags
= IORESOURCE_IRQ
,
163 static struct platform_device bf52x_t350mcqb_device
= {
164 .name
= "bfin-t350mcqb",
166 .num_resources
= ARRAY_SIZE(bf52x_t350mcqb_resources
),
167 .resource
= bf52x_t350mcqb_resources
,
171 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
172 static struct mtd_partition ezkit_partitions
[] = {
174 .name
= "bootloader(nor)",
178 .name
= "linux kernel(nor)",
180 .offset
= MTDPART_OFS_APPEND
,
182 .name
= "file system(nor)",
183 .size
= MTDPART_SIZ_FULL
,
184 .offset
= MTDPART_OFS_APPEND
,
188 static struct physmap_flash_data ezkit_flash_data
= {
190 .parts
= ezkit_partitions
,
191 .nr_parts
= ARRAY_SIZE(ezkit_partitions
),
194 static struct resource ezkit_flash_resource
= {
197 .flags
= IORESOURCE_MEM
,
200 static struct platform_device ezkit_flash_device
= {
201 .name
= "physmap-flash",
204 .platform_data
= &ezkit_flash_data
,
207 .resource
= &ezkit_flash_resource
,
211 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
212 static struct mtd_partition partition_info
[] = {
214 .name
= "linux kernel(nand)",
216 .size
= 4 * 1024 * 1024,
219 .name
= "file system(nand)",
220 .offset
= MTDPART_OFS_APPEND
,
221 .size
= MTDPART_SIZ_FULL
,
225 static struct bf5xx_nand_platform bf5xx_nand_platform
= {
226 .page_size
= NFC_PG_SIZE_256
,
227 .data_width
= NFC_NWIDTH_8
,
228 .partitions
= partition_info
,
229 .nr_partitions
= ARRAY_SIZE(partition_info
),
234 static struct resource bf5xx_nand_resources
[] = {
237 .end
= NFC_DATA_RD
+ 2,
238 .flags
= IORESOURCE_MEM
,
243 .flags
= IORESOURCE_IRQ
,
247 static struct platform_device bf5xx_nand_device
= {
248 .name
= "bf5xx-nand",
250 .num_resources
= ARRAY_SIZE(bf5xx_nand_resources
),
251 .resource
= bf5xx_nand_resources
,
253 .platform_data
= &bf5xx_nand_platform
,
258 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
259 static struct resource bfin_pcmcia_cf_resources
[] = {
261 .start
= 0x20310000, /* IO PORT */
263 .flags
= IORESOURCE_MEM
,
265 .start
= 0x20311000, /* Attribute Memory */
267 .flags
= IORESOURCE_MEM
,
271 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
273 .start
= 6, /* Card Detect PF6 */
275 .flags
= IORESOURCE_IRQ
,
279 static struct platform_device bfin_pcmcia_cf_device
= {
280 .name
= "bfin_cf_pcmcia",
282 .num_resources
= ARRAY_SIZE(bfin_pcmcia_cf_resources
),
283 .resource
= bfin_pcmcia_cf_resources
,
287 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
288 static struct platform_device rtc_device
= {
294 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
295 #include <linux/smc91x.h>
297 static struct smc91x_platdata smc91x_info
= {
298 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
299 .leda
= RPC_LED_100_10
,
300 .ledb
= RPC_LED_TX_RX
,
303 static struct resource smc91x_resources
[] = {
305 .name
= "smc91x-regs",
307 .end
= 0x20300300 + 16,
308 .flags
= IORESOURCE_MEM
,
313 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
316 static struct platform_device smc91x_device
= {
319 .num_resources
= ARRAY_SIZE(smc91x_resources
),
320 .resource
= smc91x_resources
,
322 .platform_data
= &smc91x_info
,
327 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
328 static struct resource dm9000_resources
[] = {
331 .end
= 0x203FB800 + 1,
332 .flags
= IORESOURCE_MEM
,
335 .start
= 0x203FB800 + 4,
336 .end
= 0x203FB800 + 5,
337 .flags
= IORESOURCE_MEM
,
342 .flags
= (IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHEDGE
),
346 static struct platform_device dm9000_device
= {
349 .num_resources
= ARRAY_SIZE(dm9000_resources
),
350 .resource
= dm9000_resources
,
354 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
355 static struct resource sl811_hcd_resources
[] = {
359 .flags
= IORESOURCE_MEM
,
363 .flags
= IORESOURCE_MEM
,
365 .start
= CONFIG_USB_SL811_BFIN_IRQ
,
366 .end
= CONFIG_USB_SL811_BFIN_IRQ
,
367 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
371 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
372 void sl811_port_power(struct device
*dev
, int is_on
)
374 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, "usb:SL811_VBUS");
375 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, is_on
);
379 static struct sl811_platform_data sl811_priv
= {
381 .power
= 250, /* == 500mA */
382 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
383 .port_power
= &sl811_port_power
,
387 static struct platform_device sl811_hcd_device
= {
391 .platform_data
= &sl811_priv
,
393 .num_resources
= ARRAY_SIZE(sl811_hcd_resources
),
394 .resource
= sl811_hcd_resources
,
398 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
399 static struct resource isp1362_hcd_resources
[] = {
403 .flags
= IORESOURCE_MEM
,
407 .flags
= IORESOURCE_MEM
,
409 .start
= CONFIG_USB_ISP1362_BFIN_GPIO_IRQ
,
410 .end
= CONFIG_USB_ISP1362_BFIN_GPIO_IRQ
,
411 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
415 static struct isp1362_platform_data isp1362_priv
= {
420 .int_edge_triggered
= 0,
421 .remote_wakeup_connected
= 0,
422 .no_power_switching
= 1,
423 .power_switching_mode
= 0,
426 static struct platform_device isp1362_hcd_device
= {
427 .name
= "isp1362-hcd",
430 .platform_data
= &isp1362_priv
,
432 .num_resources
= ARRAY_SIZE(isp1362_hcd_resources
),
433 .resource
= isp1362_hcd_resources
,
437 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
438 static struct platform_device bfin_mii_bus
= {
439 .name
= "bfin_mii_bus",
442 static struct platform_device bfin_mac_device
= {
444 .dev
.platform_data
= &bfin_mii_bus
,
448 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
449 static struct resource net2272_bfin_resources
[] = {
452 .end
= 0x20300000 + 0x100,
453 .flags
= IORESOURCE_MEM
,
457 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
461 static struct platform_device net2272_bfin_device
= {
464 .num_resources
= ARRAY_SIZE(net2272_bfin_resources
),
465 .resource
= net2272_bfin_resources
,
469 #if defined(CONFIG_MTD_M25P80) \
470 || defined(CONFIG_MTD_M25P80_MODULE)
471 static struct mtd_partition bfin_spi_flash_partitions
[] = {
473 .name
= "bootloader(spi)",
476 .mask_flags
= MTD_CAP_ROM
478 .name
= "linux kernel(spi)",
479 .size
= MTDPART_SIZ_FULL
,
480 .offset
= MTDPART_OFS_APPEND
,
484 static struct flash_platform_data bfin_spi_flash_data
= {
486 .parts
= bfin_spi_flash_partitions
,
487 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
491 /* SPI flash chip (m25p64) */
492 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
493 .enable_dma
= 0, /* use dma transfer with this chip*/
498 #if defined(CONFIG_BFIN_SPI_ADC) \
499 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
501 static struct bfin5xx_spi_chip spi_adc_chip_info
= {
502 .enable_dma
= 1, /* use dma transfer with this chip*/
507 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
508 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
509 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
515 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
516 static struct bfin5xx_spi_chip mmc_spi_chip_info
= {
522 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
523 static struct bfin5xx_spi_chip spi_ad7877_chip_info
= {
528 static const struct ad7877_platform_data bfin_ad7877_ts_info
= {
530 .vref_delay_usecs
= 50, /* internal, no capacitor */
533 .pressure_max
= 1000,
535 .stopacq_polarity
= 1,
536 .first_conversion_delay
= 3,
537 .acquisition_time
= 1,
539 .pen_down_acc_interval
= 1,
543 #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
544 #include <linux/spi/ad7879.h>
545 static const struct ad7879_platform_data bfin_ad7879_ts_info
= {
546 .model
= 7879, /* Model = AD7879 */
547 .x_plate_ohms
= 620, /* 620 Ohm from the touch datasheet */
548 .pressure_max
= 10000,
550 .first_conversion_delay
= 3, /* wait 512us before do a first conversion */
551 .acquisition_time
= 1, /* 4us acquisition time per sample */
552 .median
= 2, /* do 8 measurements */
553 .averaging
= 1, /* take the average of 4 middle samples */
554 .pen_down_acc_interval
= 255, /* 9.4 ms */
555 .gpio_output
= 1, /* configure AUX/VBAT/GPIO as GPIO output */
556 .gpio_default
= 1, /* During initialization set GPIO = HIGH */
560 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
561 static struct bfin5xx_spi_chip spi_ad7879_chip_info
= {
567 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
568 && defined(CONFIG_SND_SOC_WM8731_SPI)
569 static struct bfin5xx_spi_chip spi_wm8731_chip_info
= {
575 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
576 static struct bfin5xx_spi_chip spidev_chip_info
= {
582 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
583 #if defined(CONFIG_MTD_M25P80) \
584 || defined(CONFIG_MTD_M25P80_MODULE)
586 /* the modalias must be the same as spi device driver name */
587 .modalias
= "m25p80", /* Name of spi_driver for this device */
588 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
589 .bus_num
= 0, /* Framework bus number */
590 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
591 .platform_data
= &bfin_spi_flash_data
,
592 .controller_data
= &spi_flash_chip_info
,
597 #if defined(CONFIG_BFIN_SPI_ADC) \
598 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
600 .modalias
= "bfin_spi_adc", /* Name of spi_driver for this device */
601 .max_speed_hz
= 6250000, /* max spi clock (SCK) speed in HZ */
602 .bus_num
= 0, /* Framework bus number */
603 .chip_select
= 1, /* Framework chip select. */
604 .platform_data
= NULL
, /* No spi_driver specific config */
605 .controller_data
= &spi_adc_chip_info
,
609 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
610 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
612 .modalias
= "ad1836",
613 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
615 .chip_select
= CONFIG_SND_BLACKFIN_SPI_PFBIT
,
616 .controller_data
= &ad1836_spi_chip_info
,
619 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
621 .modalias
= "mmc_spi",
622 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
625 .controller_data
= &mmc_spi_chip_info
,
630 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
632 .modalias
= "ad7877",
633 .platform_data
= &bfin_ad7877_ts_info
,
635 .max_speed_hz
= 12500000, /* max spi clock (SCK) speed in HZ */
638 .controller_data
= &spi_ad7877_chip_info
,
641 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
643 .modalias
= "ad7879",
644 .platform_data
= &bfin_ad7879_ts_info
,
646 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
649 .controller_data
= &spi_ad7879_chip_info
,
650 .mode
= SPI_CPHA
| SPI_CPOL
,
653 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
654 && defined(CONFIG_SND_SOC_WM8731_SPI)
656 .modalias
= "wm8731",
657 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
660 .controller_data
= &spi_wm8731_chip_info
,
664 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
666 .modalias
= "spidev",
667 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
670 .controller_data
= &spidev_chip_info
,
675 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
676 /* SPI controller data */
677 static struct bfin5xx_spi_master bfin_spi0_info
= {
679 .enable_dma
= 1, /* master has the ability to do dma transfer */
680 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
684 static struct resource bfin_spi0_resource
[] = {
686 .start
= SPI0_REGBASE
,
687 .end
= SPI0_REGBASE
+ 0xFF,
688 .flags
= IORESOURCE_MEM
,
693 .flags
= IORESOURCE_DMA
,
698 .flags
= IORESOURCE_IRQ
,
702 static struct platform_device bfin_spi0_device
= {
704 .id
= 0, /* Bus number */
705 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
706 .resource
= bfin_spi0_resource
,
708 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
711 #endif /* spi master and devices */
713 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
714 static struct platform_device bfin_fb_device
= {
715 .name
= "bf537-lq035",
719 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
720 static struct platform_device bfin_fb_adv7393_device
= {
721 .name
= "bfin-adv7393",
725 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
726 static struct resource bfin_uart_resources
[] = {
727 #ifdef CONFIG_SERIAL_BFIN_UART0
731 .flags
= IORESOURCE_MEM
,
734 #ifdef CONFIG_SERIAL_BFIN_UART1
738 .flags
= IORESOURCE_MEM
,
743 static struct platform_device bfin_uart_device
= {
746 .num_resources
= ARRAY_SIZE(bfin_uart_resources
),
747 .resource
= bfin_uart_resources
,
751 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
752 #ifdef CONFIG_BFIN_SIR0
753 static struct resource bfin_sir0_resources
[] = {
757 .flags
= IORESOURCE_MEM
,
760 .start
= IRQ_UART0_RX
,
761 .end
= IRQ_UART0_RX
+1,
762 .flags
= IORESOURCE_IRQ
,
765 .start
= CH_UART0_RX
,
766 .end
= CH_UART0_RX
+1,
767 .flags
= IORESOURCE_DMA
,
771 static struct platform_device bfin_sir0_device
= {
774 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
775 .resource
= bfin_sir0_resources
,
778 #ifdef CONFIG_BFIN_SIR1
779 static struct resource bfin_sir1_resources
[] = {
783 .flags
= IORESOURCE_MEM
,
786 .start
= IRQ_UART1_RX
,
787 .end
= IRQ_UART1_RX
+1,
788 .flags
= IORESOURCE_IRQ
,
791 .start
= CH_UART1_RX
,
792 .end
= CH_UART1_RX
+1,
793 .flags
= IORESOURCE_DMA
,
797 static struct platform_device bfin_sir1_device
= {
800 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
801 .resource
= bfin_sir1_resources
,
806 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
807 static struct resource bfin_twi0_resource
[] = {
809 .start
= TWI0_REGBASE
,
811 .flags
= IORESOURCE_MEM
,
816 .flags
= IORESOURCE_IRQ
,
820 static struct platform_device i2c_bfin_twi_device
= {
821 .name
= "i2c-bfin-twi",
823 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
824 .resource
= bfin_twi0_resource
,
828 static struct i2c_board_info __initdata bfin_i2c_board_info
[] = {
829 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
831 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
834 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
836 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
842 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
843 static struct platform_device bfin_sport0_uart_device
= {
844 .name
= "bfin-sport-uart",
848 static struct platform_device bfin_sport1_uart_device
= {
849 .name
= "bfin-sport-uart",
854 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
855 #include <linux/input.h>
856 #include <linux/gpio_keys.h>
858 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
859 {BTN_0
, GPIO_PG0
, 1, "gpio-keys: BTN0"},
860 {BTN_1
, GPIO_PG13
, 1, "gpio-keys: BTN1"},
863 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
864 .buttons
= bfin_gpio_keys_table
,
865 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
868 static struct platform_device bfin_device_gpiokeys
= {
871 .platform_data
= &bfin_gpio_keys_data
,
876 #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
877 #include <linux/input.h>
878 #include <asm/bfin_rotary.h>
880 static struct bfin_rotary_platform_data bfin_rotary_data
= {
881 /*.rotary_up_key = KEY_UP,*/
882 /*.rotary_down_key = KEY_DOWN,*/
883 .rotary_rel_code
= REL_WHEEL
,
884 .rotary_button_key
= KEY_ENTER
,
885 .debounce
= 10, /* 0..17 */
886 .mode
= ROT_QUAD_ENC
| ROT_DEBE
,
889 static struct resource bfin_rotary_resources
[] = {
893 .flags
= IORESOURCE_IRQ
,
897 static struct platform_device bfin_rotary_device
= {
898 .name
= "bfin-rotary",
900 .num_resources
= ARRAY_SIZE(bfin_rotary_resources
),
901 .resource
= bfin_rotary_resources
,
903 .platform_data
= &bfin_rotary_data
,
908 static struct resource bfin_gpios_resources
= {
910 .end
= MAX_BLACKFIN_GPIOS
- 1,
911 .flags
= IORESOURCE_IRQ
,
914 static struct platform_device bfin_gpios_device
= {
915 .name
= "simple-gpio",
918 .resource
= &bfin_gpios_resources
,
921 static const unsigned int cclk_vlev_datasheet
[] =
923 VRPAIR(VLEV_100
, 400000000),
924 VRPAIR(VLEV_105
, 426000000),
925 VRPAIR(VLEV_110
, 500000000),
926 VRPAIR(VLEV_115
, 533000000),
927 VRPAIR(VLEV_120
, 600000000),
930 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
931 .tuple_tab
= cclk_vlev_datasheet
,
932 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
933 .vr_settling_time
= 25 /* us */,
936 static struct platform_device bfin_dpmc
= {
939 .platform_data
= &bfin_dmpc_vreg_data
,
943 static struct platform_device
*stamp_devices
[] __initdata
= {
947 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
951 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
952 &bfin_pcmcia_cf_device
,
955 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
959 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
963 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
967 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
968 &bfin_isp1760_device
,
971 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
975 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
979 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
983 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
988 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
989 &net2272_bfin_device
,
992 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
996 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1000 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
1001 &bf52x_t350mcqb_device
,
1004 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
1005 &bfin_fb_adv7393_device
,
1008 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1012 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1013 #ifdef CONFIG_BFIN_SIR0
1016 #ifdef CONFIG_BFIN_SIR1
1021 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1022 &i2c_bfin_twi_device
,
1025 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1026 &bfin_sport0_uart_device
,
1027 &bfin_sport1_uart_device
,
1030 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1031 &bfin_device_gpiokeys
,
1034 #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
1035 &bfin_rotary_device
,
1038 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1039 &ezkit_flash_device
,
1045 static int __init
ezkit_init(void)
1047 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
1048 i2c_register_board_info(0, bfin_i2c_board_info
,
1049 ARRAY_SIZE(bfin_i2c_board_info
));
1050 platform_add_devices(stamp_devices
, ARRAY_SIZE(stamp_devices
));
1051 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
1055 arch_initcall(ezkit_init
);
1057 void native_machine_restart(char *cmd
)
1059 /* workaround reboot hang when booting from SPI */
1060 if ((bfin_read_SYSCR() & 0x7) == 0x3)
1061 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS
);
1064 void bfin_get_ether_addr(char *addr
)
1066 /* the MAC is stored in OTP memory page 0xDF */
1069 u32 (*otp_read
)(u32 page
, u32 flags
, u64
*page_content
) = (void *)0xEF00001A;
1071 ret
= otp_read(0xDF, 0x00, &otp_mac
);
1073 char *otp_mac_p
= (char *)&otp_mac
;
1074 for (ret
= 0; ret
< 6; ++ret
)
1075 addr
[ret
] = otp_mac_p
[5 - ret
];
1078 EXPORT_SYMBOL(bfin_get_ether_addr
);