Merge branch 'akpm'
[linux-2.6/next.git] / arch / blackfin / mach-bf537 / boards / cm_bf537e.c
blobcfcd5d208dfd0653eced3f68243cd2872ba709b4
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>
7 * Licensed under the GPL-2 or later.
8 */
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>
29 * Name the Board for the /proc/cpuinfo
31 const char bfin_board_name[] = "Bluetechnix CM BF537E";
33 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
34 /* all SPI peripherals info goes here */
36 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
37 static struct mtd_partition bfin_spi_flash_partitions[] = {
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,
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",
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*/
65 #endif
67 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
68 static struct bfin5xx_spi_chip mmc_spi_chip_info = {
69 .enable_dma = 0,
71 #endif
73 static struct spi_board_info bfin_spi_board_info[] __initdata = {
74 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
76 /* the modalias must be the same as spi device driver name */
77 .modalias = "m25p80", /* Name of spi_driver for this device */
78 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
79 .bus_num = 0, /* Framework bus number */
80 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
81 .platform_data = &bfin_spi_flash_data,
82 .controller_data = &spi_flash_chip_info,
83 .mode = SPI_MODE_3,
85 #endif
87 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
89 .modalias = "ad183x",
90 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
91 .bus_num = 0,
92 .chip_select = 4,
94 #endif
96 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
98 .modalias = "mmc_spi",
99 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
100 .bus_num = 0,
101 .chip_select = 1,
102 .controller_data = &mmc_spi_chip_info,
103 .mode = SPI_MODE_3,
105 #endif
108 /* SPI (0) */
109 static struct resource bfin_spi0_resource[] = {
110 [0] = {
111 .start = SPI0_REGBASE,
112 .end = SPI0_REGBASE + 0xFF,
113 .flags = IORESOURCE_MEM,
115 [1] = {
116 .start = CH_SPI,
117 .end = CH_SPI,
118 .flags = IORESOURCE_DMA,
120 [2] = {
121 .start = IRQ_SPI,
122 .end = IRQ_SPI,
123 .flags = IORESOURCE_IRQ,
127 /* SPI controller data */
128 static struct bfin5xx_spi_master bfin_spi0_info = {
129 .num_chipselect = 8,
130 .enable_dma = 1, /* master has the ability to do dma transfer */
131 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
134 static struct platform_device bfin_spi0_device = {
135 .name = "bfin-spi",
136 .id = 0, /* Bus number */
137 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
138 .resource = bfin_spi0_resource,
139 .dev = {
140 .platform_data = &bfin_spi0_info, /* Passed to driver */
143 #endif /* spi master and devices */
145 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
146 static struct platform_device rtc_device = {
147 .name = "rtc-bfin",
148 .id = -1,
150 #endif
152 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
153 static struct platform_device hitachi_fb_device = {
154 .name = "hitachi-tx09",
156 #endif
158 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
159 #include <linux/smc91x.h>
161 static struct smc91x_platdata smc91x_info = {
162 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
163 .leda = RPC_LED_100_10,
164 .ledb = RPC_LED_TX_RX,
167 static struct resource smc91x_resources[] = {
169 .start = 0x20200300,
170 .end = 0x20200300 + 16,
171 .flags = IORESOURCE_MEM,
172 }, {
173 .start = IRQ_PF14,
174 .end = IRQ_PF14,
175 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
179 static struct platform_device smc91x_device = {
180 .name = "smc91x",
181 .id = 0,
182 .num_resources = ARRAY_SIZE(smc91x_resources),
183 .resource = smc91x_resources,
184 .dev = {
185 .platform_data = &smc91x_info,
188 #endif
190 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
191 static struct resource isp1362_hcd_resources[] = {
193 .start = 0x20308000,
194 .end = 0x20308000,
195 .flags = IORESOURCE_MEM,
196 }, {
197 .start = 0x20308004,
198 .end = 0x20308004,
199 .flags = IORESOURCE_MEM,
200 }, {
201 .start = IRQ_PG15,
202 .end = IRQ_PG15,
203 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
207 static struct isp1362_platform_data isp1362_priv = {
208 .sel15Kres = 1,
209 .clknotstop = 0,
210 .oc_enable = 0,
211 .int_act_high = 0,
212 .int_edge_triggered = 0,
213 .remote_wakeup_connected = 0,
214 .no_power_switching = 1,
215 .power_switching_mode = 0,
218 static struct platform_device isp1362_hcd_device = {
219 .name = "isp1362-hcd",
220 .id = 0,
221 .dev = {
222 .platform_data = &isp1362_priv,
224 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
225 .resource = isp1362_hcd_resources,
227 #endif
229 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
230 static struct resource net2272_bfin_resources[] = {
232 .start = 0x20300000,
233 .end = 0x20300000 + 0x100,
234 .flags = IORESOURCE_MEM,
235 }, {
236 .start = IRQ_PG13,
237 .end = IRQ_PG13,
238 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
242 static struct platform_device net2272_bfin_device = {
243 .name = "net2272",
244 .id = -1,
245 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
246 .resource = net2272_bfin_resources,
248 #endif
250 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
251 static struct mtd_partition cm_partitions[] = {
253 .name = "bootloader(nor)",
254 .size = 0x40000,
255 .offset = 0,
256 }, {
257 .name = "linux kernel(nor)",
258 .size = 0x100000,
259 .offset = MTDPART_OFS_APPEND,
260 }, {
261 .name = "file system(nor)",
262 .size = MTDPART_SIZ_FULL,
263 .offset = MTDPART_OFS_APPEND,
267 static struct physmap_flash_data cm_flash_data = {
268 .width = 2,
269 .parts = cm_partitions,
270 .nr_parts = ARRAY_SIZE(cm_partitions),
273 static unsigned cm_flash_gpios[] = { GPIO_PF4 };
275 static struct resource cm_flash_resource[] = {
277 .name = "cfi_probe",
278 .start = 0x20000000,
279 .end = 0x201fffff,
280 .flags = IORESOURCE_MEM,
281 }, {
282 .start = (unsigned long)cm_flash_gpios,
283 .end = ARRAY_SIZE(cm_flash_gpios),
284 .flags = IORESOURCE_IRQ,
288 static struct platform_device cm_flash_device = {
289 .name = "gpio-addr-flash",
290 .id = 0,
291 .dev = {
292 .platform_data = &cm_flash_data,
294 .num_resources = ARRAY_SIZE(cm_flash_resource),
295 .resource = cm_flash_resource,
297 #endif
299 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
300 #ifdef CONFIG_SERIAL_BFIN_UART0
301 static struct resource bfin_uart0_resources[] = {
303 .start = UART0_THR,
304 .end = UART0_GCTL+2,
305 .flags = IORESOURCE_MEM,
308 .start = IRQ_UART0_TX,
309 .end = IRQ_UART0_TX,
310 .flags = IORESOURCE_IRQ,
313 .start = IRQ_UART0_RX,
314 .end = IRQ_UART0_RX,
315 .flags = IORESOURCE_IRQ,
318 .start = IRQ_UART0_ERROR,
319 .end = IRQ_UART0_ERROR,
320 .flags = IORESOURCE_IRQ,
323 .start = CH_UART0_TX,
324 .end = CH_UART0_TX,
325 .flags = IORESOURCE_DMA,
328 .start = CH_UART0_RX,
329 .end = CH_UART0_RX,
330 .flags = IORESOURCE_DMA,
332 #ifdef CONFIG_BFIN_UART0_CTSRTS
335 * Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
337 .start = -1,
338 .end = -1,
339 .flags = IORESOURCE_IO,
343 * Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
345 .start = -1,
346 .end = -1,
347 .flags = IORESOURCE_IO,
349 #endif
352 static unsigned short bfin_uart0_peripherals[] = {
353 P_UART0_TX, P_UART0_RX, 0
356 static struct platform_device bfin_uart0_device = {
357 .name = "bfin-uart",
358 .id = 0,
359 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
360 .resource = bfin_uart0_resources,
361 .dev = {
362 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
365 #endif
366 #ifdef CONFIG_SERIAL_BFIN_UART1
367 static struct resource bfin_uart1_resources[] = {
369 .start = UART1_THR,
370 .end = UART1_GCTL+2,
371 .flags = IORESOURCE_MEM,
374 .start = IRQ_UART1_TX,
375 .end = IRQ_UART1_TX,
376 .flags = IORESOURCE_IRQ,
379 .start = IRQ_UART1_RX,
380 .end = IRQ_UART1_RX,
381 .flags = IORESOURCE_IRQ,
384 .start = IRQ_UART1_ERROR,
385 .end = IRQ_UART1_ERROR,
386 .flags = IORESOURCE_IRQ,
389 .start = CH_UART1_TX,
390 .end = CH_UART1_TX,
391 .flags = IORESOURCE_DMA,
394 .start = CH_UART1_RX,
395 .end = CH_UART1_RX,
396 .flags = IORESOURCE_DMA,
398 #ifdef CONFIG_BFIN_UART1_CTSRTS
401 * Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
403 .start = -1,
404 .end = -1,
405 .flags = IORESOURCE_IO,
409 * Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
411 .start = -1,
412 .end = -1,
413 .flags = IORESOURCE_IO,
415 #endif
418 static unsigned short bfin_uart1_peripherals[] = {
419 P_UART1_TX, P_UART1_RX, 0
422 static struct platform_device bfin_uart1_device = {
423 .name = "bfin-uart",
424 .id = 1,
425 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
426 .resource = bfin_uart1_resources,
427 .dev = {
428 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
431 #endif
432 #endif
434 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
435 #ifdef CONFIG_BFIN_SIR0
436 static struct resource bfin_sir0_resources[] = {
438 .start = 0xFFC00400,
439 .end = 0xFFC004FF,
440 .flags = IORESOURCE_MEM,
443 .start = IRQ_UART0_RX,
444 .end = IRQ_UART0_RX+1,
445 .flags = IORESOURCE_IRQ,
448 .start = CH_UART0_RX,
449 .end = CH_UART0_RX+1,
450 .flags = IORESOURCE_DMA,
453 static struct platform_device bfin_sir0_device = {
454 .name = "bfin_sir",
455 .id = 0,
456 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
457 .resource = bfin_sir0_resources,
459 #endif
460 #ifdef CONFIG_BFIN_SIR1
461 static struct resource bfin_sir1_resources[] = {
463 .start = 0xFFC02000,
464 .end = 0xFFC020FF,
465 .flags = IORESOURCE_MEM,
468 .start = IRQ_UART1_RX,
469 .end = IRQ_UART1_RX+1,
470 .flags = IORESOURCE_IRQ,
473 .start = CH_UART1_RX,
474 .end = CH_UART1_RX+1,
475 .flags = IORESOURCE_DMA,
478 static struct platform_device bfin_sir1_device = {
479 .name = "bfin_sir",
480 .id = 1,
481 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
482 .resource = bfin_sir1_resources,
484 #endif
485 #endif
487 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
488 static struct resource bfin_twi0_resource[] = {
489 [0] = {
490 .start = TWI0_REGBASE,
491 .end = TWI0_REGBASE,
492 .flags = IORESOURCE_MEM,
494 [1] = {
495 .start = IRQ_TWI,
496 .end = IRQ_TWI,
497 .flags = IORESOURCE_IRQ,
501 static struct platform_device i2c_bfin_twi_device = {
502 .name = "i2c-bfin-twi",
503 .id = 0,
504 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
505 .resource = bfin_twi0_resource,
507 #endif
509 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
510 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
511 static struct resource bfin_sport0_uart_resources[] = {
513 .start = SPORT0_TCR1,
514 .end = SPORT0_MRCS3+4,
515 .flags = IORESOURCE_MEM,
518 .start = IRQ_SPORT0_RX,
519 .end = IRQ_SPORT0_RX+1,
520 .flags = IORESOURCE_IRQ,
523 .start = IRQ_SPORT0_ERROR,
524 .end = IRQ_SPORT0_ERROR,
525 .flags = IORESOURCE_IRQ,
529 static unsigned short bfin_sport0_peripherals[] = {
530 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
531 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
534 static struct platform_device bfin_sport0_uart_device = {
535 .name = "bfin-sport-uart",
536 .id = 0,
537 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
538 .resource = bfin_sport0_uart_resources,
539 .dev = {
540 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
543 #endif
544 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
545 static struct resource bfin_sport1_uart_resources[] = {
547 .start = SPORT1_TCR1,
548 .end = SPORT1_MRCS3+4,
549 .flags = IORESOURCE_MEM,
552 .start = IRQ_SPORT1_RX,
553 .end = IRQ_SPORT1_RX+1,
554 .flags = IORESOURCE_IRQ,
557 .start = IRQ_SPORT1_ERROR,
558 .end = IRQ_SPORT1_ERROR,
559 .flags = IORESOURCE_IRQ,
563 static unsigned short bfin_sport1_peripherals[] = {
564 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
565 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
568 static struct platform_device bfin_sport1_uart_device = {
569 .name = "bfin-sport-uart",
570 .id = 1,
571 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
572 .resource = bfin_sport1_uart_resources,
573 .dev = {
574 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
577 #endif
578 #endif
580 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
581 #include <linux/bfin_mac.h>
582 static const unsigned short bfin_mac_peripherals[] = P_MII0;
584 static struct bfin_phydev_platform_data bfin_phydev_data[] = {
586 .addr = 1,
587 .irq = IRQ_MAC_PHYINT,
591 static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
592 .phydev_number = 1,
593 .phydev_data = bfin_phydev_data,
594 .phy_mode = PHY_INTERFACE_MODE_MII,
595 .mac_peripherals = bfin_mac_peripherals,
598 static struct platform_device bfin_mii_bus = {
599 .name = "bfin_mii_bus",
600 .dev = {
601 .platform_data = &bfin_mii_bus_data,
605 static struct platform_device bfin_mac_device = {
606 .name = "bfin_mac",
607 .dev = {
608 .platform_data = &bfin_mii_bus,
611 #endif
613 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
614 #define PATA_INT IRQ_PF14
616 static struct pata_platform_info bfin_pata_platform_data = {
617 .ioport_shift = 2,
618 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
621 static struct resource bfin_pata_resources[] = {
623 .start = 0x2030C000,
624 .end = 0x2030C01F,
625 .flags = IORESOURCE_MEM,
628 .start = 0x2030D018,
629 .end = 0x2030D01B,
630 .flags = IORESOURCE_MEM,
633 .start = PATA_INT,
634 .end = PATA_INT,
635 .flags = IORESOURCE_IRQ,
639 static struct platform_device bfin_pata_device = {
640 .name = "pata_platform",
641 .id = -1,
642 .num_resources = ARRAY_SIZE(bfin_pata_resources),
643 .resource = bfin_pata_resources,
644 .dev = {
645 .platform_data = &bfin_pata_platform_data,
648 #endif
650 static const unsigned int cclk_vlev_datasheet[] =
652 VRPAIR(VLEV_085, 250000000),
653 VRPAIR(VLEV_090, 376000000),
654 VRPAIR(VLEV_095, 426000000),
655 VRPAIR(VLEV_100, 426000000),
656 VRPAIR(VLEV_105, 476000000),
657 VRPAIR(VLEV_110, 476000000),
658 VRPAIR(VLEV_115, 476000000),
659 VRPAIR(VLEV_120, 500000000),
660 VRPAIR(VLEV_125, 533000000),
661 VRPAIR(VLEV_130, 600000000),
664 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
665 .tuple_tab = cclk_vlev_datasheet,
666 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
667 .vr_settling_time = 25 /* us */,
670 static struct platform_device bfin_dpmc = {
671 .name = "bfin dpmc",
672 .dev = {
673 .platform_data = &bfin_dmpc_vreg_data,
677 static struct platform_device *cm_bf537e_devices[] __initdata = {
679 &bfin_dpmc,
681 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
682 &hitachi_fb_device,
683 #endif
685 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
686 &rtc_device,
687 #endif
689 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
690 #ifdef CONFIG_SERIAL_BFIN_UART0
691 &bfin_uart0_device,
692 #endif
693 #ifdef CONFIG_SERIAL_BFIN_UART1
694 &bfin_uart1_device,
695 #endif
696 #endif
698 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
699 #ifdef CONFIG_BFIN_SIR0
700 &bfin_sir0_device,
701 #endif
702 #ifdef CONFIG_BFIN_SIR1
703 &bfin_sir1_device,
704 #endif
705 #endif
707 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
708 &i2c_bfin_twi_device,
709 #endif
711 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
712 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
713 &bfin_sport0_uart_device,
714 #endif
715 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
716 &bfin_sport1_uart_device,
717 #endif
718 #endif
720 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
721 &isp1362_hcd_device,
722 #endif
724 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
725 &smc91x_device,
726 #endif
728 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
729 &bfin_mii_bus,
730 &bfin_mac_device,
731 #endif
733 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
734 &net2272_bfin_device,
735 #endif
737 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
738 &bfin_spi0_device,
739 #endif
741 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
742 &bfin_pata_device,
743 #endif
745 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
746 &cm_flash_device,
747 #endif
750 static int __init net2272_init(void)
752 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
753 int ret;
755 ret = gpio_request(GPIO_PG14, "net2272");
756 if (ret)
757 return ret;
759 /* Reset USB Chip, PG14 */
760 gpio_direction_output(GPIO_PG14, 0);
761 mdelay(2);
762 gpio_set_value(GPIO_PG14, 1);
763 #endif
765 return 0;
768 static int __init cm_bf537e_init(void)
770 printk(KERN_INFO "%s(): registering device resources\n", __func__);
771 platform_add_devices(cm_bf537e_devices, ARRAY_SIZE(cm_bf537e_devices));
772 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
773 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
774 #endif
776 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
777 irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
778 #endif
780 if (net2272_init())
781 pr_warning("unable to configure net2272; it probably won't work\n");
783 return 0;
786 arch_initcall(cm_bf537e_init);
788 static struct platform_device *cm_bf537e_early_devices[] __initdata = {
789 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
790 #ifdef CONFIG_SERIAL_BFIN_UART0
791 &bfin_uart0_device,
792 #endif
793 #ifdef CONFIG_SERIAL_BFIN_UART1
794 &bfin_uart1_device,
795 #endif
796 #endif
798 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
799 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
800 &bfin_sport0_uart_device,
801 #endif
802 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
803 &bfin_sport1_uart_device,
804 #endif
805 #endif
808 void __init native_machine_early_platform_add_devices(void)
810 printk(KERN_INFO "register early platform devices\n");
811 early_platform_add_devices(cm_bf537e_early_devices,
812 ARRAY_SIZE(cm_bf537e_early_devices));
815 void bfin_get_ether_addr(char *addr)
817 random_ether_addr(addr);
818 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
820 EXPORT_SYMBOL(bfin_get_ether_addr);