blob: 617a28738438b35e7d61b3a80161cc98f012fcfd [file] [log] [blame]
Michael Hennerich59003142007-10-21 16:54:27 +08001/*
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)
Michael Hennericha628a8b2008-01-22 17:29:16 +080011 * Copyright 2004-2008 Analog Devices Inc.
Michael Hennerich59003142007-10-21 16:54:27 +080012 *
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>
Michael Hennerichd7e5dd42008-05-07 11:41:26 +080035#include <linux/mtd/physmap.h>
Michael Hennerich59003142007-10-21 16:54:27 +080036#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>
Michael Hennerich59003142007-10-21 16:54:27 +080040#endif
Bryan Wu72268682008-05-07 11:41:26 +080041#include <linux/i2c.h>
Michael Hennerich59003142007-10-21 16:54:27 +080042#include <linux/irq.h>
43#include <linux/interrupt.h>
Mike Frysinger632f6582007-11-15 21:25:47 +080044#include <linux/usb/sl811.h>
Michael Hennerich1089e222007-12-24 11:49:29 +080045#include <linux/usb/musb.h>
Michael Hennerich59003142007-10-21 16:54:27 +080046#include <asm/dma.h>
47#include <asm/bfin5xx_spi.h>
48#include <asm/reboot.h>
Michael Hennerich64307f72007-10-29 16:55:18 +080049#include <asm/nand.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080050#include <asm/portmux.h>
Michael Hennerich14b03202008-05-07 11:41:26 +080051#include <asm/dpmc.h>
Michael Hennerich59003142007-10-21 16:54:27 +080052#include <linux/spi/ad7877.h>
53
54/*
55 * Name the Board for the /proc/cpuinfo
56 */
Mike Frysingerfe85cad2008-11-18 17:48:22 +080057const char bfin_board_name[] = "ADI BF527-EZKIT";
Michael Hennerich59003142007-10-21 16:54:27 +080058
59/*
60 * Driver needs to know address, irq and flag pin.
61 */
62
Michael Hennerich59003142007-10-21 16:54:27 +080063#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
Michael Hennerich3f375692008-11-18 17:48:22 +080064#include <linux/usb/isp1760.h>
65static struct resource bfin_isp1760_resources[] = {
Michael Hennerich59003142007-10-21 16:54:27 +080066 [0] = {
Michael Hennerich3f375692008-11-18 17:48:22 +080067 .start = 0x203C0000,
68 .end = 0x203C0000 + 0x000fffff,
Michael Hennerich59003142007-10-21 16:54:27 +080069 .flags = IORESOURCE_MEM,
70 },
71 [1] = {
Michael Hennerich3f375692008-11-18 17:48:22 +080072 .start = IRQ_PF7,
73 .end = IRQ_PF7,
Michael Hennerich59003142007-10-21 16:54:27 +080074 .flags = IORESOURCE_IRQ,
75 },
76};
77
Michael Hennerich3f375692008-11-18 17:48:22 +080078static struct isp1760_platform_data isp1760_priv = {
79 .is_isp1761 = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080080 .bus_width_16 = 1,
81 .port1_otg = 0,
82 .analog_oc = 0,
83 .dack_polarity_high = 0,
84 .dreq_polarity_high = 0,
85};
86
87static struct platform_device bfin_isp1760_device = {
88 .name = "isp1760-hcd",
Michael Hennerich59003142007-10-21 16:54:27 +080089 .id = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080090 .dev = {
91 .platform_data = &isp1760_priv,
92 },
93 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
94 .resource = bfin_isp1760_resources,
Michael Hennerich59003142007-10-21 16:54:27 +080095};
Michael Hennerich59003142007-10-21 16:54:27 +080096#endif
97
Michael Hennerich1089e222007-12-24 11:49:29 +080098#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
99static struct resource musb_resources[] = {
100 [0] = {
101 .start = 0xffc03800,
102 .end = 0xffc03cff,
103 .flags = IORESOURCE_MEM,
104 },
105 [1] = { /* general IRQ */
106 .start = IRQ_USB_INT0,
107 .end = IRQ_USB_INT0,
108 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
109 },
110 [2] = { /* DMA IRQ */
111 .start = IRQ_USB_DMA,
112 .end = IRQ_USB_DMA,
113 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
114 },
115};
116
Bryan Wu50041ac2008-10-08 13:39:40 +0800117static struct musb_hdrc_config musb_config = {
118 .multipoint = 0,
119 .dyn_fifo = 0,
120 .soft_con = 1,
121 .dma = 1,
Bryan Wufea05da2009-01-07 23:14:39 +0800122 .num_eps = 8,
123 .dma_channels = 8,
Bryan Wu50041ac2008-10-08 13:39:40 +0800124 .gpio_vrsel = GPIO_PG13,
125};
126
Michael Hennerich1089e222007-12-24 11:49:29 +0800127static struct musb_hdrc_platform_data musb_plat = {
128#if defined(CONFIG_USB_MUSB_OTG)
129 .mode = MUSB_OTG,
130#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
131 .mode = MUSB_HOST,
132#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
133 .mode = MUSB_PERIPHERAL,
134#endif
Bryan Wu50041ac2008-10-08 13:39:40 +0800135 .config = &musb_config,
Michael Hennerich1089e222007-12-24 11:49:29 +0800136};
137
138static u64 musb_dmamask = ~(u32)0;
139
140static struct platform_device musb_device = {
141 .name = "musb_hdrc",
142 .id = 0,
143 .dev = {
144 .dma_mask = &musb_dmamask,
145 .coherent_dma_mask = 0xffffffff,
146 .platform_data = &musb_plat,
147 },
148 .num_resources = ARRAY_SIZE(musb_resources),
149 .resource = musb_resources,
150};
151#endif
152
153#if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
154
155static struct resource bf52x_t350mcqb_resources[] = {
156 {
157 .start = IRQ_PPI_ERROR,
158 .end = IRQ_PPI_ERROR,
159 .flags = IORESOURCE_IRQ,
160 },
161};
162
163static struct platform_device bf52x_t350mcqb_device = {
164 .name = "bfin-t350mcqb",
165 .id = -1,
166 .num_resources = ARRAY_SIZE(bf52x_t350mcqb_resources),
167 .resource = bf52x_t350mcqb_resources,
168};
169#endif
170
Michael Hennerichd7e5dd42008-05-07 11:41:26 +0800171#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
172static struct mtd_partition ezkit_partitions[] = {
173 {
Robin Getzaa582972008-08-05 17:47:29 +0800174 .name = "bootloader(nor)",
Michael Hennerichd7e5dd42008-05-07 11:41:26 +0800175 .size = 0x40000,
176 .offset = 0,
177 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800178 .name = "linux kernel(nor)",
Michael Hennerichd7e5dd42008-05-07 11:41:26 +0800179 .size = 0x1C0000,
180 .offset = MTDPART_OFS_APPEND,
181 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800182 .name = "file system(nor)",
Michael Hennerichd7e5dd42008-05-07 11:41:26 +0800183 .size = MTDPART_SIZ_FULL,
184 .offset = MTDPART_OFS_APPEND,
185 }
186};
187
188static struct physmap_flash_data ezkit_flash_data = {
189 .width = 2,
190 .parts = ezkit_partitions,
191 .nr_parts = ARRAY_SIZE(ezkit_partitions),
192};
193
194static struct resource ezkit_flash_resource = {
195 .start = 0x20000000,
196 .end = 0x203fffff,
197 .flags = IORESOURCE_MEM,
198};
199
200static struct platform_device ezkit_flash_device = {
201 .name = "physmap-flash",
202 .id = 0,
203 .dev = {
204 .platform_data = &ezkit_flash_data,
205 },
206 .num_resources = 1,
207 .resource = &ezkit_flash_resource,
208};
209#endif
210
Michael Hennerich64307f72007-10-29 16:55:18 +0800211#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
212static struct mtd_partition partition_info[] = {
213 {
Robin Getzaa582972008-08-05 17:47:29 +0800214 .name = "linux kernel(nand)",
Michael Hennerich64307f72007-10-29 16:55:18 +0800215 .offset = 0,
Mike Frysingerf4585a02008-10-13 14:45:21 +0800216 .size = 4 * 1024 * 1024,
Michael Hennerich64307f72007-10-29 16:55:18 +0800217 },
218 {
Robin Getzaa582972008-08-05 17:47:29 +0800219 .name = "file system(nand)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800220 .offset = MTDPART_OFS_APPEND,
221 .size = MTDPART_SIZ_FULL,
Michael Hennerich64307f72007-10-29 16:55:18 +0800222 },
223};
224
225static struct bf5xx_nand_platform bf5xx_nand_platform = {
226 .page_size = NFC_PG_SIZE_256,
227 .data_width = NFC_NWIDTH_8,
228 .partitions = partition_info,
229 .nr_partitions = ARRAY_SIZE(partition_info),
230 .rd_dly = 3,
231 .wr_dly = 3,
232};
233
234static struct resource bf5xx_nand_resources[] = {
235 {
236 .start = NFC_CTL,
237 .end = NFC_DATA_RD + 2,
238 .flags = IORESOURCE_MEM,
239 },
240 {
241 .start = CH_NFC,
242 .end = CH_NFC,
243 .flags = IORESOURCE_IRQ,
244 },
245};
246
247static struct platform_device bf5xx_nand_device = {
248 .name = "bf5xx-nand",
249 .id = 0,
250 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
251 .resource = bf5xx_nand_resources,
252 .dev = {
253 .platform_data = &bf5xx_nand_platform,
254 },
255};
256#endif
257
Michael Hennerich59003142007-10-21 16:54:27 +0800258#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
259static struct resource bfin_pcmcia_cf_resources[] = {
260 {
261 .start = 0x20310000, /* IO PORT */
262 .end = 0x20312000,
263 .flags = IORESOURCE_MEM,
264 }, {
265 .start = 0x20311000, /* Attribute Memory */
266 .end = 0x20311FFF,
267 .flags = IORESOURCE_MEM,
268 }, {
269 .start = IRQ_PF4,
270 .end = IRQ_PF4,
271 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
272 }, {
273 .start = 6, /* Card Detect PF6 */
274 .end = 6,
275 .flags = IORESOURCE_IRQ,
276 },
277};
278
279static struct platform_device bfin_pcmcia_cf_device = {
280 .name = "bfin_cf_pcmcia",
281 .id = -1,
282 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
283 .resource = bfin_pcmcia_cf_resources,
284};
285#endif
286
287#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
288static struct platform_device rtc_device = {
289 .name = "rtc-bfin",
290 .id = -1,
291};
292#endif
293
294#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Michael Hennerich61f09b52009-07-24 08:48:31 +0000295#include <linux/smc91x.h>
296
297static struct smc91x_platdata smc91x_info = {
298 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
299 .leda = RPC_LED_100_10,
300 .ledb = RPC_LED_TX_RX,
301};
302
Michael Hennerich59003142007-10-21 16:54:27 +0800303static struct resource smc91x_resources[] = {
304 {
305 .name = "smc91x-regs",
306 .start = 0x20300300,
307 .end = 0x20300300 + 16,
308 .flags = IORESOURCE_MEM,
309 }, {
310
311 .start = IRQ_PF7,
312 .end = IRQ_PF7,
313 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
314 },
315};
316static struct platform_device smc91x_device = {
317 .name = "smc91x",
318 .id = 0,
319 .num_resources = ARRAY_SIZE(smc91x_resources),
320 .resource = smc91x_resources,
Michael Hennerich61f09b52009-07-24 08:48:31 +0000321 .dev = {
322 .platform_data = &smc91x_info,
323 },
Michael Hennerich59003142007-10-21 16:54:27 +0800324};
325#endif
326
327#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
328static struct resource dm9000_resources[] = {
329 [0] = {
330 .start = 0x203FB800,
Laurent Pinchartda3854f2008-06-24 22:15:58 +0100331 .end = 0x203FB800 + 1,
Michael Hennerich59003142007-10-21 16:54:27 +0800332 .flags = IORESOURCE_MEM,
333 },
334 [1] = {
Laurent Pinchartda3854f2008-06-24 22:15:58 +0100335 .start = 0x203FB800 + 4,
336 .end = 0x203FB800 + 5,
337 .flags = IORESOURCE_MEM,
338 },
339 [2] = {
Michael Hennerich59003142007-10-21 16:54:27 +0800340 .start = IRQ_PF9,
341 .end = IRQ_PF9,
342 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
343 },
344};
345
346static struct platform_device dm9000_device = {
347 .name = "dm9000",
348 .id = -1,
349 .num_resources = ARRAY_SIZE(dm9000_resources),
350 .resource = dm9000_resources,
351};
352#endif
353
354#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
355static struct resource sl811_hcd_resources[] = {
356 {
357 .start = 0x20340000,
358 .end = 0x20340000,
359 .flags = IORESOURCE_MEM,
360 }, {
361 .start = 0x20340004,
362 .end = 0x20340004,
363 .flags = IORESOURCE_MEM,
364 }, {
365 .start = CONFIG_USB_SL811_BFIN_IRQ,
366 .end = CONFIG_USB_SL811_BFIN_IRQ,
367 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
368 },
369};
370
371#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
372void sl811_port_power(struct device *dev, int is_on)
373{
374 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
Michael Hennerichacbcd262008-01-22 18:36:20 +0800375 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
Michael Hennerich59003142007-10-21 16:54:27 +0800376}
377#endif
378
379static struct sl811_platform_data sl811_priv = {
380 .potpg = 10,
381 .power = 250, /* == 500mA */
382#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
383 .port_power = &sl811_port_power,
384#endif
385};
386
387static struct platform_device sl811_hcd_device = {
388 .name = "sl811-hcd",
389 .id = 0,
390 .dev = {
391 .platform_data = &sl811_priv,
392 },
393 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
394 .resource = sl811_hcd_resources,
395};
396#endif
397
398#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
399static struct resource isp1362_hcd_resources[] = {
400 {
401 .start = 0x20360000,
402 .end = 0x20360000,
403 .flags = IORESOURCE_MEM,
404 }, {
405 .start = 0x20360004,
406 .end = 0x20360004,
407 .flags = IORESOURCE_MEM,
408 }, {
409 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
410 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
411 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
412 },
413};
414
415static struct isp1362_platform_data isp1362_priv = {
416 .sel15Kres = 1,
417 .clknotstop = 0,
418 .oc_enable = 0,
419 .int_act_high = 0,
420 .int_edge_triggered = 0,
421 .remote_wakeup_connected = 0,
422 .no_power_switching = 1,
423 .power_switching_mode = 0,
424};
425
426static struct platform_device isp1362_hcd_device = {
427 .name = "isp1362-hcd",
428 .id = 0,
429 .dev = {
430 .platform_data = &isp1362_priv,
431 },
432 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
433 .resource = isp1362_hcd_resources,
434};
435#endif
436
437#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800438static struct platform_device bfin_mii_bus = {
439 .name = "bfin_mii_bus",
440};
441
Michael Hennerich59003142007-10-21 16:54:27 +0800442static struct platform_device bfin_mac_device = {
443 .name = "bfin_mac",
Graf Yang65319622009-02-04 16:49:45 +0800444 .dev.platform_data = &bfin_mii_bus,
Michael Hennerich59003142007-10-21 16:54:27 +0800445};
446#endif
447
448#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
449static struct resource net2272_bfin_resources[] = {
450 {
451 .start = 0x20300000,
452 .end = 0x20300000 + 0x100,
453 .flags = IORESOURCE_MEM,
454 }, {
455 .start = IRQ_PF7,
456 .end = IRQ_PF7,
457 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
458 },
459};
460
461static struct platform_device net2272_bfin_device = {
462 .name = "net2272",
463 .id = -1,
464 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
465 .resource = net2272_bfin_resources,
466};
467#endif
468
Michael Hennerich59003142007-10-21 16:54:27 +0800469#if defined(CONFIG_MTD_M25P80) \
470 || defined(CONFIG_MTD_M25P80_MODULE)
471static struct mtd_partition bfin_spi_flash_partitions[] = {
472 {
Robin Getzaa582972008-08-05 17:47:29 +0800473 .name = "bootloader(spi)",
Grace Panac76d882008-04-24 06:33:56 +0800474 .size = 0x00040000,
Michael Hennerich59003142007-10-21 16:54:27 +0800475 .offset = 0,
476 .mask_flags = MTD_CAP_ROM
477 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800478 .name = "linux kernel(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800479 .size = MTDPART_SIZ_FULL,
480 .offset = MTDPART_OFS_APPEND,
Michael Hennerich59003142007-10-21 16:54:27 +0800481 }
482};
483
484static struct flash_platform_data bfin_spi_flash_data = {
485 .name = "m25p80",
486 .parts = bfin_spi_flash_partitions,
487 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
Michael Hennerichb9c9e782008-05-07 11:41:26 +0800488 .type = "m25p16",
Michael Hennerich59003142007-10-21 16:54:27 +0800489};
490
491/* SPI flash chip (m25p64) */
492static struct bfin5xx_spi_chip spi_flash_chip_info = {
493 .enable_dma = 0, /* use dma transfer with this chip*/
494 .bits_per_word = 8,
495};
496#endif
497
Mike Frysingera261eec2009-05-20 14:05:36 +0000498#if defined(CONFIG_BFIN_SPI_ADC) \
499 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Michael Hennerich59003142007-10-21 16:54:27 +0800500/* SPI ADC chip */
501static struct bfin5xx_spi_chip spi_adc_chip_info = {
502 .enable_dma = 1, /* use dma transfer with this chip*/
503 .bits_per_word = 16,
504};
505#endif
506
507#if defined(CONFIG_SND_BLACKFIN_AD1836) \
508 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
509static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
510 .enable_dma = 0,
511 .bits_per_word = 16,
512};
513#endif
514
515#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
516static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
517 .enable_dma = 0,
518 .bits_per_word = 16,
519};
520#endif
521
Yi Liffdf3ec2009-03-31 10:36:51 +0000522#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
523static struct bfin5xx_spi_chip mmc_spi_chip_info = {
524 .enable_dma = 0,
525 .bits_per_word = 8,
526};
527#endif
528
Michael Hennerich59003142007-10-21 16:54:27 +0800529#if defined(CONFIG_PBX)
530static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
531 .ctl_reg = 0x4, /* send zero */
532 .enable_dma = 0,
533 .bits_per_word = 8,
534 .cs_change_per_word = 1,
535};
536#endif
537
Michael Hennerich59003142007-10-21 16:54:27 +0800538#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
539static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
540 .enable_dma = 0,
541 .bits_per_word = 16,
542};
543
544static const struct ad7877_platform_data bfin_ad7877_ts_info = {
545 .model = 7877,
546 .vref_delay_usecs = 50, /* internal, no capacitor */
547 .x_plate_ohms = 419,
548 .y_plate_ohms = 486,
549 .pressure_max = 1000,
550 .pressure_min = 0,
551 .stopacq_polarity = 1,
552 .first_conversion_delay = 3,
553 .acquisition_time = 1,
554 .averaging = 1,
555 .pen_down_acc_interval = 1,
556};
557#endif
558
Michael Hennerich51054322009-01-07 23:14:38 +0800559#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
560#include <linux/spi/ad7879.h>
561static const struct ad7879_platform_data bfin_ad7879_ts_info = {
562 .model = 7879, /* Model = AD7879 */
563 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
564 .pressure_max = 10000,
565 .pressure_min = 0,
566 .first_conversion_delay = 3, /* wait 512us before do a first conversion */
567 .acquisition_time = 1, /* 4us acquisition time per sample */
568 .median = 2, /* do 8 measurements */
569 .averaging = 1, /* take the average of 4 middle samples */
570 .pen_down_acc_interval = 255, /* 9.4 ms */
571 .gpio_output = 1, /* configure AUX/VBAT/GPIO as GPIO output */
572 .gpio_default = 1, /* During initialization set GPIO = HIGH */
573};
574#endif
575
576#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
577static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
578 .enable_dma = 0,
579 .bits_per_word = 16,
580};
581#endif
582
Michael Hennerichc7d48962007-11-15 21:33:31 +0800583#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
Michael Hennerich0954f702007-11-13 00:16:19 +0800584 && defined(CONFIG_SND_SOC_WM8731_SPI)
585static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
586 .enable_dma = 0,
587 .bits_per_word = 16,
588};
589#endif
Michael Hennerich6e668932008-02-09 01:54:09 +0800590
591#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
592static struct bfin5xx_spi_chip spidev_chip_info = {
593 .enable_dma = 0,
594 .bits_per_word = 8,
595};
596#endif
597
Michael Hennerich59003142007-10-21 16:54:27 +0800598static struct spi_board_info bfin_spi_board_info[] __initdata = {
599#if defined(CONFIG_MTD_M25P80) \
600 || defined(CONFIG_MTD_M25P80_MODULE)
601 {
602 /* the modalias must be the same as spi device driver name */
603 .modalias = "m25p80", /* Name of spi_driver for this device */
604 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
605 .bus_num = 0, /* Framework bus number */
606 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
607 .platform_data = &bfin_spi_flash_data,
608 .controller_data = &spi_flash_chip_info,
609 .mode = SPI_MODE_3,
610 },
611#endif
612
Mike Frysingera261eec2009-05-20 14:05:36 +0000613#if defined(CONFIG_BFIN_SPI_ADC) \
614 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Michael Hennerich59003142007-10-21 16:54:27 +0800615 {
616 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
617 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
618 .bus_num = 0, /* Framework bus number */
619 .chip_select = 1, /* Framework chip select. */
620 .platform_data = NULL, /* No spi_driver specific config */
621 .controller_data = &spi_adc_chip_info,
622 },
623#endif
624
625#if defined(CONFIG_SND_BLACKFIN_AD1836) \
626 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
627 {
628 .modalias = "ad1836-spi",
629 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
630 .bus_num = 0,
631 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
632 .controller_data = &ad1836_spi_chip_info,
633 },
634#endif
635#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
636 {
637 .modalias = "ad9960-spi",
638 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
639 .bus_num = 0,
640 .chip_select = 1,
641 .controller_data = &ad9960_spi_chip_info,
642 },
643#endif
Yi Liffdf3ec2009-03-31 10:36:51 +0000644#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
645 {
646 .modalias = "mmc_spi",
647 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
648 .bus_num = 0,
649 .chip_select = 3,
650 .controller_data = &mmc_spi_chip_info,
651 .mode = SPI_MODE_0,
652 },
653#endif
654
Michael Hennerich59003142007-10-21 16:54:27 +0800655#if defined(CONFIG_PBX)
656 {
657 .modalias = "fxs-spi",
658 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
659 .bus_num = 0,
660 .chip_select = 8 - CONFIG_J11_JUMPER,
661 .controller_data = &spi_si3xxx_chip_info,
662 .mode = SPI_MODE_3,
663 },
664 {
665 .modalias = "fxo-spi",
666 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
667 .bus_num = 0,
668 .chip_select = 8 - CONFIG_J19_JUMPER,
669 .controller_data = &spi_si3xxx_chip_info,
670 .mode = SPI_MODE_3,
671 },
672#endif
Michael Hennerich59003142007-10-21 16:54:27 +0800673#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
674 {
675 .modalias = "ad7877",
676 .platform_data = &bfin_ad7877_ts_info,
Bryan Wu2eb74ae2008-05-31 15:17:25 +0800677 .irq = IRQ_PF8,
Michael Hennerich59003142007-10-21 16:54:27 +0800678 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Michael Hennerich0954f702007-11-13 00:16:19 +0800679 .bus_num = 0,
Bryan Wu2eb74ae2008-05-31 15:17:25 +0800680 .chip_select = 2,
Michael Hennerich59003142007-10-21 16:54:27 +0800681 .controller_data = &spi_ad7877_chip_info,
682 },
683#endif
Michael Hennerich51054322009-01-07 23:14:38 +0800684#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
685 {
686 .modalias = "ad7879",
687 .platform_data = &bfin_ad7879_ts_info,
688 .irq = IRQ_PF8,
689 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
690 .bus_num = 0,
691 .chip_select = 3,
692 .controller_data = &spi_ad7879_chip_info,
693 .mode = SPI_CPHA | SPI_CPOL,
694 },
695#endif
Michael Hennerichc7d48962007-11-15 21:33:31 +0800696#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
Michael Hennerich0954f702007-11-13 00:16:19 +0800697 && defined(CONFIG_SND_SOC_WM8731_SPI)
698 {
699 .modalias = "wm8731",
700 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
701 .bus_num = 0,
702 .chip_select = 5,
703 .controller_data = &spi_wm8731_chip_info,
704 .mode = SPI_MODE_0,
705 },
706#endif
Michael Hennerich6e668932008-02-09 01:54:09 +0800707#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
708 {
709 .modalias = "spidev",
710 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
711 .bus_num = 0,
712 .chip_select = 1,
713 .controller_data = &spidev_chip_info,
714 },
715#endif
Michael Hennerich59003142007-10-21 16:54:27 +0800716};
717
Mike Frysinger5bda2722008-06-07 15:03:01 +0800718#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Michael Hennerich59003142007-10-21 16:54:27 +0800719/* SPI controller data */
720static struct bfin5xx_spi_master bfin_spi0_info = {
721 .num_chipselect = 8,
722 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800723 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Michael Hennerich59003142007-10-21 16:54:27 +0800724};
725
726/* SPI (0) */
727static struct resource bfin_spi0_resource[] = {
728 [0] = {
729 .start = SPI0_REGBASE,
730 .end = SPI0_REGBASE + 0xFF,
731 .flags = IORESOURCE_MEM,
732 },
733 [1] = {
734 .start = CH_SPI,
735 .end = CH_SPI,
Yi Li53122692009-06-05 12:11:11 +0000736 .flags = IORESOURCE_DMA,
737 },
738 [2] = {
739 .start = IRQ_SPI,
740 .end = IRQ_SPI,
Michael Hennerich59003142007-10-21 16:54:27 +0800741 .flags = IORESOURCE_IRQ,
742 },
743};
744
745static struct platform_device bfin_spi0_device = {
746 .name = "bfin-spi",
747 .id = 0, /* Bus number */
748 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
749 .resource = bfin_spi0_resource,
750 .dev = {
751 .platform_data = &bfin_spi0_info, /* Passed to driver */
752 },
753};
754#endif /* spi master and devices */
755
756#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
757static struct platform_device bfin_fb_device = {
758 .name = "bf537-lq035",
759};
760#endif
761
762#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
763static struct platform_device bfin_fb_adv7393_device = {
764 .name = "bfin-adv7393",
765};
766#endif
767
768#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
769static struct resource bfin_uart_resources[] = {
770#ifdef CONFIG_SERIAL_BFIN_UART0
771 {
772 .start = 0xFFC00400,
773 .end = 0xFFC004FF,
774 .flags = IORESOURCE_MEM,
775 },
776#endif
777#ifdef CONFIG_SERIAL_BFIN_UART1
778 {
779 .start = 0xFFC02000,
780 .end = 0xFFC020FF,
781 .flags = IORESOURCE_MEM,
782 },
783#endif
784};
785
786static struct platform_device bfin_uart_device = {
787 .name = "bfin-uart",
788 .id = 1,
789 .num_resources = ARRAY_SIZE(bfin_uart_resources),
790 .resource = bfin_uart_resources,
791};
792#endif
793
Graf Yang5be36d22008-04-25 03:09:15 +0800794#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +0800795#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800796static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800797 {
798 .start = 0xFFC00400,
799 .end = 0xFFC004FF,
800 .flags = IORESOURCE_MEM,
801 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800802 {
803 .start = IRQ_UART0_RX,
804 .end = IRQ_UART0_RX+1,
805 .flags = IORESOURCE_IRQ,
806 },
807 {
808 .start = CH_UART0_RX,
809 .end = CH_UART0_RX+1,
810 .flags = IORESOURCE_DMA,
811 },
812};
813
814static struct platform_device bfin_sir0_device = {
815 .name = "bfin_sir",
816 .id = 0,
817 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
818 .resource = bfin_sir0_resources,
819};
Graf Yang5be36d22008-04-25 03:09:15 +0800820#endif
821#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +0800822static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800823 {
824 .start = 0xFFC02000,
825 .end = 0xFFC020FF,
826 .flags = IORESOURCE_MEM,
827 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800828 {
829 .start = IRQ_UART1_RX,
830 .end = IRQ_UART1_RX+1,
831 .flags = IORESOURCE_IRQ,
832 },
833 {
834 .start = CH_UART1_RX,
835 .end = CH_UART1_RX+1,
836 .flags = IORESOURCE_DMA,
837 },
Graf Yang5be36d22008-04-25 03:09:15 +0800838};
839
Graf Yang42bd8bc2009-01-07 23:14:39 +0800840static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800841 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +0800842 .id = 1,
843 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
844 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800845};
846#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800847#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800848
Michael Hennerich59003142007-10-21 16:54:27 +0800849#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
850static struct resource bfin_twi0_resource[] = {
851 [0] = {
852 .start = TWI0_REGBASE,
853 .end = TWI0_REGBASE,
854 .flags = IORESOURCE_MEM,
855 },
856 [1] = {
857 .start = IRQ_TWI,
858 .end = IRQ_TWI,
859 .flags = IORESOURCE_IRQ,
860 },
861};
862
863static struct platform_device i2c_bfin_twi_device = {
864 .name = "i2c-bfin-twi",
865 .id = 0,
866 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
867 .resource = bfin_twi0_resource,
868};
869#endif
870
Bryan Wu72268682008-05-07 11:41:26 +0800871static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
Michael Hennerichebd58332009-07-02 11:00:38 +0000872#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
Bryan Wu72268682008-05-07 11:41:26 +0800873 {
874 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
Bryan Wu72268682008-05-07 11:41:26 +0800875 },
876#endif
Michael Hennerich204844e2009-06-30 14:57:22 +0000877#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
Bryan Wu72268682008-05-07 11:41:26 +0800878 {
879 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
Bryan Wu72268682008-05-07 11:41:26 +0800880 .irq = IRQ_PF8,
881 },
882#endif
883};
Bryan Wu72268682008-05-07 11:41:26 +0800884
Michael Hennerich59003142007-10-21 16:54:27 +0800885#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
886static struct platform_device bfin_sport0_uart_device = {
887 .name = "bfin-sport-uart",
888 .id = 0,
889};
890
891static struct platform_device bfin_sport1_uart_device = {
892 .name = "bfin-sport-uart",
893 .id = 1,
894};
895#endif
896
Michael Hennerich1089e222007-12-24 11:49:29 +0800897#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
898#include <linux/input.h>
899#include <linux/gpio_keys.h>
900
901static struct gpio_keys_button bfin_gpio_keys_table[] = {
902 {BTN_0, GPIO_PG0, 1, "gpio-keys: BTN0"},
903 {BTN_1, GPIO_PG13, 1, "gpio-keys: BTN1"},
904};
905
906static struct gpio_keys_platform_data bfin_gpio_keys_data = {
907 .buttons = bfin_gpio_keys_table,
908 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
909};
910
911static struct platform_device bfin_device_gpiokeys = {
912 .name = "gpio-keys",
913 .dev = {
914 .platform_data = &bfin_gpio_keys_data,
915 },
916};
917#endif
918
Michael Hennerichaca5e4a2008-10-08 14:27:59 +0800919#if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
920#include <linux/input.h>
921#include <asm/bfin_rotary.h>
922
923static struct bfin_rotary_platform_data bfin_rotary_data = {
924 /*.rotary_up_key = KEY_UP,*/
925 /*.rotary_down_key = KEY_DOWN,*/
926 .rotary_rel_code = REL_WHEEL,
927 .rotary_button_key = KEY_ENTER,
928 .debounce = 10, /* 0..17 */
929 .mode = ROT_QUAD_ENC | ROT_DEBE,
930};
931
932static struct resource bfin_rotary_resources[] = {
933 {
934 .start = IRQ_CNT,
935 .end = IRQ_CNT,
936 .flags = IORESOURCE_IRQ,
937 },
938};
939
940static struct platform_device bfin_rotary_device = {
941 .name = "bfin-rotary",
942 .id = -1,
943 .num_resources = ARRAY_SIZE(bfin_rotary_resources),
944 .resource = bfin_rotary_resources,
945 .dev = {
946 .platform_data = &bfin_rotary_data,
947 },
948};
949#endif
950
Mike Frysingercad2ab62008-02-22 17:01:31 +0800951static struct resource bfin_gpios_resources = {
952 .start = 0,
953 .end = MAX_BLACKFIN_GPIOS - 1,
954 .flags = IORESOURCE_IRQ,
955};
956
957static struct platform_device bfin_gpios_device = {
958 .name = "simple-gpio",
959 .id = -1,
960 .num_resources = 1,
961 .resource = &bfin_gpios_resources,
962};
963
Michael Hennerich14b03202008-05-07 11:41:26 +0800964static const unsigned int cclk_vlev_datasheet[] =
965{
966 VRPAIR(VLEV_100, 400000000),
967 VRPAIR(VLEV_105, 426000000),
968 VRPAIR(VLEV_110, 500000000),
969 VRPAIR(VLEV_115, 533000000),
970 VRPAIR(VLEV_120, 600000000),
971};
972
973static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
974 .tuple_tab = cclk_vlev_datasheet,
975 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
976 .vr_settling_time = 25 /* us */,
977};
978
979static struct platform_device bfin_dpmc = {
980 .name = "bfin dpmc",
981 .dev = {
982 .platform_data = &bfin_dmpc_vreg_data,
983 },
984};
985
Michael Hennerich59003142007-10-21 16:54:27 +0800986static struct platform_device *stamp_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +0800987
988 &bfin_dpmc,
989
Michael Hennerich64307f72007-10-29 16:55:18 +0800990#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
991 &bf5xx_nand_device,
992#endif
993
Michael Hennerich59003142007-10-21 16:54:27 +0800994#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
995 &bfin_pcmcia_cf_device,
996#endif
997
998#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
999 &rtc_device,
1000#endif
1001
1002#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
1003 &sl811_hcd_device,
1004#endif
1005
1006#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
1007 &isp1362_hcd_device,
1008#endif
1009
Michael Hennerich3f375692008-11-18 17:48:22 +08001010#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1011 &bfin_isp1760_device,
1012#endif
1013
Michael Hennerich1089e222007-12-24 11:49:29 +08001014#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
1015 &musb_device,
1016#endif
1017
Michael Hennerich59003142007-10-21 16:54:27 +08001018#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
1019 &smc91x_device,
1020#endif
1021
1022#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
1023 &dm9000_device,
1024#endif
1025
1026#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +08001027 &bfin_mii_bus,
Michael Hennerich59003142007-10-21 16:54:27 +08001028 &bfin_mac_device,
1029#endif
1030
1031#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
1032 &net2272_bfin_device,
1033#endif
1034
1035#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1036 &bfin_spi0_device,
1037#endif
1038
1039#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1040 &bfin_fb_device,
1041#endif
1042
Michael Hennerich1089e222007-12-24 11:49:29 +08001043#if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
1044 &bf52x_t350mcqb_device,
1045#endif
1046
Michael Hennerich59003142007-10-21 16:54:27 +08001047#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
1048 &bfin_fb_adv7393_device,
1049#endif
1050
1051#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1052 &bfin_uart_device,
1053#endif
1054
Graf Yang5be36d22008-04-25 03:09:15 +08001055#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +08001056#ifdef CONFIG_BFIN_SIR0
1057 &bfin_sir0_device,
1058#endif
1059#ifdef CONFIG_BFIN_SIR1
1060 &bfin_sir1_device,
1061#endif
Graf Yang5be36d22008-04-25 03:09:15 +08001062#endif
1063
Michael Hennerich59003142007-10-21 16:54:27 +08001064#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1065 &i2c_bfin_twi_device,
1066#endif
1067
1068#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1069 &bfin_sport0_uart_device,
1070 &bfin_sport1_uart_device,
1071#endif
1072
Michael Hennerich1089e222007-12-24 11:49:29 +08001073#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1074 &bfin_device_gpiokeys,
1075#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +08001076
Michael Hennerichaca5e4a2008-10-08 14:27:59 +08001077#if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
1078 &bfin_rotary_device,
1079#endif
1080
Michael Hennerichd7e5dd42008-05-07 11:41:26 +08001081#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1082 &ezkit_flash_device,
1083#endif
1084
Mike Frysingercad2ab62008-02-22 17:01:31 +08001085 &bfin_gpios_device,
Michael Hennerich59003142007-10-21 16:54:27 +08001086};
1087
Mike Frysinger7f6678c2009-02-04 16:49:45 +08001088static int __init ezkit_init(void)
Michael Hennerich59003142007-10-21 16:54:27 +08001089{
Harvey Harrisonb85d8582008-04-23 09:39:01 +08001090 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu72268682008-05-07 11:41:26 +08001091 i2c_register_board_info(0, bfin_i2c_board_info,
1092 ARRAY_SIZE(bfin_i2c_board_info));
Michael Hennerich59003142007-10-21 16:54:27 +08001093 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
Mike Frysinger5bda2722008-06-07 15:03:01 +08001094 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
Michael Hennerich59003142007-10-21 16:54:27 +08001095 return 0;
1096}
1097
Mike Frysinger7f6678c2009-02-04 16:49:45 +08001098arch_initcall(ezkit_init);
Michael Hennerich59003142007-10-21 16:54:27 +08001099
1100void native_machine_restart(char *cmd)
1101{
1102 /* workaround reboot hang when booting from SPI */
1103 if ((bfin_read_SYSCR() & 0x7) == 0x3)
Sonic Zhangb52dae32009-02-04 16:49:45 +08001104 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
Michael Hennerich59003142007-10-21 16:54:27 +08001105}
Mike Frysinger137b1522007-11-22 16:07:03 +08001106
Mike Frysinger9862cc52007-11-15 21:21:20 +08001107void bfin_get_ether_addr(char *addr)
Mike Frysinger137b1522007-11-22 16:07:03 +08001108{
Mike Frysinger181afa942008-02-25 11:42:17 +08001109 /* the MAC is stored in OTP memory page 0xDF */
1110 u32 ret;
1111 u64 otp_mac;
1112 u32 (*otp_read)(u32 page, u32 flags, u64 *page_content) = (void *)0xEF00001A;
1113
1114 ret = otp_read(0xDF, 0x00, &otp_mac);
1115 if (!(ret & 0x1)) {
1116 char *otp_mac_p = (char *)&otp_mac;
1117 for (ret = 0; ret < 6; ++ret)
1118 addr[ret] = otp_mac_p[5 - ret];
1119 }
Mike Frysinger137b1522007-11-22 16:07:03 +08001120}
Mike Frysinger9862cc52007-11-15 21:21:20 +08001121EXPORT_SYMBOL(bfin_get_ether_addr);