blob: 3bbe10227bfbc1c76747a582b2d68d9ca3b17947 [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
2 * File: arch/blackfin/mach-bf537/boards/stamp.c
3 * Based on: arch/blackfin/mach-bf533/boards/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2005 National ICT Australia (NICTA)
Michael Hennericha628a8b2008-01-22 17:29:16 +080011 * Copyright 2004-2008 Analog Devices Inc.
Bryan Wu1394f032007-05-06 14:50:22 -070012 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30
31#include <linux/device.h>
Mike Frysinger43f73fe2007-12-24 19:35:35 +080032#include <linux/etherdevice.h>
Bryan Wu1394f032007-05-06 14:50:22 -070033#include <linux/platform_device.h>
34#include <linux/mtd/mtd.h>
35#include <linux/mtd/partitions.h>
36#include <linux/spi/spi.h>
37#include <linux/spi/flash.h>
38#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
Mike Frysingerf02bcec2007-11-15 21:29:15 +080039#include <linux/usb/isp1362.h>
Bryan Wu1394f032007-05-06 14:50:22 -070040#endif
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080041#include <linux/irq.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080042#include <asm/dma.h>
Bryan Wu1394f032007-05-06 14:50:22 -070043#include <asm/bfin5xx_spi.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080044#include <asm/portmux.h>
David Brownell27f5d752007-10-04 18:06:16 -070045#include <linux/usb/sl811.h>
Bryan Wu1394f032007-05-06 14:50:22 -070046
47#include <linux/spi/ad7877.h>
48
49/*
50 * Name the Board for the /proc/cpuinfo
51 */
Mike Frysingerfe85cad2008-11-18 17:48:22 +080052const char bfin_board_name[] = "ADI PNAV-1.0";
Bryan Wu1394f032007-05-06 14:50:22 -070053
54/*
55 * Driver needs to know address, irq and flag pin.
56 */
57
58#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
59static struct resource bfin_pcmcia_cf_resources[] = {
60 {
61 .start = 0x20310000, /* IO PORT */
62 .end = 0x20312000,
63 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080064 }, {
Simon Arlottd2d50aa2007-06-11 15:31:30 +080065 .start = 0x20311000, /* Attribute Memory */
Bryan Wu1394f032007-05-06 14:50:22 -070066 .end = 0x20311FFF,
67 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080068 }, {
Bryan Wu1394f032007-05-06 14:50:22 -070069 .start = IRQ_PF4,
70 .end = IRQ_PF4,
71 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080072 }, {
Bryan Wu1394f032007-05-06 14:50:22 -070073 .start = 6, /* Card Detect PF6 */
74 .end = 6,
75 .flags = IORESOURCE_IRQ,
76 },
77};
78
79static struct platform_device bfin_pcmcia_cf_device = {
80 .name = "bfin_cf_pcmcia",
81 .id = -1,
82 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
83 .resource = bfin_pcmcia_cf_resources,
84};
85#endif
86
87#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
88static struct platform_device rtc_device = {
89 .name = "rtc-bfin",
90 .id = -1,
91};
92#endif
93
94#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Michael Hennerich61f09b52009-07-24 08:48:31 +000095#include <linux/smc91x.h>
96
97static struct smc91x_platdata smc91x_info = {
98 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
99 .leda = RPC_LED_100_10,
100 .ledb = RPC_LED_TX_RX,
101};
102
Bryan Wu1394f032007-05-06 14:50:22 -0700103static struct resource smc91x_resources[] = {
104 {
105 .name = "smc91x-regs",
106 .start = 0x20300300,
107 .end = 0x20300300 + 16,
108 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800109 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700110
111 .start = IRQ_PF7,
112 .end = IRQ_PF7,
113 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
114 },
115};
116static struct platform_device smc91x_device = {
117 .name = "smc91x",
118 .id = 0,
119 .num_resources = ARRAY_SIZE(smc91x_resources),
120 .resource = smc91x_resources,
Michael Hennerich61f09b52009-07-24 08:48:31 +0000121 .dev = {
122 .platform_data = &smc91x_info,
123 },
Bryan Wu1394f032007-05-06 14:50:22 -0700124};
125#endif
126
127#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
128static struct resource sl811_hcd_resources[] = {
129 {
130 .start = 0x20340000,
131 .end = 0x20340000,
132 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800133 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700134 .start = 0x20340004,
135 .end = 0x20340004,
136 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800137 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700138 .start = CONFIG_USB_SL811_BFIN_IRQ,
139 .end = CONFIG_USB_SL811_BFIN_IRQ,
140 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
141 },
142};
143
144#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
145void sl811_port_power(struct device *dev, int is_on)
146{
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800147 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
Michael Hennerichacbcd262008-01-22 18:36:20 +0800148 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
Bryan Wu1394f032007-05-06 14:50:22 -0700149
Bryan Wu1394f032007-05-06 14:50:22 -0700150}
151#endif
152
153static struct sl811_platform_data sl811_priv = {
154 .potpg = 10,
155 .power = 250, /* == 500mA */
156#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
157 .port_power = &sl811_port_power,
158#endif
159};
160
161static struct platform_device sl811_hcd_device = {
162 .name = "sl811-hcd",
163 .id = 0,
164 .dev = {
165 .platform_data = &sl811_priv,
166 },
167 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
168 .resource = sl811_hcd_resources,
169};
170#endif
171
172#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
173static struct resource isp1362_hcd_resources[] = {
174 {
175 .start = 0x20360000,
176 .end = 0x20360000,
177 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800178 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700179 .start = 0x20360004,
180 .end = 0x20360004,
181 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800182 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700183 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
184 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
185 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
186 },
187};
188
189static struct isp1362_platform_data isp1362_priv = {
190 .sel15Kres = 1,
191 .clknotstop = 0,
192 .oc_enable = 0,
193 .int_act_high = 0,
194 .int_edge_triggered = 0,
195 .remote_wakeup_connected = 0,
196 .no_power_switching = 1,
197 .power_switching_mode = 0,
198};
199
200static struct platform_device isp1362_hcd_device = {
201 .name = "isp1362-hcd",
202 .id = 0,
203 .dev = {
204 .platform_data = &isp1362_priv,
205 },
206 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
207 .resource = isp1362_hcd_resources,
208};
209#endif
210
211#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800212static struct platform_device bfin_mii_bus = {
213 .name = "bfin_mii_bus",
214};
215
Bryan Wu1394f032007-05-06 14:50:22 -0700216static struct platform_device bfin_mac_device = {
217 .name = "bfin_mac",
Graf Yang65319622009-02-04 16:49:45 +0800218 .dev.platform_data = &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700219};
220#endif
221
222#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
223static struct resource net2272_bfin_resources[] = {
224 {
225 .start = 0x20300000,
226 .end = 0x20300000 + 0x100,
227 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800228 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700229 .start = IRQ_PF7,
230 .end = IRQ_PF7,
231 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
232 },
233};
234
235static struct platform_device net2272_bfin_device = {
236 .name = "net2272",
237 .id = -1,
238 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
239 .resource = net2272_bfin_resources,
240};
241#endif
242
243#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
244/* all SPI peripherals info goes here */
245
246#if defined(CONFIG_MTD_M25P80) \
247 || defined(CONFIG_MTD_M25P80_MODULE)
248static struct mtd_partition bfin_spi_flash_partitions[] = {
249 {
Robin Getzaa582972008-08-05 17:47:29 +0800250 .name = "bootloader(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -0700251 .size = 0x00020000,
252 .offset = 0,
253 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800254 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800255 .name = "linux kernel(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -0700256 .size = 0xe0000,
257 .offset = 0x20000
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800258 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800259 .name = "file system(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -0700260 .size = 0x700000,
261 .offset = 0x00100000,
262 }
263};
264
265static struct flash_platform_data bfin_spi_flash_data = {
266 .name = "m25p80",
267 .parts = bfin_spi_flash_partitions,
268 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
269 .type = "m25p64",
270};
271
272/* SPI flash chip (m25p64) */
273static struct bfin5xx_spi_chip spi_flash_chip_info = {
274 .enable_dma = 0, /* use dma transfer with this chip*/
275 .bits_per_word = 8,
276};
277#endif
278
Mike Frysingera261eec2009-05-20 14:05:36 +0000279#if defined(CONFIG_BFIN_SPI_ADC) \
280 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700281/* SPI ADC chip */
282static struct bfin5xx_spi_chip spi_adc_chip_info = {
283 .enable_dma = 1, /* use dma transfer with this chip*/
284 .bits_per_word = 16,
285};
286#endif
287
288#if defined(CONFIG_SND_BLACKFIN_AD1836) \
289 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
290static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
291 .enable_dma = 0,
292 .bits_per_word = 16,
293};
294#endif
295
296#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
297static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
298 .enable_dma = 0,
299 .bits_per_word = 16,
300};
301#endif
302
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800303#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
304static struct bfin5xx_spi_chip mmc_spi_chip_info = {
305 .enable_dma = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700306 .bits_per_word = 8,
307};
308#endif
309
Bryan Wu1394f032007-05-06 14:50:22 -0700310#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
311static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
Michael Hennerichc7d48962007-11-15 21:33:31 +0800312 .cs_change_per_word = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700313 .enable_dma = 0,
314 .bits_per_word = 16,
315};
316
317static const struct ad7877_platform_data bfin_ad7877_ts_info = {
318 .model = 7877,
319 .vref_delay_usecs = 50, /* internal, no capacitor */
320 .x_plate_ohms = 419,
321 .y_plate_ohms = 486,
322 .pressure_max = 1000,
323 .pressure_min = 0,
324 .stopacq_polarity = 1,
325 .first_conversion_delay = 3,
326 .acquisition_time = 1,
327 .averaging = 1,
328 .pen_down_acc_interval = 1,
329};
330#endif
331
332static struct spi_board_info bfin_spi_board_info[] __initdata = {
333#if defined(CONFIG_MTD_M25P80) \
334 || defined(CONFIG_MTD_M25P80_MODULE)
335 {
336 /* the modalias must be the same as spi device driver name */
337 .modalias = "m25p80", /* Name of spi_driver for this device */
338 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800339 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700340 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
341 .platform_data = &bfin_spi_flash_data,
342 .controller_data = &spi_flash_chip_info,
343 .mode = SPI_MODE_3,
344 },
345#endif
346
Mike Frysingera261eec2009-05-20 14:05:36 +0000347#if defined(CONFIG_BFIN_SPI_ADC) \
348 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700349 {
350 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
351 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800352 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700353 .chip_select = 1, /* Framework chip select. */
354 .platform_data = NULL, /* No spi_driver specific config */
355 .controller_data = &spi_adc_chip_info,
356 },
357#endif
358
359#if defined(CONFIG_SND_BLACKFIN_AD1836) \
360 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
361 {
362 .modalias = "ad1836-spi",
363 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800364 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700365 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
366 .controller_data = &ad1836_spi_chip_info,
367 },
368#endif
369#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
370 {
371 .modalias = "ad9960-spi",
372 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800373 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700374 .chip_select = 1,
375 .controller_data = &ad9960_spi_chip_info,
376 },
377#endif
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800378#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700379 {
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800380 .modalias = "mmc_spi",
Bryan Wu1394f032007-05-06 14:50:22 -0700381 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800382 .bus_num = 0,
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800383 .chip_select = 5,
384 .controller_data = &mmc_spi_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700385 .mode = SPI_MODE_3,
386 },
387#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700388#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
389{
390 .modalias = "ad7877",
391 .platform_data = &bfin_ad7877_ts_info,
392 .irq = IRQ_PF2,
393 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Michael Hennerichc7d48962007-11-15 21:33:31 +0800394 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700395 .chip_select = 5,
396 .controller_data = &spi_ad7877_chip_info,
397},
398#endif
399
400};
401
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800402/* SPI (0) */
403static struct resource bfin_spi0_resource[] = {
404 [0] = {
405 .start = SPI0_REGBASE,
406 .end = SPI0_REGBASE + 0xFF,
407 .flags = IORESOURCE_MEM,
408 },
409 [1] = {
410 .start = CH_SPI,
411 .end = CH_SPI,
Yi Li53122692009-06-05 12:11:11 +0000412 .flags = IORESOURCE_DMA,
413 },
414 [2] = {
415 .start = IRQ_SPI,
416 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800417 .flags = IORESOURCE_IRQ,
Yi Li53122692009-06-05 12:11:11 +0000418 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800419};
420
Bryan Wu1394f032007-05-06 14:50:22 -0700421/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800422static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700423 .num_chipselect = 8,
424 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800425 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -0700426};
427
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800428static struct platform_device bfin_spi0_device = {
429 .name = "bfin-spi",
430 .id = 0, /* Bus number */
431 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
432 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -0700433 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800434 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -0700435 },
436};
437#endif /* spi master and devices */
438
439#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
440static struct platform_device bfin_fb_device = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800441 .name = "bf537-lq035",
Bryan Wu1394f032007-05-06 14:50:22 -0700442};
443#endif
444
445#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
446static struct resource bfin_uart_resources[] = {
447 {
448 .start = 0xFFC00400,
449 .end = 0xFFC004FF,
450 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800451 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700452 .start = 0xFFC02000,
453 .end = 0xFFC020FF,
454 .flags = IORESOURCE_MEM,
455 },
456};
457
458static struct platform_device bfin_uart_device = {
459 .name = "bfin-uart",
460 .id = 1,
461 .num_resources = ARRAY_SIZE(bfin_uart_resources),
462 .resource = bfin_uart_resources,
463};
464#endif
465
Graf Yang5be36d22008-04-25 03:09:15 +0800466#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +0800467#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800468static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800469 {
470 .start = 0xFFC00400,
471 .end = 0xFFC004FF,
472 .flags = IORESOURCE_MEM,
473 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800474 {
475 .start = IRQ_UART0_RX,
476 .end = IRQ_UART0_RX+1,
477 .flags = IORESOURCE_IRQ,
478 },
479 {
480 .start = CH_UART0_RX,
481 .end = CH_UART0_RX+1,
482 .flags = IORESOURCE_DMA,
483 },
484};
485
486static struct platform_device bfin_sir0_device = {
487 .name = "bfin_sir",
488 .id = 0,
489 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
490 .resource = bfin_sir0_resources,
491};
Graf Yang5be36d22008-04-25 03:09:15 +0800492#endif
493#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +0800494static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800495 {
496 .start = 0xFFC02000,
497 .end = 0xFFC020FF,
498 .flags = IORESOURCE_MEM,
499 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800500 {
501 .start = IRQ_UART1_RX,
502 .end = IRQ_UART1_RX+1,
503 .flags = IORESOURCE_IRQ,
504 },
505 {
506 .start = CH_UART1_RX,
507 .end = CH_UART1_RX+1,
508 .flags = IORESOURCE_DMA,
509 },
Graf Yang5be36d22008-04-25 03:09:15 +0800510};
511
Graf Yang42bd8bc2009-01-07 23:14:39 +0800512static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800513 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +0800514 .id = 1,
515 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
516 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800517};
518#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800519#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700520
521static struct platform_device *stamp_devices[] __initdata = {
522#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
523 &bfin_pcmcia_cf_device,
524#endif
525
526#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
527 &rtc_device,
528#endif
529
530#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
531 &sl811_hcd_device,
532#endif
533
534#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
535 &isp1362_hcd_device,
536#endif
537
538#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
539 &smc91x_device,
540#endif
541
542#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800543 &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700544 &bfin_mac_device,
545#endif
546
547#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
548 &net2272_bfin_device,
549#endif
550
551#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800552 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700553#endif
554
555#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
556 &bfin_fb_device,
557#endif
558
559#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
560 &bfin_uart_device,
561#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800562
563#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +0800564#ifdef CONFIG_BFIN_SIR0
565 &bfin_sir0_device,
566#endif
567#ifdef CONFIG_BFIN_SIR1
568 &bfin_sir1_device,
569#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800570#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700571};
572
Mike Frysinger7f6678c2009-02-04 16:49:45 +0800573static int __init pnav_init(void)
Bryan Wu1394f032007-05-06 14:50:22 -0700574{
Harvey Harrisonb85d8582008-04-23 09:39:01 +0800575 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu1394f032007-05-06 14:50:22 -0700576 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
577#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
578 spi_register_board_info(bfin_spi_board_info,
579 ARRAY_SIZE(bfin_spi_board_info));
580#endif
581 return 0;
582}
583
Mike Frysinger7f6678c2009-02-04 16:49:45 +0800584arch_initcall(pnav_init);
Mike Frysinger137b1522007-11-22 16:07:03 +0800585
Mike Frysinger9862cc52007-11-15 21:21:20 +0800586void bfin_get_ether_addr(char *addr)
Mike Frysinger137b1522007-11-22 16:07:03 +0800587{
588 random_ether_addr(addr);
589 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
590}
Mike Frysinger9862cc52007-11-15 21:21:20 +0800591EXPORT_SYMBOL(bfin_get_ether_addr);