blob: c1b72f2d635476ccc18d91f2d8455efe4d86ddb5 [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
Robin Getz96f10502009-09-24 14:11:24 +00002 * Copyright 2004-2009 Analog Devices Inc.
3 * 2008-2009 Bluetechnix
4 * 2005 National ICT Australia (NICTA)
5 * Aidan Williams <aidan@nicta.com.au>
Bryan Wu1394f032007-05-06 14:50:22 -07006 *
Robin Getz96f10502009-09-24 14:11:24 +00007 * Licensed under the GPL-2 or later.
Bryan Wu1394f032007-05-06 14:50:22 -07008 */
9
10#include <linux/device.h>
11#include <linux/platform_device.h>
12#include <linux/mtd/mtd.h>
13#include <linux/mtd/partitions.h>
14#include <linux/spi/spi.h>
15#include <linux/spi/flash.h>
Mike Frysingerb964c592008-05-10 00:06:10 +080016#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
Mike Frysingerf02bcec2007-11-15 21:29:15 +080017#include <linux/usb/isp1362.h>
Mike Frysingerb964c592008-05-10 00:06:10 +080018#endif
Jeff Garzik0a87e3e2008-02-01 18:02:30 -050019#include <linux/ata_platform.h>
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080020#include <linux/irq.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080021#include <asm/dma.h>
Bryan Wu1394f032007-05-06 14:50:22 -070022#include <asm/bfin5xx_spi.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080023#include <asm/portmux.h>
Michael Hennerich14b03202008-05-07 11:41:26 +080024#include <asm/dpmc.h>
Harald Krapfenbauer9c214532009-09-10 15:30:03 +000025#include <linux/mtd/physmap.h>
Bryan Wu1394f032007-05-06 14:50:22 -070026
27/*
28 * Name the Board for the /proc/cpuinfo
29 */
Mike Frysinger066954a2007-10-21 22:36:06 +080030const char bfin_board_name[] = "Bluetechnix CM BF561";
Bryan Wu1394f032007-05-06 14:50:22 -070031
32#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Simon Arlottd2d50aa2007-06-11 15:31:30 +080033/* all SPI peripherals info goes here */
Bryan Wu1394f032007-05-06 14:50:22 -070034
35#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
36static struct mtd_partition bfin_spi_flash_partitions[] = {
37 {
Robin Getzaa582972008-08-05 17:47:29 +080038 .name = "bootloader(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -070039 .size = 0x00020000,
40 .offset = 0,
41 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080042 }, {
Robin Getzaa582972008-08-05 17:47:29 +080043 .name = "linux kernel(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -070044 .size = 0xe0000,
45 .offset = 0x20000
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080046 }, {
Robin Getzaa582972008-08-05 17:47:29 +080047 .name = "file system(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -070048 .size = 0x700000,
49 .offset = 0x00100000,
50 }
51};
52
53static struct flash_platform_data bfin_spi_flash_data = {
54 .name = "m25p80",
55 .parts = bfin_spi_flash_partitions,
56 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
57 .type = "m25p64",
58};
59
60/* SPI flash chip (m25p64) */
61static struct bfin5xx_spi_chip spi_flash_chip_info = {
62 .enable_dma = 0, /* use dma transfer with this chip*/
Bryan Wu1394f032007-05-06 14:50:22 -070063};
64#endif
65
66static struct spi_board_info bfin_spi_board_info[] __initdata = {
67#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
68 {
69 /* the modalias must be the same as spi device driver name */
70 .modalias = "m25p80", /* Name of spi_driver for this device */
71 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080072 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -070073 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
74 .platform_data = &bfin_spi_flash_data,
75 .controller_data = &spi_flash_chip_info,
76 .mode = SPI_MODE_3,
77 },
78#endif
79
Barry Song7ba80062010-01-28 09:37:21 +000080#if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -070081 {
Barry Song7ba80062010-01-28 09:37:21 +000082 .modalias = "ad183x",
Bryan Wu1394f032007-05-06 14:50:22 -070083 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080084 .bus_num = 0,
Barry Song7ba80062010-01-28 09:37:21 +000085 .chip_select = 4,
Bryan Wu1394f032007-05-06 14:50:22 -070086 },
87#endif
Michael Hennerichf3f704d2009-03-06 00:27:57 +080088#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -070089 {
Michael Hennerichf3f704d2009-03-06 00:27:57 +080090 .modalias = "mmc_spi",
Harald Krapfenbauer9c214532009-09-10 15:30:03 +000091 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080092 .bus_num = 0,
Harald Krapfenbauer9c214532009-09-10 15:30:03 +000093 .chip_select = 1,
Bryan Wu1394f032007-05-06 14:50:22 -070094 .mode = SPI_MODE_3,
95 },
96#endif
97};
98
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080099/* SPI (0) */
100static struct resource bfin_spi0_resource[] = {
101 [0] = {
102 .start = SPI0_REGBASE,
103 .end = SPI0_REGBASE + 0xFF,
104 .flags = IORESOURCE_MEM,
105 },
106 [1] = {
107 .start = CH_SPI,
108 .end = CH_SPI,
Yi Li53122692009-06-05 12:11:11 +0000109 .flags = IORESOURCE_DMA,
110 },
111 [2] = {
112 .start = IRQ_SPI,
113 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800114 .flags = IORESOURCE_IRQ,
Yi Li53122692009-06-05 12:11:11 +0000115 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800116};
117
Bryan Wu1394f032007-05-06 14:50:22 -0700118/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800119static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700120 .num_chipselect = 8,
121 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800122 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -0700123};
124
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800125static struct platform_device bfin_spi0_device = {
126 .name = "bfin-spi",
127 .id = 0, /* Bus number */
128 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
129 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -0700130 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800131 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -0700132 },
133};
134#endif /* spi master and devices */
135
136
Michael Hennerich0d4a89b2008-01-27 19:58:46 +0800137#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
138static struct platform_device hitachi_fb_device = {
139 .name = "hitachi-tx09",
140};
141#endif
142
143
Bryan Wu1394f032007-05-06 14:50:22 -0700144#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Michael Hennerich61f09b52009-07-24 08:48:31 +0000145#include <linux/smc91x.h>
146
147static struct smc91x_platdata smc91x_info = {
148 .flags = SMC91X_USE_32BIT | SMC91X_NOWAIT,
149 .leda = RPC_LED_100_10,
150 .ledb = RPC_LED_TX_RX,
151};
Bryan Wu1394f032007-05-06 14:50:22 -0700152
153static struct resource smc91x_resources[] = {
154 {
155 .name = "smc91x-regs",
156 .start = 0x28000300,
157 .end = 0x28000300 + 16,
158 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800159 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700160 .start = IRQ_PF0,
161 .end = IRQ_PF0,
162 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
163 },
164};
165static struct platform_device smc91x_device = {
166 .name = "smc91x",
167 .id = 0,
168 .num_resources = ARRAY_SIZE(smc91x_resources),
169 .resource = smc91x_resources,
Michael Hennerich61f09b52009-07-24 08:48:31 +0000170 .dev = {
171 .platform_data = &smc91x_info,
172 },
Bryan Wu1394f032007-05-06 14:50:22 -0700173};
174#endif
175
Harald Krapfenbauer9c214532009-09-10 15:30:03 +0000176#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
177#include <linux/smsc911x.h>
178
179static struct resource smsc911x_resources[] = {
180 {
181 .name = "smsc911x-memory",
182 .start = 0x24008000,
183 .end = 0x24008000 + 0xFF,
184 .flags = IORESOURCE_MEM,
185 },
186 {
187 .start = IRQ_PF43,
188 .end = IRQ_PF43,
189 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
190 },
191};
192
193static struct smsc911x_platform_config smsc911x_config = {
194 .flags = SMSC911X_USE_16BIT,
195 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
196 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
197 .phy_interface = PHY_INTERFACE_MODE_MII,
198};
199
200static struct platform_device smsc911x_device = {
201 .name = "smsc911x",
202 .id = 0,
203 .num_resources = ARRAY_SIZE(smsc911x_resources),
204 .resource = smsc911x_resources,
205 .dev = {
206 .platform_data = &smsc911x_config,
207 },
208};
209#endif
210
211#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
212static struct resource net2272_bfin_resources[] = {
213 {
214 .start = 0x24000000,
215 .end = 0x24000000 + 0x100,
216 .flags = IORESOURCE_MEM,
217 }, {
218 .start = IRQ_PF45,
219 .end = IRQ_PF45,
220 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
221 },
222};
223
224static struct platform_device net2272_bfin_device = {
225 .name = "net2272",
226 .id = -1,
227 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
228 .resource = net2272_bfin_resources,
229};
230#endif
231
Bryan Wu1394f032007-05-06 14:50:22 -0700232#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
233static struct resource isp1362_hcd_resources[] = {
234 {
235 .start = 0x24008000,
236 .end = 0x24008000,
237 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800238 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700239 .start = 0x24008004,
240 .end = 0x24008004,
241 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800242 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700243 .start = IRQ_PF47,
244 .end = IRQ_PF47,
Michael Hennerich9e758942010-03-18 12:51:49 +0000245 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
Bryan Wu1394f032007-05-06 14:50:22 -0700246 },
247};
248
249static struct isp1362_platform_data isp1362_priv = {
250 .sel15Kres = 1,
251 .clknotstop = 0,
252 .oc_enable = 0,
253 .int_act_high = 0,
254 .int_edge_triggered = 0,
255 .remote_wakeup_connected = 0,
256 .no_power_switching = 1,
257 .power_switching_mode = 0,
258};
259
260static struct platform_device isp1362_hcd_device = {
261 .name = "isp1362-hcd",
262 .id = 0,
263 .dev = {
264 .platform_data = &isp1362_priv,
265 },
266 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
267 .resource = isp1362_hcd_resources,
268};
269#endif
270
271#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000272#ifdef CONFIG_SERIAL_BFIN_UART0
273static struct resource bfin_uart0_resources[] = {
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800274 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000275 .start = BFIN_UART_THR,
276 .end = BFIN_UART_GCTL+2,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800277 .flags = IORESOURCE_MEM,
278 },
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000279 {
280 .start = IRQ_UART_RX,
281 .end = IRQ_UART_RX+1,
282 .flags = IORESOURCE_IRQ,
283 },
284 {
285 .start = IRQ_UART_ERROR,
286 .end = IRQ_UART_ERROR,
287 .flags = IORESOURCE_IRQ,
288 },
289 {
290 .start = CH_UART_TX,
291 .end = CH_UART_TX,
292 .flags = IORESOURCE_DMA,
293 },
294 {
295 .start = CH_UART_RX,
296 .end = CH_UART_RX,
297 .flags = IORESOURCE_DMA,
298 },
Bryan Wu1394f032007-05-06 14:50:22 -0700299};
300
Mike Frysingera8b19882010-11-24 09:23:04 +0000301static unsigned short bfin_uart0_peripherals[] = {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000302 P_UART0_TX, P_UART0_RX, 0
Bryan Wu1394f032007-05-06 14:50:22 -0700303};
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000304
305static struct platform_device bfin_uart0_device = {
306 .name = "bfin-uart",
307 .id = 0,
308 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
309 .resource = bfin_uart0_resources,
310 .dev = {
311 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
312 },
313};
314#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700315#endif
316
Graf Yang5be36d22008-04-25 03:09:15 +0800317#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +0800318#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800319static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800320 {
321 .start = 0xFFC00400,
322 .end = 0xFFC004FF,
323 .flags = IORESOURCE_MEM,
324 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800325 {
326 .start = IRQ_UART0_RX,
327 .end = IRQ_UART0_RX+1,
328 .flags = IORESOURCE_IRQ,
329 },
330 {
331 .start = CH_UART0_RX,
332 .end = CH_UART0_RX+1,
333 .flags = IORESOURCE_DMA,
334 },
Graf Yang5be36d22008-04-25 03:09:15 +0800335};
336
Graf Yang42bd8bc2009-01-07 23:14:39 +0800337static struct platform_device bfin_sir0_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800338 .name = "bfin_sir",
339 .id = 0,
Graf Yang42bd8bc2009-01-07 23:14:39 +0800340 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
341 .resource = bfin_sir0_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800342};
343#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800344#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800345
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800346#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
Mike Frysingerfe5aeb92008-08-05 18:29:56 +0800347#define PATA_INT IRQ_PF46
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800348
349static struct pata_platform_info bfin_pata_platform_data = {
350 .ioport_shift = 2,
Yong Zhang7832bb52011-09-07 16:10:03 +0800351 .irq_type = IRQF_TRIGGER_HIGH,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800352};
353
354static struct resource bfin_pata_resources[] = {
355 {
356 .start = 0x2400C000,
357 .end = 0x2400C001F,
358 .flags = IORESOURCE_MEM,
359 },
360 {
361 .start = 0x2400D018,
362 .end = 0x2400D01B,
363 .flags = IORESOURCE_MEM,
364 },
365 {
366 .start = PATA_INT,
367 .end = PATA_INT,
368 .flags = IORESOURCE_IRQ,
369 },
370};
371
372static struct platform_device bfin_pata_device = {
373 .name = "pata_platform",
374 .id = -1,
375 .num_resources = ARRAY_SIZE(bfin_pata_resources),
376 .resource = bfin_pata_resources,
377 .dev = {
378 .platform_data = &bfin_pata_platform_data,
379 }
380};
381#endif
382
Harald Krapfenbauer9c214532009-09-10 15:30:03 +0000383#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
384static struct mtd_partition para_partitions[] = {
385 {
386 .name = "bootloader(nor)",
387 .size = 0x40000,
388 .offset = 0,
389 }, {
390 .name = "linux kernel(nor)",
391 .size = 0x100000,
392 .offset = MTDPART_OFS_APPEND,
393 }, {
394 .name = "file system(nor)",
395 .size = MTDPART_SIZ_FULL,
396 .offset = MTDPART_OFS_APPEND,
397 }
398};
399
400static struct physmap_flash_data para_flash_data = {
401 .width = 2,
402 .parts = para_partitions,
403 .nr_parts = ARRAY_SIZE(para_partitions),
404};
405
406static struct resource para_flash_resource = {
407 .start = 0x20000000,
408 .end = 0x207fffff,
409 .flags = IORESOURCE_MEM,
410};
411
412static struct platform_device para_flash_device = {
413 .name = "physmap-flash",
414 .id = 0,
415 .dev = {
416 .platform_data = &para_flash_data,
417 },
418 .num_resources = 1,
419 .resource = &para_flash_resource,
420};
421#endif
422
Michael Hennerich14b03202008-05-07 11:41:26 +0800423static const unsigned int cclk_vlev_datasheet[] =
424{
425 VRPAIR(VLEV_085, 250000000),
426 VRPAIR(VLEV_090, 300000000),
427 VRPAIR(VLEV_095, 313000000),
428 VRPAIR(VLEV_100, 350000000),
429 VRPAIR(VLEV_105, 400000000),
430 VRPAIR(VLEV_110, 444000000),
431 VRPAIR(VLEV_115, 450000000),
432 VRPAIR(VLEV_120, 475000000),
433 VRPAIR(VLEV_125, 500000000),
434 VRPAIR(VLEV_130, 600000000),
435};
436
437static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
438 .tuple_tab = cclk_vlev_datasheet,
439 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
440 .vr_settling_time = 25 /* us */,
441};
442
443static struct platform_device bfin_dpmc = {
444 .name = "bfin dpmc",
445 .dev = {
446 .platform_data = &bfin_dmpc_vreg_data,
447 },
448};
449
Bryan Wu1394f032007-05-06 14:50:22 -0700450static struct platform_device *cm_bf561_devices[] __initdata = {
451
Michael Hennerich14b03202008-05-07 11:41:26 +0800452 &bfin_dpmc,
453
Michael Hennerich0d4a89b2008-01-27 19:58:46 +0800454#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
455 &hitachi_fb_device,
456#endif
457
Bryan Wu1394f032007-05-06 14:50:22 -0700458#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000459#ifdef CONFIG_SERIAL_BFIN_UART0
460 &bfin_uart0_device,
461#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700462#endif
463
Graf Yang5be36d22008-04-25 03:09:15 +0800464#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +0800465#ifdef CONFIG_BFIN_SIR0
466 &bfin_sir0_device,
467#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800468#endif
469
Bryan Wu1394f032007-05-06 14:50:22 -0700470#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
471 &isp1362_hcd_device,
472#endif
473
474#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
475 &smc91x_device,
476#endif
477
Harald Krapfenbauer9c214532009-09-10 15:30:03 +0000478#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
479 &smsc911x_device,
480#endif
481
482#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
483 &net2272_bfin_device,
484#endif
485
Bryan Wu1394f032007-05-06 14:50:22 -0700486#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800487 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700488#endif
489
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800490#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
491 &bfin_pata_device,
492#endif
Mike Frysingerc97618d2009-01-07 23:14:38 +0800493
Harald Krapfenbauer9c214532009-09-10 15:30:03 +0000494#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
495 &para_flash_device,
496#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700497};
498
Mike Frysinger9be86312011-05-04 11:20:15 -0400499static int __init net2272_init(void)
500{
501#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
502 int ret;
503
504 ret = gpio_request(GPIO_PF46, "net2272");
505 if (ret)
506 return ret;
507
508 /* Reset USB Chip, PF46 */
509 gpio_direction_output(GPIO_PF46, 0);
510 mdelay(2);
511 gpio_set_value(GPIO_PF46, 1);
512#endif
513
514 return 0;
515}
516
Bryan Wu1394f032007-05-06 14:50:22 -0700517static int __init cm_bf561_init(void)
518{
Harvey Harrisonb85d8582008-04-23 09:39:01 +0800519 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu1394f032007-05-06 14:50:22 -0700520 platform_add_devices(cm_bf561_devices, ARRAY_SIZE(cm_bf561_devices));
521#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
522 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
523#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800524
525#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
Thomas Gleixnerbc2f6bd2011-02-06 18:23:38 +0000526 irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800527#endif
Mike Frysinger9be86312011-05-04 11:20:15 -0400528
529 if (net2272_init())
530 pr_warning("unable to configure net2272; it probably won't work\n");
531
Bryan Wu1394f032007-05-06 14:50:22 -0700532 return 0;
533}
534
535arch_initcall(cm_bf561_init);
Sonic Zhangc13ce9f2009-09-23 09:37:46 +0000536
537static struct platform_device *cm_bf561_early_devices[] __initdata = {
538#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
539#ifdef CONFIG_SERIAL_BFIN_UART0
540 &bfin_uart0_device,
541#endif
542#endif
543};
544
545void __init native_machine_early_platform_add_devices(void)
546{
547 printk(KERN_INFO "register early platform devices\n");
548 early_platform_add_devices(cm_bf561_early_devices,
549 ARRAY_SIZE(cm_bf561_early_devices));
550}