aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf527/boards
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2007-10-21 04:54:27 -0400
committerBryan Wu <bryan.wu@analog.com>2007-10-21 04:54:27 -0400
commit590031450a52c373bf72f5fb156fbcc0c78c6f2c (patch)
tree0e631bc6e8af9422635535459aaaf10fdddab357 /arch/blackfin/mach-bf527/boards
parentcfa76f024f7c9e65169425804e5b32e71f66d0ee (diff)
Blackfin arch: add new processor ADSP-BF52x arch/mach support
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/mach-bf527/boards')
-rw-r--r--arch/blackfin/mach-bf527/boards/Makefile7
-rw-r--r--arch/blackfin/mach-bf527/boards/eth_mac.c50
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c737
3 files changed, 794 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf527/boards/Makefile b/arch/blackfin/mach-bf527/boards/Makefile
new file mode 100644
index 000000000000..912ac8ebc889
--- /dev/null
+++ b/arch/blackfin/mach-bf527/boards/Makefile
@@ -0,0 +1,7 @@
1#
2# arch/blackfin/mach-bf532/boards/Makefile
3#
4
5obj-y += eth_mac.o
6obj-$(CONFIG_BFIN527_EZKIT) += ezkit.o
7
diff --git a/arch/blackfin/mach-bf527/boards/eth_mac.c b/arch/blackfin/mach-bf527/boards/eth_mac.c
new file mode 100644
index 000000000000..a725cc8a9290
--- /dev/null
+++ b/arch/blackfin/mach-bf527/boards/eth_mac.c
@@ -0,0 +1,50 @@
1/*
2 * arch/blackfin/mach-bf537/board/eth_mac.c
3 *
4 * Copyright (C) 2007 Analog Devices, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/module.h>
21#include <asm/blackfin.h>
22
23#if defined(CONFIG_GENERIC_BOARD) || defined(CONFIG_BFIN537_STAMP)
24
25/*
26 * Currently the MAC address is saved in Flash by U-Boot
27 */
28#define FLASH_MAC 0x203f0000
29
30void get_bf537_ether_addr(char *addr)
31{
32 unsigned int flash_mac = (unsigned int) FLASH_MAC;
33 *(u32 *)(&(addr[0])) = bfin_read32(flash_mac);
34 flash_mac += 4;
35 *(u16 *)(&(addr[4])) = bfin_read16(flash_mac);
36}
37
38#else
39
40/*
41 * Provide MAC address function for other specific board setting
42 */
43void get_bf537_ether_addr(char *addr)
44{
45 printk(KERN_WARNING "%s: No valid Ethernet MAC address found\n", __FILE__);
46}
47
48#endif
49
50EXPORT_SYMBOL(get_bf537_ether_addr);
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
new file mode 100644
index 000000000000..09fb624af5ac
--- /dev/null
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -0,0 +1,737 @@
1/*
2 * File: arch/blackfin/mach-bf527/boards/ezkit.c
3 * Based on: arch/blackfin/mach-bf537/boards/stamp.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2007 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>
35#include <linux/spi/spi.h>
36#include <linux/spi/flash.h>
37#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
38#include <linux/usb_isp1362.h>
39#endif
40#include <linux/pata_platform.h>
41#include <linux/irq.h>
42#include <linux/interrupt.h>
43#include <linux/usb_sl811.h>
44#include <asm/dma.h>
45#include <asm/bfin5xx_spi.h>
46#include <asm/reboot.h>
47#include <linux/spi/ad7877.h>
48
49/*
50 * Name the Board for the /proc/cpuinfo
51 */
52char *bfin_board_name = "ADDS-BF527-EZKIT";
53
54/*
55 * Driver needs to know address, irq and flag pin.
56 */
57
58#define ISP1761_BASE 0x203C0000
59#define ISP1761_IRQ IRQ_PF7
60
61#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
62static struct resource bfin_isp1761_resources[] = {
63 [0] = {
64 .name = "isp1761-regs",
65 .start = ISP1761_BASE + 0x00000000,
66 .end = ISP1761_BASE + 0x000fffff,
67 .flags = IORESOURCE_MEM,
68 },
69 [1] = {
70 .start = ISP1761_IRQ,
71 .end = ISP1761_IRQ,
72 .flags = IORESOURCE_IRQ,
73 },
74};
75
76static struct platform_device bfin_isp1761_device = {
77 .name = "isp1761",
78 .id = 0,
79 .num_resources = ARRAY_SIZE(bfin_isp1761_resources),
80 .resource = bfin_isp1761_resources,
81};
82
83static struct platform_device *bfin_isp1761_devices[] = {
84 &bfin_isp1761_device,
85};
86
87int __init bfin_isp1761_init(void)
88{
89 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
90
91 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
92 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
93
94 return platform_add_devices(bfin_isp1761_devices, num_devices);
95}
96
97void __exit bfin_isp1761_exit(void)
98{
99 platform_device_unregister(&bfin_isp1761_device);
100}
101
102arch_initcall(bfin_isp1761_init);
103#endif
104
105#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
106static struct resource bfin_pcmcia_cf_resources[] = {
107 {
108 .start = 0x20310000, /* IO PORT */
109 .end = 0x20312000,
110 .flags = IORESOURCE_MEM,
111 }, {
112 .start = 0x20311000, /* Attribute Memory */
113 .end = 0x20311FFF,
114 .flags = IORESOURCE_MEM,
115 }, {
116 .start = IRQ_PF4,
117 .end = IRQ_PF4,
118 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
119 }, {
120 .start = 6, /* Card Detect PF6 */
121 .end = 6,
122 .flags = IORESOURCE_IRQ,
123 },
124};
125
126static struct platform_device bfin_pcmcia_cf_device = {
127 .name = "bfin_cf_pcmcia",
128 .id = -1,
129 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
130 .resource = bfin_pcmcia_cf_resources,
131};
132#endif
133
134#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
135static struct platform_device rtc_device = {
136 .name = "rtc-bfin",
137 .id = -1,
138};
139#endif
140
141#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
142static struct resource smc91x_resources[] = {
143 {
144 .name = "smc91x-regs",
145 .start = 0x20300300,
146 .end = 0x20300300 + 16,
147 .flags = IORESOURCE_MEM,
148 }, {
149
150 .start = IRQ_PF7,
151 .end = IRQ_PF7,
152 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
153 },
154};
155static struct platform_device smc91x_device = {
156 .name = "smc91x",
157 .id = 0,
158 .num_resources = ARRAY_SIZE(smc91x_resources),
159 .resource = smc91x_resources,
160};
161#endif
162
163#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
164static struct resource dm9000_resources[] = {
165 [0] = {
166 .start = 0x203FB800,
167 .end = 0x203FB800 + 8,
168 .flags = IORESOURCE_MEM,
169 },
170 [1] = {
171 .start = IRQ_PF9,
172 .end = IRQ_PF9,
173 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
174 },
175};
176
177static struct platform_device dm9000_device = {
178 .name = "dm9000",
179 .id = -1,
180 .num_resources = ARRAY_SIZE(dm9000_resources),
181 .resource = dm9000_resources,
182};
183#endif
184
185#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
186static struct resource sl811_hcd_resources[] = {
187 {
188 .start = 0x20340000,
189 .end = 0x20340000,
190 .flags = IORESOURCE_MEM,
191 }, {
192 .start = 0x20340004,
193 .end = 0x20340004,
194 .flags = IORESOURCE_MEM,
195 }, {
196 .start = CONFIG_USB_SL811_BFIN_IRQ,
197 .end = CONFIG_USB_SL811_BFIN_IRQ,
198 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
199 },
200};
201
202#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
203void sl811_port_power(struct device *dev, int is_on)
204{
205 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
206 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS);
207
208 if (is_on)
209 gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 1);
210 else
211 gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 0);
212}
213#endif
214
215static struct sl811_platform_data sl811_priv = {
216 .potpg = 10,
217 .power = 250, /* == 500mA */
218#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
219 .port_power = &sl811_port_power,
220#endif
221};
222
223static struct platform_device sl811_hcd_device = {
224 .name = "sl811-hcd",
225 .id = 0,
226 .dev = {
227 .platform_data = &sl811_priv,
228 },
229 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
230 .resource = sl811_hcd_resources,
231};
232#endif
233
234#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
235static struct resource isp1362_hcd_resources[] = {
236 {
237 .start = 0x20360000,
238 .end = 0x20360000,
239 .flags = IORESOURCE_MEM,
240 }, {
241 .start = 0x20360004,
242 .end = 0x20360004,
243 .flags = IORESOURCE_MEM,
244 }, {
245 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
246 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
247 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
248 },
249};
250
251static struct isp1362_platform_data isp1362_priv = {
252 .sel15Kres = 1,
253 .clknotstop = 0,
254 .oc_enable = 0,
255 .int_act_high = 0,
256 .int_edge_triggered = 0,
257 .remote_wakeup_connected = 0,
258 .no_power_switching = 1,
259 .power_switching_mode = 0,
260};
261
262static struct platform_device isp1362_hcd_device = {
263 .name = "isp1362-hcd",
264 .id = 0,
265 .dev = {
266 .platform_data = &isp1362_priv,
267 },
268 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
269 .resource = isp1362_hcd_resources,
270};
271#endif
272
273#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
274static struct platform_device bfin_mac_device = {
275 .name = "bfin_mac",
276};
277#endif
278
279#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
280static struct resource net2272_bfin_resources[] = {
281 {
282 .start = 0x20300000,
283 .end = 0x20300000 + 0x100,
284 .flags = IORESOURCE_MEM,
285 }, {
286 .start = IRQ_PF7,
287 .end = IRQ_PF7,
288 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
289 },
290};
291
292static struct platform_device net2272_bfin_device = {
293 .name = "net2272",
294 .id = -1,
295 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
296 .resource = net2272_bfin_resources,
297};
298#endif
299
300#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
301/* all SPI peripherals info goes here */
302
303#if defined(CONFIG_MTD_M25P80) \
304 || defined(CONFIG_MTD_M25P80_MODULE)
305static struct mtd_partition bfin_spi_flash_partitions[] = {
306 {
307 .name = "bootloader",
308 .size = 0x00020000,
309 .offset = 0,
310 .mask_flags = MTD_CAP_ROM
311 }, {
312 .name = "kernel",
313 .size = 0xe0000,
314 .offset = 0x20000
315 }, {
316 .name = "file system",
317 .size = 0x700000,
318 .offset = 0x00100000,
319 }
320};
321
322static struct flash_platform_data bfin_spi_flash_data = {
323 .name = "m25p80",
324 .parts = bfin_spi_flash_partitions,
325 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
326 .type = "m25p64",
327};
328
329/* SPI flash chip (m25p64) */
330static struct bfin5xx_spi_chip spi_flash_chip_info = {
331 .enable_dma = 0, /* use dma transfer with this chip*/
332 .bits_per_word = 8,
333};
334#endif
335
336#if defined(CONFIG_SPI_ADC_BF533) \
337 || defined(CONFIG_SPI_ADC_BF533_MODULE)
338/* SPI ADC chip */
339static struct bfin5xx_spi_chip spi_adc_chip_info = {
340 .enable_dma = 1, /* use dma transfer with this chip*/
341 .bits_per_word = 16,
342};
343#endif
344
345#if defined(CONFIG_SND_BLACKFIN_AD1836) \
346 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
347static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
348 .enable_dma = 0,
349 .bits_per_word = 16,
350};
351#endif
352
353#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
354static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
355 .enable_dma = 0,
356 .bits_per_word = 16,
357};
358#endif
359
360#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
361static struct bfin5xx_spi_chip spi_mmc_chip_info = {
362 .enable_dma = 1,
363 .bits_per_word = 8,
364};
365#endif
366
367#if defined(CONFIG_PBX)
368static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
369 .ctl_reg = 0x4, /* send zero */
370 .enable_dma = 0,
371 .bits_per_word = 8,
372 .cs_change_per_word = 1,
373};
374#endif
375
376#if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE)
377static struct bfin5xx_spi_chip ad5304_chip_info = {
378 .enable_dma = 0,
379 .bits_per_word = 16,
380};
381#endif
382
383#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
384static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
385 .enable_dma = 0,
386 .bits_per_word = 16,
387};
388
389static const struct ad7877_platform_data bfin_ad7877_ts_info = {
390 .model = 7877,
391 .vref_delay_usecs = 50, /* internal, no capacitor */
392 .x_plate_ohms = 419,
393 .y_plate_ohms = 486,
394 .pressure_max = 1000,
395 .pressure_min = 0,
396 .stopacq_polarity = 1,
397 .first_conversion_delay = 3,
398 .acquisition_time = 1,
399 .averaging = 1,
400 .pen_down_acc_interval = 1,
401};
402#endif
403
404static struct spi_board_info bfin_spi_board_info[] __initdata = {
405#if defined(CONFIG_MTD_M25P80) \
406 || defined(CONFIG_MTD_M25P80_MODULE)
407 {
408 /* the modalias must be the same as spi device driver name */
409 .modalias = "m25p80", /* Name of spi_driver for this device */
410 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
411 .bus_num = 0, /* Framework bus number */
412 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
413 .platform_data = &bfin_spi_flash_data,
414 .controller_data = &spi_flash_chip_info,
415 .mode = SPI_MODE_3,
416 },
417#endif
418
419#if defined(CONFIG_SPI_ADC_BF533) \
420 || defined(CONFIG_SPI_ADC_BF533_MODULE)
421 {
422 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
423 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
424 .bus_num = 0, /* Framework bus number */
425 .chip_select = 1, /* Framework chip select. */
426 .platform_data = NULL, /* No spi_driver specific config */
427 .controller_data = &spi_adc_chip_info,
428 },
429#endif
430
431#if defined(CONFIG_SND_BLACKFIN_AD1836) \
432 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
433 {
434 .modalias = "ad1836-spi",
435 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
436 .bus_num = 0,
437 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
438 .controller_data = &ad1836_spi_chip_info,
439 },
440#endif
441#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
442 {
443 .modalias = "ad9960-spi",
444 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
445 .bus_num = 0,
446 .chip_select = 1,
447 .controller_data = &ad9960_spi_chip_info,
448 },
449#endif
450#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
451 {
452 .modalias = "spi_mmc_dummy",
453 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
454 .bus_num = 0,
455 .chip_select = 0,
456 .platform_data = NULL,
457 .controller_data = &spi_mmc_chip_info,
458 .mode = SPI_MODE_3,
459 },
460 {
461 .modalias = "spi_mmc",
462 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
463 .bus_num = 0,
464 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
465 .platform_data = NULL,
466 .controller_data = &spi_mmc_chip_info,
467 .mode = SPI_MODE_3,
468 },
469#endif
470#if defined(CONFIG_PBX)
471 {
472 .modalias = "fxs-spi",
473 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
474 .bus_num = 0,
475 .chip_select = 8 - CONFIG_J11_JUMPER,
476 .controller_data = &spi_si3xxx_chip_info,
477 .mode = SPI_MODE_3,
478 },
479 {
480 .modalias = "fxo-spi",
481 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
482 .bus_num = 0,
483 .chip_select = 8 - CONFIG_J19_JUMPER,
484 .controller_data = &spi_si3xxx_chip_info,
485 .mode = SPI_MODE_3,
486 },
487#endif
488#if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE)
489 {
490 .modalias = "ad5304_spi",
491 .max_speed_hz = 1250000, /* max spi clock (SCK) speed in HZ */
492 .bus_num = 0,
493 .chip_select = 2,
494 .platform_data = NULL,
495 .controller_data = &ad5304_chip_info,
496 .mode = SPI_MODE_2,
497 },
498#endif
499#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
500 {
501 .modalias = "ad7877",
502 .platform_data = &bfin_ad7877_ts_info,
503 .irq = IRQ_PF6,
504 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
505 .bus_num = 1,
506 .chip_select = 1,
507 .controller_data = &spi_ad7877_chip_info,
508 },
509#endif
510};
511
512/* SPI controller data */
513static struct bfin5xx_spi_master bfin_spi0_info = {
514 .num_chipselect = 8,
515 .enable_dma = 1, /* master has the ability to do dma transfer */
516};
517
518/* SPI (0) */
519static struct resource bfin_spi0_resource[] = {
520 [0] = {
521 .start = SPI0_REGBASE,
522 .end = SPI0_REGBASE + 0xFF,
523 .flags = IORESOURCE_MEM,
524 },
525 [1] = {
526 .start = CH_SPI,
527 .end = CH_SPI,
528 .flags = IORESOURCE_IRQ,
529 },
530};
531
532static struct platform_device bfin_spi0_device = {
533 .name = "bfin-spi",
534 .id = 0, /* Bus number */
535 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
536 .resource = bfin_spi0_resource,
537 .dev = {
538 .platform_data = &bfin_spi0_info, /* Passed to driver */
539 },
540};
541#endif /* spi master and devices */
542
543#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
544static struct platform_device bfin_fb_device = {
545 .name = "bf537-lq035",
546};
547#endif
548
549#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
550static struct platform_device bfin_fb_adv7393_device = {
551 .name = "bfin-adv7393",
552};
553#endif
554
555#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
556static struct resource bfin_uart_resources[] = {
557#ifdef CONFIG_SERIAL_BFIN_UART0
558 {
559 .start = 0xFFC00400,
560 .end = 0xFFC004FF,
561 .flags = IORESOURCE_MEM,
562 },
563#endif
564#ifdef CONFIG_SERIAL_BFIN_UART1
565 {
566 .start = 0xFFC02000,
567 .end = 0xFFC020FF,
568 .flags = IORESOURCE_MEM,
569 },
570#endif
571};
572
573static struct platform_device bfin_uart_device = {
574 .name = "bfin-uart",
575 .id = 1,
576 .num_resources = ARRAY_SIZE(bfin_uart_resources),
577 .resource = bfin_uart_resources,
578};
579#endif
580
581#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
582static struct resource bfin_twi0_resource[] = {
583 [0] = {
584 .start = TWI0_REGBASE,
585 .end = TWI0_REGBASE,
586 .flags = IORESOURCE_MEM,
587 },
588 [1] = {
589 .start = IRQ_TWI,
590 .end = IRQ_TWI,
591 .flags = IORESOURCE_IRQ,
592 },
593};
594
595static struct platform_device i2c_bfin_twi_device = {
596 .name = "i2c-bfin-twi",
597 .id = 0,
598 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
599 .resource = bfin_twi0_resource,
600};
601#endif
602
603#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
604static struct platform_device bfin_sport0_uart_device = {
605 .name = "bfin-sport-uart",
606 .id = 0,
607};
608
609static struct platform_device bfin_sport1_uart_device = {
610 .name = "bfin-sport-uart",
611 .id = 1,
612};
613#endif
614
615#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
616#define PATA_INT 55
617
618static struct pata_platform_info bfin_pata_platform_data = {
619 .ioport_shift = 1,
620 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
621};
622
623static struct resource bfin_pata_resources[] = {
624 {
625 .start = 0x20314020,
626 .end = 0x2031403F,
627 .flags = IORESOURCE_MEM,
628 },
629 {
630 .start = 0x2031401C,
631 .end = 0x2031401F,
632 .flags = IORESOURCE_MEM,
633 },
634 {
635 .start = PATA_INT,
636 .end = PATA_INT,
637 .flags = IORESOURCE_IRQ,
638 },
639};
640
641static struct platform_device bfin_pata_device = {
642 .name = "pata_platform",
643 .id = -1,
644 .num_resources = ARRAY_SIZE(bfin_pata_resources),
645 .resource = bfin_pata_resources,
646 .dev = {
647 .platform_data = &bfin_pata_platform_data,
648 }
649};
650#endif
651
652static struct platform_device *stamp_devices[] __initdata = {
653#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
654 &bfin_pcmcia_cf_device,
655#endif
656
657#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
658 &rtc_device,
659#endif
660
661#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
662 &sl811_hcd_device,
663#endif
664
665#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
666 &isp1362_hcd_device,
667#endif
668
669#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
670 &smc91x_device,
671#endif
672
673#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
674 &dm9000_device,
675#endif
676
677#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
678 &bfin_mac_device,
679#endif
680
681#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
682 &net2272_bfin_device,
683#endif
684
685#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
686 &bfin_spi0_device,
687#endif
688
689#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
690 &bfin_fb_device,
691#endif
692
693#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
694 &bfin_fb_adv7393_device,
695#endif
696
697#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
698 &bfin_uart_device,
699#endif
700
701#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
702 &i2c_bfin_twi_device,
703#endif
704
705#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
706 &bfin_sport0_uart_device,
707 &bfin_sport1_uart_device,
708#endif
709
710#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
711 &bfin_pata_device,
712#endif
713};
714
715static int __init stamp_init(void)
716{
717 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
718 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
719#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
720 spi_register_board_info(bfin_spi_board_info,
721 ARRAY_SIZE(bfin_spi_board_info));
722#endif
723
724#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
725 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
726#endif
727 return 0;
728}
729
730arch_initcall(stamp_init);
731
732void native_machine_restart(char *cmd)
733{
734 /* workaround reboot hang when booting from SPI */
735 if ((bfin_read_SYSCR() & 0x7) == 0x3)
736 bfin_gpio_reset_spi0_ssel1();
737}