blob: 7a1d645bbfbbb677c496faf944fb5b4a38269717 [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
Robin Getz96f10502009-09-24 14:11:24 +00002 * Copyright 2004-2009 Analog Devices Inc.
3 * 2005 National ICT Australia (NICTA)
4 * Aidan Williams <aidan@nicta.com.au>
Bryan Wu1394f032007-05-06 14:50:22 -07005 *
Robin Getz96f10502009-09-24 14:11:24 +00006 * Licensed under the GPL-2 or later.
Bryan Wu1394f032007-05-06 14:50:22 -07007 */
8
9#include <linux/device.h>
Mike Frysingerfc689112008-06-25 11:41:42 +080010#include <linux/kernel.h>
Bryan Wu1394f032007-05-06 14:50:22 -070011#include <linux/platform_device.h>
Barry Song6e364752009-09-29 03:01:40 +000012#include <linux/io.h>
Bryan Wu1394f032007-05-06 14:50:22 -070013#include <linux/mtd/mtd.h>
Mike Frysingerfc689112008-06-25 11:41:42 +080014#include <linux/mtd/nand.h>
Bryan Wu1394f032007-05-06 14:50:22 -070015#include <linux/mtd/partitions.h>
Mike Frysingerfc689112008-06-25 11:41:42 +080016#include <linux/mtd/plat-ram.h>
Mike Frysingerde8c43f2008-01-24 17:14:04 +080017#include <linux/mtd/physmap.h>
Bryan Wu1394f032007-05-06 14:50:22 -070018#include <linux/spi/spi.h>
19#include <linux/spi/flash.h>
20#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
Mike Frysingerf02bcec2007-11-15 21:29:15 +080021#include <linux/usb/isp1362.h>
Bryan Wu1394f032007-05-06 14:50:22 -070022#endif
Sonic Zhang7a9cc482009-12-22 04:47:04 +000023#include <linux/i2c.h>
24#include <linux/i2c/adp5588.h>
Mike Frysinger0531c462010-01-19 07:04:29 +000025#include <linux/etherdevice.h>
Jeff Garzik0a87e3e2008-02-01 18:02:30 -050026#include <linux/ata_platform.h>
Bryan Wu1394f032007-05-06 14:50:22 -070027#include <linux/irq.h>
28#include <linux/interrupt.h>
David Brownell27f5d752007-10-04 18:06:16 -070029#include <linux/usb/sl811.h>
Yi Lif79ea4c2009-01-07 23:14:38 +080030#include <linux/spi/mmc_spi.h>
Michael Hennerich78756c62009-10-13 15:28:33 +000031#include <linux/leds.h>
32#include <linux/input.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080033#include <asm/dma.h>
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080034#include <asm/bfin5xx_spi.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080035#include <asm/reboot.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080036#include <asm/portmux.h>
Michael Hennerich14b03202008-05-07 11:41:26 +080037#include <asm/dpmc.h>
Bryan Wu1394f032007-05-06 14:50:22 -070038
39/*
40 * Name the Board for the /proc/cpuinfo
41 */
Mike Frysingerfe85cad2008-11-18 17:48:22 +080042const char bfin_board_name[] = "ADI BF537-STAMP";
Bryan Wu1394f032007-05-06 14:50:22 -070043
44/*
45 * Driver needs to know address, irq and flag pin.
46 */
47
Bryan Wu1394f032007-05-06 14:50:22 -070048#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
Michael Hennerich3f375692008-11-18 17:48:22 +080049#include <linux/usb/isp1760.h>
50static struct resource bfin_isp1760_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -070051 [0] = {
Michael Hennerich3f375692008-11-18 17:48:22 +080052 .start = 0x203C0000,
53 .end = 0x203C0000 + 0x000fffff,
Bryan Wu1394f032007-05-06 14:50:22 -070054 .flags = IORESOURCE_MEM,
55 },
56 [1] = {
Michael Hennerich3f375692008-11-18 17:48:22 +080057 .start = IRQ_PF7,
58 .end = IRQ_PF7,
Michael Hennerich6a6be3d2009-01-07 23:14:39 +080059 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
Bryan Wu1394f032007-05-06 14:50:22 -070060 },
61};
62
Michael Hennerich3f375692008-11-18 17:48:22 +080063static struct isp1760_platform_data isp1760_priv = {
64 .is_isp1761 = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080065 .bus_width_16 = 1,
66 .port1_otg = 0,
67 .analog_oc = 0,
68 .dack_polarity_high = 0,
69 .dreq_polarity_high = 0,
70};
71
72static struct platform_device bfin_isp1760_device = {
Michael Hennerichc6feb762009-10-15 10:37:33 +000073 .name = "isp1760",
Bryan Wu1394f032007-05-06 14:50:22 -070074 .id = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080075 .dev = {
76 .platform_data = &isp1760_priv,
77 },
78 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
79 .resource = bfin_isp1760_resources,
Bryan Wu1394f032007-05-06 14:50:22 -070080};
Bryan Wu1394f032007-05-06 14:50:22 -070081#endif
82
Michael Hennerich2463ef22008-01-27 16:49:48 +080083#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
Michael Hennerich2463ef22008-01-27 16:49:48 +080084#include <linux/gpio_keys.h>
85
86static struct gpio_keys_button bfin_gpio_keys_table[] = {
87 {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"},
88 {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"},
89 {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"},
90 {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"},
91};
92
93static struct gpio_keys_platform_data bfin_gpio_keys_data = {
94 .buttons = bfin_gpio_keys_table,
95 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
96};
97
98static struct platform_device bfin_device_gpiokeys = {
99 .name = "gpio-keys",
100 .dev = {
101 .platform_data = &bfin_gpio_keys_data,
102 },
103};
104#endif
105
Bryan Wu1394f032007-05-06 14:50:22 -0700106#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
107static struct resource bfin_pcmcia_cf_resources[] = {
108 {
109 .start = 0x20310000, /* IO PORT */
110 .end = 0x20312000,
111 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800112 }, {
Simon Arlottd2d50aa2007-06-11 15:31:30 +0800113 .start = 0x20311000, /* Attribute Memory */
Bryan Wu1394f032007-05-06 14:50:22 -0700114 .end = 0x20311FFF,
115 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800116 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700117 .start = IRQ_PF4,
118 .end = IRQ_PF4,
119 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800120 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700121 .start = 6, /* Card Detect PF6 */
122 .end = 6,
123 .flags = IORESOURCE_IRQ,
124 },
125};
126
127static struct platform_device bfin_pcmcia_cf_device = {
128 .name = "bfin_cf_pcmcia",
129 .id = -1,
130 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
131 .resource = bfin_pcmcia_cf_resources,
132};
133#endif
134
135#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
136static struct platform_device rtc_device = {
137 .name = "rtc-bfin",
138 .id = -1,
139};
140#endif
141
142#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Michael Hennerich61f09b52009-07-24 08:48:31 +0000143#include <linux/smc91x.h>
144
145static struct smc91x_platdata smc91x_info = {
146 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
147 .leda = RPC_LED_100_10,
148 .ledb = RPC_LED_TX_RX,
149};
150
Bryan Wu1394f032007-05-06 14:50:22 -0700151static struct resource smc91x_resources[] = {
152 {
153 .name = "smc91x-regs",
154 .start = 0x20300300,
155 .end = 0x20300300 + 16,
156 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800157 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700158
159 .start = IRQ_PF7,
160 .end = IRQ_PF7,
161 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
162 },
163};
164static struct platform_device smc91x_device = {
165 .name = "smc91x",
166 .id = 0,
167 .num_resources = ARRAY_SIZE(smc91x_resources),
168 .resource = smc91x_resources,
Michael Hennerich61f09b52009-07-24 08:48:31 +0000169 .dev = {
170 .platform_data = &smc91x_info,
171 },
Bryan Wu1394f032007-05-06 14:50:22 -0700172};
173#endif
174
Alex Landauf40d24d2007-07-12 12:11:48 +0800175#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
176static struct resource dm9000_resources[] = {
177 [0] = {
178 .start = 0x203FB800,
Barry Songb3dec4a2009-07-27 06:42:50 +0000179 .end = 0x203FB800 + 1,
Alex Landauf40d24d2007-07-12 12:11:48 +0800180 .flags = IORESOURCE_MEM,
181 },
182 [1] = {
Barry Songb3dec4a2009-07-27 06:42:50 +0000183 .start = 0x203FB804,
184 .end = 0x203FB804 + 1,
185 .flags = IORESOURCE_MEM,
186 },
187 [2] = {
Alex Landauf40d24d2007-07-12 12:11:48 +0800188 .start = IRQ_PF9,
189 .end = IRQ_PF9,
190 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
191 },
192};
193
194static struct platform_device dm9000_device = {
195 .name = "dm9000",
196 .id = -1,
197 .num_resources = ARRAY_SIZE(dm9000_resources),
198 .resource = dm9000_resources,
199};
200#endif
201
Bryan Wu1394f032007-05-06 14:50:22 -0700202#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
203static struct resource sl811_hcd_resources[] = {
204 {
205 .start = 0x20340000,
206 .end = 0x20340000,
207 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800208 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700209 .start = 0x20340004,
210 .end = 0x20340004,
211 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800212 }, {
Mike Frysinger01218652009-12-21 15:07:43 +0000213 .start = IRQ_PF4,
214 .end = IRQ_PF4,
Bryan Wu1394f032007-05-06 14:50:22 -0700215 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
216 },
217};
218
219#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
220void sl811_port_power(struct device *dev, int is_on)
221{
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800222 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
Michael Hennerichacbcd262008-01-22 18:36:20 +0800223 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
Bryan Wu1394f032007-05-06 14:50:22 -0700224}
225#endif
226
227static struct sl811_platform_data sl811_priv = {
228 .potpg = 10,
229 .power = 250, /* == 500mA */
230#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
231 .port_power = &sl811_port_power,
232#endif
233};
234
235static struct platform_device sl811_hcd_device = {
236 .name = "sl811-hcd",
237 .id = 0,
238 .dev = {
239 .platform_data = &sl811_priv,
240 },
241 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
242 .resource = sl811_hcd_resources,
243};
244#endif
245
246#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
247static struct resource isp1362_hcd_resources[] = {
248 {
249 .start = 0x20360000,
250 .end = 0x20360000,
251 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800252 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700253 .start = 0x20360004,
254 .end = 0x20360004,
255 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800256 }, {
Mike Frysinger21b03cf2009-09-24 05:44:36 +0000257 .start = IRQ_PF3,
258 .end = IRQ_PF3,
Bryan Wu1394f032007-05-06 14:50:22 -0700259 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
260 },
261};
262
263static struct isp1362_platform_data isp1362_priv = {
264 .sel15Kres = 1,
265 .clknotstop = 0,
266 .oc_enable = 0,
267 .int_act_high = 0,
268 .int_edge_triggered = 0,
269 .remote_wakeup_connected = 0,
270 .no_power_switching = 1,
271 .power_switching_mode = 0,
272};
273
274static struct platform_device isp1362_hcd_device = {
275 .name = "isp1362-hcd",
276 .id = 0,
277 .dev = {
278 .platform_data = &isp1362_priv,
279 },
280 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
281 .resource = isp1362_hcd_resources,
282};
283#endif
284
Barry Song706a01b2009-11-02 07:29:07 +0000285#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
286unsigned short bfin_can_peripherals[] = {
287 P_CAN0_RX, P_CAN0_TX, 0
288};
289
290static struct resource bfin_can_resources[] = {
291 {
292 .start = 0xFFC02A00,
293 .end = 0xFFC02FFF,
294 .flags = IORESOURCE_MEM,
295 },
296 {
297 .start = IRQ_CAN_RX,
298 .end = IRQ_CAN_RX,
299 .flags = IORESOURCE_IRQ,
300 },
301 {
302 .start = IRQ_CAN_TX,
303 .end = IRQ_CAN_TX,
304 .flags = IORESOURCE_IRQ,
305 },
306 {
307 .start = IRQ_CAN_ERROR,
308 .end = IRQ_CAN_ERROR,
309 .flags = IORESOURCE_IRQ,
310 },
311};
312
313static struct platform_device bfin_can_device = {
314 .name = "bfin_can",
315 .num_resources = ARRAY_SIZE(bfin_can_resources),
316 .resource = bfin_can_resources,
317 .dev = {
318 .platform_data = &bfin_can_peripherals, /* Passed to driver */
319 },
320};
321#endif
322
Bryan Wu1394f032007-05-06 14:50:22 -0700323#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800324static struct platform_device bfin_mii_bus = {
325 .name = "bfin_mii_bus",
326};
327
Bryan Wu1394f032007-05-06 14:50:22 -0700328static struct platform_device bfin_mac_device = {
329 .name = "bfin_mac",
Graf Yang65319622009-02-04 16:49:45 +0800330 .dev.platform_data = &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700331};
332#endif
333
334#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
335static struct resource net2272_bfin_resources[] = {
336 {
337 .start = 0x20300000,
338 .end = 0x20300000 + 0x100,
339 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800340 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700341 .start = IRQ_PF7,
342 .end = IRQ_PF7,
343 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
344 },
345};
346
347static struct platform_device net2272_bfin_device = {
348 .name = "net2272",
349 .id = -1,
350 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
351 .resource = net2272_bfin_resources,
352};
353#endif
354
Mike Frysingerfc689112008-06-25 11:41:42 +0800355#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
356#ifdef CONFIG_MTD_PARTITIONS
357const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
358
359static struct mtd_partition bfin_plat_nand_partitions[] = {
360 {
Robin Getzaa582972008-08-05 17:47:29 +0800361 .name = "linux kernel(nand)",
Mike Frysingerfc689112008-06-25 11:41:42 +0800362 .size = 0x400000,
363 .offset = 0,
364 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800365 .name = "file system(nand)",
Mike Frysingerfc689112008-06-25 11:41:42 +0800366 .size = MTDPART_SIZ_FULL,
367 .offset = MTDPART_OFS_APPEND,
368 },
369};
370#endif
371
372#define BFIN_NAND_PLAT_CLE 2
373#define BFIN_NAND_PLAT_ALE 1
374static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
375{
376 struct nand_chip *this = mtd->priv;
377
378 if (cmd == NAND_CMD_NONE)
379 return;
380
381 if (ctrl & NAND_CLE)
382 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));
383 else
384 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));
385}
386
387#define BFIN_NAND_PLAT_READY GPIO_PF3
388static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
389{
390 return gpio_get_value(BFIN_NAND_PLAT_READY);
391}
392
393static struct platform_nand_data bfin_plat_nand_data = {
394 .chip = {
395 .chip_delay = 30,
396#ifdef CONFIG_MTD_PARTITIONS
397 .part_probe_types = part_probes,
398 .partitions = bfin_plat_nand_partitions,
399 .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
400#endif
401 },
402 .ctrl = {
403 .cmd_ctrl = bfin_plat_nand_cmd_ctrl,
404 .dev_ready = bfin_plat_nand_dev_ready,
405 },
406};
407
408#define MAX(x, y) (x > y ? x : y)
409static struct resource bfin_plat_nand_resources = {
410 .start = 0x20212000,
411 .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
412 .flags = IORESOURCE_IO,
413};
414
415static struct platform_device bfin_async_nand_device = {
416 .name = "gen_nand",
417 .id = -1,
418 .num_resources = 1,
419 .resource = &bfin_plat_nand_resources,
420 .dev = {
421 .platform_data = &bfin_plat_nand_data,
422 },
423};
424
425static void bfin_plat_nand_init(void)
426{
427 gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
428}
429#else
430static void bfin_plat_nand_init(void) {}
431#endif
432
Mike Frysinger793dc272008-03-26 08:09:12 +0800433#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800434static struct mtd_partition stamp_partitions[] = {
435 {
Robin Getzaa582972008-08-05 17:47:29 +0800436 .name = "bootloader(nor)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800437 .size = 0x40000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800438 .offset = 0,
439 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800440 .name = "linux kernel(nor)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800441 .size = 0x180000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800442 .offset = MTDPART_OFS_APPEND,
443 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800444 .name = "file system(nor)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800445 .size = 0x400000 - 0x40000 - 0x180000 - 0x10000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800446 .offset = MTDPART_OFS_APPEND,
447 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800448 .name = "MAC Address(nor)",
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800449 .size = MTDPART_SIZ_FULL,
450 .offset = 0x3F0000,
451 .mask_flags = MTD_WRITEABLE,
452 }
453};
454
455static struct physmap_flash_data stamp_flash_data = {
456 .width = 2,
457 .parts = stamp_partitions,
458 .nr_parts = ARRAY_SIZE(stamp_partitions),
Barry Song38e76732010-01-15 03:24:39 +0000459#ifdef CONFIG_ROMKERNEL
460 .probe_type = "map_rom",
461#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800462};
463
464static struct resource stamp_flash_resource = {
465 .start = 0x20000000,
466 .end = 0x203fffff,
467 .flags = IORESOURCE_MEM,
468};
469
470static struct platform_device stamp_flash_device = {
471 .name = "physmap-flash",
472 .id = 0,
473 .dev = {
474 .platform_data = &stamp_flash_data,
475 },
476 .num_resources = 1,
477 .resource = &stamp_flash_resource,
478};
Mike Frysinger793dc272008-03-26 08:09:12 +0800479#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800480
Bryan Wu1394f032007-05-06 14:50:22 -0700481#if defined(CONFIG_MTD_M25P80) \
482 || defined(CONFIG_MTD_M25P80_MODULE)
483static struct mtd_partition bfin_spi_flash_partitions[] = {
484 {
Robin Getzaa582972008-08-05 17:47:29 +0800485 .name = "bootloader(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800486 .size = 0x00040000,
Bryan Wu1394f032007-05-06 14:50:22 -0700487 .offset = 0,
488 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800489 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800490 .name = "linux kernel(spi)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800491 .size = 0x180000,
Mike Frysingeredf05642008-02-25 11:38:11 +0800492 .offset = MTDPART_OFS_APPEND,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800493 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800494 .name = "file system(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800495 .size = MTDPART_SIZ_FULL,
496 .offset = MTDPART_OFS_APPEND,
Bryan Wu1394f032007-05-06 14:50:22 -0700497 }
498};
499
500static struct flash_platform_data bfin_spi_flash_data = {
501 .name = "m25p80",
502 .parts = bfin_spi_flash_partitions,
503 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
Michael Hennerich88a80782008-11-18 17:48:22 +0800504 /* .type = "m25p64", */
Bryan Wu1394f032007-05-06 14:50:22 -0700505};
506
507/* SPI flash chip (m25p64) */
508static struct bfin5xx_spi_chip spi_flash_chip_info = {
509 .enable_dma = 0, /* use dma transfer with this chip*/
510 .bits_per_word = 8,
511};
512#endif
513
Mike Frysingera261eec2009-05-20 14:05:36 +0000514#if defined(CONFIG_BFIN_SPI_ADC) \
515 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700516/* SPI ADC chip */
517static struct bfin5xx_spi_chip spi_adc_chip_info = {
518 .enable_dma = 1, /* use dma transfer with this chip*/
519 .bits_per_word = 16,
520};
521#endif
522
Barry Song83124402009-08-06 21:03:02 +0000523#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
524 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700525static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
526 .enable_dma = 0,
527 .bits_per_word = 16,
528};
529#endif
530
Barry Song3b827902010-01-27 09:01:36 +0000531#if defined(CONFIG_SND_BF5XX_SOC_AD193X) \
532 || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
Barry Songd4b834c2009-06-04 10:14:17 +0000533static struct bfin5xx_spi_chip ad1938_spi_chip_info = {
534 .enable_dma = 0,
535 .bits_per_word = 8,
Barry Songd4b834c2009-06-04 10:14:17 +0000536};
537#endif
538
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000539#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000540#include <linux/input/ad714x.h>
541static struct bfin5xx_spi_chip ad7147_spi_chip_info = {
542 .enable_dma = 0,
543 .bits_per_word = 16,
544};
545
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000546static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000547 {
548 .start_stage = 0,
549 .end_stage = 7,
550 .max_coord = 128,
551 },
552};
553
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000554static struct ad714x_button_plat ad7147_spi_button_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000555 {
556 .keycode = BTN_FORWARD,
557 .l_mask = 0,
558 .h_mask = 0x600,
559 },
560 {
561 .keycode = BTN_LEFT,
562 .l_mask = 0,
563 .h_mask = 0x500,
564 },
565 {
566 .keycode = BTN_MIDDLE,
567 .l_mask = 0,
568 .h_mask = 0x800,
569 },
570 {
571 .keycode = BTN_RIGHT,
572 .l_mask = 0x100,
573 .h_mask = 0x400,
574 },
575 {
576 .keycode = BTN_BACK,
577 .l_mask = 0x200,
578 .h_mask = 0x400,
579 },
580};
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000581static struct ad714x_platform_data ad7147_spi_platform_data = {
Barry Song427f2772009-07-17 07:04:55 +0000582 .slider_num = 1,
583 .button_num = 5,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000584 .slider = ad7147_spi_slider_plat,
585 .button = ad7147_spi_button_plat,
Barry Song427f2772009-07-17 07:04:55 +0000586 .stage_cfg_reg = {
587 {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
588 {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
589 {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
590 {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
591 {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
592 {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
593 {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
594 {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
595 {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
596 {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
597 {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
598 {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
599 },
600 .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
601};
602#endif
603
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000604#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000605#include <linux/input/ad714x.h>
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000606static struct ad714x_button_plat ad7142_i2c_button_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000607 {
608 .keycode = BTN_1,
609 .l_mask = 0,
610 .h_mask = 0x1,
611 },
612 {
613 .keycode = BTN_2,
614 .l_mask = 0,
615 .h_mask = 0x2,
616 },
617 {
618 .keycode = BTN_3,
619 .l_mask = 0,
620 .h_mask = 0x4,
621 },
622 {
623 .keycode = BTN_4,
624 .l_mask = 0x0,
625 .h_mask = 0x8,
626 },
627};
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000628static struct ad714x_platform_data ad7142_i2c_platform_data = {
Barry Song427f2772009-07-17 07:04:55 +0000629 .button_num = 4,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000630 .button = ad7142_i2c_button_plat,
Barry Song427f2772009-07-17 07:04:55 +0000631 .stage_cfg_reg = {
632 /* fixme: figure out right setting for all comoponent according
633 * to hardware feature of EVAL-AD7142EB board */
634 {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
635 {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
636 {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
637 {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
638 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
639 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
640 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
641 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
642 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
643 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
644 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
645 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
646 },
647 .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
648};
649#endif
650
Yi Lif79ea4c2009-01-07 23:14:38 +0800651#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
652#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
653
654static int bfin_mmc_spi_init(struct device *dev,
655 irqreturn_t (*detect_int)(int, void *), void *data)
656{
657 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
658 IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
659}
660
661static void bfin_mmc_spi_exit(struct device *dev, void *data)
662{
663 free_irq(MMC_SPI_CARD_DETECT_INT, data);
664}
665
666static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
667 .init = bfin_mmc_spi_init,
668 .exit = bfin_mmc_spi_exit,
669 .detect_delay = 100, /* msecs */
670};
671
672static struct bfin5xx_spi_chip mmc_spi_chip_info = {
673 .enable_dma = 0,
674 .bits_per_word = 8,
Yi Lie68d1eb2009-06-03 09:46:22 +0000675 .pio_interrupt = 0,
Yi Lif79ea4c2009-01-07 23:14:38 +0800676};
677#endif
678
Bryan Wu1394f032007-05-06 14:50:22 -0700679#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800680#include <linux/spi/ad7877.h>
Bryan Wu1394f032007-05-06 14:50:22 -0700681static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700682 .enable_dma = 0,
683 .bits_per_word = 16,
684};
685
686static const struct ad7877_platform_data bfin_ad7877_ts_info = {
687 .model = 7877,
688 .vref_delay_usecs = 50, /* internal, no capacitor */
689 .x_plate_ohms = 419,
690 .y_plate_ohms = 486,
691 .pressure_max = 1000,
692 .pressure_min = 0,
693 .stopacq_polarity = 1,
694 .first_conversion_delay = 3,
695 .acquisition_time = 1,
696 .averaging = 1,
697 .pen_down_acc_interval = 1,
698};
699#endif
700
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800701#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
702#include <linux/spi/ad7879.h>
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800703static const struct ad7879_platform_data bfin_ad7879_ts_info = {
704 .model = 7879, /* Model = AD7879 */
705 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
706 .pressure_max = 10000,
707 .pressure_min = 0,
708 .first_conversion_delay = 3, /* wait 512us before do a first conversion */
709 .acquisition_time = 1, /* 4us acquisition time per sample */
710 .median = 2, /* do 8 measurements */
711 .averaging = 1, /* take the average of 4 middle samples */
712 .pen_down_acc_interval = 255, /* 9.4 ms */
Michael Hennerich244d3422009-12-18 09:29:39 +0000713 .gpio_export = 1, /* Export GPIO to gpiolib */
714 .gpio_base = -1, /* Dynamic allocation */
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800715};
716#endif
717
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000718#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000719#include <linux/input/adxl34x.h>
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000720static const struct adxl34x_platform_data adxl34x_info = {
721 .x_axis_offset = 0,
722 .y_axis_offset = 0,
723 .z_axis_offset = 0,
724 .tap_threshold = 0x31,
725 .tap_duration = 0x10,
726 .tap_latency = 0x60,
727 .tap_window = 0xF0,
728 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
729 .act_axis_control = 0xFF,
730 .activity_threshold = 5,
731 .inactivity_threshold = 3,
732 .inactivity_time = 4,
733 .free_fall_threshold = 0x7,
734 .free_fall_time = 0x20,
735 .data_rate = 0x8,
736 .data_range = ADXL_FULL_RES,
737
738 .ev_type = EV_ABS,
739 .ev_code_x = ABS_X, /* EV_REL */
740 .ev_code_y = ABS_Y, /* EV_REL */
741 .ev_code_z = ABS_Z, /* EV_REL */
742
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000743 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000744
745/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
746/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
747 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
748 .fifo_mode = ADXL_FIFO_STREAM,
749};
750#endif
751
Michael Hennerichf5150152008-10-16 23:23:18 +0800752#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
753static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
754 .enable_dma = 0,
755 .bits_per_word = 16,
756};
757#endif
758
Michael Hennerich6e668932008-02-09 01:54:09 +0800759#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
760static struct bfin5xx_spi_chip spidev_chip_info = {
761 .enable_dma = 0,
762 .bits_per_word = 8,
763};
764#endif
765
Michael Hennerich2043f3f2008-10-13 14:46:30 +0800766#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
767static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
768 .enable_dma = 0,
769 .bits_per_word = 8,
770};
771#endif
772
Michael Hennerich85a192e2009-01-07 23:14:38 +0800773#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
774static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
775 .enable_dma = 1,
776 .bits_per_word = 8,
777 .cs_gpio = GPIO_PF10,
778};
779#endif
780
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000781#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
782static struct bfin5xx_spi_chip adf7021_spi_chip_info = {
783 .bits_per_word = 16,
784 .cs_gpio = GPIO_PF10,
785};
786
787#include <linux/spi/adf702x.h>
788#define TXREG 0x0160A470
789static const u32 adf7021_regs[] = {
790 0x09608FA0,
791 0x00575011,
792 0x00A7F092,
793 0x2B141563,
794 0x81F29E94,
795 0x00003155,
796 0x050A4F66,
797 0x00000007,
798 0x00000008,
799 0x000231E9,
800 0x3296354A,
801 0x891A2B3B,
802 0x00000D9C,
803 0x0000000D,
804 0x0000000E,
805 0x0000000F,
806};
807
808static struct adf702x_platform_data adf7021_platform_data = {
809 .regs_base = (void *)SPORT1_TCR1,
810 .dma_ch_rx = CH_SPORT1_RX,
811 .dma_ch_tx = CH_SPORT1_TX,
812 .irq_sport_err = IRQ_SPORT1_ERROR,
813 .gpio_int_rfs = GPIO_PF8,
814 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_RFS, P_SPORT1_DRPRI,
815 P_SPORT1_RSCLK, P_SPORT1_TSCLK, 0},
816 .adf702x_model = MODEL_ADF7021,
817 .adf702x_regs = adf7021_regs,
818 .tx_reg = TXREG,
819};
Mike Frysinger0531c462010-01-19 07:04:29 +0000820static inline void adf702x_mac_init(void)
821{
822 random_ether_addr(adf7021_platform_data.mac_addr);
823}
824#else
825static inline void adf702x_mac_init(void) {}
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000826#endif
827
Michael Hennerichfe5b25c2010-02-04 14:41:39 +0000828#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
829#include <linux/spi/ads7846.h>
830static struct bfin5xx_spi_chip ad7873_spi_chip_info = {
831 .bits_per_word = 8,
832};
833
834static int ads7873_get_pendown_state(void)
835{
836 return gpio_get_value(GPIO_PF6);
837}
838
839static struct ads7846_platform_data __initdata ad7873_pdata = {
840 .model = 7873, /* AD7873 */
841 .x_max = 0xfff,
842 .y_max = 0xfff,
843 .x_plate_ohms = 620,
844 .debounce_max = 1,
845 .debounce_rep = 0,
846 .debounce_tol = (~0),
847 .get_pendown_state = ads7873_get_pendown_state,
848};
849#endif
850
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800851#if defined(CONFIG_MTD_DATAFLASH) \
852 || defined(CONFIG_MTD_DATAFLASH_MODULE)
Michael Hennerichceac2652008-08-25 17:39:11 +0800853
854static struct mtd_partition bfin_spi_dataflash_partitions[] = {
855 {
856 .name = "bootloader(spi)",
857 .size = 0x00040000,
858 .offset = 0,
859 .mask_flags = MTD_CAP_ROM
860 }, {
861 .name = "linux kernel(spi)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800862 .size = 0x180000,
Michael Hennerichceac2652008-08-25 17:39:11 +0800863 .offset = MTDPART_OFS_APPEND,
864 }, {
865 .name = "file system(spi)",
866 .size = MTDPART_SIZ_FULL,
867 .offset = MTDPART_OFS_APPEND,
868 }
869};
870
871static struct flash_platform_data bfin_spi_dataflash_data = {
872 .name = "SPI Dataflash",
873 .parts = bfin_spi_dataflash_partitions,
874 .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
875};
876
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800877/* DataFlash chip */
878static struct bfin5xx_spi_chip data_flash_chip_info = {
879 .enable_dma = 0, /* use dma transfer with this chip*/
880 .bits_per_word = 8,
881};
882#endif
883
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000884#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
885static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
886 .enable_dma = 0, /* use dma transfer with this chip*/
887 .bits_per_word = 8,
888};
889#endif
890
Bryan Wu1394f032007-05-06 14:50:22 -0700891static struct spi_board_info bfin_spi_board_info[] __initdata = {
892#if defined(CONFIG_MTD_M25P80) \
893 || defined(CONFIG_MTD_M25P80_MODULE)
894 {
895 /* the modalias must be the same as spi device driver name */
896 .modalias = "m25p80", /* Name of spi_driver for this device */
897 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800898 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700899 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
900 .platform_data = &bfin_spi_flash_data,
901 .controller_data = &spi_flash_chip_info,
902 .mode = SPI_MODE_3,
903 },
904#endif
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800905#if defined(CONFIG_MTD_DATAFLASH) \
906 || defined(CONFIG_MTD_DATAFLASH_MODULE)
907 { /* DataFlash chip */
908 .modalias = "mtd_dataflash",
Michael Hennerichceac2652008-08-25 17:39:11 +0800909 .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800910 .bus_num = 0, /* Framework bus number */
911 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
Michael Hennerichceac2652008-08-25 17:39:11 +0800912 .platform_data = &bfin_spi_dataflash_data,
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800913 .controller_data = &data_flash_chip_info,
914 .mode = SPI_MODE_3,
915 },
916#endif
Mike Frysingera261eec2009-05-20 14:05:36 +0000917#if defined(CONFIG_BFIN_SPI_ADC) \
918 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700919 {
920 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
921 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800922 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700923 .chip_select = 1, /* Framework chip select. */
924 .platform_data = NULL, /* No spi_driver specific config */
925 .controller_data = &spi_adc_chip_info,
926 },
927#endif
928
Barry Song83124402009-08-06 21:03:02 +0000929#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
930 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700931 {
Barry Songdac98172009-08-13 21:07:37 +0000932 .modalias = "ad1836",
Bryan Wu1394f032007-05-06 14:50:22 -0700933 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800934 .bus_num = 0,
Barry Song83124402009-08-06 21:03:02 +0000935 .chip_select = 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
Bryan Wu1394f032007-05-06 14:50:22 -0700936 .controller_data = &ad1836_spi_chip_info,
Barry Song83124402009-08-06 21:03:02 +0000937 .mode = SPI_MODE_3,
Bryan Wu1394f032007-05-06 14:50:22 -0700938 },
939#endif
Barry Songd4b834c2009-06-04 10:14:17 +0000940
Barry Song3b827902010-01-27 09:01:36 +0000941#if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
Barry Songd4b834c2009-06-04 10:14:17 +0000942 {
Barry Song3b827902010-01-27 09:01:36 +0000943 .modalias = "ad193x",
Barry Songd4b834c2009-06-04 10:14:17 +0000944 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
945 .bus_num = 0,
Barry Song08a54bf2009-09-18 09:14:38 +0000946 .chip_select = 5,
Barry Songd4b834c2009-06-04 10:14:17 +0000947 .controller_data = &ad1938_spi_chip_info,
948 .mode = SPI_MODE_3,
949 },
950#endif
951
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000952#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000953 {
954 .modalias = "ad714x_captouch",
955 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
956 .irq = IRQ_PF4,
957 .bus_num = 0,
958 .chip_select = 5,
959 .mode = SPI_MODE_3,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000960 .platform_data = &ad7147_spi_platform_data,
Barry Song427f2772009-07-17 07:04:55 +0000961 .controller_data = &ad7147_spi_chip_info,
962 },
963#endif
964
Yi Lif79ea4c2009-01-07 23:14:38 +0800965#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
966 {
967 .modalias = "mmc_spi",
968 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
969 .bus_num = 0,
970 .chip_select = 4,
971 .platform_data = &bfin_mmc_spi_pdata,
972 .controller_data = &mmc_spi_chip_info,
973 .mode = SPI_MODE_3,
974 },
975#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700976#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
977 {
978 .modalias = "ad7877",
979 .platform_data = &bfin_ad7877_ts_info,
980 .irq = IRQ_PF6,
981 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Michael Hennerichc7d48962007-11-15 21:33:31 +0800982 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700983 .chip_select = 1,
984 .controller_data = &spi_ad7877_chip_info,
985 },
986#endif
Michael Hennerichf5150152008-10-16 23:23:18 +0800987#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800988 {
989 .modalias = "ad7879",
990 .platform_data = &bfin_ad7879_ts_info,
991 .irq = IRQ_PF7,
992 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
993 .bus_num = 0,
994 .chip_select = 1,
995 .controller_data = &spi_ad7879_chip_info,
996 .mode = SPI_CPHA | SPI_CPOL,
997 },
998#endif
Michael Hennerich6e668932008-02-09 01:54:09 +0800999#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1000 {
1001 .modalias = "spidev",
1002 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1003 .bus_num = 0,
1004 .chip_select = 1,
1005 .controller_data = &spidev_chip_info,
1006 },
1007#endif
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001008#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1009 {
1010 .modalias = "bfin-lq035q1-spi",
1011 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1012 .bus_num = 0,
Michael Hennerich46aa04f2008-10-13 11:30:17 +08001013 .chip_select = 2,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001014 .controller_data = &lq035q1_spi_chip_info,
1015 .mode = SPI_CPHA | SPI_CPOL,
1016 },
1017#endif
Michael Hennerich85a192e2009-01-07 23:14:38 +08001018#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
1019 {
1020 .modalias = "enc28j60",
1021 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1022 .irq = IRQ_PF6,
1023 .bus_num = 0,
1024 .chip_select = 0, /* GPIO controlled SSEL */
1025 .controller_data = &enc28j60_spi_chip_info,
1026 .mode = SPI_MODE_0,
1027 },
1028#endif
Michael Hennerich57af8ed2009-10-16 12:35:20 +00001029#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1030 {
1031 .modalias = "adxl34x",
1032 .platform_data = &adxl34x_info,
1033 .irq = IRQ_PF6,
1034 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1035 .bus_num = 0,
1036 .chip_select = 2,
1037 .controller_data = &spi_adxl34x_chip_info,
1038 .mode = SPI_MODE_3,
1039 },
1040#endif
Michael Hennerichefaf7cd2009-11-12 16:54:08 +00001041#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
1042 {
1043 .modalias = "adf702x",
1044 .max_speed_hz = 16000000, /* max spi clock (SCK) speed in HZ */
1045 .bus_num = 0,
1046 .chip_select = 0, /* GPIO controlled SSEL */
1047 .controller_data = &adf7021_spi_chip_info,
1048 .platform_data = &adf7021_platform_data,
1049 .mode = SPI_MODE_0,
1050 },
1051#endif
Michael Hennerichfe5b25c2010-02-04 14:41:39 +00001052#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
1053 {
1054 .modalias = "ads7846",
1055 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1056 .bus_num = 0,
1057 .irq = IRQ_PF6,
1058 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1059 .controller_data = &ad7873_spi_chip_info,
1060 .platform_data = &ad7873_pdata,
1061 .mode = SPI_MODE_0,
1062 },
1063#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001064};
1065
Mike Frysinger5bda2722008-06-07 15:03:01 +08001066#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -07001067/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001068static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -07001069 .num_chipselect = 8,
1070 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +08001071 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -07001072};
1073
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001074/* SPI (0) */
1075static struct resource bfin_spi0_resource[] = {
1076 [0] = {
1077 .start = SPI0_REGBASE,
1078 .end = SPI0_REGBASE + 0xFF,
1079 .flags = IORESOURCE_MEM,
1080 },
1081 [1] = {
1082 .start = CH_SPI,
1083 .end = CH_SPI,
Yi Lie68d1eb2009-06-03 09:46:22 +00001084 .flags = IORESOURCE_DMA,
1085 },
1086 [2] = {
1087 .start = IRQ_SPI,
1088 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001089 .flags = IORESOURCE_IRQ,
1090 },
1091};
1092
1093static struct platform_device bfin_spi0_device = {
1094 .name = "bfin-spi",
1095 .id = 0, /* Bus number */
1096 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1097 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -07001098 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001099 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -07001100 },
1101};
1102#endif /* spi master and devices */
1103
Cliff Cai1e9aa952009-03-28 23:28:51 +08001104#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1105
1106/* SPORT SPI controller data */
1107static struct bfin5xx_spi_master bfin_sport_spi0_info = {
1108 .num_chipselect = 1, /* master only supports one device */
1109 .enable_dma = 0, /* master don't support DMA */
1110 .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,
1111 P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0},
1112};
1113
1114static struct resource bfin_sport_spi0_resource[] = {
1115 [0] = {
1116 .start = SPORT0_TCR1,
1117 .end = SPORT0_TCR1 + 0xFF,
1118 .flags = IORESOURCE_MEM,
1119 },
1120 [1] = {
1121 .start = IRQ_SPORT0_ERROR,
1122 .end = IRQ_SPORT0_ERROR,
1123 .flags = IORESOURCE_IRQ,
1124 },
1125};
1126
1127static struct platform_device bfin_sport_spi0_device = {
1128 .name = "bfin-sport-spi",
1129 .id = 1, /* Bus number */
1130 .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource),
1131 .resource = bfin_sport_spi0_resource,
1132 .dev = {
1133 .platform_data = &bfin_sport_spi0_info, /* Passed to driver */
1134 },
1135};
1136
1137static struct bfin5xx_spi_master bfin_sport_spi1_info = {
1138 .num_chipselect = 1, /* master only supports one device */
1139 .enable_dma = 0, /* master don't support DMA */
1140 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,
1141 P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0},
1142};
1143
1144static struct resource bfin_sport_spi1_resource[] = {
1145 [0] = {
1146 .start = SPORT1_TCR1,
1147 .end = SPORT1_TCR1 + 0xFF,
1148 .flags = IORESOURCE_MEM,
1149 },
1150 [1] = {
1151 .start = IRQ_SPORT1_ERROR,
1152 .end = IRQ_SPORT1_ERROR,
1153 .flags = IORESOURCE_IRQ,
1154 },
1155};
1156
1157static struct platform_device bfin_sport_spi1_device = {
1158 .name = "bfin-sport-spi",
1159 .id = 2, /* Bus number */
1160 .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource),
1161 .resource = bfin_sport_spi1_resource,
1162 .dev = {
1163 .platform_data = &bfin_sport_spi1_info, /* Passed to driver */
1164 },
1165};
1166
1167#endif /* sport spi master and devices */
1168
Bryan Wu1394f032007-05-06 14:50:22 -07001169#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1170static struct platform_device bfin_fb_device = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001171 .name = "bf537-lq035",
1172};
1173#endif
1174
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001175#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1176#include <asm/bfin-lq035q1.h>
1177
1178static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
Michael Hennerichd94a1aa2009-12-08 11:45:55 +00001179 .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
1180 .ppi_mode = USE_RGB565_16_BIT_PPI,
1181 .use_bl = 0, /* let something else control the LCD Blacklight */
1182 .gpio_bl = GPIO_PF7,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001183};
1184
1185static struct resource bfin_lq035q1_resources[] = {
1186 {
1187 .start = IRQ_PPI_ERROR,
1188 .end = IRQ_PPI_ERROR,
1189 .flags = IORESOURCE_IRQ,
1190 },
1191};
1192
1193static struct platform_device bfin_lq035q1_device = {
1194 .name = "bfin-lq035q1",
1195 .id = -1,
Michael Hennerichd94a1aa2009-12-08 11:45:55 +00001196 .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
1197 .resource = bfin_lq035q1_resources,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001198 .dev = {
1199 .platform_data = &bfin_lq035q1_data,
1200 },
1201};
1202#endif
1203
Bryan Wu1394f032007-05-06 14:50:22 -07001204#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang233b28a2007-11-21 17:04:41 +08001205#ifdef CONFIG_SERIAL_BFIN_UART0
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001206static struct resource bfin_uart0_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -07001207 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001208 .start = UART0_THR,
1209 .end = UART0_GCTL+2,
Bryan Wu1394f032007-05-06 14:50:22 -07001210 .flags = IORESOURCE_MEM,
Sonic Zhang233b28a2007-11-21 17:04:41 +08001211 },
Sonic Zhang233b28a2007-11-21 17:04:41 +08001212 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001213 .start = IRQ_UART0_RX,
1214 .end = IRQ_UART0_RX+1,
1215 .flags = IORESOURCE_IRQ,
1216 },
1217 {
1218 .start = IRQ_UART0_ERROR,
1219 .end = IRQ_UART0_ERROR,
1220 .flags = IORESOURCE_IRQ,
1221 },
1222 {
1223 .start = CH_UART0_TX,
1224 .end = CH_UART0_TX,
1225 .flags = IORESOURCE_DMA,
1226 },
1227 {
1228 .start = CH_UART0_RX,
1229 .end = CH_UART0_RX,
1230 .flags = IORESOURCE_DMA,
1231 },
1232#ifdef CONFIG_BFIN_UART0_CTSRTS
1233 { /* CTS pin */
1234 .start = GPIO_PG7,
1235 .end = GPIO_PG7,
1236 .flags = IORESOURCE_IO,
1237 },
1238 { /* RTS pin */
1239 .start = GPIO_PG6,
1240 .end = GPIO_PG6,
1241 .flags = IORESOURCE_IO,
Bryan Wu1394f032007-05-06 14:50:22 -07001242 },
Sonic Zhang233b28a2007-11-21 17:04:41 +08001243#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001244};
1245
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001246unsigned short bfin_uart0_peripherals[] = {
1247 P_UART0_TX, P_UART0_RX, 0
1248};
1249
1250static struct platform_device bfin_uart0_device = {
1251 .name = "bfin-uart",
1252 .id = 0,
1253 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
1254 .resource = bfin_uart0_resources,
1255 .dev = {
1256 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
1257 },
1258};
1259#endif
1260#ifdef CONFIG_SERIAL_BFIN_UART1
1261static struct resource bfin_uart1_resources[] = {
1262 {
1263 .start = UART1_THR,
1264 .end = UART1_GCTL+2,
1265 .flags = IORESOURCE_MEM,
1266 },
1267 {
1268 .start = IRQ_UART1_RX,
1269 .end = IRQ_UART1_RX+1,
1270 .flags = IORESOURCE_IRQ,
1271 },
1272 {
1273 .start = IRQ_UART1_ERROR,
1274 .end = IRQ_UART1_ERROR,
1275 .flags = IORESOURCE_IRQ,
1276 },
1277 {
1278 .start = CH_UART1_TX,
1279 .end = CH_UART1_TX,
1280 .flags = IORESOURCE_DMA,
1281 },
1282 {
1283 .start = CH_UART1_RX,
1284 .end = CH_UART1_RX,
1285 .flags = IORESOURCE_DMA,
1286 },
1287};
1288
1289unsigned short bfin_uart1_peripherals[] = {
1290 P_UART1_TX, P_UART1_RX, 0
1291};
1292
1293static struct platform_device bfin_uart1_device = {
Bryan Wu1394f032007-05-06 14:50:22 -07001294 .name = "bfin-uart",
1295 .id = 1,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001296 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
1297 .resource = bfin_uart1_resources,
1298 .dev = {
1299 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
1300 },
Bryan Wu1394f032007-05-06 14:50:22 -07001301};
1302#endif
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001303#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001304
Graf Yang5be36d22008-04-25 03:09:15 +08001305#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +08001306#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +08001307static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +08001308 {
1309 .start = 0xFFC00400,
1310 .end = 0xFFC004FF,
1311 .flags = IORESOURCE_MEM,
1312 },
Graf Yang42bd8bc2009-01-07 23:14:39 +08001313 {
1314 .start = IRQ_UART0_RX,
1315 .end = IRQ_UART0_RX+1,
1316 .flags = IORESOURCE_IRQ,
1317 },
1318 {
1319 .start = CH_UART0_RX,
1320 .end = CH_UART0_RX+1,
1321 .flags = IORESOURCE_DMA,
1322 },
1323};
1324
1325static struct platform_device bfin_sir0_device = {
1326 .name = "bfin_sir",
1327 .id = 0,
1328 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
1329 .resource = bfin_sir0_resources,
1330};
Graf Yang5be36d22008-04-25 03:09:15 +08001331#endif
1332#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +08001333static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +08001334 {
1335 .start = 0xFFC02000,
1336 .end = 0xFFC020FF,
1337 .flags = IORESOURCE_MEM,
1338 },
Graf Yang42bd8bc2009-01-07 23:14:39 +08001339 {
1340 .start = IRQ_UART1_RX,
1341 .end = IRQ_UART1_RX+1,
1342 .flags = IORESOURCE_IRQ,
1343 },
1344 {
1345 .start = CH_UART1_RX,
1346 .end = CH_UART1_RX+1,
1347 .flags = IORESOURCE_DMA,
1348 },
Graf Yang5be36d22008-04-25 03:09:15 +08001349};
1350
Graf Yang42bd8bc2009-01-07 23:14:39 +08001351static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +08001352 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +08001353 .id = 1,
1354 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
1355 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +08001356};
1357#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +08001358#endif
Graf Yang5be36d22008-04-25 03:09:15 +08001359
Bryan Wu1394f032007-05-06 14:50:22 -07001360#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001361static struct resource bfin_twi0_resource[] = {
1362 [0] = {
1363 .start = TWI0_REGBASE,
1364 .end = TWI0_REGBASE,
1365 .flags = IORESOURCE_MEM,
1366 },
1367 [1] = {
1368 .start = IRQ_TWI,
1369 .end = IRQ_TWI,
1370 .flags = IORESOURCE_IRQ,
1371 },
1372};
1373
Bryan Wu1394f032007-05-06 14:50:22 -07001374static struct platform_device i2c_bfin_twi_device = {
1375 .name = "i2c-bfin-twi",
1376 .id = 0,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001377 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1378 .resource = bfin_twi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -07001379};
1380#endif
1381
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001382#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001383static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
1384 [0] = KEY_GRAVE,
1385 [1] = KEY_1,
1386 [2] = KEY_2,
1387 [3] = KEY_3,
1388 [4] = KEY_4,
1389 [5] = KEY_5,
1390 [6] = KEY_6,
1391 [7] = KEY_7,
1392 [8] = KEY_8,
1393 [9] = KEY_9,
1394 [10] = KEY_0,
1395 [11] = KEY_MINUS,
1396 [12] = KEY_EQUAL,
1397 [13] = KEY_BACKSLASH,
1398 [15] = KEY_KP0,
1399 [16] = KEY_Q,
1400 [17] = KEY_W,
1401 [18] = KEY_E,
1402 [19] = KEY_R,
1403 [20] = KEY_T,
1404 [21] = KEY_Y,
1405 [22] = KEY_U,
1406 [23] = KEY_I,
1407 [24] = KEY_O,
1408 [25] = KEY_P,
1409 [26] = KEY_LEFTBRACE,
1410 [27] = KEY_RIGHTBRACE,
1411 [29] = KEY_KP1,
1412 [30] = KEY_KP2,
1413 [31] = KEY_KP3,
1414 [32] = KEY_A,
1415 [33] = KEY_S,
1416 [34] = KEY_D,
1417 [35] = KEY_F,
1418 [36] = KEY_G,
1419 [37] = KEY_H,
1420 [38] = KEY_J,
1421 [39] = KEY_K,
1422 [40] = KEY_L,
1423 [41] = KEY_SEMICOLON,
1424 [42] = KEY_APOSTROPHE,
1425 [43] = KEY_BACKSLASH,
1426 [45] = KEY_KP4,
1427 [46] = KEY_KP5,
1428 [47] = KEY_KP6,
1429 [48] = KEY_102ND,
1430 [49] = KEY_Z,
1431 [50] = KEY_X,
1432 [51] = KEY_C,
1433 [52] = KEY_V,
1434 [53] = KEY_B,
1435 [54] = KEY_N,
1436 [55] = KEY_M,
1437 [56] = KEY_COMMA,
1438 [57] = KEY_DOT,
1439 [58] = KEY_SLASH,
1440 [60] = KEY_KPDOT,
1441 [61] = KEY_KP7,
1442 [62] = KEY_KP8,
1443 [63] = KEY_KP9,
1444 [64] = KEY_SPACE,
1445 [65] = KEY_BACKSPACE,
1446 [66] = KEY_TAB,
1447 [67] = KEY_KPENTER,
1448 [68] = KEY_ENTER,
1449 [69] = KEY_ESC,
1450 [70] = KEY_DELETE,
1451 [74] = KEY_KPMINUS,
1452 [76] = KEY_UP,
1453 [77] = KEY_DOWN,
1454 [78] = KEY_RIGHT,
1455 [79] = KEY_LEFT,
1456};
1457
1458static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1459 .rows = 8,
1460 .cols = 10,
1461 .keymap = adp5588_keymap,
1462 .keymapsize = ARRAY_SIZE(adp5588_keymap),
1463 .repeat = 0,
1464};
1465#endif
1466
Michael Hennerich3ea57212009-03-28 22:15:07 +08001467#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1468#include <linux/mfd/adp5520.h>
1469
1470 /*
1471 * ADP5520/5501 Backlight Data
1472 */
1473
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001474static struct adp5520_backlight_platform_data adp5520_backlight_data = {
1475 .fade_in = ADP5520_FADE_T_1200ms,
1476 .fade_out = ADP5520_FADE_T_1200ms,
1477 .fade_led_law = ADP5520_BL_LAW_LINEAR,
1478 .en_ambl_sens = 1,
1479 .abml_filt = ADP5520_BL_AMBL_FILT_640ms,
1480 .l1_daylight_max = ADP5520_BL_CUR_mA(15),
1481 .l1_daylight_dim = ADP5520_BL_CUR_mA(0),
1482 .l2_office_max = ADP5520_BL_CUR_mA(7),
1483 .l2_office_dim = ADP5520_BL_CUR_mA(0),
1484 .l3_dark_max = ADP5520_BL_CUR_mA(3),
1485 .l3_dark_dim = ADP5520_BL_CUR_mA(0),
1486 .l2_trip = ADP5520_L2_COMP_CURR_uA(700),
1487 .l2_hyst = ADP5520_L2_COMP_CURR_uA(50),
1488 .l3_trip = ADP5520_L3_COMP_CURR_uA(80),
1489 .l3_hyst = ADP5520_L3_COMP_CURR_uA(20),
Michael Hennerich3ea57212009-03-28 22:15:07 +08001490};
1491
1492 /*
1493 * ADP5520/5501 LEDs Data
1494 */
1495
Michael Hennerich3ea57212009-03-28 22:15:07 +08001496static struct led_info adp5520_leds[] = {
1497 {
1498 .name = "adp5520-led1",
1499 .default_trigger = "none",
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001500 .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001501 },
1502#ifdef ADP5520_EN_ALL_LEDS
1503 {
1504 .name = "adp5520-led2",
1505 .default_trigger = "none",
1506 .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1,
1507 },
1508 {
1509 .name = "adp5520-led3",
1510 .default_trigger = "none",
1511 .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2,
1512 },
1513#endif
1514};
1515
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001516static struct adp5520_leds_platform_data adp5520_leds_data = {
Michael Hennerich3ea57212009-03-28 22:15:07 +08001517 .num_leds = ARRAY_SIZE(adp5520_leds),
1518 .leds = adp5520_leds,
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001519 .fade_in = ADP5520_FADE_T_600ms,
1520 .fade_out = ADP5520_FADE_T_600ms,
1521 .led_on_time = ADP5520_LED_ONT_600ms,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001522};
1523
1524 /*
1525 * ADP5520 GPIO Data
1526 */
1527
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001528static struct adp5520_gpio_platform_data adp5520_gpio_data = {
Michael Hennerich3ea57212009-03-28 22:15:07 +08001529 .gpio_start = 50,
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001530 .gpio_en_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
1531 .gpio_pullup_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001532};
1533
1534 /*
1535 * ADP5520 Keypad Data
1536 */
1537
Michael Hennerich3ea57212009-03-28 22:15:07 +08001538static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001539 [ADP5520_KEY(0, 0)] = KEY_GRAVE,
1540 [ADP5520_KEY(0, 1)] = KEY_1,
1541 [ADP5520_KEY(0, 2)] = KEY_2,
1542 [ADP5520_KEY(0, 3)] = KEY_3,
1543 [ADP5520_KEY(1, 0)] = KEY_4,
1544 [ADP5520_KEY(1, 1)] = KEY_5,
1545 [ADP5520_KEY(1, 2)] = KEY_6,
1546 [ADP5520_KEY(1, 3)] = KEY_7,
1547 [ADP5520_KEY(2, 0)] = KEY_8,
1548 [ADP5520_KEY(2, 1)] = KEY_9,
1549 [ADP5520_KEY(2, 2)] = KEY_0,
1550 [ADP5520_KEY(2, 3)] = KEY_MINUS,
1551 [ADP5520_KEY(3, 0)] = KEY_EQUAL,
1552 [ADP5520_KEY(3, 1)] = KEY_BACKSLASH,
1553 [ADP5520_KEY(3, 2)] = KEY_BACKSPACE,
1554 [ADP5520_KEY(3, 3)] = KEY_ENTER,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001555};
1556
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001557static struct adp5520_keys_platform_data adp5520_keys_data = {
1558 .rows_en_mask = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0,
1559 .cols_en_mask = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001560 .keymap = adp5520_keymap,
1561 .keymapsize = ARRAY_SIZE(adp5520_keymap),
1562 .repeat = 0,
1563};
1564
1565 /*
1566 * ADP5520/5501 Multifuction Device Init Data
1567 */
1568
Michael Hennerich3ea57212009-03-28 22:15:07 +08001569static struct adp5520_platform_data adp5520_pdev_data = {
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001570 .backlight = &adp5520_backlight_data,
1571 .leds = &adp5520_leds_data,
1572 .gpio = &adp5520_gpio_data,
1573 .keys = &adp5520_keys_data,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001574};
1575
1576#endif
1577
Michael Hennerichba877d42009-08-27 04:09:32 +00001578#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001579static struct adp5588_gpio_platform_data adp5588_gpio_data = {
Michael Hennerichba877d42009-08-27 04:09:32 +00001580 .gpio_start = 50,
1581 .pullup_dis_mask = 0,
1582};
1583#endif
1584
Michael Hennerich78756c62009-10-13 15:28:33 +00001585#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
1586#include <linux/i2c/adp8870.h>
1587static struct led_info adp8870_leds[] = {
1588 {
1589 .name = "adp8870-led7",
1590 .default_trigger = "none",
1591 .flags = ADP8870_LED_D7 | ADP8870_LED_OFFT_600ms,
1592 },
1593};
1594
1595
1596static struct adp8870_backlight_platform_data adp8870_pdata = {
1597 .bl_led_assign = ADP8870_BL_D1 | ADP8870_BL_D2 | ADP8870_BL_D3 |
1598 ADP8870_BL_D4 | ADP8870_BL_D5 | ADP8870_BL_D6, /* 1 = Backlight 0 = Individual LED */
1599 .pwm_assign = 0, /* 1 = Enables PWM mode */
1600
1601 .bl_fade_in = ADP8870_FADE_T_1200ms, /* Backlight Fade-In Timer */
1602 .bl_fade_out = ADP8870_FADE_T_1200ms, /* Backlight Fade-Out Timer */
1603 .bl_fade_law = ADP8870_FADE_LAW_CUBIC1, /* fade-on/fade-off transfer characteristic */
1604
1605 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
1606 .abml_filt = ADP8870_BL_AMBL_FILT_320ms, /* Light sensor filter time */
1607
1608 .l1_daylight_max = ADP8870_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1609 .l1_daylight_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1610 .l2_bright_max = ADP8870_BL_CUR_mA(14), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1611 .l2_bright_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1612 .l3_office_max = ADP8870_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1613 .l3_office_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1614 .l4_indoor_max = ADP8870_BL_CUR_mA(3), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1615 .l4_indor_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1616 .l5_dark_max = ADP8870_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1617 .l5_dark_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1618
1619 .l2_trip = ADP8870_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1620 .l2_hyst = ADP8870_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1621 .l3_trip = ADP8870_L3_COMP_CURR_uA(389), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
1622 .l3_hyst = ADP8870_L3_COMP_CURR_uA(54), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
1623 .l4_trip = ADP8870_L4_COMP_CURR_uA(167), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
1624 .l4_hyst = ADP8870_L4_COMP_CURR_uA(16), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
1625 .l5_trip = ADP8870_L5_COMP_CURR_uA(43), /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1626 .l5_hyst = ADP8870_L5_COMP_CURR_uA(11), /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1627
1628 .leds = adp8870_leds,
1629 .num_leds = ARRAY_SIZE(adp8870_leds),
1630 .led_fade_law = ADP8870_FADE_LAW_SQUARE, /* fade-on/fade-off transfer characteristic */
1631 .led_fade_in = ADP8870_FADE_T_600ms,
1632 .led_fade_out = ADP8870_FADE_T_600ms,
1633 .led_on_time = ADP8870_LED_ONT_200ms,
1634};
1635#endif
1636
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001637static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001638#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001639 {
Barry Song427f2772009-07-17 07:04:55 +00001640 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
Barry Song4c94c3e2009-07-07 07:41:50 +00001641 .irq = IRQ_PG5,
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001642 .platform_data = (void *)&ad7142_i2c_platform_data,
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001643 },
1644#endif
Barry Songad6720c2010-02-03 09:15:31 +00001645
1646#if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE)
1647 {
1648 I2C_BOARD_INFO("ad7150", 0x48),
1649 .irq = IRQ_PG5, /* fixme: use real interrupt number */
1650 },
1651#endif
1652
1653#if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE)
1654 {
1655 I2C_BOARD_INFO("ad7152", 0x48),
1656 },
1657#endif
1658
1659#if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE)
1660 {
1661 I2C_BOARD_INFO("ad774x", 0x48),
1662 },
1663#endif
1664
Michael Hennerichebd58332009-07-02 11:00:38 +00001665#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001666 {
1667 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001668 },
1669#endif
Michael Hennerich204844e2009-06-30 14:57:22 +00001670#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001671 {
1672 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
Michael Hennerichf5150152008-10-16 23:23:18 +08001673 .irq = IRQ_PG6,
1674 },
1675#endif
1676#if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
1677 {
1678 I2C_BOARD_INFO("ad7879", 0x2F),
1679 .irq = IRQ_PG5,
1680 .platform_data = (void *)&bfin_ad7879_ts_info,
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001681 },
1682#endif
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001683#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1684 {
1685 I2C_BOARD_INFO("adp5588-keys", 0x34),
1686 .irq = IRQ_PG0,
1687 .platform_data = (void *)&adp5588_kpad_data,
1688 },
1689#endif
Michael Hennerich3ea57212009-03-28 22:15:07 +08001690#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1691 {
1692 I2C_BOARD_INFO("pmic-adp5520", 0x32),
Mike Frysinger4f84b6e2009-06-10 20:45:48 -04001693 .irq = IRQ_PG0,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001694 .platform_data = (void *)&adp5520_pdev_data,
1695 },
1696#endif
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001697#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1698 {
1699 I2C_BOARD_INFO("adxl34x", 0x53),
1700 .irq = IRQ_PG3,
1701 .platform_data = (void *)&adxl34x_info,
1702 },
1703#endif
Michael Hennerichba877d42009-08-27 04:09:32 +00001704#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1705 {
1706 I2C_BOARD_INFO("adp5588-gpio", 0x34),
1707 .platform_data = (void *)&adp5588_gpio_data,
1708 },
1709#endif
Michael Hennerich50c4c082009-09-22 13:10:09 +00001710#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
1711 {
1712 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
1713 },
1714#endif
Michael Hennerichddcd7cb2009-09-22 15:36:55 +00001715#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1716 {
1717 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2C),
1718 },
1719#endif
Michael Hennerich78756c62009-10-13 15:28:33 +00001720#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
1721 {
1722 I2C_BOARD_INFO("adp8870", 0x2B),
1723 .platform_data = (void *)&adp8870_pdata,
1724 },
1725#endif
Cliff Caid53127f2009-10-15 02:33:04 +00001726#if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE)
1727 {
1728 I2C_BOARD_INFO("adau1371", 0x1A),
1729 },
1730#endif
Cliff Cai04267632009-10-28 06:50:36 +00001731#if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE)
1732 {
1733 I2C_BOARD_INFO("adau1761", 0x38),
1734 },
1735#endif
Michael Hennerich1f13f2f2009-11-17 10:18:27 +00001736#if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
1737 {
1738 I2C_BOARD_INFO("ad5258", 0x18),
1739 },
1740#endif
Cliff Cai29bb3bc2010-01-14 08:28:38 +00001741#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
1742 {
1743 I2C_BOARD_INFO("ssm2602", 0x1b),
1744 },
1745#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001746};
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001747
Bryan Wu1394f032007-05-06 14:50:22 -07001748#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +00001749#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1750static struct resource bfin_sport0_uart_resources[] = {
1751 {
1752 .start = SPORT0_TCR1,
1753 .end = SPORT0_MRCS3+4,
1754 .flags = IORESOURCE_MEM,
1755 },
1756 {
1757 .start = IRQ_SPORT0_RX,
1758 .end = IRQ_SPORT0_RX+1,
1759 .flags = IORESOURCE_IRQ,
1760 },
1761 {
1762 .start = IRQ_SPORT0_ERROR,
1763 .end = IRQ_SPORT0_ERROR,
1764 .flags = IORESOURCE_IRQ,
1765 },
1766};
1767
1768unsigned short bfin_sport0_peripherals[] = {
1769 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
1770 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
1771};
1772
Bryan Wu1394f032007-05-06 14:50:22 -07001773static struct platform_device bfin_sport0_uart_device = {
1774 .name = "bfin-sport-uart",
1775 .id = 0,
Sonic Zhangdf5de262009-09-23 05:01:56 +00001776 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
1777 .resource = bfin_sport0_uart_resources,
1778 .dev = {
1779 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
1780 },
1781};
1782#endif
1783#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1784static struct resource bfin_sport1_uart_resources[] = {
1785 {
1786 .start = SPORT1_TCR1,
1787 .end = SPORT1_MRCS3+4,
1788 .flags = IORESOURCE_MEM,
1789 },
1790 {
1791 .start = IRQ_SPORT1_RX,
1792 .end = IRQ_SPORT1_RX+1,
1793 .flags = IORESOURCE_IRQ,
1794 },
1795 {
1796 .start = IRQ_SPORT1_ERROR,
1797 .end = IRQ_SPORT1_ERROR,
1798 .flags = IORESOURCE_IRQ,
1799 },
1800};
1801
1802unsigned short bfin_sport1_peripherals[] = {
1803 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
1804 P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
Bryan Wu1394f032007-05-06 14:50:22 -07001805};
1806
1807static struct platform_device bfin_sport1_uart_device = {
1808 .name = "bfin-sport-uart",
1809 .id = 1,
Sonic Zhangdf5de262009-09-23 05:01:56 +00001810 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
1811 .resource = bfin_sport1_uart_resources,
1812 .dev = {
1813 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
1814 },
Bryan Wu1394f032007-05-06 14:50:22 -07001815};
1816#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +00001817#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001818
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001819#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001820#define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
1821/* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001822
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001823#ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
1824#define PATA_INT IRQ_PF5
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001825static struct pata_platform_info bfin_pata_platform_data = {
1826 .ioport_shift = 1,
Mike Frysinger64e5c512007-10-30 11:56:13 +08001827 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001828};
1829
1830static struct resource bfin_pata_resources[] = {
1831 {
1832 .start = 0x20314020,
1833 .end = 0x2031403F,
1834 .flags = IORESOURCE_MEM,
1835 },
1836 {
1837 .start = 0x2031401C,
1838 .end = 0x2031401F,
1839 .flags = IORESOURCE_MEM,
1840 },
1841 {
1842 .start = PATA_INT,
1843 .end = PATA_INT,
1844 .flags = IORESOURCE_IRQ,
1845 },
1846};
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001847#elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
1848static struct pata_platform_info bfin_pata_platform_data = {
1849 .ioport_shift = 0,
1850};
Michael Hennerich648882d2009-04-21 12:05:50 +00001851/* CompactFlash Storage Card Memory Mapped Adressing
1852 * /REG = A11 = 1
1853 */
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001854static struct resource bfin_pata_resources[] = {
1855 {
Michael Hennerich648882d2009-04-21 12:05:50 +00001856 .start = 0x20211800,
1857 .end = 0x20211807,
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001858 .flags = IORESOURCE_MEM,
1859 },
1860 {
Michael Hennerich648882d2009-04-21 12:05:50 +00001861 .start = 0x2021180E, /* Device Ctl */
1862 .end = 0x2021180E,
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001863 .flags = IORESOURCE_MEM,
1864 },
1865};
1866#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001867
1868static struct platform_device bfin_pata_device = {
1869 .name = "pata_platform",
1870 .id = -1,
1871 .num_resources = ARRAY_SIZE(bfin_pata_resources),
1872 .resource = bfin_pata_resources,
1873 .dev = {
1874 .platform_data = &bfin_pata_platform_data,
1875 }
1876};
1877#endif
1878
Michael Hennerich14b03202008-05-07 11:41:26 +08001879static const unsigned int cclk_vlev_datasheet[] =
1880{
1881 VRPAIR(VLEV_085, 250000000),
1882 VRPAIR(VLEV_090, 376000000),
1883 VRPAIR(VLEV_095, 426000000),
1884 VRPAIR(VLEV_100, 426000000),
1885 VRPAIR(VLEV_105, 476000000),
1886 VRPAIR(VLEV_110, 476000000),
1887 VRPAIR(VLEV_115, 476000000),
1888 VRPAIR(VLEV_120, 500000000),
1889 VRPAIR(VLEV_125, 533000000),
1890 VRPAIR(VLEV_130, 600000000),
1891};
1892
1893static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
1894 .tuple_tab = cclk_vlev_datasheet,
1895 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
1896 .vr_settling_time = 25 /* us */,
1897};
1898
1899static struct platform_device bfin_dpmc = {
1900 .name = "bfin dpmc",
1901 .dev = {
1902 .platform_data = &bfin_dmpc_vreg_data,
1903 },
1904};
1905
Barry Song336746e2009-10-13 09:19:18 +00001906#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1907static struct platform_device bfin_i2s = {
1908 .name = "bfin-i2s",
1909 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1910 /* TODO: add platform data here */
1911};
1912#endif
1913
Barry Song83124402009-08-06 21:03:02 +00001914#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1915static struct platform_device bfin_tdm = {
1916 .name = "bfin-tdm",
Barry Song336746e2009-10-13 09:19:18 +00001917 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1918 /* TODO: add platform data here */
1919};
1920#endif
1921
1922#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1923static struct platform_device bfin_ac97 = {
1924 .name = "bfin-ac97",
1925 .id = CONFIG_SND_BF5XX_SPORT_NUM,
Barry Song83124402009-08-06 21:03:02 +00001926 /* TODO: add platform data here */
1927};
1928#endif
1929
Bryan Wu1394f032007-05-06 14:50:22 -07001930static struct platform_device *stamp_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +08001931
1932 &bfin_dpmc,
1933
Bryan Wu1394f032007-05-06 14:50:22 -07001934#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
1935 &bfin_pcmcia_cf_device,
1936#endif
1937
1938#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1939 &rtc_device,
1940#endif
1941
1942#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
1943 &sl811_hcd_device,
1944#endif
1945
1946#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
1947 &isp1362_hcd_device,
1948#endif
1949
Michael Hennerich3f375692008-11-18 17:48:22 +08001950#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1951 &bfin_isp1760_device,
1952#endif
1953
Bryan Wu1394f032007-05-06 14:50:22 -07001954#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
1955 &smc91x_device,
1956#endif
1957
Alex Landauf40d24d2007-07-12 12:11:48 +08001958#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
1959 &dm9000_device,
1960#endif
1961
Barry Song706a01b2009-11-02 07:29:07 +00001962#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
1963 &bfin_can_device,
1964#endif
1965
Bryan Wu1394f032007-05-06 14:50:22 -07001966#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +08001967 &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -07001968 &bfin_mac_device,
1969#endif
1970
1971#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
1972 &net2272_bfin_device,
1973#endif
1974
1975#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001976 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -07001977#endif
1978
Cliff Cai1e9aa952009-03-28 23:28:51 +08001979#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1980 &bfin_sport_spi0_device,
1981 &bfin_sport_spi1_device,
1982#endif
1983
Bryan Wu1394f032007-05-06 14:50:22 -07001984#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1985 &bfin_fb_device,
1986#endif
1987
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001988#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1989 &bfin_lq035q1_device,
1990#endif
1991
Bryan Wu1394f032007-05-06 14:50:22 -07001992#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001993#ifdef CONFIG_SERIAL_BFIN_UART0
1994 &bfin_uart0_device,
1995#endif
1996#ifdef CONFIG_SERIAL_BFIN_UART1
1997 &bfin_uart1_device,
1998#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001999#endif
2000
Graf Yang5be36d22008-04-25 03:09:15 +08002001#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +08002002#ifdef CONFIG_BFIN_SIR0
2003 &bfin_sir0_device,
2004#endif
2005#ifdef CONFIG_BFIN_SIR1
2006 &bfin_sir1_device,
2007#endif
Graf Yang5be36d22008-04-25 03:09:15 +08002008#endif
2009
Bryan Wu1394f032007-05-06 14:50:22 -07002010#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
2011 &i2c_bfin_twi_device,
2012#endif
2013
2014#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +00002015#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
Bryan Wu1394f032007-05-06 14:50:22 -07002016 &bfin_sport0_uart_device,
Sonic Zhangdf5de262009-09-23 05:01:56 +00002017#endif
2018#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
Bryan Wu1394f032007-05-06 14:50:22 -07002019 &bfin_sport1_uart_device,
2020#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +00002021#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002022
2023#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2024 &bfin_pata_device,
2025#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +08002026
2027#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
2028 &bfin_device_gpiokeys,
2029#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +08002030
Mike Frysingerfc689112008-06-25 11:41:42 +08002031#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
2032 &bfin_async_nand_device,
2033#endif
2034
Mike Frysinger793dc272008-03-26 08:09:12 +08002035#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +08002036 &stamp_flash_device,
Mike Frysinger793dc272008-03-26 08:09:12 +08002037#endif
Barry Song83124402009-08-06 21:03:02 +00002038
Barry Song336746e2009-10-13 09:19:18 +00002039#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2040 &bfin_i2s,
2041#endif
2042
Barry Song83124402009-08-06 21:03:02 +00002043#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2044 &bfin_tdm,
2045#endif
Barry Song336746e2009-10-13 09:19:18 +00002046
2047#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2048 &bfin_ac97,
2049#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002050};
2051
2052static int __init stamp_init(void)
2053{
Harvey Harrisonb85d8582008-04-23 09:39:01 +08002054 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Mike Frysingerfc689112008-06-25 11:41:42 +08002055 bfin_plat_nand_init();
Mike Frysinger0531c462010-01-19 07:04:29 +00002056 adf702x_mac_init();
Bryan Wu1394f032007-05-06 14:50:22 -07002057 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
Sonic Zhangdf5de262009-09-23 05:01:56 +00002058 i2c_register_board_info(0, bfin_i2c_board_info,
2059 ARRAY_SIZE(bfin_i2c_board_info));
Mike Frysinger5bda2722008-06-07 15:03:01 +08002060 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002061
Bryan Wu1394f032007-05-06 14:50:22 -07002062 return 0;
2063}
2064
2065arch_initcall(stamp_init);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002066
Sonic Zhangc13ce9f2009-09-23 09:37:46 +00002067
2068static struct platform_device *stamp_early_devices[] __initdata = {
2069#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
2070#ifdef CONFIG_SERIAL_BFIN_UART0
2071 &bfin_uart0_device,
2072#endif
2073#ifdef CONFIG_SERIAL_BFIN_UART1
2074 &bfin_uart1_device,
2075#endif
2076#endif
2077
2078#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
2079#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2080 &bfin_sport0_uart_device,
2081#endif
2082#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2083 &bfin_sport1_uart_device,
2084#endif
2085#endif
2086};
2087
2088void __init native_machine_early_platform_add_devices(void)
2089{
2090 printk(KERN_INFO "register early platform devices\n");
2091 early_platform_add_devices(stamp_early_devices,
2092 ARRAY_SIZE(stamp_early_devices));
2093}
2094
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002095void native_machine_restart(char *cmd)
2096{
2097 /* workaround reboot hang when booting from SPI */
2098 if ((bfin_read_SYSCR() & 0x7) == 0x3)
Sonic Zhangb52dae32009-02-04 16:49:45 +08002099 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002100}
Mike Frysinger137b1522007-11-22 16:07:03 +08002101
2102/*
2103 * Currently the MAC address is saved in Flash by U-Boot
2104 */
2105#define FLASH_MAC 0x203f0000
Mike Frysinger9862cc52007-11-15 21:21:20 +08002106void bfin_get_ether_addr(char *addr)
Mike Frysinger137b1522007-11-22 16:07:03 +08002107{
2108 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
2109 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
2110}
Mike Frysinger9862cc52007-11-15 21:21:20 +08002111EXPORT_SYMBOL(bfin_get_ether_addr);