blob: ecf449b322d9d9734a8fa027dcaf41b8bfac99b1 [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 Wuc6c4d7b2007-10-11 01:20:06 +080043#include <asm/dma.h>
Bryan Wu1394f032007-05-06 14:50:22 -070044#include <asm/bfin5xx_spi.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080045#include <asm/reboot.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080046#include <asm/portmux.h>
Bryan Wu1394f032007-05-06 14:50:22 -070047
48/*
49 * Name the Board for the /proc/cpuinfo
50 */
Mike Frysinger066954a2007-10-21 22:36:06 +080051const char bfin_board_name[] = "ADDS-BF533-STAMP";
Bryan Wu1394f032007-05-06 14:50:22 -070052
53#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
54static struct platform_device rtc_device = {
55 .name = "rtc-bfin",
56 .id = -1,
57};
58#endif
59
60/*
61 * Driver needs to know address, irq and flag pin.
62 */
63#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
64static struct resource smc91x_resources[] = {
65 {
66 .name = "smc91x-regs",
67 .start = 0x20300300,
68 .end = 0x20300300 + 16,
69 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080070 }, {
Bryan Wu1394f032007-05-06 14:50:22 -070071 .start = IRQ_PF7,
72 .end = IRQ_PF7,
73 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
74 },
75};
76
77static struct platform_device smc91x_device = {
78 .name = "smc91x",
79 .id = 0,
80 .num_resources = ARRAY_SIZE(smc91x_resources),
81 .resource = smc91x_resources,
82};
83#endif
84
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080085#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
86static struct platform_device bfin_fb_adv7393_device = {
87 .name = "bfin-adv7393",
88};
89#endif
90
Bryan Wu1394f032007-05-06 14:50:22 -070091#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
92static struct resource net2272_bfin_resources[] = {
93 {
94 .start = 0x20300000,
95 .end = 0x20300000 + 0x100,
96 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080097 }, {
Bryan Wu1394f032007-05-06 14:50:22 -070098 .start = IRQ_PF10,
99 .end = IRQ_PF10,
100 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
101 },
102};
103
104static struct platform_device net2272_bfin_device = {
105 .name = "net2272",
106 .id = -1,
107 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
108 .resource = net2272_bfin_resources,
109};
110#endif
111
Mike Frysinger793dc272008-03-26 08:09:12 +0800112#if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800113static struct mtd_partition stamp_partitions[] = {
114 {
115 .name = "Bootloader",
Mike Frysingeredf05642008-02-25 11:38:11 +0800116 .size = 0x40000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800117 .offset = 0,
118 }, {
119 .name = "Kernel",
120 .size = 0xE0000,
121 .offset = MTDPART_OFS_APPEND,
122 }, {
123 .name = "RootFS",
124 .size = MTDPART_SIZ_FULL,
125 .offset = MTDPART_OFS_APPEND,
126 }
127};
128
129static struct physmap_flash_data stamp_flash_data = {
130 .width = 2,
131 .parts = stamp_partitions,
132 .nr_parts = ARRAY_SIZE(stamp_partitions),
133};
134
135static struct resource stamp_flash_resource[] = {
136 {
137 .name = "cfi_probe",
138 .start = 0x20000000,
139 .end = 0x203fffff,
140 .flags = IORESOURCE_MEM,
141 }, {
142 .start = CONFIG_ENET_FLASH_PIN,
143 .flags = IORESOURCE_IRQ,
144 }
145};
146
147static struct platform_device stamp_flash_device = {
148 .name = "BF5xx-Flash",
149 .id = 0,
150 .dev = {
151 .platform_data = &stamp_flash_data,
152 },
153 .num_resources = ARRAY_SIZE(stamp_flash_resource),
154 .resource = stamp_flash_resource,
155};
Mike Frysinger793dc272008-03-26 08:09:12 +0800156#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800157
Bryan Wu1394f032007-05-06 14:50:22 -0700158#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
159/* all SPI peripherals info goes here */
160
161#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
162static struct mtd_partition bfin_spi_flash_partitions[] = {
163 {
164 .name = "bootloader",
Mike Frysingeredf05642008-02-25 11:38:11 +0800165 .size = 0x00040000,
Bryan Wu1394f032007-05-06 14:50:22 -0700166 .offset = 0,
167 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800168 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700169 .name = "kernel",
170 .size = 0xe0000,
Mike Frysingeredf05642008-02-25 11:38:11 +0800171 .offset = MTDPART_OFS_APPEND,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800172 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700173 .name = "file system",
Mike Frysingeredf05642008-02-25 11:38:11 +0800174 .size = MTDPART_SIZ_FULL,
175 .offset = MTDPART_OFS_APPEND,
Bryan Wu1394f032007-05-06 14:50:22 -0700176 }
177};
178
179static struct flash_platform_data bfin_spi_flash_data = {
180 .name = "m25p80",
181 .parts = bfin_spi_flash_partitions,
182 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
183 .type = "m25p64",
184};
185
186/* SPI flash chip (m25p64) */
187static struct bfin5xx_spi_chip spi_flash_chip_info = {
188 .enable_dma = 0, /* use dma transfer with this chip*/
189 .bits_per_word = 8,
190};
191#endif
192
193#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
194/* SPI ADC chip */
195static struct bfin5xx_spi_chip spi_adc_chip_info = {
196 .enable_dma = 1, /* use dma transfer with this chip*/
197 .bits_per_word = 16,
198};
199#endif
200
201#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
202static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
203 .enable_dma = 0,
204 .bits_per_word = 16,
205};
206#endif
207
208#if defined(CONFIG_PBX)
209static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
210 .ctl_reg = 0x4, /* send zero */
211 .enable_dma = 0,
212 .bits_per_word = 8,
213 .cs_change_per_word = 1,
214};
215#endif
216
Bryan Wued2fbf52007-05-21 18:09:10 +0800217#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
218static struct bfin5xx_spi_chip spi_mmc_chip_info = {
219 .enable_dma = 1,
220 .bits_per_word = 8,
221};
222#endif
223
Michael Hennerich6e668932008-02-09 01:54:09 +0800224#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
225static struct bfin5xx_spi_chip spidev_chip_info = {
226 .enable_dma = 0,
227 .bits_per_word = 8,
228};
229#endif
230
Bryan Wu1394f032007-05-06 14:50:22 -0700231static struct spi_board_info bfin_spi_board_info[] __initdata = {
232#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
233 {
234 /* the modalias must be the same as spi device driver name */
235 .modalias = "m25p80", /* Name of spi_driver for this device */
236 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800237 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700238 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
239 .platform_data = &bfin_spi_flash_data,
240 .controller_data = &spi_flash_chip_info,
241 .mode = SPI_MODE_3,
242 },
243#endif
244
245#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
246 {
247 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
248 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800249 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700250 .chip_select = 1, /* Framework chip select. */
251 .platform_data = NULL, /* No spi_driver specific config */
252 .controller_data = &spi_adc_chip_info,
253 },
254#endif
255
256#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
257 {
258 .modalias = "ad1836-spi",
259 .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800260 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700261 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
262 .controller_data = &ad1836_spi_chip_info,
263 },
264#endif
265
Bryan Wued2fbf52007-05-21 18:09:10 +0800266#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
267 {
268 .modalias = "spi_mmc_dummy",
Sonic Zhang111cf972007-10-30 11:48:42 +0800269 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800270 .bus_num = 0,
Bryan Wued2fbf52007-05-21 18:09:10 +0800271 .chip_select = 0,
272 .platform_data = NULL,
273 .controller_data = &spi_mmc_chip_info,
274 .mode = SPI_MODE_3,
275 },
276 {
277 .modalias = "spi_mmc",
Sonic Zhang111cf972007-10-30 11:48:42 +0800278 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800279 .bus_num = 0,
Bryan Wued2fbf52007-05-21 18:09:10 +0800280 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
281 .platform_data = NULL,
282 .controller_data = &spi_mmc_chip_info,
283 .mode = SPI_MODE_3,
284 },
285#endif
286
Bryan Wu1394f032007-05-06 14:50:22 -0700287#if defined(CONFIG_PBX)
288 {
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800289 .modalias = "fxs-spi",
290 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800291 .bus_num = 0,
292 .chip_select = 8 - CONFIG_J11_JUMPER,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800293 .controller_data = &spi_si3xxx_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700294 .mode = SPI_MODE_3,
295 },
296 {
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800297 .modalias = "fxo-spi",
298 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800299 .bus_num = 0,
300 .chip_select = 8 - CONFIG_J19_JUMPER,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800301 .controller_data = &spi_si3xxx_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700302 .mode = SPI_MODE_3,
303 },
304#endif
305
Michael Hennerich6e668932008-02-09 01:54:09 +0800306#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
307 {
308 .modalias = "spidev",
309 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
310 .bus_num = 0,
311 .chip_select = 1,
312 .controller_data = &spidev_chip_info,
313 },
314#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700315};
316
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800317/* SPI (0) */
318static struct resource bfin_spi0_resource[] = {
319 [0] = {
320 .start = SPI0_REGBASE,
321 .end = SPI0_REGBASE + 0xFF,
322 .flags = IORESOURCE_MEM,
323 },
324 [1] = {
325 .start = CH_SPI,
326 .end = CH_SPI,
327 .flags = IORESOURCE_IRQ,
328 }
329};
330
Bryan Wu1394f032007-05-06 14:50:22 -0700331/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800332static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700333 .num_chipselect = 8,
334 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800335 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -0700336};
337
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800338static struct platform_device bfin_spi0_device = {
339 .name = "bfin-spi",
340 .id = 0, /* Bus number */
341 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
342 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -0700343 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800344 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -0700345 },
346};
347#endif /* spi master and devices */
348
349#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
350static struct platform_device bfin_fb_device = {
351 .name = "bf537-fb",
352};
353#endif
354
355#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
356static struct resource bfin_uart_resources[] = {
357 {
358 .start = 0xFFC00400,
359 .end = 0xFFC004FF,
360 .flags = IORESOURCE_MEM,
361 },
362};
363
364static struct platform_device bfin_uart_device = {
365 .name = "bfin-uart",
366 .id = 1,
367 .num_resources = ARRAY_SIZE(bfin_uart_resources),
368 .resource = bfin_uart_resources,
369};
370#endif
371
372#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
373static struct platform_device bfin_sport0_uart_device = {
374 .name = "bfin-sport-uart",
375 .id = 0,
376};
377
378static struct platform_device bfin_sport1_uart_device = {
379 .name = "bfin-sport-uart",
380 .id = 1,
381};
382#endif
383
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800384#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
385#define PATA_INT 55
386
387static struct pata_platform_info bfin_pata_platform_data = {
388 .ioport_shift = 1,
389 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
390};
391
392static struct resource bfin_pata_resources[] = {
393 {
394 .start = 0x20314020,
395 .end = 0x2031403F,
396 .flags = IORESOURCE_MEM,
397 },
398 {
399 .start = 0x2031401C,
400 .end = 0x2031401F,
401 .flags = IORESOURCE_MEM,
402 },
403 {
404 .start = PATA_INT,
405 .end = PATA_INT,
406 .flags = IORESOURCE_IRQ,
407 },
408};
409
410static struct platform_device bfin_pata_device = {
411 .name = "pata_platform",
412 .id = -1,
413 .num_resources = ARRAY_SIZE(bfin_pata_resources),
414 .resource = bfin_pata_resources,
415 .dev = {
416 .platform_data = &bfin_pata_platform_data,
417 }
418};
419#endif
420
Michael Hennerich2463ef22008-01-27 16:49:48 +0800421#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
422#include <linux/input.h>
423#include <linux/gpio_keys.h>
424
425static struct gpio_keys_button bfin_gpio_keys_table[] = {
Michael Hennerichf1bceb42008-02-02 16:17:52 +0800426 {BTN_0, GPIO_PF5, 0, "gpio-keys: BTN0"},
427 {BTN_1, GPIO_PF6, 0, "gpio-keys: BTN1"},
428 {BTN_2, GPIO_PF8, 0, "gpio-keys: BTN2"},
Michael Hennerich2463ef22008-01-27 16:49:48 +0800429};
430
431static struct gpio_keys_platform_data bfin_gpio_keys_data = {
432 .buttons = bfin_gpio_keys_table,
433 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
434};
435
436static struct platform_device bfin_device_gpiokeys = {
437 .name = "gpio-keys",
438 .dev = {
439 .platform_data = &bfin_gpio_keys_data,
440 },
441};
442#endif
443
Mike Frysingercad2ab62008-02-22 17:01:31 +0800444static struct resource bfin_gpios_resources = {
445 .start = 0,
446 .end = MAX_BLACKFIN_GPIOS - 1,
447 .flags = IORESOURCE_IRQ,
448};
449
450static struct platform_device bfin_gpios_device = {
451 .name = "simple-gpio",
452 .id = -1,
453 .num_resources = 1,
454 .resource = &bfin_gpios_resources,
455};
456
Bryan Wue3163952008-01-24 16:19:15 +0800457#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
458#include <linux/i2c-gpio.h>
459
460static struct i2c_gpio_platform_data i2c_gpio_data = {
461 .sda_pin = 2,
462 .scl_pin = 3,
463 .sda_is_open_drain = 0,
464 .scl_is_open_drain = 0,
465 .udelay = 40,
466};
467
468static struct platform_device i2c_gpio_device = {
469 .name = "i2c-gpio",
470 .id = 0,
471 .dev = {
472 .platform_data = &i2c_gpio_data,
473 },
474};
475#endif
476
Bryan Wu1394f032007-05-06 14:50:22 -0700477static struct platform_device *stamp_devices[] __initdata = {
478#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
479 &rtc_device,
480#endif
481
482#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
483 &smc91x_device,
484#endif
485
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800486#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
487 &bfin_fb_adv7393_device,
488#endif
489
Bryan Wu1394f032007-05-06 14:50:22 -0700490#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
491 &net2272_bfin_device,
492#endif
493
494#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800495 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700496#endif
497
498#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
499 &bfin_uart_device,
500#endif
501
502#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
503 &bfin_sport0_uart_device,
504 &bfin_sport1_uart_device,
505#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800506
507#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
508 &bfin_pata_device,
509#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +0800510
511#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
512 &bfin_device_gpiokeys,
513#endif
Bryan Wue3163952008-01-24 16:19:15 +0800514
515#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
516 &i2c_gpio_device,
517#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +0800518
519 &bfin_gpios_device,
Mike Frysinger793dc272008-03-26 08:09:12 +0800520
521#if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800522 &stamp_flash_device,
Mike Frysinger793dc272008-03-26 08:09:12 +0800523#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700524};
525
526static int __init stamp_init(void)
527{
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800528 int ret;
529
Bryan Wu1394f032007-05-06 14:50:22 -0700530 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800531 ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
532 if (ret < 0)
533 return ret;
534
535#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800536 /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */
537 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (1 << CONFIG_ENET_FLASH_PIN));
538 bfin_write_FIO_FLAG_S(1 << CONFIG_ENET_FLASH_PIN);
539 SSYNC();
Bryan Wu1394f032007-05-06 14:50:22 -0700540#endif
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800541
542#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800543 spi_register_board_info(bfin_spi_board_info,
544 ARRAY_SIZE(bfin_spi_board_info));
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800545#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800546#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
547 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
548#endif
549 return 0;
Bryan Wu1394f032007-05-06 14:50:22 -0700550}
551
552arch_initcall(stamp_init);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800553
554void native_machine_restart(char *cmd)
555{
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800556#define BIT_TO_SET (1 << CONFIG_ENET_FLASH_PIN)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800557 bfin_write_FIO_INEN(~BIT_TO_SET);
558 bfin_write_FIO_DIR(BIT_TO_SET);
559 bfin_write_FIO_FLAG_C(BIT_TO_SET);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800560}