e930638e323119034176647640de7025b52325ae
[safe/jmp/linux-2.6] / arch / blackfin / mach-bf537 / boards / cm_bf537e.c
1 /*
2  * Copyright 2004-2009 Analog Devices Inc.
3  *           2008-2009 Bluetechnix
4  *                2005 National ICT Australia (NICTA)
5  *                      Aidan Williams <aidan@nicta.com.au>
6  *
7  * Licensed under the GPL-2 or later.
8  */
9
10 #include <linux/device.h>
11 #include <linux/etherdevice.h>
12 #include <linux/platform_device.h>
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/partitions.h>
15 #include <linux/mtd/physmap.h>
16 #include <linux/spi/spi.h>
17 #include <linux/spi/flash.h>
18 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
19 #include <linux/usb/isp1362.h>
20 #endif
21 #include <linux/ata_platform.h>
22 #include <linux/irq.h>
23 #include <asm/dma.h>
24 #include <asm/bfin5xx_spi.h>
25 #include <asm/portmux.h>
26 #include <asm/dpmc.h>
27
28 /*
29  * Name the Board for the /proc/cpuinfo
30  */
31 const char bfin_board_name[] = "Bluetechnix CM BF537E";
32
33 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
34 /* all SPI peripherals info goes here */
35
36 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
37 static struct mtd_partition bfin_spi_flash_partitions[] = {
38         {
39                 .name = "bootloader(spi)",
40                 .size = 0x00020000,
41                 .offset = 0,
42                 .mask_flags = MTD_CAP_ROM
43         }, {
44                 .name = "linux kernel(spi)",
45                 .size = 0xe0000,
46                 .offset = 0x20000
47         }, {
48                 .name = "file system(spi)",
49                 .size = 0x700000,
50                 .offset = 0x00100000,
51         }
52 };
53
54 static struct flash_platform_data bfin_spi_flash_data = {
55         .name = "m25p80",
56         .parts = bfin_spi_flash_partitions,
57         .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
58         .type = "m25p64",
59 };
60
61 /* SPI flash chip (m25p64) */
62 static struct bfin5xx_spi_chip spi_flash_chip_info = {
63         .enable_dma = 0,         /* use dma transfer with this chip*/
64         .bits_per_word = 8,
65 };
66 #endif
67
68 #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
69 /* SPI ADC chip */
70 static struct bfin5xx_spi_chip spi_adc_chip_info = {
71         .enable_dma = 1,         /* use dma transfer with this chip*/
72         .bits_per_word = 16,
73 };
74 #endif
75
76 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
77 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
78         .enable_dma = 0,
79         .bits_per_word = 16,
80 };
81 #endif
82
83 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
84 static struct bfin5xx_spi_chip  mmc_spi_chip_info = {
85         .enable_dma = 0,
86         .bits_per_word = 8,
87 };
88 #endif
89
90 static struct spi_board_info bfin_spi_board_info[] __initdata = {
91 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
92         {
93                 /* the modalias must be the same as spi device driver name */
94                 .modalias = "m25p80", /* Name of spi_driver for this device */
95                 .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
96                 .bus_num = 0, /* Framework bus number */
97                 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
98                 .platform_data = &bfin_spi_flash_data,
99                 .controller_data = &spi_flash_chip_info,
100                 .mode = SPI_MODE_3,
101         },
102 #endif
103
104 #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
105         {
106                 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
107                 .max_speed_hz = 6250000,     /* max spi clock (SCK) speed in HZ */
108                 .bus_num = 0, /* Framework bus number */
109                 .chip_select = 1, /* Framework chip select. */
110                 .platform_data = NULL, /* No spi_driver specific config */
111                 .controller_data = &spi_adc_chip_info,
112         },
113 #endif
114
115 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
116         {
117                 .modalias = "ad1836",
118                 .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
119                 .bus_num = 0,
120                 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
121                 .controller_data = &ad1836_spi_chip_info,
122         },
123 #endif
124
125 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
126         {
127                 .modalias = "mmc_spi",
128                 .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
129                 .bus_num = 0,
130                 .chip_select = 1,
131                 .controller_data = &mmc_spi_chip_info,
132                 .mode = SPI_MODE_3,
133         },
134 #endif
135 };
136
137 /* SPI (0) */
138 static struct resource bfin_spi0_resource[] = {
139         [0] = {
140                 .start = SPI0_REGBASE,
141                 .end   = SPI0_REGBASE + 0xFF,
142                 .flags = IORESOURCE_MEM,
143                 },
144         [1] = {
145                 .start = CH_SPI,
146                 .end   = CH_SPI,
147                 .flags = IORESOURCE_DMA,
148         },
149         [2] = {
150                 .start = IRQ_SPI,
151                 .end   = IRQ_SPI,
152                 .flags = IORESOURCE_IRQ,
153         },
154 };
155
156 /* SPI controller data */
157 static struct bfin5xx_spi_master bfin_spi0_info = {
158         .num_chipselect = 8,
159         .enable_dma = 1,  /* master has the ability to do dma transfer */
160         .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
161 };
162
163 static struct platform_device bfin_spi0_device = {
164         .name = "bfin-spi",
165         .id = 0, /* Bus number */
166         .num_resources = ARRAY_SIZE(bfin_spi0_resource),
167         .resource = bfin_spi0_resource,
168         .dev = {
169                 .platform_data = &bfin_spi0_info, /* Passed to driver */
170         },
171 };
172 #endif  /* spi master and devices */
173
174 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
175 static struct platform_device rtc_device = {
176         .name = "rtc-bfin",
177         .id   = -1,
178 };
179 #endif
180
181 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
182 static struct platform_device hitachi_fb_device = {
183         .name = "hitachi-tx09",
184 };
185 #endif
186
187 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
188 #include <linux/smc91x.h>
189
190 static struct smc91x_platdata smc91x_info = {
191         .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
192         .leda = RPC_LED_100_10,
193         .ledb = RPC_LED_TX_RX,
194 };
195
196 static struct resource smc91x_resources[] = {
197         {
198                 .start = 0x20200300,
199                 .end = 0x20200300 + 16,
200                 .flags = IORESOURCE_MEM,
201         }, {
202                 .start = IRQ_PF14,
203                 .end = IRQ_PF14,
204                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
205                 },
206 };
207
208 static struct platform_device smc91x_device = {
209         .name = "smc91x",
210         .id = 0,
211         .num_resources = ARRAY_SIZE(smc91x_resources),
212         .resource = smc91x_resources,
213         .dev    = {
214                 .platform_data  = &smc91x_info,
215         },
216 };
217 #endif
218
219 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
220 static struct resource isp1362_hcd_resources[] = {
221         {
222                 .start = 0x20308000,
223                 .end = 0x20308000,
224                 .flags = IORESOURCE_MEM,
225         }, {
226                 .start = 0x20308004,
227                 .end = 0x20308004,
228                 .flags = IORESOURCE_MEM,
229         }, {
230                 .start = IRQ_PG15,
231                 .end = IRQ_PG15,
232                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
233         },
234 };
235
236 static struct isp1362_platform_data isp1362_priv = {
237         .sel15Kres = 1,
238         .clknotstop = 0,
239         .oc_enable = 0,
240         .int_act_high = 0,
241         .int_edge_triggered = 0,
242         .remote_wakeup_connected = 0,
243         .no_power_switching = 1,
244         .power_switching_mode = 0,
245 };
246
247 static struct platform_device isp1362_hcd_device = {
248         .name = "isp1362-hcd",
249         .id = 0,
250         .dev = {
251                 .platform_data = &isp1362_priv,
252         },
253         .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
254         .resource = isp1362_hcd_resources,
255 };
256 #endif
257
258 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
259 static struct resource net2272_bfin_resources[] = {
260         {
261                 .start = 0x20300000,
262                 .end = 0x20300000 + 0x100,
263                 .flags = IORESOURCE_MEM,
264         }, {
265                 .start = IRQ_PG13,
266                 .end = IRQ_PG13,
267                 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
268         },
269 };
270
271 static struct platform_device net2272_bfin_device = {
272         .name = "net2272",
273         .id = -1,
274         .num_resources = ARRAY_SIZE(net2272_bfin_resources),
275         .resource = net2272_bfin_resources,
276 };
277 #endif
278
279 static struct resource bfin_gpios_resources = {
280         .start = 0,
281         .end   = MAX_BLACKFIN_GPIOS - 1,
282         .flags = IORESOURCE_IRQ,
283 };
284
285 static struct platform_device bfin_gpios_device = {
286         .name = "simple-gpio",
287         .id = -1,
288         .num_resources = 1,
289         .resource = &bfin_gpios_resources,
290 };
291
292 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
293 static struct mtd_partition cm_partitions[] = {
294         {
295                 .name   = "bootloader(nor)",
296                 .size   = 0x40000,
297                 .offset = 0,
298         }, {
299                 .name   = "linux kernel(nor)",
300                 .size   = 0x100000,
301                 .offset = MTDPART_OFS_APPEND,
302         }, {
303                 .name   = "file system(nor)",
304                 .size   = MTDPART_SIZ_FULL,
305                 .offset = MTDPART_OFS_APPEND,
306         }
307 };
308
309 static struct physmap_flash_data cm_flash_data = {
310         .width    = 2,
311         .parts    = cm_partitions,
312         .nr_parts = ARRAY_SIZE(cm_partitions),
313 };
314
315 static unsigned cm_flash_gpios[] = { GPIO_PF4 };
316
317 static struct resource cm_flash_resource[] = {
318         {
319                 .name  = "cfi_probe",
320                 .start = 0x20000000,
321                 .end   = 0x201fffff,
322                 .flags = IORESOURCE_MEM,
323         }, {
324                 .start = (unsigned long)cm_flash_gpios,
325                 .end   = ARRAY_SIZE(cm_flash_gpios),
326                 .flags = IORESOURCE_IRQ,
327         }
328 };
329
330 static struct platform_device cm_flash_device = {
331         .name          = "gpio-addr-flash",
332         .id            = 0,
333         .dev = {
334                 .platform_data = &cm_flash_data,
335         },
336         .num_resources = ARRAY_SIZE(cm_flash_resource),
337         .resource      = cm_flash_resource,
338 };
339 #endif
340
341 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
342 #ifdef CONFIG_SERIAL_BFIN_UART0
343 static struct resource bfin_uart0_resources[] = {
344         {
345                 .start = 0xFFC00400,
346                 .end = 0xFFC004FF,
347                 .flags = IORESOURCE_MEM,
348         },
349         {
350                 .start = IRQ_UART0_RX,
351                 .end = IRQ_UART0_RX+1,
352                 .flags = IORESOURCE_IRQ,
353         },
354         {
355                 .start = IRQ_UART0_ERROR,
356                 .end = IRQ_UART0_ERROR,
357                 .flags = IORESOURCE_IRQ,
358         },
359         {
360                 .start = CH_UART0_TX,
361                 .end = CH_UART0_TX,
362                 .flags = IORESOURCE_DMA,
363         },
364         {
365                 .start = CH_UART0_RX,
366                 .end = CH_UART0_RX,
367                 .flags = IORESOURCE_DMA,
368         },
369 #ifdef CONFIG_BFIN_UART0_CTSRTS
370         {
371                 /*
372                  * Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
373                  */
374                 .start = -1,
375                 .end = -1,
376                 .flags = IORESOURCE_IO,
377         },
378         {
379                 /*
380                  * Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
381                  */
382                 .start = -1,
383                 .end = -1,
384                 .flags = IORESOURCE_IO,
385         },
386 #endif
387 };
388
389 static struct platform_device bfin_uart0_device = {
390         .name = "bfin-uart",
391         .id = 0,
392         .num_resources = ARRAY_SIZE(bfin_uart0_resources),
393         .resource = bfin_uart0_resources,
394 };
395 #endif
396 #ifdef CONFIG_SERIAL_BFIN_UART1
397 static struct resource bfin_uart1_resources[] = {
398         {
399                 .start = 0xFFC02000,
400                 .end = 0xFFC020FF,
401                 .flags = IORESOURCE_MEM,
402         },
403         {
404                 .start = IRQ_UART1_RX,
405                 .end = IRQ_UART1_RX+1,
406                 .flags = IORESOURCE_IRQ,
407         },
408         {
409                 .start = IRQ_UART1_ERROR,
410                 .end = IRQ_UART1_ERROR,
411                 .flags = IORESOURCE_IRQ,
412         },
413         {
414                 .start = CH_UART1_TX,
415                 .end = CH_UART1_TX,
416                 .flags = IORESOURCE_DMA,
417         },
418         {
419                 .start = CH_UART1_RX,
420                 .end = CH_UART1_RX,
421                 .flags = IORESOURCE_DMA,
422         },
423 #ifdef CONFIG_BFIN_UART1_CTSRTS
424         {
425                 /*
426                  * Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
427                  */
428                 .start = -1,
429                 .end = -1,
430                 .flags = IORESOURCE_IO,
431         },
432         {
433                 /*
434                  * Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
435                  */
436                 .start = -1,
437                 .end = -1,
438                 .flags = IORESOURCE_IO,
439         },
440 #endif
441 };
442
443 static struct platform_device bfin_uart1_device = {
444         .name = "bfin-uart",
445         .id = 1,
446         .num_resources = ARRAY_SIZE(bfin_uart1_resources),
447         .resource = bfin_uart1_resources,
448 };
449 #endif
450 #endif
451
452 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
453 #ifdef CONFIG_BFIN_SIR0
454 static struct resource bfin_sir0_resources[] = {
455         {
456                 .start = 0xFFC00400,
457                 .end = 0xFFC004FF,
458                 .flags = IORESOURCE_MEM,
459         },
460         {
461                 .start = IRQ_UART0_RX,
462                 .end = IRQ_UART0_RX+1,
463                 .flags = IORESOURCE_IRQ,
464         },
465         {
466                 .start = CH_UART0_RX,
467                 .end = CH_UART0_RX+1,
468                 .flags = IORESOURCE_DMA,
469         },
470 };
471 static struct platform_device bfin_sir0_device = {
472         .name = "bfin_sir",
473         .id = 0,
474         .num_resources = ARRAY_SIZE(bfin_sir0_resources),
475         .resource = bfin_sir0_resources,
476 };
477 #endif
478 #ifdef CONFIG_BFIN_SIR1
479 static struct resource bfin_sir1_resources[] = {
480         {
481                 .start = 0xFFC02000,
482                 .end = 0xFFC020FF,
483                 .flags = IORESOURCE_MEM,
484         },
485         {
486                 .start = IRQ_UART1_RX,
487                 .end = IRQ_UART1_RX+1,
488                 .flags = IORESOURCE_IRQ,
489         },
490         {
491                 .start = CH_UART1_RX,
492                 .end = CH_UART1_RX+1,
493                 .flags = IORESOURCE_DMA,
494         },
495 };
496 static struct platform_device bfin_sir1_device = {
497         .name = "bfin_sir",
498         .id = 1,
499         .num_resources = ARRAY_SIZE(bfin_sir1_resources),
500         .resource = bfin_sir1_resources,
501 };
502 #endif
503 #endif
504
505 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
506 static struct resource bfin_twi0_resource[] = {
507         [0] = {
508                 .start = TWI0_REGBASE,
509                 .end   = TWI0_REGBASE,
510                 .flags = IORESOURCE_MEM,
511         },
512         [1] = {
513                 .start = IRQ_TWI,
514                 .end   = IRQ_TWI,
515                 .flags = IORESOURCE_IRQ,
516         },
517 };
518
519 static struct platform_device i2c_bfin_twi_device = {
520         .name = "i2c-bfin-twi",
521         .id = 0,
522         .num_resources = ARRAY_SIZE(bfin_twi0_resource),
523         .resource = bfin_twi0_resource,
524 };
525 #endif
526
527 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
528 static struct platform_device bfin_sport0_uart_device = {
529         .name = "bfin-sport-uart",
530         .id = 0,
531 };
532
533 static struct platform_device bfin_sport1_uart_device = {
534         .name = "bfin-sport-uart",
535         .id = 1,
536 };
537 #endif
538
539 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
540 static struct platform_device bfin_mii_bus = {
541         .name = "bfin_mii_bus",
542 };
543
544 static struct platform_device bfin_mac_device = {
545         .name = "bfin_mac",
546         .dev.platform_data = &bfin_mii_bus,
547 };
548 #endif
549
550 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
551 #define PATA_INT        IRQ_PF14
552
553 static struct pata_platform_info bfin_pata_platform_data = {
554         .ioport_shift = 2,
555         .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
556 };
557
558 static struct resource bfin_pata_resources[] = {
559         {
560                 .start = 0x2030C000,
561                 .end = 0x2030C01F,
562                 .flags = IORESOURCE_MEM,
563         },
564         {
565                 .start = 0x2030D018,
566                 .end = 0x2030D01B,
567                 .flags = IORESOURCE_MEM,
568         },
569         {
570                 .start = PATA_INT,
571                 .end = PATA_INT,
572                 .flags = IORESOURCE_IRQ,
573         },
574 };
575
576 static struct platform_device bfin_pata_device = {
577         .name = "pata_platform",
578         .id = -1,
579         .num_resources = ARRAY_SIZE(bfin_pata_resources),
580         .resource = bfin_pata_resources,
581         .dev = {
582                 .platform_data = &bfin_pata_platform_data,
583         }
584 };
585 #endif
586
587 static const unsigned int cclk_vlev_datasheet[] =
588 {
589         VRPAIR(VLEV_085, 250000000),
590         VRPAIR(VLEV_090, 376000000),
591         VRPAIR(VLEV_095, 426000000),
592         VRPAIR(VLEV_100, 426000000),
593         VRPAIR(VLEV_105, 476000000),
594         VRPAIR(VLEV_110, 476000000),
595         VRPAIR(VLEV_115, 476000000),
596         VRPAIR(VLEV_120, 500000000),
597         VRPAIR(VLEV_125, 533000000),
598         VRPAIR(VLEV_130, 600000000),
599 };
600
601 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
602         .tuple_tab = cclk_vlev_datasheet,
603         .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
604         .vr_settling_time = 25 /* us */,
605 };
606
607 static struct platform_device bfin_dpmc = {
608         .name = "bfin dpmc",
609         .dev = {
610                 .platform_data = &bfin_dmpc_vreg_data,
611         },
612 };
613
614 static struct platform_device *cm_bf537e_devices[] __initdata = {
615
616         &bfin_dpmc,
617
618 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
619         &hitachi_fb_device,
620 #endif
621
622 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
623         &rtc_device,
624 #endif
625
626 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
627 #ifdef CONFIG_SERIAL_BFIN_UART0
628         &bfin_uart0_device,
629 #endif
630 #ifdef CONFIG_SERIAL_BFIN_UART1
631         &bfin_uart1_device,
632 #endif
633 #endif
634
635 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
636 #ifdef CONFIG_BFIN_SIR0
637         &bfin_sir0_device,
638 #endif
639 #ifdef CONFIG_BFIN_SIR1
640         &bfin_sir1_device,
641 #endif
642 #endif
643
644 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
645         &i2c_bfin_twi_device,
646 #endif
647
648 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
649         &bfin_sport0_uart_device,
650         &bfin_sport1_uart_device,
651 #endif
652
653 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
654         &isp1362_hcd_device,
655 #endif
656
657 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
658         &smc91x_device,
659 #endif
660
661 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
662         &bfin_mii_bus,
663         &bfin_mac_device,
664 #endif
665
666 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
667         &net2272_bfin_device,
668 #endif
669
670 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
671         &bfin_spi0_device,
672 #endif
673
674 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
675         &bfin_pata_device,
676 #endif
677
678 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
679         &cm_flash_device,
680 #endif
681
682         &bfin_gpios_device,
683 };
684
685 static int __init cm_bf537e_init(void)
686 {
687         printk(KERN_INFO "%s(): registering device resources\n", __func__);
688         platform_add_devices(cm_bf537e_devices, ARRAY_SIZE(cm_bf537e_devices));
689 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
690         spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
691 #endif
692
693 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
694         irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
695 #endif
696         return 0;
697 }
698
699 arch_initcall(cm_bf537e_init);
700
701 void bfin_get_ether_addr(char *addr)
702 {
703         random_ether_addr(addr);
704         printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
705 }
706 EXPORT_SYMBOL(bfin_get_ether_addr);