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
9 #include <linux/device.h>
10 #include <linux/platform_device.h>
11 #include <linux/mtd/mtd.h>
12 #include <linux/mtd/physmap.h>
13 #include <linux/mtd/partitions.h>
14 #include <linux/spi/spi.h>
15 #include <linux/spi/flash.h>
16 #include <linux/irq.h>
17 #include <linux/interrupt.h>
18 #include <asm/bfin5xx_spi.h>
22 #include <asm/portmux.h>
24 #include <linux/input.h>
27 * Name the Board for the /proc/cpuinfo
29 const char bfin_board_name
[] = "ADI BF538-EZKIT";
32 * Driver needs to know address, irq and flag pin.
36 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
37 static struct platform_device rtc_device
= {
43 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
44 #ifdef CONFIG_SERIAL_BFIN_UART0
45 static struct resource bfin_uart0_resources
[] = {
49 .flags
= IORESOURCE_MEM
,
52 .start
= IRQ_UART0_RX
,
53 .end
= IRQ_UART0_RX
+1,
54 .flags
= IORESOURCE_IRQ
,
57 .start
= IRQ_UART0_ERROR
,
58 .end
= IRQ_UART0_ERROR
,
59 .flags
= IORESOURCE_IRQ
,
64 .flags
= IORESOURCE_DMA
,
69 .flags
= IORESOURCE_DMA
,
71 #ifdef CONFIG_BFIN_UART0_CTSRTS
75 .flags
= IORESOURCE_IO
,
80 .flags
= IORESOURCE_IO
,
85 static unsigned short bfin_uart0_peripherals
[] = {
86 P_UART0_TX
, P_UART0_RX
, 0
89 static struct platform_device bfin_uart0_device
= {
92 .num_resources
= ARRAY_SIZE(bfin_uart0_resources
),
93 .resource
= bfin_uart0_resources
,
95 .platform_data
= &bfin_uart0_peripherals
, /* Passed to driver */
99 #ifdef CONFIG_SERIAL_BFIN_UART1
100 static struct resource bfin_uart1_resources
[] = {
104 .flags
= IORESOURCE_MEM
,
107 .start
= IRQ_UART1_RX
,
108 .end
= IRQ_UART1_RX
+1,
109 .flags
= IORESOURCE_IRQ
,
112 .start
= IRQ_UART1_ERROR
,
113 .end
= IRQ_UART1_ERROR
,
114 .flags
= IORESOURCE_IRQ
,
117 .start
= CH_UART1_TX
,
119 .flags
= IORESOURCE_DMA
,
122 .start
= CH_UART1_RX
,
124 .flags
= IORESOURCE_DMA
,
128 static unsigned short bfin_uart1_peripherals
[] = {
129 P_UART1_TX
, P_UART1_RX
, 0
132 static struct platform_device bfin_uart1_device
= {
135 .num_resources
= ARRAY_SIZE(bfin_uart1_resources
),
136 .resource
= bfin_uart1_resources
,
138 .platform_data
= &bfin_uart1_peripherals
, /* Passed to driver */
142 #ifdef CONFIG_SERIAL_BFIN_UART2
143 static struct resource bfin_uart2_resources
[] = {
147 .flags
= IORESOURCE_MEM
,
150 .start
= IRQ_UART2_RX
,
151 .end
= IRQ_UART2_RX
+1,
152 .flags
= IORESOURCE_IRQ
,
155 .start
= IRQ_UART2_ERROR
,
156 .end
= IRQ_UART2_ERROR
,
157 .flags
= IORESOURCE_IRQ
,
160 .start
= CH_UART2_TX
,
162 .flags
= IORESOURCE_DMA
,
165 .start
= CH_UART2_RX
,
167 .flags
= IORESOURCE_DMA
,
171 static unsigned short bfin_uart2_peripherals
[] = {
172 P_UART2_TX
, P_UART2_RX
, 0
175 static struct platform_device bfin_uart2_device
= {
178 .num_resources
= ARRAY_SIZE(bfin_uart2_resources
),
179 .resource
= bfin_uart2_resources
,
181 .platform_data
= &bfin_uart2_peripherals
, /* Passed to driver */
187 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
188 #ifdef CONFIG_BFIN_SIR0
189 static struct resource bfin_sir0_resources
[] = {
193 .flags
= IORESOURCE_MEM
,
196 .start
= IRQ_UART0_RX
,
197 .end
= IRQ_UART0_RX
+1,
198 .flags
= IORESOURCE_IRQ
,
201 .start
= CH_UART0_RX
,
202 .end
= CH_UART0_RX
+1,
203 .flags
= IORESOURCE_DMA
,
206 static struct platform_device bfin_sir0_device
= {
209 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
210 .resource
= bfin_sir0_resources
,
213 #ifdef CONFIG_BFIN_SIR1
214 static struct resource bfin_sir1_resources
[] = {
218 .flags
= IORESOURCE_MEM
,
221 .start
= IRQ_UART1_RX
,
222 .end
= IRQ_UART1_RX
+1,
223 .flags
= IORESOURCE_IRQ
,
226 .start
= CH_UART1_RX
,
227 .end
= CH_UART1_RX
+1,
228 .flags
= IORESOURCE_DMA
,
231 static struct platform_device bfin_sir1_device
= {
234 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
235 .resource
= bfin_sir1_resources
,
238 #ifdef CONFIG_BFIN_SIR2
239 static struct resource bfin_sir2_resources
[] = {
243 .flags
= IORESOURCE_MEM
,
246 .start
= IRQ_UART2_RX
,
247 .end
= IRQ_UART2_RX
+1,
248 .flags
= IORESOURCE_IRQ
,
251 .start
= CH_UART2_RX
,
252 .end
= CH_UART2_RX
+1,
253 .flags
= IORESOURCE_DMA
,
256 static struct platform_device bfin_sir2_device
= {
259 .num_resources
= ARRAY_SIZE(bfin_sir2_resources
),
260 .resource
= bfin_sir2_resources
,
265 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
266 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
267 static struct resource bfin_sport0_uart_resources
[] = {
269 .start
= SPORT0_TCR1
,
270 .end
= SPORT0_MRCS3
+4,
271 .flags
= IORESOURCE_MEM
,
274 .start
= IRQ_SPORT0_RX
,
275 .end
= IRQ_SPORT0_RX
+1,
276 .flags
= IORESOURCE_IRQ
,
279 .start
= IRQ_SPORT0_ERROR
,
280 .end
= IRQ_SPORT0_ERROR
,
281 .flags
= IORESOURCE_IRQ
,
285 static unsigned short bfin_sport0_peripherals
[] = {
286 P_SPORT0_TFS
, P_SPORT0_DTPRI
, P_SPORT0_TSCLK
, P_SPORT0_RFS
,
287 P_SPORT0_DRPRI
, P_SPORT0_RSCLK
, 0
290 static struct platform_device bfin_sport0_uart_device
= {
291 .name
= "bfin-sport-uart",
293 .num_resources
= ARRAY_SIZE(bfin_sport0_uart_resources
),
294 .resource
= bfin_sport0_uart_resources
,
296 .platform_data
= &bfin_sport0_peripherals
, /* Passed to driver */
300 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
301 static struct resource bfin_sport1_uart_resources
[] = {
303 .start
= SPORT1_TCR1
,
304 .end
= SPORT1_MRCS3
+4,
305 .flags
= IORESOURCE_MEM
,
308 .start
= IRQ_SPORT1_RX
,
309 .end
= IRQ_SPORT1_RX
+1,
310 .flags
= IORESOURCE_IRQ
,
313 .start
= IRQ_SPORT1_ERROR
,
314 .end
= IRQ_SPORT1_ERROR
,
315 .flags
= IORESOURCE_IRQ
,
319 static unsigned short bfin_sport1_peripherals
[] = {
320 P_SPORT1_TFS
, P_SPORT1_DTPRI
, P_SPORT1_TSCLK
, P_SPORT1_RFS
,
321 P_SPORT1_DRPRI
, P_SPORT1_RSCLK
, 0
324 static struct platform_device bfin_sport1_uart_device
= {
325 .name
= "bfin-sport-uart",
327 .num_resources
= ARRAY_SIZE(bfin_sport1_uart_resources
),
328 .resource
= bfin_sport1_uart_resources
,
330 .platform_data
= &bfin_sport1_peripherals
, /* Passed to driver */
334 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
335 static struct resource bfin_sport2_uart_resources
[] = {
337 .start
= SPORT2_TCR1
,
338 .end
= SPORT2_MRCS3
+4,
339 .flags
= IORESOURCE_MEM
,
342 .start
= IRQ_SPORT2_RX
,
343 .end
= IRQ_SPORT2_RX
+1,
344 .flags
= IORESOURCE_IRQ
,
347 .start
= IRQ_SPORT2_ERROR
,
348 .end
= IRQ_SPORT2_ERROR
,
349 .flags
= IORESOURCE_IRQ
,
353 static unsigned short bfin_sport2_peripherals
[] = {
354 P_SPORT2_TFS
, P_SPORT2_DTPRI
, P_SPORT2_TSCLK
, P_SPORT2_RFS
,
355 P_SPORT2_DRPRI
, P_SPORT2_RSCLK
, P_SPORT2_DRSEC
, P_SPORT2_DTSEC
, 0
358 static struct platform_device bfin_sport2_uart_device
= {
359 .name
= "bfin-sport-uart",
361 .num_resources
= ARRAY_SIZE(bfin_sport2_uart_resources
),
362 .resource
= bfin_sport2_uart_resources
,
364 .platform_data
= &bfin_sport2_peripherals
, /* Passed to driver */
368 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
369 static struct resource bfin_sport3_uart_resources
[] = {
371 .start
= SPORT3_TCR1
,
372 .end
= SPORT3_MRCS3
+4,
373 .flags
= IORESOURCE_MEM
,
376 .start
= IRQ_SPORT3_RX
,
377 .end
= IRQ_SPORT3_RX
+1,
378 .flags
= IORESOURCE_IRQ
,
381 .start
= IRQ_SPORT3_ERROR
,
382 .end
= IRQ_SPORT3_ERROR
,
383 .flags
= IORESOURCE_IRQ
,
387 static unsigned short bfin_sport3_peripherals
[] = {
388 P_SPORT3_TFS
, P_SPORT3_DTPRI
, P_SPORT3_TSCLK
, P_SPORT3_RFS
,
389 P_SPORT3_DRPRI
, P_SPORT3_RSCLK
, P_SPORT3_DRSEC
, P_SPORT3_DTSEC
, 0
392 static struct platform_device bfin_sport3_uart_device
= {
393 .name
= "bfin-sport-uart",
395 .num_resources
= ARRAY_SIZE(bfin_sport3_uart_resources
),
396 .resource
= bfin_sport3_uart_resources
,
398 .platform_data
= &bfin_sport3_peripherals
, /* Passed to driver */
404 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
405 static unsigned short bfin_can_peripherals
[] = {
406 P_CAN0_RX
, P_CAN0_TX
, 0
409 static struct resource bfin_can_resources
[] = {
413 .flags
= IORESOURCE_MEM
,
418 .flags
= IORESOURCE_IRQ
,
423 .flags
= IORESOURCE_IRQ
,
426 .start
= IRQ_CAN_ERROR
,
427 .end
= IRQ_CAN_ERROR
,
428 .flags
= IORESOURCE_IRQ
,
432 static struct platform_device bfin_can_device
= {
434 .num_resources
= ARRAY_SIZE(bfin_can_resources
),
435 .resource
= bfin_can_resources
,
437 .platform_data
= &bfin_can_peripherals
, /* Passed to driver */
443 * USB-LAN EzExtender board
444 * Driver needs to know address, irq and flag pin.
446 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
447 #include <linux/smc91x.h>
449 static struct smc91x_platdata smc91x_info
= {
450 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
451 .leda
= RPC_LED_100_10
,
452 .ledb
= RPC_LED_TX_RX
,
455 static struct resource smc91x_resources
[] = {
457 .name
= "smc91x-regs",
459 .end
= 0x20310300 + 16,
460 .flags
= IORESOURCE_MEM
,
464 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
467 static struct platform_device smc91x_device
= {
470 .num_resources
= ARRAY_SIZE(smc91x_resources
),
471 .resource
= smc91x_resources
,
473 .platform_data
= &smc91x_info
,
478 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
479 /* all SPI peripherals info goes here */
480 #if defined(CONFIG_MTD_M25P80) \
481 || defined(CONFIG_MTD_M25P80_MODULE)
482 /* SPI flash chip (m25p16) */
483 static struct mtd_partition bfin_spi_flash_partitions
[] = {
485 .name
= "bootloader(spi)",
488 .mask_flags
= MTD_CAP_ROM
490 .name
= "linux kernel(spi)",
496 static struct flash_platform_data bfin_spi_flash_data
= {
498 .parts
= bfin_spi_flash_partitions
,
499 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
503 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
504 .enable_dma
= 0, /* use dma transfer with this chip*/
508 #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
509 #include <linux/spi/ad7879.h>
510 static const struct ad7879_platform_data bfin_ad7879_ts_info
= {
511 .model
= 7879, /* Model = AD7879 */
512 .x_plate_ohms
= 620, /* 620 Ohm from the touch datasheet */
513 .pressure_max
= 10000,
515 .first_conversion_delay
= 3, /* wait 512us before do a first conversion */
516 .acquisition_time
= 1, /* 4us acquisition time per sample */
517 .median
= 2, /* do 8 measurements */
518 .averaging
= 1, /* take the average of 4 middle samples */
519 .pen_down_acc_interval
= 255, /* 9.4 ms */
520 .gpio_export
= 1, /* Export GPIO to gpiolib */
521 .gpio_base
= -1, /* Dynamic allocation */
525 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
526 #include <asm/bfin-lq035q1.h>
528 static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data
= {
529 .mode
= LQ035_NORM
| LQ035_RGB
| LQ035_RL
| LQ035_TB
,
530 .ppi_mode
= USE_RGB565_16_BIT_PPI
,
531 .use_bl
= 0, /* let something else control the LCD Blacklight */
535 static struct resource bfin_lq035q1_resources
[] = {
537 .start
= IRQ_PPI_ERROR
,
538 .end
= IRQ_PPI_ERROR
,
539 .flags
= IORESOURCE_IRQ
,
543 static struct platform_device bfin_lq035q1_device
= {
544 .name
= "bfin-lq035q1",
546 .num_resources
= ARRAY_SIZE(bfin_lq035q1_resources
),
547 .resource
= bfin_lq035q1_resources
,
549 .platform_data
= &bfin_lq035q1_data
,
554 static struct spi_board_info bf538_spi_board_info
[] __initdata
= {
555 #if defined(CONFIG_MTD_M25P80) \
556 || defined(CONFIG_MTD_M25P80_MODULE)
558 /* the modalias must be the same as spi device driver name */
559 .modalias
= "m25p80", /* Name of spi_driver for this device */
560 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
561 .bus_num
= 0, /* Framework bus number */
562 .chip_select
= 1, /* SPI_SSEL1*/
563 .platform_data
= &bfin_spi_flash_data
,
564 .controller_data
= &spi_flash_chip_info
,
568 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
570 .modalias
= "ad7879",
571 .platform_data
= &bfin_ad7879_ts_info
,
573 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
576 .mode
= SPI_CPHA
| SPI_CPOL
,
579 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
581 .modalias
= "bfin-lq035q1-spi",
582 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
585 .mode
= SPI_CPHA
| SPI_CPOL
,
588 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
590 .modalias
= "spidev",
591 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
599 static struct resource bfin_spi0_resource
[] = {
601 .start
= SPI0_REGBASE
,
602 .end
= SPI0_REGBASE
+ 0xFF,
603 .flags
= IORESOURCE_MEM
,
608 .flags
= IORESOURCE_DMA
,
613 .flags
= IORESOURCE_IRQ
,
618 static struct resource bfin_spi1_resource
[] = {
620 .start
= SPI1_REGBASE
,
621 .end
= SPI1_REGBASE
+ 0xFF,
622 .flags
= IORESOURCE_MEM
,
627 .flags
= IORESOURCE_DMA
,
632 .flags
= IORESOURCE_IRQ
,
637 static struct resource bfin_spi2_resource
[] = {
639 .start
= SPI2_REGBASE
,
640 .end
= SPI2_REGBASE
+ 0xFF,
641 .flags
= IORESOURCE_MEM
,
646 .flags
= IORESOURCE_DMA
,
651 .flags
= IORESOURCE_IRQ
,
655 /* SPI controller data */
656 static struct bfin5xx_spi_master bf538_spi_master_info0
= {
658 .enable_dma
= 1, /* master has the ability to do dma transfer */
659 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
662 static struct platform_device bf538_spi_master0
= {
664 .id
= 0, /* Bus number */
665 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
666 .resource
= bfin_spi0_resource
,
668 .platform_data
= &bf538_spi_master_info0
, /* Passed to driver */
672 static struct bfin5xx_spi_master bf538_spi_master_info1
= {
674 .enable_dma
= 1, /* master has the ability to do dma transfer */
675 .pin_req
= {P_SPI1_SCK
, P_SPI1_MISO
, P_SPI1_MOSI
, 0},
678 static struct platform_device bf538_spi_master1
= {
680 .id
= 1, /* Bus number */
681 .num_resources
= ARRAY_SIZE(bfin_spi1_resource
),
682 .resource
= bfin_spi1_resource
,
684 .platform_data
= &bf538_spi_master_info1
, /* Passed to driver */
688 static struct bfin5xx_spi_master bf538_spi_master_info2
= {
690 .enable_dma
= 1, /* master has the ability to do dma transfer */
691 .pin_req
= {P_SPI2_SCK
, P_SPI2_MISO
, P_SPI2_MOSI
, 0},
694 static struct platform_device bf538_spi_master2
= {
696 .id
= 2, /* Bus number */
697 .num_resources
= ARRAY_SIZE(bfin_spi2_resource
),
698 .resource
= bfin_spi2_resource
,
700 .platform_data
= &bf538_spi_master_info2
, /* Passed to driver */
704 #endif /* spi master and devices */
706 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
707 static struct resource bfin_twi0_resource
[] = {
709 .start
= TWI0_REGBASE
,
710 .end
= TWI0_REGBASE
+ 0xFF,
711 .flags
= IORESOURCE_MEM
,
716 .flags
= IORESOURCE_IRQ
,
720 static struct platform_device i2c_bfin_twi0_device
= {
721 .name
= "i2c-bfin-twi",
723 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
724 .resource
= bfin_twi0_resource
,
727 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
728 static struct resource bfin_twi1_resource
[] = {
730 .start
= TWI1_REGBASE
,
731 .end
= TWI1_REGBASE
+ 0xFF,
732 .flags
= IORESOURCE_MEM
,
737 .flags
= IORESOURCE_IRQ
,
741 static struct platform_device i2c_bfin_twi1_device
= {
742 .name
= "i2c-bfin-twi",
744 .num_resources
= ARRAY_SIZE(bfin_twi1_resource
),
745 .resource
= bfin_twi1_resource
,
750 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
751 #include <linux/gpio_keys.h>
753 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
754 {BTN_0
, GPIO_PC7
, 1, "gpio-keys: BTN0"},
757 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
758 .buttons
= bfin_gpio_keys_table
,
759 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
762 static struct platform_device bfin_device_gpiokeys
= {
765 .platform_data
= &bfin_gpio_keys_data
,
770 static const unsigned int cclk_vlev_datasheet
[] =
773 * Internal VLEV BF538SBBC1533
774 ****temporarily using these values until data sheet is updated
776 VRPAIR(VLEV_100
, 150000000),
777 VRPAIR(VLEV_100
, 250000000),
778 VRPAIR(VLEV_110
, 276000000),
779 VRPAIR(VLEV_115
, 301000000),
780 VRPAIR(VLEV_120
, 525000000),
781 VRPAIR(VLEV_125
, 550000000),
782 VRPAIR(VLEV_130
, 600000000),
785 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
786 .tuple_tab
= cclk_vlev_datasheet
,
787 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
788 .vr_settling_time
= 25 /* us */,
791 static struct platform_device bfin_dpmc
= {
794 .platform_data
= &bfin_dmpc_vreg_data
,
798 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
799 static struct mtd_partition ezkit_partitions
[] = {
801 .name
= "bootloader(nor)",
805 .name
= "linux kernel(nor)",
807 .offset
= MTDPART_OFS_APPEND
,
809 .name
= "file system(nor)",
810 .size
= MTDPART_SIZ_FULL
,
811 .offset
= MTDPART_OFS_APPEND
,
815 static struct physmap_flash_data ezkit_flash_data
= {
817 .parts
= ezkit_partitions
,
818 .nr_parts
= ARRAY_SIZE(ezkit_partitions
),
821 static struct resource ezkit_flash_resource
= {
823 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
828 .flags
= IORESOURCE_MEM
,
831 static struct platform_device ezkit_flash_device
= {
832 .name
= "physmap-flash",
835 .platform_data
= &ezkit_flash_data
,
838 .resource
= &ezkit_flash_resource
,
842 static struct platform_device
*cm_bf538_devices
[] __initdata
= {
846 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
850 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
851 #ifdef CONFIG_SERIAL_BFIN_UART0
854 #ifdef CONFIG_SERIAL_BFIN_UART1
857 #ifdef CONFIG_SERIAL_BFIN_UART2
862 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
868 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
869 &i2c_bfin_twi0_device
,
870 &i2c_bfin_twi1_device
,
873 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
874 #ifdef CONFIG_BFIN_SIR0
877 #ifdef CONFIG_BFIN_SIR1
880 #ifdef CONFIG_BFIN_SIR2
885 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
886 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
887 &bfin_sport0_uart_device
,
889 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
890 &bfin_sport1_uart_device
,
892 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
893 &bfin_sport2_uart_device
,
895 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
896 &bfin_sport3_uart_device
,
900 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
904 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
908 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
909 &bfin_lq035q1_device
,
912 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
913 &bfin_device_gpiokeys
,
916 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
921 static int __init
ezkit_init(void)
923 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
924 platform_add_devices(cm_bf538_devices
, ARRAY_SIZE(cm_bf538_devices
));
926 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
927 spi_register_board_info(bf538_spi_board_info
,
928 ARRAY_SIZE(bf538_spi_board_info
));
934 arch_initcall(ezkit_init
);
936 static struct platform_device
*ezkit_early_devices
[] __initdata
= {
937 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
938 #ifdef CONFIG_SERIAL_BFIN_UART0
941 #ifdef CONFIG_SERIAL_BFIN_UART1
944 #ifdef CONFIG_SERIAL_BFIN_UART2
949 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
950 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
951 &bfin_sport0_uart_device
,
953 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
954 &bfin_sport1_uart_device
,
956 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
957 &bfin_sport2_uart_device
,
959 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
960 &bfin_sport3_uart_device
,
965 void __init
native_machine_early_platform_add_devices(void)
967 printk(KERN_INFO
"register early platform devices\n");
968 early_platform_add_devices(ezkit_early_devices
,
969 ARRAY_SIZE(ezkit_early_devices
));