The discovered bit in PGCCSR register indicates if the device has been
[linux-2.6/next.git] / arch / blackfin / mach-bf537 / boards / cm_bf537u.c
blob40d4cd02a96b4ab441ac23e2523e5d57d592c7c9
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>
27 #include <linux/spi/mmc_spi.h>
30 * Name the Board for the /proc/cpuinfo
32 const char bfin_board_name[] = "Bluetechnix CM BF537U";
34 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
35 /* all SPI peripherals info goes here */
37 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
38 static struct mtd_partition bfin_spi_flash_partitions[] = {
40 .name = "bootloader(spi)",
41 .size = 0x00020000,
42 .offset = 0,
43 .mask_flags = MTD_CAP_ROM
44 }, {
45 .name = "linux kernel(spi)",
46 .size = 0xe0000,
47 .offset = 0x20000
48 }, {
49 .name = "file system(spi)",
50 .size = 0x700000,
51 .offset = 0x00100000,
55 static struct flash_platform_data bfin_spi_flash_data = {
56 .name = "m25p80",
57 .parts = bfin_spi_flash_partitions,
58 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
59 .type = "m25p64",
62 /* SPI flash chip (m25p64) */
63 static struct bfin5xx_spi_chip spi_flash_chip_info = {
64 .enable_dma = 0, /* use dma transfer with this chip*/
66 #endif
68 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
69 static struct bfin5xx_spi_chip mmc_spi_chip_info = {
70 .enable_dma = 0,
72 #endif
74 static struct spi_board_info bfin_spi_board_info[] __initdata = {
75 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
77 /* the modalias must be the same as spi device driver name */
78 .modalias = "m25p80", /* Name of spi_driver for this device */
79 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
80 .bus_num = 0, /* Framework bus number */
81 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
82 .platform_data = &bfin_spi_flash_data,
83 .controller_data = &spi_flash_chip_info,
84 .mode = SPI_MODE_3,
86 #endif
88 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
90 .modalias = "ad183x",
91 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
92 .bus_num = 0,
93 .chip_select = 4,
95 #endif
97 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
99 .modalias = "mmc_spi",
100 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
101 .bus_num = 0,
102 .chip_select = 1,
103 .controller_data = &mmc_spi_chip_info,
104 .mode = SPI_MODE_3,
106 #endif
109 /* SPI (0) */
110 static struct resource bfin_spi0_resource[] = {
111 [0] = {
112 .start = SPI0_REGBASE,
113 .end = SPI0_REGBASE + 0xFF,
114 .flags = IORESOURCE_MEM,
116 [1] = {
117 .start = CH_SPI,
118 .end = CH_SPI,
119 .flags = IORESOURCE_DMA,
121 [2] = {
122 .start = IRQ_SPI,
123 .end = IRQ_SPI,
124 .flags = IORESOURCE_IRQ,
128 /* SPI controller data */
129 static struct bfin5xx_spi_master bfin_spi0_info = {
130 .num_chipselect = 8,
131 .enable_dma = 1, /* master has the ability to do dma transfer */
132 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
135 static struct platform_device bfin_spi0_device = {
136 .name = "bfin-spi",
137 .id = 0, /* Bus number */
138 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
139 .resource = bfin_spi0_resource,
140 .dev = {
141 .platform_data = &bfin_spi0_info, /* Passed to driver */
144 #endif /* spi master and devices */
146 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
147 static struct platform_device rtc_device = {
148 .name = "rtc-bfin",
149 .id = -1,
151 #endif
153 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
154 static struct platform_device hitachi_fb_device = {
155 .name = "hitachi-tx09",
157 #endif
159 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
160 #include <linux/smc91x.h>
162 static struct smc91x_platdata smc91x_info = {
163 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
164 .leda = RPC_LED_100_10,
165 .ledb = RPC_LED_TX_RX,
168 static struct resource smc91x_resources[] = {
170 .start = 0x20200300,
171 .end = 0x20200300 + 16,
172 .flags = IORESOURCE_MEM,
173 }, {
174 .start = IRQ_PF14,
175 .end = IRQ_PF14,
176 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
180 static struct platform_device smc91x_device = {
181 .name = "smc91x",
182 .id = 0,
183 .num_resources = ARRAY_SIZE(smc91x_resources),
184 .resource = smc91x_resources,
185 .dev = {
186 .platform_data = &smc91x_info,
189 #endif
191 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
192 static struct resource isp1362_hcd_resources[] = {
194 .start = 0x20308000,
195 .end = 0x20308000,
196 .flags = IORESOURCE_MEM,
197 }, {
198 .start = 0x20308004,
199 .end = 0x20308004,
200 .flags = IORESOURCE_MEM,
201 }, {
202 .start = IRQ_PG15,
203 .end = IRQ_PG15,
204 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
208 static struct isp1362_platform_data isp1362_priv = {
209 .sel15Kres = 1,
210 .clknotstop = 0,
211 .oc_enable = 0,
212 .int_act_high = 0,
213 .int_edge_triggered = 0,
214 .remote_wakeup_connected = 0,
215 .no_power_switching = 1,
216 .power_switching_mode = 0,
219 static struct platform_device isp1362_hcd_device = {
220 .name = "isp1362-hcd",
221 .id = 0,
222 .dev = {
223 .platform_data = &isp1362_priv,
225 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
226 .resource = isp1362_hcd_resources,
228 #endif
230 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
231 static struct resource net2272_bfin_resources[] = {
233 .start = 0x20200000,
234 .end = 0x20200000 + 0x100,
235 .flags = IORESOURCE_MEM,
236 }, {
237 .start = IRQ_PH14,
238 .end = IRQ_PH14,
239 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
243 static struct platform_device net2272_bfin_device = {
244 .name = "net2272",
245 .id = -1,
246 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
247 .resource = net2272_bfin_resources,
249 #endif
251 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
252 static struct mtd_partition cm_partitions[] = {
254 .name = "bootloader(nor)",
255 .size = 0x40000,
256 .offset = 0,
257 }, {
258 .name = "linux kernel(nor)",
259 .size = 0x100000,
260 .offset = MTDPART_OFS_APPEND,
261 }, {
262 .name = "file system(nor)",
263 .size = MTDPART_SIZ_FULL,
264 .offset = MTDPART_OFS_APPEND,
268 static struct physmap_flash_data cm_flash_data = {
269 .width = 2,
270 .parts = cm_partitions,
271 .nr_parts = ARRAY_SIZE(cm_partitions),
274 static unsigned cm_flash_gpios[] = { GPIO_PH0 };
276 static struct resource cm_flash_resource[] = {
278 .name = "cfi_probe",
279 .start = 0x20000000,
280 .end = 0x201fffff,
281 .flags = IORESOURCE_MEM,
282 }, {
283 .start = (unsigned long)cm_flash_gpios,
284 .end = ARRAY_SIZE(cm_flash_gpios),
285 .flags = IORESOURCE_IRQ,
289 static struct platform_device cm_flash_device = {
290 .name = "gpio-addr-flash",
291 .id = 0,
292 .dev = {
293 .platform_data = &cm_flash_data,
295 .num_resources = ARRAY_SIZE(cm_flash_resource),
296 .resource = cm_flash_resource,
298 #endif
300 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
301 #ifdef CONFIG_SERIAL_BFIN_UART0
302 static struct resource bfin_uart0_resources[] = {
304 .start = UART0_THR,
305 .end = UART0_GCTL+2,
306 .flags = IORESOURCE_MEM,
309 .start = IRQ_UART0_TX,
310 .end = IRQ_UART0_TX,
311 .flags = IORESOURCE_IRQ,
314 .start = IRQ_UART0_RX,
315 .end = IRQ_UART0_RX,
316 .flags = IORESOURCE_IRQ,
319 .start = IRQ_UART0_ERROR,
320 .end = IRQ_UART0_ERROR,
321 .flags = IORESOURCE_IRQ,
324 .start = CH_UART0_TX,
325 .end = CH_UART0_TX,
326 .flags = IORESOURCE_DMA,
329 .start = CH_UART0_RX,
330 .end = CH_UART0_RX,
331 .flags = IORESOURCE_DMA,
335 static unsigned short bfin_uart0_peripherals[] = {
336 P_UART0_TX, P_UART0_RX, 0
339 static struct platform_device bfin_uart0_device = {
340 .name = "bfin-uart",
341 .id = 0,
342 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
343 .resource = bfin_uart0_resources,
344 .dev = {
345 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
348 #endif
349 #ifdef CONFIG_SERIAL_BFIN_UART1
350 static struct resource bfin_uart1_resources[] = {
352 .start = UART1_THR,
353 .end = UART1_GCTL+2,
354 .flags = IORESOURCE_MEM,
357 .start = IRQ_UART1_TX,
358 .end = IRQ_UART1_TX,
359 .flags = IORESOURCE_IRQ,
362 .start = IRQ_UART1_RX,
363 .end = IRQ_UART1_RX,
364 .flags = IORESOURCE_IRQ,
367 .start = IRQ_UART1_ERROR,
368 .end = IRQ_UART1_ERROR,
369 .flags = IORESOURCE_IRQ,
372 .start = CH_UART1_TX,
373 .end = CH_UART1_TX,
374 .flags = IORESOURCE_DMA,
377 .start = CH_UART1_RX,
378 .end = CH_UART1_RX,
379 .flags = IORESOURCE_DMA,
383 static unsigned short bfin_uart1_peripherals[] = {
384 P_UART1_TX, P_UART1_RX, 0
387 static struct platform_device bfin_uart1_device = {
388 .name = "bfin-uart",
389 .id = 1,
390 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
391 .resource = bfin_uart1_resources,
392 .dev = {
393 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
396 #endif
397 #endif
399 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
400 #ifdef CONFIG_BFIN_SIR0
401 static struct resource bfin_sir0_resources[] = {
403 .start = 0xFFC00400,
404 .end = 0xFFC004FF,
405 .flags = IORESOURCE_MEM,
408 .start = IRQ_UART0_RX,
409 .end = IRQ_UART0_RX+1,
410 .flags = IORESOURCE_IRQ,
413 .start = CH_UART0_RX,
414 .end = CH_UART0_RX+1,
415 .flags = IORESOURCE_DMA,
418 static struct platform_device bfin_sir0_device = {
419 .name = "bfin_sir",
420 .id = 0,
421 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
422 .resource = bfin_sir0_resources,
424 #endif
425 #ifdef CONFIG_BFIN_SIR1
426 static struct resource bfin_sir1_resources[] = {
428 .start = 0xFFC02000,
429 .end = 0xFFC020FF,
430 .flags = IORESOURCE_MEM,
433 .start = IRQ_UART1_RX,
434 .end = IRQ_UART1_RX+1,
435 .flags = IORESOURCE_IRQ,
438 .start = CH_UART1_RX,
439 .end = CH_UART1_RX+1,
440 .flags = IORESOURCE_DMA,
443 static struct platform_device bfin_sir1_device = {
444 .name = "bfin_sir",
445 .id = 1,
446 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
447 .resource = bfin_sir1_resources,
449 #endif
450 #endif
452 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
453 static struct resource bfin_twi0_resource[] = {
454 [0] = {
455 .start = TWI0_REGBASE,
456 .end = TWI0_REGBASE,
457 .flags = IORESOURCE_MEM,
459 [1] = {
460 .start = IRQ_TWI,
461 .end = IRQ_TWI,
462 .flags = IORESOURCE_IRQ,
466 static struct platform_device i2c_bfin_twi_device = {
467 .name = "i2c-bfin-twi",
468 .id = 0,
469 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
470 .resource = bfin_twi0_resource,
472 #endif
474 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
475 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
476 static struct resource bfin_sport0_uart_resources[] = {
478 .start = SPORT0_TCR1,
479 .end = SPORT0_MRCS3+4,
480 .flags = IORESOURCE_MEM,
483 .start = IRQ_SPORT0_RX,
484 .end = IRQ_SPORT0_RX+1,
485 .flags = IORESOURCE_IRQ,
488 .start = IRQ_SPORT0_ERROR,
489 .end = IRQ_SPORT0_ERROR,
490 .flags = IORESOURCE_IRQ,
494 static unsigned short bfin_sport0_peripherals[] = {
495 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
496 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
499 static struct platform_device bfin_sport0_uart_device = {
500 .name = "bfin-sport-uart",
501 .id = 0,
502 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
503 .resource = bfin_sport0_uart_resources,
504 .dev = {
505 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
508 #endif
509 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
510 static struct resource bfin_sport1_uart_resources[] = {
512 .start = SPORT1_TCR1,
513 .end = SPORT1_MRCS3+4,
514 .flags = IORESOURCE_MEM,
517 .start = IRQ_SPORT1_RX,
518 .end = IRQ_SPORT1_RX+1,
519 .flags = IORESOURCE_IRQ,
522 .start = IRQ_SPORT1_ERROR,
523 .end = IRQ_SPORT1_ERROR,
524 .flags = IORESOURCE_IRQ,
528 static unsigned short bfin_sport1_peripherals[] = {
529 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
530 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
533 static struct platform_device bfin_sport1_uart_device = {
534 .name = "bfin-sport-uart",
535 .id = 1,
536 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
537 .resource = bfin_sport1_uart_resources,
538 .dev = {
539 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
542 #endif
543 #endif
545 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
546 #include <linux/bfin_mac.h>
547 static const unsigned short bfin_mac_peripherals[] = P_MII0;
549 static struct bfin_phydev_platform_data bfin_phydev_data[] = {
551 .addr = 1,
552 .irq = IRQ_MAC_PHYINT,
556 static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
557 .phydev_number = 1,
558 .phydev_data = bfin_phydev_data,
559 .phy_mode = PHY_INTERFACE_MODE_MII,
560 .mac_peripherals = bfin_mac_peripherals,
563 static struct platform_device bfin_mii_bus = {
564 .name = "bfin_mii_bus",
565 .dev = {
566 .platform_data = &bfin_mii_bus_data,
570 static struct platform_device bfin_mac_device = {
571 .name = "bfin_mac",
572 .dev = {
573 .platform_data = &bfin_mii_bus,
576 #endif
578 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
579 #define PATA_INT IRQ_PF14
581 static struct pata_platform_info bfin_pata_platform_data = {
582 .ioport_shift = 2,
583 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
586 static struct resource bfin_pata_resources[] = {
588 .start = 0x2030C000,
589 .end = 0x2030C01F,
590 .flags = IORESOURCE_MEM,
593 .start = 0x2030D018,
594 .end = 0x2030D01B,
595 .flags = IORESOURCE_MEM,
598 .start = PATA_INT,
599 .end = PATA_INT,
600 .flags = IORESOURCE_IRQ,
604 static struct platform_device bfin_pata_device = {
605 .name = "pata_platform",
606 .id = -1,
607 .num_resources = ARRAY_SIZE(bfin_pata_resources),
608 .resource = bfin_pata_resources,
609 .dev = {
610 .platform_data = &bfin_pata_platform_data,
613 #endif
615 static const unsigned int cclk_vlev_datasheet[] =
617 VRPAIR(VLEV_085, 250000000),
618 VRPAIR(VLEV_090, 376000000),
619 VRPAIR(VLEV_095, 426000000),
620 VRPAIR(VLEV_100, 426000000),
621 VRPAIR(VLEV_105, 476000000),
622 VRPAIR(VLEV_110, 476000000),
623 VRPAIR(VLEV_115, 476000000),
624 VRPAIR(VLEV_120, 500000000),
625 VRPAIR(VLEV_125, 533000000),
626 VRPAIR(VLEV_130, 600000000),
629 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
630 .tuple_tab = cclk_vlev_datasheet,
631 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
632 .vr_settling_time = 25 /* us */,
635 static struct platform_device bfin_dpmc = {
636 .name = "bfin dpmc",
637 .dev = {
638 .platform_data = &bfin_dmpc_vreg_data,
642 static struct platform_device *cm_bf537u_devices[] __initdata = {
644 &bfin_dpmc,
646 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
647 &hitachi_fb_device,
648 #endif
650 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
651 &rtc_device,
652 #endif
654 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
655 #ifdef CONFIG_SERIAL_BFIN_UART0
656 &bfin_uart0_device,
657 #endif
658 #ifdef CONFIG_SERIAL_BFIN_UART1
659 &bfin_uart1_device,
660 #endif
661 #endif
663 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
664 #ifdef CONFIG_BFIN_SIR0
665 &bfin_sir0_device,
666 #endif
667 #ifdef CONFIG_BFIN_SIR1
668 &bfin_sir1_device,
669 #endif
670 #endif
672 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
673 &i2c_bfin_twi_device,
674 #endif
676 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
677 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
678 &bfin_sport0_uart_device,
679 #endif
680 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
681 &bfin_sport1_uart_device,
682 #endif
683 #endif
685 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
686 &isp1362_hcd_device,
687 #endif
689 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
690 &smc91x_device,
691 #endif
693 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
694 &bfin_mii_bus,
695 &bfin_mac_device,
696 #endif
698 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
699 &net2272_bfin_device,
700 #endif
702 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
703 &bfin_spi0_device,
704 #endif
706 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
707 &bfin_pata_device,
708 #endif
710 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
711 &cm_flash_device,
712 #endif
715 static int __init net2272_init(void)
717 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
718 int ret;
720 ret = gpio_request(GPIO_PH15, driver_name);
721 if (ret)
722 return ret;
724 ret = gpio_request(GPIO_PH13, "net2272");
725 if (ret) {
726 gpio_free(GPIO_PH15);
727 return ret;
730 /* Set PH15 Low make /AMS2 work properly */
731 gpio_direction_output(GPIO_PH15, 0);
733 /* enable CLKBUF output */
734 bfin_write_VR_CTL(bfin_read_VR_CTL() | CLKBUFOE);
736 /* Reset the USB chip */
737 gpio_direction_output(GPIO_PH13, 0);
738 mdelay(2);
739 gpio_set_value(GPIO_PH13, 1);
740 #endif
742 return 0;
745 static int __init cm_bf537u_init(void)
747 printk(KERN_INFO "%s(): registering device resources\n", __func__);
748 platform_add_devices(cm_bf537u_devices, ARRAY_SIZE(cm_bf537u_devices));
749 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
750 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
751 #endif
753 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
754 irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
755 #endif
757 if (net2272_init())
758 pr_warning("unable to configure net2272; it probably won't work\n");
760 return 0;
763 arch_initcall(cm_bf537u_init);
765 static struct platform_device *cm_bf537u_early_devices[] __initdata = {
766 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
767 #ifdef CONFIG_SERIAL_BFIN_UART0
768 &bfin_uart0_device,
769 #endif
770 #ifdef CONFIG_SERIAL_BFIN_UART1
771 &bfin_uart1_device,
772 #endif
773 #endif
775 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
776 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
777 &bfin_sport0_uart_device,
778 #endif
779 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
780 &bfin_sport1_uart_device,
781 #endif
782 #endif
785 void __init native_machine_early_platform_add_devices(void)
787 printk(KERN_INFO "register early platform devices\n");
788 early_platform_add_devices(cm_bf537u_early_devices,
789 ARRAY_SIZE(cm_bf537u_early_devices));
792 void bfin_get_ether_addr(char *addr)
794 random_ether_addr(addr);
795 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
797 EXPORT_SYMBOL(bfin_get_ether_addr);