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