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 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 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 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 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
, P_SPORT0_DRSEC
, P_SPORT0_DTSEC
, 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 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
, P_SPORT1_DRSEC
, P_SPORT1_DTSEC
, 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 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 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 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*/
509 #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
510 #include <linux/spi/ad7879.h>
511 static const struct ad7879_platform_data bfin_ad7879_ts_info
= {
512 .model
= 7879, /* Model = AD7879 */
513 .x_plate_ohms
= 620, /* 620 Ohm from the touch datasheet */
514 .pressure_max
= 10000,
516 .first_conversion_delay
= 3, /* wait 512us before do a first conversion */
517 .acquisition_time
= 1, /* 4us acquisition time per sample */
518 .median
= 2, /* do 8 measurements */
519 .averaging
= 1, /* take the average of 4 middle samples */
520 .pen_down_acc_interval
= 255, /* 9.4 ms */
521 .gpio_export
= 1, /* Export GPIO to gpiolib */
522 .gpio_base
= -1, /* Dynamic allocation */
526 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
527 static struct bfin5xx_spi_chip spi_ad7879_chip_info
= {
533 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
534 #include <asm/bfin-lq035q1.h>
536 static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data
= {
537 .mode
= LQ035_NORM
| LQ035_RGB
| LQ035_RL
| LQ035_TB
,
538 .ppi_mode
= USE_RGB565_16_BIT_PPI
,
539 .use_bl
= 0, /* let something else control the LCD Blacklight */
543 static struct resource bfin_lq035q1_resources
[] = {
545 .start
= IRQ_PPI_ERROR
,
546 .end
= IRQ_PPI_ERROR
,
547 .flags
= IORESOURCE_IRQ
,
551 static struct platform_device bfin_lq035q1_device
= {
552 .name
= "bfin-lq035q1",
554 .num_resources
= ARRAY_SIZE(bfin_lq035q1_resources
),
555 .resource
= bfin_lq035q1_resources
,
557 .platform_data
= &bfin_lq035q1_data
,
562 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
563 static struct bfin5xx_spi_chip spidev_chip_info
= {
569 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
570 static struct bfin5xx_spi_chip lq035q1_spi_chip_info
= {
576 static struct spi_board_info bf538_spi_board_info
[] __initdata
= {
577 #if defined(CONFIG_MTD_M25P80) \
578 || defined(CONFIG_MTD_M25P80_MODULE)
580 /* the modalias must be the same as spi device driver name */
581 .modalias
= "m25p80", /* Name of spi_driver for this device */
582 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
583 .bus_num
= 0, /* Framework bus number */
584 .chip_select
= 1, /* SPI_SSEL1*/
585 .platform_data
= &bfin_spi_flash_data
,
586 .controller_data
= &spi_flash_chip_info
,
590 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
592 .modalias
= "ad7879",
593 .platform_data
= &bfin_ad7879_ts_info
,
595 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
598 .controller_data
= &spi_ad7879_chip_info
,
599 .mode
= SPI_CPHA
| SPI_CPOL
,
602 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
604 .modalias
= "bfin-lq035q1-spi",
605 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
608 .controller_data
= &lq035q1_spi_chip_info
,
609 .mode
= SPI_CPHA
| SPI_CPOL
,
612 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
614 .modalias
= "spidev",
615 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
618 .controller_data
= &spidev_chip_info
,
624 static struct resource bfin_spi0_resource
[] = {
626 .start
= SPI0_REGBASE
,
627 .end
= SPI0_REGBASE
+ 0xFF,
628 .flags
= IORESOURCE_MEM
,
633 .flags
= IORESOURCE_DMA
,
638 .flags
= IORESOURCE_IRQ
,
643 static struct resource bfin_spi1_resource
[] = {
645 .start
= SPI1_REGBASE
,
646 .end
= SPI1_REGBASE
+ 0xFF,
647 .flags
= IORESOURCE_MEM
,
652 .flags
= IORESOURCE_DMA
,
657 .flags
= IORESOURCE_IRQ
,
662 static struct resource bfin_spi2_resource
[] = {
664 .start
= SPI2_REGBASE
,
665 .end
= SPI2_REGBASE
+ 0xFF,
666 .flags
= IORESOURCE_MEM
,
671 .flags
= IORESOURCE_DMA
,
676 .flags
= IORESOURCE_IRQ
,
680 /* SPI controller data */
681 static struct bfin5xx_spi_master bf538_spi_master_info0
= {
683 .enable_dma
= 1, /* master has the ability to do dma transfer */
684 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
687 static struct platform_device bf538_spi_master0
= {
689 .id
= 0, /* Bus number */
690 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
691 .resource
= bfin_spi0_resource
,
693 .platform_data
= &bf538_spi_master_info0
, /* Passed to driver */
697 static struct bfin5xx_spi_master bf538_spi_master_info1
= {
699 .enable_dma
= 1, /* master has the ability to do dma transfer */
700 .pin_req
= {P_SPI1_SCK
, P_SPI1_MISO
, P_SPI1_MOSI
, 0},
703 static struct platform_device bf538_spi_master1
= {
705 .id
= 1, /* Bus number */
706 .num_resources
= ARRAY_SIZE(bfin_spi1_resource
),
707 .resource
= bfin_spi1_resource
,
709 .platform_data
= &bf538_spi_master_info1
, /* Passed to driver */
713 static struct bfin5xx_spi_master bf538_spi_master_info2
= {
715 .enable_dma
= 1, /* master has the ability to do dma transfer */
716 .pin_req
= {P_SPI2_SCK
, P_SPI2_MISO
, P_SPI2_MOSI
, 0},
719 static struct platform_device bf538_spi_master2
= {
721 .id
= 2, /* Bus number */
722 .num_resources
= ARRAY_SIZE(bfin_spi2_resource
),
723 .resource
= bfin_spi2_resource
,
725 .platform_data
= &bf538_spi_master_info2
, /* Passed to driver */
729 #endif /* spi master and devices */
731 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
732 static struct resource bfin_twi0_resource
[] = {
734 .start
= TWI0_REGBASE
,
735 .end
= TWI0_REGBASE
+ 0xFF,
736 .flags
= IORESOURCE_MEM
,
741 .flags
= IORESOURCE_IRQ
,
745 static struct platform_device i2c_bfin_twi0_device
= {
746 .name
= "i2c-bfin-twi",
748 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
749 .resource
= bfin_twi0_resource
,
752 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
753 static struct resource bfin_twi1_resource
[] = {
755 .start
= TWI1_REGBASE
,
756 .end
= TWI1_REGBASE
+ 0xFF,
757 .flags
= IORESOURCE_MEM
,
762 .flags
= IORESOURCE_IRQ
,
766 static struct platform_device i2c_bfin_twi1_device
= {
767 .name
= "i2c-bfin-twi",
769 .num_resources
= ARRAY_SIZE(bfin_twi1_resource
),
770 .resource
= bfin_twi1_resource
,
775 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
776 #include <linux/gpio_keys.h>
778 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
779 {BTN_0
, GPIO_PC7
, 1, "gpio-keys: BTN0"},
782 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
783 .buttons
= bfin_gpio_keys_table
,
784 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
787 static struct platform_device bfin_device_gpiokeys
= {
790 .platform_data
= &bfin_gpio_keys_data
,
795 static const unsigned int cclk_vlev_datasheet
[] =
798 * Internal VLEV BF538SBBC1533
799 ****temporarily using these values until data sheet is updated
801 VRPAIR(VLEV_100
, 150000000),
802 VRPAIR(VLEV_100
, 250000000),
803 VRPAIR(VLEV_110
, 276000000),
804 VRPAIR(VLEV_115
, 301000000),
805 VRPAIR(VLEV_120
, 525000000),
806 VRPAIR(VLEV_125
, 550000000),
807 VRPAIR(VLEV_130
, 600000000),
810 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
811 .tuple_tab
= cclk_vlev_datasheet
,
812 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
813 .vr_settling_time
= 25 /* us */,
816 static struct platform_device bfin_dpmc
= {
819 .platform_data
= &bfin_dmpc_vreg_data
,
823 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
824 static struct mtd_partition ezkit_partitions
[] = {
826 .name
= "bootloader(nor)",
830 .name
= "linux kernel(nor)",
832 .offset
= MTDPART_OFS_APPEND
,
834 .name
= "file system(nor)",
835 .size
= MTDPART_SIZ_FULL
,
836 .offset
= MTDPART_OFS_APPEND
,
840 static struct physmap_flash_data ezkit_flash_data
= {
842 .parts
= ezkit_partitions
,
843 .nr_parts
= ARRAY_SIZE(ezkit_partitions
),
846 static struct resource ezkit_flash_resource
= {
848 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
853 .flags
= IORESOURCE_MEM
,
856 static struct platform_device ezkit_flash_device
= {
857 .name
= "physmap-flash",
860 .platform_data
= &ezkit_flash_data
,
863 .resource
= &ezkit_flash_resource
,
867 static struct platform_device
*cm_bf538_devices
[] __initdata
= {
871 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
875 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
876 #ifdef CONFIG_SERIAL_BFIN_UART0
879 #ifdef CONFIG_SERIAL_BFIN_UART1
882 #ifdef CONFIG_SERIAL_BFIN_UART2
887 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
893 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
894 &i2c_bfin_twi0_device
,
895 &i2c_bfin_twi1_device
,
898 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
899 #ifdef CONFIG_BFIN_SIR0
902 #ifdef CONFIG_BFIN_SIR1
905 #ifdef CONFIG_BFIN_SIR2
910 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
911 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
912 &bfin_sport0_uart_device
,
914 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
915 &bfin_sport1_uart_device
,
917 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
918 &bfin_sport2_uart_device
,
920 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
921 &bfin_sport3_uart_device
,
925 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
929 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
933 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
934 &bfin_lq035q1_device
,
937 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
938 &bfin_device_gpiokeys
,
941 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
946 static int __init
ezkit_init(void)
948 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
949 platform_add_devices(cm_bf538_devices
, ARRAY_SIZE(cm_bf538_devices
));
951 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
952 spi_register_board_info(bf538_spi_board_info
,
953 ARRAY_SIZE(bf538_spi_board_info
));
959 arch_initcall(ezkit_init
);
961 static struct platform_device
*ezkit_early_devices
[] __initdata
= {
962 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
963 #ifdef CONFIG_SERIAL_BFIN_UART0
966 #ifdef CONFIG_SERIAL_BFIN_UART1
969 #ifdef CONFIG_SERIAL_BFIN_UART2
974 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
975 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
976 &bfin_sport0_uart_device
,
978 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
979 &bfin_sport1_uart_device
,
981 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
982 &bfin_sport2_uart_device
,
984 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
985 &bfin_sport3_uart_device
,
990 void __init
native_machine_early_platform_add_devices(void)
992 printk(KERN_INFO
"register early platform devices\n");
993 early_platform_add_devices(ezkit_early_devices
,
994 ARRAY_SIZE(ezkit_early_devices
));