blob: 29e38d5af4f9fcfe58a50842d99aef5614a4d34a [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 * 2005 National ICT Australia (NICTA)
4 * Aidan Williams <aidan@nicta.com.au>
Bryan Wu1394f032007-05-06 14:50:22 -07005 *
Robin Getz96f10502009-09-24 14:11:24 +00006 * Licensed under the GPL-2 or later.
Bryan Wu1394f032007-05-06 14:50:22 -07007 */
8
9#include <linux/device.h>
Mike Frysinger43f73fe2007-12-24 19:35:35 +080010#include <linux/etherdevice.h>
Bryan Wu1394f032007-05-06 14:50:22 -070011#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)
Mike Frysingerf02bcec2007-11-15 21:29:15 +080017#include <linux/usb/isp1362.h>
Bryan Wu1394f032007-05-06 14:50:22 -070018#endif
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080019#include <linux/irq.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080020#include <asm/dma.h>
Bryan Wu1394f032007-05-06 14:50:22 -070021#include <asm/bfin5xx_spi.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080022#include <asm/portmux.h>
David Brownell27f5d752007-10-04 18:06:16 -070023#include <linux/usb/sl811.h>
Bryan Wu1394f032007-05-06 14:50:22 -070024
25#include <linux/spi/ad7877.h>
26
27/*
28 * Name the Board for the /proc/cpuinfo
29 */
Mike Frysingerfe85cad2008-11-18 17:48:22 +080030const char bfin_board_name[] = "ADI PNAV-1.0";
Bryan Wu1394f032007-05-06 14:50:22 -070031
32/*
33 * Driver needs to know address, irq and flag pin.
34 */
35
36#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
37static struct resource bfin_pcmcia_cf_resources[] = {
38 {
39 .start = 0x20310000, /* IO PORT */
40 .end = 0x20312000,
41 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080042 }, {
Simon Arlottd2d50aa2007-06-11 15:31:30 +080043 .start = 0x20311000, /* Attribute Memory */
Bryan Wu1394f032007-05-06 14:50:22 -070044 .end = 0x20311FFF,
45 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080046 }, {
Bryan Wu1394f032007-05-06 14:50:22 -070047 .start = IRQ_PF4,
48 .end = IRQ_PF4,
49 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080050 }, {
Bryan Wu1394f032007-05-06 14:50:22 -070051 .start = 6, /* Card Detect PF6 */
52 .end = 6,
53 .flags = IORESOURCE_IRQ,
54 },
55};
56
57static struct platform_device bfin_pcmcia_cf_device = {
58 .name = "bfin_cf_pcmcia",
59 .id = -1,
60 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
61 .resource = bfin_pcmcia_cf_resources,
62};
63#endif
64
65#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
66static struct platform_device rtc_device = {
67 .name = "rtc-bfin",
68 .id = -1,
69};
70#endif
71
72#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Michael Hennerich61f09b52009-07-24 08:48:31 +000073#include <linux/smc91x.h>
74
75static struct smc91x_platdata smc91x_info = {
76 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
77 .leda = RPC_LED_100_10,
78 .ledb = RPC_LED_TX_RX,
79};
80
Bryan Wu1394f032007-05-06 14:50:22 -070081static struct resource smc91x_resources[] = {
82 {
83 .name = "smc91x-regs",
84 .start = 0x20300300,
85 .end = 0x20300300 + 16,
86 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080087 }, {
Bryan Wu1394f032007-05-06 14:50:22 -070088
89 .start = IRQ_PF7,
90 .end = IRQ_PF7,
91 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
92 },
93};
94static struct platform_device smc91x_device = {
95 .name = "smc91x",
96 .id = 0,
97 .num_resources = ARRAY_SIZE(smc91x_resources),
98 .resource = smc91x_resources,
Michael Hennerich61f09b52009-07-24 08:48:31 +000099 .dev = {
100 .platform_data = &smc91x_info,
101 },
Bryan Wu1394f032007-05-06 14:50:22 -0700102};
103#endif
104
105#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
106static struct resource sl811_hcd_resources[] = {
107 {
108 .start = 0x20340000,
109 .end = 0x20340000,
110 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800111 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700112 .start = 0x20340004,
113 .end = 0x20340004,
114 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800115 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700116 .start = CONFIG_USB_SL811_BFIN_IRQ,
117 .end = CONFIG_USB_SL811_BFIN_IRQ,
118 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
119 },
120};
121
122#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
123void sl811_port_power(struct device *dev, int is_on)
124{
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800125 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
Michael Hennerichacbcd262008-01-22 18:36:20 +0800126 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
Bryan Wu1394f032007-05-06 14:50:22 -0700127
Bryan Wu1394f032007-05-06 14:50:22 -0700128}
129#endif
130
131static struct sl811_platform_data sl811_priv = {
132 .potpg = 10,
133 .power = 250, /* == 500mA */
134#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
135 .port_power = &sl811_port_power,
136#endif
137};
138
139static struct platform_device sl811_hcd_device = {
140 .name = "sl811-hcd",
141 .id = 0,
142 .dev = {
143 .platform_data = &sl811_priv,
144 },
145 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
146 .resource = sl811_hcd_resources,
147};
148#endif
149
150#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
151static struct resource isp1362_hcd_resources[] = {
152 {
153 .start = 0x20360000,
154 .end = 0x20360000,
155 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800156 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700157 .start = 0x20360004,
158 .end = 0x20360004,
159 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800160 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700161 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
162 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
163 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
164 },
165};
166
167static struct isp1362_platform_data isp1362_priv = {
168 .sel15Kres = 1,
169 .clknotstop = 0,
170 .oc_enable = 0,
171 .int_act_high = 0,
172 .int_edge_triggered = 0,
173 .remote_wakeup_connected = 0,
174 .no_power_switching = 1,
175 .power_switching_mode = 0,
176};
177
178static struct platform_device isp1362_hcd_device = {
179 .name = "isp1362-hcd",
180 .id = 0,
181 .dev = {
182 .platform_data = &isp1362_priv,
183 },
184 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
185 .resource = isp1362_hcd_resources,
186};
187#endif
188
189#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800190static struct platform_device bfin_mii_bus = {
191 .name = "bfin_mii_bus",
192};
193
Bryan Wu1394f032007-05-06 14:50:22 -0700194static struct platform_device bfin_mac_device = {
195 .name = "bfin_mac",
Graf Yang65319622009-02-04 16:49:45 +0800196 .dev.platform_data = &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700197};
198#endif
199
200#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
201static struct resource net2272_bfin_resources[] = {
202 {
203 .start = 0x20300000,
204 .end = 0x20300000 + 0x100,
205 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800206 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700207 .start = IRQ_PF7,
208 .end = IRQ_PF7,
209 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
210 },
211};
212
213static struct platform_device net2272_bfin_device = {
214 .name = "net2272",
215 .id = -1,
216 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
217 .resource = net2272_bfin_resources,
218};
219#endif
220
221#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
222/* all SPI peripherals info goes here */
223
224#if defined(CONFIG_MTD_M25P80) \
225 || defined(CONFIG_MTD_M25P80_MODULE)
226static struct mtd_partition bfin_spi_flash_partitions[] = {
227 {
Robin Getzaa582972008-08-05 17:47:29 +0800228 .name = "bootloader(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -0700229 .size = 0x00020000,
230 .offset = 0,
231 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800232 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800233 .name = "linux kernel(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -0700234 .size = 0xe0000,
235 .offset = 0x20000
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800236 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800237 .name = "file system(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -0700238 .size = 0x700000,
239 .offset = 0x00100000,
240 }
241};
242
243static struct flash_platform_data bfin_spi_flash_data = {
244 .name = "m25p80",
245 .parts = bfin_spi_flash_partitions,
246 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
247 .type = "m25p64",
248};
249
250/* SPI flash chip (m25p64) */
251static struct bfin5xx_spi_chip spi_flash_chip_info = {
252 .enable_dma = 0, /* use dma transfer with this chip*/
253 .bits_per_word = 8,
254};
255#endif
256
Mike Frysingera261eec2009-05-20 14:05:36 +0000257#if defined(CONFIG_BFIN_SPI_ADC) \
258 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700259/* SPI ADC chip */
260static struct bfin5xx_spi_chip spi_adc_chip_info = {
261 .enable_dma = 1, /* use dma transfer with this chip*/
262 .bits_per_word = 16,
263};
264#endif
265
266#if defined(CONFIG_SND_BLACKFIN_AD1836) \
267 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
268static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
269 .enable_dma = 0,
270 .bits_per_word = 16,
271};
272#endif
273
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800274#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
275static struct bfin5xx_spi_chip mmc_spi_chip_info = {
276 .enable_dma = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700277 .bits_per_word = 8,
278};
279#endif
280
Bryan Wu1394f032007-05-06 14:50:22 -0700281#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
282static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
Michael Hennerichc7d48962007-11-15 21:33:31 +0800283 .cs_change_per_word = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700284 .enable_dma = 0,
285 .bits_per_word = 16,
286};
287
288static const struct ad7877_platform_data bfin_ad7877_ts_info = {
289 .model = 7877,
290 .vref_delay_usecs = 50, /* internal, no capacitor */
291 .x_plate_ohms = 419,
292 .y_plate_ohms = 486,
293 .pressure_max = 1000,
294 .pressure_min = 0,
295 .stopacq_polarity = 1,
296 .first_conversion_delay = 3,
297 .acquisition_time = 1,
298 .averaging = 1,
299 .pen_down_acc_interval = 1,
300};
301#endif
302
303static struct spi_board_info bfin_spi_board_info[] __initdata = {
304#if defined(CONFIG_MTD_M25P80) \
305 || defined(CONFIG_MTD_M25P80_MODULE)
306 {
307 /* the modalias must be the same as spi device driver name */
308 .modalias = "m25p80", /* Name of spi_driver for this device */
309 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800310 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700311 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
312 .platform_data = &bfin_spi_flash_data,
313 .controller_data = &spi_flash_chip_info,
314 .mode = SPI_MODE_3,
315 },
316#endif
317
Mike Frysingera261eec2009-05-20 14:05:36 +0000318#if defined(CONFIG_BFIN_SPI_ADC) \
319 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700320 {
321 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
322 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800323 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700324 .chip_select = 1, /* Framework chip select. */
325 .platform_data = NULL, /* No spi_driver specific config */
326 .controller_data = &spi_adc_chip_info,
327 },
328#endif
329
330#if defined(CONFIG_SND_BLACKFIN_AD1836) \
331 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
332 {
Barry Songdac98172009-08-13 21:07:37 +0000333 .modalias = "ad1836",
Bryan Wu1394f032007-05-06 14:50:22 -0700334 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800335 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700336 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
337 .controller_data = &ad1836_spi_chip_info,
338 },
339#endif
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800340#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700341 {
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800342 .modalias = "mmc_spi",
Bryan Wu1394f032007-05-06 14:50:22 -0700343 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800344 .bus_num = 0,
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800345 .chip_select = 5,
346 .controller_data = &mmc_spi_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700347 .mode = SPI_MODE_3,
348 },
349#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700350#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
351{
352 .modalias = "ad7877",
353 .platform_data = &bfin_ad7877_ts_info,
354 .irq = IRQ_PF2,
355 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Michael Hennerichc7d48962007-11-15 21:33:31 +0800356 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700357 .chip_select = 5,
358 .controller_data = &spi_ad7877_chip_info,
359},
360#endif
361
362};
363
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800364/* SPI (0) */
365static struct resource bfin_spi0_resource[] = {
366 [0] = {
367 .start = SPI0_REGBASE,
368 .end = SPI0_REGBASE + 0xFF,
369 .flags = IORESOURCE_MEM,
370 },
371 [1] = {
372 .start = CH_SPI,
373 .end = CH_SPI,
Yi Li53122692009-06-05 12:11:11 +0000374 .flags = IORESOURCE_DMA,
375 },
376 [2] = {
377 .start = IRQ_SPI,
378 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800379 .flags = IORESOURCE_IRQ,
Yi Li53122692009-06-05 12:11:11 +0000380 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800381};
382
Bryan Wu1394f032007-05-06 14:50:22 -0700383/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800384static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700385 .num_chipselect = 8,
386 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800387 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -0700388};
389
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800390static struct platform_device bfin_spi0_device = {
391 .name = "bfin-spi",
392 .id = 0, /* Bus number */
393 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
394 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -0700395 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800396 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -0700397 },
398};
399#endif /* spi master and devices */
400
401#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
402static struct platform_device bfin_fb_device = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800403 .name = "bf537-lq035",
Bryan Wu1394f032007-05-06 14:50:22 -0700404};
405#endif
406
407#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
408static struct resource bfin_uart_resources[] = {
409 {
410 .start = 0xFFC00400,
411 .end = 0xFFC004FF,
412 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800413 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700414 .start = 0xFFC02000,
415 .end = 0xFFC020FF,
416 .flags = IORESOURCE_MEM,
417 },
418};
419
420static struct platform_device bfin_uart_device = {
421 .name = "bfin-uart",
422 .id = 1,
423 .num_resources = ARRAY_SIZE(bfin_uart_resources),
424 .resource = bfin_uart_resources,
425};
426#endif
427
Graf Yang5be36d22008-04-25 03:09:15 +0800428#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +0800429#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800430static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800431 {
432 .start = 0xFFC00400,
433 .end = 0xFFC004FF,
434 .flags = IORESOURCE_MEM,
435 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800436 {
437 .start = IRQ_UART0_RX,
438 .end = IRQ_UART0_RX+1,
439 .flags = IORESOURCE_IRQ,
440 },
441 {
442 .start = CH_UART0_RX,
443 .end = CH_UART0_RX+1,
444 .flags = IORESOURCE_DMA,
445 },
446};
447
448static struct platform_device bfin_sir0_device = {
449 .name = "bfin_sir",
450 .id = 0,
451 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
452 .resource = bfin_sir0_resources,
453};
Graf Yang5be36d22008-04-25 03:09:15 +0800454#endif
455#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +0800456static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800457 {
458 .start = 0xFFC02000,
459 .end = 0xFFC020FF,
460 .flags = IORESOURCE_MEM,
461 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800462 {
463 .start = IRQ_UART1_RX,
464 .end = IRQ_UART1_RX+1,
465 .flags = IORESOURCE_IRQ,
466 },
467 {
468 .start = CH_UART1_RX,
469 .end = CH_UART1_RX+1,
470 .flags = IORESOURCE_DMA,
471 },
Graf Yang5be36d22008-04-25 03:09:15 +0800472};
473
Graf Yang42bd8bc2009-01-07 23:14:39 +0800474static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800475 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +0800476 .id = 1,
477 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
478 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800479};
480#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800481#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700482
483static struct platform_device *stamp_devices[] __initdata = {
484#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
485 &bfin_pcmcia_cf_device,
486#endif
487
488#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
489 &rtc_device,
490#endif
491
492#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
493 &sl811_hcd_device,
494#endif
495
496#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
497 &isp1362_hcd_device,
498#endif
499
500#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
501 &smc91x_device,
502#endif
503
504#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800505 &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700506 &bfin_mac_device,
507#endif
508
509#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
510 &net2272_bfin_device,
511#endif
512
513#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800514 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700515#endif
516
517#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
518 &bfin_fb_device,
519#endif
520
521#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
522 &bfin_uart_device,
523#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800524
525#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +0800526#ifdef CONFIG_BFIN_SIR0
527 &bfin_sir0_device,
528#endif
529#ifdef CONFIG_BFIN_SIR1
530 &bfin_sir1_device,
531#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800532#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700533};
534
Mike Frysinger7f6678c2009-02-04 16:49:45 +0800535static int __init pnav_init(void)
Bryan Wu1394f032007-05-06 14:50:22 -0700536{
Harvey Harrisonb85d8582008-04-23 09:39:01 +0800537 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu1394f032007-05-06 14:50:22 -0700538 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
539#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
540 spi_register_board_info(bfin_spi_board_info,
541 ARRAY_SIZE(bfin_spi_board_info));
542#endif
543 return 0;
544}
545
Mike Frysinger7f6678c2009-02-04 16:49:45 +0800546arch_initcall(pnav_init);
Mike Frysinger137b1522007-11-22 16:07:03 +0800547
Mike Frysinger9862cc52007-11-15 21:21:20 +0800548void bfin_get_ether_addr(char *addr)
Mike Frysinger137b1522007-11-22 16:07:03 +0800549{
550 random_ether_addr(addr);
551 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
552}
Mike Frysinger9862cc52007-11-15 21:21:20 +0800553EXPORT_SYMBOL(bfin_get_ether_addr);