blob: 7fd35fb32fd52a0206e157893608eab0fd53766b [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>
Michael Hennerich14b03202008-05-07 11:41:26 +080048#include <asm/dpmc.h>
Bryan Wu1394f032007-05-06 14:50:22 -070049
50/*
51 * Name the Board for the /proc/cpuinfo
52 */
Mike Frysinger066954a2007-10-21 22:36:06 +080053const char bfin_board_name[] = "ADDS-BF533-STAMP";
Bryan Wu1394f032007-05-06 14:50:22 -070054
55#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
56static struct platform_device rtc_device = {
57 .name = "rtc-bfin",
58 .id = -1,
59};
60#endif
61
62/*
63 * Driver needs to know address, irq and flag pin.
64 */
65#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
66static struct resource smc91x_resources[] = {
67 {
68 .name = "smc91x-regs",
69 .start = 0x20300300,
70 .end = 0x20300300 + 16,
71 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080072 }, {
Bryan Wu1394f032007-05-06 14:50:22 -070073 .start = IRQ_PF7,
74 .end = IRQ_PF7,
75 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
76 },
77};
78
79static struct platform_device smc91x_device = {
80 .name = "smc91x",
81 .id = 0,
82 .num_resources = ARRAY_SIZE(smc91x_resources),
83 .resource = smc91x_resources,
84};
85#endif
86
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080087#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
88static struct platform_device bfin_fb_adv7393_device = {
89 .name = "bfin-adv7393",
90};
91#endif
92
Bryan Wu1394f032007-05-06 14:50:22 -070093#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
94static struct resource net2272_bfin_resources[] = {
95 {
96 .start = 0x20300000,
97 .end = 0x20300000 + 0x100,
98 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080099 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700100 .start = IRQ_PF10,
101 .end = IRQ_PF10,
102 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
103 },
104};
105
106static struct platform_device net2272_bfin_device = {
107 .name = "net2272",
108 .id = -1,
109 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
110 .resource = net2272_bfin_resources,
111};
112#endif
113
Mike Frysinger793dc272008-03-26 08:09:12 +0800114#if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800115static struct mtd_partition stamp_partitions[] = {
116 {
117 .name = "Bootloader",
Mike Frysingeredf05642008-02-25 11:38:11 +0800118 .size = 0x40000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800119 .offset = 0,
120 }, {
121 .name = "Kernel",
122 .size = 0xE0000,
123 .offset = MTDPART_OFS_APPEND,
124 }, {
125 .name = "RootFS",
126 .size = MTDPART_SIZ_FULL,
127 .offset = MTDPART_OFS_APPEND,
128 }
129};
130
131static struct physmap_flash_data stamp_flash_data = {
132 .width = 2,
133 .parts = stamp_partitions,
134 .nr_parts = ARRAY_SIZE(stamp_partitions),
135};
136
137static struct resource stamp_flash_resource[] = {
138 {
139 .name = "cfi_probe",
140 .start = 0x20000000,
141 .end = 0x203fffff,
142 .flags = IORESOURCE_MEM,
143 }, {
144 .start = CONFIG_ENET_FLASH_PIN,
145 .flags = IORESOURCE_IRQ,
146 }
147};
148
149static struct platform_device stamp_flash_device = {
150 .name = "BF5xx-Flash",
151 .id = 0,
152 .dev = {
153 .platform_data = &stamp_flash_data,
154 },
155 .num_resources = ARRAY_SIZE(stamp_flash_resource),
156 .resource = stamp_flash_resource,
157};
Mike Frysinger793dc272008-03-26 08:09:12 +0800158#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800159
Bryan Wu1394f032007-05-06 14:50:22 -0700160#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
161/* all SPI peripherals info goes here */
162
163#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
164static struct mtd_partition bfin_spi_flash_partitions[] = {
165 {
166 .name = "bootloader",
Mike Frysingeredf05642008-02-25 11:38:11 +0800167 .size = 0x00040000,
Bryan Wu1394f032007-05-06 14:50:22 -0700168 .offset = 0,
169 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800170 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700171 .name = "kernel",
172 .size = 0xe0000,
Mike Frysingeredf05642008-02-25 11:38:11 +0800173 .offset = MTDPART_OFS_APPEND,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800174 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700175 .name = "file system",
Mike Frysingeredf05642008-02-25 11:38:11 +0800176 .size = MTDPART_SIZ_FULL,
177 .offset = MTDPART_OFS_APPEND,
Bryan Wu1394f032007-05-06 14:50:22 -0700178 }
179};
180
181static struct flash_platform_data bfin_spi_flash_data = {
182 .name = "m25p80",
183 .parts = bfin_spi_flash_partitions,
184 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
185 .type = "m25p64",
186};
187
188/* SPI flash chip (m25p64) */
189static struct bfin5xx_spi_chip spi_flash_chip_info = {
190 .enable_dma = 0, /* use dma transfer with this chip*/
191 .bits_per_word = 8,
192};
193#endif
194
195#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
196/* SPI ADC chip */
197static struct bfin5xx_spi_chip spi_adc_chip_info = {
198 .enable_dma = 1, /* use dma transfer with this chip*/
199 .bits_per_word = 16,
200};
201#endif
202
203#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
204static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
205 .enable_dma = 0,
206 .bits_per_word = 16,
207};
208#endif
209
210#if defined(CONFIG_PBX)
211static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
212 .ctl_reg = 0x4, /* send zero */
213 .enable_dma = 0,
214 .bits_per_word = 8,
215 .cs_change_per_word = 1,
216};
217#endif
218
Bryan Wued2fbf52007-05-21 18:09:10 +0800219#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
220static struct bfin5xx_spi_chip spi_mmc_chip_info = {
221 .enable_dma = 1,
222 .bits_per_word = 8,
223};
224#endif
225
Michael Hennerich6e668932008-02-09 01:54:09 +0800226#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
227static struct bfin5xx_spi_chip spidev_chip_info = {
228 .enable_dma = 0,
229 .bits_per_word = 8,
230};
231#endif
232
Bryan Wu1394f032007-05-06 14:50:22 -0700233static struct spi_board_info bfin_spi_board_info[] __initdata = {
234#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
235 {
236 /* the modalias must be the same as spi device driver name */
237 .modalias = "m25p80", /* Name of spi_driver for this device */
238 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800239 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700240 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
241 .platform_data = &bfin_spi_flash_data,
242 .controller_data = &spi_flash_chip_info,
243 .mode = SPI_MODE_3,
244 },
245#endif
246
247#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
248 {
249 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
250 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800251 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700252 .chip_select = 1, /* Framework chip select. */
253 .platform_data = NULL, /* No spi_driver specific config */
254 .controller_data = &spi_adc_chip_info,
255 },
256#endif
257
258#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
259 {
260 .modalias = "ad1836-spi",
261 .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800262 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700263 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
264 .controller_data = &ad1836_spi_chip_info,
265 },
266#endif
267
Bryan Wued2fbf52007-05-21 18:09:10 +0800268#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
269 {
270 .modalias = "spi_mmc_dummy",
Sonic Zhang111cf972007-10-30 11:48:42 +0800271 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800272 .bus_num = 0,
Bryan Wued2fbf52007-05-21 18:09:10 +0800273 .chip_select = 0,
274 .platform_data = NULL,
275 .controller_data = &spi_mmc_chip_info,
276 .mode = SPI_MODE_3,
277 },
278 {
279 .modalias = "spi_mmc",
Sonic Zhang111cf972007-10-30 11:48:42 +0800280 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800281 .bus_num = 0,
Bryan Wued2fbf52007-05-21 18:09:10 +0800282 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
283 .platform_data = NULL,
284 .controller_data = &spi_mmc_chip_info,
285 .mode = SPI_MODE_3,
286 },
287#endif
288
Bryan Wu1394f032007-05-06 14:50:22 -0700289#if defined(CONFIG_PBX)
290 {
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800291 .modalias = "fxs-spi",
292 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800293 .bus_num = 0,
294 .chip_select = 8 - CONFIG_J11_JUMPER,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800295 .controller_data = &spi_si3xxx_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700296 .mode = SPI_MODE_3,
297 },
298 {
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800299 .modalias = "fxo-spi",
300 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800301 .bus_num = 0,
302 .chip_select = 8 - CONFIG_J19_JUMPER,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800303 .controller_data = &spi_si3xxx_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700304 .mode = SPI_MODE_3,
305 },
306#endif
307
Michael Hennerich6e668932008-02-09 01:54:09 +0800308#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
309 {
310 .modalias = "spidev",
311 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
312 .bus_num = 0,
313 .chip_select = 1,
314 .controller_data = &spidev_chip_info,
315 },
316#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700317};
318
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800319/* SPI (0) */
320static struct resource bfin_spi0_resource[] = {
321 [0] = {
322 .start = SPI0_REGBASE,
323 .end = SPI0_REGBASE + 0xFF,
324 .flags = IORESOURCE_MEM,
325 },
326 [1] = {
327 .start = CH_SPI,
328 .end = CH_SPI,
329 .flags = IORESOURCE_IRQ,
330 }
331};
332
Bryan Wu1394f032007-05-06 14:50:22 -0700333/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800334static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700335 .num_chipselect = 8,
336 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800337 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -0700338};
339
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800340static struct platform_device bfin_spi0_device = {
341 .name = "bfin-spi",
342 .id = 0, /* Bus number */
343 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
344 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -0700345 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800346 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -0700347 },
348};
349#endif /* spi master and devices */
350
351#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
352static struct platform_device bfin_fb_device = {
353 .name = "bf537-fb",
354};
355#endif
356
357#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
358static struct resource bfin_uart_resources[] = {
359 {
360 .start = 0xFFC00400,
361 .end = 0xFFC004FF,
362 .flags = IORESOURCE_MEM,
363 },
364};
365
366static struct platform_device bfin_uart_device = {
367 .name = "bfin-uart",
368 .id = 1,
369 .num_resources = ARRAY_SIZE(bfin_uart_resources),
370 .resource = bfin_uart_resources,
371};
372#endif
373
Graf Yang5be36d22008-04-25 03:09:15 +0800374#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
375static struct resource bfin_sir_resources[] = {
376#ifdef CONFIG_BFIN_SIR0
377 {
378 .start = 0xFFC00400,
379 .end = 0xFFC004FF,
380 .flags = IORESOURCE_MEM,
381 },
382#endif
383};
384
385static struct platform_device bfin_sir_device = {
386 .name = "bfin_sir",
387 .id = 0,
388 .num_resources = ARRAY_SIZE(bfin_sir_resources),
389 .resource = bfin_sir_resources,
390};
391#endif
392
Bryan Wu1394f032007-05-06 14:50:22 -0700393#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
394static struct platform_device bfin_sport0_uart_device = {
395 .name = "bfin-sport-uart",
396 .id = 0,
397};
398
399static struct platform_device bfin_sport1_uart_device = {
400 .name = "bfin-sport-uart",
401 .id = 1,
402};
403#endif
404
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800405#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
406#define PATA_INT 55
407
408static struct pata_platform_info bfin_pata_platform_data = {
409 .ioport_shift = 1,
410 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
411};
412
413static struct resource bfin_pata_resources[] = {
414 {
415 .start = 0x20314020,
416 .end = 0x2031403F,
417 .flags = IORESOURCE_MEM,
418 },
419 {
420 .start = 0x2031401C,
421 .end = 0x2031401F,
422 .flags = IORESOURCE_MEM,
423 },
424 {
425 .start = PATA_INT,
426 .end = PATA_INT,
427 .flags = IORESOURCE_IRQ,
428 },
429};
430
431static struct platform_device bfin_pata_device = {
432 .name = "pata_platform",
433 .id = -1,
434 .num_resources = ARRAY_SIZE(bfin_pata_resources),
435 .resource = bfin_pata_resources,
436 .dev = {
437 .platform_data = &bfin_pata_platform_data,
438 }
439};
440#endif
441
Michael Hennerich2463ef22008-01-27 16:49:48 +0800442#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
443#include <linux/input.h>
444#include <linux/gpio_keys.h>
445
446static struct gpio_keys_button bfin_gpio_keys_table[] = {
Michael Hennerichf1bceb42008-02-02 16:17:52 +0800447 {BTN_0, GPIO_PF5, 0, "gpio-keys: BTN0"},
448 {BTN_1, GPIO_PF6, 0, "gpio-keys: BTN1"},
449 {BTN_2, GPIO_PF8, 0, "gpio-keys: BTN2"},
Michael Hennerich2463ef22008-01-27 16:49:48 +0800450};
451
452static struct gpio_keys_platform_data bfin_gpio_keys_data = {
453 .buttons = bfin_gpio_keys_table,
454 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
455};
456
457static struct platform_device bfin_device_gpiokeys = {
458 .name = "gpio-keys",
459 .dev = {
460 .platform_data = &bfin_gpio_keys_data,
461 },
462};
463#endif
464
Mike Frysingercad2ab62008-02-22 17:01:31 +0800465static struct resource bfin_gpios_resources = {
466 .start = 0,
467 .end = MAX_BLACKFIN_GPIOS - 1,
468 .flags = IORESOURCE_IRQ,
469};
470
471static struct platform_device bfin_gpios_device = {
472 .name = "simple-gpio",
473 .id = -1,
474 .num_resources = 1,
475 .resource = &bfin_gpios_resources,
476};
477
Bryan Wue3163952008-01-24 16:19:15 +0800478#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
479#include <linux/i2c-gpio.h>
480
481static struct i2c_gpio_platform_data i2c_gpio_data = {
482 .sda_pin = 2,
483 .scl_pin = 3,
484 .sda_is_open_drain = 0,
485 .scl_is_open_drain = 0,
486 .udelay = 40,
487};
488
489static struct platform_device i2c_gpio_device = {
490 .name = "i2c-gpio",
491 .id = 0,
492 .dev = {
493 .platform_data = &i2c_gpio_data,
494 },
495};
496#endif
497
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800498#ifdef CONFIG_I2C_BOARDINFO
499static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
500#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
501 {
502 I2C_BOARD_INFO("ad7142_joystick", 0x2C),
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800503 .irq = 39,
504 },
505#endif
506#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
507 {
508 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800509 },
510#endif
511#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
512 {
513 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800514 .irq = 39,
515 },
516#endif
517};
518#endif
519
Michael Hennerich14b03202008-05-07 11:41:26 +0800520static const unsigned int cclk_vlev_datasheet[] =
521{
522 VRPAIR(VLEV_085, 250000000),
523 VRPAIR(VLEV_090, 376000000),
524 VRPAIR(VLEV_095, 426000000),
525 VRPAIR(VLEV_100, 426000000),
526 VRPAIR(VLEV_105, 476000000),
527 VRPAIR(VLEV_110, 476000000),
528 VRPAIR(VLEV_115, 476000000),
529 VRPAIR(VLEV_120, 600000000),
530 VRPAIR(VLEV_125, 600000000),
531 VRPAIR(VLEV_130, 600000000),
532};
533
534static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
535 .tuple_tab = cclk_vlev_datasheet,
536 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
537 .vr_settling_time = 25 /* us */,
538};
539
540static struct platform_device bfin_dpmc = {
541 .name = "bfin dpmc",
542 .dev = {
543 .platform_data = &bfin_dmpc_vreg_data,
544 },
545};
546
Bryan Wu1394f032007-05-06 14:50:22 -0700547static struct platform_device *stamp_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +0800548
549 &bfin_dpmc,
550
Bryan Wu1394f032007-05-06 14:50:22 -0700551#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
552 &rtc_device,
553#endif
554
555#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
556 &smc91x_device,
557#endif
558
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800559#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
560 &bfin_fb_adv7393_device,
561#endif
562
Bryan Wu1394f032007-05-06 14:50:22 -0700563#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
564 &net2272_bfin_device,
565#endif
566
567#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800568 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700569#endif
570
571#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
572 &bfin_uart_device,
573#endif
574
Graf Yang5be36d22008-04-25 03:09:15 +0800575#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
576 &bfin_sir_device,
577#endif
578
Bryan Wu1394f032007-05-06 14:50:22 -0700579#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
580 &bfin_sport0_uart_device,
581 &bfin_sport1_uart_device,
582#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800583
584#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
585 &bfin_pata_device,
586#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +0800587
588#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
589 &bfin_device_gpiokeys,
590#endif
Bryan Wue3163952008-01-24 16:19:15 +0800591
592#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
593 &i2c_gpio_device,
594#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +0800595
596 &bfin_gpios_device,
Mike Frysinger793dc272008-03-26 08:09:12 +0800597
598#if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800599 &stamp_flash_device,
Mike Frysinger793dc272008-03-26 08:09:12 +0800600#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700601};
602
603static int __init stamp_init(void)
604{
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800605 int ret;
606
Harvey Harrisonb85d8582008-04-23 09:39:01 +0800607 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800608
609#ifdef CONFIG_I2C_BOARDINFO
610 i2c_register_board_info(0, bfin_i2c_board_info,
611 ARRAY_SIZE(bfin_i2c_board_info));
612#endif
613
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800614 ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
615 if (ret < 0)
616 return ret;
617
618#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800619 /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */
620 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (1 << CONFIG_ENET_FLASH_PIN));
621 bfin_write_FIO_FLAG_S(1 << CONFIG_ENET_FLASH_PIN);
622 SSYNC();
Bryan Wu1394f032007-05-06 14:50:22 -0700623#endif
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800624
625#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800626 spi_register_board_info(bfin_spi_board_info,
627 ARRAY_SIZE(bfin_spi_board_info));
Mike Frysingerc0fc5252007-05-21 18:09:25 +0800628#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800629#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
630 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
631#endif
632 return 0;
Bryan Wu1394f032007-05-06 14:50:22 -0700633}
634
635arch_initcall(stamp_init);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800636
637void native_machine_restart(char *cmd)
638{
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800639#define BIT_TO_SET (1 << CONFIG_ENET_FLASH_PIN)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800640 bfin_write_FIO_INEN(~BIT_TO_SET);
641 bfin_write_FIO_DIR(BIT_TO_SET);
642 bfin_write_FIO_FLAG_C(BIT_TO_SET);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800643}