Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
[pandora-kernel.git] / arch / blackfin / mach-bf527 / boards / ezkit.c
1 /*
2  * Copyright 2004-2009 Analog Devices Inc.
3  *                2005 National ICT Australia (NICTA)
4  *                      Aidan Williams <aidan@nicta.com.au>
5  *
6  * Licensed under the GPL-2 or later.
7  */
8
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/musb.h>
20 #include <linux/leds.h>
21 #include <linux/input.h>
22 #include <asm/dma.h>
23 #include <asm/bfin5xx_spi.h>
24 #include <asm/reboot.h>
25 #include <asm/nand.h>
26 #include <asm/portmux.h>
27 #include <asm/dpmc.h>
28 #include <linux/spi/ad7877.h>
29
30 /*
31  * Name the Board for the /proc/cpuinfo
32  */
33 #ifdef CONFIG_BFIN527_EZKIT_V2
34 const char bfin_board_name[] = "ADI BF527-EZKIT V2";
35 #else
36 const char bfin_board_name[] = "ADI BF527-EZKIT";
37 #endif
38
39 /*
40  *  Driver needs to know address, irq and flag pin.
41  */
42
43 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
44 #include <linux/usb/isp1760.h>
45 static struct resource bfin_isp1760_resources[] = {
46         [0] = {
47                 .start  = 0x203C0000,
48                 .end    = 0x203C0000 + 0x000fffff,
49                 .flags  = IORESOURCE_MEM,
50         },
51         [1] = {
52                 .start  = IRQ_PF7,
53                 .end    = IRQ_PF7,
54                 .flags  = IORESOURCE_IRQ,
55         },
56 };
57
58 static struct isp1760_platform_data isp1760_priv = {
59         .is_isp1761 = 0,
60         .bus_width_16 = 1,
61         .port1_otg = 0,
62         .analog_oc = 0,
63         .dack_polarity_high = 0,
64         .dreq_polarity_high = 0,
65 };
66
67 static struct platform_device bfin_isp1760_device = {
68         .name           = "isp1760",
69         .id             = 0,
70         .dev = {
71                 .platform_data = &isp1760_priv,
72         },
73         .num_resources  = ARRAY_SIZE(bfin_isp1760_resources),
74         .resource       = bfin_isp1760_resources,
75 };
76 #endif
77
78 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
79 static struct resource musb_resources[] = {
80         [0] = {
81                 .start  = 0xffc03800,
82                 .end    = 0xffc03cff,
83                 .flags  = IORESOURCE_MEM,
84         },
85         [1] = { /* general IRQ */
86                 .start  = IRQ_USB_INT0,
87                 .end    = IRQ_USB_INT0,
88                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
89                 .name   = "mc"
90         },
91         [2] = { /* DMA IRQ */
92                 .start  = IRQ_USB_DMA,
93                 .end    = IRQ_USB_DMA,
94                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
95                 .name   = "dma"
96         },
97 };
98
99 static struct musb_hdrc_config musb_config = {
100         .multipoint     = 0,
101         .dyn_fifo       = 0,
102         .soft_con       = 1,
103         .dma            = 1,
104         .num_eps        = 8,
105         .dma_channels   = 8,
106         .gpio_vrsel     = GPIO_PG13,
107         /* Some custom boards need to be active low, just set it to "0"
108          * if it is the case.
109          */
110         .gpio_vrsel_active      = 1,
111 };
112
113 static struct musb_hdrc_platform_data musb_plat = {
114 #if defined(CONFIG_USB_MUSB_OTG)
115         .mode           = MUSB_OTG,
116 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
117         .mode           = MUSB_HOST,
118 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
119         .mode           = MUSB_PERIPHERAL,
120 #endif
121         .config         = &musb_config,
122 };
123
124 static u64 musb_dmamask = ~(u32)0;
125
126 static struct platform_device musb_device = {
127         .name           = "musb-blackfin",
128         .id             = 0,
129         .dev = {
130                 .dma_mask               = &musb_dmamask,
131                 .coherent_dma_mask      = 0xffffffff,
132                 .platform_data          = &musb_plat,
133         },
134         .num_resources  = ARRAY_SIZE(musb_resources),
135         .resource       = musb_resources,
136 };
137 #endif
138
139 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
140
141 static struct resource bf52x_t350mcqb_resources[] = {
142         {
143                 .start = IRQ_PPI_ERROR,
144                 .end = IRQ_PPI_ERROR,
145                 .flags = IORESOURCE_IRQ,
146         },
147 };
148
149 static struct platform_device bf52x_t350mcqb_device = {
150         .name           = "bfin-t350mcqb",
151         .id             = -1,
152         .num_resources  = ARRAY_SIZE(bf52x_t350mcqb_resources),
153         .resource       = bf52x_t350mcqb_resources,
154 };
155 #endif
156
157 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
158 #include <asm/bfin-lq035q1.h>
159
160 static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
161         .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
162         .ppi_mode = USE_RGB565_8_BIT_PPI,
163 };
164
165 static struct resource bfin_lq035q1_resources[] = {
166         {
167                 .start = IRQ_PPI_ERROR,
168                 .end = IRQ_PPI_ERROR,
169                 .flags = IORESOURCE_IRQ,
170         },
171 };
172
173 static struct platform_device bfin_lq035q1_device = {
174         .name           = "bfin-lq035q1",
175         .id             = -1,
176         .num_resources  = ARRAY_SIZE(bfin_lq035q1_resources),
177         .resource       = bfin_lq035q1_resources,
178         .dev            = {
179                 .platform_data = &bfin_lq035q1_data,
180         },
181 };
182 #endif
183
184 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
185 static struct mtd_partition ezkit_partitions[] = {
186         {
187                 .name       = "bootloader(nor)",
188                 .size       = 0x40000,
189                 .offset     = 0,
190         }, {
191                 .name       = "linux kernel(nor)",
192                 .size       = 0x1C0000,
193                 .offset     = MTDPART_OFS_APPEND,
194         }, {
195                 .name       = "file system(nor)",
196                 .size       = MTDPART_SIZ_FULL,
197                 .offset     = MTDPART_OFS_APPEND,
198         }
199 };
200
201 static struct physmap_flash_data ezkit_flash_data = {
202         .width      = 2,
203         .parts      = ezkit_partitions,
204         .nr_parts   = ARRAY_SIZE(ezkit_partitions),
205 };
206
207 static struct resource ezkit_flash_resource = {
208         .start = 0x20000000,
209         .end   = 0x203fffff,
210         .flags = IORESOURCE_MEM,
211 };
212
213 static struct platform_device ezkit_flash_device = {
214         .name          = "physmap-flash",
215         .id            = 0,
216         .dev = {
217                 .platform_data = &ezkit_flash_data,
218         },
219         .num_resources = 1,
220         .resource      = &ezkit_flash_resource,
221 };
222 #endif
223
224 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
225 static struct mtd_partition partition_info[] = {
226         {
227                 .name = "bootloader(nand)",
228                 .offset = 0,
229                 .size = 0x40000,
230         }, {
231                 .name = "linux kernel(nand)",
232                 .offset = MTDPART_OFS_APPEND,
233                 .size = 4 * 1024 * 1024,
234         },
235         {
236                 .name = "file system(nand)",
237                 .offset = MTDPART_OFS_APPEND,
238                 .size = MTDPART_SIZ_FULL,
239         },
240 };
241
242 static struct bf5xx_nand_platform bf5xx_nand_platform = {
243         .data_width = NFC_NWIDTH_8,
244         .partitions = partition_info,
245         .nr_partitions = ARRAY_SIZE(partition_info),
246         .rd_dly = 3,
247         .wr_dly = 3,
248 };
249
250 static struct resource bf5xx_nand_resources[] = {
251         {
252                 .start = NFC_CTL,
253                 .end = NFC_DATA_RD + 2,
254                 .flags = IORESOURCE_MEM,
255         },
256         {
257                 .start = CH_NFC,
258                 .end = CH_NFC,
259                 .flags = IORESOURCE_IRQ,
260         },
261 };
262
263 static struct platform_device bf5xx_nand_device = {
264         .name = "bf5xx-nand",
265         .id = 0,
266         .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
267         .resource = bf5xx_nand_resources,
268         .dev = {
269                 .platform_data = &bf5xx_nand_platform,
270         },
271 };
272 #endif
273
274 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
275 static struct resource bfin_pcmcia_cf_resources[] = {
276         {
277                 .start = 0x20310000, /* IO PORT */
278                 .end = 0x20312000,
279                 .flags = IORESOURCE_MEM,
280         }, {
281                 .start = 0x20311000, /* Attribute Memory */
282                 .end = 0x20311FFF,
283                 .flags = IORESOURCE_MEM,
284         }, {
285                 .start = IRQ_PF4,
286                 .end = IRQ_PF4,
287                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
288         }, {
289                 .start = 6, /* Card Detect PF6 */
290                 .end = 6,
291                 .flags = IORESOURCE_IRQ,
292         },
293 };
294
295 static struct platform_device bfin_pcmcia_cf_device = {
296         .name = "bfin_cf_pcmcia",
297         .id = -1,
298         .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
299         .resource = bfin_pcmcia_cf_resources,
300 };
301 #endif
302
303 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
304 static struct platform_device rtc_device = {
305         .name = "rtc-bfin",
306         .id   = -1,
307 };
308 #endif
309
310 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
311 #include <linux/smc91x.h>
312
313 static struct smc91x_platdata smc91x_info = {
314         .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
315         .leda = RPC_LED_100_10,
316         .ledb = RPC_LED_TX_RX,
317 };
318
319 static struct resource smc91x_resources[] = {
320         {
321                 .name = "smc91x-regs",
322                 .start = 0x20300300,
323                 .end = 0x20300300 + 16,
324                 .flags = IORESOURCE_MEM,
325         }, {
326
327                 .start = IRQ_PF7,
328                 .end = IRQ_PF7,
329                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
330         },
331 };
332 static struct platform_device smc91x_device = {
333         .name = "smc91x",
334         .id = 0,
335         .num_resources = ARRAY_SIZE(smc91x_resources),
336         .resource = smc91x_resources,
337         .dev    = {
338                 .platform_data  = &smc91x_info,
339         },
340 };
341 #endif
342
343 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
344 static struct resource dm9000_resources[] = {
345         [0] = {
346                 .start  = 0x203FB800,
347                 .end    = 0x203FB800 + 1,
348                 .flags  = IORESOURCE_MEM,
349         },
350         [1] = {
351                 .start  = 0x203FB800 + 4,
352                 .end    = 0x203FB800 + 5,
353                 .flags  = IORESOURCE_MEM,
354         },
355         [2] = {
356                 .start  = IRQ_PF9,
357                 .end    = IRQ_PF9,
358                 .flags  = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
359         },
360 };
361
362 static struct platform_device dm9000_device = {
363         .name           = "dm9000",
364         .id             = -1,
365         .num_resources  = ARRAY_SIZE(dm9000_resources),
366         .resource       = dm9000_resources,
367 };
368 #endif
369
370 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
371 #include <linux/bfin_mac.h>
372 static const unsigned short bfin_mac_peripherals[] = P_RMII0;
373
374 static struct bfin_phydev_platform_data bfin_phydev_data[] = {
375         {
376                 .addr = 1,
377                 .irq = IRQ_MAC_PHYINT,
378         },
379 };
380
381 static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
382         .phydev_number = 1,
383         .phydev_data = bfin_phydev_data,
384         .phy_mode = PHY_INTERFACE_MODE_RMII,
385         .mac_peripherals = bfin_mac_peripherals,
386 };
387
388 static struct platform_device bfin_mii_bus = {
389         .name = "bfin_mii_bus",
390         .dev = {
391                 .platform_data = &bfin_mii_bus_data,
392         }
393 };
394
395 static struct platform_device bfin_mac_device = {
396         .name = "bfin_mac",
397         .dev = {
398                 .platform_data = &bfin_mii_bus,
399         }
400 };
401 #endif
402
403 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
404 static struct resource net2272_bfin_resources[] = {
405         {
406                 .start = 0x20300000,
407                 .end = 0x20300000 + 0x100,
408                 .flags = IORESOURCE_MEM,
409         }, {
410                 .start = IRQ_PF7,
411                 .end = IRQ_PF7,
412                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
413         },
414 };
415
416 static struct platform_device net2272_bfin_device = {
417         .name = "net2272",
418         .id = -1,
419         .num_resources = ARRAY_SIZE(net2272_bfin_resources),
420         .resource = net2272_bfin_resources,
421 };
422 #endif
423
424 #if defined(CONFIG_MTD_M25P80) \
425         || defined(CONFIG_MTD_M25P80_MODULE)
426 static struct mtd_partition bfin_spi_flash_partitions[] = {
427         {
428                 .name = "bootloader(spi)",
429                 .size = 0x00040000,
430                 .offset = 0,
431                 .mask_flags = MTD_CAP_ROM
432         }, {
433                 .name = "linux kernel(spi)",
434                 .size = MTDPART_SIZ_FULL,
435                 .offset = MTDPART_OFS_APPEND,
436         }
437 };
438
439 static struct flash_platform_data bfin_spi_flash_data = {
440         .name = "m25p80",
441         .parts = bfin_spi_flash_partitions,
442         .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
443         .type = "m25p16",
444 };
445
446 /* SPI flash chip (m25p64) */
447 static struct bfin5xx_spi_chip spi_flash_chip_info = {
448         .enable_dma = 0,         /* use dma transfer with this chip*/
449         .bits_per_word = 8,
450 };
451 #endif
452
453 #if defined(CONFIG_BFIN_SPI_ADC) \
454         || defined(CONFIG_BFIN_SPI_ADC_MODULE)
455 /* SPI ADC chip */
456 static struct bfin5xx_spi_chip spi_adc_chip_info = {
457         .enable_dma = 1,         /* use dma transfer with this chip*/
458         .bits_per_word = 16,
459 };
460 #endif
461
462 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
463         || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
464 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
465         .enable_dma = 0,
466         .bits_per_word = 16,
467 };
468 #endif
469
470 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
471 static struct bfin5xx_spi_chip  mmc_spi_chip_info = {
472         .enable_dma = 0,
473         .bits_per_word = 8,
474 };
475 #endif
476
477 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
478 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
479         .enable_dma = 0,
480         .bits_per_word = 16,
481 };
482
483 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
484         .model                  = 7877,
485         .vref_delay_usecs       = 50,   /* internal, no capacitor */
486         .x_plate_ohms           = 419,
487         .y_plate_ohms           = 486,
488         .pressure_max           = 1000,
489         .pressure_min           = 0,
490         .stopacq_polarity       = 1,
491         .first_conversion_delay = 3,
492         .acquisition_time       = 1,
493         .averaging              = 1,
494         .pen_down_acc_interval  = 1,
495 };
496 #endif
497
498 #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
499 #include <linux/spi/ad7879.h>
500 static const struct ad7879_platform_data bfin_ad7879_ts_info = {
501         .model                  = 7879, /* Model = AD7879 */
502         .x_plate_ohms           = 620,  /* 620 Ohm from the touch datasheet */
503         .pressure_max           = 10000,
504         .pressure_min           = 0,
505         .first_conversion_delay = 3,    /* wait 512us before do a first conversion */
506         .acquisition_time       = 1,    /* 4us acquisition time per sample */
507         .median                 = 2,    /* do 8 measurements */
508         .averaging              = 1,    /* take the average of 4 middle samples */
509         .pen_down_acc_interval  = 255,  /* 9.4 ms */
510         .gpio_export            = 0,    /* Export GPIO to gpiolib */
511 };
512 #endif
513
514 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
515 static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
516         .enable_dma = 0,
517         .bits_per_word = 16,
518 };
519 #endif
520
521 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
522 static struct bfin5xx_spi_chip spidev_chip_info = {
523         .enable_dma = 0,
524         .bits_per_word = 8,
525 };
526 #endif
527
528 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
529 static struct platform_device bfin_i2s = {
530         .name = "bfin-i2s",
531         .id = CONFIG_SND_BF5XX_SPORT_NUM,
532         /* TODO: add platform data here */
533 };
534 #endif
535
536 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
537 static struct platform_device bfin_tdm = {
538         .name = "bfin-tdm",
539         .id = CONFIG_SND_BF5XX_SPORT_NUM,
540         /* TODO: add platform data here */
541 };
542 #endif
543
544 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
545 static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
546         .enable_dma     = 0,
547         .bits_per_word  = 8,
548 };
549 #endif
550
551 static struct spi_board_info bfin_spi_board_info[] __initdata = {
552 #if defined(CONFIG_MTD_M25P80) \
553         || defined(CONFIG_MTD_M25P80_MODULE)
554         {
555                 /* the modalias must be the same as spi device driver name */
556                 .modalias = "m25p80", /* Name of spi_driver for this device */
557                 .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
558                 .bus_num = 0, /* Framework bus number */
559                 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
560                 .platform_data = &bfin_spi_flash_data,
561                 .controller_data = &spi_flash_chip_info,
562                 .mode = SPI_MODE_3,
563         },
564 #endif
565
566 #if defined(CONFIG_BFIN_SPI_ADC) \
567         || defined(CONFIG_BFIN_SPI_ADC_MODULE)
568         {
569                 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
570                 .max_speed_hz = 6250000,     /* max spi clock (SCK) speed in HZ */
571                 .bus_num = 0, /* Framework bus number */
572                 .chip_select = 1, /* Framework chip select. */
573                 .platform_data = NULL, /* No spi_driver specific config */
574                 .controller_data = &spi_adc_chip_info,
575         },
576 #endif
577
578 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
579         || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
580         {
581                 .modalias = "ad183x",
582                 .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
583                 .bus_num = 0,
584                 .chip_select = 4,
585                 .controller_data = &ad1836_spi_chip_info,
586         },
587 #endif
588 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
589         {
590                 .modalias = "mmc_spi",
591                 .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
592                 .bus_num = 0,
593                 .chip_select = 3,
594                 .controller_data = &mmc_spi_chip_info,
595                 .mode = SPI_MODE_0,
596         },
597 #endif
598
599 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
600         {
601                 .modalias               = "ad7877",
602                 .platform_data          = &bfin_ad7877_ts_info,
603                 .irq                    = IRQ_PF8,
604                 .max_speed_hz   = 12500000,     /* max spi clock (SCK) speed in HZ */
605                 .bus_num        = 0,
606                 .chip_select  = 2,
607                 .controller_data = &spi_ad7877_chip_info,
608         },
609 #endif
610 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
611         {
612                 .modalias = "ad7879",
613                 .platform_data = &bfin_ad7879_ts_info,
614                 .irq = IRQ_PF8,
615                 .max_speed_hz = 5000000,     /* max spi clock (SCK) speed in HZ */
616                 .bus_num = 0,
617                 .chip_select = 3,
618                 .controller_data = &spi_ad7879_chip_info,
619                 .mode = SPI_CPHA | SPI_CPOL,
620         },
621 #endif
622 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
623         {
624                 .modalias = "spidev",
625                 .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
626                 .bus_num = 0,
627                 .chip_select = 1,
628                 .controller_data = &spidev_chip_info,
629         },
630 #endif
631 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
632         {
633                 .modalias = "bfin-lq035q1-spi",
634                 .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
635                 .bus_num = 0,
636                 .chip_select = 7,
637                 .controller_data = &lq035q1_spi_chip_info,
638                 .mode = SPI_CPHA | SPI_CPOL,
639         },
640 #endif
641 };
642
643 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
644 /* SPI controller data */
645 static struct bfin5xx_spi_master bfin_spi0_info = {
646         .num_chipselect = 8,
647         .enable_dma = 1,  /* master has the ability to do dma transfer */
648         .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
649 };
650
651 /* SPI (0) */
652 static struct resource bfin_spi0_resource[] = {
653         [0] = {
654                 .start = SPI0_REGBASE,
655                 .end   = SPI0_REGBASE + 0xFF,
656                 .flags = IORESOURCE_MEM,
657                 },
658         [1] = {
659                 .start = CH_SPI,
660                 .end   = CH_SPI,
661                 .flags = IORESOURCE_DMA,
662         },
663         [2] = {
664                 .start = IRQ_SPI,
665                 .end   = IRQ_SPI,
666                 .flags = IORESOURCE_IRQ,
667         },
668 };
669
670 static struct platform_device bfin_spi0_device = {
671         .name = "bfin-spi",
672         .id = 0, /* Bus number */
673         .num_resources = ARRAY_SIZE(bfin_spi0_resource),
674         .resource = bfin_spi0_resource,
675         .dev = {
676                 .platform_data = &bfin_spi0_info, /* Passed to driver */
677         },
678 };
679 #endif  /* spi master and devices */
680
681 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
682 #ifdef CONFIG_SERIAL_BFIN_UART0
683 static struct resource bfin_uart0_resources[] = {
684         {
685                 .start = UART0_THR,
686                 .end = UART0_GCTL+2,
687                 .flags = IORESOURCE_MEM,
688         },
689         {
690                 .start = IRQ_UART0_RX,
691                 .end = IRQ_UART0_RX+1,
692                 .flags = IORESOURCE_IRQ,
693         },
694         {
695                 .start = IRQ_UART0_ERROR,
696                 .end = IRQ_UART0_ERROR,
697                 .flags = IORESOURCE_IRQ,
698         },
699         {
700                 .start = CH_UART0_TX,
701                 .end = CH_UART0_TX,
702                 .flags = IORESOURCE_DMA,
703         },
704         {
705                 .start = CH_UART0_RX,
706                 .end = CH_UART0_RX,
707                 .flags = IORESOURCE_DMA,
708         },
709 };
710
711 unsigned short bfin_uart0_peripherals[] = {
712         P_UART0_TX, P_UART0_RX, 0
713 };
714
715 static struct platform_device bfin_uart0_device = {
716         .name = "bfin-uart",
717         .id = 0,
718         .num_resources = ARRAY_SIZE(bfin_uart0_resources),
719         .resource = bfin_uart0_resources,
720         .dev = {
721                 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
722         },
723 };
724 #endif
725 #ifdef CONFIG_SERIAL_BFIN_UART1
726 static struct resource bfin_uart1_resources[] = {
727         {
728                 .start = UART1_THR,
729                 .end = UART1_GCTL+2,
730                 .flags = IORESOURCE_MEM,
731         },
732         {
733                 .start = IRQ_UART1_RX,
734                 .end = IRQ_UART1_RX+1,
735                 .flags = IORESOURCE_IRQ,
736         },
737         {
738                 .start = IRQ_UART1_ERROR,
739                 .end = IRQ_UART1_ERROR,
740                 .flags = IORESOURCE_IRQ,
741         },
742         {
743                 .start = CH_UART1_TX,
744                 .end = CH_UART1_TX,
745                 .flags = IORESOURCE_DMA,
746         },
747         {
748                 .start = CH_UART1_RX,
749                 .end = CH_UART1_RX,
750                 .flags = IORESOURCE_DMA,
751         },
752 #ifdef CONFIG_BFIN_UART1_CTSRTS
753         {       /* CTS pin */
754                 .start = GPIO_PF9,
755                 .end = GPIO_PF9,
756                 .flags = IORESOURCE_IO,
757         },
758         {       /* RTS pin */
759                 .start = GPIO_PF10,
760                 .end = GPIO_PF10,
761                 .flags = IORESOURCE_IO,
762         },
763 #endif
764 };
765
766 unsigned short bfin_uart1_peripherals[] = {
767         P_UART1_TX, P_UART1_RX, 0
768 };
769
770 static struct platform_device bfin_uart1_device = {
771         .name = "bfin-uart",
772         .id = 1,
773         .num_resources = ARRAY_SIZE(bfin_uart1_resources),
774         .resource = bfin_uart1_resources,
775         .dev = {
776                 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
777         },
778 };
779 #endif
780 #endif
781
782 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
783 #ifdef CONFIG_BFIN_SIR0
784 static struct resource bfin_sir0_resources[] = {
785         {
786                 .start = 0xFFC00400,
787                 .end = 0xFFC004FF,
788                 .flags = IORESOURCE_MEM,
789         },
790         {
791                 .start = IRQ_UART0_RX,
792                 .end = IRQ_UART0_RX+1,
793                 .flags = IORESOURCE_IRQ,
794         },
795         {
796                 .start = CH_UART0_RX,
797                 .end = CH_UART0_RX+1,
798                 .flags = IORESOURCE_DMA,
799         },
800 };
801
802 static struct platform_device bfin_sir0_device = {
803         .name = "bfin_sir",
804         .id = 0,
805         .num_resources = ARRAY_SIZE(bfin_sir0_resources),
806         .resource = bfin_sir0_resources,
807 };
808 #endif
809 #ifdef CONFIG_BFIN_SIR1
810 static struct resource bfin_sir1_resources[] = {
811         {
812                 .start = 0xFFC02000,
813                 .end = 0xFFC020FF,
814                 .flags = IORESOURCE_MEM,
815         },
816         {
817                 .start = IRQ_UART1_RX,
818                 .end = IRQ_UART1_RX+1,
819                 .flags = IORESOURCE_IRQ,
820         },
821         {
822                 .start = CH_UART1_RX,
823                 .end = CH_UART1_RX+1,
824                 .flags = IORESOURCE_DMA,
825         },
826 };
827
828 static struct platform_device bfin_sir1_device = {
829         .name = "bfin_sir",
830         .id = 1,
831         .num_resources = ARRAY_SIZE(bfin_sir1_resources),
832         .resource = bfin_sir1_resources,
833 };
834 #endif
835 #endif
836
837 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
838 static struct resource bfin_twi0_resource[] = {
839         [0] = {
840                 .start = TWI0_REGBASE,
841                 .end   = TWI0_REGBASE,
842                 .flags = IORESOURCE_MEM,
843         },
844         [1] = {
845                 .start = IRQ_TWI,
846                 .end   = IRQ_TWI,
847                 .flags = IORESOURCE_IRQ,
848         },
849 };
850
851 static struct platform_device i2c_bfin_twi_device = {
852         .name = "i2c-bfin-twi",
853         .id = 0,
854         .num_resources = ARRAY_SIZE(bfin_twi0_resource),
855         .resource = bfin_twi0_resource,
856 };
857 #endif
858
859 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
860 #include <linux/mfd/adp5520.h>
861
862         /*
863          *  ADP5520/5501 LEDs Data
864          */
865
866 static struct led_info adp5520_leds[] = {
867         {
868                 .name = "adp5520-led1",
869                 .default_trigger = "none",
870                 .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
871         },
872 };
873
874 static struct adp5520_leds_platform_data adp5520_leds_data = {
875         .num_leds = ARRAY_SIZE(adp5520_leds),
876         .leds = adp5520_leds,
877         .fade_in = ADP5520_FADE_T_600ms,
878         .fade_out = ADP5520_FADE_T_600ms,
879         .led_on_time = ADP5520_LED_ONT_600ms,
880 };
881
882         /*
883          *  ADP5520 Keypad Data
884          */
885
886 static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
887         [ADP5520_KEY(3, 3)]     = KEY_1,
888         [ADP5520_KEY(2, 3)]     = KEY_2,
889         [ADP5520_KEY(1, 3)]     = KEY_3,
890         [ADP5520_KEY(0, 3)]     = KEY_UP,
891         [ADP5520_KEY(3, 2)]     = KEY_4,
892         [ADP5520_KEY(2, 2)]     = KEY_5,
893         [ADP5520_KEY(1, 2)]     = KEY_6,
894         [ADP5520_KEY(0, 2)]     = KEY_DOWN,
895         [ADP5520_KEY(3, 1)]     = KEY_7,
896         [ADP5520_KEY(2, 1)]     = KEY_8,
897         [ADP5520_KEY(1, 1)]     = KEY_9,
898         [ADP5520_KEY(0, 1)]     = KEY_DOT,
899         [ADP5520_KEY(3, 0)]     = KEY_BACKSPACE,
900         [ADP5520_KEY(2, 0)]     = KEY_0,
901         [ADP5520_KEY(1, 0)]     = KEY_HELP,
902         [ADP5520_KEY(0, 0)]     = KEY_ENTER,
903 };
904
905 static struct adp5520_keys_platform_data adp5520_keys_data = {
906         .rows_en_mask   = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0,
907         .cols_en_mask   = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0,
908         .keymap         = adp5520_keymap,
909         .keymapsize     = ARRAY_SIZE(adp5520_keymap),
910         .repeat         = 0,
911 };
912
913         /*
914          *  ADP5520/5501 Multifunction Device Init Data
915          */
916
917 static struct adp5520_platform_data adp5520_pdev_data = {
918         .leds = &adp5520_leds_data,
919         .keys = &adp5520_keys_data,
920 };
921
922 #endif
923
924 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
925 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
926         {
927                 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
928         },
929 #endif
930 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
931         {
932                 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
933                 .irq = IRQ_PF8,
934         },
935 #endif
936 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
937         {
938                 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
939         },
940 #endif
941 #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
942         {
943                 I2C_BOARD_INFO("ad7879", 0x2C),
944                 .irq = IRQ_PF8,
945                 .platform_data = (void *)&bfin_ad7879_ts_info,
946         },
947 #endif
948 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
949         {
950                 I2C_BOARD_INFO("pmic-adp5520", 0x32),
951                 .irq = IRQ_PF9,
952                 .platform_data = (void *)&adp5520_pdev_data,
953         },
954 #endif
955 #if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
956         {
957                 I2C_BOARD_INFO("ssm2602", 0x1b),
958         },
959 #endif
960 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
961         {
962                 I2C_BOARD_INFO("ad5252", 0x2f),
963         },
964 #endif
965 };
966
967 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
968 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
969 static struct resource bfin_sport0_uart_resources[] = {
970         {
971                 .start = SPORT0_TCR1,
972                 .end = SPORT0_MRCS3+4,
973                 .flags = IORESOURCE_MEM,
974         },
975         {
976                 .start = IRQ_SPORT0_RX,
977                 .end = IRQ_SPORT0_RX+1,
978                 .flags = IORESOURCE_IRQ,
979         },
980         {
981                 .start = IRQ_SPORT0_ERROR,
982                 .end = IRQ_SPORT0_ERROR,
983                 .flags = IORESOURCE_IRQ,
984         },
985 };
986
987 unsigned short bfin_sport0_peripherals[] = {
988         P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
989         P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
990 };
991
992 static struct platform_device bfin_sport0_uart_device = {
993         .name = "bfin-sport-uart",
994         .id = 0,
995         .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
996         .resource = bfin_sport0_uart_resources,
997         .dev = {
998                 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
999         },
1000 };
1001 #endif
1002 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1003 static struct resource bfin_sport1_uart_resources[] = {
1004         {
1005                 .start = SPORT1_TCR1,
1006                 .end = SPORT1_MRCS3+4,
1007                 .flags = IORESOURCE_MEM,
1008         },
1009         {
1010                 .start = IRQ_SPORT1_RX,
1011                 .end = IRQ_SPORT1_RX+1,
1012                 .flags = IORESOURCE_IRQ,
1013         },
1014         {
1015                 .start = IRQ_SPORT1_ERROR,
1016                 .end = IRQ_SPORT1_ERROR,
1017                 .flags = IORESOURCE_IRQ,
1018         },
1019 };
1020
1021 unsigned short bfin_sport1_peripherals[] = {
1022         P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
1023         P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
1024 };
1025
1026 static struct platform_device bfin_sport1_uart_device = {
1027         .name = "bfin-sport-uart",
1028         .id = 1,
1029         .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
1030         .resource = bfin_sport1_uart_resources,
1031         .dev = {
1032                 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
1033         },
1034 };
1035 #endif
1036 #endif
1037
1038 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1039 #include <linux/gpio_keys.h>
1040
1041 static struct gpio_keys_button bfin_gpio_keys_table[] = {
1042         {BTN_0, GPIO_PG0, 1, "gpio-keys: BTN0"},
1043         {BTN_1, GPIO_PG13, 1, "gpio-keys: BTN1"},
1044 };
1045
1046 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
1047         .buttons        = bfin_gpio_keys_table,
1048         .nbuttons       = ARRAY_SIZE(bfin_gpio_keys_table),
1049 };
1050
1051 static struct platform_device bfin_device_gpiokeys = {
1052         .name      = "gpio-keys",
1053         .dev = {
1054                 .platform_data = &bfin_gpio_keys_data,
1055         },
1056 };
1057 #endif
1058
1059 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
1060 #include <asm/bfin_rotary.h>
1061
1062 static struct bfin_rotary_platform_data bfin_rotary_data = {
1063         /*.rotary_up_key     = KEY_UP,*/
1064         /*.rotary_down_key   = KEY_DOWN,*/
1065         .rotary_rel_code   = REL_WHEEL,
1066         .rotary_button_key = KEY_ENTER,
1067         .debounce          = 10,        /* 0..17 */
1068         .mode              = ROT_QUAD_ENC | ROT_DEBE,
1069 };
1070
1071 static struct resource bfin_rotary_resources[] = {
1072         {
1073                 .start = IRQ_CNT,
1074                 .end = IRQ_CNT,
1075                 .flags = IORESOURCE_IRQ,
1076         },
1077 };
1078
1079 static struct platform_device bfin_rotary_device = {
1080         .name           = "bfin-rotary",
1081         .id             = -1,
1082         .num_resources  = ARRAY_SIZE(bfin_rotary_resources),
1083         .resource       = bfin_rotary_resources,
1084         .dev            = {
1085                 .platform_data = &bfin_rotary_data,
1086         },
1087 };
1088 #endif
1089
1090 static const unsigned int cclk_vlev_datasheet[] =
1091 {
1092         VRPAIR(VLEV_100, 400000000),
1093         VRPAIR(VLEV_105, 426000000),
1094         VRPAIR(VLEV_110, 500000000),
1095         VRPAIR(VLEV_115, 533000000),
1096         VRPAIR(VLEV_120, 600000000),
1097 };
1098
1099 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
1100         .tuple_tab = cclk_vlev_datasheet,
1101         .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
1102         .vr_settling_time = 25 /* us */,
1103 };
1104
1105 static struct platform_device bfin_dpmc = {
1106         .name = "bfin dpmc",
1107         .dev = {
1108                 .platform_data = &bfin_dmpc_vreg_data,
1109         },
1110 };
1111
1112 static struct platform_device *stamp_devices[] __initdata = {
1113
1114         &bfin_dpmc,
1115
1116 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
1117         &bf5xx_nand_device,
1118 #endif
1119
1120 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
1121         &bfin_pcmcia_cf_device,
1122 #endif
1123
1124 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1125         &rtc_device,
1126 #endif
1127
1128 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1129         &bfin_isp1760_device,
1130 #endif
1131
1132 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
1133         &musb_device,
1134 #endif
1135
1136 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
1137         &smc91x_device,
1138 #endif
1139
1140 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
1141         &dm9000_device,
1142 #endif
1143
1144 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
1145         &bfin_mii_bus,
1146         &bfin_mac_device,
1147 #endif
1148
1149 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
1150         &net2272_bfin_device,
1151 #endif
1152
1153 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1154         &bfin_spi0_device,
1155 #endif
1156
1157 #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
1158         &bf52x_t350mcqb_device,
1159 #endif
1160
1161 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1162         &bfin_lq035q1_device,
1163 #endif
1164
1165 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1166 #ifdef CONFIG_SERIAL_BFIN_UART0
1167         &bfin_uart0_device,
1168 #endif
1169 #ifdef CONFIG_SERIAL_BFIN_UART1
1170         &bfin_uart1_device,
1171 #endif
1172 #endif
1173
1174 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1175 #ifdef CONFIG_BFIN_SIR0
1176         &bfin_sir0_device,
1177 #endif
1178 #ifdef CONFIG_BFIN_SIR1
1179         &bfin_sir1_device,
1180 #endif
1181 #endif
1182
1183 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1184         &i2c_bfin_twi_device,
1185 #endif
1186
1187 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1188 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1189         &bfin_sport0_uart_device,
1190 #endif
1191 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1192         &bfin_sport1_uart_device,
1193 #endif
1194 #endif
1195
1196 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1197         &bfin_device_gpiokeys,
1198 #endif
1199
1200 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
1201         &bfin_rotary_device,
1202 #endif
1203
1204 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1205         &ezkit_flash_device,
1206 #endif
1207
1208 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1209         &bfin_i2s,
1210 #endif
1211
1212 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1213         &bfin_tdm,
1214 #endif
1215 };
1216
1217 static int __init ezkit_init(void)
1218 {
1219         printk(KERN_INFO "%s(): registering device resources\n", __func__);
1220         i2c_register_board_info(0, bfin_i2c_board_info,
1221                                 ARRAY_SIZE(bfin_i2c_board_info));
1222         platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
1223         spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
1224         return 0;
1225 }
1226
1227 arch_initcall(ezkit_init);
1228
1229 static struct platform_device *ezkit_early_devices[] __initdata = {
1230 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
1231 #ifdef CONFIG_SERIAL_BFIN_UART0
1232         &bfin_uart0_device,
1233 #endif
1234 #ifdef CONFIG_SERIAL_BFIN_UART1
1235         &bfin_uart1_device,
1236 #endif
1237 #endif
1238
1239 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
1240 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1241         &bfin_sport0_uart_device,
1242 #endif
1243 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1244         &bfin_sport1_uart_device,
1245 #endif
1246 #endif
1247 };
1248
1249 void __init native_machine_early_platform_add_devices(void)
1250 {
1251         printk(KERN_INFO "register early platform devices\n");
1252         early_platform_add_devices(ezkit_early_devices,
1253                 ARRAY_SIZE(ezkit_early_devices));
1254 }
1255
1256 void native_machine_restart(char *cmd)
1257 {
1258         /* workaround reboot hang when booting from SPI */
1259         if ((bfin_read_SYSCR() & 0x7) == 0x3)
1260                 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
1261 }
1262
1263 void bfin_get_ether_addr(char *addr)
1264 {
1265         /* the MAC is stored in OTP memory page 0xDF */
1266         u32 ret;
1267         u64 otp_mac;
1268         u32 (*otp_read)(u32 page, u32 flags, u64 *page_content) = (void *)0xEF00001A;
1269
1270         ret = otp_read(0xDF, 0x00, &otp_mac);
1271         if (!(ret & 0x1)) {
1272                 char *otp_mac_p = (char *)&otp_mac;
1273                 for (ret = 0; ret < 6; ++ret)
1274                         addr[ret] = otp_mac_p[5 - ret];
1275         }
1276 }
1277 EXPORT_SYMBOL(bfin_get_ether_addr);