blob: b2ac4816ae62d585633de456c74e5a07dedee751 [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 Frysingerde8c43f2008-01-24 17:14:04 +0800112static struct mtd_partition stamp_partitions[] = {
113 {
114 .name = "Bootloader",
Mike Frysingeredf05642008-02-25 11:38:11 +0800115 .size = 0x40000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800116 .offset = 0,
117 }, {
118 .name = "Kernel",
119 .size = 0xE0000,
120 .offset = MTDPART_OFS_APPEND,
121 }, {
122 .name = "RootFS",
123 .size = MTDPART_SIZ_FULL,
124 .offset = MTDPART_OFS_APPEND,
125 }
126};
127
128static struct physmap_flash_data stamp_flash_data = {
129 .width = 2,
130 .parts = stamp_partitions,
131 .nr_parts = ARRAY_SIZE(stamp_partitions),
132};
133
134static struct resource stamp_flash_resource[] = {
135 {
136 .name = "cfi_probe",
137 .start = 0x20000000,
138 .end = 0x203fffff,
139 .flags = IORESOURCE_MEM,
140 }, {
141 .start = CONFIG_ENET_FLASH_PIN,
142 .flags = IORESOURCE_IRQ,
143 }
144};
145
146static struct platform_device stamp_flash_device = {
147 .name = "BF5xx-Flash",
148 .id = 0,
149 .dev = {
150 .platform_data = &stamp_flash_data,
151 },
152 .num_resources = ARRAY_SIZE(stamp_flash_resource),
153 .resource = stamp_flash_resource,
154};
155
Bryan Wu1394f032007-05-06 14:50:22 -0700156#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
157/* all SPI peripherals info goes here */
158
159#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
160static struct mtd_partition bfin_spi_flash_partitions[] = {
161 {
162 .name = "bootloader",
Mike Frysingeredf05642008-02-25 11:38:11 +0800163 .size = 0x00040000,
Bryan Wu1394f032007-05-06 14:50:22 -0700164 .offset = 0,
165 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800166 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700167 .name = "kernel",
168 .size = 0xe0000,
Mike Frysingeredf05642008-02-25 11:38:11 +0800169 .offset = MTDPART_OFS_APPEND,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800170 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700171 .name = "file system",
Mike Frysingeredf05642008-02-25 11:38:11 +0800172 .size = MTDPART_SIZ_FULL,
173 .offset = MTDPART_OFS_APPEND,
Bryan Wu1394f032007-05-06 14:50:22 -0700174 }
175};
176
177static struct flash_platform_data bfin_spi_flash_data = {
178 .name = "m25p80",
179 .parts = bfin_spi_flash_partitions,
180 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
181 .type = "m25p64",
182};
183
184/* SPI flash chip (m25p64) */
185static struct bfin5xx_spi_chip spi_flash_chip_info = {
186 .enable_dma = 0, /* use dma transfer with this chip*/
187 .bits_per_word = 8,
188};
189#endif
190
191#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
192/* SPI ADC chip */
193static struct bfin5xx_spi_chip spi_adc_chip_info = {
194 .enable_dma = 1, /* use dma transfer with this chip*/
195 .bits_per_word = 16,
196};
197#endif
198
199#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
200static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
201 .enable_dma = 0,
202 .bits_per_word = 16,
203};
204#endif
205
206#if defined(CONFIG_PBX)
207static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
208 .ctl_reg = 0x4, /* send zero */
209 .enable_dma = 0,
210 .bits_per_word = 8,
211 .cs_change_per_word = 1,
212};
213#endif
214
Bryan Wued2fbf52007-05-21 18:09:10 +0800215#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
216static struct bfin5xx_spi_chip spi_mmc_chip_info = {
217 .enable_dma = 1,
218 .bits_per_word = 8,
219};
220#endif
221
Michael Hennerich6e668932008-02-09 01:54:09 +0800222#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
223static struct bfin5xx_spi_chip spidev_chip_info = {
224 .enable_dma = 0,
225 .bits_per_word = 8,
226};
227#endif
228
Bryan Wu1394f032007-05-06 14:50:22 -0700229static struct spi_board_info bfin_spi_board_info[] __initdata = {
230#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
231 {
232 /* the modalias must be the same as spi device driver name */
233 .modalias = "m25p80", /* Name of spi_driver for this device */
234 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800235 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700236 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
237 .platform_data = &bfin_spi_flash_data,
238 .controller_data = &spi_flash_chip_info,
239 .mode = SPI_MODE_3,
240 },
241#endif
242
243#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
244 {
245 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
246 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800247 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700248 .chip_select = 1, /* Framework chip select. */
249 .platform_data = NULL, /* No spi_driver specific config */
250 .controller_data = &spi_adc_chip_info,
251 },
252#endif
253
254#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
255 {
256 .modalias = "ad1836-spi",
257 .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800258 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700259 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
260 .controller_data = &ad1836_spi_chip_info,
261 },
262#endif
263
Bryan Wued2fbf52007-05-21 18:09:10 +0800264#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
265 {
266 .modalias = "spi_mmc_dummy",
Sonic Zhang111cf972007-10-30 11:48:42 +0800267 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800268 .bus_num = 0,
Bryan Wued2fbf52007-05-21 18:09:10 +0800269 .chip_select = 0,
270 .platform_data = NULL,
271 .controller_data = &spi_mmc_chip_info,
272 .mode = SPI_MODE_3,
273 },
274 {
275 .modalias = "spi_mmc",
Sonic Zhang111cf972007-10-30 11:48:42 +0800276 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800277 .bus_num = 0,
Bryan Wued2fbf52007-05-21 18:09:10 +0800278 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
279 .platform_data = NULL,
280 .controller_data = &spi_mmc_chip_info,
281 .mode = SPI_MODE_3,
282 },
283#endif
284
Bryan Wu1394f032007-05-06 14:50:22 -0700285#if defined(CONFIG_PBX)
286 {
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800287 .modalias = "fxs-spi",
288 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800289 .bus_num = 0,
290 .chip_select = 8 - CONFIG_J11_JUMPER,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800291 .controller_data = &spi_si3xxx_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700292 .mode = SPI_MODE_3,
293 },
294 {
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800295 .modalias = "fxo-spi",
296 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800297 .bus_num = 0,
298 .chip_select = 8 - CONFIG_J19_JUMPER,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800299 .controller_data = &spi_si3xxx_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700300 .mode = SPI_MODE_3,
301 },
302#endif
303
Michael Hennerich6e668932008-02-09 01:54:09 +0800304#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
305 {
306 .modalias = "spidev",
307 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
308 .bus_num = 0,
309 .chip_select = 1,
310 .controller_data = &spidev_chip_info,
311 },
312#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700313};
314
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800315/* SPI (0) */
316static struct resource bfin_spi0_resource[] = {
317 [0] = {
318 .start = SPI0_REGBASE,
319 .end = SPI0_REGBASE + 0xFF,
320 .flags = IORESOURCE_MEM,
321 },
322 [1] = {
323 .start = CH_SPI,
324 .end = CH_SPI,
325 .flags = IORESOURCE_IRQ,
326 }
327};
328
Bryan Wu1394f032007-05-06 14:50:22 -0700329/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800330static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700331 .num_chipselect = 8,
332 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800333 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -0700334};
335
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800336static struct platform_device bfin_spi0_device = {
337 .name = "bfin-spi",
338 .id = 0, /* Bus number */
339 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
340 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -0700341 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800342 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -0700343 },
344};
345#endif /* spi master and devices */
346
347#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
348static struct platform_device bfin_fb_device = {
349 .name = "bf537-fb",
350};
351#endif
352
353#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
354static struct resource bfin_uart_resources[] = {
355 {
356 .start = 0xFFC00400,
357 .end = 0xFFC004FF,
358 .flags = IORESOURCE_MEM,
359 },
360};
361
362static struct platform_device bfin_uart_device = {
363 .name = "bfin-uart",
364 .id = 1,
365 .num_resources = ARRAY_SIZE(bfin_uart_resources),
366 .resource = bfin_uart_resources,
367};
368#endif
369
370#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
371static struct platform_device bfin_sport0_uart_device = {
372 .name = "bfin-sport-uart",
373 .id = 0,
374};
375
376static struct platform_device bfin_sport1_uart_device = {
377 .name = "bfin-sport-uart",
378 .id = 1,
379};
380#endif
381
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800382#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
383#define PATA_INT 55
384
385static struct pata_platform_info bfin_pata_platform_data = {
386 .ioport_shift = 1,
387 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
388};
389
390static struct resource bfin_pata_resources[] = {
391 {
392 .start = 0x20314020,
393 .end = 0x2031403F,
394 .flags = IORESOURCE_MEM,
395 },
396 {
397 .start = 0x2031401C,
398 .end = 0x2031401F,
399 .flags = IORESOURCE_MEM,
400 },
401 {
402 .start = PATA_INT,
403 .end = PATA_INT,
404 .flags = IORESOURCE_IRQ,
405 },
406};
407
408static struct platform_device bfin_pata_device = {
409 .name = "pata_platform",
410 .id = -1,
411 .num_resources = ARRAY_SIZE(bfin_pata_resources),
412 .resource = bfin_pata_resources,
413 .dev = {
414 .platform_data = &bfin_pata_platform_data,
415 }
416};
417#endif
418
Michael Hennerich2463ef22008-01-27 16:49:48 +0800419#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
420#include <linux/input.h>
421#include <linux/gpio_keys.h>
422
423static struct gpio_keys_button bfin_gpio_keys_table[] = {
Michael Hennerichf1bceb42008-02-02 16:17:52 +0800424 {BTN_0, GPIO_PF5, 0, "gpio-keys: BTN0"},
425 {BTN_1, GPIO_PF6, 0, "gpio-keys: BTN1"},
426 {BTN_2, GPIO_PF8, 0, "gpio-keys: BTN2"},
Michael Hennerich2463ef22008-01-27 16:49:48 +0800427};
428
429static struct gpio_keys_platform_data bfin_gpio_keys_data = {
430 .buttons = bfin_gpio_keys_table,
431 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
432};
433
434static struct platform_device bfin_device_gpiokeys = {
435 .name = "gpio-keys",
436 .dev = {
437 .platform_data = &bfin_gpio_keys_data,
438 },
439};
440#endif
441
Mike Frysingercad2ab62008-02-22 17:01:31 +0800442static struct resource bfin_gpios_resources = {
443 .start = 0,
444 .end = MAX_BLACKFIN_GPIOS - 1,
445 .flags = IORESOURCE_IRQ,
446};
447
448static struct platform_device bfin_gpios_device = {
449 .name = "simple-gpio",
450 .id = -1,
451 .num_resources = 1,
452 .resource = &bfin_gpios_resources,
453};
454
Bryan Wue3163952008-01-24 16:19:15 +0800455#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
456#include <linux/i2c-gpio.h>
457
458static struct i2c_gpio_platform_data i2c_gpio_data = {
459 .sda_pin = 2,
460 .scl_pin = 3,
461 .sda_is_open_drain = 0,
462 .scl_is_open_drain = 0,
463 .udelay = 40,
464};
465
466static struct platform_device i2c_gpio_device = {
467 .name = "i2c-gpio",
468 .id = 0,
469 .dev = {
470 .platform_data = &i2c_gpio_data,
471 },
472};
473#endif
474
Bryan Wu1394f032007-05-06 14:50:22 -0700475static struct platform_device *stamp_devices[] __initdata = {
476#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
477 &rtc_device,
478#endif
479
480#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
481 &smc91x_device,
482#endif
483
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800484#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
485 &bfin_fb_adv7393_device,
486#endif
487
Bryan Wu1394f032007-05-06 14:50:22 -0700488#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
489 &net2272_bfin_device,
490#endif
491
492#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800493 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700494#endif
495
496#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
497 &bfin_uart_device,
498#endif
499
500#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
501 &bfin_sport0_uart_device,
502 &bfin_sport1_uart_device,
503#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800504
505#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
506 &bfin_pata_device,
507#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +0800508
509#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
510 &bfin_device_gpiokeys,
511#endif
Bryan Wue3163952008-01-24 16:19:15 +0800512
513#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
514 &i2c_gpio_device,
515#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +0800516
517 &bfin_gpios_device,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800518 &stamp_flash_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700519};
520
521static int __init stamp_init(void)
522{
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800523 int ret;
524
Bryan Wu1394f032007-05-06 14:50:22 -0700525 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800526 ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
527 if (ret < 0)
528 return ret;
529
530#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800531 /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */
532 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (1 << CONFIG_ENET_FLASH_PIN));
533 bfin_write_FIO_FLAG_S(1 << CONFIG_ENET_FLASH_PIN);
534 SSYNC();
Bryan Wu1394f032007-05-06 14:50:22 -0700535#endif
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800536
537#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800538 spi_register_board_info(bfin_spi_board_info,
539 ARRAY_SIZE(bfin_spi_board_info));
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800540#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800541#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
542 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
543#endif
544 return 0;
Bryan Wu1394f032007-05-06 14:50:22 -0700545}
546
547arch_initcall(stamp_init);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800548
549void native_machine_restart(char *cmd)
550{
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800551#define BIT_TO_SET (1 << CONFIG_ENET_FLASH_PIN)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800552 bfin_write_FIO_INEN(~BIT_TO_SET);
553 bfin_write_FIO_DIR(BIT_TO_SET);
554 bfin_write_FIO_FLAG_C(BIT_TO_SET);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800555}