blob: 5332c9828a33092580e0fb6164b750003d9a34c5 [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
Robin Getz96f10502009-09-24 14:11:24 +00002 * Copyright 2004-2009 Analog Devices Inc.
3 * 2005 National ICT Australia (NICTA)
4 * Aidan Williams <aidan@nicta.com.au>
Bryan Wu1394f032007-05-06 14:50:22 -07005 *
Robin Getz96f10502009-09-24 14:11:24 +00006 * Licensed under the GPL-2 or later.
Bryan Wu1394f032007-05-06 14:50:22 -07007 */
8
9#include <linux/device.h>
10#include <linux/platform_device.h>
11#include <linux/mtd/mtd.h>
12#include <linux/mtd/partitions.h>
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -040013#include <linux/mtd/plat-ram.h>
Mike Frysinger7036c612009-09-22 22:23:04 -040014#include <linux/mtd/physmap.h>
Bryan Wu1394f032007-05-06 14:50:22 -070015#include <linux/spi/spi.h>
16#include <linux/spi/flash.h>
Mike Frysinger67f2d332008-02-09 01:49:23 +080017#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
Mike Frysingerf02bcec2007-11-15 21:29:15 +080018#include <linux/usb/isp1362.h>
Mike Frysinger67f2d332008-02-09 01:49:23 +080019#endif
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080020#include <linux/irq.h>
Michael Hennerich50c4c082009-09-22 13:10:09 +000021#include <linux/i2c.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080022#include <asm/dma.h>
Bryan Wu1394f032007-05-06 14:50:22 -070023#include <asm/bfin5xx_spi.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080024#include <asm/portmux.h>
Michael Hennerich14b03202008-05-07 11:41:26 +080025#include <asm/dpmc.h>
Bryan Wu1394f032007-05-06 14:50:22 -070026
27/*
28 * Name the Board for the /proc/cpuinfo
29 */
Mike Frysingerfe85cad2008-11-18 17:48:22 +080030const char bfin_board_name[] = "ADI BF533-EZKIT";
Bryan Wu1394f032007-05-06 14:50:22 -070031
32#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
33static struct platform_device rtc_device = {
34 .name = "rtc-bfin",
35 .id = -1,
36};
37#endif
38
39/*
40 * USB-LAN EzExtender board
41 * Driver needs to know address, irq and flag pin.
42 */
43#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Michael Hennerich61f09b52009-07-24 08:48:31 +000044#include <linux/smc91x.h>
45
46static struct smc91x_platdata smc91x_info = {
47 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
48 .leda = RPC_LED_100_10,
49 .ledb = RPC_LED_TX_RX,
50};
51
Bryan Wu1394f032007-05-06 14:50:22 -070052static struct resource smc91x_resources[] = {
53 {
54 .name = "smc91x-regs",
55 .start = 0x20310300,
56 .end = 0x20310300 + 16,
57 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080058 }, {
Bryan Wu1394f032007-05-06 14:50:22 -070059 .start = IRQ_PF9,
60 .end = IRQ_PF9,
61 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
62 },
63};
64static struct platform_device smc91x_device = {
65 .name = "smc91x",
66 .id = 0,
67 .num_resources = ARRAY_SIZE(smc91x_resources),
68 .resource = smc91x_resources,
Michael Hennerich61f09b52009-07-24 08:48:31 +000069 .dev = {
70 .platform_data = &smc91x_info,
71 },
Bryan Wu1394f032007-05-06 14:50:22 -070072};
73#endif
74
Mike Frysinger7036c612009-09-22 22:23:04 -040075#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
76static struct mtd_partition ezkit_partitions_a[] = {
77 {
78 .name = "bootloader(nor a)",
79 .size = 0x40000,
80 .offset = 0,
81 }, {
82 .name = "linux kernel(nor a)",
83 .size = MTDPART_SIZ_FULL,
84 .offset = MTDPART_OFS_APPEND,
85 },
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -040086};
87
Mike Frysinger7036c612009-09-22 22:23:04 -040088static struct physmap_flash_data ezkit_flash_data_a = {
89 .width = 2,
90 .parts = ezkit_partitions_a,
91 .nr_parts = ARRAY_SIZE(ezkit_partitions_a),
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -040092};
93
Mike Frysinger7036c612009-09-22 22:23:04 -040094static struct resource ezkit_flash_resource_a = {
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -040095 .start = 0x20000000,
96 .end = 0x200fffff,
97 .flags = IORESOURCE_MEM,
98};
99
Mike Frysinger7036c612009-09-22 22:23:04 -0400100static struct platform_device ezkit_flash_device_a = {
101 .name = "physmap-flash",
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -0400102 .id = 0,
103 .dev = {
Mike Frysinger7036c612009-09-22 22:23:04 -0400104 .platform_data = &ezkit_flash_data_a,
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -0400105 },
106 .num_resources = 1,
Mike Frysinger7036c612009-09-22 22:23:04 -0400107 .resource = &ezkit_flash_resource_a,
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -0400108};
109
Mike Frysinger7036c612009-09-22 22:23:04 -0400110static struct mtd_partition ezkit_partitions_b[] = {
111 {
112 .name = "file system(nor b)",
113 .size = MTDPART_SIZ_FULL,
114 .offset = MTDPART_OFS_APPEND,
115 },
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -0400116};
117
Mike Frysinger7036c612009-09-22 22:23:04 -0400118static struct physmap_flash_data ezkit_flash_data_b = {
119 .width = 2,
120 .parts = ezkit_partitions_b,
121 .nr_parts = ARRAY_SIZE(ezkit_partitions_b),
122};
123
124static struct resource ezkit_flash_resource_b = {
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -0400125 .start = 0x20100000,
126 .end = 0x201fffff,
127 .flags = IORESOURCE_MEM,
128};
129
Mike Frysinger7036c612009-09-22 22:23:04 -0400130static struct platform_device ezkit_flash_device_b = {
131 .name = "physmap-flash",
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -0400132 .id = 4,
133 .dev = {
Mike Frysinger7036c612009-09-22 22:23:04 -0400134 .platform_data = &ezkit_flash_data_b,
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -0400135 },
136 .num_resources = 1,
Mike Frysinger7036c612009-09-22 22:23:04 -0400137 .resource = &ezkit_flash_resource_b,
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -0400138};
139#endif
140
141#if defined(CONFIG_MTD_PLATRAM) || defined(CONFIG_MTD_PLATRAM_MODULE)
142static struct platdata_mtd_ram sram_data_a = {
143 .mapname = "Flash A SRAM",
144 .bankwidth = 2,
145};
146
147static struct resource sram_resource_a = {
148 .start = 0x20240000,
149 .end = 0x2024ffff,
150 .flags = IORESOURCE_MEM,
151};
152
153static struct platform_device sram_device_a = {
154 .name = "mtd-ram",
155 .id = 8,
156 .dev = {
157 .platform_data = &sram_data_a,
158 },
159 .num_resources = 1,
160 .resource = &sram_resource_a,
161};
162
163static struct platdata_mtd_ram sram_data_b = {
164 .mapname = "Flash B SRAM",
165 .bankwidth = 2,
166};
167
168static struct resource sram_resource_b = {
169 .start = 0x202c0000,
170 .end = 0x202cffff,
171 .flags = IORESOURCE_MEM,
172};
173
174static struct platform_device sram_device_b = {
175 .name = "mtd-ram",
176 .id = 9,
177 .dev = {
178 .platform_data = &sram_data_b,
179 },
180 .num_resources = 1,
181 .resource = &sram_resource_b,
182};
183#endif
184
Bryan Wu1394f032007-05-06 14:50:22 -0700185#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
186static struct mtd_partition bfin_spi_flash_partitions[] = {
187 {
Robin Getzaa582972008-08-05 17:47:29 +0800188 .name = "bootloader(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -0700189 .size = 0x00020000,
190 .offset = 0,
191 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800192 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800193 .name = "linux kernel(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -0700194 .size = 0xe0000,
Mike Frysingeredf05642008-02-25 11:38:11 +0800195 .offset = MTDPART_OFS_APPEND,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800196 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800197 .name = "file system(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800198 .size = MTDPART_SIZ_FULL,
199 .offset = MTDPART_OFS_APPEND,
Bryan Wu1394f032007-05-06 14:50:22 -0700200 }
201};
202
203static struct flash_platform_data bfin_spi_flash_data = {
204 .name = "m25p80",
205 .parts = bfin_spi_flash_partitions,
206 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
207 .type = "m25p64",
208};
209
210/* SPI flash chip (m25p64) */
211static struct bfin5xx_spi_chip spi_flash_chip_info = {
212 .enable_dma = 0, /* use dma transfer with this chip*/
213 .bits_per_word = 8,
214};
215#endif
216
Mike Frysingera261eec2009-05-20 14:05:36 +0000217#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700218/* SPI ADC chip */
219static struct bfin5xx_spi_chip spi_adc_chip_info = {
220 .enable_dma = 1, /* use dma transfer with this chip*/
221 .bits_per_word = 16,
222};
223#endif
224
225#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
226static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
227 .enable_dma = 0,
228 .bits_per_word = 16,
229};
230#endif
231
Michael Hennerich6e668932008-02-09 01:54:09 +0800232#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
233static struct bfin5xx_spi_chip spidev_chip_info = {
234 .enable_dma = 0,
235 .bits_per_word = 8,
236};
237#endif
238
Bryan Wu1394f032007-05-06 14:50:22 -0700239static struct spi_board_info bfin_spi_board_info[] __initdata = {
240#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
241 {
242 /* the modalias must be the same as spi device driver name */
243 .modalias = "m25p80", /* Name of spi_driver for this device */
244 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800245 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700246 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
247 .platform_data = &bfin_spi_flash_data,
248 .controller_data = &spi_flash_chip_info,
249 .mode = SPI_MODE_3,
250 },
251#endif
252
Mike Frysingera261eec2009-05-20 14:05:36 +0000253#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700254 {
255 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
256 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800257 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700258 .chip_select = 1, /* Framework chip select. */
259 .platform_data = NULL, /* No spi_driver specific config */
260 .controller_data = &spi_adc_chip_info,
261 },
262#endif
263
264#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
265 {
Barry Songdac98172009-08-13 21:07:37 +0000266 .modalias = "ad1836",
Bryan Wu1394f032007-05-06 14:50:22 -0700267 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800268 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700269 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
270 .controller_data = &ad1836_spi_chip_info,
271 },
272#endif
Michael Hennerich6e668932008-02-09 01:54:09 +0800273#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
274 {
275 .modalias = "spidev",
276 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
277 .bus_num = 0,
278 .chip_select = 1,
279 .controller_data = &spidev_chip_info,
280 },
281#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700282};
283
Mike Frysinger5bda2722008-06-07 15:03:01 +0800284#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800285/* SPI (0) */
286static struct resource bfin_spi0_resource[] = {
287 [0] = {
288 .start = SPI0_REGBASE,
289 .end = SPI0_REGBASE + 0xFF,
290 .flags = IORESOURCE_MEM,
291 },
292 [1] = {
293 .start = CH_SPI,
294 .end = CH_SPI,
Yi Li53122692009-06-05 12:11:11 +0000295 .flags = IORESOURCE_DMA,
296 },
297 [2] = {
298 .start = IRQ_SPI,
299 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800300 .flags = IORESOURCE_IRQ,
301 }
302};
303
Bryan Wu1394f032007-05-06 14:50:22 -0700304/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800305static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700306 .num_chipselect = 8,
307 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800308 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -0700309};
310
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800311static struct platform_device bfin_spi0_device = {
312 .name = "bfin-spi",
313 .id = 0, /* Bus number */
314 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
315 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -0700316 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800317 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -0700318 },
319};
320#endif /* spi master and devices */
321
322#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000323#ifdef CONFIG_SERIAL_BFIN_UART0
324static struct resource bfin_uart0_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -0700325 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000326 .start = BFIN_UART_THR,
327 .end = BFIN_UART_GCTL+2,
Bryan Wu1394f032007-05-06 14:50:22 -0700328 .flags = IORESOURCE_MEM,
329 },
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000330 {
331 .start = IRQ_UART0_RX,
332 .end = IRQ_UART0_RX + 1,
333 .flags = IORESOURCE_IRQ,
334 },
335 {
336 .start = IRQ_UART0_ERROR,
337 .end = IRQ_UART0_ERROR,
338 .flags = IORESOURCE_IRQ,
339 },
340 {
341 .start = CH_UART0_TX,
342 .end = CH_UART0_TX,
343 .flags = IORESOURCE_DMA,
344 },
345 {
346 .start = CH_UART0_RX,
347 .end = CH_UART0_RX,
348 .flags = IORESOURCE_DMA,
349 },
Bryan Wu1394f032007-05-06 14:50:22 -0700350};
351
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000352unsigned short bfin_uart0_peripherals[] = {
353 P_UART0_TX, P_UART0_RX, 0
Bryan Wu1394f032007-05-06 14:50:22 -0700354};
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000355
356static struct platform_device bfin_uart0_device = {
357 .name = "bfin-uart",
358 .id = 0,
359 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
360 .resource = bfin_uart0_resources,
361 .dev = {
362 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
363 },
364};
365#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700366#endif
367
Graf Yang5be36d22008-04-25 03:09:15 +0800368#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +0800369#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800370static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800371 {
372 .start = 0xFFC00400,
373 .end = 0xFFC004FF,
374 .flags = IORESOURCE_MEM,
375 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800376 {
377 .start = IRQ_UART0_RX,
378 .end = IRQ_UART0_RX+1,
379 .flags = IORESOURCE_IRQ,
380 },
381 {
382 .start = CH_UART0_RX,
383 .end = CH_UART0_RX+1,
384 .flags = IORESOURCE_DMA,
385 },
Graf Yang5be36d22008-04-25 03:09:15 +0800386};
387
Graf Yang42bd8bc2009-01-07 23:14:39 +0800388static struct platform_device bfin_sir0_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800389 .name = "bfin_sir",
390 .id = 0,
Graf Yang42bd8bc2009-01-07 23:14:39 +0800391 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
392 .resource = bfin_sir0_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800393};
394#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800395#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800396
Michael Hennerich2463ef22008-01-27 16:49:48 +0800397#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
398#include <linux/input.h>
399#include <linux/gpio_keys.h>
400
401static struct gpio_keys_button bfin_gpio_keys_table[] = {
402 {BTN_0, GPIO_PF7, 1, "gpio-keys: BTN0"},
403 {BTN_1, GPIO_PF8, 1, "gpio-keys: BTN1"},
404 {BTN_2, GPIO_PF9, 1, "gpio-keys: BTN2"},
405 {BTN_3, GPIO_PF10, 1, "gpio-keys: BTN3"},
406};
407
408static struct gpio_keys_platform_data bfin_gpio_keys_data = {
409 .buttons = bfin_gpio_keys_table,
410 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
411};
412
413static struct platform_device bfin_device_gpiokeys = {
414 .name = "gpio-keys",
415 .dev = {
416 .platform_data = &bfin_gpio_keys_data,
417 },
418};
419#endif
420
Bryan Wue3163952008-01-24 16:19:15 +0800421#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
422#include <linux/i2c-gpio.h>
423
424static struct i2c_gpio_platform_data i2c_gpio_data = {
425 .sda_pin = 1,
426 .scl_pin = 0,
427 .sda_is_open_drain = 0,
428 .scl_is_open_drain = 0,
429 .udelay = 40,
430};
431
432static struct platform_device i2c_gpio_device = {
433 .name = "i2c-gpio",
434 .id = 0,
435 .dev = {
436 .platform_data = &i2c_gpio_data,
437 },
438};
439#endif
440
Michael Hennerich14b03202008-05-07 11:41:26 +0800441static const unsigned int cclk_vlev_datasheet[] =
442{
443 VRPAIR(VLEV_085, 250000000),
444 VRPAIR(VLEV_090, 376000000),
445 VRPAIR(VLEV_095, 426000000),
446 VRPAIR(VLEV_100, 426000000),
447 VRPAIR(VLEV_105, 476000000),
448 VRPAIR(VLEV_110, 476000000),
449 VRPAIR(VLEV_115, 476000000),
450 VRPAIR(VLEV_120, 600000000),
451 VRPAIR(VLEV_125, 600000000),
452 VRPAIR(VLEV_130, 600000000),
453};
454
455static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
456 .tuple_tab = cclk_vlev_datasheet,
457 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
458 .vr_settling_time = 25 /* us */,
459};
460
461static struct platform_device bfin_dpmc = {
462 .name = "bfin dpmc",
463 .dev = {
464 .platform_data = &bfin_dmpc_vreg_data,
465 },
466};
467
Michael Hennerich50c4c082009-09-22 13:10:09 +0000468static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
469#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
470 {
471 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
472 },
473#endif
474};
475
Bryan Wu1394f032007-05-06 14:50:22 -0700476static struct platform_device *ezkit_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +0800477
478 &bfin_dpmc,
479
Mike Frysinger7036c612009-09-22 22:23:04 -0400480#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
481 &ezkit_flash_device_a,
482 &ezkit_flash_device_b,
Mike Frysinger4d5e6fd2009-06-13 06:34:49 -0400483#endif
484
485#if defined(CONFIG_MTD_PLATRAM) || defined(CONFIG_MTD_PLATRAM_MODULE)
486 &sram_device_a,
487 &sram_device_b,
488#endif
489
Bryan Wu1394f032007-05-06 14:50:22 -0700490#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
491 &smc91x_device,
492#endif
493
494#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800495 &bfin_spi0_device,
496#endif
497
Bryan Wu1394f032007-05-06 14:50:22 -0700498#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
499 &rtc_device,
500#endif
501
Sonic Zhange062cea2009-01-07 23:14:39 +0800502#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000503#ifdef CONFIG_SERIAL_BFIN_UART0
504 &bfin_uart0_device,
505#endif
Sonic Zhange062cea2009-01-07 23:14:39 +0800506#endif
507
Graf Yang5be36d22008-04-25 03:09:15 +0800508#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +0800509#ifdef CONFIG_BFIN_SIR0
510 &bfin_sir0_device,
511#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800512#endif
513
Michael Hennerich2463ef22008-01-27 16:49:48 +0800514#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
515 &bfin_device_gpiokeys,
516#endif
Bryan Wue3163952008-01-24 16:19:15 +0800517
518#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
519 &i2c_gpio_device,
520#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700521};
522
523static int __init ezkit_init(void)
524{
Harvey Harrisonb85d8582008-04-23 09:39:01 +0800525 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu1394f032007-05-06 14:50:22 -0700526 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
Bryan Wu1394f032007-05-06 14:50:22 -0700527 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
Michael Hennerich50c4c082009-09-22 13:10:09 +0000528 i2c_register_board_info(0, bfin_i2c_board_info,
529 ARRAY_SIZE(bfin_i2c_board_info));
Bryan Wu1394f032007-05-06 14:50:22 -0700530 return 0;
531}
532
533arch_initcall(ezkit_init);
Sonic Zhangc13ce9f2009-09-23 09:37:46 +0000534
535static struct platform_device *ezkit_early_devices[] __initdata = {
536#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
537#ifdef CONFIG_SERIAL_BFIN_UART0
538 &bfin_uart0_device,
539#endif
540#endif
541};
542
543void __init native_machine_early_platform_add_devices(void)
544{
545 printk(KERN_INFO "register early platform devices\n");
546 early_platform_add_devices(ezkit_early_devices,
547 ARRAY_SIZE(ezkit_early_devices));
548}