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/i2c.h>
17 #include <linux/irq.h>
18 #include <linux/interrupt.h>
19 #include <linux/usb/sl811.h>
20 #include <linux/usb/musb.h>
22 #include <asm/bfin5xx_spi.h>
23 #include <asm/reboot.h>
25 #include <asm/portmux.h>
27 #include <linux/spi/ad7877.h>
30 * Name the Board for the /proc/cpuinfo
32 const char bfin_board_name
[] = "ADI BF527-EZKIT";
35 * Driver needs to know address, irq and flag pin.
38 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
39 #include <linux/usb/isp1760.h>
40 static struct resource bfin_isp1760_resources
[] = {
43 .end
= 0x203C0000 + 0x000fffff,
44 .flags
= IORESOURCE_MEM
,
49 .flags
= IORESOURCE_IRQ
,
53 static struct isp1760_platform_data isp1760_priv
= {
58 .dack_polarity_high
= 0,
59 .dreq_polarity_high
= 0,
62 static struct platform_device bfin_isp1760_device
= {
66 .platform_data
= &isp1760_priv
,
68 .num_resources
= ARRAY_SIZE(bfin_isp1760_resources
),
69 .resource
= bfin_isp1760_resources
,
73 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
74 static struct resource musb_resources
[] = {
78 .flags
= IORESOURCE_MEM
,
80 [1] = { /* general IRQ */
81 .start
= IRQ_USB_INT0
,
83 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
88 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
92 static struct musb_hdrc_config musb_config
= {
99 .gpio_vrsel
= GPIO_PG13
,
102 static struct musb_hdrc_platform_data musb_plat
= {
103 #if defined(CONFIG_USB_MUSB_OTG)
105 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
107 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
108 .mode
= MUSB_PERIPHERAL
,
110 .config
= &musb_config
,
113 static u64 musb_dmamask
= ~(u32
)0;
115 static struct platform_device musb_device
= {
119 .dma_mask
= &musb_dmamask
,
120 .coherent_dma_mask
= 0xffffffff,
121 .platform_data
= &musb_plat
,
123 .num_resources
= ARRAY_SIZE(musb_resources
),
124 .resource
= musb_resources
,
128 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
130 static struct resource bf52x_t350mcqb_resources
[] = {
132 .start
= IRQ_PPI_ERROR
,
133 .end
= IRQ_PPI_ERROR
,
134 .flags
= IORESOURCE_IRQ
,
138 static struct platform_device bf52x_t350mcqb_device
= {
139 .name
= "bfin-t350mcqb",
141 .num_resources
= ARRAY_SIZE(bf52x_t350mcqb_resources
),
142 .resource
= bf52x_t350mcqb_resources
,
146 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
147 static struct mtd_partition ezkit_partitions
[] = {
149 .name
= "bootloader(nor)",
153 .name
= "linux kernel(nor)",
155 .offset
= MTDPART_OFS_APPEND
,
157 .name
= "file system(nor)",
158 .size
= MTDPART_SIZ_FULL
,
159 .offset
= MTDPART_OFS_APPEND
,
163 static struct physmap_flash_data ezkit_flash_data
= {
165 .parts
= ezkit_partitions
,
166 .nr_parts
= ARRAY_SIZE(ezkit_partitions
),
169 static struct resource ezkit_flash_resource
= {
172 .flags
= IORESOURCE_MEM
,
175 static struct platform_device ezkit_flash_device
= {
176 .name
= "physmap-flash",
179 .platform_data
= &ezkit_flash_data
,
182 .resource
= &ezkit_flash_resource
,
186 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
187 static struct mtd_partition partition_info
[] = {
189 .name
= "linux kernel(nand)",
191 .size
= 4 * 1024 * 1024,
194 .name
= "file system(nand)",
195 .offset
= MTDPART_OFS_APPEND
,
196 .size
= MTDPART_SIZ_FULL
,
200 static struct bf5xx_nand_platform bf5xx_nand_platform
= {
201 .page_size
= NFC_PG_SIZE_256
,
202 .data_width
= NFC_NWIDTH_8
,
203 .partitions
= partition_info
,
204 .nr_partitions
= ARRAY_SIZE(partition_info
),
209 static struct resource bf5xx_nand_resources
[] = {
212 .end
= NFC_DATA_RD
+ 2,
213 .flags
= IORESOURCE_MEM
,
218 .flags
= IORESOURCE_IRQ
,
222 static struct platform_device bf5xx_nand_device
= {
223 .name
= "bf5xx-nand",
225 .num_resources
= ARRAY_SIZE(bf5xx_nand_resources
),
226 .resource
= bf5xx_nand_resources
,
228 .platform_data
= &bf5xx_nand_platform
,
233 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
234 static struct resource bfin_pcmcia_cf_resources
[] = {
236 .start
= 0x20310000, /* IO PORT */
238 .flags
= IORESOURCE_MEM
,
240 .start
= 0x20311000, /* Attribute Memory */
242 .flags
= IORESOURCE_MEM
,
246 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
248 .start
= 6, /* Card Detect PF6 */
250 .flags
= IORESOURCE_IRQ
,
254 static struct platform_device bfin_pcmcia_cf_device
= {
255 .name
= "bfin_cf_pcmcia",
257 .num_resources
= ARRAY_SIZE(bfin_pcmcia_cf_resources
),
258 .resource
= bfin_pcmcia_cf_resources
,
262 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
263 static struct platform_device rtc_device
= {
269 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
270 #include <linux/smc91x.h>
272 static struct smc91x_platdata smc91x_info
= {
273 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
274 .leda
= RPC_LED_100_10
,
275 .ledb
= RPC_LED_TX_RX
,
278 static struct resource smc91x_resources
[] = {
280 .name
= "smc91x-regs",
282 .end
= 0x20300300 + 16,
283 .flags
= IORESOURCE_MEM
,
288 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
291 static struct platform_device smc91x_device
= {
294 .num_resources
= ARRAY_SIZE(smc91x_resources
),
295 .resource
= smc91x_resources
,
297 .platform_data
= &smc91x_info
,
302 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
303 static struct resource dm9000_resources
[] = {
306 .end
= 0x203FB800 + 1,
307 .flags
= IORESOURCE_MEM
,
310 .start
= 0x203FB800 + 4,
311 .end
= 0x203FB800 + 5,
312 .flags
= IORESOURCE_MEM
,
317 .flags
= (IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHEDGE
),
321 static struct platform_device dm9000_device
= {
324 .num_resources
= ARRAY_SIZE(dm9000_resources
),
325 .resource
= dm9000_resources
,
329 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
330 static struct resource sl811_hcd_resources
[] = {
334 .flags
= IORESOURCE_MEM
,
338 .flags
= IORESOURCE_MEM
,
340 .start
= CONFIG_USB_SL811_BFIN_IRQ
,
341 .end
= CONFIG_USB_SL811_BFIN_IRQ
,
342 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
346 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
347 void sl811_port_power(struct device
*dev
, int is_on
)
349 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, "usb:SL811_VBUS");
350 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, is_on
);
354 static struct sl811_platform_data sl811_priv
= {
356 .power
= 250, /* == 500mA */
357 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
358 .port_power
= &sl811_port_power
,
362 static struct platform_device sl811_hcd_device
= {
366 .platform_data
= &sl811_priv
,
368 .num_resources
= ARRAY_SIZE(sl811_hcd_resources
),
369 .resource
= sl811_hcd_resources
,
373 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
374 static struct platform_device bfin_mii_bus
= {
375 .name
= "bfin_mii_bus",
378 static struct platform_device bfin_mac_device
= {
380 .dev
.platform_data
= &bfin_mii_bus
,
384 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
385 static struct resource net2272_bfin_resources
[] = {
388 .end
= 0x20300000 + 0x100,
389 .flags
= IORESOURCE_MEM
,
393 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
397 static struct platform_device net2272_bfin_device
= {
400 .num_resources
= ARRAY_SIZE(net2272_bfin_resources
),
401 .resource
= net2272_bfin_resources
,
405 #if defined(CONFIG_MTD_M25P80) \
406 || defined(CONFIG_MTD_M25P80_MODULE)
407 static struct mtd_partition bfin_spi_flash_partitions
[] = {
409 .name
= "bootloader(spi)",
412 .mask_flags
= MTD_CAP_ROM
414 .name
= "linux kernel(spi)",
415 .size
= MTDPART_SIZ_FULL
,
416 .offset
= MTDPART_OFS_APPEND
,
420 static struct flash_platform_data bfin_spi_flash_data
= {
422 .parts
= bfin_spi_flash_partitions
,
423 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
427 /* SPI flash chip (m25p64) */
428 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
429 .enable_dma
= 0, /* use dma transfer with this chip*/
434 #if defined(CONFIG_BFIN_SPI_ADC) \
435 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
437 static struct bfin5xx_spi_chip spi_adc_chip_info
= {
438 .enable_dma
= 1, /* use dma transfer with this chip*/
443 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
444 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
445 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
451 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
452 static struct bfin5xx_spi_chip mmc_spi_chip_info
= {
458 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
459 static struct bfin5xx_spi_chip spi_ad7877_chip_info
= {
464 static const struct ad7877_platform_data bfin_ad7877_ts_info
= {
466 .vref_delay_usecs
= 50, /* internal, no capacitor */
469 .pressure_max
= 1000,
471 .stopacq_polarity
= 1,
472 .first_conversion_delay
= 3,
473 .acquisition_time
= 1,
475 .pen_down_acc_interval
= 1,
479 #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
480 #include <linux/spi/ad7879.h>
481 static const struct ad7879_platform_data bfin_ad7879_ts_info
= {
482 .model
= 7879, /* Model = AD7879 */
483 .x_plate_ohms
= 620, /* 620 Ohm from the touch datasheet */
484 .pressure_max
= 10000,
486 .first_conversion_delay
= 3, /* wait 512us before do a first conversion */
487 .acquisition_time
= 1, /* 4us acquisition time per sample */
488 .median
= 2, /* do 8 measurements */
489 .averaging
= 1, /* take the average of 4 middle samples */
490 .pen_down_acc_interval
= 255, /* 9.4 ms */
491 .gpio_output
= 1, /* configure AUX/VBAT/GPIO as GPIO output */
492 .gpio_default
= 1, /* During initialization set GPIO = HIGH */
496 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
497 static struct bfin5xx_spi_chip spi_ad7879_chip_info
= {
503 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
504 && defined(CONFIG_SND_SOC_WM8731_SPI)
505 static struct bfin5xx_spi_chip spi_wm8731_chip_info
= {
511 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
512 static struct bfin5xx_spi_chip spidev_chip_info
= {
518 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
519 #if defined(CONFIG_MTD_M25P80) \
520 || defined(CONFIG_MTD_M25P80_MODULE)
522 /* the modalias must be the same as spi device driver name */
523 .modalias
= "m25p80", /* Name of spi_driver for this device */
524 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
525 .bus_num
= 0, /* Framework bus number */
526 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
527 .platform_data
= &bfin_spi_flash_data
,
528 .controller_data
= &spi_flash_chip_info
,
533 #if defined(CONFIG_BFIN_SPI_ADC) \
534 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
536 .modalias
= "bfin_spi_adc", /* Name of spi_driver for this device */
537 .max_speed_hz
= 6250000, /* max spi clock (SCK) speed in HZ */
538 .bus_num
= 0, /* Framework bus number */
539 .chip_select
= 1, /* Framework chip select. */
540 .platform_data
= NULL
, /* No spi_driver specific config */
541 .controller_data
= &spi_adc_chip_info
,
545 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
546 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
548 .modalias
= "ad1836",
549 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
551 .chip_select
= CONFIG_SND_BLACKFIN_SPI_PFBIT
,
552 .controller_data
= &ad1836_spi_chip_info
,
555 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
557 .modalias
= "mmc_spi",
558 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
561 .controller_data
= &mmc_spi_chip_info
,
566 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
568 .modalias
= "ad7877",
569 .platform_data
= &bfin_ad7877_ts_info
,
571 .max_speed_hz
= 12500000, /* max spi clock (SCK) speed in HZ */
574 .controller_data
= &spi_ad7877_chip_info
,
577 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
579 .modalias
= "ad7879",
580 .platform_data
= &bfin_ad7879_ts_info
,
582 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
585 .controller_data
= &spi_ad7879_chip_info
,
586 .mode
= SPI_CPHA
| SPI_CPOL
,
589 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
590 && defined(CONFIG_SND_SOC_WM8731_SPI)
592 .modalias
= "wm8731",
593 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
596 .controller_data
= &spi_wm8731_chip_info
,
600 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
602 .modalias
= "spidev",
603 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
606 .controller_data
= &spidev_chip_info
,
611 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
612 /* SPI controller data */
613 static struct bfin5xx_spi_master bfin_spi0_info
= {
615 .enable_dma
= 1, /* master has the ability to do dma transfer */
616 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
620 static struct resource bfin_spi0_resource
[] = {
622 .start
= SPI0_REGBASE
,
623 .end
= SPI0_REGBASE
+ 0xFF,
624 .flags
= IORESOURCE_MEM
,
629 .flags
= IORESOURCE_DMA
,
634 .flags
= IORESOURCE_IRQ
,
638 static struct platform_device bfin_spi0_device
= {
640 .id
= 0, /* Bus number */
641 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
642 .resource
= bfin_spi0_resource
,
644 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
647 #endif /* spi master and devices */
649 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
650 static struct resource bfin_uart_resources
[] = {
651 #ifdef CONFIG_SERIAL_BFIN_UART0
655 .flags
= IORESOURCE_MEM
,
658 #ifdef CONFIG_SERIAL_BFIN_UART1
662 .flags
= IORESOURCE_MEM
,
667 static struct platform_device bfin_uart_device
= {
670 .num_resources
= ARRAY_SIZE(bfin_uart_resources
),
671 .resource
= bfin_uart_resources
,
675 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
676 #ifdef CONFIG_BFIN_SIR0
677 static struct resource bfin_sir0_resources
[] = {
681 .flags
= IORESOURCE_MEM
,
684 .start
= IRQ_UART0_RX
,
685 .end
= IRQ_UART0_RX
+1,
686 .flags
= IORESOURCE_IRQ
,
689 .start
= CH_UART0_RX
,
690 .end
= CH_UART0_RX
+1,
691 .flags
= IORESOURCE_DMA
,
695 static struct platform_device bfin_sir0_device
= {
698 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
699 .resource
= bfin_sir0_resources
,
702 #ifdef CONFIG_BFIN_SIR1
703 static struct resource bfin_sir1_resources
[] = {
707 .flags
= IORESOURCE_MEM
,
710 .start
= IRQ_UART1_RX
,
711 .end
= IRQ_UART1_RX
+1,
712 .flags
= IORESOURCE_IRQ
,
715 .start
= CH_UART1_RX
,
716 .end
= CH_UART1_RX
+1,
717 .flags
= IORESOURCE_DMA
,
721 static struct platform_device bfin_sir1_device
= {
724 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
725 .resource
= bfin_sir1_resources
,
730 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
731 static struct resource bfin_twi0_resource
[] = {
733 .start
= TWI0_REGBASE
,
735 .flags
= IORESOURCE_MEM
,
740 .flags
= IORESOURCE_IRQ
,
744 static struct platform_device i2c_bfin_twi_device
= {
745 .name
= "i2c-bfin-twi",
747 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
748 .resource
= bfin_twi0_resource
,
752 static struct i2c_board_info __initdata bfin_i2c_board_info
[] = {
753 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
755 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
758 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
760 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
764 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
766 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
771 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
772 static struct platform_device bfin_sport0_uart_device
= {
773 .name
= "bfin-sport-uart",
777 static struct platform_device bfin_sport1_uart_device
= {
778 .name
= "bfin-sport-uart",
783 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
784 #include <linux/input.h>
785 #include <linux/gpio_keys.h>
787 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
788 {BTN_0
, GPIO_PG0
, 1, "gpio-keys: BTN0"},
789 {BTN_1
, GPIO_PG13
, 1, "gpio-keys: BTN1"},
792 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
793 .buttons
= bfin_gpio_keys_table
,
794 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
797 static struct platform_device bfin_device_gpiokeys
= {
800 .platform_data
= &bfin_gpio_keys_data
,
805 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
806 #include <linux/input.h>
807 #include <asm/bfin_rotary.h>
809 static struct bfin_rotary_platform_data bfin_rotary_data
= {
810 /*.rotary_up_key = KEY_UP,*/
811 /*.rotary_down_key = KEY_DOWN,*/
812 .rotary_rel_code
= REL_WHEEL
,
813 .rotary_button_key
= KEY_ENTER
,
814 .debounce
= 10, /* 0..17 */
815 .mode
= ROT_QUAD_ENC
| ROT_DEBE
,
818 static struct resource bfin_rotary_resources
[] = {
822 .flags
= IORESOURCE_IRQ
,
826 static struct platform_device bfin_rotary_device
= {
827 .name
= "bfin-rotary",
829 .num_resources
= ARRAY_SIZE(bfin_rotary_resources
),
830 .resource
= bfin_rotary_resources
,
832 .platform_data
= &bfin_rotary_data
,
837 static const unsigned int cclk_vlev_datasheet
[] =
839 VRPAIR(VLEV_100
, 400000000),
840 VRPAIR(VLEV_105
, 426000000),
841 VRPAIR(VLEV_110
, 500000000),
842 VRPAIR(VLEV_115
, 533000000),
843 VRPAIR(VLEV_120
, 600000000),
846 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
847 .tuple_tab
= cclk_vlev_datasheet
,
848 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
849 .vr_settling_time
= 25 /* us */,
852 static struct platform_device bfin_dpmc
= {
855 .platform_data
= &bfin_dmpc_vreg_data
,
859 static struct platform_device
*stamp_devices
[] __initdata
= {
863 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
867 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
868 &bfin_pcmcia_cf_device
,
871 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
875 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
879 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
880 &bfin_isp1760_device
,
883 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
887 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
891 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
895 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
900 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
901 &net2272_bfin_device
,
904 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
908 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
909 &bf52x_t350mcqb_device
,
912 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
916 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
917 #ifdef CONFIG_BFIN_SIR0
920 #ifdef CONFIG_BFIN_SIR1
925 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
926 &i2c_bfin_twi_device
,
929 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
930 &bfin_sport0_uart_device
,
931 &bfin_sport1_uart_device
,
934 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
935 &bfin_device_gpiokeys
,
938 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
942 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
947 static int __init
ezkit_init(void)
949 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
950 i2c_register_board_info(0, bfin_i2c_board_info
,
951 ARRAY_SIZE(bfin_i2c_board_info
));
952 platform_add_devices(stamp_devices
, ARRAY_SIZE(stamp_devices
));
953 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
957 arch_initcall(ezkit_init
);
959 void native_machine_restart(char *cmd
)
961 /* workaround reboot hang when booting from SPI */
962 if ((bfin_read_SYSCR() & 0x7) == 0x3)
963 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS
);
966 void bfin_get_ether_addr(char *addr
)
968 /* the MAC is stored in OTP memory page 0xDF */
971 u32 (*otp_read
)(u32 page
, u32 flags
, u64
*page_content
) = (void *)0xEF00001A;
973 ret
= otp_read(0xDF, 0x00, &otp_mac
);
975 char *otp_mac_p
= (char *)&otp_mac
;
976 for (ret
= 0; ret
< 6; ++ret
)
977 addr
[ret
] = otp_mac_p
[5 - ret
];
980 EXPORT_SYMBOL(bfin_get_ether_addr
);