blob: 3a727d3676e17e7bf6bb66cc42bb43a6689c93b9 [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
2 * File: arch/blackfin/mach-bf533/stamp.c
3 * Based on: arch/blackfin/mach-bf533/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
5 *
6 * Created: 2005
7 * Description: Board Info File for the BF533-STAMP
8 *
9 * Modified:
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2006 Analog Devices Inc.
12 *
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>
32#include <linux/platform_device.h>
33#include <linux/mtd/mtd.h>
34#include <linux/mtd/partitions.h>
Mike Frysingerde8c43f2008-01-24 17:14:04 +080035#include <linux/mtd/physmap.h>
Bryan Wu1394f032007-05-06 14:50:22 -070036#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
Jeff Garzik0a87e3e2008-02-01 18:02:30 -050041#include <linux/ata_platform.h>
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080042#include <linux/irq.h>
Bryan Wu81d9c7f2008-03-26 10:02:13 +080043#include <linux/i2c.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080044#include <asm/dma.h>
Bryan Wu1394f032007-05-06 14:50:22 -070045#include <asm/bfin5xx_spi.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080046#include <asm/reboot.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080047#include <asm/portmux.h>
Bryan Wu1394f032007-05-06 14:50:22 -070048
49/*
50 * Name the Board for the /proc/cpuinfo
51 */
Mike Frysinger066954a2007-10-21 22:36:06 +080052const char bfin_board_name[] = "ADDS-BF533-STAMP";
Bryan Wu1394f032007-05-06 14:50:22 -070053
54#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
55static struct platform_device rtc_device = {
56 .name = "rtc-bfin",
57 .id = -1,
58};
59#endif
60
61/*
62 * Driver needs to know address, irq and flag pin.
63 */
64#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
65static struct resource smc91x_resources[] = {
66 {
67 .name = "smc91x-regs",
68 .start = 0x20300300,
69 .end = 0x20300300 + 16,
70 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080071 }, {
Bryan Wu1394f032007-05-06 14:50:22 -070072 .start = IRQ_PF7,
73 .end = IRQ_PF7,
74 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
75 },
76};
77
78static struct platform_device smc91x_device = {
79 .name = "smc91x",
80 .id = 0,
81 .num_resources = ARRAY_SIZE(smc91x_resources),
82 .resource = smc91x_resources,
83};
84#endif
85
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080086#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
87static struct platform_device bfin_fb_adv7393_device = {
88 .name = "bfin-adv7393",
89};
90#endif
91
Bryan Wu1394f032007-05-06 14:50:22 -070092#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
93static struct resource net2272_bfin_resources[] = {
94 {
95 .start = 0x20300000,
96 .end = 0x20300000 + 0x100,
97 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080098 }, {
Bryan Wu1394f032007-05-06 14:50:22 -070099 .start = IRQ_PF10,
100 .end = IRQ_PF10,
101 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
102 },
103};
104
105static struct platform_device net2272_bfin_device = {
106 .name = "net2272",
107 .id = -1,
108 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
109 .resource = net2272_bfin_resources,
110};
111#endif
112
Mike Frysinger793dc272008-03-26 08:09:12 +0800113#if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800114static struct mtd_partition stamp_partitions[] = {
115 {
116 .name = "Bootloader",
Mike Frysingeredf05642008-02-25 11:38:11 +0800117 .size = 0x40000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800118 .offset = 0,
119 }, {
120 .name = "Kernel",
121 .size = 0xE0000,
122 .offset = MTDPART_OFS_APPEND,
123 }, {
124 .name = "RootFS",
125 .size = MTDPART_SIZ_FULL,
126 .offset = MTDPART_OFS_APPEND,
127 }
128};
129
130static struct physmap_flash_data stamp_flash_data = {
131 .width = 2,
132 .parts = stamp_partitions,
133 .nr_parts = ARRAY_SIZE(stamp_partitions),
134};
135
136static struct resource stamp_flash_resource[] = {
137 {
138 .name = "cfi_probe",
139 .start = 0x20000000,
140 .end = 0x203fffff,
141 .flags = IORESOURCE_MEM,
142 }, {
143 .start = CONFIG_ENET_FLASH_PIN,
144 .flags = IORESOURCE_IRQ,
145 }
146};
147
148static struct platform_device stamp_flash_device = {
149 .name = "BF5xx-Flash",
150 .id = 0,
151 .dev = {
152 .platform_data = &stamp_flash_data,
153 },
154 .num_resources = ARRAY_SIZE(stamp_flash_resource),
155 .resource = stamp_flash_resource,
156};
Mike Frysinger793dc272008-03-26 08:09:12 +0800157#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800158
Bryan Wu1394f032007-05-06 14:50:22 -0700159#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
160/* all SPI peripherals info goes here */
161
162#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
163static struct mtd_partition bfin_spi_flash_partitions[] = {
164 {
165 .name = "bootloader",
Mike Frysingeredf05642008-02-25 11:38:11 +0800166 .size = 0x00040000,
Bryan Wu1394f032007-05-06 14:50:22 -0700167 .offset = 0,
168 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800169 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700170 .name = "kernel",
171 .size = 0xe0000,
Mike Frysingeredf05642008-02-25 11:38:11 +0800172 .offset = MTDPART_OFS_APPEND,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800173 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700174 .name = "file system",
Mike Frysingeredf05642008-02-25 11:38:11 +0800175 .size = MTDPART_SIZ_FULL,
176 .offset = MTDPART_OFS_APPEND,
Bryan Wu1394f032007-05-06 14:50:22 -0700177 }
178};
179
180static struct flash_platform_data bfin_spi_flash_data = {
181 .name = "m25p80",
182 .parts = bfin_spi_flash_partitions,
183 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
184 .type = "m25p64",
185};
186
187/* SPI flash chip (m25p64) */
188static struct bfin5xx_spi_chip spi_flash_chip_info = {
189 .enable_dma = 0, /* use dma transfer with this chip*/
190 .bits_per_word = 8,
191};
192#endif
193
194#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
195/* SPI ADC chip */
196static struct bfin5xx_spi_chip spi_adc_chip_info = {
197 .enable_dma = 1, /* use dma transfer with this chip*/
198 .bits_per_word = 16,
199};
200#endif
201
202#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
203static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
204 .enable_dma = 0,
205 .bits_per_word = 16,
206};
207#endif
208
209#if defined(CONFIG_PBX)
210static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
211 .ctl_reg = 0x4, /* send zero */
212 .enable_dma = 0,
213 .bits_per_word = 8,
214 .cs_change_per_word = 1,
215};
216#endif
217
Bryan Wued2fbf52007-05-21 18:09:10 +0800218#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
219static struct bfin5xx_spi_chip spi_mmc_chip_info = {
220 .enable_dma = 1,
221 .bits_per_word = 8,
222};
223#endif
224
Michael Hennerich6e668932008-02-09 01:54:09 +0800225#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
226static struct bfin5xx_spi_chip spidev_chip_info = {
227 .enable_dma = 0,
228 .bits_per_word = 8,
229};
230#endif
231
Bryan Wu1394f032007-05-06 14:50:22 -0700232static struct spi_board_info bfin_spi_board_info[] __initdata = {
233#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
234 {
235 /* the modalias must be the same as spi device driver name */
236 .modalias = "m25p80", /* Name of spi_driver for this device */
237 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800238 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700239 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
240 .platform_data = &bfin_spi_flash_data,
241 .controller_data = &spi_flash_chip_info,
242 .mode = SPI_MODE_3,
243 },
244#endif
245
246#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
247 {
248 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
249 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800250 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700251 .chip_select = 1, /* Framework chip select. */
252 .platform_data = NULL, /* No spi_driver specific config */
253 .controller_data = &spi_adc_chip_info,
254 },
255#endif
256
257#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
258 {
259 .modalias = "ad1836-spi",
260 .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800261 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700262 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
263 .controller_data = &ad1836_spi_chip_info,
264 },
265#endif
266
Bryan Wued2fbf52007-05-21 18:09:10 +0800267#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
268 {
269 .modalias = "spi_mmc_dummy",
Sonic Zhang111cf972007-10-30 11:48:42 +0800270 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800271 .bus_num = 0,
Bryan Wued2fbf52007-05-21 18:09:10 +0800272 .chip_select = 0,
273 .platform_data = NULL,
274 .controller_data = &spi_mmc_chip_info,
275 .mode = SPI_MODE_3,
276 },
277 {
278 .modalias = "spi_mmc",
Sonic Zhang111cf972007-10-30 11:48:42 +0800279 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800280 .bus_num = 0,
Bryan Wued2fbf52007-05-21 18:09:10 +0800281 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
282 .platform_data = NULL,
283 .controller_data = &spi_mmc_chip_info,
284 .mode = SPI_MODE_3,
285 },
286#endif
287
Bryan Wu1394f032007-05-06 14:50:22 -0700288#if defined(CONFIG_PBX)
289 {
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800290 .modalias = "fxs-spi",
291 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800292 .bus_num = 0,
293 .chip_select = 8 - CONFIG_J11_JUMPER,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800294 .controller_data = &spi_si3xxx_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700295 .mode = SPI_MODE_3,
296 },
297 {
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800298 .modalias = "fxo-spi",
299 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800300 .bus_num = 0,
301 .chip_select = 8 - CONFIG_J19_JUMPER,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800302 .controller_data = &spi_si3xxx_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700303 .mode = SPI_MODE_3,
304 },
305#endif
306
Michael Hennerich6e668932008-02-09 01:54:09 +0800307#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
308 {
309 .modalias = "spidev",
310 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
311 .bus_num = 0,
312 .chip_select = 1,
313 .controller_data = &spidev_chip_info,
314 },
315#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700316};
317
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800318/* SPI (0) */
319static struct resource bfin_spi0_resource[] = {
320 [0] = {
321 .start = SPI0_REGBASE,
322 .end = SPI0_REGBASE + 0xFF,
323 .flags = IORESOURCE_MEM,
324 },
325 [1] = {
326 .start = CH_SPI,
327 .end = CH_SPI,
328 .flags = IORESOURCE_IRQ,
329 }
330};
331
Bryan Wu1394f032007-05-06 14:50:22 -0700332/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800333static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700334 .num_chipselect = 8,
335 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800336 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -0700337};
338
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800339static struct platform_device bfin_spi0_device = {
340 .name = "bfin-spi",
341 .id = 0, /* Bus number */
342 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
343 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -0700344 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800345 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -0700346 },
347};
348#endif /* spi master and devices */
349
350#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
351static struct platform_device bfin_fb_device = {
352 .name = "bf537-fb",
353};
354#endif
355
356#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
357static struct resource bfin_uart_resources[] = {
358 {
359 .start = 0xFFC00400,
360 .end = 0xFFC004FF,
361 .flags = IORESOURCE_MEM,
362 },
363};
364
365static struct platform_device bfin_uart_device = {
366 .name = "bfin-uart",
367 .id = 1,
368 .num_resources = ARRAY_SIZE(bfin_uart_resources),
369 .resource = bfin_uart_resources,
370};
371#endif
372
373#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
374static struct platform_device bfin_sport0_uart_device = {
375 .name = "bfin-sport-uart",
376 .id = 0,
377};
378
379static struct platform_device bfin_sport1_uart_device = {
380 .name = "bfin-sport-uart",
381 .id = 1,
382};
383#endif
384
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800385#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
386#define PATA_INT 55
387
388static struct pata_platform_info bfin_pata_platform_data = {
389 .ioport_shift = 1,
390 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
391};
392
393static struct resource bfin_pata_resources[] = {
394 {
395 .start = 0x20314020,
396 .end = 0x2031403F,
397 .flags = IORESOURCE_MEM,
398 },
399 {
400 .start = 0x2031401C,
401 .end = 0x2031401F,
402 .flags = IORESOURCE_MEM,
403 },
404 {
405 .start = PATA_INT,
406 .end = PATA_INT,
407 .flags = IORESOURCE_IRQ,
408 },
409};
410
411static struct platform_device bfin_pata_device = {
412 .name = "pata_platform",
413 .id = -1,
414 .num_resources = ARRAY_SIZE(bfin_pata_resources),
415 .resource = bfin_pata_resources,
416 .dev = {
417 .platform_data = &bfin_pata_platform_data,
418 }
419};
420#endif
421
Michael Hennerich2463ef22008-01-27 16:49:48 +0800422#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
423#include <linux/input.h>
424#include <linux/gpio_keys.h>
425
426static struct gpio_keys_button bfin_gpio_keys_table[] = {
Michael Hennerichf1bceb42008-02-02 16:17:52 +0800427 {BTN_0, GPIO_PF5, 0, "gpio-keys: BTN0"},
428 {BTN_1, GPIO_PF6, 0, "gpio-keys: BTN1"},
429 {BTN_2, GPIO_PF8, 0, "gpio-keys: BTN2"},
Michael Hennerich2463ef22008-01-27 16:49:48 +0800430};
431
432static struct gpio_keys_platform_data bfin_gpio_keys_data = {
433 .buttons = bfin_gpio_keys_table,
434 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
435};
436
437static struct platform_device bfin_device_gpiokeys = {
438 .name = "gpio-keys",
439 .dev = {
440 .platform_data = &bfin_gpio_keys_data,
441 },
442};
443#endif
444
Mike Frysingercad2ab62008-02-22 17:01:31 +0800445static struct resource bfin_gpios_resources = {
446 .start = 0,
447 .end = MAX_BLACKFIN_GPIOS - 1,
448 .flags = IORESOURCE_IRQ,
449};
450
451static struct platform_device bfin_gpios_device = {
452 .name = "simple-gpio",
453 .id = -1,
454 .num_resources = 1,
455 .resource = &bfin_gpios_resources,
456};
457
Bryan Wue3163952008-01-24 16:19:15 +0800458#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
459#include <linux/i2c-gpio.h>
460
461static struct i2c_gpio_platform_data i2c_gpio_data = {
462 .sda_pin = 2,
463 .scl_pin = 3,
464 .sda_is_open_drain = 0,
465 .scl_is_open_drain = 0,
466 .udelay = 40,
467};
468
469static struct platform_device i2c_gpio_device = {
470 .name = "i2c-gpio",
471 .id = 0,
472 .dev = {
473 .platform_data = &i2c_gpio_data,
474 },
475};
476#endif
477
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800478#ifdef CONFIG_I2C_BOARDINFO
479static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
480#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
481 {
482 I2C_BOARD_INFO("ad7142_joystick", 0x2C),
483 .type = "ad7142_joystick",
484 .irq = 39,
485 },
486#endif
487#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
488 {
489 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
490 .type = "pcf8574_lcd",
491 },
492#endif
493#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
494 {
495 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
496 .type = "pcf8574_keypad",
497 .irq = 39,
498 },
499#endif
500};
501#endif
502
Bryan Wu1394f032007-05-06 14:50:22 -0700503static struct platform_device *stamp_devices[] __initdata = {
504#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
505 &rtc_device,
506#endif
507
508#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
509 &smc91x_device,
510#endif
511
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800512#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
513 &bfin_fb_adv7393_device,
514#endif
515
Bryan Wu1394f032007-05-06 14:50:22 -0700516#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
517 &net2272_bfin_device,
518#endif
519
520#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800521 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700522#endif
523
524#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
525 &bfin_uart_device,
526#endif
527
528#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
529 &bfin_sport0_uart_device,
530 &bfin_sport1_uart_device,
531#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800532
533#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
534 &bfin_pata_device,
535#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +0800536
537#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
538 &bfin_device_gpiokeys,
539#endif
Bryan Wue3163952008-01-24 16:19:15 +0800540
541#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
542 &i2c_gpio_device,
543#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +0800544
545 &bfin_gpios_device,
Mike Frysinger793dc272008-03-26 08:09:12 +0800546
547#if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800548 &stamp_flash_device,
Mike Frysinger793dc272008-03-26 08:09:12 +0800549#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700550};
551
552static int __init stamp_init(void)
553{
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800554 int ret;
555
Harvey Harrisonb85d8582008-04-23 09:39:01 +0800556 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800557
558#ifdef CONFIG_I2C_BOARDINFO
559 i2c_register_board_info(0, bfin_i2c_board_info,
560 ARRAY_SIZE(bfin_i2c_board_info));
561#endif
562
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800563 ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
564 if (ret < 0)
565 return ret;
566
567#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800568 /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */
569 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (1 << CONFIG_ENET_FLASH_PIN));
570 bfin_write_FIO_FLAG_S(1 << CONFIG_ENET_FLASH_PIN);
571 SSYNC();
Bryan Wu1394f032007-05-06 14:50:22 -0700572#endif
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800573
574#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800575 spi_register_board_info(bfin_spi_board_info,
576 ARRAY_SIZE(bfin_spi_board_info));
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800577#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800578#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
579 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
580#endif
581 return 0;
Bryan Wu1394f032007-05-06 14:50:22 -0700582}
583
584arch_initcall(stamp_init);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800585
586void native_machine_restart(char *cmd)
587{
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800588#define BIT_TO_SET (1 << CONFIG_ENET_FLASH_PIN)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800589 bfin_write_FIO_INEN(~BIT_TO_SET);
590 bfin_write_FIO_DIR(BIT_TO_SET);
591 bfin_write_FIO_FLAG_C(BIT_TO_SET);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800592}