blob: 9ba290466b5695775ec00ac26bfb69029b778dc1 [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 = {
Bryan Wu1394f032007-05-06 14:50:22 -0700283 .enable_dma = 0,
284 .bits_per_word = 16,
285};
286
287static const struct ad7877_platform_data bfin_ad7877_ts_info = {
288 .model = 7877,
289 .vref_delay_usecs = 50, /* internal, no capacitor */
290 .x_plate_ohms = 419,
291 .y_plate_ohms = 486,
292 .pressure_max = 1000,
293 .pressure_min = 0,
294 .stopacq_polarity = 1,
295 .first_conversion_delay = 3,
296 .acquisition_time = 1,
297 .averaging = 1,
298 .pen_down_acc_interval = 1,
299};
300#endif
301
302static struct spi_board_info bfin_spi_board_info[] __initdata = {
303#if defined(CONFIG_MTD_M25P80) \
304 || defined(CONFIG_MTD_M25P80_MODULE)
305 {
306 /* the modalias must be the same as spi device driver name */
307 .modalias = "m25p80", /* Name of spi_driver for this device */
308 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800309 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700310 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
311 .platform_data = &bfin_spi_flash_data,
312 .controller_data = &spi_flash_chip_info,
313 .mode = SPI_MODE_3,
314 },
315#endif
316
Mike Frysingera261eec2009-05-20 14:05:36 +0000317#if defined(CONFIG_BFIN_SPI_ADC) \
318 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700319 {
320 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
321 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800322 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700323 .chip_select = 1, /* Framework chip select. */
324 .platform_data = NULL, /* No spi_driver specific config */
325 .controller_data = &spi_adc_chip_info,
326 },
327#endif
328
329#if defined(CONFIG_SND_BLACKFIN_AD1836) \
330 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
331 {
Barry Songdac98172009-08-13 21:07:37 +0000332 .modalias = "ad1836",
Bryan Wu1394f032007-05-06 14:50:22 -0700333 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800334 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700335 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
336 .controller_data = &ad1836_spi_chip_info,
337 },
338#endif
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800339#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700340 {
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800341 .modalias = "mmc_spi",
Bryan Wu1394f032007-05-06 14:50:22 -0700342 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800343 .bus_num = 0,
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800344 .chip_select = 5,
345 .controller_data = &mmc_spi_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700346 .mode = SPI_MODE_3,
347 },
348#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700349#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
350{
351 .modalias = "ad7877",
352 .platform_data = &bfin_ad7877_ts_info,
353 .irq = IRQ_PF2,
354 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Michael Hennerichc7d48962007-11-15 21:33:31 +0800355 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700356 .chip_select = 5,
357 .controller_data = &spi_ad7877_chip_info,
358},
359#endif
360
361};
362
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800363/* SPI (0) */
364static struct resource bfin_spi0_resource[] = {
365 [0] = {
366 .start = SPI0_REGBASE,
367 .end = SPI0_REGBASE + 0xFF,
368 .flags = IORESOURCE_MEM,
369 },
370 [1] = {
371 .start = CH_SPI,
372 .end = CH_SPI,
Yi Li53122692009-06-05 12:11:11 +0000373 .flags = IORESOURCE_DMA,
374 },
375 [2] = {
376 .start = IRQ_SPI,
377 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800378 .flags = IORESOURCE_IRQ,
Yi Li53122692009-06-05 12:11:11 +0000379 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800380};
381
Bryan Wu1394f032007-05-06 14:50:22 -0700382/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800383static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700384 .num_chipselect = 8,
385 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800386 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -0700387};
388
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800389static struct platform_device bfin_spi0_device = {
390 .name = "bfin-spi",
391 .id = 0, /* Bus number */
392 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
393 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -0700394 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800395 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -0700396 },
397};
398#endif /* spi master and devices */
399
400#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
401static struct platform_device bfin_fb_device = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800402 .name = "bf537-lq035",
Bryan Wu1394f032007-05-06 14:50:22 -0700403};
404#endif
405
406#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
407static struct resource bfin_uart_resources[] = {
408 {
409 .start = 0xFFC00400,
410 .end = 0xFFC004FF,
411 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800412 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700413 .start = 0xFFC02000,
414 .end = 0xFFC020FF,
415 .flags = IORESOURCE_MEM,
416 },
417};
418
419static struct platform_device bfin_uart_device = {
420 .name = "bfin-uart",
421 .id = 1,
422 .num_resources = ARRAY_SIZE(bfin_uart_resources),
423 .resource = bfin_uart_resources,
424};
425#endif
426
Graf Yang5be36d22008-04-25 03:09:15 +0800427#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +0800428#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800429static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800430 {
431 .start = 0xFFC00400,
432 .end = 0xFFC004FF,
433 .flags = IORESOURCE_MEM,
434 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800435 {
436 .start = IRQ_UART0_RX,
437 .end = IRQ_UART0_RX+1,
438 .flags = IORESOURCE_IRQ,
439 },
440 {
441 .start = CH_UART0_RX,
442 .end = CH_UART0_RX+1,
443 .flags = IORESOURCE_DMA,
444 },
445};
446
447static struct platform_device bfin_sir0_device = {
448 .name = "bfin_sir",
449 .id = 0,
450 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
451 .resource = bfin_sir0_resources,
452};
Graf Yang5be36d22008-04-25 03:09:15 +0800453#endif
454#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +0800455static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800456 {
457 .start = 0xFFC02000,
458 .end = 0xFFC020FF,
459 .flags = IORESOURCE_MEM,
460 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800461 {
462 .start = IRQ_UART1_RX,
463 .end = IRQ_UART1_RX+1,
464 .flags = IORESOURCE_IRQ,
465 },
466 {
467 .start = CH_UART1_RX,
468 .end = CH_UART1_RX+1,
469 .flags = IORESOURCE_DMA,
470 },
Graf Yang5be36d22008-04-25 03:09:15 +0800471};
472
Graf Yang42bd8bc2009-01-07 23:14:39 +0800473static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800474 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +0800475 .id = 1,
476 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
477 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800478};
479#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800480#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700481
482static struct platform_device *stamp_devices[] __initdata = {
483#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
484 &bfin_pcmcia_cf_device,
485#endif
486
487#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
488 &rtc_device,
489#endif
490
491#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
492 &sl811_hcd_device,
493#endif
494
495#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
496 &isp1362_hcd_device,
497#endif
498
499#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
500 &smc91x_device,
501#endif
502
503#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800504 &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700505 &bfin_mac_device,
506#endif
507
508#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
509 &net2272_bfin_device,
510#endif
511
512#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800513 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700514#endif
515
516#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
517 &bfin_fb_device,
518#endif
519
520#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
521 &bfin_uart_device,
522#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800523
524#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +0800525#ifdef CONFIG_BFIN_SIR0
526 &bfin_sir0_device,
527#endif
528#ifdef CONFIG_BFIN_SIR1
529 &bfin_sir1_device,
530#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800531#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700532};
533
Mike Frysinger7f6678c2009-02-04 16:49:45 +0800534static int __init pnav_init(void)
Bryan Wu1394f032007-05-06 14:50:22 -0700535{
Harvey Harrisonb85d8582008-04-23 09:39:01 +0800536 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu1394f032007-05-06 14:50:22 -0700537 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
538#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
539 spi_register_board_info(bfin_spi_board_info,
540 ARRAY_SIZE(bfin_spi_board_info));
541#endif
542 return 0;
543}
544
Mike Frysinger7f6678c2009-02-04 16:49:45 +0800545arch_initcall(pnav_init);
Mike Frysinger137b1522007-11-22 16:07:03 +0800546
Mike Frysinger9862cc52007-11-15 21:21:20 +0800547void bfin_get_ether_addr(char *addr)
Mike Frysinger137b1522007-11-22 16:07:03 +0800548{
549 random_ether_addr(addr);
550 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
551}
Mike Frysinger9862cc52007-11-15 21:21:20 +0800552EXPORT_SYMBOL(bfin_get_ether_addr);