blob: c62f9dccd9f797e4ea74d8253781f478a963e186 [file] [log] [blame]
Martin Strubel471b9a62008-01-27 19:54:20 +08001/*
Robin Getz96f10502009-09-24 14:11:24 +00002 * Copyright 2004-2009 Analog Devices Inc.
3 * 2008-2009 Cambridge Signal Processing
4 * 2005 National ICT Australia (NICTA)
5 * Aidan Williams <aidan@nicta.com.au>
6 *
7 * Licensed under the GPL-2 or later.
Martin Strubel471b9a62008-01-27 19:54:20 +08008 */
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>
16#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
Peter Korsgaardf950f602008-04-24 03:34:13 +080017#include <linux/usb/isp1362.h>
Martin Strubel471b9a62008-01-27 19:54:20 +080018#endif
Jeff Garzik0a87e3e2008-02-01 18:02:30 -050019#include <linux/ata_platform.h>
Martin Strubel471b9a62008-01-27 19:54:20 +080020#include <linux/irq.h>
21#include <linux/interrupt.h>
Peter Korsgaardf950f602008-04-24 03:34:13 +080022#include <linux/usb/sl811.h>
Martin Strubel471b9a62008-01-27 19:54:20 +080023#include <asm/dma.h>
24#include <asm/bfin5xx_spi.h>
25#include <asm/reboot.h>
Mike Frysinger11cabcb2010-04-15 16:31:43 +000026#include <asm/portmux.h>
Martin Strubel471b9a62008-01-27 19:54:20 +080027#include <linux/spi/ad7877.h>
28
29/*
30 * Name the Board for the /proc/cpuinfo
31 */
Mike Frysinger11cabcb2010-04-15 16:31:43 +000032const char bfin_board_name[] = "CamSig Minotaur BF537";
Martin Strubel471b9a62008-01-27 19:54:20 +080033
34#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
35static struct resource bfin_pcmcia_cf_resources[] = {
36 {
37 .start = 0x20310000, /* IO PORT */
38 .end = 0x20312000,
39 .flags = IORESOURCE_MEM,
40 }, {
41 .start = 0x20311000, /* Attribute Memory */
42 .end = 0x20311FFF,
43 .flags = IORESOURCE_MEM,
44 }, {
45 .start = IRQ_PF4,
46 .end = IRQ_PF4,
47 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
48 }, {
49 .start = IRQ_PF6, /* Card Detect PF6 */
50 .end = IRQ_PF6,
51 .flags = IORESOURCE_IRQ,
52 },
53};
54
55static struct platform_device bfin_pcmcia_cf_device = {
56 .name = "bfin_cf_pcmcia",
57 .id = -1,
58 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
59 .resource = bfin_pcmcia_cf_resources,
60};
61#endif
62
63#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
64static struct platform_device rtc_device = {
65 .name = "rtc-bfin",
66 .id = -1,
67};
68#endif
69
70#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Sonic Zhang02460d02010-06-11 10:44:22 +000071#include <linux/bfin_mac.h>
72static const unsigned short bfin_mac_peripherals[] = P_MII0;
73
74static struct bfin_phydev_platform_data bfin_phydev_data[] = {
75 {
76 .addr = 1,
77 .irq = IRQ_MAC_PHYINT,
78 },
79};
80
81static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
82 .phydev_number = 1,
83 .phydev_data = bfin_phydev_data,
84 .phy_mode = PHY_INTERFACE_MODE_MII,
85 .mac_peripherals = bfin_mac_peripherals,
86};
87
Graf Yang65319622009-02-04 16:49:45 +080088static struct platform_device bfin_mii_bus = {
89 .name = "bfin_mii_bus",
Sonic Zhang02460d02010-06-11 10:44:22 +000090 .dev = {
91 .platform_data = &bfin_mii_bus_data,
92 }
Graf Yang65319622009-02-04 16:49:45 +080093};
94
Martin Strubel471b9a62008-01-27 19:54:20 +080095static struct platform_device bfin_mac_device = {
96 .name = "bfin_mac",
Sonic Zhang02460d02010-06-11 10:44:22 +000097 .dev = {
98 .platform_data = &bfin_mii_bus,
99 }
Martin Strubel471b9a62008-01-27 19:54:20 +0800100};
101#endif
102
103#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
104static struct resource net2272_bfin_resources[] = {
105 {
106 .start = 0x20300000,
107 .end = 0x20300000 + 0x100,
108 .flags = IORESOURCE_MEM,
109 }, {
110 .start = IRQ_PF7,
111 .end = IRQ_PF7,
112 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
113 },
114};
115
116static struct platform_device net2272_bfin_device = {
117 .name = "net2272",
118 .id = -1,
119 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
120 .resource = net2272_bfin_resources,
121};
122#endif
123
124#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
125/* all SPI peripherals info goes here */
126
127#if defined(CONFIG_MTD_M25P80) \
128 || defined(CONFIG_MTD_M25P80_MODULE)
129
130/* Partition sizes */
131#define FLASH_SIZE 0x00400000
132#define PSIZE_UBOOT 0x00030000
133#define PSIZE_INITRAMFS 0x00240000
134
135static struct mtd_partition bfin_spi_flash_partitions[] = {
136 {
Robin Getzaa582972008-08-05 17:47:29 +0800137 .name = "bootloader(spi)",
Martin Strubel471b9a62008-01-27 19:54:20 +0800138 .size = PSIZE_UBOOT,
139 .offset = 0x000000,
140 .mask_flags = MTD_CAP_ROM
141 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800142 .name = "initramfs(spi)",
Martin Strubel471b9a62008-01-27 19:54:20 +0800143 .size = PSIZE_INITRAMFS,
144 .offset = PSIZE_UBOOT
145 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800146 .name = "opt(spi)",
Martin Strubel471b9a62008-01-27 19:54:20 +0800147 .size = FLASH_SIZE - (PSIZE_UBOOT + PSIZE_INITRAMFS),
148 .offset = PSIZE_UBOOT + PSIZE_INITRAMFS,
149 }
150};
151
152static struct flash_platform_data bfin_spi_flash_data = {
153 .name = "m25p80",
154 .parts = bfin_spi_flash_partitions,
155 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
156 .type = "m25p64",
157};
158
159/* SPI flash chip (m25p64) */
160static struct bfin5xx_spi_chip spi_flash_chip_info = {
161 .enable_dma = 0, /* use dma transfer with this chip*/
Martin Strubel471b9a62008-01-27 19:54:20 +0800162};
163#endif
164
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800165#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
166static struct bfin5xx_spi_chip mmc_spi_chip_info = {
167 .enable_dma = 0,
Martin Strubel471b9a62008-01-27 19:54:20 +0800168};
169#endif
170
171static struct spi_board_info bfin_spi_board_info[] __initdata = {
172#if defined(CONFIG_MTD_M25P80) \
173 || defined(CONFIG_MTD_M25P80_MODULE)
174 {
175 /* the modalias must be the same as spi device driver name */
176 .modalias = "m25p80", /* Name of spi_driver for this device */
177 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
178 .bus_num = 0, /* Framework bus number */
179 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
180 .platform_data = &bfin_spi_flash_data,
181 .controller_data = &spi_flash_chip_info,
182 .mode = SPI_MODE_3,
183 },
184#endif
185
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800186#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
Martin Strubel471b9a62008-01-27 19:54:20 +0800187 {
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800188 .modalias = "mmc_spi",
Martin Strubel471b9a62008-01-27 19:54:20 +0800189 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
190 .bus_num = 0,
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800191 .chip_select = 5,
192 .controller_data = &mmc_spi_chip_info,
Martin Strubel471b9a62008-01-27 19:54:20 +0800193 .mode = SPI_MODE_3,
194 },
195#endif
196};
197
198/* SPI controller data */
199static struct bfin5xx_spi_master bfin_spi0_info = {
200 .num_chipselect = 8,
201 .enable_dma = 1, /* master has the ability to do dma transfer */
202};
203
204/* SPI (0) */
205static struct resource bfin_spi0_resource[] = {
206 [0] = {
207 .start = SPI0_REGBASE,
208 .end = SPI0_REGBASE + 0xFF,
209 .flags = IORESOURCE_MEM,
210 },
211 [1] = {
212 .start = CH_SPI,
213 .end = CH_SPI,
Yi Li53122692009-06-05 12:11:11 +0000214 .flags = IORESOURCE_DMA,
215 },
216 [2] = {
217 .start = IRQ_SPI,
218 .end = IRQ_SPI,
Martin Strubel471b9a62008-01-27 19:54:20 +0800219 .flags = IORESOURCE_IRQ,
220 },
221};
222
223static struct platform_device bfin_spi0_device = {
224 .name = "bfin-spi",
225 .id = 0, /* Bus number */
226 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
227 .resource = bfin_spi0_resource,
228 .dev = {
229 .platform_data = &bfin_spi0_info, /* Passed to driver */
230 },
231};
232#endif /* spi master and devices */
233
234#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000235#ifdef CONFIG_SERIAL_BFIN_UART0
236static struct resource bfin_uart0_resources[] = {
Martin Strubel471b9a62008-01-27 19:54:20 +0800237 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000238 .start = UART0_THR,
239 .end = UART0_GCTL+2,
Martin Strubel471b9a62008-01-27 19:54:20 +0800240 .flags = IORESOURCE_MEM,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000241 },
242 {
243 .start = IRQ_UART0_RX,
244 .end = IRQ_UART0_RX+1,
245 .flags = IORESOURCE_IRQ,
246 },
247 {
248 .start = IRQ_UART0_ERROR,
249 .end = IRQ_UART0_ERROR,
250 .flags = IORESOURCE_IRQ,
251 },
252 {
253 .start = CH_UART0_TX,
254 .end = CH_UART0_TX,
255 .flags = IORESOURCE_DMA,
256 },
257 {
258 .start = CH_UART0_RX,
259 .end = CH_UART0_RX,
260 .flags = IORESOURCE_DMA,
Martin Strubel471b9a62008-01-27 19:54:20 +0800261 },
262};
263
Mike Frysingera8b19882010-11-24 09:23:04 +0000264static unsigned short bfin_uart0_peripherals[] = {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000265 P_UART0_TX, P_UART0_RX, 0
266};
267
268static struct platform_device bfin_uart0_device = {
269 .name = "bfin-uart",
270 .id = 0,
271 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
272 .resource = bfin_uart0_resources,
273 .dev = {
274 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
275 },
276};
277#endif
278#ifdef CONFIG_SERIAL_BFIN_UART1
279static struct resource bfin_uart1_resources[] = {
280 {
281 .start = UART1_THR,
282 .end = UART1_GCTL+2,
283 .flags = IORESOURCE_MEM,
284 },
285 {
286 .start = IRQ_UART1_RX,
287 .end = IRQ_UART1_RX+1,
288 .flags = IORESOURCE_IRQ,
289 },
290 {
291 .start = IRQ_UART1_ERROR,
292 .end = IRQ_UART1_ERROR,
293 .flags = IORESOURCE_IRQ,
294 },
295 {
296 .start = CH_UART1_TX,
297 .end = CH_UART1_TX,
298 .flags = IORESOURCE_DMA,
299 },
300 {
301 .start = CH_UART1_RX,
302 .end = CH_UART1_RX,
303 .flags = IORESOURCE_DMA,
304 },
305};
306
Mike Frysingera8b19882010-11-24 09:23:04 +0000307static unsigned short bfin_uart1_peripherals[] = {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000308 P_UART1_TX, P_UART1_RX, 0
309};
310
311static struct platform_device bfin_uart1_device = {
Martin Strubel471b9a62008-01-27 19:54:20 +0800312 .name = "bfin-uart",
313 .id = 1,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000314 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
315 .resource = bfin_uart1_resources,
316 .dev = {
317 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
318 },
Martin Strubel471b9a62008-01-27 19:54:20 +0800319};
320#endif
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000321#endif
Martin Strubel471b9a62008-01-27 19:54:20 +0800322
Graf Yang5be36d22008-04-25 03:09:15 +0800323#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +0800324#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800325static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800326 {
327 .start = 0xFFC00400,
328 .end = 0xFFC004FF,
329 .flags = IORESOURCE_MEM,
330 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800331 {
332 .start = IRQ_UART0_RX,
333 .end = IRQ_UART0_RX+1,
334 .flags = IORESOURCE_IRQ,
335 },
336 {
337 .start = CH_UART0_RX,
338 .end = CH_UART0_RX+1,
339 .flags = IORESOURCE_DMA,
340 },
341};
342
343static struct platform_device bfin_sir0_device = {
344 .name = "bfin_sir",
345 .id = 0,
346 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
347 .resource = bfin_sir0_resources,
348};
Graf Yang5be36d22008-04-25 03:09:15 +0800349#endif
350#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +0800351static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800352 {
353 .start = 0xFFC02000,
354 .end = 0xFFC020FF,
355 .flags = IORESOURCE_MEM,
356 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800357 {
358 .start = IRQ_UART1_RX,
359 .end = IRQ_UART1_RX+1,
360 .flags = IORESOURCE_IRQ,
361 },
362 {
363 .start = CH_UART1_RX,
364 .end = CH_UART1_RX+1,
365 .flags = IORESOURCE_DMA,
366 },
Graf Yang5be36d22008-04-25 03:09:15 +0800367};
368
Graf Yang42bd8bc2009-01-07 23:14:39 +0800369static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800370 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +0800371 .id = 1,
372 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
373 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800374};
375#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800376#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800377
Martin Strubel471b9a62008-01-27 19:54:20 +0800378#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
379static struct resource bfin_twi0_resource[] = {
380 [0] = {
381 .start = TWI0_REGBASE,
382 .end = TWI0_REGBASE + 0xFF,
383 .flags = IORESOURCE_MEM,
384 },
385 [1] = {
386 .start = IRQ_TWI,
387 .end = IRQ_TWI,
388 .flags = IORESOURCE_IRQ,
389 },
390};
391
392static struct platform_device i2c_bfin_twi_device = {
393 .name = "i2c-bfin-twi",
394 .id = 0,
395 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
396 .resource = bfin_twi0_resource,
397};
398#endif
399
400#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +0000401#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
402static struct resource bfin_sport0_uart_resources[] = {
403 {
404 .start = SPORT0_TCR1,
405 .end = SPORT0_MRCS3+4,
406 .flags = IORESOURCE_MEM,
407 },
408 {
409 .start = IRQ_SPORT0_RX,
410 .end = IRQ_SPORT0_RX+1,
411 .flags = IORESOURCE_IRQ,
412 },
413 {
414 .start = IRQ_SPORT0_ERROR,
415 .end = IRQ_SPORT0_ERROR,
416 .flags = IORESOURCE_IRQ,
417 },
418};
419
Mike Frysingera8b19882010-11-24 09:23:04 +0000420static unsigned short bfin_sport0_peripherals[] = {
Sonic Zhangdf5de262009-09-23 05:01:56 +0000421 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
Sonic Zhange54b6732010-11-12 02:45:38 +0000422 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
Sonic Zhangdf5de262009-09-23 05:01:56 +0000423};
424
Martin Strubel471b9a62008-01-27 19:54:20 +0800425static struct platform_device bfin_sport0_uart_device = {
426 .name = "bfin-sport-uart",
427 .id = 0,
Sonic Zhangdf5de262009-09-23 05:01:56 +0000428 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
429 .resource = bfin_sport0_uart_resources,
430 .dev = {
431 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
432 },
433};
434#endif
435#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
436static struct resource bfin_sport1_uart_resources[] = {
437 {
438 .start = SPORT1_TCR1,
439 .end = SPORT1_MRCS3+4,
440 .flags = IORESOURCE_MEM,
441 },
442 {
443 .start = IRQ_SPORT1_RX,
444 .end = IRQ_SPORT1_RX+1,
445 .flags = IORESOURCE_IRQ,
446 },
447 {
448 .start = IRQ_SPORT1_ERROR,
449 .end = IRQ_SPORT1_ERROR,
450 .flags = IORESOURCE_IRQ,
451 },
452};
453
Mike Frysingera8b19882010-11-24 09:23:04 +0000454static unsigned short bfin_sport1_peripherals[] = {
Sonic Zhangdf5de262009-09-23 05:01:56 +0000455 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
Sonic Zhange54b6732010-11-12 02:45:38 +0000456 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
Martin Strubel471b9a62008-01-27 19:54:20 +0800457};
458
459static struct platform_device bfin_sport1_uart_device = {
460 .name = "bfin-sport-uart",
461 .id = 1,
Sonic Zhangdf5de262009-09-23 05:01:56 +0000462 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
463 .resource = bfin_sport1_uart_resources,
464 .dev = {
465 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
466 },
Martin Strubel471b9a62008-01-27 19:54:20 +0800467};
468#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +0000469#endif
Martin Strubel471b9a62008-01-27 19:54:20 +0800470
471static struct platform_device *minotaur_devices[] __initdata = {
472#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
473 &bfin_pcmcia_cf_device,
474#endif
475
476#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
477 &rtc_device,
478#endif
479
480#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800481 &bfin_mii_bus,
Martin Strubel471b9a62008-01-27 19:54:20 +0800482 &bfin_mac_device,
483#endif
484
485#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
486 &net2272_bfin_device,
487#endif
488
489#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
490 &bfin_spi0_device,
491#endif
492
493#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000494#ifdef CONFIG_SERIAL_BFIN_UART0
495 &bfin_uart0_device,
496#endif
497#ifdef CONFIG_SERIAL_BFIN_UART1
498 &bfin_uart1_device,
499#endif
Martin Strubel471b9a62008-01-27 19:54:20 +0800500#endif
501
Graf Yang5be36d22008-04-25 03:09:15 +0800502#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +0800503#ifdef CONFIG_BFIN_SIR0
504 &bfin_sir0_device,
505#endif
506#ifdef CONFIG_BFIN_SIR1
507 &bfin_sir1_device,
508#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800509#endif
510
Martin Strubel471b9a62008-01-27 19:54:20 +0800511#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
512 &i2c_bfin_twi_device,
513#endif
514
515#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +0000516#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
Martin Strubel471b9a62008-01-27 19:54:20 +0800517 &bfin_sport0_uart_device,
Sonic Zhangdf5de262009-09-23 05:01:56 +0000518#endif
519#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
Martin Strubel471b9a62008-01-27 19:54:20 +0800520 &bfin_sport1_uart_device,
521#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +0000522#endif
Martin Strubel471b9a62008-01-27 19:54:20 +0800523
524};
525
526static int __init minotaur_init(void)
527{
Harvey Harrisonb85d8582008-04-23 09:39:01 +0800528 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Martin Strubel471b9a62008-01-27 19:54:20 +0800529 platform_add_devices(minotaur_devices, ARRAY_SIZE(minotaur_devices));
530#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
531 spi_register_board_info(bfin_spi_board_info,
532 ARRAY_SIZE(bfin_spi_board_info));
533#endif
534
535 return 0;
536}
537
538arch_initcall(minotaur_init);
539
Sonic Zhangc13ce9f2009-09-23 09:37:46 +0000540static struct platform_device *minotaur_early_devices[] __initdata = {
541#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
542#ifdef CONFIG_SERIAL_BFIN_UART0
543 &bfin_uart0_device,
544#endif
545#ifdef CONFIG_SERIAL_BFIN_UART1
546 &bfin_uart1_device,
547#endif
548#endif
549
550#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
551#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
552 &bfin_sport0_uart_device,
553#endif
554#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
555 &bfin_sport1_uart_device,
556#endif
557#endif
558};
559
560void __init native_machine_early_platform_add_devices(void)
561{
562 printk(KERN_INFO "register early platform devices\n");
563 early_platform_add_devices(minotaur_early_devices,
564 ARRAY_SIZE(minotaur_early_devices));
565}
566
Martin Strubel471b9a62008-01-27 19:54:20 +0800567void native_machine_restart(char *cmd)
568{
569 /* workaround reboot hang when booting from SPI */
570 if ((bfin_read_SYSCR() & 0x7) == 0x3)
Sonic Zhangb52dae32009-02-04 16:49:45 +0800571 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
Martin Strubel471b9a62008-01-27 19:54:20 +0800572}