blob: 4a09ce90ca4b4905d9aae65ea47835465e8a15da [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>
Sonic Zhangf32792d2010-02-09 02:47:09 +000038#ifdef CONFIG_REGULATOR_AD5398
39#include <linux/regulator/ad5398.h>
40#endif
41#include <linux/regulator/consumer.h>
42#include <linux/regulator/userspace-consumer.h>
Bryan Wu1394f032007-05-06 14:50:22 -070043
44/*
45 * Name the Board for the /proc/cpuinfo
46 */
Mike Frysingerfe85cad2008-11-18 17:48:22 +080047const char bfin_board_name[] = "ADI BF537-STAMP";
Bryan Wu1394f032007-05-06 14:50:22 -070048
49/*
50 * Driver needs to know address, irq and flag pin.
51 */
52
Bryan Wu1394f032007-05-06 14:50:22 -070053#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
Michael Hennerich3f375692008-11-18 17:48:22 +080054#include <linux/usb/isp1760.h>
55static struct resource bfin_isp1760_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -070056 [0] = {
Michael Hennerich3f375692008-11-18 17:48:22 +080057 .start = 0x203C0000,
58 .end = 0x203C0000 + 0x000fffff,
Bryan Wu1394f032007-05-06 14:50:22 -070059 .flags = IORESOURCE_MEM,
60 },
61 [1] = {
Michael Hennerich3f375692008-11-18 17:48:22 +080062 .start = IRQ_PF7,
63 .end = IRQ_PF7,
Michael Hennerich6a6be3d2009-01-07 23:14:39 +080064 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
Bryan Wu1394f032007-05-06 14:50:22 -070065 },
66};
67
Michael Hennerich3f375692008-11-18 17:48:22 +080068static struct isp1760_platform_data isp1760_priv = {
69 .is_isp1761 = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080070 .bus_width_16 = 1,
71 .port1_otg = 0,
72 .analog_oc = 0,
73 .dack_polarity_high = 0,
74 .dreq_polarity_high = 0,
75};
76
77static struct platform_device bfin_isp1760_device = {
Michael Hennerichc6feb7682009-10-15 10:37:33 +000078 .name = "isp1760",
Bryan Wu1394f032007-05-06 14:50:22 -070079 .id = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080080 .dev = {
81 .platform_data = &isp1760_priv,
82 },
83 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
84 .resource = bfin_isp1760_resources,
Bryan Wu1394f032007-05-06 14:50:22 -070085};
Bryan Wu1394f032007-05-06 14:50:22 -070086#endif
87
Michael Hennerich2463ef22008-01-27 16:49:48 +080088#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
Michael Hennerich2463ef22008-01-27 16:49:48 +080089#include <linux/gpio_keys.h>
90
91static struct gpio_keys_button bfin_gpio_keys_table[] = {
92 {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"},
93 {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"},
94 {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"},
95 {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"},
96};
97
98static struct gpio_keys_platform_data bfin_gpio_keys_data = {
99 .buttons = bfin_gpio_keys_table,
100 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
101};
102
103static struct platform_device bfin_device_gpiokeys = {
104 .name = "gpio-keys",
105 .dev = {
106 .platform_data = &bfin_gpio_keys_data,
107 },
108};
109#endif
110
Bryan Wu1394f032007-05-06 14:50:22 -0700111#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
112static struct resource bfin_pcmcia_cf_resources[] = {
113 {
114 .start = 0x20310000, /* IO PORT */
115 .end = 0x20312000,
116 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800117 }, {
Simon Arlottd2d50aa2007-06-11 15:31:30 +0800118 .start = 0x20311000, /* Attribute Memory */
Bryan Wu1394f032007-05-06 14:50:22 -0700119 .end = 0x20311FFF,
120 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800121 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700122 .start = IRQ_PF4,
123 .end = IRQ_PF4,
124 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800125 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700126 .start = 6, /* Card Detect PF6 */
127 .end = 6,
128 .flags = IORESOURCE_IRQ,
129 },
130};
131
132static struct platform_device bfin_pcmcia_cf_device = {
133 .name = "bfin_cf_pcmcia",
134 .id = -1,
135 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
136 .resource = bfin_pcmcia_cf_resources,
137};
138#endif
139
140#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
141static struct platform_device rtc_device = {
142 .name = "rtc-bfin",
143 .id = -1,
144};
145#endif
146
147#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Michael Hennerich61f09b52009-07-24 08:48:31 +0000148#include <linux/smc91x.h>
149
150static struct smc91x_platdata smc91x_info = {
151 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
152 .leda = RPC_LED_100_10,
153 .ledb = RPC_LED_TX_RX,
154};
155
Bryan Wu1394f032007-05-06 14:50:22 -0700156static struct resource smc91x_resources[] = {
157 {
158 .name = "smc91x-regs",
159 .start = 0x20300300,
160 .end = 0x20300300 + 16,
161 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800162 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700163
164 .start = IRQ_PF7,
165 .end = IRQ_PF7,
166 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
167 },
168};
169static struct platform_device smc91x_device = {
170 .name = "smc91x",
171 .id = 0,
172 .num_resources = ARRAY_SIZE(smc91x_resources),
173 .resource = smc91x_resources,
Michael Hennerich61f09b52009-07-24 08:48:31 +0000174 .dev = {
175 .platform_data = &smc91x_info,
176 },
Bryan Wu1394f032007-05-06 14:50:22 -0700177};
178#endif
179
Alex Landauf40d24d2007-07-12 12:11:48 +0800180#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
181static struct resource dm9000_resources[] = {
182 [0] = {
183 .start = 0x203FB800,
Barry Songb3dec4a2009-07-27 06:42:50 +0000184 .end = 0x203FB800 + 1,
Alex Landauf40d24d2007-07-12 12:11:48 +0800185 .flags = IORESOURCE_MEM,
186 },
187 [1] = {
Barry Songb3dec4a2009-07-27 06:42:50 +0000188 .start = 0x203FB804,
189 .end = 0x203FB804 + 1,
190 .flags = IORESOURCE_MEM,
191 },
192 [2] = {
Alex Landauf40d24d2007-07-12 12:11:48 +0800193 .start = IRQ_PF9,
194 .end = IRQ_PF9,
195 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
196 },
197};
198
199static struct platform_device dm9000_device = {
200 .name = "dm9000",
201 .id = -1,
202 .num_resources = ARRAY_SIZE(dm9000_resources),
203 .resource = dm9000_resources,
204};
205#endif
206
Bryan Wu1394f032007-05-06 14:50:22 -0700207#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
208static struct resource sl811_hcd_resources[] = {
209 {
210 .start = 0x20340000,
211 .end = 0x20340000,
212 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800213 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700214 .start = 0x20340004,
215 .end = 0x20340004,
216 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800217 }, {
Mike Frysinger01218652009-12-21 15:07:43 +0000218 .start = IRQ_PF4,
219 .end = IRQ_PF4,
Bryan Wu1394f032007-05-06 14:50:22 -0700220 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
221 },
222};
223
224#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
225void sl811_port_power(struct device *dev, int is_on)
226{
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800227 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
Michael Hennerichacbcd262008-01-22 18:36:20 +0800228 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
Bryan Wu1394f032007-05-06 14:50:22 -0700229}
230#endif
231
232static struct sl811_platform_data sl811_priv = {
233 .potpg = 10,
234 .power = 250, /* == 500mA */
235#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
236 .port_power = &sl811_port_power,
237#endif
238};
239
240static struct platform_device sl811_hcd_device = {
241 .name = "sl811-hcd",
242 .id = 0,
243 .dev = {
244 .platform_data = &sl811_priv,
245 },
246 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
247 .resource = sl811_hcd_resources,
248};
249#endif
250
251#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
252static struct resource isp1362_hcd_resources[] = {
253 {
254 .start = 0x20360000,
255 .end = 0x20360000,
256 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800257 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700258 .start = 0x20360004,
259 .end = 0x20360004,
260 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800261 }, {
Mike Frysinger21b03cf2009-09-24 05:44:36 +0000262 .start = IRQ_PF3,
263 .end = IRQ_PF3,
Bryan Wu1394f032007-05-06 14:50:22 -0700264 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
265 },
266};
267
268static struct isp1362_platform_data isp1362_priv = {
269 .sel15Kres = 1,
270 .clknotstop = 0,
271 .oc_enable = 0,
272 .int_act_high = 0,
273 .int_edge_triggered = 0,
274 .remote_wakeup_connected = 0,
275 .no_power_switching = 1,
276 .power_switching_mode = 0,
277};
278
279static struct platform_device isp1362_hcd_device = {
280 .name = "isp1362-hcd",
281 .id = 0,
282 .dev = {
283 .platform_data = &isp1362_priv,
284 },
285 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
286 .resource = isp1362_hcd_resources,
287};
288#endif
289
Barry Song706a01b2009-11-02 07:29:07 +0000290#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
291unsigned short bfin_can_peripherals[] = {
292 P_CAN0_RX, P_CAN0_TX, 0
293};
294
295static struct resource bfin_can_resources[] = {
296 {
297 .start = 0xFFC02A00,
298 .end = 0xFFC02FFF,
299 .flags = IORESOURCE_MEM,
300 },
301 {
302 .start = IRQ_CAN_RX,
303 .end = IRQ_CAN_RX,
304 .flags = IORESOURCE_IRQ,
305 },
306 {
307 .start = IRQ_CAN_TX,
308 .end = IRQ_CAN_TX,
309 .flags = IORESOURCE_IRQ,
310 },
311 {
312 .start = IRQ_CAN_ERROR,
313 .end = IRQ_CAN_ERROR,
314 .flags = IORESOURCE_IRQ,
315 },
316};
317
318static struct platform_device bfin_can_device = {
319 .name = "bfin_can",
320 .num_resources = ARRAY_SIZE(bfin_can_resources),
321 .resource = bfin_can_resources,
322 .dev = {
323 .platform_data = &bfin_can_peripherals, /* Passed to driver */
324 },
325};
326#endif
327
Bryan Wu1394f032007-05-06 14:50:22 -0700328#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800329static struct platform_device bfin_mii_bus = {
330 .name = "bfin_mii_bus",
331};
332
Bryan Wu1394f032007-05-06 14:50:22 -0700333static struct platform_device bfin_mac_device = {
334 .name = "bfin_mac",
Graf Yang65319622009-02-04 16:49:45 +0800335 .dev.platform_data = &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700336};
337#endif
338
339#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
340static struct resource net2272_bfin_resources[] = {
341 {
342 .start = 0x20300000,
343 .end = 0x20300000 + 0x100,
344 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800345 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700346 .start = IRQ_PF7,
347 .end = IRQ_PF7,
348 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
349 },
350};
351
352static struct platform_device net2272_bfin_device = {
353 .name = "net2272",
354 .id = -1,
355 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
356 .resource = net2272_bfin_resources,
357};
358#endif
359
Mike Frysingerfc689112008-06-25 11:41:42 +0800360#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
361#ifdef CONFIG_MTD_PARTITIONS
362const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
363
364static struct mtd_partition bfin_plat_nand_partitions[] = {
365 {
Robin Getzaa582972008-08-05 17:47:29 +0800366 .name = "linux kernel(nand)",
Mike Frysingerfc689112008-06-25 11:41:42 +0800367 .size = 0x400000,
368 .offset = 0,
369 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800370 .name = "file system(nand)",
Mike Frysingerfc689112008-06-25 11:41:42 +0800371 .size = MTDPART_SIZ_FULL,
372 .offset = MTDPART_OFS_APPEND,
373 },
374};
375#endif
376
377#define BFIN_NAND_PLAT_CLE 2
378#define BFIN_NAND_PLAT_ALE 1
379static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
380{
381 struct nand_chip *this = mtd->priv;
382
383 if (cmd == NAND_CMD_NONE)
384 return;
385
386 if (ctrl & NAND_CLE)
387 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));
388 else
389 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));
390}
391
392#define BFIN_NAND_PLAT_READY GPIO_PF3
393static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
394{
395 return gpio_get_value(BFIN_NAND_PLAT_READY);
396}
397
398static struct platform_nand_data bfin_plat_nand_data = {
399 .chip = {
400 .chip_delay = 30,
401#ifdef CONFIG_MTD_PARTITIONS
402 .part_probe_types = part_probes,
403 .partitions = bfin_plat_nand_partitions,
404 .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
405#endif
406 },
407 .ctrl = {
408 .cmd_ctrl = bfin_plat_nand_cmd_ctrl,
409 .dev_ready = bfin_plat_nand_dev_ready,
410 },
411};
412
413#define MAX(x, y) (x > y ? x : y)
414static struct resource bfin_plat_nand_resources = {
415 .start = 0x20212000,
416 .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
417 .flags = IORESOURCE_IO,
418};
419
420static struct platform_device bfin_async_nand_device = {
421 .name = "gen_nand",
422 .id = -1,
423 .num_resources = 1,
424 .resource = &bfin_plat_nand_resources,
425 .dev = {
426 .platform_data = &bfin_plat_nand_data,
427 },
428};
429
430static void bfin_plat_nand_init(void)
431{
432 gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
433}
434#else
435static void bfin_plat_nand_init(void) {}
436#endif
437
Mike Frysinger793dc272008-03-26 08:09:12 +0800438#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800439static struct mtd_partition stamp_partitions[] = {
440 {
Robin Getzaa582972008-08-05 17:47:29 +0800441 .name = "bootloader(nor)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800442 .size = 0x40000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800443 .offset = 0,
444 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800445 .name = "linux kernel(nor)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800446 .size = 0x180000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800447 .offset = MTDPART_OFS_APPEND,
448 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800449 .name = "file system(nor)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800450 .size = 0x400000 - 0x40000 - 0x180000 - 0x10000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800451 .offset = MTDPART_OFS_APPEND,
452 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800453 .name = "MAC Address(nor)",
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800454 .size = MTDPART_SIZ_FULL,
455 .offset = 0x3F0000,
456 .mask_flags = MTD_WRITEABLE,
457 }
458};
459
460static struct physmap_flash_data stamp_flash_data = {
461 .width = 2,
462 .parts = stamp_partitions,
463 .nr_parts = ARRAY_SIZE(stamp_partitions),
Barry Song38e76732010-01-15 03:24:39 +0000464#ifdef CONFIG_ROMKERNEL
465 .probe_type = "map_rom",
466#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800467};
468
469static struct resource stamp_flash_resource = {
470 .start = 0x20000000,
471 .end = 0x203fffff,
472 .flags = IORESOURCE_MEM,
473};
474
475static struct platform_device stamp_flash_device = {
476 .name = "physmap-flash",
477 .id = 0,
478 .dev = {
479 .platform_data = &stamp_flash_data,
480 },
481 .num_resources = 1,
482 .resource = &stamp_flash_resource,
483};
Mike Frysinger793dc272008-03-26 08:09:12 +0800484#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800485
Bryan Wu1394f032007-05-06 14:50:22 -0700486#if defined(CONFIG_MTD_M25P80) \
487 || defined(CONFIG_MTD_M25P80_MODULE)
488static struct mtd_partition bfin_spi_flash_partitions[] = {
489 {
Robin Getzaa582972008-08-05 17:47:29 +0800490 .name = "bootloader(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800491 .size = 0x00040000,
Bryan Wu1394f032007-05-06 14:50:22 -0700492 .offset = 0,
493 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800494 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800495 .name = "linux kernel(spi)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800496 .size = 0x180000,
Mike Frysingeredf05642008-02-25 11:38:11 +0800497 .offset = MTDPART_OFS_APPEND,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800498 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800499 .name = "file system(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800500 .size = MTDPART_SIZ_FULL,
501 .offset = MTDPART_OFS_APPEND,
Bryan Wu1394f032007-05-06 14:50:22 -0700502 }
503};
504
505static struct flash_platform_data bfin_spi_flash_data = {
506 .name = "m25p80",
507 .parts = bfin_spi_flash_partitions,
508 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
Michael Hennerich88a80782008-11-18 17:48:22 +0800509 /* .type = "m25p64", */
Bryan Wu1394f032007-05-06 14:50:22 -0700510};
511
512/* SPI flash chip (m25p64) */
513static struct bfin5xx_spi_chip spi_flash_chip_info = {
514 .enable_dma = 0, /* use dma transfer with this chip*/
515 .bits_per_word = 8,
516};
517#endif
518
Mike Frysingera261eec2009-05-20 14:05:36 +0000519#if defined(CONFIG_BFIN_SPI_ADC) \
520 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700521/* SPI ADC chip */
522static struct bfin5xx_spi_chip spi_adc_chip_info = {
523 .enable_dma = 1, /* use dma transfer with this chip*/
524 .bits_per_word = 16,
525};
526#endif
527
Barry Song83124402009-08-06 21:03:02 +0000528#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
529 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700530static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
531 .enable_dma = 0,
532 .bits_per_word = 16,
533};
534#endif
535
Barry Song3b827902010-01-27 09:01:36 +0000536#if defined(CONFIG_SND_BF5XX_SOC_AD193X) \
537 || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
Barry Songd4b834c2009-06-04 10:14:17 +0000538static struct bfin5xx_spi_chip ad1938_spi_chip_info = {
539 .enable_dma = 0,
540 .bits_per_word = 8,
Barry Songd4b834c2009-06-04 10:14:17 +0000541};
542#endif
543
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000544#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000545#include <linux/input/ad714x.h>
546static struct bfin5xx_spi_chip ad7147_spi_chip_info = {
547 .enable_dma = 0,
548 .bits_per_word = 16,
549};
550
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000551static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000552 {
553 .start_stage = 0,
554 .end_stage = 7,
555 .max_coord = 128,
556 },
557};
558
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000559static struct ad714x_button_plat ad7147_spi_button_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000560 {
561 .keycode = BTN_FORWARD,
562 .l_mask = 0,
563 .h_mask = 0x600,
564 },
565 {
566 .keycode = BTN_LEFT,
567 .l_mask = 0,
568 .h_mask = 0x500,
569 },
570 {
571 .keycode = BTN_MIDDLE,
572 .l_mask = 0,
573 .h_mask = 0x800,
574 },
575 {
576 .keycode = BTN_RIGHT,
577 .l_mask = 0x100,
578 .h_mask = 0x400,
579 },
580 {
581 .keycode = BTN_BACK,
582 .l_mask = 0x200,
583 .h_mask = 0x400,
584 },
585};
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000586static struct ad714x_platform_data ad7147_spi_platform_data = {
Barry Song427f2772009-07-17 07:04:55 +0000587 .slider_num = 1,
588 .button_num = 5,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000589 .slider = ad7147_spi_slider_plat,
590 .button = ad7147_spi_button_plat,
Barry Song427f2772009-07-17 07:04:55 +0000591 .stage_cfg_reg = {
592 {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
593 {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
594 {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
595 {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
596 {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
597 {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
598 {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
599 {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
600 {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
601 {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
602 {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
603 {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
604 },
605 .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
606};
607#endif
608
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000609#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000610#include <linux/input/ad714x.h>
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000611static struct ad714x_button_plat ad7142_i2c_button_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000612 {
613 .keycode = BTN_1,
614 .l_mask = 0,
615 .h_mask = 0x1,
616 },
617 {
618 .keycode = BTN_2,
619 .l_mask = 0,
620 .h_mask = 0x2,
621 },
622 {
623 .keycode = BTN_3,
624 .l_mask = 0,
625 .h_mask = 0x4,
626 },
627 {
628 .keycode = BTN_4,
629 .l_mask = 0x0,
630 .h_mask = 0x8,
631 },
632};
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000633static struct ad714x_platform_data ad7142_i2c_platform_data = {
Barry Song427f2772009-07-17 07:04:55 +0000634 .button_num = 4,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000635 .button = ad7142_i2c_button_plat,
Barry Song427f2772009-07-17 07:04:55 +0000636 .stage_cfg_reg = {
637 /* fixme: figure out right setting for all comoponent according
638 * to hardware feature of EVAL-AD7142EB board */
639 {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
640 {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
641 {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
642 {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
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 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
647 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
648 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
649 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
650 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
651 },
652 .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
653};
654#endif
655
Graf Yangf5f95312010-02-10 07:15:59 +0000656#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
657static struct bfin5xx_spi_chip ad2s90_spi_chip_info = {
658 .enable_dma = 0,
659 .bits_per_word = 16,
660};
661#endif
662
Yi Lif79ea4c2009-01-07 23:14:38 +0800663#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
664#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
665
666static int bfin_mmc_spi_init(struct device *dev,
667 irqreturn_t (*detect_int)(int, void *), void *data)
668{
669 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
670 IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
671}
672
673static void bfin_mmc_spi_exit(struct device *dev, void *data)
674{
675 free_irq(MMC_SPI_CARD_DETECT_INT, data);
676}
677
678static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
679 .init = bfin_mmc_spi_init,
680 .exit = bfin_mmc_spi_exit,
681 .detect_delay = 100, /* msecs */
682};
683
684static struct bfin5xx_spi_chip mmc_spi_chip_info = {
685 .enable_dma = 0,
686 .bits_per_word = 8,
Yi Lie68d1eb2009-06-03 09:46:22 +0000687 .pio_interrupt = 0,
Yi Lif79ea4c2009-01-07 23:14:38 +0800688};
689#endif
690
Bryan Wu1394f032007-05-06 14:50:22 -0700691#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800692#include <linux/spi/ad7877.h>
Bryan Wu1394f032007-05-06 14:50:22 -0700693static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700694 .enable_dma = 0,
695 .bits_per_word = 16,
696};
697
698static const struct ad7877_platform_data bfin_ad7877_ts_info = {
699 .model = 7877,
700 .vref_delay_usecs = 50, /* internal, no capacitor */
701 .x_plate_ohms = 419,
702 .y_plate_ohms = 486,
703 .pressure_max = 1000,
704 .pressure_min = 0,
705 .stopacq_polarity = 1,
706 .first_conversion_delay = 3,
707 .acquisition_time = 1,
708 .averaging = 1,
709 .pen_down_acc_interval = 1,
710};
711#endif
712
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800713#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
714#include <linux/spi/ad7879.h>
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800715static const struct ad7879_platform_data bfin_ad7879_ts_info = {
716 .model = 7879, /* Model = AD7879 */
717 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
718 .pressure_max = 10000,
719 .pressure_min = 0,
720 .first_conversion_delay = 3, /* wait 512us before do a first conversion */
721 .acquisition_time = 1, /* 4us acquisition time per sample */
722 .median = 2, /* do 8 measurements */
723 .averaging = 1, /* take the average of 4 middle samples */
724 .pen_down_acc_interval = 255, /* 9.4 ms */
Michael Hennerich244d3422009-12-18 09:29:39 +0000725 .gpio_export = 1, /* Export GPIO to gpiolib */
726 .gpio_base = -1, /* Dynamic allocation */
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800727};
728#endif
729
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000730#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000731#include <linux/input/adxl34x.h>
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000732static const struct adxl34x_platform_data adxl34x_info = {
733 .x_axis_offset = 0,
734 .y_axis_offset = 0,
735 .z_axis_offset = 0,
736 .tap_threshold = 0x31,
737 .tap_duration = 0x10,
738 .tap_latency = 0x60,
739 .tap_window = 0xF0,
740 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
741 .act_axis_control = 0xFF,
742 .activity_threshold = 5,
743 .inactivity_threshold = 3,
744 .inactivity_time = 4,
745 .free_fall_threshold = 0x7,
746 .free_fall_time = 0x20,
747 .data_rate = 0x8,
748 .data_range = ADXL_FULL_RES,
749
750 .ev_type = EV_ABS,
751 .ev_code_x = ABS_X, /* EV_REL */
752 .ev_code_y = ABS_Y, /* EV_REL */
753 .ev_code_z = ABS_Z, /* EV_REL */
754
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000755 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000756
757/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
758/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
759 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
760 .fifo_mode = ADXL_FIFO_STREAM,
761};
762#endif
763
Michael Hennerichf5150152008-10-16 23:23:18 +0800764#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
765static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
766 .enable_dma = 0,
767 .bits_per_word = 16,
768};
769#endif
770
Michael Hennerich6e668932008-02-09 01:54:09 +0800771#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
772static struct bfin5xx_spi_chip spidev_chip_info = {
773 .enable_dma = 0,
774 .bits_per_word = 8,
775};
776#endif
777
Michael Hennerich2043f3f2008-10-13 14:46:30 +0800778#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
779static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
780 .enable_dma = 0,
781 .bits_per_word = 8,
782};
783#endif
784
Michael Hennerich85a192e2009-01-07 23:14:38 +0800785#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
786static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
787 .enable_dma = 1,
788 .bits_per_word = 8,
789 .cs_gpio = GPIO_PF10,
790};
791#endif
792
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000793#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
794static struct bfin5xx_spi_chip adf7021_spi_chip_info = {
795 .bits_per_word = 16,
796 .cs_gpio = GPIO_PF10,
797};
798
799#include <linux/spi/adf702x.h>
800#define TXREG 0x0160A470
801static const u32 adf7021_regs[] = {
802 0x09608FA0,
803 0x00575011,
804 0x00A7F092,
805 0x2B141563,
806 0x81F29E94,
807 0x00003155,
808 0x050A4F66,
809 0x00000007,
810 0x00000008,
811 0x000231E9,
812 0x3296354A,
813 0x891A2B3B,
814 0x00000D9C,
815 0x0000000D,
816 0x0000000E,
817 0x0000000F,
818};
819
820static struct adf702x_platform_data adf7021_platform_data = {
821 .regs_base = (void *)SPORT1_TCR1,
822 .dma_ch_rx = CH_SPORT1_RX,
823 .dma_ch_tx = CH_SPORT1_TX,
824 .irq_sport_err = IRQ_SPORT1_ERROR,
825 .gpio_int_rfs = GPIO_PF8,
826 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_RFS, P_SPORT1_DRPRI,
827 P_SPORT1_RSCLK, P_SPORT1_TSCLK, 0},
828 .adf702x_model = MODEL_ADF7021,
829 .adf702x_regs = adf7021_regs,
830 .tx_reg = TXREG,
831};
Mike Frysinger0531c462010-01-19 07:04:29 +0000832static inline void adf702x_mac_init(void)
833{
834 random_ether_addr(adf7021_platform_data.mac_addr);
835}
836#else
837static inline void adf702x_mac_init(void) {}
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000838#endif
839
Michael Hennerichfe5b25c2010-02-04 14:41:39 +0000840#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
841#include <linux/spi/ads7846.h>
842static struct bfin5xx_spi_chip ad7873_spi_chip_info = {
843 .bits_per_word = 8,
844};
845
846static int ads7873_get_pendown_state(void)
847{
848 return gpio_get_value(GPIO_PF6);
849}
850
851static struct ads7846_platform_data __initdata ad7873_pdata = {
852 .model = 7873, /* AD7873 */
853 .x_max = 0xfff,
854 .y_max = 0xfff,
855 .x_plate_ohms = 620,
856 .debounce_max = 1,
857 .debounce_rep = 0,
858 .debounce_tol = (~0),
859 .get_pendown_state = ads7873_get_pendown_state,
860};
861#endif
862
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800863#if defined(CONFIG_MTD_DATAFLASH) \
864 || defined(CONFIG_MTD_DATAFLASH_MODULE)
Michael Hennerichceac2652008-08-25 17:39:11 +0800865
866static struct mtd_partition bfin_spi_dataflash_partitions[] = {
867 {
868 .name = "bootloader(spi)",
869 .size = 0x00040000,
870 .offset = 0,
871 .mask_flags = MTD_CAP_ROM
872 }, {
873 .name = "linux kernel(spi)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800874 .size = 0x180000,
Michael Hennerichceac2652008-08-25 17:39:11 +0800875 .offset = MTDPART_OFS_APPEND,
876 }, {
877 .name = "file system(spi)",
878 .size = MTDPART_SIZ_FULL,
879 .offset = MTDPART_OFS_APPEND,
880 }
881};
882
883static struct flash_platform_data bfin_spi_dataflash_data = {
884 .name = "SPI Dataflash",
885 .parts = bfin_spi_dataflash_partitions,
886 .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
887};
888
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800889/* DataFlash chip */
890static struct bfin5xx_spi_chip data_flash_chip_info = {
891 .enable_dma = 0, /* use dma transfer with this chip*/
892 .bits_per_word = 8,
893};
894#endif
895
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000896#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
897static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
898 .enable_dma = 0, /* use dma transfer with this chip*/
899 .bits_per_word = 8,
900};
901#endif
902
Bryan Wu1394f032007-05-06 14:50:22 -0700903static struct spi_board_info bfin_spi_board_info[] __initdata = {
904#if defined(CONFIG_MTD_M25P80) \
905 || defined(CONFIG_MTD_M25P80_MODULE)
906 {
907 /* the modalias must be the same as spi device driver name */
908 .modalias = "m25p80", /* Name of spi_driver for this device */
909 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800910 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700911 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
912 .platform_data = &bfin_spi_flash_data,
913 .controller_data = &spi_flash_chip_info,
914 .mode = SPI_MODE_3,
915 },
916#endif
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800917#if defined(CONFIG_MTD_DATAFLASH) \
918 || defined(CONFIG_MTD_DATAFLASH_MODULE)
919 { /* DataFlash chip */
920 .modalias = "mtd_dataflash",
Michael Hennerichceac2652008-08-25 17:39:11 +0800921 .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800922 .bus_num = 0, /* Framework bus number */
923 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
Michael Hennerichceac2652008-08-25 17:39:11 +0800924 .platform_data = &bfin_spi_dataflash_data,
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800925 .controller_data = &data_flash_chip_info,
926 .mode = SPI_MODE_3,
927 },
928#endif
Mike Frysingera261eec2009-05-20 14:05:36 +0000929#if defined(CONFIG_BFIN_SPI_ADC) \
930 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700931 {
932 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
933 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800934 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700935 .chip_select = 1, /* Framework chip select. */
936 .platform_data = NULL, /* No spi_driver specific config */
937 .controller_data = &spi_adc_chip_info,
938 },
939#endif
940
Barry Song83124402009-08-06 21:03:02 +0000941#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
942 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700943 {
Barry Songdac98172009-08-13 21:07:37 +0000944 .modalias = "ad1836",
Bryan Wu1394f032007-05-06 14:50:22 -0700945 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800946 .bus_num = 0,
Barry Song83124402009-08-06 21:03:02 +0000947 .chip_select = 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
Bryan Wu1394f032007-05-06 14:50:22 -0700948 .controller_data = &ad1836_spi_chip_info,
Barry Song83124402009-08-06 21:03:02 +0000949 .mode = SPI_MODE_3,
Bryan Wu1394f032007-05-06 14:50:22 -0700950 },
951#endif
Barry Songd4b834c2009-06-04 10:14:17 +0000952
Barry Song3b827902010-01-27 09:01:36 +0000953#if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
Barry Songd4b834c2009-06-04 10:14:17 +0000954 {
Barry Song3b827902010-01-27 09:01:36 +0000955 .modalias = "ad193x",
Barry Songd4b834c2009-06-04 10:14:17 +0000956 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
957 .bus_num = 0,
Barry Song08a54bf2009-09-18 09:14:38 +0000958 .chip_select = 5,
Barry Songd4b834c2009-06-04 10:14:17 +0000959 .controller_data = &ad1938_spi_chip_info,
960 .mode = SPI_MODE_3,
961 },
962#endif
963
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000964#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000965 {
966 .modalias = "ad714x_captouch",
967 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
968 .irq = IRQ_PF4,
969 .bus_num = 0,
970 .chip_select = 5,
971 .mode = SPI_MODE_3,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000972 .platform_data = &ad7147_spi_platform_data,
Barry Song427f2772009-07-17 07:04:55 +0000973 .controller_data = &ad7147_spi_chip_info,
974 },
975#endif
976
Graf Yangf5f95312010-02-10 07:15:59 +0000977#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
978 {
979 .modalias = "ad2s90",
980 .bus_num = 0,
981 .chip_select = 3, /* change it for your board */
982 .platform_data = NULL,
983 .controller_data = &ad2s90_spi_chip_info,
984 },
985#endif
986
Yi Lif79ea4c2009-01-07 23:14:38 +0800987#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
988 {
989 .modalias = "mmc_spi",
990 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
991 .bus_num = 0,
992 .chip_select = 4,
993 .platform_data = &bfin_mmc_spi_pdata,
994 .controller_data = &mmc_spi_chip_info,
995 .mode = SPI_MODE_3,
996 },
997#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700998#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
999 {
1000 .modalias = "ad7877",
1001 .platform_data = &bfin_ad7877_ts_info,
1002 .irq = IRQ_PF6,
1003 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Michael Hennerichc7d48962007-11-15 21:33:31 +08001004 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -07001005 .chip_select = 1,
1006 .controller_data = &spi_ad7877_chip_info,
1007 },
1008#endif
Michael Hennerichf5150152008-10-16 23:23:18 +08001009#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
Michael Hennerich46aa04f2008-10-13 11:30:17 +08001010 {
1011 .modalias = "ad7879",
1012 .platform_data = &bfin_ad7879_ts_info,
1013 .irq = IRQ_PF7,
1014 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1015 .bus_num = 0,
1016 .chip_select = 1,
1017 .controller_data = &spi_ad7879_chip_info,
1018 .mode = SPI_CPHA | SPI_CPOL,
1019 },
1020#endif
Michael Hennerich6e668932008-02-09 01:54:09 +08001021#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1022 {
1023 .modalias = "spidev",
1024 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1025 .bus_num = 0,
1026 .chip_select = 1,
1027 .controller_data = &spidev_chip_info,
1028 },
1029#endif
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001030#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1031 {
1032 .modalias = "bfin-lq035q1-spi",
1033 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1034 .bus_num = 0,
Michael Hennerich46aa04f2008-10-13 11:30:17 +08001035 .chip_select = 2,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001036 .controller_data = &lq035q1_spi_chip_info,
1037 .mode = SPI_CPHA | SPI_CPOL,
1038 },
1039#endif
Michael Hennerich85a192e2009-01-07 23:14:38 +08001040#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
1041 {
1042 .modalias = "enc28j60",
1043 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1044 .irq = IRQ_PF6,
1045 .bus_num = 0,
1046 .chip_select = 0, /* GPIO controlled SSEL */
1047 .controller_data = &enc28j60_spi_chip_info,
1048 .mode = SPI_MODE_0,
1049 },
1050#endif
Michael Hennerich57af8ed2009-10-16 12:35:20 +00001051#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1052 {
1053 .modalias = "adxl34x",
1054 .platform_data = &adxl34x_info,
1055 .irq = IRQ_PF6,
1056 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1057 .bus_num = 0,
1058 .chip_select = 2,
1059 .controller_data = &spi_adxl34x_chip_info,
1060 .mode = SPI_MODE_3,
1061 },
1062#endif
Michael Hennerichefaf7cd2009-11-12 16:54:08 +00001063#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
1064 {
1065 .modalias = "adf702x",
1066 .max_speed_hz = 16000000, /* max spi clock (SCK) speed in HZ */
1067 .bus_num = 0,
1068 .chip_select = 0, /* GPIO controlled SSEL */
1069 .controller_data = &adf7021_spi_chip_info,
1070 .platform_data = &adf7021_platform_data,
1071 .mode = SPI_MODE_0,
1072 },
1073#endif
Michael Hennerichfe5b25c2010-02-04 14:41:39 +00001074#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
1075 {
1076 .modalias = "ads7846",
1077 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1078 .bus_num = 0,
1079 .irq = IRQ_PF6,
1080 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1081 .controller_data = &ad7873_spi_chip_info,
1082 .platform_data = &ad7873_pdata,
1083 .mode = SPI_MODE_0,
1084 },
1085#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001086};
1087
Mike Frysinger5bda2722008-06-07 15:03:01 +08001088#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -07001089/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001090static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -07001091 .num_chipselect = 8,
1092 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +08001093 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -07001094};
1095
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001096/* SPI (0) */
1097static struct resource bfin_spi0_resource[] = {
1098 [0] = {
1099 .start = SPI0_REGBASE,
1100 .end = SPI0_REGBASE + 0xFF,
1101 .flags = IORESOURCE_MEM,
1102 },
1103 [1] = {
1104 .start = CH_SPI,
1105 .end = CH_SPI,
Yi Lie68d1eb2009-06-03 09:46:22 +00001106 .flags = IORESOURCE_DMA,
1107 },
1108 [2] = {
1109 .start = IRQ_SPI,
1110 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001111 .flags = IORESOURCE_IRQ,
1112 },
1113};
1114
1115static struct platform_device bfin_spi0_device = {
1116 .name = "bfin-spi",
1117 .id = 0, /* Bus number */
1118 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1119 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -07001120 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001121 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -07001122 },
1123};
1124#endif /* spi master and devices */
1125
Cliff Cai1e9aa952009-03-28 23:28:51 +08001126#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1127
1128/* SPORT SPI controller data */
1129static struct bfin5xx_spi_master bfin_sport_spi0_info = {
1130 .num_chipselect = 1, /* master only supports one device */
1131 .enable_dma = 0, /* master don't support DMA */
1132 .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,
1133 P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0},
1134};
1135
1136static struct resource bfin_sport_spi0_resource[] = {
1137 [0] = {
1138 .start = SPORT0_TCR1,
1139 .end = SPORT0_TCR1 + 0xFF,
1140 .flags = IORESOURCE_MEM,
1141 },
1142 [1] = {
1143 .start = IRQ_SPORT0_ERROR,
1144 .end = IRQ_SPORT0_ERROR,
1145 .flags = IORESOURCE_IRQ,
1146 },
1147};
1148
1149static struct platform_device bfin_sport_spi0_device = {
1150 .name = "bfin-sport-spi",
1151 .id = 1, /* Bus number */
1152 .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource),
1153 .resource = bfin_sport_spi0_resource,
1154 .dev = {
1155 .platform_data = &bfin_sport_spi0_info, /* Passed to driver */
1156 },
1157};
1158
1159static struct bfin5xx_spi_master bfin_sport_spi1_info = {
1160 .num_chipselect = 1, /* master only supports one device */
1161 .enable_dma = 0, /* master don't support DMA */
1162 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,
1163 P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0},
1164};
1165
1166static struct resource bfin_sport_spi1_resource[] = {
1167 [0] = {
1168 .start = SPORT1_TCR1,
1169 .end = SPORT1_TCR1 + 0xFF,
1170 .flags = IORESOURCE_MEM,
1171 },
1172 [1] = {
1173 .start = IRQ_SPORT1_ERROR,
1174 .end = IRQ_SPORT1_ERROR,
1175 .flags = IORESOURCE_IRQ,
1176 },
1177};
1178
1179static struct platform_device bfin_sport_spi1_device = {
1180 .name = "bfin-sport-spi",
1181 .id = 2, /* Bus number */
1182 .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource),
1183 .resource = bfin_sport_spi1_resource,
1184 .dev = {
1185 .platform_data = &bfin_sport_spi1_info, /* Passed to driver */
1186 },
1187};
1188
1189#endif /* sport spi master and devices */
1190
Bryan Wu1394f032007-05-06 14:50:22 -07001191#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1192static struct platform_device bfin_fb_device = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001193 .name = "bf537-lq035",
1194};
1195#endif
1196
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001197#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1198#include <asm/bfin-lq035q1.h>
1199
1200static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
Michael Hennerichd94a1aa2009-12-08 11:45:55 +00001201 .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
1202 .ppi_mode = USE_RGB565_16_BIT_PPI,
1203 .use_bl = 0, /* let something else control the LCD Blacklight */
1204 .gpio_bl = GPIO_PF7,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001205};
1206
1207static struct resource bfin_lq035q1_resources[] = {
1208 {
1209 .start = IRQ_PPI_ERROR,
1210 .end = IRQ_PPI_ERROR,
1211 .flags = IORESOURCE_IRQ,
1212 },
1213};
1214
1215static struct platform_device bfin_lq035q1_device = {
1216 .name = "bfin-lq035q1",
1217 .id = -1,
Michael Hennerichd94a1aa2009-12-08 11:45:55 +00001218 .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
1219 .resource = bfin_lq035q1_resources,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001220 .dev = {
1221 .platform_data = &bfin_lq035q1_data,
1222 },
1223};
1224#endif
1225
Bryan Wu1394f032007-05-06 14:50:22 -07001226#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang233b28a2007-11-21 17:04:41 +08001227#ifdef CONFIG_SERIAL_BFIN_UART0
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001228static struct resource bfin_uart0_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -07001229 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001230 .start = UART0_THR,
1231 .end = UART0_GCTL+2,
Bryan Wu1394f032007-05-06 14:50:22 -07001232 .flags = IORESOURCE_MEM,
Sonic Zhang233b28a2007-11-21 17:04:41 +08001233 },
Sonic Zhang233b28a2007-11-21 17:04:41 +08001234 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001235 .start = IRQ_UART0_RX,
1236 .end = IRQ_UART0_RX+1,
1237 .flags = IORESOURCE_IRQ,
1238 },
1239 {
1240 .start = IRQ_UART0_ERROR,
1241 .end = IRQ_UART0_ERROR,
1242 .flags = IORESOURCE_IRQ,
1243 },
1244 {
1245 .start = CH_UART0_TX,
1246 .end = CH_UART0_TX,
1247 .flags = IORESOURCE_DMA,
1248 },
1249 {
1250 .start = CH_UART0_RX,
1251 .end = CH_UART0_RX,
1252 .flags = IORESOURCE_DMA,
1253 },
1254#ifdef CONFIG_BFIN_UART0_CTSRTS
1255 { /* CTS pin */
1256 .start = GPIO_PG7,
1257 .end = GPIO_PG7,
1258 .flags = IORESOURCE_IO,
1259 },
1260 { /* RTS pin */
1261 .start = GPIO_PG6,
1262 .end = GPIO_PG6,
1263 .flags = IORESOURCE_IO,
Bryan Wu1394f032007-05-06 14:50:22 -07001264 },
Sonic Zhang233b28a2007-11-21 17:04:41 +08001265#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001266};
1267
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001268unsigned short bfin_uart0_peripherals[] = {
1269 P_UART0_TX, P_UART0_RX, 0
1270};
1271
1272static struct platform_device bfin_uart0_device = {
1273 .name = "bfin-uart",
1274 .id = 0,
1275 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
1276 .resource = bfin_uart0_resources,
1277 .dev = {
1278 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
1279 },
1280};
1281#endif
1282#ifdef CONFIG_SERIAL_BFIN_UART1
1283static struct resource bfin_uart1_resources[] = {
1284 {
1285 .start = UART1_THR,
1286 .end = UART1_GCTL+2,
1287 .flags = IORESOURCE_MEM,
1288 },
1289 {
1290 .start = IRQ_UART1_RX,
1291 .end = IRQ_UART1_RX+1,
1292 .flags = IORESOURCE_IRQ,
1293 },
1294 {
1295 .start = IRQ_UART1_ERROR,
1296 .end = IRQ_UART1_ERROR,
1297 .flags = IORESOURCE_IRQ,
1298 },
1299 {
1300 .start = CH_UART1_TX,
1301 .end = CH_UART1_TX,
1302 .flags = IORESOURCE_DMA,
1303 },
1304 {
1305 .start = CH_UART1_RX,
1306 .end = CH_UART1_RX,
1307 .flags = IORESOURCE_DMA,
1308 },
1309};
1310
1311unsigned short bfin_uart1_peripherals[] = {
1312 P_UART1_TX, P_UART1_RX, 0
1313};
1314
1315static struct platform_device bfin_uart1_device = {
Bryan Wu1394f032007-05-06 14:50:22 -07001316 .name = "bfin-uart",
1317 .id = 1,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001318 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
1319 .resource = bfin_uart1_resources,
1320 .dev = {
1321 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
1322 },
Bryan Wu1394f032007-05-06 14:50:22 -07001323};
1324#endif
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001325#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001326
Graf Yang5be36d22008-04-25 03:09:15 +08001327#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +08001328#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +08001329static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +08001330 {
1331 .start = 0xFFC00400,
1332 .end = 0xFFC004FF,
1333 .flags = IORESOURCE_MEM,
1334 },
Graf Yang42bd8bc2009-01-07 23:14:39 +08001335 {
1336 .start = IRQ_UART0_RX,
1337 .end = IRQ_UART0_RX+1,
1338 .flags = IORESOURCE_IRQ,
1339 },
1340 {
1341 .start = CH_UART0_RX,
1342 .end = CH_UART0_RX+1,
1343 .flags = IORESOURCE_DMA,
1344 },
1345};
1346
1347static struct platform_device bfin_sir0_device = {
1348 .name = "bfin_sir",
1349 .id = 0,
1350 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
1351 .resource = bfin_sir0_resources,
1352};
Graf Yang5be36d22008-04-25 03:09:15 +08001353#endif
1354#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +08001355static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +08001356 {
1357 .start = 0xFFC02000,
1358 .end = 0xFFC020FF,
1359 .flags = IORESOURCE_MEM,
1360 },
Graf Yang42bd8bc2009-01-07 23:14:39 +08001361 {
1362 .start = IRQ_UART1_RX,
1363 .end = IRQ_UART1_RX+1,
1364 .flags = IORESOURCE_IRQ,
1365 },
1366 {
1367 .start = CH_UART1_RX,
1368 .end = CH_UART1_RX+1,
1369 .flags = IORESOURCE_DMA,
1370 },
Graf Yang5be36d22008-04-25 03:09:15 +08001371};
1372
Graf Yang42bd8bc2009-01-07 23:14:39 +08001373static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +08001374 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +08001375 .id = 1,
1376 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
1377 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +08001378};
1379#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +08001380#endif
Graf Yang5be36d22008-04-25 03:09:15 +08001381
Bryan Wu1394f032007-05-06 14:50:22 -07001382#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001383static struct resource bfin_twi0_resource[] = {
1384 [0] = {
1385 .start = TWI0_REGBASE,
1386 .end = TWI0_REGBASE,
1387 .flags = IORESOURCE_MEM,
1388 },
1389 [1] = {
1390 .start = IRQ_TWI,
1391 .end = IRQ_TWI,
1392 .flags = IORESOURCE_IRQ,
1393 },
1394};
1395
Bryan Wu1394f032007-05-06 14:50:22 -07001396static struct platform_device i2c_bfin_twi_device = {
1397 .name = "i2c-bfin-twi",
1398 .id = 0,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001399 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1400 .resource = bfin_twi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -07001401};
1402#endif
1403
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001404#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001405static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
1406 [0] = KEY_GRAVE,
1407 [1] = KEY_1,
1408 [2] = KEY_2,
1409 [3] = KEY_3,
1410 [4] = KEY_4,
1411 [5] = KEY_5,
1412 [6] = KEY_6,
1413 [7] = KEY_7,
1414 [8] = KEY_8,
1415 [9] = KEY_9,
1416 [10] = KEY_0,
1417 [11] = KEY_MINUS,
1418 [12] = KEY_EQUAL,
1419 [13] = KEY_BACKSLASH,
1420 [15] = KEY_KP0,
1421 [16] = KEY_Q,
1422 [17] = KEY_W,
1423 [18] = KEY_E,
1424 [19] = KEY_R,
1425 [20] = KEY_T,
1426 [21] = KEY_Y,
1427 [22] = KEY_U,
1428 [23] = KEY_I,
1429 [24] = KEY_O,
1430 [25] = KEY_P,
1431 [26] = KEY_LEFTBRACE,
1432 [27] = KEY_RIGHTBRACE,
1433 [29] = KEY_KP1,
1434 [30] = KEY_KP2,
1435 [31] = KEY_KP3,
1436 [32] = KEY_A,
1437 [33] = KEY_S,
1438 [34] = KEY_D,
1439 [35] = KEY_F,
1440 [36] = KEY_G,
1441 [37] = KEY_H,
1442 [38] = KEY_J,
1443 [39] = KEY_K,
1444 [40] = KEY_L,
1445 [41] = KEY_SEMICOLON,
1446 [42] = KEY_APOSTROPHE,
1447 [43] = KEY_BACKSLASH,
1448 [45] = KEY_KP4,
1449 [46] = KEY_KP5,
1450 [47] = KEY_KP6,
1451 [48] = KEY_102ND,
1452 [49] = KEY_Z,
1453 [50] = KEY_X,
1454 [51] = KEY_C,
1455 [52] = KEY_V,
1456 [53] = KEY_B,
1457 [54] = KEY_N,
1458 [55] = KEY_M,
1459 [56] = KEY_COMMA,
1460 [57] = KEY_DOT,
1461 [58] = KEY_SLASH,
1462 [60] = KEY_KPDOT,
1463 [61] = KEY_KP7,
1464 [62] = KEY_KP8,
1465 [63] = KEY_KP9,
1466 [64] = KEY_SPACE,
1467 [65] = KEY_BACKSPACE,
1468 [66] = KEY_TAB,
1469 [67] = KEY_KPENTER,
1470 [68] = KEY_ENTER,
1471 [69] = KEY_ESC,
1472 [70] = KEY_DELETE,
1473 [74] = KEY_KPMINUS,
1474 [76] = KEY_UP,
1475 [77] = KEY_DOWN,
1476 [78] = KEY_RIGHT,
1477 [79] = KEY_LEFT,
1478};
1479
1480static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1481 .rows = 8,
1482 .cols = 10,
1483 .keymap = adp5588_keymap,
1484 .keymapsize = ARRAY_SIZE(adp5588_keymap),
1485 .repeat = 0,
1486};
1487#endif
1488
Michael Hennerich3ea57212009-03-28 22:15:07 +08001489#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1490#include <linux/mfd/adp5520.h>
1491
1492 /*
1493 * ADP5520/5501 Backlight Data
1494 */
1495
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001496static struct adp5520_backlight_platform_data adp5520_backlight_data = {
1497 .fade_in = ADP5520_FADE_T_1200ms,
1498 .fade_out = ADP5520_FADE_T_1200ms,
1499 .fade_led_law = ADP5520_BL_LAW_LINEAR,
1500 .en_ambl_sens = 1,
1501 .abml_filt = ADP5520_BL_AMBL_FILT_640ms,
1502 .l1_daylight_max = ADP5520_BL_CUR_mA(15),
1503 .l1_daylight_dim = ADP5520_BL_CUR_mA(0),
1504 .l2_office_max = ADP5520_BL_CUR_mA(7),
1505 .l2_office_dim = ADP5520_BL_CUR_mA(0),
1506 .l3_dark_max = ADP5520_BL_CUR_mA(3),
1507 .l3_dark_dim = ADP5520_BL_CUR_mA(0),
1508 .l2_trip = ADP5520_L2_COMP_CURR_uA(700),
1509 .l2_hyst = ADP5520_L2_COMP_CURR_uA(50),
1510 .l3_trip = ADP5520_L3_COMP_CURR_uA(80),
1511 .l3_hyst = ADP5520_L3_COMP_CURR_uA(20),
Michael Hennerich3ea57212009-03-28 22:15:07 +08001512};
1513
1514 /*
1515 * ADP5520/5501 LEDs Data
1516 */
1517
Michael Hennerich3ea57212009-03-28 22:15:07 +08001518static struct led_info adp5520_leds[] = {
1519 {
1520 .name = "adp5520-led1",
1521 .default_trigger = "none",
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001522 .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001523 },
1524#ifdef ADP5520_EN_ALL_LEDS
1525 {
1526 .name = "adp5520-led2",
1527 .default_trigger = "none",
1528 .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1,
1529 },
1530 {
1531 .name = "adp5520-led3",
1532 .default_trigger = "none",
1533 .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2,
1534 },
1535#endif
1536};
1537
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001538static struct adp5520_leds_platform_data adp5520_leds_data = {
Michael Hennerich3ea57212009-03-28 22:15:07 +08001539 .num_leds = ARRAY_SIZE(adp5520_leds),
1540 .leds = adp5520_leds,
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001541 .fade_in = ADP5520_FADE_T_600ms,
1542 .fade_out = ADP5520_FADE_T_600ms,
1543 .led_on_time = ADP5520_LED_ONT_600ms,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001544};
1545
1546 /*
1547 * ADP5520 GPIO Data
1548 */
1549
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001550static struct adp5520_gpio_platform_data adp5520_gpio_data = {
Michael Hennerich3ea57212009-03-28 22:15:07 +08001551 .gpio_start = 50,
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001552 .gpio_en_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
1553 .gpio_pullup_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001554};
1555
1556 /*
1557 * ADP5520 Keypad Data
1558 */
1559
Michael Hennerich3ea57212009-03-28 22:15:07 +08001560static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001561 [ADP5520_KEY(0, 0)] = KEY_GRAVE,
1562 [ADP5520_KEY(0, 1)] = KEY_1,
1563 [ADP5520_KEY(0, 2)] = KEY_2,
1564 [ADP5520_KEY(0, 3)] = KEY_3,
1565 [ADP5520_KEY(1, 0)] = KEY_4,
1566 [ADP5520_KEY(1, 1)] = KEY_5,
1567 [ADP5520_KEY(1, 2)] = KEY_6,
1568 [ADP5520_KEY(1, 3)] = KEY_7,
1569 [ADP5520_KEY(2, 0)] = KEY_8,
1570 [ADP5520_KEY(2, 1)] = KEY_9,
1571 [ADP5520_KEY(2, 2)] = KEY_0,
1572 [ADP5520_KEY(2, 3)] = KEY_MINUS,
1573 [ADP5520_KEY(3, 0)] = KEY_EQUAL,
1574 [ADP5520_KEY(3, 1)] = KEY_BACKSLASH,
1575 [ADP5520_KEY(3, 2)] = KEY_BACKSPACE,
1576 [ADP5520_KEY(3, 3)] = KEY_ENTER,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001577};
1578
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001579static struct adp5520_keys_platform_data adp5520_keys_data = {
1580 .rows_en_mask = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0,
1581 .cols_en_mask = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001582 .keymap = adp5520_keymap,
1583 .keymapsize = ARRAY_SIZE(adp5520_keymap),
1584 .repeat = 0,
1585};
1586
1587 /*
1588 * ADP5520/5501 Multifuction Device Init Data
1589 */
1590
Michael Hennerich3ea57212009-03-28 22:15:07 +08001591static struct adp5520_platform_data adp5520_pdev_data = {
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001592 .backlight = &adp5520_backlight_data,
1593 .leds = &adp5520_leds_data,
1594 .gpio = &adp5520_gpio_data,
1595 .keys = &adp5520_keys_data,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001596};
1597
1598#endif
1599
Michael Hennerichba877d42009-08-27 04:09:32 +00001600#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001601static struct adp5588_gpio_platform_data adp5588_gpio_data = {
Michael Hennerichba877d42009-08-27 04:09:32 +00001602 .gpio_start = 50,
1603 .pullup_dis_mask = 0,
1604};
1605#endif
1606
Michael Hennerich78756c62009-10-13 15:28:33 +00001607#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
1608#include <linux/i2c/adp8870.h>
1609static struct led_info adp8870_leds[] = {
1610 {
1611 .name = "adp8870-led7",
1612 .default_trigger = "none",
1613 .flags = ADP8870_LED_D7 | ADP8870_LED_OFFT_600ms,
1614 },
1615};
1616
1617
1618static struct adp8870_backlight_platform_data adp8870_pdata = {
1619 .bl_led_assign = ADP8870_BL_D1 | ADP8870_BL_D2 | ADP8870_BL_D3 |
1620 ADP8870_BL_D4 | ADP8870_BL_D5 | ADP8870_BL_D6, /* 1 = Backlight 0 = Individual LED */
1621 .pwm_assign = 0, /* 1 = Enables PWM mode */
1622
1623 .bl_fade_in = ADP8870_FADE_T_1200ms, /* Backlight Fade-In Timer */
1624 .bl_fade_out = ADP8870_FADE_T_1200ms, /* Backlight Fade-Out Timer */
1625 .bl_fade_law = ADP8870_FADE_LAW_CUBIC1, /* fade-on/fade-off transfer characteristic */
1626
1627 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
1628 .abml_filt = ADP8870_BL_AMBL_FILT_320ms, /* Light sensor filter time */
1629
1630 .l1_daylight_max = ADP8870_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1631 .l1_daylight_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1632 .l2_bright_max = ADP8870_BL_CUR_mA(14), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1633 .l2_bright_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1634 .l3_office_max = ADP8870_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1635 .l3_office_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1636 .l4_indoor_max = ADP8870_BL_CUR_mA(3), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1637 .l4_indor_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1638 .l5_dark_max = ADP8870_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1639 .l5_dark_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1640
1641 .l2_trip = ADP8870_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1642 .l2_hyst = ADP8870_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1643 .l3_trip = ADP8870_L3_COMP_CURR_uA(389), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
1644 .l3_hyst = ADP8870_L3_COMP_CURR_uA(54), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
1645 .l4_trip = ADP8870_L4_COMP_CURR_uA(167), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
1646 .l4_hyst = ADP8870_L4_COMP_CURR_uA(16), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
1647 .l5_trip = ADP8870_L5_COMP_CURR_uA(43), /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1648 .l5_hyst = ADP8870_L5_COMP_CURR_uA(11), /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1649
1650 .leds = adp8870_leds,
1651 .num_leds = ARRAY_SIZE(adp8870_leds),
1652 .led_fade_law = ADP8870_FADE_LAW_SQUARE, /* fade-on/fade-off transfer characteristic */
1653 .led_fade_in = ADP8870_FADE_T_600ms,
1654 .led_fade_out = ADP8870_FADE_T_600ms,
1655 .led_on_time = ADP8870_LED_ONT_200ms,
1656};
1657#endif
1658
Sonic Zhangf32792d2010-02-09 02:47:09 +00001659#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
1660static struct regulator_consumer_supply ad5398_consumer = {
1661 .supply = "current",
1662};
1663
1664static struct regulator_init_data ad5398_regulator_data = {
1665 .constraints = {
1666 .name = "current range",
1667 .max_uA = 120000,
1668 .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
1669 },
1670 .num_consumer_supplies = 1,
1671 .consumer_supplies = &ad5398_consumer,
1672};
1673
1674static struct ad5398_platform_data ad5398_i2c_platform_data = {
1675 .current_bits = 10,
1676 .current_offset = 4,
1677 .regulator_data = &ad5398_regulator_data,
1678};
1679
1680#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
1681 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
1682static struct platform_device ad5398_virt_consumer_device = {
1683 .name = "reg-virt-consumer",
1684 .id = 0,
1685 .dev = {
1686 .platform_data = "current", /* Passed to driver */
1687 },
1688};
1689#endif
1690#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
1691 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
1692static struct regulator_bulk_data ad5398_bulk_data = {
1693 .supply = "current",
1694};
1695
1696static struct regulator_userspace_consumer_data ad5398_userspace_comsumer_data = {
1697 .name = "ad5398",
1698 .num_supplies = 1,
1699 .supplies = &ad5398_bulk_data,
1700};
1701
1702static struct platform_device ad5398_userspace_consumer_device = {
1703 .name = "reg-userspace-consumer",
1704 .id = 0,
1705 .dev = {
1706 .platform_data = &ad5398_userspace_comsumer_data,
1707 },
1708};
1709#endif
1710#endif
1711
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001712static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001713#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001714 {
Barry Song427f2772009-07-17 07:04:55 +00001715 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
Barry Song4c94c3e2009-07-07 07:41:50 +00001716 .irq = IRQ_PG5,
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001717 .platform_data = (void *)&ad7142_i2c_platform_data,
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001718 },
1719#endif
Barry Songad6720c2010-02-03 09:15:31 +00001720
1721#if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE)
1722 {
1723 I2C_BOARD_INFO("ad7150", 0x48),
1724 .irq = IRQ_PG5, /* fixme: use real interrupt number */
1725 },
1726#endif
1727
1728#if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE)
1729 {
1730 I2C_BOARD_INFO("ad7152", 0x48),
1731 },
1732#endif
1733
1734#if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE)
1735 {
1736 I2C_BOARD_INFO("ad774x", 0x48),
1737 },
1738#endif
1739
Michael Hennerichebd58332009-07-02 11:00:38 +00001740#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001741 {
1742 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001743 },
1744#endif
Michael Hennerich204844e2009-06-30 14:57:22 +00001745#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001746 {
1747 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
Michael Hennerichf5150152008-10-16 23:23:18 +08001748 .irq = IRQ_PG6,
1749 },
1750#endif
1751#if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
1752 {
1753 I2C_BOARD_INFO("ad7879", 0x2F),
1754 .irq = IRQ_PG5,
1755 .platform_data = (void *)&bfin_ad7879_ts_info,
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001756 },
1757#endif
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001758#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1759 {
1760 I2C_BOARD_INFO("adp5588-keys", 0x34),
1761 .irq = IRQ_PG0,
1762 .platform_data = (void *)&adp5588_kpad_data,
1763 },
1764#endif
Michael Hennerich3ea57212009-03-28 22:15:07 +08001765#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1766 {
1767 I2C_BOARD_INFO("pmic-adp5520", 0x32),
Mike Frysinger4f84b6e2009-06-10 20:45:48 -04001768 .irq = IRQ_PG0,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001769 .platform_data = (void *)&adp5520_pdev_data,
1770 },
1771#endif
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001772#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1773 {
1774 I2C_BOARD_INFO("adxl34x", 0x53),
1775 .irq = IRQ_PG3,
1776 .platform_data = (void *)&adxl34x_info,
1777 },
1778#endif
Michael Hennerichba877d42009-08-27 04:09:32 +00001779#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1780 {
1781 I2C_BOARD_INFO("adp5588-gpio", 0x34),
1782 .platform_data = (void *)&adp5588_gpio_data,
1783 },
1784#endif
Michael Hennerich50c4c082009-09-22 13:10:09 +00001785#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
1786 {
1787 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
1788 },
1789#endif
Michael Hennerichddcd7cb2009-09-22 15:36:55 +00001790#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1791 {
1792 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2C),
1793 },
1794#endif
Michael Hennerich78756c62009-10-13 15:28:33 +00001795#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
1796 {
1797 I2C_BOARD_INFO("adp8870", 0x2B),
1798 .platform_data = (void *)&adp8870_pdata,
1799 },
1800#endif
Cliff Caid53127f2009-10-15 02:33:04 +00001801#if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE)
1802 {
1803 I2C_BOARD_INFO("adau1371", 0x1A),
1804 },
1805#endif
Cliff Cai04267632009-10-28 06:50:36 +00001806#if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE)
1807 {
1808 I2C_BOARD_INFO("adau1761", 0x38),
1809 },
1810#endif
Michael Hennerich1f13f2f2009-11-17 10:18:27 +00001811#if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
1812 {
1813 I2C_BOARD_INFO("ad5258", 0x18),
1814 },
1815#endif
Cliff Cai29bb3bc2010-01-14 08:28:38 +00001816#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
1817 {
1818 I2C_BOARD_INFO("ssm2602", 0x1b),
1819 },
1820#endif
Sonic Zhangf32792d2010-02-09 02:47:09 +00001821#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
1822 {
1823 I2C_BOARD_INFO("ad5398", 0xC),
1824 .platform_data = (void *)&ad5398_i2c_platform_data,
1825 },
1826#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001827};
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001828
Bryan Wu1394f032007-05-06 14:50:22 -07001829#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +00001830#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1831static struct resource bfin_sport0_uart_resources[] = {
1832 {
1833 .start = SPORT0_TCR1,
1834 .end = SPORT0_MRCS3+4,
1835 .flags = IORESOURCE_MEM,
1836 },
1837 {
1838 .start = IRQ_SPORT0_RX,
1839 .end = IRQ_SPORT0_RX+1,
1840 .flags = IORESOURCE_IRQ,
1841 },
1842 {
1843 .start = IRQ_SPORT0_ERROR,
1844 .end = IRQ_SPORT0_ERROR,
1845 .flags = IORESOURCE_IRQ,
1846 },
1847};
1848
1849unsigned short bfin_sport0_peripherals[] = {
1850 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
1851 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
1852};
1853
Bryan Wu1394f032007-05-06 14:50:22 -07001854static struct platform_device bfin_sport0_uart_device = {
1855 .name = "bfin-sport-uart",
1856 .id = 0,
Sonic Zhangdf5de262009-09-23 05:01:56 +00001857 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
1858 .resource = bfin_sport0_uart_resources,
1859 .dev = {
1860 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
1861 },
1862};
1863#endif
1864#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1865static struct resource bfin_sport1_uart_resources[] = {
1866 {
1867 .start = SPORT1_TCR1,
1868 .end = SPORT1_MRCS3+4,
1869 .flags = IORESOURCE_MEM,
1870 },
1871 {
1872 .start = IRQ_SPORT1_RX,
1873 .end = IRQ_SPORT1_RX+1,
1874 .flags = IORESOURCE_IRQ,
1875 },
1876 {
1877 .start = IRQ_SPORT1_ERROR,
1878 .end = IRQ_SPORT1_ERROR,
1879 .flags = IORESOURCE_IRQ,
1880 },
1881};
1882
1883unsigned short bfin_sport1_peripherals[] = {
1884 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
1885 P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
Bryan Wu1394f032007-05-06 14:50:22 -07001886};
1887
1888static struct platform_device bfin_sport1_uart_device = {
1889 .name = "bfin-sport-uart",
1890 .id = 1,
Sonic Zhangdf5de262009-09-23 05:01:56 +00001891 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
1892 .resource = bfin_sport1_uart_resources,
1893 .dev = {
1894 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
1895 },
Bryan Wu1394f032007-05-06 14:50:22 -07001896};
1897#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +00001898#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001899
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001900#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001901#define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
1902/* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001903
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001904#ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
1905#define PATA_INT IRQ_PF5
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001906static struct pata_platform_info bfin_pata_platform_data = {
1907 .ioport_shift = 1,
Mike Frysinger64e5c512007-10-30 11:56:13 +08001908 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001909};
1910
1911static struct resource bfin_pata_resources[] = {
1912 {
1913 .start = 0x20314020,
1914 .end = 0x2031403F,
1915 .flags = IORESOURCE_MEM,
1916 },
1917 {
1918 .start = 0x2031401C,
1919 .end = 0x2031401F,
1920 .flags = IORESOURCE_MEM,
1921 },
1922 {
1923 .start = PATA_INT,
1924 .end = PATA_INT,
1925 .flags = IORESOURCE_IRQ,
1926 },
1927};
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001928#elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
1929static struct pata_platform_info bfin_pata_platform_data = {
1930 .ioport_shift = 0,
1931};
Michael Hennerich648882d2009-04-21 12:05:50 +00001932/* CompactFlash Storage Card Memory Mapped Adressing
1933 * /REG = A11 = 1
1934 */
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001935static struct resource bfin_pata_resources[] = {
1936 {
Michael Hennerich648882d2009-04-21 12:05:50 +00001937 .start = 0x20211800,
1938 .end = 0x20211807,
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001939 .flags = IORESOURCE_MEM,
1940 },
1941 {
Michael Hennerich648882d2009-04-21 12:05:50 +00001942 .start = 0x2021180E, /* Device Ctl */
1943 .end = 0x2021180E,
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001944 .flags = IORESOURCE_MEM,
1945 },
1946};
1947#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001948
1949static struct platform_device bfin_pata_device = {
1950 .name = "pata_platform",
1951 .id = -1,
1952 .num_resources = ARRAY_SIZE(bfin_pata_resources),
1953 .resource = bfin_pata_resources,
1954 .dev = {
1955 .platform_data = &bfin_pata_platform_data,
1956 }
1957};
1958#endif
1959
Michael Hennerich14b03202008-05-07 11:41:26 +08001960static const unsigned int cclk_vlev_datasheet[] =
1961{
1962 VRPAIR(VLEV_085, 250000000),
1963 VRPAIR(VLEV_090, 376000000),
1964 VRPAIR(VLEV_095, 426000000),
1965 VRPAIR(VLEV_100, 426000000),
1966 VRPAIR(VLEV_105, 476000000),
1967 VRPAIR(VLEV_110, 476000000),
1968 VRPAIR(VLEV_115, 476000000),
1969 VRPAIR(VLEV_120, 500000000),
1970 VRPAIR(VLEV_125, 533000000),
1971 VRPAIR(VLEV_130, 600000000),
1972};
1973
1974static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
1975 .tuple_tab = cclk_vlev_datasheet,
1976 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
1977 .vr_settling_time = 25 /* us */,
1978};
1979
1980static struct platform_device bfin_dpmc = {
1981 .name = "bfin dpmc",
1982 .dev = {
1983 .platform_data = &bfin_dmpc_vreg_data,
1984 },
1985};
1986
Barry Song336746e2009-10-13 09:19:18 +00001987#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1988static struct platform_device bfin_i2s = {
1989 .name = "bfin-i2s",
1990 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1991 /* TODO: add platform data here */
1992};
1993#endif
1994
Barry Song83124402009-08-06 21:03:02 +00001995#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1996static struct platform_device bfin_tdm = {
1997 .name = "bfin-tdm",
Barry Song336746e2009-10-13 09:19:18 +00001998 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1999 /* TODO: add platform data here */
2000};
2001#endif
2002
2003#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2004static struct platform_device bfin_ac97 = {
2005 .name = "bfin-ac97",
2006 .id = CONFIG_SND_BF5XX_SPORT_NUM,
Barry Song83124402009-08-06 21:03:02 +00002007 /* TODO: add platform data here */
2008};
2009#endif
2010
Bryan Wu1394f032007-05-06 14:50:22 -07002011static struct platform_device *stamp_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +08002012
2013 &bfin_dpmc,
2014
Bryan Wu1394f032007-05-06 14:50:22 -07002015#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
2016 &bfin_pcmcia_cf_device,
2017#endif
2018
2019#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
2020 &rtc_device,
2021#endif
2022
2023#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
2024 &sl811_hcd_device,
2025#endif
2026
2027#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
2028 &isp1362_hcd_device,
2029#endif
2030
Michael Hennerich3f375692008-11-18 17:48:22 +08002031#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
2032 &bfin_isp1760_device,
2033#endif
2034
Bryan Wu1394f032007-05-06 14:50:22 -07002035#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
2036 &smc91x_device,
2037#endif
2038
Alex Landauf40d24d2007-07-12 12:11:48 +08002039#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
2040 &dm9000_device,
2041#endif
2042
Barry Song706a01b2009-11-02 07:29:07 +00002043#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
2044 &bfin_can_device,
2045#endif
2046
Bryan Wu1394f032007-05-06 14:50:22 -07002047#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +08002048 &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -07002049 &bfin_mac_device,
2050#endif
2051
2052#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
2053 &net2272_bfin_device,
2054#endif
2055
2056#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002057 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -07002058#endif
2059
Cliff Cai1e9aa952009-03-28 23:28:51 +08002060#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
2061 &bfin_sport_spi0_device,
2062 &bfin_sport_spi1_device,
2063#endif
2064
Bryan Wu1394f032007-05-06 14:50:22 -07002065#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2066 &bfin_fb_device,
2067#endif
2068
Michael Hennerich2043f3f2008-10-13 14:46:30 +08002069#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
2070 &bfin_lq035q1_device,
2071#endif
2072
Bryan Wu1394f032007-05-06 14:50:22 -07002073#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00002074#ifdef CONFIG_SERIAL_BFIN_UART0
2075 &bfin_uart0_device,
2076#endif
2077#ifdef CONFIG_SERIAL_BFIN_UART1
2078 &bfin_uart1_device,
2079#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002080#endif
2081
Graf Yang5be36d22008-04-25 03:09:15 +08002082#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +08002083#ifdef CONFIG_BFIN_SIR0
2084 &bfin_sir0_device,
2085#endif
2086#ifdef CONFIG_BFIN_SIR1
2087 &bfin_sir1_device,
2088#endif
Graf Yang5be36d22008-04-25 03:09:15 +08002089#endif
2090
Bryan Wu1394f032007-05-06 14:50:22 -07002091#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
2092 &i2c_bfin_twi_device,
2093#endif
2094
2095#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +00002096#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
Bryan Wu1394f032007-05-06 14:50:22 -07002097 &bfin_sport0_uart_device,
Sonic Zhangdf5de262009-09-23 05:01:56 +00002098#endif
2099#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
Bryan Wu1394f032007-05-06 14:50:22 -07002100 &bfin_sport1_uart_device,
2101#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +00002102#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002103
2104#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2105 &bfin_pata_device,
2106#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +08002107
2108#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
2109 &bfin_device_gpiokeys,
2110#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +08002111
Mike Frysingerfc689112008-06-25 11:41:42 +08002112#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
2113 &bfin_async_nand_device,
2114#endif
2115
Mike Frysinger793dc272008-03-26 08:09:12 +08002116#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +08002117 &stamp_flash_device,
Mike Frysinger793dc272008-03-26 08:09:12 +08002118#endif
Barry Song83124402009-08-06 21:03:02 +00002119
Barry Song336746e2009-10-13 09:19:18 +00002120#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2121 &bfin_i2s,
2122#endif
2123
Barry Song83124402009-08-06 21:03:02 +00002124#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2125 &bfin_tdm,
2126#endif
Barry Song336746e2009-10-13 09:19:18 +00002127
2128#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2129 &bfin_ac97,
2130#endif
Sonic Zhangf32792d2010-02-09 02:47:09 +00002131#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2132#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2133 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2134 &ad5398_virt_consumer_device,
2135#endif
2136#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2137 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2138 &ad5398_userspace_consumer_device,
2139#endif
2140#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002141};
2142
2143static int __init stamp_init(void)
2144{
Harvey Harrisonb85d8582008-04-23 09:39:01 +08002145 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Mike Frysingerfc689112008-06-25 11:41:42 +08002146 bfin_plat_nand_init();
Mike Frysinger0531c462010-01-19 07:04:29 +00002147 adf702x_mac_init();
Bryan Wu1394f032007-05-06 14:50:22 -07002148 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
Sonic Zhangdf5de262009-09-23 05:01:56 +00002149 i2c_register_board_info(0, bfin_i2c_board_info,
2150 ARRAY_SIZE(bfin_i2c_board_info));
Mike Frysinger5bda2722008-06-07 15:03:01 +08002151 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002152
Bryan Wu1394f032007-05-06 14:50:22 -07002153 return 0;
2154}
2155
2156arch_initcall(stamp_init);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002157
Sonic Zhangc13ce9f2009-09-23 09:37:46 +00002158
2159static struct platform_device *stamp_early_devices[] __initdata = {
2160#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
2161#ifdef CONFIG_SERIAL_BFIN_UART0
2162 &bfin_uart0_device,
2163#endif
2164#ifdef CONFIG_SERIAL_BFIN_UART1
2165 &bfin_uart1_device,
2166#endif
2167#endif
2168
2169#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
2170#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2171 &bfin_sport0_uart_device,
2172#endif
2173#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2174 &bfin_sport1_uart_device,
2175#endif
2176#endif
2177};
2178
2179void __init native_machine_early_platform_add_devices(void)
2180{
2181 printk(KERN_INFO "register early platform devices\n");
2182 early_platform_add_devices(stamp_early_devices,
2183 ARRAY_SIZE(stamp_early_devices));
2184}
2185
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002186void native_machine_restart(char *cmd)
2187{
2188 /* workaround reboot hang when booting from SPI */
2189 if ((bfin_read_SYSCR() & 0x7) == 0x3)
Sonic Zhangb52dae32009-02-04 16:49:45 +08002190 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002191}
Mike Frysinger137b1522007-11-22 16:07:03 +08002192
2193/*
2194 * Currently the MAC address is saved in Flash by U-Boot
2195 */
2196#define FLASH_MAC 0x203f0000
Mike Frysinger9862cc52007-11-15 21:21:20 +08002197void bfin_get_ether_addr(char *addr)
Mike Frysinger137b1522007-11-22 16:07:03 +08002198{
2199 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
2200 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
2201}
Mike Frysinger9862cc52007-11-15 21:21:20 +08002202EXPORT_SYMBOL(bfin_get_ether_addr);