Merge branch 'linus' into sched/devel
[linux-2.6] / arch / blackfin / mach-bf537 / boards / generic_board.c
1 /*
2  * File:         arch/blackfin/mach-bf537/boards/generic_board.c
3  * Based on:     arch/blackfin/mach-bf533/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-2008 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/etherdevice.h>
33 #include <linux/platform_device.h>
34 #include <linux/mtd/mtd.h>
35 #include <linux/mtd/partitions.h>
36 #include <linux/spi/spi.h>
37 #include <linux/spi/flash.h>
38 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
39 #include <linux/usb/isp1362.h>
40 #endif
41 #include <linux/irq.h>
42 #include <linux/interrupt.h>
43 #include <linux/usb/sl811.h>
44 #include <asm/dma.h>
45 #include <asm/bfin5xx_spi.h>
46 #include <asm/reboot.h>
47 #include <asm/portmux.h>
48 #include <linux/spi/ad7877.h>
49
50 /*
51  * Name the Board for the /proc/cpuinfo
52  */
53 const char bfin_board_name[] = "GENERIC Board";
54
55 /*
56  *  Driver needs to know address, irq and flag pin.
57  */
58
59 #define ISP1761_BASE       0x203C0000
60 #define ISP1761_IRQ        IRQ_PF7
61
62 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
63 static struct resource bfin_isp1761_resources[] = {
64         [0] = {
65                 .name   = "isp1761-regs",
66                 .start  = ISP1761_BASE + 0x00000000,
67                 .end    = ISP1761_BASE + 0x000fffff,
68                 .flags  = IORESOURCE_MEM,
69         },
70         [1] = {
71                 .start  = ISP1761_IRQ,
72                 .end    = ISP1761_IRQ,
73                 .flags  = IORESOURCE_IRQ,
74         },
75 };
76
77 static struct platform_device bfin_isp1761_device = {
78         .name           = "isp1761",
79         .id             = 0,
80         .num_resources  = ARRAY_SIZE(bfin_isp1761_resources),
81         .resource       = bfin_isp1761_resources,
82 };
83
84 static struct platform_device *bfin_isp1761_devices[] = {
85         &bfin_isp1761_device,
86 };
87
88 int __init bfin_isp1761_init(void)
89 {
90         unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
91
92         printk(KERN_INFO "%s(): registering device resources\n", __func__);
93         set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
94
95         return platform_add_devices(bfin_isp1761_devices, num_devices);
96 }
97
98 void __exit bfin_isp1761_exit(void)
99 {
100         platform_device_unregister(&bfin_isp1761_device);
101 }
102
103 arch_initcall(bfin_isp1761_init);
104 #endif
105
106 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
107 static struct resource bfin_pcmcia_cf_resources[] = {
108         {
109                 .start = 0x20310000, /* IO PORT */
110                 .end = 0x20312000,
111                 .flags = IORESOURCE_MEM,
112         }, {
113                 .start = 0x20311000, /* Attribute Memory */
114                 .end = 0x20311FFF,
115                 .flags = IORESOURCE_MEM,
116         }, {
117                 .start = IRQ_PF4,
118                 .end = IRQ_PF4,
119                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
120         }, {
121                 .start = 6, /* Card Detect PF6 */
122                 .end = 6,
123                 .flags = IORESOURCE_IRQ,
124         },
125 };
126
127 static struct platform_device bfin_pcmcia_cf_device = {
128         .name = "bfin_cf_pcmcia",
129         .id = -1,
130         .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
131         .resource = bfin_pcmcia_cf_resources,
132 };
133 #endif
134
135 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
136 static struct platform_device rtc_device = {
137         .name = "rtc-bfin",
138         .id   = -1,
139 };
140 #endif
141
142 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
143 static struct resource smc91x_resources[] = {
144         {
145                 .name = "smc91x-regs",
146                 .start = 0x20300300,
147                 .end = 0x20300300 + 16,
148                 .flags = IORESOURCE_MEM,
149         }, {
150
151                 .start = IRQ_PF7,
152                 .end = IRQ_PF7,
153                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
154         },
155 };
156 static struct platform_device smc91x_device = {
157         .name = "smc91x",
158         .id = 0,
159         .num_resources = ARRAY_SIZE(smc91x_resources),
160         .resource = smc91x_resources,
161 };
162 #endif
163
164 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
165 static struct resource dm9000_resources[] = {
166         [0] = {
167                 .start  = 0x203FB800,
168                 .end    = 0x203FB800 + 1,
169                 .flags  = IORESOURCE_MEM,
170         },
171         [1] = {
172                 .start  = 0x203FB800 + 4,
173                 .end    = 0x203FB800 + 5,
174                 .flags  = IORESOURCE_MEM,
175         },
176         [2] = {
177                 .start  = IRQ_PF9,
178                 .end    = IRQ_PF9,
179                 .flags  = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
180         },
181 };
182
183 static struct platform_device dm9000_device = {
184         .name           = "dm9000",
185         .id             = -1,
186         .num_resources  = ARRAY_SIZE(dm9000_resources),
187         .resource       = dm9000_resources,
188 };
189 #endif
190
191 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
192 static struct resource sl811_hcd_resources[] = {
193         {
194                 .start = 0x20340000,
195                 .end = 0x20340000,
196                 .flags = IORESOURCE_MEM,
197         }, {
198                 .start = 0x20340004,
199                 .end = 0x20340004,
200                 .flags = IORESOURCE_MEM,
201         }, {
202                 .start = CONFIG_USB_SL811_BFIN_IRQ,
203                 .end = CONFIG_USB_SL811_BFIN_IRQ,
204                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
205         },
206 };
207
208 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
209 void sl811_port_power(struct device *dev, int is_on)
210 {
211         gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
212         gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
213
214 }
215 #endif
216
217 static struct sl811_platform_data sl811_priv = {
218         .potpg = 10,
219         .power = 250,       /* == 500mA */
220 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
221         .port_power = &sl811_port_power,
222 #endif
223 };
224
225 static struct platform_device sl811_hcd_device = {
226         .name = "sl811-hcd",
227         .id = 0,
228         .dev = {
229                 .platform_data = &sl811_priv,
230         },
231         .num_resources = ARRAY_SIZE(sl811_hcd_resources),
232         .resource = sl811_hcd_resources,
233 };
234 #endif
235
236 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
237 static struct resource isp1362_hcd_resources[] = {
238         {
239                 .start = 0x20360000,
240                 .end = 0x20360000,
241                 .flags = IORESOURCE_MEM,
242         }, {
243                 .start = 0x20360004,
244                 .end = 0x20360004,
245                 .flags = IORESOURCE_MEM,
246         }, {
247                 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
248                 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
249                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
250         },
251 };
252
253 static struct isp1362_platform_data isp1362_priv = {
254         .sel15Kres = 1,
255         .clknotstop = 0,
256         .oc_enable = 0,
257         .int_act_high = 0,
258         .int_edge_triggered = 0,
259         .remote_wakeup_connected = 0,
260         .no_power_switching = 1,
261         .power_switching_mode = 0,
262 };
263
264 static struct platform_device isp1362_hcd_device = {
265         .name = "isp1362-hcd",
266         .id = 0,
267         .dev = {
268                 .platform_data = &isp1362_priv,
269         },
270         .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
271         .resource = isp1362_hcd_resources,
272 };
273 #endif
274
275 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
276 static struct platform_device bfin_mac_device = {
277         .name = "bfin_mac",
278 };
279 #endif
280
281 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
282 static struct resource net2272_bfin_resources[] = {
283         {
284                 .start = 0x20300000,
285                 .end = 0x20300000 + 0x100,
286                 .flags = IORESOURCE_MEM,
287         }, {
288                 .start = IRQ_PF7,
289                 .end = IRQ_PF7,
290                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
291         },
292 };
293
294 static struct platform_device net2272_bfin_device = {
295         .name = "net2272",
296         .id = -1,
297         .num_resources = ARRAY_SIZE(net2272_bfin_resources),
298         .resource = net2272_bfin_resources,
299 };
300 #endif
301
302 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
303 /* all SPI peripherals info goes here */
304
305 #if defined(CONFIG_MTD_M25P80) \
306         || defined(CONFIG_MTD_M25P80_MODULE)
307 static struct mtd_partition bfin_spi_flash_partitions[] = {
308         {
309                 .name = "bootloader(spi)",
310                 .size = 0x00020000,
311                 .offset = 0,
312                 .mask_flags = MTD_CAP_ROM
313         }, {
314                 .name = "linux kernel(spi)",
315                 .size = 0xe0000,
316                 .offset = 0x20000
317         }, {
318                 .name = "file system(spi)",
319                 .size = 0x700000,
320                 .offset = 0x00100000,
321         }
322 };
323
324 static struct flash_platform_data bfin_spi_flash_data = {
325         .name = "m25p80",
326         .parts = bfin_spi_flash_partitions,
327         .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
328         .type = "m25p64",
329 };
330
331 /* SPI flash chip (m25p64) */
332 static struct bfin5xx_spi_chip spi_flash_chip_info = {
333         .enable_dma = 0,         /* use dma transfer with this chip*/
334         .bits_per_word = 8,
335 };
336 #endif
337
338 #if defined(CONFIG_SPI_ADC_BF533) \
339         || defined(CONFIG_SPI_ADC_BF533_MODULE)
340 /* SPI ADC chip */
341 static struct bfin5xx_spi_chip spi_adc_chip_info = {
342         .enable_dma = 1,         /* use dma transfer with this chip*/
343         .bits_per_word = 16,
344 };
345 #endif
346
347 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
348         || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
349 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
350         .enable_dma = 0,
351         .bits_per_word = 16,
352 };
353 #endif
354
355 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
356 static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
357         .enable_dma = 0,
358         .bits_per_word = 16,
359 };
360 #endif
361
362 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
363 static struct bfin5xx_spi_chip spi_mmc_chip_info = {
364         .enable_dma = 1,
365         .bits_per_word = 8,
366 };
367 #endif
368
369 #if defined(CONFIG_PBX)
370 static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
371         .ctl_reg        = 0x4, /* send zero */
372         .enable_dma     = 0,
373         .bits_per_word  = 8,
374         .cs_change_per_word = 1,
375 };
376 #endif
377
378 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
379 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
380         .enable_dma = 0,
381         .bits_per_word = 16,
382 };
383
384 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
385         .model                  = 7877,
386         .vref_delay_usecs       = 50,   /* internal, no capacitor */
387         .x_plate_ohms           = 419,
388         .y_plate_ohms           = 486,
389         .pressure_max           = 1000,
390         .pressure_min           = 0,
391         .stopacq_polarity       = 1,
392         .first_conversion_delay = 3,
393         .acquisition_time       = 1,
394         .averaging              = 1,
395         .pen_down_acc_interval  = 1,
396 };
397 #endif
398
399 static struct spi_board_info bfin_spi_board_info[] __initdata = {
400 #if defined(CONFIG_MTD_M25P80) \
401         || defined(CONFIG_MTD_M25P80_MODULE)
402         {
403                 /* the modalias must be the same as spi device driver name */
404                 .modalias = "m25p80", /* Name of spi_driver for this device */
405                 .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
406                 .bus_num = 0, /* Framework bus number */
407                 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
408                 .platform_data = &bfin_spi_flash_data,
409                 .controller_data = &spi_flash_chip_info,
410                 .mode = SPI_MODE_3,
411         },
412 #endif
413
414 #if defined(CONFIG_SPI_ADC_BF533) \
415         || defined(CONFIG_SPI_ADC_BF533_MODULE)
416         {
417                 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
418                 .max_speed_hz = 6250000,     /* max spi clock (SCK) speed in HZ */
419                 .bus_num = 0, /* Framework bus number */
420                 .chip_select = 1, /* Framework chip select. */
421                 .platform_data = NULL, /* No spi_driver specific config */
422                 .controller_data = &spi_adc_chip_info,
423         },
424 #endif
425
426 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
427         || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
428         {
429                 .modalias = "ad1836-spi",
430                 .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
431                 .bus_num = 0,
432                 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
433                 .controller_data = &ad1836_spi_chip_info,
434         },
435 #endif
436 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
437         {
438                 .modalias = "ad9960-spi",
439                 .max_speed_hz = 10000000,     /* max spi clock (SCK) speed in HZ */
440                 .bus_num = 0,
441                 .chip_select = 1,
442                 .controller_data = &ad9960_spi_chip_info,
443         },
444 #endif
445 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
446         {
447                 .modalias = "spi_mmc_dummy",
448                 .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
449                 .bus_num = 0,
450                 .chip_select = 0,
451                 .platform_data = NULL,
452                 .controller_data = &spi_mmc_chip_info,
453                 .mode = SPI_MODE_3,
454         },
455         {
456                 .modalias = "spi_mmc",
457                 .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
458                 .bus_num = 0,
459                 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
460                 .platform_data = NULL,
461                 .controller_data = &spi_mmc_chip_info,
462                 .mode = SPI_MODE_3,
463         },
464 #endif
465 #if defined(CONFIG_PBX)
466         {
467                 .modalias = "fxs-spi",
468                 .max_speed_hz = 12500000,     /* max spi clock (SCK) speed in HZ */
469                 .bus_num = 0,
470                 .chip_select = 8 - CONFIG_J11_JUMPER,
471                 .controller_data = &spi_si3xxx_chip_info,
472                 .mode = SPI_MODE_3,
473         },
474         {
475                 .modalias = "fxo-spi",
476                 .max_speed_hz = 12500000,     /* max spi clock (SCK) speed in HZ */
477                 .bus_num = 0,
478                 .chip_select = 8 - CONFIG_J19_JUMPER,
479                 .controller_data = &spi_si3xxx_chip_info,
480                 .mode = SPI_MODE_3,
481         },
482 #endif
483 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
484         {
485                 .modalias               = "ad7877",
486                 .platform_data          = &bfin_ad7877_ts_info,
487                 .irq                    = IRQ_PF6,
488                 .max_speed_hz   = 12500000,     /* max spi clock (SCK) speed in HZ */
489                 .bus_num        = 0,
490                 .chip_select  = 1,
491                 .controller_data = &spi_ad7877_chip_info,
492         },
493 #endif
494 };
495
496 /* SPI controller data */
497 static struct bfin5xx_spi_master bfin_spi0_info = {
498         .num_chipselect = 8,
499         .enable_dma = 1,  /* master has the ability to do dma transfer */
500         .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
501 };
502
503 /* SPI (0) */
504 static struct resource bfin_spi0_resource[] = {
505         [0] = {
506                 .start = SPI0_REGBASE,
507                 .end   = SPI0_REGBASE + 0xFF,
508                 .flags = IORESOURCE_MEM,
509                 },
510         [1] = {
511                 .start = CH_SPI,
512                 .end   = CH_SPI,
513                 .flags = IORESOURCE_IRQ,
514         },
515 };
516
517 static struct platform_device bfin_spi0_device = {
518         .name = "bfin-spi",
519         .id = 0, /* Bus number */
520         .num_resources = ARRAY_SIZE(bfin_spi0_resource),
521         .resource = bfin_spi0_resource,
522         .dev = {
523                 .platform_data = &bfin_spi0_info, /* Passed to driver */
524         },
525 };
526 #endif  /* spi master and devices */
527
528 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
529 static struct platform_device bfin_fb_device = {
530         .name = "bf537-lq035",
531 };
532 #endif
533
534 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
535 static struct platform_device bfin_fb_adv7393_device = {
536         .name = "bfin-adv7393",
537 };
538 #endif
539
540 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
541 static struct resource bfin_uart_resources[] = {
542         {
543                 .start = 0xFFC00400,
544                 .end = 0xFFC004FF,
545                 .flags = IORESOURCE_MEM,
546         }, {
547                 .start = 0xFFC02000,
548                 .end = 0xFFC020FF,
549                 .flags = IORESOURCE_MEM,
550         },
551 };
552
553 static struct platform_device bfin_uart_device = {
554         .name = "bfin-uart",
555         .id = 1,
556         .num_resources = ARRAY_SIZE(bfin_uart_resources),
557         .resource = bfin_uart_resources,
558 };
559 #endif
560
561 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
562 static struct resource bfin_sir_resources[] = {
563 #ifdef CONFIG_BFIN_SIR0
564         {
565                 .start = 0xFFC00400,
566                 .end = 0xFFC004FF,
567                 .flags = IORESOURCE_MEM,
568         },
569 #endif
570 #ifdef CONFIG_BFIN_SIR1
571         {
572                 .start = 0xFFC02000,
573                 .end = 0xFFC020FF,
574                 .flags = IORESOURCE_MEM,
575         },
576 #endif
577 };
578
579 static struct platform_device bfin_sir_device = {
580         .name = "bfin_sir",
581         .id = 0,
582         .num_resources = ARRAY_SIZE(bfin_sir_resources),
583         .resource = bfin_sir_resources,
584 };
585 #endif
586
587 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
588 static struct resource bfin_twi0_resource[] = {
589         [0] = {
590                 .start = TWI0_REGBASE,
591                 .end   = TWI0_REGBASE + 0xFF,
592                 .flags = IORESOURCE_MEM,
593         },
594         [1] = {
595                 .start = IRQ_TWI,
596                 .end   = IRQ_TWI,
597                 .flags = IORESOURCE_IRQ,
598         },
599 };
600
601 static struct platform_device i2c_bfin_twi_device = {
602         .name = "i2c-bfin-twi",
603         .id = 0,
604         .num_resources = ARRAY_SIZE(bfin_twi0_resource),
605         .resource = bfin_twi0_resource,
606 };
607 #endif
608
609 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
610 static struct platform_device bfin_sport0_uart_device = {
611         .name = "bfin-sport-uart",
612         .id = 0,
613 };
614
615 static struct platform_device bfin_sport1_uart_device = {
616         .name = "bfin-sport-uart",
617         .id = 1,
618 };
619 #endif
620
621 static struct platform_device *stamp_devices[] __initdata = {
622 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
623         &bfin_pcmcia_cf_device,
624 #endif
625
626 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
627         &rtc_device,
628 #endif
629
630 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
631         &sl811_hcd_device,
632 #endif
633
634 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
635         &isp1362_hcd_device,
636 #endif
637
638 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
639         &smc91x_device,
640 #endif
641
642 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
643         &dm9000_device,
644 #endif
645
646 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
647         &bfin_mac_device,
648 #endif
649
650 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
651         &net2272_bfin_device,
652 #endif
653
654 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
655         &bfin_spi0_device,
656 #endif
657
658 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
659         &bfin_fb_device,
660 #endif
661
662 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
663         &bfin_fb_adv7393_device,
664 #endif
665
666 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
667         &bfin_uart_device,
668 #endif
669
670 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
671         &bfin_sir_device,
672 #endif
673
674 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
675         &i2c_bfin_twi_device,
676 #endif
677
678 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
679         &bfin_sport0_uart_device,
680         &bfin_sport1_uart_device,
681 #endif
682 };
683
684 static int __init stamp_init(void)
685 {
686         printk(KERN_INFO "%s(): registering device resources\n", __func__);
687         platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
688 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
689         spi_register_board_info(bfin_spi_board_info,
690                                 ARRAY_SIZE(bfin_spi_board_info));
691 #endif
692
693         return 0;
694 }
695
696 arch_initcall(stamp_init);
697
698 void native_machine_restart(char *cmd)
699 {
700         /* workaround reboot hang when booting from SPI */
701         if ((bfin_read_SYSCR() & 0x7) == 0x3)
702                 bfin_gpio_reset_spi0_ssel1();
703 }
704
705 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
706 void bfin_get_ether_addr(char *addr)
707 {
708         random_ether_addr(addr);
709         printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
710 }
711 EXPORT_SYMBOL(bfin_get_ether_addr);
712 #endif