[Blackfin] arch: Adjust the u-boot and kernel image partition size in mtd device.
[linux-2.6] / arch / blackfin / mach-bf548 / boards / ezkit.c
1 /*
2  * File:         arch/blackfin/mach-bf548/boards/ezkit.c
3  * Based on:     arch/blackfin/mach-bf537/boards/ezkit.c
4  * Author:       Aidan Williams <aidan@nicta.com.au>
5  *
6  * Created:
7  * Description:
8  *
9  * Modified:
10  *               Copyright 2005 National ICT Australia (NICTA)
11  *               Copyright 2004-2007 Analog Devices Inc.
12  *
13  * Bugs:         Enter bugs at http://blackfin.uclinux.org/
14  *
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.
19  *
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.
24  *
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
29  */
30
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 #include <linux/irq.h>
39 #include <linux/i2c.h>
40 #include <linux/interrupt.h>
41 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
42 #include <linux/usb/musb.h>
43 #endif
44 #include <asm/bfin5xx_spi.h>
45 #include <asm/cplb.h>
46 #include <asm/dma.h>
47 #include <asm/gpio.h>
48 #include <asm/nand.h>
49 #include <asm/portmux.h>
50 #include <asm/mach/bf54x_keys.h>
51 #include <linux/input.h>
52 #include <linux/spi/ad7877.h>
53
54 /*
55  * Name the Board for the /proc/cpuinfo
56  */
57 const char bfin_board_name[] = "ADSP-BF548-EZKIT";
58
59 /*
60  *  Driver needs to know address, irq and flag pin.
61  */
62
63 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
64
65 #include <asm/mach/bf54x-lq043.h>
66
67 static struct bfin_bf54xfb_mach_info bf54x_lq043_data = {
68         .width =        480,
69         .height =       272,
70         .xres =         {480, 480, 480},
71         .yres =         {272, 272, 272},
72         .bpp =          {24, 24, 24},
73         .disp =         GPIO_PE3,
74 };
75
76 static struct resource bf54x_lq043_resources[] = {
77         {
78                 .start = IRQ_EPPI0_ERR,
79                 .end = IRQ_EPPI0_ERR,
80                 .flags = IORESOURCE_IRQ,
81         },
82 };
83
84 static struct platform_device bf54x_lq043_device = {
85         .name           = "bf54x-lq043",
86         .id             = -1,
87         .num_resources  = ARRAY_SIZE(bf54x_lq043_resources),
88         .resource       = bf54x_lq043_resources,
89         .dev            = {
90                 .platform_data = &bf54x_lq043_data,
91         },
92 };
93 #endif
94
95 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
96 static const unsigned int bf548_keymap[] = {
97         KEYVAL(0, 0, KEY_ENTER),
98         KEYVAL(0, 1, KEY_HELP),
99         KEYVAL(0, 2, KEY_0),
100         KEYVAL(0, 3, KEY_BACKSPACE),
101         KEYVAL(1, 0, KEY_TAB),
102         KEYVAL(1, 1, KEY_9),
103         KEYVAL(1, 2, KEY_8),
104         KEYVAL(1, 3, KEY_7),
105         KEYVAL(2, 0, KEY_DOWN),
106         KEYVAL(2, 1, KEY_6),
107         KEYVAL(2, 2, KEY_5),
108         KEYVAL(2, 3, KEY_4),
109         KEYVAL(3, 0, KEY_UP),
110         KEYVAL(3, 1, KEY_3),
111         KEYVAL(3, 2, KEY_2),
112         KEYVAL(3, 3, KEY_1),
113 };
114
115 static struct bfin_kpad_platform_data bf54x_kpad_data = {
116         .rows                   = 4,
117         .cols                   = 4,
118         .keymap                 = bf548_keymap,
119         .keymapsize             = ARRAY_SIZE(bf548_keymap),
120         .repeat                 = 0,
121         .debounce_time          = 5000, /* ns (5ms) */
122         .coldrive_time          = 1000, /* ns (1ms) */
123         .keyup_test_interval    = 50, /* ms (50ms) */
124 };
125
126 static struct resource bf54x_kpad_resources[] = {
127         {
128                 .start = IRQ_KEY,
129                 .end = IRQ_KEY,
130                 .flags = IORESOURCE_IRQ,
131         },
132 };
133
134 static struct platform_device bf54x_kpad_device = {
135         .name           = "bf54x-keys",
136         .id             = -1,
137         .num_resources  = ARRAY_SIZE(bf54x_kpad_resources),
138         .resource       = bf54x_kpad_resources,
139         .dev            = {
140                 .platform_data = &bf54x_kpad_data,
141         },
142 };
143 #endif
144
145 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
146 static struct platform_device rtc_device = {
147         .name = "rtc-bfin",
148         .id   = -1,
149 };
150 #endif
151
152 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
153 static struct resource bfin_uart_resources[] = {
154 #ifdef CONFIG_SERIAL_BFIN_UART0
155         {
156                 .start = 0xFFC00400,
157                 .end = 0xFFC004FF,
158                 .flags = IORESOURCE_MEM,
159         },
160 #endif
161 #ifdef CONFIG_SERIAL_BFIN_UART1
162         {
163                 .start = 0xFFC02000,
164                 .end = 0xFFC020FF,
165                 .flags = IORESOURCE_MEM,
166         },
167 #endif
168 #ifdef CONFIG_SERIAL_BFIN_UART2
169         {
170                 .start = 0xFFC02100,
171                 .end = 0xFFC021FF,
172                 .flags = IORESOURCE_MEM,
173         },
174 #endif
175 #ifdef CONFIG_SERIAL_BFIN_UART3
176         {
177                 .start = 0xFFC03100,
178                 .end = 0xFFC031FF,
179         },
180 #endif
181 };
182
183 static struct platform_device bfin_uart_device = {
184         .name = "bfin-uart",
185         .id = 1,
186         .num_resources = ARRAY_SIZE(bfin_uart_resources),
187         .resource = bfin_uart_resources,
188 };
189 #endif
190
191 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
192 static struct resource smsc911x_resources[] = {
193         {
194                 .name = "smsc911x-memory",
195                 .start = 0x24000000,
196                 .end = 0x24000000 + 0xFF,
197                 .flags = IORESOURCE_MEM,
198         },
199         {
200                 .start = IRQ_PE8,
201                 .end = IRQ_PE8,
202                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
203         },
204 };
205 static struct platform_device smsc911x_device = {
206         .name = "smsc911x",
207         .id = 0,
208         .num_resources = ARRAY_SIZE(smsc911x_resources),
209         .resource = smsc911x_resources,
210 };
211 #endif
212
213 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
214 static struct resource musb_resources[] = {
215         [0] = {
216                 .start  = 0xFFC03C00,
217                 .end    = 0xFFC040FF,
218                 .flags  = IORESOURCE_MEM,
219         },
220         [1] = { /* general IRQ */
221                 .start  = IRQ_USB_INT0,
222                 .end    = IRQ_USB_INT0,
223                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
224         },
225         [2] = { /* DMA IRQ */
226                 .start  = IRQ_USB_DMA,
227                 .end    = IRQ_USB_DMA,
228                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
229         },
230 };
231
232 static struct musb_hdrc_platform_data musb_plat = {
233 #if defined(CONFIG_USB_MUSB_OTG)
234         .mode           = MUSB_OTG,
235 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
236         .mode           = MUSB_HOST,
237 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
238         .mode           = MUSB_PERIPHERAL,
239 #endif
240         .multipoint     = 0,
241 };
242
243 static u64 musb_dmamask = ~(u32)0;
244
245 static struct platform_device musb_device = {
246         .name           = "musb_hdrc",
247         .id             = 0,
248         .dev = {
249                 .dma_mask               = &musb_dmamask,
250                 .coherent_dma_mask      = 0xffffffff,
251                 .platform_data          = &musb_plat,
252         },
253         .num_resources  = ARRAY_SIZE(musb_resources),
254         .resource       = musb_resources,
255 };
256 #endif
257
258 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
259 static struct resource bfin_atapi_resources[] = {
260         {
261                 .start = 0xFFC03800,
262                 .end = 0xFFC0386F,
263                 .flags = IORESOURCE_MEM,
264         },
265         {
266                 .start = IRQ_ATAPI_ERR,
267                 .end = IRQ_ATAPI_ERR,
268                 .flags = IORESOURCE_IRQ,
269         },
270 };
271
272 static struct platform_device bfin_atapi_device = {
273         .name = "pata-bf54x",
274         .id = -1,
275         .num_resources = ARRAY_SIZE(bfin_atapi_resources),
276         .resource = bfin_atapi_resources,
277 };
278 #endif
279
280 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
281 static struct mtd_partition partition_info[] = {
282         {
283                 .name = "Linux Kernel",
284                 .offset = 0,
285                 .size = 4 * SIZE_1M,
286         },
287         {
288                 .name = "File System",
289                 .offset = MTDPART_OFS_APPEND,
290                 .size = MTDPART_SIZ_FULL,
291         },
292 };
293
294 static struct bf5xx_nand_platform bf5xx_nand_platform = {
295         .page_size = NFC_PG_SIZE_256,
296         .data_width = NFC_NWIDTH_8,
297         .partitions = partition_info,
298         .nr_partitions = ARRAY_SIZE(partition_info),
299         .rd_dly = 3,
300         .wr_dly = 3,
301 };
302
303 static struct resource bf5xx_nand_resources[] = {
304         {
305                 .start = 0xFFC03B00,
306                 .end = 0xFFC03B4F,
307                 .flags = IORESOURCE_MEM,
308         },
309         {
310                 .start = CH_NFC,
311                 .end = CH_NFC,
312                 .flags = IORESOURCE_IRQ,
313         },
314 };
315
316 static struct platform_device bf5xx_nand_device = {
317         .name = "bf5xx-nand",
318         .id = 0,
319         .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
320         .resource = bf5xx_nand_resources,
321         .dev = {
322                 .platform_data = &bf5xx_nand_platform,
323         },
324 };
325 #endif
326
327 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
328 static struct platform_device bf54x_sdh_device = {
329         .name = "bfin-sdh",
330         .id = 0,
331 };
332 #endif
333
334 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
335 static struct mtd_partition ezkit_partitions[] = {
336         {
337                 .name       = "Bootloader",
338                 .size       = 0x40000,
339                 .offset     = 0,
340         }, {
341                 .name       = "Kernel",
342                 .size       = 0x1C0000,
343                 .offset     = MTDPART_OFS_APPEND,
344         }, {
345                 .name       = "RootFS",
346                 .size       = MTDPART_SIZ_FULL,
347                 .offset     = MTDPART_OFS_APPEND,
348         }
349 };
350
351 static struct physmap_flash_data ezkit_flash_data = {
352         .width      = 2,
353         .parts      = ezkit_partitions,
354         .nr_parts   = ARRAY_SIZE(ezkit_partitions),
355 };
356
357 static struct resource ezkit_flash_resource = {
358         .start = 0x20000000,
359         .end   = 0x20ffffff,
360         .flags = IORESOURCE_MEM,
361 };
362
363 static struct platform_device ezkit_flash_device = {
364         .name          = "physmap-flash",
365         .id            = 0,
366         .dev = {
367                 .platform_data = &ezkit_flash_data,
368         },
369         .num_resources = 1,
370         .resource      = &ezkit_flash_resource,
371 };
372 #endif
373
374 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
375 /* all SPI peripherals info goes here */
376 #if defined(CONFIG_MTD_M25P80) \
377         || defined(CONFIG_MTD_M25P80_MODULE)
378 /* SPI flash chip (m25p16) */
379 static struct mtd_partition bfin_spi_flash_partitions[] = {
380         {
381                 .name = "bootloader",
382                 .size = 0x00040000,
383                 .offset = 0,
384                 .mask_flags = MTD_CAP_ROM
385         }, {
386                 .name = "linux kernel",
387                 .size = MTDPART_SIZ_FULL,
388                 .offset = MTDPART_OFS_APPEND,
389         }
390 };
391
392 static struct flash_platform_data bfin_spi_flash_data = {
393         .name = "m25p80",
394         .parts = bfin_spi_flash_partitions,
395         .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
396         .type = "m25p16",
397 };
398
399 static struct bfin5xx_spi_chip spi_flash_chip_info = {
400         .enable_dma = 0,         /* use dma transfer with this chip*/
401         .bits_per_word = 8,
402         .cs_change_per_word = 0,
403 };
404 #endif
405
406 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
407         || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
408 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
409         .enable_dma = 0,
410         .bits_per_word = 16,
411 };
412 #endif
413
414 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
415 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
416         .cs_change_per_word = 0,
417         .enable_dma = 0,
418         .bits_per_word = 16,
419 };
420
421 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
422         .model                  = 7877,
423         .vref_delay_usecs       = 50,   /* internal, no capacitor */
424         .x_plate_ohms           = 419,
425         .y_plate_ohms           = 486,
426         .pressure_max           = 1000,
427         .pressure_min           = 0,
428         .stopacq_polarity       = 1,
429         .first_conversion_delay = 3,
430         .acquisition_time       = 1,
431         .averaging              = 1,
432         .pen_down_acc_interval  = 1,
433 };
434 #endif
435
436 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
437 static struct bfin5xx_spi_chip spidev_chip_info = {
438         .enable_dma = 0,
439         .bits_per_word = 8,
440 };
441 #endif
442
443 static struct spi_board_info bf54x_spi_board_info[] __initdata = {
444 #if defined(CONFIG_MTD_M25P80) \
445         || defined(CONFIG_MTD_M25P80_MODULE)
446         {
447                 /* the modalias must be the same as spi device driver name */
448                 .modalias = "m25p80", /* Name of spi_driver for this device */
449                 .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
450                 .bus_num = 0, /* Framework bus number */
451                 .chip_select = 1, /* SPI_SSEL1*/
452                 .platform_data = &bfin_spi_flash_data,
453                 .controller_data = &spi_flash_chip_info,
454                 .mode = SPI_MODE_3,
455         },
456 #endif
457 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
458         || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
459         {
460                 .modalias = "ad1836-spi",
461                 .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
462                 .bus_num = 1,
463                 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
464                 .controller_data = &ad1836_spi_chip_info,
465         },
466 #endif
467 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
468 {
469         .modalias               = "ad7877",
470         .platform_data          = &bfin_ad7877_ts_info,
471         .irq                    = IRQ_PJ11,
472         .max_speed_hz           = 12500000,     /* max spi clock (SCK) speed in HZ */
473         .bus_num                = 0,
474         .chip_select            = 2,
475         .controller_data = &spi_ad7877_chip_info,
476 },
477 #endif
478 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
479         {
480                 .modalias = "spidev",
481                 .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
482                 .bus_num = 0,
483                 .chip_select = 1,
484                 .controller_data = &spidev_chip_info,
485         },
486 #endif
487 };
488
489 /* SPI (0) */
490 static struct resource bfin_spi0_resource[] = {
491         [0] = {
492                 .start = SPI0_REGBASE,
493                 .end   = SPI0_REGBASE + 0xFF,
494                 .flags = IORESOURCE_MEM,
495         },
496         [1] = {
497                 .start = CH_SPI0,
498                 .end   = CH_SPI0,
499                 .flags = IORESOURCE_IRQ,
500         }
501 };
502
503 /* SPI (1) */
504 static struct resource bfin_spi1_resource[] = {
505         [0] = {
506                 .start = SPI1_REGBASE,
507                 .end   = SPI1_REGBASE + 0xFF,
508                 .flags = IORESOURCE_MEM,
509         },
510         [1] = {
511                 .start = CH_SPI1,
512                 .end   = CH_SPI1,
513                 .flags = IORESOURCE_IRQ,
514         }
515 };
516
517 /* SPI controller data */
518 static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
519         .num_chipselect = 8,
520         .enable_dma = 1,  /* master has the ability to do dma transfer */
521         .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
522 };
523
524 static struct platform_device bf54x_spi_master0 = {
525         .name = "bfin-spi",
526         .id = 0, /* Bus number */
527         .num_resources = ARRAY_SIZE(bfin_spi0_resource),
528         .resource = bfin_spi0_resource,
529         .dev = {
530                 .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
531                 },
532 };
533
534 static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
535         .num_chipselect = 8,
536         .enable_dma = 1,  /* master has the ability to do dma transfer */
537         .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
538 };
539
540 static struct platform_device bf54x_spi_master1 = {
541         .name = "bfin-spi",
542         .id = 1, /* Bus number */
543         .num_resources = ARRAY_SIZE(bfin_spi1_resource),
544         .resource = bfin_spi1_resource,
545         .dev = {
546                 .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
547                 },
548 };
549 #endif  /* spi master and devices */
550
551 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
552 static struct resource bfin_twi0_resource[] = {
553         [0] = {
554                 .start = TWI0_REGBASE,
555                 .end   = TWI0_REGBASE + 0xFF,
556                 .flags = IORESOURCE_MEM,
557         },
558         [1] = {
559                 .start = IRQ_TWI0,
560                 .end   = IRQ_TWI0,
561                 .flags = IORESOURCE_IRQ,
562         },
563 };
564
565 static struct platform_device i2c_bfin_twi0_device = {
566         .name = "i2c-bfin-twi",
567         .id = 0,
568         .num_resources = ARRAY_SIZE(bfin_twi0_resource),
569         .resource = bfin_twi0_resource,
570 };
571
572 #if !defined(CONFIG_BF542)      /* The BF542 only has 1 TWI */
573 static struct resource bfin_twi1_resource[] = {
574         [0] = {
575                 .start = TWI1_REGBASE,
576                 .end   = TWI1_REGBASE + 0xFF,
577                 .flags = IORESOURCE_MEM,
578         },
579         [1] = {
580                 .start = IRQ_TWI1,
581                 .end   = IRQ_TWI1,
582                 .flags = IORESOURCE_IRQ,
583         },
584 };
585
586 static struct platform_device i2c_bfin_twi1_device = {
587         .name = "i2c-bfin-twi",
588         .id = 1,
589         .num_resources = ARRAY_SIZE(bfin_twi1_resource),
590         .resource = bfin_twi1_resource,
591 };
592 #endif
593 #endif
594
595 #ifdef CONFIG_I2C_BOARDINFO
596 static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
597 };
598
599 #if !defined(CONFIG_BF542)      /* The BF542 only has 1 TWI */
600 static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
601 #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
602         {
603                 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
604                 .type = "pcf8574_lcd",
605         },
606 #endif
607 #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
608         {
609                 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
610                 .type = "pcf8574_keypad",
611                 .irq = 212,
612         },
613 #endif
614 };
615 #endif
616 #endif
617
618 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
619 #include <linux/gpio_keys.h>
620
621 static struct gpio_keys_button bfin_gpio_keys_table[] = {
622         {BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"},
623         {BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"},
624         {BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"},
625         {BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"},
626 };
627
628 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
629         .buttons        = bfin_gpio_keys_table,
630         .nbuttons       = ARRAY_SIZE(bfin_gpio_keys_table),
631 };
632
633 static struct platform_device bfin_device_gpiokeys = {
634         .name      = "gpio-keys",
635         .dev = {
636                 .platform_data = &bfin_gpio_keys_data,
637         },
638 };
639 #endif
640
641 static struct resource bfin_gpios_resources = {
642         .start = 0,
643         .end   = MAX_BLACKFIN_GPIOS - 1,
644         .flags = IORESOURCE_IRQ,
645 };
646
647 static struct platform_device bfin_gpios_device = {
648         .name = "simple-gpio",
649         .id = -1,
650         .num_resources = 1,
651         .resource = &bfin_gpios_resources,
652 };
653
654 static struct platform_device *ezkit_devices[] __initdata = {
655 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
656         &rtc_device,
657 #endif
658
659 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
660         &bfin_uart_device,
661 #endif
662
663 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
664         &bf54x_lq043_device,
665 #endif
666
667 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
668         &smsc911x_device,
669 #endif
670
671 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
672         &musb_device,
673 #endif
674
675 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
676         &bfin_atapi_device,
677 #endif
678
679 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
680         &bf5xx_nand_device,
681 #endif
682
683 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
684         &bf54x_sdh_device,
685 #endif
686
687 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
688         &bf54x_spi_master0,
689         &bf54x_spi_master1,
690 #endif
691
692 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
693         &bf54x_kpad_device,
694 #endif
695
696 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
697         &i2c_bfin_twi0_device,
698 #if !defined(CONFIG_BF542)
699         &i2c_bfin_twi1_device,
700 #endif
701 #endif
702
703 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
704         &bfin_device_gpiokeys,
705 #endif
706
707         &bfin_gpios_device,
708
709 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
710         &ezkit_flash_device,
711 #endif
712 };
713
714 static int __init ezkit_init(void)
715 {
716         printk(KERN_INFO "%s(): registering device resources\n", __func__);
717
718 #ifdef CONFIG_I2C_BOARDINFO
719         i2c_register_board_info(0, bfin_i2c_board_info0,
720                                 ARRAY_SIZE(bfin_i2c_board_info0));
721 #if !defined(CONFIG_BF542)      /* The BF542 only has 1 TWI */
722         i2c_register_board_info(1, bfin_i2c_board_info1,
723                                 ARRAY_SIZE(bfin_i2c_board_info1));
724 #endif
725 #endif
726
727         platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
728
729 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
730         spi_register_board_info(bf54x_spi_board_info,
731                         ARRAY_SIZE(bf54x_spi_board_info));
732 #endif
733
734         return 0;
735 }
736
737 arch_initcall(ezkit_init);