blob: a3f172fdda998f771cd9763ec987ec50b263eec2 [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 Zhangf8e6dbf2010-02-10 09:09:05 +000038#ifdef CONFIG_REGULATOR_ADP_SWITCH
39#include <linux/regulator/adp_switch.h>
40#endif
Sonic Zhangf32792d2010-02-09 02:47:09 +000041#ifdef CONFIG_REGULATOR_AD5398
42#include <linux/regulator/ad5398.h>
43#endif
44#include <linux/regulator/consumer.h>
45#include <linux/regulator/userspace-consumer.h>
Bryan Wu1394f032007-05-06 14:50:22 -070046
47/*
48 * Name the Board for the /proc/cpuinfo
49 */
Mike Frysingerfe85cad2008-11-18 17:48:22 +080050const char bfin_board_name[] = "ADI BF537-STAMP";
Bryan Wu1394f032007-05-06 14:50:22 -070051
52/*
53 * Driver needs to know address, irq and flag pin.
54 */
55
Bryan Wu1394f032007-05-06 14:50:22 -070056#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
Michael Hennerich3f375692008-11-18 17:48:22 +080057#include <linux/usb/isp1760.h>
58static struct resource bfin_isp1760_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -070059 [0] = {
Michael Hennerich3f375692008-11-18 17:48:22 +080060 .start = 0x203C0000,
61 .end = 0x203C0000 + 0x000fffff,
Bryan Wu1394f032007-05-06 14:50:22 -070062 .flags = IORESOURCE_MEM,
63 },
64 [1] = {
Michael Hennerich3f375692008-11-18 17:48:22 +080065 .start = IRQ_PF7,
66 .end = IRQ_PF7,
Michael Hennerich6a6be3d2009-01-07 23:14:39 +080067 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
Bryan Wu1394f032007-05-06 14:50:22 -070068 },
69};
70
Michael Hennerich3f375692008-11-18 17:48:22 +080071static struct isp1760_platform_data isp1760_priv = {
72 .is_isp1761 = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080073 .bus_width_16 = 1,
74 .port1_otg = 0,
75 .analog_oc = 0,
76 .dack_polarity_high = 0,
77 .dreq_polarity_high = 0,
78};
79
80static struct platform_device bfin_isp1760_device = {
Michael Hennerichc6feb762009-10-15 10:37:33 +000081 .name = "isp1760",
Bryan Wu1394f032007-05-06 14:50:22 -070082 .id = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080083 .dev = {
84 .platform_data = &isp1760_priv,
85 },
86 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
87 .resource = bfin_isp1760_resources,
Bryan Wu1394f032007-05-06 14:50:22 -070088};
Bryan Wu1394f032007-05-06 14:50:22 -070089#endif
90
Michael Hennerich2463ef22008-01-27 16:49:48 +080091#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
Michael Hennerich2463ef22008-01-27 16:49:48 +080092#include <linux/gpio_keys.h>
93
94static struct gpio_keys_button bfin_gpio_keys_table[] = {
95 {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"},
96 {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"},
97 {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"},
98 {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"},
99};
100
101static struct gpio_keys_platform_data bfin_gpio_keys_data = {
102 .buttons = bfin_gpio_keys_table,
103 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
104};
105
106static struct platform_device bfin_device_gpiokeys = {
107 .name = "gpio-keys",
108 .dev = {
109 .platform_data = &bfin_gpio_keys_data,
110 },
111};
112#endif
113
Bryan Wu1394f032007-05-06 14:50:22 -0700114#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
115static struct resource bfin_pcmcia_cf_resources[] = {
116 {
117 .start = 0x20310000, /* IO PORT */
118 .end = 0x20312000,
119 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800120 }, {
Simon Arlottd2d50aa2007-06-11 15:31:30 +0800121 .start = 0x20311000, /* Attribute Memory */
Bryan Wu1394f032007-05-06 14:50:22 -0700122 .end = 0x20311FFF,
123 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800124 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700125 .start = IRQ_PF4,
126 .end = IRQ_PF4,
127 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800128 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700129 .start = 6, /* Card Detect PF6 */
130 .end = 6,
131 .flags = IORESOURCE_IRQ,
132 },
133};
134
135static struct platform_device bfin_pcmcia_cf_device = {
136 .name = "bfin_cf_pcmcia",
137 .id = -1,
138 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
139 .resource = bfin_pcmcia_cf_resources,
140};
141#endif
142
143#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
144static struct platform_device rtc_device = {
145 .name = "rtc-bfin",
146 .id = -1,
147};
148#endif
149
150#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Michael Hennerich61f09b52009-07-24 08:48:31 +0000151#include <linux/smc91x.h>
152
153static struct smc91x_platdata smc91x_info = {
154 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
155 .leda = RPC_LED_100_10,
156 .ledb = RPC_LED_TX_RX,
157};
158
Bryan Wu1394f032007-05-06 14:50:22 -0700159static struct resource smc91x_resources[] = {
160 {
161 .name = "smc91x-regs",
162 .start = 0x20300300,
163 .end = 0x20300300 + 16,
164 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800165 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700166
167 .start = IRQ_PF7,
168 .end = IRQ_PF7,
169 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
170 },
171};
172static struct platform_device smc91x_device = {
173 .name = "smc91x",
174 .id = 0,
175 .num_resources = ARRAY_SIZE(smc91x_resources),
176 .resource = smc91x_resources,
Michael Hennerich61f09b52009-07-24 08:48:31 +0000177 .dev = {
178 .platform_data = &smc91x_info,
179 },
Bryan Wu1394f032007-05-06 14:50:22 -0700180};
181#endif
182
Alex Landauf40d24d2007-07-12 12:11:48 +0800183#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
184static struct resource dm9000_resources[] = {
185 [0] = {
186 .start = 0x203FB800,
Barry Songb3dec4a2009-07-27 06:42:50 +0000187 .end = 0x203FB800 + 1,
Alex Landauf40d24d2007-07-12 12:11:48 +0800188 .flags = IORESOURCE_MEM,
189 },
190 [1] = {
Barry Songb3dec4a2009-07-27 06:42:50 +0000191 .start = 0x203FB804,
192 .end = 0x203FB804 + 1,
193 .flags = IORESOURCE_MEM,
194 },
195 [2] = {
Alex Landauf40d24d2007-07-12 12:11:48 +0800196 .start = IRQ_PF9,
197 .end = IRQ_PF9,
198 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
199 },
200};
201
202static struct platform_device dm9000_device = {
203 .name = "dm9000",
204 .id = -1,
205 .num_resources = ARRAY_SIZE(dm9000_resources),
206 .resource = dm9000_resources,
207};
208#endif
209
Bryan Wu1394f032007-05-06 14:50:22 -0700210#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
211static struct resource sl811_hcd_resources[] = {
212 {
213 .start = 0x20340000,
214 .end = 0x20340000,
215 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800216 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700217 .start = 0x20340004,
218 .end = 0x20340004,
219 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800220 }, {
Mike Frysinger01218652009-12-21 15:07:43 +0000221 .start = IRQ_PF4,
222 .end = IRQ_PF4,
Bryan Wu1394f032007-05-06 14:50:22 -0700223 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
224 },
225};
226
227#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
228void sl811_port_power(struct device *dev, int is_on)
229{
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800230 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
Michael Hennerichacbcd262008-01-22 18:36:20 +0800231 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
Bryan Wu1394f032007-05-06 14:50:22 -0700232}
233#endif
234
235static struct sl811_platform_data sl811_priv = {
236 .potpg = 10,
237 .power = 250, /* == 500mA */
238#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
239 .port_power = &sl811_port_power,
240#endif
241};
242
243static struct platform_device sl811_hcd_device = {
244 .name = "sl811-hcd",
245 .id = 0,
246 .dev = {
247 .platform_data = &sl811_priv,
248 },
249 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
250 .resource = sl811_hcd_resources,
251};
252#endif
253
254#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
255static struct resource isp1362_hcd_resources[] = {
256 {
257 .start = 0x20360000,
258 .end = 0x20360000,
259 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800260 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700261 .start = 0x20360004,
262 .end = 0x20360004,
263 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800264 }, {
Mike Frysinger21b03cf2009-09-24 05:44:36 +0000265 .start = IRQ_PF3,
266 .end = IRQ_PF3,
Bryan Wu1394f032007-05-06 14:50:22 -0700267 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
268 },
269};
270
271static struct isp1362_platform_data isp1362_priv = {
272 .sel15Kres = 1,
273 .clknotstop = 0,
274 .oc_enable = 0,
275 .int_act_high = 0,
276 .int_edge_triggered = 0,
277 .remote_wakeup_connected = 0,
278 .no_power_switching = 1,
279 .power_switching_mode = 0,
280};
281
282static struct platform_device isp1362_hcd_device = {
283 .name = "isp1362-hcd",
284 .id = 0,
285 .dev = {
286 .platform_data = &isp1362_priv,
287 },
288 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
289 .resource = isp1362_hcd_resources,
290};
291#endif
292
Barry Song706a01b2009-11-02 07:29:07 +0000293#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
294unsigned short bfin_can_peripherals[] = {
295 P_CAN0_RX, P_CAN0_TX, 0
296};
297
298static struct resource bfin_can_resources[] = {
299 {
300 .start = 0xFFC02A00,
301 .end = 0xFFC02FFF,
302 .flags = IORESOURCE_MEM,
303 },
304 {
305 .start = IRQ_CAN_RX,
306 .end = IRQ_CAN_RX,
307 .flags = IORESOURCE_IRQ,
308 },
309 {
310 .start = IRQ_CAN_TX,
311 .end = IRQ_CAN_TX,
312 .flags = IORESOURCE_IRQ,
313 },
314 {
315 .start = IRQ_CAN_ERROR,
316 .end = IRQ_CAN_ERROR,
317 .flags = IORESOURCE_IRQ,
318 },
319};
320
321static struct platform_device bfin_can_device = {
322 .name = "bfin_can",
323 .num_resources = ARRAY_SIZE(bfin_can_resources),
324 .resource = bfin_can_resources,
325 .dev = {
326 .platform_data = &bfin_can_peripherals, /* Passed to driver */
327 },
328};
329#endif
330
Bryan Wu1394f032007-05-06 14:50:22 -0700331#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800332static struct platform_device bfin_mii_bus = {
333 .name = "bfin_mii_bus",
334};
335
Bryan Wu1394f032007-05-06 14:50:22 -0700336static struct platform_device bfin_mac_device = {
337 .name = "bfin_mac",
Graf Yang65319622009-02-04 16:49:45 +0800338 .dev.platform_data = &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700339};
340#endif
341
342#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
343static struct resource net2272_bfin_resources[] = {
344 {
345 .start = 0x20300000,
346 .end = 0x20300000 + 0x100,
347 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800348 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700349 .start = IRQ_PF7,
350 .end = IRQ_PF7,
351 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
352 },
353};
354
355static struct platform_device net2272_bfin_device = {
356 .name = "net2272",
357 .id = -1,
358 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
359 .resource = net2272_bfin_resources,
360};
361#endif
362
Mike Frysingerfc689112008-06-25 11:41:42 +0800363#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
364#ifdef CONFIG_MTD_PARTITIONS
365const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
366
367static struct mtd_partition bfin_plat_nand_partitions[] = {
368 {
Robin Getzaa582972008-08-05 17:47:29 +0800369 .name = "linux kernel(nand)",
Mike Frysingerfc689112008-06-25 11:41:42 +0800370 .size = 0x400000,
371 .offset = 0,
372 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800373 .name = "file system(nand)",
Mike Frysingerfc689112008-06-25 11:41:42 +0800374 .size = MTDPART_SIZ_FULL,
375 .offset = MTDPART_OFS_APPEND,
376 },
377};
378#endif
379
380#define BFIN_NAND_PLAT_CLE 2
381#define BFIN_NAND_PLAT_ALE 1
382static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
383{
384 struct nand_chip *this = mtd->priv;
385
386 if (cmd == NAND_CMD_NONE)
387 return;
388
389 if (ctrl & NAND_CLE)
390 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));
391 else
392 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));
393}
394
395#define BFIN_NAND_PLAT_READY GPIO_PF3
396static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
397{
398 return gpio_get_value(BFIN_NAND_PLAT_READY);
399}
400
401static struct platform_nand_data bfin_plat_nand_data = {
402 .chip = {
Marek Vasutef566092010-08-12 03:53:54 +0100403 .nr_chips = 1,
Mike Frysingerfc689112008-06-25 11:41:42 +0800404 .chip_delay = 30,
405#ifdef CONFIG_MTD_PARTITIONS
406 .part_probe_types = part_probes,
407 .partitions = bfin_plat_nand_partitions,
408 .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
409#endif
410 },
411 .ctrl = {
412 .cmd_ctrl = bfin_plat_nand_cmd_ctrl,
413 .dev_ready = bfin_plat_nand_dev_ready,
414 },
415};
416
417#define MAX(x, y) (x > y ? x : y)
418static struct resource bfin_plat_nand_resources = {
419 .start = 0x20212000,
420 .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
421 .flags = IORESOURCE_IO,
422};
423
424static struct platform_device bfin_async_nand_device = {
425 .name = "gen_nand",
426 .id = -1,
427 .num_resources = 1,
428 .resource = &bfin_plat_nand_resources,
429 .dev = {
430 .platform_data = &bfin_plat_nand_data,
431 },
432};
433
434static void bfin_plat_nand_init(void)
435{
436 gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
437}
438#else
439static void bfin_plat_nand_init(void) {}
440#endif
441
Mike Frysinger793dc272008-03-26 08:09:12 +0800442#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800443static struct mtd_partition stamp_partitions[] = {
444 {
Robin Getzaa582972008-08-05 17:47:29 +0800445 .name = "bootloader(nor)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800446 .size = 0x40000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800447 .offset = 0,
448 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800449 .name = "linux kernel(nor)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800450 .size = 0x180000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800451 .offset = MTDPART_OFS_APPEND,
452 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800453 .name = "file system(nor)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800454 .size = 0x400000 - 0x40000 - 0x180000 - 0x10000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800455 .offset = MTDPART_OFS_APPEND,
456 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800457 .name = "MAC Address(nor)",
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800458 .size = MTDPART_SIZ_FULL,
459 .offset = 0x3F0000,
460 .mask_flags = MTD_WRITEABLE,
461 }
462};
463
464static struct physmap_flash_data stamp_flash_data = {
465 .width = 2,
466 .parts = stamp_partitions,
467 .nr_parts = ARRAY_SIZE(stamp_partitions),
Barry Song38e76732010-01-15 03:24:39 +0000468#ifdef CONFIG_ROMKERNEL
469 .probe_type = "map_rom",
470#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800471};
472
473static struct resource stamp_flash_resource = {
474 .start = 0x20000000,
475 .end = 0x203fffff,
476 .flags = IORESOURCE_MEM,
477};
478
479static struct platform_device stamp_flash_device = {
480 .name = "physmap-flash",
481 .id = 0,
482 .dev = {
483 .platform_data = &stamp_flash_data,
484 },
485 .num_resources = 1,
486 .resource = &stamp_flash_resource,
487};
Mike Frysinger793dc272008-03-26 08:09:12 +0800488#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800489
Bryan Wu1394f032007-05-06 14:50:22 -0700490#if defined(CONFIG_MTD_M25P80) \
491 || defined(CONFIG_MTD_M25P80_MODULE)
492static struct mtd_partition bfin_spi_flash_partitions[] = {
493 {
Robin Getzaa582972008-08-05 17:47:29 +0800494 .name = "bootloader(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800495 .size = 0x00040000,
Bryan Wu1394f032007-05-06 14:50:22 -0700496 .offset = 0,
497 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800498 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800499 .name = "linux kernel(spi)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800500 .size = 0x180000,
Mike Frysingeredf05642008-02-25 11:38:11 +0800501 .offset = MTDPART_OFS_APPEND,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800502 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800503 .name = "file system(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800504 .size = MTDPART_SIZ_FULL,
505 .offset = MTDPART_OFS_APPEND,
Bryan Wu1394f032007-05-06 14:50:22 -0700506 }
507};
508
509static struct flash_platform_data bfin_spi_flash_data = {
510 .name = "m25p80",
511 .parts = bfin_spi_flash_partitions,
512 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
Michael Hennerich88a80782008-11-18 17:48:22 +0800513 /* .type = "m25p64", */
Bryan Wu1394f032007-05-06 14:50:22 -0700514};
515
516/* SPI flash chip (m25p64) */
517static struct bfin5xx_spi_chip spi_flash_chip_info = {
518 .enable_dma = 0, /* use dma transfer with this chip*/
519 .bits_per_word = 8,
520};
521#endif
522
Mike Frysingera261eec2009-05-20 14:05:36 +0000523#if defined(CONFIG_BFIN_SPI_ADC) \
524 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700525/* SPI ADC chip */
526static struct bfin5xx_spi_chip spi_adc_chip_info = {
527 .enable_dma = 1, /* use dma transfer with this chip*/
528 .bits_per_word = 16,
529};
530#endif
531
Barry Songd40bd712010-02-22 10:31:06 +0000532#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
533 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700534static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
535 .enable_dma = 0,
536 .bits_per_word = 16,
537};
538#endif
539
Barry Song3b827902010-01-27 09:01:36 +0000540#if defined(CONFIG_SND_BF5XX_SOC_AD193X) \
541 || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
Barry Songd4b834c2009-06-04 10:14:17 +0000542static struct bfin5xx_spi_chip ad1938_spi_chip_info = {
543 .enable_dma = 0,
544 .bits_per_word = 8,
Barry Songd4b834c2009-06-04 10:14:17 +0000545};
546#endif
547
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000548#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000549#include <linux/input/ad714x.h>
550static struct bfin5xx_spi_chip ad7147_spi_chip_info = {
551 .enable_dma = 0,
552 .bits_per_word = 16,
553};
554
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000555static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000556 {
557 .start_stage = 0,
558 .end_stage = 7,
559 .max_coord = 128,
560 },
561};
562
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000563static struct ad714x_button_plat ad7147_spi_button_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000564 {
565 .keycode = BTN_FORWARD,
566 .l_mask = 0,
567 .h_mask = 0x600,
568 },
569 {
570 .keycode = BTN_LEFT,
571 .l_mask = 0,
572 .h_mask = 0x500,
573 },
574 {
575 .keycode = BTN_MIDDLE,
576 .l_mask = 0,
577 .h_mask = 0x800,
578 },
579 {
580 .keycode = BTN_RIGHT,
581 .l_mask = 0x100,
582 .h_mask = 0x400,
583 },
584 {
585 .keycode = BTN_BACK,
586 .l_mask = 0x200,
587 .h_mask = 0x400,
588 },
589};
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000590static struct ad714x_platform_data ad7147_spi_platform_data = {
Barry Song427f2772009-07-17 07:04:55 +0000591 .slider_num = 1,
592 .button_num = 5,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000593 .slider = ad7147_spi_slider_plat,
594 .button = ad7147_spi_button_plat,
Barry Song427f2772009-07-17 07:04:55 +0000595 .stage_cfg_reg = {
596 {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
597 {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
598 {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
599 {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
600 {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
601 {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
602 {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
603 {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
604 {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
605 {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
606 {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
607 {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
608 },
609 .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
610};
611#endif
612
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000613#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000614#include <linux/input/ad714x.h>
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000615static struct ad714x_button_plat ad7142_i2c_button_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000616 {
617 .keycode = BTN_1,
618 .l_mask = 0,
619 .h_mask = 0x1,
620 },
621 {
622 .keycode = BTN_2,
623 .l_mask = 0,
624 .h_mask = 0x2,
625 },
626 {
627 .keycode = BTN_3,
628 .l_mask = 0,
629 .h_mask = 0x4,
630 },
631 {
632 .keycode = BTN_4,
633 .l_mask = 0x0,
634 .h_mask = 0x8,
635 },
636};
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000637static struct ad714x_platform_data ad7142_i2c_platform_data = {
Barry Song427f2772009-07-17 07:04:55 +0000638 .button_num = 4,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000639 .button = ad7142_i2c_button_plat,
Barry Song427f2772009-07-17 07:04:55 +0000640 .stage_cfg_reg = {
641 /* fixme: figure out right setting for all comoponent according
642 * to hardware feature of EVAL-AD7142EB board */
643 {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
644 {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
645 {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
646 {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
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 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
652 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
653 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
654 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
655 },
656 .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
657};
658#endif
659
Graf Yangf5f95312010-02-10 07:15:59 +0000660#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
661static struct bfin5xx_spi_chip ad2s90_spi_chip_info = {
662 .enable_dma = 0,
663 .bits_per_word = 16,
664};
665#endif
666
Graf Yangdf6a9492010-02-21 10:23:07 +0000667#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
668unsigned short ad2s120x_platform_data[] = {
669 /* used as SAMPLE and RDVEL */
670 GPIO_PF5, GPIO_PF6, 0
671};
672
673static struct bfin5xx_spi_chip ad2s120x_spi_chip_info = {
674 .enable_dma = 0,
675 .bits_per_word = 16,
676};
677#endif
678
Graf Yang848c51c2010-02-26 11:49:52 +0000679#if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
680unsigned short ad2s1210_platform_data[] = {
681 /* use as SAMPLE, A0, A1 */
682 GPIO_PF7, GPIO_PF8, GPIO_PF9,
683# if defined(CONFIG_AD2S1210_GPIO_INPUT) || defined(CONFIG_AD2S1210_GPIO_OUTPUT)
684 /* the RES0 and RES1 pins */
685 GPIO_PF4, GPIO_PF5,
686# endif
687 0,
688};
689
690static struct bfin5xx_spi_chip ad2s1210_spi_chip_info = {
691 .enable_dma = 0,
692 .bits_per_word = 8,
693};
694#endif
695
Yi Lif79ea4c2009-01-07 23:14:38 +0800696#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
697#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
698
699static int bfin_mmc_spi_init(struct device *dev,
700 irqreturn_t (*detect_int)(int, void *), void *data)
701{
702 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
703 IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
704}
705
706static void bfin_mmc_spi_exit(struct device *dev, void *data)
707{
708 free_irq(MMC_SPI_CARD_DETECT_INT, data);
709}
710
711static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
712 .init = bfin_mmc_spi_init,
713 .exit = bfin_mmc_spi_exit,
714 .detect_delay = 100, /* msecs */
715};
716
717static struct bfin5xx_spi_chip mmc_spi_chip_info = {
718 .enable_dma = 0,
719 .bits_per_word = 8,
Yi Lie68d1eb2009-06-03 09:46:22 +0000720 .pio_interrupt = 0,
Yi Lif79ea4c2009-01-07 23:14:38 +0800721};
722#endif
723
Bryan Wu1394f032007-05-06 14:50:22 -0700724#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800725#include <linux/spi/ad7877.h>
Bryan Wu1394f032007-05-06 14:50:22 -0700726static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700727 .enable_dma = 0,
728 .bits_per_word = 16,
729};
730
731static const struct ad7877_platform_data bfin_ad7877_ts_info = {
732 .model = 7877,
733 .vref_delay_usecs = 50, /* internal, no capacitor */
734 .x_plate_ohms = 419,
735 .y_plate_ohms = 486,
736 .pressure_max = 1000,
737 .pressure_min = 0,
Michael Hennerich6ba255f2009-12-08 11:34:07 +0000738 .stopacq_polarity = 1,
739 .first_conversion_delay = 3,
740 .acquisition_time = 1,
741 .averaging = 1,
742 .pen_down_acc_interval = 1,
Bryan Wu1394f032007-05-06 14:50:22 -0700743};
744#endif
745
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800746#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
747#include <linux/spi/ad7879.h>
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800748static const struct ad7879_platform_data bfin_ad7879_ts_info = {
749 .model = 7879, /* Model = AD7879 */
750 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
751 .pressure_max = 10000,
752 .pressure_min = 0,
Michael Hennerich6ba255f2009-12-08 11:34:07 +0000753 .first_conversion_delay = 3, /* wait 512us before do a first conversion */
754 .acquisition_time = 1, /* 4us acquisition time per sample */
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800755 .median = 2, /* do 8 measurements */
Michael Hennerich6ba255f2009-12-08 11:34:07 +0000756 .averaging = 1, /* take the average of 4 middle samples */
757 .pen_down_acc_interval = 255, /* 9.4 ms */
Michael Hennerich244d3422009-12-18 09:29:39 +0000758 .gpio_export = 1, /* Export GPIO to gpiolib */
759 .gpio_base = -1, /* Dynamic allocation */
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800760};
761#endif
762
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000763#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000764#include <linux/input/adxl34x.h>
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000765static const struct adxl34x_platform_data adxl34x_info = {
766 .x_axis_offset = 0,
767 .y_axis_offset = 0,
768 .z_axis_offset = 0,
769 .tap_threshold = 0x31,
770 .tap_duration = 0x10,
771 .tap_latency = 0x60,
772 .tap_window = 0xF0,
773 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
774 .act_axis_control = 0xFF,
775 .activity_threshold = 5,
776 .inactivity_threshold = 3,
777 .inactivity_time = 4,
778 .free_fall_threshold = 0x7,
779 .free_fall_time = 0x20,
780 .data_rate = 0x8,
781 .data_range = ADXL_FULL_RES,
782
783 .ev_type = EV_ABS,
784 .ev_code_x = ABS_X, /* EV_REL */
785 .ev_code_y = ABS_Y, /* EV_REL */
786 .ev_code_z = ABS_Z, /* EV_REL */
787
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000788 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000789
790/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
791/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
792 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
793 .fifo_mode = ADXL_FIFO_STREAM,
Michael Hennerich6ba255f2009-12-08 11:34:07 +0000794 .orientation_enable = ADXL_EN_ORIENTATION_3D,
795 .deadzone_angle = ADXL_DEADZONE_ANGLE_10p8,
796 .divisor_length = ADXL_LP_FILTER_DIVISOR_16,
797 /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
798 .ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C},
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000799};
800#endif
801
Michael Hennerichf5150152008-10-16 23:23:18 +0800802#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
803static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
804 .enable_dma = 0,
805 .bits_per_word = 16,
806};
807#endif
808
Michael Hennerich6e668932008-02-09 01:54:09 +0800809#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
810static struct bfin5xx_spi_chip spidev_chip_info = {
811 .enable_dma = 0,
812 .bits_per_word = 8,
813};
814#endif
815
Michael Hennerich2043f3f2008-10-13 14:46:30 +0800816#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
817static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
818 .enable_dma = 0,
819 .bits_per_word = 8,
820};
821#endif
822
Michael Hennerich85a192e2009-01-07 23:14:38 +0800823#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
824static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
825 .enable_dma = 1,
826 .bits_per_word = 8,
Michael Hennerich85a192e2009-01-07 23:14:38 +0800827};
828#endif
829
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000830#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
831static struct bfin5xx_spi_chip adf7021_spi_chip_info = {
832 .bits_per_word = 16,
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000833};
834
835#include <linux/spi/adf702x.h>
836#define TXREG 0x0160A470
837static const u32 adf7021_regs[] = {
838 0x09608FA0,
839 0x00575011,
840 0x00A7F092,
841 0x2B141563,
842 0x81F29E94,
843 0x00003155,
844 0x050A4F66,
845 0x00000007,
846 0x00000008,
847 0x000231E9,
848 0x3296354A,
849 0x891A2B3B,
850 0x00000D9C,
851 0x0000000D,
852 0x0000000E,
853 0x0000000F,
854};
855
856static struct adf702x_platform_data adf7021_platform_data = {
857 .regs_base = (void *)SPORT1_TCR1,
858 .dma_ch_rx = CH_SPORT1_RX,
859 .dma_ch_tx = CH_SPORT1_TX,
860 .irq_sport_err = IRQ_SPORT1_ERROR,
861 .gpio_int_rfs = GPIO_PF8,
862 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_RFS, P_SPORT1_DRPRI,
863 P_SPORT1_RSCLK, P_SPORT1_TSCLK, 0},
864 .adf702x_model = MODEL_ADF7021,
865 .adf702x_regs = adf7021_regs,
866 .tx_reg = TXREG,
867};
Mike Frysinger0531c462010-01-19 07:04:29 +0000868static inline void adf702x_mac_init(void)
869{
870 random_ether_addr(adf7021_platform_data.mac_addr);
871}
872#else
873static inline void adf702x_mac_init(void) {}
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000874#endif
875
Michael Hennerichfe5b25c2010-02-04 14:41:39 +0000876#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
877#include <linux/spi/ads7846.h>
878static struct bfin5xx_spi_chip ad7873_spi_chip_info = {
879 .bits_per_word = 8,
880};
881
882static int ads7873_get_pendown_state(void)
883{
884 return gpio_get_value(GPIO_PF6);
885}
886
887static struct ads7846_platform_data __initdata ad7873_pdata = {
888 .model = 7873, /* AD7873 */
889 .x_max = 0xfff,
890 .y_max = 0xfff,
891 .x_plate_ohms = 620,
892 .debounce_max = 1,
893 .debounce_rep = 0,
894 .debounce_tol = (~0),
895 .get_pendown_state = ads7873_get_pendown_state,
896};
897#endif
898
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800899#if defined(CONFIG_MTD_DATAFLASH) \
900 || defined(CONFIG_MTD_DATAFLASH_MODULE)
Michael Hennerichceac2652008-08-25 17:39:11 +0800901
902static struct mtd_partition bfin_spi_dataflash_partitions[] = {
903 {
904 .name = "bootloader(spi)",
905 .size = 0x00040000,
906 .offset = 0,
907 .mask_flags = MTD_CAP_ROM
908 }, {
909 .name = "linux kernel(spi)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800910 .size = 0x180000,
Michael Hennerichceac2652008-08-25 17:39:11 +0800911 .offset = MTDPART_OFS_APPEND,
912 }, {
913 .name = "file system(spi)",
914 .size = MTDPART_SIZ_FULL,
915 .offset = MTDPART_OFS_APPEND,
916 }
917};
918
919static struct flash_platform_data bfin_spi_dataflash_data = {
920 .name = "SPI Dataflash",
921 .parts = bfin_spi_dataflash_partitions,
922 .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
923};
924
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800925/* DataFlash chip */
926static struct bfin5xx_spi_chip data_flash_chip_info = {
927 .enable_dma = 0, /* use dma transfer with this chip*/
928 .bits_per_word = 8,
929};
930#endif
931
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000932#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
933static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
934 .enable_dma = 0, /* use dma transfer with this chip*/
935 .bits_per_word = 8,
936};
937#endif
938
Bryan Wu1394f032007-05-06 14:50:22 -0700939static struct spi_board_info bfin_spi_board_info[] __initdata = {
940#if defined(CONFIG_MTD_M25P80) \
941 || defined(CONFIG_MTD_M25P80_MODULE)
942 {
943 /* the modalias must be the same as spi device driver name */
944 .modalias = "m25p80", /* Name of spi_driver for this device */
945 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800946 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700947 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
948 .platform_data = &bfin_spi_flash_data,
949 .controller_data = &spi_flash_chip_info,
950 .mode = SPI_MODE_3,
951 },
952#endif
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800953#if defined(CONFIG_MTD_DATAFLASH) \
954 || defined(CONFIG_MTD_DATAFLASH_MODULE)
955 { /* DataFlash chip */
956 .modalias = "mtd_dataflash",
Michael Hennerichceac2652008-08-25 17:39:11 +0800957 .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800958 .bus_num = 0, /* Framework bus number */
959 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
Michael Hennerichceac2652008-08-25 17:39:11 +0800960 .platform_data = &bfin_spi_dataflash_data,
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800961 .controller_data = &data_flash_chip_info,
962 .mode = SPI_MODE_3,
963 },
964#endif
Mike Frysingera261eec2009-05-20 14:05:36 +0000965#if defined(CONFIG_BFIN_SPI_ADC) \
966 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700967 {
968 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
969 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800970 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700971 .chip_select = 1, /* Framework chip select. */
972 .platform_data = NULL, /* No spi_driver specific config */
973 .controller_data = &spi_adc_chip_info,
974 },
975#endif
976
Barry Songd40bd712010-02-22 10:31:06 +0000977#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
978 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700979 {
Barry Songd40bd712010-02-22 10:31:06 +0000980 .modalias = "ad183x",
Bryan Wu1394f032007-05-06 14:50:22 -0700981 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800982 .bus_num = 0,
Barry Song83124402009-08-06 21:03:02 +0000983 .chip_select = 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
Barry Songd40bd712010-02-22 10:31:06 +0000984 .platform_data = "ad1836", /* only includes chip name for the moment */
Bryan Wu1394f032007-05-06 14:50:22 -0700985 .controller_data = &ad1836_spi_chip_info,
Barry Song83124402009-08-06 21:03:02 +0000986 .mode = SPI_MODE_3,
Bryan Wu1394f032007-05-06 14:50:22 -0700987 },
988#endif
Barry Songd4b834c2009-06-04 10:14:17 +0000989
Barry Song3b827902010-01-27 09:01:36 +0000990#if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
Barry Songd4b834c2009-06-04 10:14:17 +0000991 {
Barry Song3b827902010-01-27 09:01:36 +0000992 .modalias = "ad193x",
Barry Songd4b834c2009-06-04 10:14:17 +0000993 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
994 .bus_num = 0,
Barry Song08a54bf2009-09-18 09:14:38 +0000995 .chip_select = 5,
Barry Songd4b834c2009-06-04 10:14:17 +0000996 .controller_data = &ad1938_spi_chip_info,
997 .mode = SPI_MODE_3,
998 },
999#endif
1000
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001001#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
Barry Song427f2772009-07-17 07:04:55 +00001002 {
1003 .modalias = "ad714x_captouch",
1004 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1005 .irq = IRQ_PF4,
1006 .bus_num = 0,
1007 .chip_select = 5,
1008 .mode = SPI_MODE_3,
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001009 .platform_data = &ad7147_spi_platform_data,
Barry Song427f2772009-07-17 07:04:55 +00001010 .controller_data = &ad7147_spi_chip_info,
1011 },
1012#endif
1013
Graf Yangf5f95312010-02-10 07:15:59 +00001014#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
1015 {
1016 .modalias = "ad2s90",
1017 .bus_num = 0,
1018 .chip_select = 3, /* change it for your board */
1019 .platform_data = NULL,
1020 .controller_data = &ad2s90_spi_chip_info,
1021 },
1022#endif
1023
Graf Yangdf6a9492010-02-21 10:23:07 +00001024#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
1025 {
1026 .modalias = "ad2s120x",
1027 .bus_num = 0,
1028 .chip_select = 4, /* CS, change it for your board */
1029 .platform_data = ad2s120x_platform_data,
1030 .controller_data = &ad2s120x_spi_chip_info,
1031 },
1032#endif
1033
Graf Yang848c51c2010-02-26 11:49:52 +00001034#if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
1035 {
1036 .modalias = "ad2s1210",
1037 .max_speed_hz = 8192000,
1038 .bus_num = 0,
1039 .chip_select = 4, /* CS, change it for your board */
1040 .platform_data = ad2s1210_platform_data,
1041 .controller_data = &ad2s1210_spi_chip_info,
1042 },
1043#endif
1044
Yi Lif79ea4c2009-01-07 23:14:38 +08001045#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
1046 {
1047 .modalias = "mmc_spi",
1048 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1049 .bus_num = 0,
1050 .chip_select = 4,
1051 .platform_data = &bfin_mmc_spi_pdata,
1052 .controller_data = &mmc_spi_chip_info,
1053 .mode = SPI_MODE_3,
1054 },
1055#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001056#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1057 {
1058 .modalias = "ad7877",
1059 .platform_data = &bfin_ad7877_ts_info,
1060 .irq = IRQ_PF6,
1061 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Michael Hennerichc7d48962007-11-15 21:33:31 +08001062 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -07001063 .chip_select = 1,
1064 .controller_data = &spi_ad7877_chip_info,
1065 },
1066#endif
Michael Hennerichf5150152008-10-16 23:23:18 +08001067#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
Michael Hennerich46aa04f2008-10-13 11:30:17 +08001068 {
1069 .modalias = "ad7879",
1070 .platform_data = &bfin_ad7879_ts_info,
1071 .irq = IRQ_PF7,
1072 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1073 .bus_num = 0,
1074 .chip_select = 1,
1075 .controller_data = &spi_ad7879_chip_info,
1076 .mode = SPI_CPHA | SPI_CPOL,
1077 },
1078#endif
Michael Hennerich6e668932008-02-09 01:54:09 +08001079#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1080 {
1081 .modalias = "spidev",
1082 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1083 .bus_num = 0,
1084 .chip_select = 1,
1085 .controller_data = &spidev_chip_info,
1086 },
1087#endif
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001088#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1089 {
1090 .modalias = "bfin-lq035q1-spi",
1091 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1092 .bus_num = 0,
Michael Hennerich46aa04f2008-10-13 11:30:17 +08001093 .chip_select = 2,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001094 .controller_data = &lq035q1_spi_chip_info,
1095 .mode = SPI_CPHA | SPI_CPOL,
1096 },
1097#endif
Michael Hennerich85a192e2009-01-07 23:14:38 +08001098#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
1099 {
1100 .modalias = "enc28j60",
1101 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1102 .irq = IRQ_PF6,
1103 .bus_num = 0,
Barry Songf9f0e3b2009-11-17 09:45:59 +00001104 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
Michael Hennerich85a192e2009-01-07 23:14:38 +08001105 .controller_data = &enc28j60_spi_chip_info,
1106 .mode = SPI_MODE_0,
1107 },
1108#endif
Michael Hennerich57af8ed2009-10-16 12:35:20 +00001109#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1110 {
1111 .modalias = "adxl34x",
1112 .platform_data = &adxl34x_info,
1113 .irq = IRQ_PF6,
1114 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1115 .bus_num = 0,
1116 .chip_select = 2,
1117 .controller_data = &spi_adxl34x_chip_info,
1118 .mode = SPI_MODE_3,
1119 },
1120#endif
Michael Hennerichefaf7cd2009-11-12 16:54:08 +00001121#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
1122 {
1123 .modalias = "adf702x",
1124 .max_speed_hz = 16000000, /* max spi clock (SCK) speed in HZ */
1125 .bus_num = 0,
Barry Songf9f0e3b2009-11-17 09:45:59 +00001126 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
Michael Hennerichefaf7cd2009-11-12 16:54:08 +00001127 .controller_data = &adf7021_spi_chip_info,
1128 .platform_data = &adf7021_platform_data,
1129 .mode = SPI_MODE_0,
1130 },
1131#endif
Michael Hennerichfe5b25c2010-02-04 14:41:39 +00001132#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
1133 {
1134 .modalias = "ads7846",
1135 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1136 .bus_num = 0,
1137 .irq = IRQ_PF6,
1138 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1139 .controller_data = &ad7873_spi_chip_info,
1140 .platform_data = &ad7873_pdata,
1141 .mode = SPI_MODE_0,
1142 },
1143#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001144};
1145
Mike Frysinger5bda2722008-06-07 15:03:01 +08001146#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -07001147/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001148static struct bfin5xx_spi_master bfin_spi0_info = {
Barry Songf9f0e3b2009-11-17 09:45:59 +00001149 .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
Bryan Wu1394f032007-05-06 14:50:22 -07001150 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +08001151 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -07001152};
1153
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001154/* SPI (0) */
1155static struct resource bfin_spi0_resource[] = {
1156 [0] = {
1157 .start = SPI0_REGBASE,
1158 .end = SPI0_REGBASE + 0xFF,
1159 .flags = IORESOURCE_MEM,
1160 },
1161 [1] = {
1162 .start = CH_SPI,
1163 .end = CH_SPI,
Yi Lie68d1eb2009-06-03 09:46:22 +00001164 .flags = IORESOURCE_DMA,
1165 },
1166 [2] = {
1167 .start = IRQ_SPI,
1168 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001169 .flags = IORESOURCE_IRQ,
1170 },
1171};
1172
1173static struct platform_device bfin_spi0_device = {
1174 .name = "bfin-spi",
1175 .id = 0, /* Bus number */
1176 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1177 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -07001178 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001179 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -07001180 },
1181};
1182#endif /* spi master and devices */
1183
Cliff Cai1e9aa952009-03-28 23:28:51 +08001184#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1185
1186/* SPORT SPI controller data */
1187static struct bfin5xx_spi_master bfin_sport_spi0_info = {
1188 .num_chipselect = 1, /* master only supports one device */
1189 .enable_dma = 0, /* master don't support DMA */
1190 .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,
1191 P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0},
1192};
1193
1194static struct resource bfin_sport_spi0_resource[] = {
1195 [0] = {
1196 .start = SPORT0_TCR1,
1197 .end = SPORT0_TCR1 + 0xFF,
1198 .flags = IORESOURCE_MEM,
1199 },
1200 [1] = {
1201 .start = IRQ_SPORT0_ERROR,
1202 .end = IRQ_SPORT0_ERROR,
1203 .flags = IORESOURCE_IRQ,
1204 },
1205};
1206
1207static struct platform_device bfin_sport_spi0_device = {
1208 .name = "bfin-sport-spi",
1209 .id = 1, /* Bus number */
1210 .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource),
1211 .resource = bfin_sport_spi0_resource,
1212 .dev = {
1213 .platform_data = &bfin_sport_spi0_info, /* Passed to driver */
1214 },
1215};
1216
1217static struct bfin5xx_spi_master bfin_sport_spi1_info = {
1218 .num_chipselect = 1, /* master only supports one device */
1219 .enable_dma = 0, /* master don't support DMA */
1220 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,
1221 P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0},
1222};
1223
1224static struct resource bfin_sport_spi1_resource[] = {
1225 [0] = {
1226 .start = SPORT1_TCR1,
1227 .end = SPORT1_TCR1 + 0xFF,
1228 .flags = IORESOURCE_MEM,
1229 },
1230 [1] = {
1231 .start = IRQ_SPORT1_ERROR,
1232 .end = IRQ_SPORT1_ERROR,
1233 .flags = IORESOURCE_IRQ,
1234 },
1235};
1236
1237static struct platform_device bfin_sport_spi1_device = {
1238 .name = "bfin-sport-spi",
1239 .id = 2, /* Bus number */
1240 .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource),
1241 .resource = bfin_sport_spi1_resource,
1242 .dev = {
1243 .platform_data = &bfin_sport_spi1_info, /* Passed to driver */
1244 },
1245};
1246
1247#endif /* sport spi master and devices */
1248
Bryan Wu1394f032007-05-06 14:50:22 -07001249#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1250static struct platform_device bfin_fb_device = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001251 .name = "bf537-lq035",
1252};
1253#endif
1254
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001255#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1256#include <asm/bfin-lq035q1.h>
1257
1258static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
Michael Hennerichd94a1aa2009-12-08 11:45:55 +00001259 .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
1260 .ppi_mode = USE_RGB565_16_BIT_PPI,
1261 .use_bl = 0, /* let something else control the LCD Blacklight */
1262 .gpio_bl = GPIO_PF7,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001263};
1264
1265static struct resource bfin_lq035q1_resources[] = {
1266 {
1267 .start = IRQ_PPI_ERROR,
1268 .end = IRQ_PPI_ERROR,
1269 .flags = IORESOURCE_IRQ,
1270 },
1271};
1272
1273static struct platform_device bfin_lq035q1_device = {
1274 .name = "bfin-lq035q1",
1275 .id = -1,
Michael Hennerichd94a1aa2009-12-08 11:45:55 +00001276 .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
1277 .resource = bfin_lq035q1_resources,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001278 .dev = {
1279 .platform_data = &bfin_lq035q1_data,
1280 },
1281};
1282#endif
1283
Bryan Wu1394f032007-05-06 14:50:22 -07001284#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang233b28a2007-11-21 17:04:41 +08001285#ifdef CONFIG_SERIAL_BFIN_UART0
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001286static struct resource bfin_uart0_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -07001287 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001288 .start = UART0_THR,
1289 .end = UART0_GCTL+2,
Bryan Wu1394f032007-05-06 14:50:22 -07001290 .flags = IORESOURCE_MEM,
Sonic Zhang233b28a2007-11-21 17:04:41 +08001291 },
Sonic Zhang233b28a2007-11-21 17:04:41 +08001292 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001293 .start = IRQ_UART0_RX,
1294 .end = IRQ_UART0_RX+1,
1295 .flags = IORESOURCE_IRQ,
1296 },
1297 {
1298 .start = IRQ_UART0_ERROR,
1299 .end = IRQ_UART0_ERROR,
1300 .flags = IORESOURCE_IRQ,
1301 },
1302 {
1303 .start = CH_UART0_TX,
1304 .end = CH_UART0_TX,
1305 .flags = IORESOURCE_DMA,
1306 },
1307 {
1308 .start = CH_UART0_RX,
1309 .end = CH_UART0_RX,
1310 .flags = IORESOURCE_DMA,
1311 },
1312#ifdef CONFIG_BFIN_UART0_CTSRTS
1313 { /* CTS pin */
1314 .start = GPIO_PG7,
1315 .end = GPIO_PG7,
1316 .flags = IORESOURCE_IO,
1317 },
1318 { /* RTS pin */
1319 .start = GPIO_PG6,
1320 .end = GPIO_PG6,
1321 .flags = IORESOURCE_IO,
Bryan Wu1394f032007-05-06 14:50:22 -07001322 },
Sonic Zhang233b28a2007-11-21 17:04:41 +08001323#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001324};
1325
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001326unsigned short bfin_uart0_peripherals[] = {
1327 P_UART0_TX, P_UART0_RX, 0
1328};
1329
1330static struct platform_device bfin_uart0_device = {
1331 .name = "bfin-uart",
1332 .id = 0,
1333 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
1334 .resource = bfin_uart0_resources,
1335 .dev = {
1336 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
1337 },
1338};
1339#endif
1340#ifdef CONFIG_SERIAL_BFIN_UART1
1341static struct resource bfin_uart1_resources[] = {
1342 {
1343 .start = UART1_THR,
1344 .end = UART1_GCTL+2,
1345 .flags = IORESOURCE_MEM,
1346 },
1347 {
1348 .start = IRQ_UART1_RX,
1349 .end = IRQ_UART1_RX+1,
1350 .flags = IORESOURCE_IRQ,
1351 },
1352 {
1353 .start = IRQ_UART1_ERROR,
1354 .end = IRQ_UART1_ERROR,
1355 .flags = IORESOURCE_IRQ,
1356 },
1357 {
1358 .start = CH_UART1_TX,
1359 .end = CH_UART1_TX,
1360 .flags = IORESOURCE_DMA,
1361 },
1362 {
1363 .start = CH_UART1_RX,
1364 .end = CH_UART1_RX,
1365 .flags = IORESOURCE_DMA,
1366 },
1367};
1368
1369unsigned short bfin_uart1_peripherals[] = {
1370 P_UART1_TX, P_UART1_RX, 0
1371};
1372
1373static struct platform_device bfin_uart1_device = {
Bryan Wu1394f032007-05-06 14:50:22 -07001374 .name = "bfin-uart",
1375 .id = 1,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001376 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
1377 .resource = bfin_uart1_resources,
1378 .dev = {
1379 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
1380 },
Bryan Wu1394f032007-05-06 14:50:22 -07001381};
1382#endif
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001383#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001384
Graf Yang5be36d22008-04-25 03:09:15 +08001385#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +08001386#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +08001387static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +08001388 {
1389 .start = 0xFFC00400,
1390 .end = 0xFFC004FF,
1391 .flags = IORESOURCE_MEM,
1392 },
Graf Yang42bd8bc2009-01-07 23:14:39 +08001393 {
1394 .start = IRQ_UART0_RX,
1395 .end = IRQ_UART0_RX+1,
1396 .flags = IORESOURCE_IRQ,
1397 },
1398 {
1399 .start = CH_UART0_RX,
1400 .end = CH_UART0_RX+1,
1401 .flags = IORESOURCE_DMA,
1402 },
1403};
1404
1405static struct platform_device bfin_sir0_device = {
1406 .name = "bfin_sir",
1407 .id = 0,
1408 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
1409 .resource = bfin_sir0_resources,
1410};
Graf Yang5be36d22008-04-25 03:09:15 +08001411#endif
1412#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +08001413static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +08001414 {
1415 .start = 0xFFC02000,
1416 .end = 0xFFC020FF,
1417 .flags = IORESOURCE_MEM,
1418 },
Graf Yang42bd8bc2009-01-07 23:14:39 +08001419 {
1420 .start = IRQ_UART1_RX,
1421 .end = IRQ_UART1_RX+1,
1422 .flags = IORESOURCE_IRQ,
1423 },
1424 {
1425 .start = CH_UART1_RX,
1426 .end = CH_UART1_RX+1,
1427 .flags = IORESOURCE_DMA,
1428 },
Graf Yang5be36d22008-04-25 03:09:15 +08001429};
1430
Graf Yang42bd8bc2009-01-07 23:14:39 +08001431static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +08001432 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +08001433 .id = 1,
1434 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
1435 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +08001436};
1437#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +08001438#endif
Graf Yang5be36d22008-04-25 03:09:15 +08001439
Bryan Wu1394f032007-05-06 14:50:22 -07001440#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001441static struct resource bfin_twi0_resource[] = {
1442 [0] = {
1443 .start = TWI0_REGBASE,
1444 .end = TWI0_REGBASE,
1445 .flags = IORESOURCE_MEM,
1446 },
1447 [1] = {
1448 .start = IRQ_TWI,
1449 .end = IRQ_TWI,
1450 .flags = IORESOURCE_IRQ,
1451 },
1452};
1453
Bryan Wu1394f032007-05-06 14:50:22 -07001454static struct platform_device i2c_bfin_twi_device = {
1455 .name = "i2c-bfin-twi",
1456 .id = 0,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001457 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1458 .resource = bfin_twi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -07001459};
1460#endif
1461
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001462#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001463static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
1464 [0] = KEY_GRAVE,
1465 [1] = KEY_1,
1466 [2] = KEY_2,
1467 [3] = KEY_3,
1468 [4] = KEY_4,
1469 [5] = KEY_5,
1470 [6] = KEY_6,
1471 [7] = KEY_7,
1472 [8] = KEY_8,
1473 [9] = KEY_9,
1474 [10] = KEY_0,
1475 [11] = KEY_MINUS,
1476 [12] = KEY_EQUAL,
1477 [13] = KEY_BACKSLASH,
1478 [15] = KEY_KP0,
1479 [16] = KEY_Q,
1480 [17] = KEY_W,
1481 [18] = KEY_E,
1482 [19] = KEY_R,
1483 [20] = KEY_T,
1484 [21] = KEY_Y,
1485 [22] = KEY_U,
1486 [23] = KEY_I,
1487 [24] = KEY_O,
1488 [25] = KEY_P,
1489 [26] = KEY_LEFTBRACE,
1490 [27] = KEY_RIGHTBRACE,
1491 [29] = KEY_KP1,
1492 [30] = KEY_KP2,
1493 [31] = KEY_KP3,
1494 [32] = KEY_A,
1495 [33] = KEY_S,
1496 [34] = KEY_D,
1497 [35] = KEY_F,
1498 [36] = KEY_G,
1499 [37] = KEY_H,
1500 [38] = KEY_J,
1501 [39] = KEY_K,
1502 [40] = KEY_L,
1503 [41] = KEY_SEMICOLON,
1504 [42] = KEY_APOSTROPHE,
1505 [43] = KEY_BACKSLASH,
1506 [45] = KEY_KP4,
1507 [46] = KEY_KP5,
1508 [47] = KEY_KP6,
1509 [48] = KEY_102ND,
1510 [49] = KEY_Z,
1511 [50] = KEY_X,
1512 [51] = KEY_C,
1513 [52] = KEY_V,
1514 [53] = KEY_B,
1515 [54] = KEY_N,
1516 [55] = KEY_M,
1517 [56] = KEY_COMMA,
1518 [57] = KEY_DOT,
1519 [58] = KEY_SLASH,
1520 [60] = KEY_KPDOT,
1521 [61] = KEY_KP7,
1522 [62] = KEY_KP8,
1523 [63] = KEY_KP9,
1524 [64] = KEY_SPACE,
1525 [65] = KEY_BACKSPACE,
1526 [66] = KEY_TAB,
1527 [67] = KEY_KPENTER,
1528 [68] = KEY_ENTER,
1529 [69] = KEY_ESC,
1530 [70] = KEY_DELETE,
1531 [74] = KEY_KPMINUS,
1532 [76] = KEY_UP,
1533 [77] = KEY_DOWN,
1534 [78] = KEY_RIGHT,
1535 [79] = KEY_LEFT,
1536};
1537
1538static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1539 .rows = 8,
1540 .cols = 10,
1541 .keymap = adp5588_keymap,
1542 .keymapsize = ARRAY_SIZE(adp5588_keymap),
1543 .repeat = 0,
1544};
1545#endif
1546
Michael Hennerich3ea57212009-03-28 22:15:07 +08001547#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1548#include <linux/mfd/adp5520.h>
1549
1550 /*
1551 * ADP5520/5501 Backlight Data
1552 */
1553
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001554static struct adp5520_backlight_platform_data adp5520_backlight_data = {
1555 .fade_in = ADP5520_FADE_T_1200ms,
1556 .fade_out = ADP5520_FADE_T_1200ms,
1557 .fade_led_law = ADP5520_BL_LAW_LINEAR,
1558 .en_ambl_sens = 1,
1559 .abml_filt = ADP5520_BL_AMBL_FILT_640ms,
1560 .l1_daylight_max = ADP5520_BL_CUR_mA(15),
1561 .l1_daylight_dim = ADP5520_BL_CUR_mA(0),
1562 .l2_office_max = ADP5520_BL_CUR_mA(7),
1563 .l2_office_dim = ADP5520_BL_CUR_mA(0),
1564 .l3_dark_max = ADP5520_BL_CUR_mA(3),
1565 .l3_dark_dim = ADP5520_BL_CUR_mA(0),
1566 .l2_trip = ADP5520_L2_COMP_CURR_uA(700),
1567 .l2_hyst = ADP5520_L2_COMP_CURR_uA(50),
1568 .l3_trip = ADP5520_L3_COMP_CURR_uA(80),
1569 .l3_hyst = ADP5520_L3_COMP_CURR_uA(20),
Michael Hennerich3ea57212009-03-28 22:15:07 +08001570};
1571
1572 /*
1573 * ADP5520/5501 LEDs Data
1574 */
1575
Michael Hennerich3ea57212009-03-28 22:15:07 +08001576static struct led_info adp5520_leds[] = {
1577 {
1578 .name = "adp5520-led1",
1579 .default_trigger = "none",
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001580 .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001581 },
1582#ifdef ADP5520_EN_ALL_LEDS
1583 {
1584 .name = "adp5520-led2",
1585 .default_trigger = "none",
1586 .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1,
1587 },
1588 {
1589 .name = "adp5520-led3",
1590 .default_trigger = "none",
1591 .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2,
1592 },
1593#endif
1594};
1595
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001596static struct adp5520_leds_platform_data adp5520_leds_data = {
Michael Hennerich3ea57212009-03-28 22:15:07 +08001597 .num_leds = ARRAY_SIZE(adp5520_leds),
1598 .leds = adp5520_leds,
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001599 .fade_in = ADP5520_FADE_T_600ms,
1600 .fade_out = ADP5520_FADE_T_600ms,
1601 .led_on_time = ADP5520_LED_ONT_600ms,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001602};
1603
1604 /*
1605 * ADP5520 GPIO Data
1606 */
1607
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001608static struct adp5520_gpio_platform_data adp5520_gpio_data = {
Michael Hennerich3ea57212009-03-28 22:15:07 +08001609 .gpio_start = 50,
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001610 .gpio_en_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
1611 .gpio_pullup_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001612};
1613
1614 /*
1615 * ADP5520 Keypad Data
1616 */
1617
Michael Hennerich3ea57212009-03-28 22:15:07 +08001618static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001619 [ADP5520_KEY(0, 0)] = KEY_GRAVE,
1620 [ADP5520_KEY(0, 1)] = KEY_1,
1621 [ADP5520_KEY(0, 2)] = KEY_2,
1622 [ADP5520_KEY(0, 3)] = KEY_3,
1623 [ADP5520_KEY(1, 0)] = KEY_4,
1624 [ADP5520_KEY(1, 1)] = KEY_5,
1625 [ADP5520_KEY(1, 2)] = KEY_6,
1626 [ADP5520_KEY(1, 3)] = KEY_7,
1627 [ADP5520_KEY(2, 0)] = KEY_8,
1628 [ADP5520_KEY(2, 1)] = KEY_9,
1629 [ADP5520_KEY(2, 2)] = KEY_0,
1630 [ADP5520_KEY(2, 3)] = KEY_MINUS,
1631 [ADP5520_KEY(3, 0)] = KEY_EQUAL,
1632 [ADP5520_KEY(3, 1)] = KEY_BACKSLASH,
1633 [ADP5520_KEY(3, 2)] = KEY_BACKSPACE,
1634 [ADP5520_KEY(3, 3)] = KEY_ENTER,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001635};
1636
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001637static struct adp5520_keys_platform_data adp5520_keys_data = {
1638 .rows_en_mask = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0,
1639 .cols_en_mask = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001640 .keymap = adp5520_keymap,
1641 .keymapsize = ARRAY_SIZE(adp5520_keymap),
1642 .repeat = 0,
1643};
1644
1645 /*
1646 * ADP5520/5501 Multifuction Device Init Data
1647 */
1648
Michael Hennerich3ea57212009-03-28 22:15:07 +08001649static struct adp5520_platform_data adp5520_pdev_data = {
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001650 .backlight = &adp5520_backlight_data,
1651 .leds = &adp5520_leds_data,
1652 .gpio = &adp5520_gpio_data,
1653 .keys = &adp5520_keys_data,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001654};
1655
1656#endif
1657
Michael Hennerichba877d42009-08-27 04:09:32 +00001658#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001659static struct adp5588_gpio_platform_data adp5588_gpio_data = {
Michael Hennerichba877d42009-08-27 04:09:32 +00001660 .gpio_start = 50,
1661 .pullup_dis_mask = 0,
1662};
1663#endif
1664
Michael Hennerich78756c62009-10-13 15:28:33 +00001665#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
1666#include <linux/i2c/adp8870.h>
1667static struct led_info adp8870_leds[] = {
1668 {
1669 .name = "adp8870-led7",
1670 .default_trigger = "none",
1671 .flags = ADP8870_LED_D7 | ADP8870_LED_OFFT_600ms,
1672 },
1673};
1674
1675
1676static struct adp8870_backlight_platform_data adp8870_pdata = {
1677 .bl_led_assign = ADP8870_BL_D1 | ADP8870_BL_D2 | ADP8870_BL_D3 |
1678 ADP8870_BL_D4 | ADP8870_BL_D5 | ADP8870_BL_D6, /* 1 = Backlight 0 = Individual LED */
1679 .pwm_assign = 0, /* 1 = Enables PWM mode */
1680
1681 .bl_fade_in = ADP8870_FADE_T_1200ms, /* Backlight Fade-In Timer */
1682 .bl_fade_out = ADP8870_FADE_T_1200ms, /* Backlight Fade-Out Timer */
1683 .bl_fade_law = ADP8870_FADE_LAW_CUBIC1, /* fade-on/fade-off transfer characteristic */
1684
1685 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
1686 .abml_filt = ADP8870_BL_AMBL_FILT_320ms, /* Light sensor filter time */
1687
1688 .l1_daylight_max = ADP8870_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1689 .l1_daylight_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1690 .l2_bright_max = ADP8870_BL_CUR_mA(14), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1691 .l2_bright_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1692 .l3_office_max = ADP8870_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1693 .l3_office_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1694 .l4_indoor_max = ADP8870_BL_CUR_mA(3), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1695 .l4_indor_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1696 .l5_dark_max = ADP8870_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1697 .l5_dark_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1698
1699 .l2_trip = ADP8870_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1700 .l2_hyst = ADP8870_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1701 .l3_trip = ADP8870_L3_COMP_CURR_uA(389), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
1702 .l3_hyst = ADP8870_L3_COMP_CURR_uA(54), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
1703 .l4_trip = ADP8870_L4_COMP_CURR_uA(167), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
1704 .l4_hyst = ADP8870_L4_COMP_CURR_uA(16), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
1705 .l5_trip = ADP8870_L5_COMP_CURR_uA(43), /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1706 .l5_hyst = ADP8870_L5_COMP_CURR_uA(11), /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1707
1708 .leds = adp8870_leds,
1709 .num_leds = ARRAY_SIZE(adp8870_leds),
1710 .led_fade_law = ADP8870_FADE_LAW_SQUARE, /* fade-on/fade-off transfer characteristic */
1711 .led_fade_in = ADP8870_FADE_T_600ms,
1712 .led_fade_out = ADP8870_FADE_T_600ms,
1713 .led_on_time = ADP8870_LED_ONT_200ms,
1714};
1715#endif
1716
Michael Hennerich72fa2e92010-02-24 21:05:35 +00001717#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
1718#include <linux/i2c/adp8860.h>
1719static struct led_info adp8860_leds[] = {
1720 {
1721 .name = "adp8860-led7",
1722 .default_trigger = "none",
1723 .flags = ADP8860_LED_D7 | ADP8860_LED_OFFT_600ms,
1724 },
1725};
1726
1727static struct adp8860_backlight_platform_data adp8860_pdata = {
1728 .bl_led_assign = ADP8860_BL_D1 | ADP8860_BL_D2 | ADP8860_BL_D3 |
1729 ADP8860_BL_D4 | ADP8860_BL_D5 | ADP8860_BL_D6, /* 1 = Backlight 0 = Individual LED */
1730
1731 .bl_fade_in = ADP8860_FADE_T_1200ms, /* Backlight Fade-In Timer */
1732 .bl_fade_out = ADP8860_FADE_T_1200ms, /* Backlight Fade-Out Timer */
1733 .bl_fade_law = ADP8860_FADE_LAW_CUBIC1, /* fade-on/fade-off transfer characteristic */
1734
1735 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
1736 .abml_filt = ADP8860_BL_AMBL_FILT_320ms, /* Light sensor filter time */
1737
1738 .l1_daylight_max = ADP8860_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1739 .l1_daylight_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1740 .l2_office_max = ADP8860_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1741 .l2_office_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1742 .l3_dark_max = ADP8860_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1743 .l3_dark_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1744
1745 .l2_trip = ADP8860_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1746 .l2_hyst = ADP8860_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1747 .l3_trip = ADP8860_L3_COMP_CURR_uA(43), /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1748 .l3_hyst = ADP8860_L3_COMP_CURR_uA(11), /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1749
1750 .leds = adp8860_leds,
1751 .num_leds = ARRAY_SIZE(adp8860_leds),
1752 .led_fade_law = ADP8860_FADE_LAW_SQUARE, /* fade-on/fade-off transfer characteristic */
1753 .led_fade_in = ADP8860_FADE_T_600ms,
1754 .led_fade_out = ADP8860_FADE_T_600ms,
1755 .led_on_time = ADP8860_LED_ONT_200ms,
1756};
1757#endif
1758
Sonic Zhangf32792d2010-02-09 02:47:09 +00001759#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
1760static struct regulator_consumer_supply ad5398_consumer = {
1761 .supply = "current",
1762};
1763
1764static struct regulator_init_data ad5398_regulator_data = {
1765 .constraints = {
1766 .name = "current range",
1767 .max_uA = 120000,
1768 .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
1769 },
1770 .num_consumer_supplies = 1,
1771 .consumer_supplies = &ad5398_consumer,
1772};
1773
1774static struct ad5398_platform_data ad5398_i2c_platform_data = {
1775 .current_bits = 10,
1776 .current_offset = 4,
1777 .regulator_data = &ad5398_regulator_data,
1778};
1779
1780#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
1781 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
1782static struct platform_device ad5398_virt_consumer_device = {
1783 .name = "reg-virt-consumer",
1784 .id = 0,
1785 .dev = {
1786 .platform_data = "current", /* Passed to driver */
1787 },
1788};
1789#endif
1790#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
1791 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
1792static struct regulator_bulk_data ad5398_bulk_data = {
1793 .supply = "current",
1794};
1795
1796static struct regulator_userspace_consumer_data ad5398_userspace_comsumer_data = {
1797 .name = "ad5398",
1798 .num_supplies = 1,
1799 .supplies = &ad5398_bulk_data,
1800};
1801
1802static struct platform_device ad5398_userspace_consumer_device = {
1803 .name = "reg-userspace-consumer",
1804 .id = 0,
1805 .dev = {
1806 .platform_data = &ad5398_userspace_comsumer_data,
1807 },
1808};
1809#endif
1810#endif
1811
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001812static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001813#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001814 {
Barry Song427f2772009-07-17 07:04:55 +00001815 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
Barry Song4c94c3e2009-07-07 07:41:50 +00001816 .irq = IRQ_PG5,
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001817 .platform_data = (void *)&ad7142_i2c_platform_data,
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001818 },
1819#endif
Barry Songad6720c2010-02-03 09:15:31 +00001820
1821#if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE)
1822 {
1823 I2C_BOARD_INFO("ad7150", 0x48),
1824 .irq = IRQ_PG5, /* fixme: use real interrupt number */
1825 },
1826#endif
1827
1828#if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE)
1829 {
1830 I2C_BOARD_INFO("ad7152", 0x48),
1831 },
1832#endif
1833
1834#if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE)
1835 {
1836 I2C_BOARD_INFO("ad774x", 0x48),
1837 },
1838#endif
1839
Sonic Zhang5f022592010-02-24 07:32:50 +00001840#if defined(CONFIG_AD7414) || defined(CONFIG_AD7414_MODULE)
1841 {
1842 I2C_BOARD_INFO("ad7414", 0x9),
1843 .irq = IRQ_PG5,
1844 /*
1845 * platform_data pointer is borrwoed by the driver to
1846 * store custimer defined IRQ ALART level mode.
1847 * only IRQF_TRIGGER_HIGH and IRQF_TRIGGER_LOW are valid.
1848 */
1849 .platform_data = (void *)IRQF_TRIGGER_LOW,
1850 },
1851#endif
1852
Sonic Zhangef8873e2010-02-25 10:27:48 +00001853#if defined(CONFIG_AD7416) || defined(CONFIG_AD7416_MODULE)
1854 {
1855 I2C_BOARD_INFO("ad7417", 0xb),
1856 .irq = IRQ_PG5,
1857 /*
1858 * platform_data pointer is borrwoed by the driver to
1859 * store custimer defined IRQ ALART level mode.
1860 * only IRQF_TRIGGER_HIGH and IRQF_TRIGGER_LOW are valid.
1861 */
1862 .platform_data = (void *)IRQF_TRIGGER_LOW,
1863 },
1864#endif
1865
Michael Hennerichebd58332009-07-02 11:00:38 +00001866#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001867 {
1868 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001869 },
1870#endif
Michael Hennerich204844e2009-06-30 14:57:22 +00001871#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001872 {
1873 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
Michael Hennerichf5150152008-10-16 23:23:18 +08001874 .irq = IRQ_PG6,
1875 },
1876#endif
1877#if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
1878 {
1879 I2C_BOARD_INFO("ad7879", 0x2F),
1880 .irq = IRQ_PG5,
1881 .platform_data = (void *)&bfin_ad7879_ts_info,
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001882 },
1883#endif
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001884#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1885 {
1886 I2C_BOARD_INFO("adp5588-keys", 0x34),
1887 .irq = IRQ_PG0,
1888 .platform_data = (void *)&adp5588_kpad_data,
1889 },
1890#endif
Michael Hennerich3ea57212009-03-28 22:15:07 +08001891#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1892 {
1893 I2C_BOARD_INFO("pmic-adp5520", 0x32),
Mike Frysinger4f84b6e2009-06-10 20:45:48 -04001894 .irq = IRQ_PG0,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001895 .platform_data = (void *)&adp5520_pdev_data,
1896 },
1897#endif
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001898#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1899 {
1900 I2C_BOARD_INFO("adxl34x", 0x53),
1901 .irq = IRQ_PG3,
1902 .platform_data = (void *)&adxl34x_info,
1903 },
1904#endif
Michael Hennerichba877d42009-08-27 04:09:32 +00001905#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1906 {
1907 I2C_BOARD_INFO("adp5588-gpio", 0x34),
1908 .platform_data = (void *)&adp5588_gpio_data,
1909 },
1910#endif
Michael Hennerich50c4c082009-09-22 13:10:09 +00001911#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
1912 {
1913 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
1914 },
1915#endif
Michael Hennerichddcd7cb2009-09-22 15:36:55 +00001916#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1917 {
1918 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2C),
1919 },
1920#endif
Michael Hennerich78756c62009-10-13 15:28:33 +00001921#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
1922 {
1923 I2C_BOARD_INFO("adp8870", 0x2B),
1924 .platform_data = (void *)&adp8870_pdata,
1925 },
1926#endif
Cliff Caid53127f2009-10-15 02:33:04 +00001927#if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE)
1928 {
1929 I2C_BOARD_INFO("adau1371", 0x1A),
1930 },
1931#endif
Cliff Cai04267632009-10-28 06:50:36 +00001932#if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE)
1933 {
1934 I2C_BOARD_INFO("adau1761", 0x38),
1935 },
1936#endif
Cliff Caic48d7672010-02-11 09:27:18 +00001937#if defined(CONFIG_SND_SOC_ADAU1361) || defined(CONFIG_SND_SOC_ADAU1361_MODULE)
1938 {
1939 I2C_BOARD_INFO("adau1361", 0x38),
1940 },
1941#endif
Michael Hennerich1f13f2f2009-11-17 10:18:27 +00001942#if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
1943 {
1944 I2C_BOARD_INFO("ad5258", 0x18),
1945 },
1946#endif
Cliff Cai29bb3bc2010-01-14 08:28:38 +00001947#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
1948 {
1949 I2C_BOARD_INFO("ssm2602", 0x1b),
1950 },
1951#endif
Sonic Zhangf32792d2010-02-09 02:47:09 +00001952#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
1953 {
1954 I2C_BOARD_INFO("ad5398", 0xC),
1955 .platform_data = (void *)&ad5398_i2c_platform_data,
1956 },
1957#endif
Michael Hennerich72fa2e92010-02-24 21:05:35 +00001958#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
1959 {
1960 I2C_BOARD_INFO("adp8860", 0x2A),
1961 .platform_data = (void *)&adp8860_pdata,
1962 },
1963#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001964};
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001965
Bryan Wu1394f032007-05-06 14:50:22 -07001966#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +00001967#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1968static struct resource bfin_sport0_uart_resources[] = {
1969 {
1970 .start = SPORT0_TCR1,
1971 .end = SPORT0_MRCS3+4,
1972 .flags = IORESOURCE_MEM,
1973 },
1974 {
1975 .start = IRQ_SPORT0_RX,
1976 .end = IRQ_SPORT0_RX+1,
1977 .flags = IORESOURCE_IRQ,
1978 },
1979 {
1980 .start = IRQ_SPORT0_ERROR,
1981 .end = IRQ_SPORT0_ERROR,
1982 .flags = IORESOURCE_IRQ,
1983 },
1984};
1985
1986unsigned short bfin_sport0_peripherals[] = {
1987 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
1988 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
1989};
1990
Bryan Wu1394f032007-05-06 14:50:22 -07001991static struct platform_device bfin_sport0_uart_device = {
1992 .name = "bfin-sport-uart",
1993 .id = 0,
Sonic Zhangdf5de262009-09-23 05:01:56 +00001994 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
1995 .resource = bfin_sport0_uart_resources,
1996 .dev = {
1997 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
1998 },
1999};
2000#endif
2001#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2002static struct resource bfin_sport1_uart_resources[] = {
2003 {
2004 .start = SPORT1_TCR1,
2005 .end = SPORT1_MRCS3+4,
2006 .flags = IORESOURCE_MEM,
2007 },
2008 {
2009 .start = IRQ_SPORT1_RX,
2010 .end = IRQ_SPORT1_RX+1,
2011 .flags = IORESOURCE_IRQ,
2012 },
2013 {
2014 .start = IRQ_SPORT1_ERROR,
2015 .end = IRQ_SPORT1_ERROR,
2016 .flags = IORESOURCE_IRQ,
2017 },
2018};
2019
2020unsigned short bfin_sport1_peripherals[] = {
2021 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
2022 P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
Bryan Wu1394f032007-05-06 14:50:22 -07002023};
2024
2025static struct platform_device bfin_sport1_uart_device = {
2026 .name = "bfin-sport-uart",
2027 .id = 1,
Sonic Zhangdf5de262009-09-23 05:01:56 +00002028 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
2029 .resource = bfin_sport1_uart_resources,
2030 .dev = {
2031 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
2032 },
Bryan Wu1394f032007-05-06 14:50:22 -07002033};
2034#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +00002035#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002036
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002037#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002038#define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2039/* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002040
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002041#ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2042#define PATA_INT IRQ_PF5
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002043static struct pata_platform_info bfin_pata_platform_data = {
2044 .ioport_shift = 1,
Mike Frysinger64e5c512007-10-30 11:56:13 +08002045 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002046};
2047
2048static struct resource bfin_pata_resources[] = {
2049 {
2050 .start = 0x20314020,
2051 .end = 0x2031403F,
2052 .flags = IORESOURCE_MEM,
2053 },
2054 {
2055 .start = 0x2031401C,
2056 .end = 0x2031401F,
2057 .flags = IORESOURCE_MEM,
2058 },
2059 {
2060 .start = PATA_INT,
2061 .end = PATA_INT,
2062 .flags = IORESOURCE_IRQ,
2063 },
2064};
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002065#elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
2066static struct pata_platform_info bfin_pata_platform_data = {
2067 .ioport_shift = 0,
2068};
Michael Hennerich648882d2009-04-21 12:05:50 +00002069/* CompactFlash Storage Card Memory Mapped Adressing
2070 * /REG = A11 = 1
2071 */
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002072static struct resource bfin_pata_resources[] = {
2073 {
Michael Hennerich648882d2009-04-21 12:05:50 +00002074 .start = 0x20211800,
2075 .end = 0x20211807,
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002076 .flags = IORESOURCE_MEM,
2077 },
2078 {
Michael Hennerich648882d2009-04-21 12:05:50 +00002079 .start = 0x2021180E, /* Device Ctl */
2080 .end = 0x2021180E,
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002081 .flags = IORESOURCE_MEM,
2082 },
2083};
2084#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002085
2086static struct platform_device bfin_pata_device = {
2087 .name = "pata_platform",
2088 .id = -1,
2089 .num_resources = ARRAY_SIZE(bfin_pata_resources),
2090 .resource = bfin_pata_resources,
2091 .dev = {
2092 .platform_data = &bfin_pata_platform_data,
2093 }
2094};
2095#endif
2096
Michael Hennerich14b03202008-05-07 11:41:26 +08002097static const unsigned int cclk_vlev_datasheet[] =
2098{
2099 VRPAIR(VLEV_085, 250000000),
2100 VRPAIR(VLEV_090, 376000000),
2101 VRPAIR(VLEV_095, 426000000),
2102 VRPAIR(VLEV_100, 426000000),
2103 VRPAIR(VLEV_105, 476000000),
2104 VRPAIR(VLEV_110, 476000000),
2105 VRPAIR(VLEV_115, 476000000),
2106 VRPAIR(VLEV_120, 500000000),
2107 VRPAIR(VLEV_125, 533000000),
2108 VRPAIR(VLEV_130, 600000000),
2109};
2110
2111static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
2112 .tuple_tab = cclk_vlev_datasheet,
2113 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
2114 .vr_settling_time = 25 /* us */,
2115};
2116
2117static struct platform_device bfin_dpmc = {
2118 .name = "bfin dpmc",
2119 .dev = {
2120 .platform_data = &bfin_dmpc_vreg_data,
2121 },
2122};
2123
Barry Song336746e2009-10-13 09:19:18 +00002124#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2125static struct platform_device bfin_i2s = {
2126 .name = "bfin-i2s",
2127 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2128 /* TODO: add platform data here */
2129};
2130#endif
2131
Barry Song83124402009-08-06 21:03:02 +00002132#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2133static struct platform_device bfin_tdm = {
2134 .name = "bfin-tdm",
Barry Song336746e2009-10-13 09:19:18 +00002135 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2136 /* TODO: add platform data here */
2137};
2138#endif
2139
2140#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2141static struct platform_device bfin_ac97 = {
2142 .name = "bfin-ac97",
2143 .id = CONFIG_SND_BF5XX_SPORT_NUM,
Barry Song83124402009-08-06 21:03:02 +00002144 /* TODO: add platform data here */
2145};
2146#endif
2147
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002148#if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
2149#define REGULATOR_ADP122 "adp122"
2150#define REGULATOR_ADP150 "adp150"
2151
2152static struct regulator_consumer_supply adp122_consumers = {
2153 .supply = REGULATOR_ADP122,
2154};
2155
2156static struct regulator_consumer_supply adp150_consumers = {
2157 .supply = REGULATOR_ADP150,
2158};
2159
2160static struct regulator_init_data adp_switch_regulator_data[] = {
2161 {
2162 .constraints = {
2163 .name = REGULATOR_ADP122,
2164 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
Sonic Zhang5f022592010-02-24 07:32:50 +00002165 .min_uA = 0,
2166 .max_uA = 300000,
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002167 },
2168 .num_consumer_supplies = 1, /* only 1 */
2169 .consumer_supplies = &adp122_consumers,
2170 .driver_data = (void *)GPIO_PF2, /* gpio port only */
2171 },
2172 {
2173 .constraints = {
2174 .name = REGULATOR_ADP150,
2175 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
Sonic Zhang5f022592010-02-24 07:32:50 +00002176 .min_uA = 0,
2177 .max_uA = 150000,
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002178 },
2179 .num_consumer_supplies = 1, /* only 1 */
2180 .consumer_supplies = &adp150_consumers,
2181 .driver_data = (void *)GPIO_PF3, /* gpio port only */
2182 },
2183};
2184
2185static struct adp_switch_platform_data adp_switch_pdata = {
2186 .regulator_num = ARRAY_SIZE(adp_switch_regulator_data),
2187 .regulator_data = adp_switch_regulator_data,
2188};
2189
2190static struct platform_device adp_switch_device = {
2191 .name = "adp_switch",
2192 .id = 0,
2193 .dev = {
2194 .platform_data = &adp_switch_pdata,
2195 },
2196};
2197
2198#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2199 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2200static struct regulator_bulk_data adp122_bulk_data = {
2201 .supply = REGULATOR_ADP122,
2202};
2203
2204static struct regulator_userspace_consumer_data adp122_userspace_comsumer_data = {
2205 .name = REGULATOR_ADP122,
2206 .num_supplies = 1,
2207 .supplies = &adp122_bulk_data,
2208};
2209
2210static struct platform_device adp122_userspace_consumer_device = {
2211 .name = "reg-userspace-consumer",
2212 .id = 0,
2213 .dev = {
2214 .platform_data = &adp122_userspace_comsumer_data,
2215 },
2216};
2217
2218static struct regulator_bulk_data adp150_bulk_data = {
2219 .supply = REGULATOR_ADP150,
2220};
2221
2222static struct regulator_userspace_consumer_data adp150_userspace_comsumer_data = {
2223 .name = REGULATOR_ADP150,
2224 .num_supplies = 1,
2225 .supplies = &adp150_bulk_data,
2226};
2227
2228static struct platform_device adp150_userspace_consumer_device = {
2229 .name = "reg-userspace-consumer",
2230 .id = 1,
2231 .dev = {
2232 .platform_data = &adp150_userspace_comsumer_data,
2233 },
2234};
2235#endif
2236#endif
2237
2238
Bryan Wu1394f032007-05-06 14:50:22 -07002239static struct platform_device *stamp_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +08002240
2241 &bfin_dpmc,
2242
Bryan Wu1394f032007-05-06 14:50:22 -07002243#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
2244 &bfin_pcmcia_cf_device,
2245#endif
2246
2247#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
2248 &rtc_device,
2249#endif
2250
2251#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
2252 &sl811_hcd_device,
2253#endif
2254
2255#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
2256 &isp1362_hcd_device,
2257#endif
2258
Michael Hennerich3f375692008-11-18 17:48:22 +08002259#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
2260 &bfin_isp1760_device,
2261#endif
2262
Bryan Wu1394f032007-05-06 14:50:22 -07002263#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
2264 &smc91x_device,
2265#endif
2266
Alex Landauf40d24d2007-07-12 12:11:48 +08002267#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
2268 &dm9000_device,
2269#endif
2270
Barry Song706a01b2009-11-02 07:29:07 +00002271#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
2272 &bfin_can_device,
2273#endif
2274
Bryan Wu1394f032007-05-06 14:50:22 -07002275#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +08002276 &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -07002277 &bfin_mac_device,
2278#endif
2279
2280#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
2281 &net2272_bfin_device,
2282#endif
2283
2284#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002285 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -07002286#endif
2287
Cliff Cai1e9aa952009-03-28 23:28:51 +08002288#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
2289 &bfin_sport_spi0_device,
2290 &bfin_sport_spi1_device,
2291#endif
2292
Bryan Wu1394f032007-05-06 14:50:22 -07002293#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2294 &bfin_fb_device,
2295#endif
2296
Michael Hennerich2043f3f2008-10-13 14:46:30 +08002297#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
2298 &bfin_lq035q1_device,
2299#endif
2300
Bryan Wu1394f032007-05-06 14:50:22 -07002301#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00002302#ifdef CONFIG_SERIAL_BFIN_UART0
2303 &bfin_uart0_device,
2304#endif
2305#ifdef CONFIG_SERIAL_BFIN_UART1
2306 &bfin_uart1_device,
2307#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002308#endif
2309
Graf Yang5be36d22008-04-25 03:09:15 +08002310#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +08002311#ifdef CONFIG_BFIN_SIR0
2312 &bfin_sir0_device,
2313#endif
2314#ifdef CONFIG_BFIN_SIR1
2315 &bfin_sir1_device,
2316#endif
Graf Yang5be36d22008-04-25 03:09:15 +08002317#endif
2318
Bryan Wu1394f032007-05-06 14:50:22 -07002319#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
2320 &i2c_bfin_twi_device,
2321#endif
2322
2323#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +00002324#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
Bryan Wu1394f032007-05-06 14:50:22 -07002325 &bfin_sport0_uart_device,
Sonic Zhangdf5de262009-09-23 05:01:56 +00002326#endif
2327#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
Bryan Wu1394f032007-05-06 14:50:22 -07002328 &bfin_sport1_uart_device,
2329#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +00002330#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002331
2332#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2333 &bfin_pata_device,
2334#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +08002335
2336#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
2337 &bfin_device_gpiokeys,
2338#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +08002339
Mike Frysingerfc689112008-06-25 11:41:42 +08002340#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
2341 &bfin_async_nand_device,
2342#endif
2343
Mike Frysinger793dc272008-03-26 08:09:12 +08002344#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +08002345 &stamp_flash_device,
Mike Frysinger793dc272008-03-26 08:09:12 +08002346#endif
Barry Song83124402009-08-06 21:03:02 +00002347
Barry Song336746e2009-10-13 09:19:18 +00002348#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2349 &bfin_i2s,
2350#endif
2351
Barry Song83124402009-08-06 21:03:02 +00002352#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2353 &bfin_tdm,
2354#endif
Barry Song336746e2009-10-13 09:19:18 +00002355
2356#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2357 &bfin_ac97,
2358#endif
Sonic Zhangf32792d2010-02-09 02:47:09 +00002359#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2360#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2361 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2362 &ad5398_virt_consumer_device,
2363#endif
2364#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2365 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2366 &ad5398_userspace_consumer_device,
2367#endif
2368#endif
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002369
2370#if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
2371 &adp_switch_device,
2372#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2373 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2374 &adp122_userspace_consumer_device,
2375 &adp150_userspace_consumer_device,
2376#endif
2377#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002378};
2379
2380static int __init stamp_init(void)
2381{
Harvey Harrisonb85d8582008-04-23 09:39:01 +08002382 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Mike Frysingerfc689112008-06-25 11:41:42 +08002383 bfin_plat_nand_init();
Mike Frysinger0531c462010-01-19 07:04:29 +00002384 adf702x_mac_init();
Bryan Wu1394f032007-05-06 14:50:22 -07002385 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
Sonic Zhangdf5de262009-09-23 05:01:56 +00002386 i2c_register_board_info(0, bfin_i2c_board_info,
2387 ARRAY_SIZE(bfin_i2c_board_info));
Mike Frysinger5bda2722008-06-07 15:03:01 +08002388 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002389
Bryan Wu1394f032007-05-06 14:50:22 -07002390 return 0;
2391}
2392
2393arch_initcall(stamp_init);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002394
Sonic Zhangc13ce9f2009-09-23 09:37:46 +00002395
2396static struct platform_device *stamp_early_devices[] __initdata = {
2397#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
2398#ifdef CONFIG_SERIAL_BFIN_UART0
2399 &bfin_uart0_device,
2400#endif
2401#ifdef CONFIG_SERIAL_BFIN_UART1
2402 &bfin_uart1_device,
2403#endif
2404#endif
2405
2406#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
2407#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2408 &bfin_sport0_uart_device,
2409#endif
2410#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2411 &bfin_sport1_uart_device,
2412#endif
2413#endif
2414};
2415
2416void __init native_machine_early_platform_add_devices(void)
2417{
2418 printk(KERN_INFO "register early platform devices\n");
2419 early_platform_add_devices(stamp_early_devices,
2420 ARRAY_SIZE(stamp_early_devices));
2421}
2422
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002423void native_machine_restart(char *cmd)
2424{
2425 /* workaround reboot hang when booting from SPI */
2426 if ((bfin_read_SYSCR() & 0x7) == 0x3)
Sonic Zhangb52dae32009-02-04 16:49:45 +08002427 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002428}
Mike Frysinger137b1522007-11-22 16:07:03 +08002429
2430/*
2431 * Currently the MAC address is saved in Flash by U-Boot
2432 */
2433#define FLASH_MAC 0x203f0000
Mike Frysinger9862cc52007-11-15 21:21:20 +08002434void bfin_get_ether_addr(char *addr)
Mike Frysinger137b1522007-11-22 16:07:03 +08002435{
2436 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
2437 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
2438}
Mike Frysinger9862cc52007-11-15 21:21:20 +08002439EXPORT_SYMBOL(bfin_get_ether_addr);