blob: 283cc66f0220761d55f1a21537412eba7096c339 [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 Hennerichc6feb7682009-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 = {
403 .chip_delay = 30,
404#ifdef CONFIG_MTD_PARTITIONS
405 .part_probe_types = part_probes,
406 .partitions = bfin_plat_nand_partitions,
407 .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
408#endif
409 },
410 .ctrl = {
411 .cmd_ctrl = bfin_plat_nand_cmd_ctrl,
412 .dev_ready = bfin_plat_nand_dev_ready,
413 },
414};
415
416#define MAX(x, y) (x > y ? x : y)
417static struct resource bfin_plat_nand_resources = {
418 .start = 0x20212000,
419 .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
420 .flags = IORESOURCE_IO,
421};
422
423static struct platform_device bfin_async_nand_device = {
424 .name = "gen_nand",
425 .id = -1,
426 .num_resources = 1,
427 .resource = &bfin_plat_nand_resources,
428 .dev = {
429 .platform_data = &bfin_plat_nand_data,
430 },
431};
432
433static void bfin_plat_nand_init(void)
434{
435 gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
436}
437#else
438static void bfin_plat_nand_init(void) {}
439#endif
440
Mike Frysinger793dc272008-03-26 08:09:12 +0800441#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800442static struct mtd_partition stamp_partitions[] = {
443 {
Robin Getzaa582972008-08-05 17:47:29 +0800444 .name = "bootloader(nor)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800445 .size = 0x40000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800446 .offset = 0,
447 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800448 .name = "linux kernel(nor)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800449 .size = 0x180000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800450 .offset = MTDPART_OFS_APPEND,
451 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800452 .name = "file system(nor)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800453 .size = 0x400000 - 0x40000 - 0x180000 - 0x10000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800454 .offset = MTDPART_OFS_APPEND,
455 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800456 .name = "MAC Address(nor)",
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800457 .size = MTDPART_SIZ_FULL,
458 .offset = 0x3F0000,
459 .mask_flags = MTD_WRITEABLE,
460 }
461};
462
463static struct physmap_flash_data stamp_flash_data = {
464 .width = 2,
465 .parts = stamp_partitions,
466 .nr_parts = ARRAY_SIZE(stamp_partitions),
Barry Song38e76732010-01-15 03:24:39 +0000467#ifdef CONFIG_ROMKERNEL
468 .probe_type = "map_rom",
469#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800470};
471
472static struct resource stamp_flash_resource = {
473 .start = 0x20000000,
474 .end = 0x203fffff,
475 .flags = IORESOURCE_MEM,
476};
477
478static struct platform_device stamp_flash_device = {
479 .name = "physmap-flash",
480 .id = 0,
481 .dev = {
482 .platform_data = &stamp_flash_data,
483 },
484 .num_resources = 1,
485 .resource = &stamp_flash_resource,
486};
Mike Frysinger793dc272008-03-26 08:09:12 +0800487#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800488
Bryan Wu1394f032007-05-06 14:50:22 -0700489#if defined(CONFIG_MTD_M25P80) \
490 || defined(CONFIG_MTD_M25P80_MODULE)
491static struct mtd_partition bfin_spi_flash_partitions[] = {
492 {
Robin Getzaa582972008-08-05 17:47:29 +0800493 .name = "bootloader(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800494 .size = 0x00040000,
Bryan Wu1394f032007-05-06 14:50:22 -0700495 .offset = 0,
496 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800497 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800498 .name = "linux kernel(spi)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800499 .size = 0x180000,
Mike Frysingeredf05642008-02-25 11:38:11 +0800500 .offset = MTDPART_OFS_APPEND,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800501 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800502 .name = "file system(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800503 .size = MTDPART_SIZ_FULL,
504 .offset = MTDPART_OFS_APPEND,
Bryan Wu1394f032007-05-06 14:50:22 -0700505 }
506};
507
508static struct flash_platform_data bfin_spi_flash_data = {
509 .name = "m25p80",
510 .parts = bfin_spi_flash_partitions,
511 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
Michael Hennerich88a80782008-11-18 17:48:22 +0800512 /* .type = "m25p64", */
Bryan Wu1394f032007-05-06 14:50:22 -0700513};
514
515/* SPI flash chip (m25p64) */
516static struct bfin5xx_spi_chip spi_flash_chip_info = {
517 .enable_dma = 0, /* use dma transfer with this chip*/
518 .bits_per_word = 8,
519};
520#endif
521
Mike Frysingera261eec2009-05-20 14:05:36 +0000522#if defined(CONFIG_BFIN_SPI_ADC) \
523 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700524/* SPI ADC chip */
525static struct bfin5xx_spi_chip spi_adc_chip_info = {
526 .enable_dma = 1, /* use dma transfer with this chip*/
527 .bits_per_word = 16,
528};
529#endif
530
Barry Song83124402009-08-06 21:03:02 +0000531#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
532 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700533static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
534 .enable_dma = 0,
535 .bits_per_word = 16,
536};
537#endif
538
Barry Song3b827902010-01-27 09:01:36 +0000539#if defined(CONFIG_SND_BF5XX_SOC_AD193X) \
540 || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
Barry Songd4b834c2009-06-04 10:14:17 +0000541static struct bfin5xx_spi_chip ad1938_spi_chip_info = {
542 .enable_dma = 0,
543 .bits_per_word = 8,
Barry Songd4b834c2009-06-04 10:14:17 +0000544};
545#endif
546
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000547#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000548#include <linux/input/ad714x.h>
549static struct bfin5xx_spi_chip ad7147_spi_chip_info = {
550 .enable_dma = 0,
551 .bits_per_word = 16,
552};
553
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000554static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000555 {
556 .start_stage = 0,
557 .end_stage = 7,
558 .max_coord = 128,
559 },
560};
561
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000562static struct ad714x_button_plat ad7147_spi_button_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000563 {
564 .keycode = BTN_FORWARD,
565 .l_mask = 0,
566 .h_mask = 0x600,
567 },
568 {
569 .keycode = BTN_LEFT,
570 .l_mask = 0,
571 .h_mask = 0x500,
572 },
573 {
574 .keycode = BTN_MIDDLE,
575 .l_mask = 0,
576 .h_mask = 0x800,
577 },
578 {
579 .keycode = BTN_RIGHT,
580 .l_mask = 0x100,
581 .h_mask = 0x400,
582 },
583 {
584 .keycode = BTN_BACK,
585 .l_mask = 0x200,
586 .h_mask = 0x400,
587 },
588};
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000589static struct ad714x_platform_data ad7147_spi_platform_data = {
Barry Song427f2772009-07-17 07:04:55 +0000590 .slider_num = 1,
591 .button_num = 5,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000592 .slider = ad7147_spi_slider_plat,
593 .button = ad7147_spi_button_plat,
Barry Song427f2772009-07-17 07:04:55 +0000594 .stage_cfg_reg = {
595 {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
596 {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
597 {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
598 {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
599 {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
600 {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
601 {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
602 {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
603 {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
604 {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
605 {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
606 {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
607 },
608 .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
609};
610#endif
611
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000612#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000613#include <linux/input/ad714x.h>
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000614static struct ad714x_button_plat ad7142_i2c_button_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000615 {
616 .keycode = BTN_1,
617 .l_mask = 0,
618 .h_mask = 0x1,
619 },
620 {
621 .keycode = BTN_2,
622 .l_mask = 0,
623 .h_mask = 0x2,
624 },
625 {
626 .keycode = BTN_3,
627 .l_mask = 0,
628 .h_mask = 0x4,
629 },
630 {
631 .keycode = BTN_4,
632 .l_mask = 0x0,
633 .h_mask = 0x8,
634 },
635};
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000636static struct ad714x_platform_data ad7142_i2c_platform_data = {
Barry Song427f2772009-07-17 07:04:55 +0000637 .button_num = 4,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000638 .button = ad7142_i2c_button_plat,
Barry Song427f2772009-07-17 07:04:55 +0000639 .stage_cfg_reg = {
640 /* fixme: figure out right setting for all comoponent according
641 * to hardware feature of EVAL-AD7142EB board */
642 {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
643 {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
644 {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
645 {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
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 {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 },
655 .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
656};
657#endif
658
Graf Yangf5f95312010-02-10 07:15:59 +0000659#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
660static struct bfin5xx_spi_chip ad2s90_spi_chip_info = {
661 .enable_dma = 0,
662 .bits_per_word = 16,
663};
664#endif
665
Graf Yangdf6a9492010-02-21 10:23:07 +0000666#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
667unsigned short ad2s120x_platform_data[] = {
668 /* used as SAMPLE and RDVEL */
669 GPIO_PF5, GPIO_PF6, 0
670};
671
672static struct bfin5xx_spi_chip ad2s120x_spi_chip_info = {
673 .enable_dma = 0,
674 .bits_per_word = 16,
675};
676#endif
677
Yi Lif79ea4c2009-01-07 23:14:38 +0800678#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
679#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
680
681static int bfin_mmc_spi_init(struct device *dev,
682 irqreturn_t (*detect_int)(int, void *), void *data)
683{
684 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
685 IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
686}
687
688static void bfin_mmc_spi_exit(struct device *dev, void *data)
689{
690 free_irq(MMC_SPI_CARD_DETECT_INT, data);
691}
692
693static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
694 .init = bfin_mmc_spi_init,
695 .exit = bfin_mmc_spi_exit,
696 .detect_delay = 100, /* msecs */
697};
698
699static struct bfin5xx_spi_chip mmc_spi_chip_info = {
700 .enable_dma = 0,
701 .bits_per_word = 8,
Yi Lie68d1eb2009-06-03 09:46:22 +0000702 .pio_interrupt = 0,
Yi Lif79ea4c2009-01-07 23:14:38 +0800703};
704#endif
705
Bryan Wu1394f032007-05-06 14:50:22 -0700706#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800707#include <linux/spi/ad7877.h>
Bryan Wu1394f032007-05-06 14:50:22 -0700708static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700709 .enable_dma = 0,
710 .bits_per_word = 16,
711};
712
713static const struct ad7877_platform_data bfin_ad7877_ts_info = {
714 .model = 7877,
715 .vref_delay_usecs = 50, /* internal, no capacitor */
716 .x_plate_ohms = 419,
717 .y_plate_ohms = 486,
718 .pressure_max = 1000,
719 .pressure_min = 0,
720 .stopacq_polarity = 1,
721 .first_conversion_delay = 3,
722 .acquisition_time = 1,
723 .averaging = 1,
724 .pen_down_acc_interval = 1,
725};
726#endif
727
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800728#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
729#include <linux/spi/ad7879.h>
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800730static const struct ad7879_platform_data bfin_ad7879_ts_info = {
731 .model = 7879, /* Model = AD7879 */
732 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
733 .pressure_max = 10000,
734 .pressure_min = 0,
735 .first_conversion_delay = 3, /* wait 512us before do a first conversion */
736 .acquisition_time = 1, /* 4us acquisition time per sample */
737 .median = 2, /* do 8 measurements */
738 .averaging = 1, /* take the average of 4 middle samples */
739 .pen_down_acc_interval = 255, /* 9.4 ms */
Michael Hennerich244d3422009-12-18 09:29:39 +0000740 .gpio_export = 1, /* Export GPIO to gpiolib */
741 .gpio_base = -1, /* Dynamic allocation */
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800742};
743#endif
744
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000745#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000746#include <linux/input/adxl34x.h>
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000747static const struct adxl34x_platform_data adxl34x_info = {
748 .x_axis_offset = 0,
749 .y_axis_offset = 0,
750 .z_axis_offset = 0,
751 .tap_threshold = 0x31,
752 .tap_duration = 0x10,
753 .tap_latency = 0x60,
754 .tap_window = 0xF0,
755 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
756 .act_axis_control = 0xFF,
757 .activity_threshold = 5,
758 .inactivity_threshold = 3,
759 .inactivity_time = 4,
760 .free_fall_threshold = 0x7,
761 .free_fall_time = 0x20,
762 .data_rate = 0x8,
763 .data_range = ADXL_FULL_RES,
764
765 .ev_type = EV_ABS,
766 .ev_code_x = ABS_X, /* EV_REL */
767 .ev_code_y = ABS_Y, /* EV_REL */
768 .ev_code_z = ABS_Z, /* EV_REL */
769
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000770 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000771
772/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
773/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
774 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
775 .fifo_mode = ADXL_FIFO_STREAM,
776};
777#endif
778
Michael Hennerichf5150152008-10-16 23:23:18 +0800779#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
780static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
781 .enable_dma = 0,
782 .bits_per_word = 16,
783};
784#endif
785
Michael Hennerich6e668932008-02-09 01:54:09 +0800786#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
787static struct bfin5xx_spi_chip spidev_chip_info = {
788 .enable_dma = 0,
789 .bits_per_word = 8,
790};
791#endif
792
Michael Hennerich2043f3f2008-10-13 14:46:30 +0800793#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
794static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
795 .enable_dma = 0,
796 .bits_per_word = 8,
797};
798#endif
799
Michael Hennerich85a192e2009-01-07 23:14:38 +0800800#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
801static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
802 .enable_dma = 1,
803 .bits_per_word = 8,
804 .cs_gpio = GPIO_PF10,
805};
806#endif
807
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000808#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
809static struct bfin5xx_spi_chip adf7021_spi_chip_info = {
810 .bits_per_word = 16,
811 .cs_gpio = GPIO_PF10,
812};
813
814#include <linux/spi/adf702x.h>
815#define TXREG 0x0160A470
816static const u32 adf7021_regs[] = {
817 0x09608FA0,
818 0x00575011,
819 0x00A7F092,
820 0x2B141563,
821 0x81F29E94,
822 0x00003155,
823 0x050A4F66,
824 0x00000007,
825 0x00000008,
826 0x000231E9,
827 0x3296354A,
828 0x891A2B3B,
829 0x00000D9C,
830 0x0000000D,
831 0x0000000E,
832 0x0000000F,
833};
834
835static struct adf702x_platform_data adf7021_platform_data = {
836 .regs_base = (void *)SPORT1_TCR1,
837 .dma_ch_rx = CH_SPORT1_RX,
838 .dma_ch_tx = CH_SPORT1_TX,
839 .irq_sport_err = IRQ_SPORT1_ERROR,
840 .gpio_int_rfs = GPIO_PF8,
841 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_RFS, P_SPORT1_DRPRI,
842 P_SPORT1_RSCLK, P_SPORT1_TSCLK, 0},
843 .adf702x_model = MODEL_ADF7021,
844 .adf702x_regs = adf7021_regs,
845 .tx_reg = TXREG,
846};
Mike Frysinger0531c462010-01-19 07:04:29 +0000847static inline void adf702x_mac_init(void)
848{
849 random_ether_addr(adf7021_platform_data.mac_addr);
850}
851#else
852static inline void adf702x_mac_init(void) {}
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000853#endif
854
Michael Hennerichfe5b25c2010-02-04 14:41:39 +0000855#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
856#include <linux/spi/ads7846.h>
857static struct bfin5xx_spi_chip ad7873_spi_chip_info = {
858 .bits_per_word = 8,
859};
860
861static int ads7873_get_pendown_state(void)
862{
863 return gpio_get_value(GPIO_PF6);
864}
865
866static struct ads7846_platform_data __initdata ad7873_pdata = {
867 .model = 7873, /* AD7873 */
868 .x_max = 0xfff,
869 .y_max = 0xfff,
870 .x_plate_ohms = 620,
871 .debounce_max = 1,
872 .debounce_rep = 0,
873 .debounce_tol = (~0),
874 .get_pendown_state = ads7873_get_pendown_state,
875};
876#endif
877
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800878#if defined(CONFIG_MTD_DATAFLASH) \
879 || defined(CONFIG_MTD_DATAFLASH_MODULE)
Michael Hennerichceac2652008-08-25 17:39:11 +0800880
881static struct mtd_partition bfin_spi_dataflash_partitions[] = {
882 {
883 .name = "bootloader(spi)",
884 .size = 0x00040000,
885 .offset = 0,
886 .mask_flags = MTD_CAP_ROM
887 }, {
888 .name = "linux kernel(spi)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800889 .size = 0x180000,
Michael Hennerichceac2652008-08-25 17:39:11 +0800890 .offset = MTDPART_OFS_APPEND,
891 }, {
892 .name = "file system(spi)",
893 .size = MTDPART_SIZ_FULL,
894 .offset = MTDPART_OFS_APPEND,
895 }
896};
897
898static struct flash_platform_data bfin_spi_dataflash_data = {
899 .name = "SPI Dataflash",
900 .parts = bfin_spi_dataflash_partitions,
901 .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
902};
903
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800904/* DataFlash chip */
905static struct bfin5xx_spi_chip data_flash_chip_info = {
906 .enable_dma = 0, /* use dma transfer with this chip*/
907 .bits_per_word = 8,
908};
909#endif
910
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000911#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
912static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
913 .enable_dma = 0, /* use dma transfer with this chip*/
914 .bits_per_word = 8,
915};
916#endif
917
Bryan Wu1394f032007-05-06 14:50:22 -0700918static struct spi_board_info bfin_spi_board_info[] __initdata = {
919#if defined(CONFIG_MTD_M25P80) \
920 || defined(CONFIG_MTD_M25P80_MODULE)
921 {
922 /* the modalias must be the same as spi device driver name */
923 .modalias = "m25p80", /* Name of spi_driver for this device */
924 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800925 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700926 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
927 .platform_data = &bfin_spi_flash_data,
928 .controller_data = &spi_flash_chip_info,
929 .mode = SPI_MODE_3,
930 },
931#endif
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800932#if defined(CONFIG_MTD_DATAFLASH) \
933 || defined(CONFIG_MTD_DATAFLASH_MODULE)
934 { /* DataFlash chip */
935 .modalias = "mtd_dataflash",
Michael Hennerichceac2652008-08-25 17:39:11 +0800936 .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800937 .bus_num = 0, /* Framework bus number */
938 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
Michael Hennerichceac2652008-08-25 17:39:11 +0800939 .platform_data = &bfin_spi_dataflash_data,
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800940 .controller_data = &data_flash_chip_info,
941 .mode = SPI_MODE_3,
942 },
943#endif
Mike Frysingera261eec2009-05-20 14:05:36 +0000944#if defined(CONFIG_BFIN_SPI_ADC) \
945 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700946 {
947 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
948 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800949 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700950 .chip_select = 1, /* Framework chip select. */
951 .platform_data = NULL, /* No spi_driver specific config */
952 .controller_data = &spi_adc_chip_info,
953 },
954#endif
955
Barry Song83124402009-08-06 21:03:02 +0000956#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
957 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700958 {
Barry Songdac98172009-08-13 21:07:37 +0000959 .modalias = "ad1836",
Bryan Wu1394f032007-05-06 14:50:22 -0700960 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800961 .bus_num = 0,
Barry Song83124402009-08-06 21:03:02 +0000962 .chip_select = 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
Bryan Wu1394f032007-05-06 14:50:22 -0700963 .controller_data = &ad1836_spi_chip_info,
Barry Song83124402009-08-06 21:03:02 +0000964 .mode = SPI_MODE_3,
Bryan Wu1394f032007-05-06 14:50:22 -0700965 },
966#endif
Barry Songd4b834c2009-06-04 10:14:17 +0000967
Barry Song3b827902010-01-27 09:01:36 +0000968#if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
Barry Songd4b834c2009-06-04 10:14:17 +0000969 {
Barry Song3b827902010-01-27 09:01:36 +0000970 .modalias = "ad193x",
Barry Songd4b834c2009-06-04 10:14:17 +0000971 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
972 .bus_num = 0,
Barry Song08a54bf2009-09-18 09:14:38 +0000973 .chip_select = 5,
Barry Songd4b834c2009-06-04 10:14:17 +0000974 .controller_data = &ad1938_spi_chip_info,
975 .mode = SPI_MODE_3,
976 },
977#endif
978
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000979#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000980 {
981 .modalias = "ad714x_captouch",
982 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
983 .irq = IRQ_PF4,
984 .bus_num = 0,
985 .chip_select = 5,
986 .mode = SPI_MODE_3,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000987 .platform_data = &ad7147_spi_platform_data,
Barry Song427f2772009-07-17 07:04:55 +0000988 .controller_data = &ad7147_spi_chip_info,
989 },
990#endif
991
Graf Yangf5f95312010-02-10 07:15:59 +0000992#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
993 {
994 .modalias = "ad2s90",
995 .bus_num = 0,
996 .chip_select = 3, /* change it for your board */
997 .platform_data = NULL,
998 .controller_data = &ad2s90_spi_chip_info,
999 },
1000#endif
1001
Graf Yangdf6a9492010-02-21 10:23:07 +00001002#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
1003 {
1004 .modalias = "ad2s120x",
1005 .bus_num = 0,
1006 .chip_select = 4, /* CS, change it for your board */
1007 .platform_data = ad2s120x_platform_data,
1008 .controller_data = &ad2s120x_spi_chip_info,
1009 },
1010#endif
1011
Yi Lif79ea4c2009-01-07 23:14:38 +08001012#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
1013 {
1014 .modalias = "mmc_spi",
1015 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1016 .bus_num = 0,
1017 .chip_select = 4,
1018 .platform_data = &bfin_mmc_spi_pdata,
1019 .controller_data = &mmc_spi_chip_info,
1020 .mode = SPI_MODE_3,
1021 },
1022#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001023#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1024 {
1025 .modalias = "ad7877",
1026 .platform_data = &bfin_ad7877_ts_info,
1027 .irq = IRQ_PF6,
1028 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Michael Hennerichc7d48962007-11-15 21:33:31 +08001029 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -07001030 .chip_select = 1,
1031 .controller_data = &spi_ad7877_chip_info,
1032 },
1033#endif
Michael Hennerichf5150152008-10-16 23:23:18 +08001034#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
Michael Hennerich46aa04f2008-10-13 11:30:17 +08001035 {
1036 .modalias = "ad7879",
1037 .platform_data = &bfin_ad7879_ts_info,
1038 .irq = IRQ_PF7,
1039 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1040 .bus_num = 0,
1041 .chip_select = 1,
1042 .controller_data = &spi_ad7879_chip_info,
1043 .mode = SPI_CPHA | SPI_CPOL,
1044 },
1045#endif
Michael Hennerich6e668932008-02-09 01:54:09 +08001046#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1047 {
1048 .modalias = "spidev",
1049 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1050 .bus_num = 0,
1051 .chip_select = 1,
1052 .controller_data = &spidev_chip_info,
1053 },
1054#endif
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001055#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1056 {
1057 .modalias = "bfin-lq035q1-spi",
1058 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1059 .bus_num = 0,
Michael Hennerich46aa04f2008-10-13 11:30:17 +08001060 .chip_select = 2,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001061 .controller_data = &lq035q1_spi_chip_info,
1062 .mode = SPI_CPHA | SPI_CPOL,
1063 },
1064#endif
Michael Hennerich85a192e2009-01-07 23:14:38 +08001065#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
1066 {
1067 .modalias = "enc28j60",
1068 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1069 .irq = IRQ_PF6,
1070 .bus_num = 0,
1071 .chip_select = 0, /* GPIO controlled SSEL */
1072 .controller_data = &enc28j60_spi_chip_info,
1073 .mode = SPI_MODE_0,
1074 },
1075#endif
Michael Hennerich57af8ed2009-10-16 12:35:20 +00001076#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1077 {
1078 .modalias = "adxl34x",
1079 .platform_data = &adxl34x_info,
1080 .irq = IRQ_PF6,
1081 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1082 .bus_num = 0,
1083 .chip_select = 2,
1084 .controller_data = &spi_adxl34x_chip_info,
1085 .mode = SPI_MODE_3,
1086 },
1087#endif
Michael Hennerichefaf7cd2009-11-12 16:54:08 +00001088#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
1089 {
1090 .modalias = "adf702x",
1091 .max_speed_hz = 16000000, /* max spi clock (SCK) speed in HZ */
1092 .bus_num = 0,
1093 .chip_select = 0, /* GPIO controlled SSEL */
1094 .controller_data = &adf7021_spi_chip_info,
1095 .platform_data = &adf7021_platform_data,
1096 .mode = SPI_MODE_0,
1097 },
1098#endif
Michael Hennerichfe5b25c2010-02-04 14:41:39 +00001099#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
1100 {
1101 .modalias = "ads7846",
1102 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1103 .bus_num = 0,
1104 .irq = IRQ_PF6,
1105 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1106 .controller_data = &ad7873_spi_chip_info,
1107 .platform_data = &ad7873_pdata,
1108 .mode = SPI_MODE_0,
1109 },
1110#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001111};
1112
Mike Frysinger5bda2722008-06-07 15:03:01 +08001113#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -07001114/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001115static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -07001116 .num_chipselect = 8,
1117 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +08001118 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -07001119};
1120
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001121/* SPI (0) */
1122static struct resource bfin_spi0_resource[] = {
1123 [0] = {
1124 .start = SPI0_REGBASE,
1125 .end = SPI0_REGBASE + 0xFF,
1126 .flags = IORESOURCE_MEM,
1127 },
1128 [1] = {
1129 .start = CH_SPI,
1130 .end = CH_SPI,
Yi Lie68d1eb2009-06-03 09:46:22 +00001131 .flags = IORESOURCE_DMA,
1132 },
1133 [2] = {
1134 .start = IRQ_SPI,
1135 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001136 .flags = IORESOURCE_IRQ,
1137 },
1138};
1139
1140static struct platform_device bfin_spi0_device = {
1141 .name = "bfin-spi",
1142 .id = 0, /* Bus number */
1143 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1144 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -07001145 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001146 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -07001147 },
1148};
1149#endif /* spi master and devices */
1150
Cliff Cai1e9aa952009-03-28 23:28:51 +08001151#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1152
1153/* SPORT SPI controller data */
1154static struct bfin5xx_spi_master bfin_sport_spi0_info = {
1155 .num_chipselect = 1, /* master only supports one device */
1156 .enable_dma = 0, /* master don't support DMA */
1157 .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,
1158 P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0},
1159};
1160
1161static struct resource bfin_sport_spi0_resource[] = {
1162 [0] = {
1163 .start = SPORT0_TCR1,
1164 .end = SPORT0_TCR1 + 0xFF,
1165 .flags = IORESOURCE_MEM,
1166 },
1167 [1] = {
1168 .start = IRQ_SPORT0_ERROR,
1169 .end = IRQ_SPORT0_ERROR,
1170 .flags = IORESOURCE_IRQ,
1171 },
1172};
1173
1174static struct platform_device bfin_sport_spi0_device = {
1175 .name = "bfin-sport-spi",
1176 .id = 1, /* Bus number */
1177 .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource),
1178 .resource = bfin_sport_spi0_resource,
1179 .dev = {
1180 .platform_data = &bfin_sport_spi0_info, /* Passed to driver */
1181 },
1182};
1183
1184static struct bfin5xx_spi_master bfin_sport_spi1_info = {
1185 .num_chipselect = 1, /* master only supports one device */
1186 .enable_dma = 0, /* master don't support DMA */
1187 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,
1188 P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0},
1189};
1190
1191static struct resource bfin_sport_spi1_resource[] = {
1192 [0] = {
1193 .start = SPORT1_TCR1,
1194 .end = SPORT1_TCR1 + 0xFF,
1195 .flags = IORESOURCE_MEM,
1196 },
1197 [1] = {
1198 .start = IRQ_SPORT1_ERROR,
1199 .end = IRQ_SPORT1_ERROR,
1200 .flags = IORESOURCE_IRQ,
1201 },
1202};
1203
1204static struct platform_device bfin_sport_spi1_device = {
1205 .name = "bfin-sport-spi",
1206 .id = 2, /* Bus number */
1207 .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource),
1208 .resource = bfin_sport_spi1_resource,
1209 .dev = {
1210 .platform_data = &bfin_sport_spi1_info, /* Passed to driver */
1211 },
1212};
1213
1214#endif /* sport spi master and devices */
1215
Bryan Wu1394f032007-05-06 14:50:22 -07001216#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1217static struct platform_device bfin_fb_device = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001218 .name = "bf537-lq035",
1219};
1220#endif
1221
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001222#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1223#include <asm/bfin-lq035q1.h>
1224
1225static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
Michael Hennerichd94a1aa2009-12-08 11:45:55 +00001226 .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
1227 .ppi_mode = USE_RGB565_16_BIT_PPI,
1228 .use_bl = 0, /* let something else control the LCD Blacklight */
1229 .gpio_bl = GPIO_PF7,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001230};
1231
1232static struct resource bfin_lq035q1_resources[] = {
1233 {
1234 .start = IRQ_PPI_ERROR,
1235 .end = IRQ_PPI_ERROR,
1236 .flags = IORESOURCE_IRQ,
1237 },
1238};
1239
1240static struct platform_device bfin_lq035q1_device = {
1241 .name = "bfin-lq035q1",
1242 .id = -1,
Michael Hennerichd94a1aa2009-12-08 11:45:55 +00001243 .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
1244 .resource = bfin_lq035q1_resources,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001245 .dev = {
1246 .platform_data = &bfin_lq035q1_data,
1247 },
1248};
1249#endif
1250
Bryan Wu1394f032007-05-06 14:50:22 -07001251#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang233b28a2007-11-21 17:04:41 +08001252#ifdef CONFIG_SERIAL_BFIN_UART0
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001253static struct resource bfin_uart0_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -07001254 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001255 .start = UART0_THR,
1256 .end = UART0_GCTL+2,
Bryan Wu1394f032007-05-06 14:50:22 -07001257 .flags = IORESOURCE_MEM,
Sonic Zhang233b28a2007-11-21 17:04:41 +08001258 },
Sonic Zhang233b28a2007-11-21 17:04:41 +08001259 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001260 .start = IRQ_UART0_RX,
1261 .end = IRQ_UART0_RX+1,
1262 .flags = IORESOURCE_IRQ,
1263 },
1264 {
1265 .start = IRQ_UART0_ERROR,
1266 .end = IRQ_UART0_ERROR,
1267 .flags = IORESOURCE_IRQ,
1268 },
1269 {
1270 .start = CH_UART0_TX,
1271 .end = CH_UART0_TX,
1272 .flags = IORESOURCE_DMA,
1273 },
1274 {
1275 .start = CH_UART0_RX,
1276 .end = CH_UART0_RX,
1277 .flags = IORESOURCE_DMA,
1278 },
1279#ifdef CONFIG_BFIN_UART0_CTSRTS
1280 { /* CTS pin */
1281 .start = GPIO_PG7,
1282 .end = GPIO_PG7,
1283 .flags = IORESOURCE_IO,
1284 },
1285 { /* RTS pin */
1286 .start = GPIO_PG6,
1287 .end = GPIO_PG6,
1288 .flags = IORESOURCE_IO,
Bryan Wu1394f032007-05-06 14:50:22 -07001289 },
Sonic Zhang233b28a2007-11-21 17:04:41 +08001290#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001291};
1292
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001293unsigned short bfin_uart0_peripherals[] = {
1294 P_UART0_TX, P_UART0_RX, 0
1295};
1296
1297static struct platform_device bfin_uart0_device = {
1298 .name = "bfin-uart",
1299 .id = 0,
1300 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
1301 .resource = bfin_uart0_resources,
1302 .dev = {
1303 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
1304 },
1305};
1306#endif
1307#ifdef CONFIG_SERIAL_BFIN_UART1
1308static struct resource bfin_uart1_resources[] = {
1309 {
1310 .start = UART1_THR,
1311 .end = UART1_GCTL+2,
1312 .flags = IORESOURCE_MEM,
1313 },
1314 {
1315 .start = IRQ_UART1_RX,
1316 .end = IRQ_UART1_RX+1,
1317 .flags = IORESOURCE_IRQ,
1318 },
1319 {
1320 .start = IRQ_UART1_ERROR,
1321 .end = IRQ_UART1_ERROR,
1322 .flags = IORESOURCE_IRQ,
1323 },
1324 {
1325 .start = CH_UART1_TX,
1326 .end = CH_UART1_TX,
1327 .flags = IORESOURCE_DMA,
1328 },
1329 {
1330 .start = CH_UART1_RX,
1331 .end = CH_UART1_RX,
1332 .flags = IORESOURCE_DMA,
1333 },
1334};
1335
1336unsigned short bfin_uart1_peripherals[] = {
1337 P_UART1_TX, P_UART1_RX, 0
1338};
1339
1340static struct platform_device bfin_uart1_device = {
Bryan Wu1394f032007-05-06 14:50:22 -07001341 .name = "bfin-uart",
1342 .id = 1,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001343 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
1344 .resource = bfin_uart1_resources,
1345 .dev = {
1346 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
1347 },
Bryan Wu1394f032007-05-06 14:50:22 -07001348};
1349#endif
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001350#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001351
Graf Yang5be36d22008-04-25 03:09:15 +08001352#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +08001353#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +08001354static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +08001355 {
1356 .start = 0xFFC00400,
1357 .end = 0xFFC004FF,
1358 .flags = IORESOURCE_MEM,
1359 },
Graf Yang42bd8bc2009-01-07 23:14:39 +08001360 {
1361 .start = IRQ_UART0_RX,
1362 .end = IRQ_UART0_RX+1,
1363 .flags = IORESOURCE_IRQ,
1364 },
1365 {
1366 .start = CH_UART0_RX,
1367 .end = CH_UART0_RX+1,
1368 .flags = IORESOURCE_DMA,
1369 },
1370};
1371
1372static struct platform_device bfin_sir0_device = {
1373 .name = "bfin_sir",
1374 .id = 0,
1375 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
1376 .resource = bfin_sir0_resources,
1377};
Graf Yang5be36d22008-04-25 03:09:15 +08001378#endif
1379#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +08001380static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +08001381 {
1382 .start = 0xFFC02000,
1383 .end = 0xFFC020FF,
1384 .flags = IORESOURCE_MEM,
1385 },
Graf Yang42bd8bc2009-01-07 23:14:39 +08001386 {
1387 .start = IRQ_UART1_RX,
1388 .end = IRQ_UART1_RX+1,
1389 .flags = IORESOURCE_IRQ,
1390 },
1391 {
1392 .start = CH_UART1_RX,
1393 .end = CH_UART1_RX+1,
1394 .flags = IORESOURCE_DMA,
1395 },
Graf Yang5be36d22008-04-25 03:09:15 +08001396};
1397
Graf Yang42bd8bc2009-01-07 23:14:39 +08001398static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +08001399 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +08001400 .id = 1,
1401 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
1402 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +08001403};
1404#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +08001405#endif
Graf Yang5be36d22008-04-25 03:09:15 +08001406
Bryan Wu1394f032007-05-06 14:50:22 -07001407#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001408static struct resource bfin_twi0_resource[] = {
1409 [0] = {
1410 .start = TWI0_REGBASE,
1411 .end = TWI0_REGBASE,
1412 .flags = IORESOURCE_MEM,
1413 },
1414 [1] = {
1415 .start = IRQ_TWI,
1416 .end = IRQ_TWI,
1417 .flags = IORESOURCE_IRQ,
1418 },
1419};
1420
Bryan Wu1394f032007-05-06 14:50:22 -07001421static struct platform_device i2c_bfin_twi_device = {
1422 .name = "i2c-bfin-twi",
1423 .id = 0,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001424 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1425 .resource = bfin_twi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -07001426};
1427#endif
1428
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001429#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001430static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
1431 [0] = KEY_GRAVE,
1432 [1] = KEY_1,
1433 [2] = KEY_2,
1434 [3] = KEY_3,
1435 [4] = KEY_4,
1436 [5] = KEY_5,
1437 [6] = KEY_6,
1438 [7] = KEY_7,
1439 [8] = KEY_8,
1440 [9] = KEY_9,
1441 [10] = KEY_0,
1442 [11] = KEY_MINUS,
1443 [12] = KEY_EQUAL,
1444 [13] = KEY_BACKSLASH,
1445 [15] = KEY_KP0,
1446 [16] = KEY_Q,
1447 [17] = KEY_W,
1448 [18] = KEY_E,
1449 [19] = KEY_R,
1450 [20] = KEY_T,
1451 [21] = KEY_Y,
1452 [22] = KEY_U,
1453 [23] = KEY_I,
1454 [24] = KEY_O,
1455 [25] = KEY_P,
1456 [26] = KEY_LEFTBRACE,
1457 [27] = KEY_RIGHTBRACE,
1458 [29] = KEY_KP1,
1459 [30] = KEY_KP2,
1460 [31] = KEY_KP3,
1461 [32] = KEY_A,
1462 [33] = KEY_S,
1463 [34] = KEY_D,
1464 [35] = KEY_F,
1465 [36] = KEY_G,
1466 [37] = KEY_H,
1467 [38] = KEY_J,
1468 [39] = KEY_K,
1469 [40] = KEY_L,
1470 [41] = KEY_SEMICOLON,
1471 [42] = KEY_APOSTROPHE,
1472 [43] = KEY_BACKSLASH,
1473 [45] = KEY_KP4,
1474 [46] = KEY_KP5,
1475 [47] = KEY_KP6,
1476 [48] = KEY_102ND,
1477 [49] = KEY_Z,
1478 [50] = KEY_X,
1479 [51] = KEY_C,
1480 [52] = KEY_V,
1481 [53] = KEY_B,
1482 [54] = KEY_N,
1483 [55] = KEY_M,
1484 [56] = KEY_COMMA,
1485 [57] = KEY_DOT,
1486 [58] = KEY_SLASH,
1487 [60] = KEY_KPDOT,
1488 [61] = KEY_KP7,
1489 [62] = KEY_KP8,
1490 [63] = KEY_KP9,
1491 [64] = KEY_SPACE,
1492 [65] = KEY_BACKSPACE,
1493 [66] = KEY_TAB,
1494 [67] = KEY_KPENTER,
1495 [68] = KEY_ENTER,
1496 [69] = KEY_ESC,
1497 [70] = KEY_DELETE,
1498 [74] = KEY_KPMINUS,
1499 [76] = KEY_UP,
1500 [77] = KEY_DOWN,
1501 [78] = KEY_RIGHT,
1502 [79] = KEY_LEFT,
1503};
1504
1505static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1506 .rows = 8,
1507 .cols = 10,
1508 .keymap = adp5588_keymap,
1509 .keymapsize = ARRAY_SIZE(adp5588_keymap),
1510 .repeat = 0,
1511};
1512#endif
1513
Michael Hennerich3ea57212009-03-28 22:15:07 +08001514#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1515#include <linux/mfd/adp5520.h>
1516
1517 /*
1518 * ADP5520/5501 Backlight Data
1519 */
1520
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001521static struct adp5520_backlight_platform_data adp5520_backlight_data = {
1522 .fade_in = ADP5520_FADE_T_1200ms,
1523 .fade_out = ADP5520_FADE_T_1200ms,
1524 .fade_led_law = ADP5520_BL_LAW_LINEAR,
1525 .en_ambl_sens = 1,
1526 .abml_filt = ADP5520_BL_AMBL_FILT_640ms,
1527 .l1_daylight_max = ADP5520_BL_CUR_mA(15),
1528 .l1_daylight_dim = ADP5520_BL_CUR_mA(0),
1529 .l2_office_max = ADP5520_BL_CUR_mA(7),
1530 .l2_office_dim = ADP5520_BL_CUR_mA(0),
1531 .l3_dark_max = ADP5520_BL_CUR_mA(3),
1532 .l3_dark_dim = ADP5520_BL_CUR_mA(0),
1533 .l2_trip = ADP5520_L2_COMP_CURR_uA(700),
1534 .l2_hyst = ADP5520_L2_COMP_CURR_uA(50),
1535 .l3_trip = ADP5520_L3_COMP_CURR_uA(80),
1536 .l3_hyst = ADP5520_L3_COMP_CURR_uA(20),
Michael Hennerich3ea57212009-03-28 22:15:07 +08001537};
1538
1539 /*
1540 * ADP5520/5501 LEDs Data
1541 */
1542
Michael Hennerich3ea57212009-03-28 22:15:07 +08001543static struct led_info adp5520_leds[] = {
1544 {
1545 .name = "adp5520-led1",
1546 .default_trigger = "none",
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001547 .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001548 },
1549#ifdef ADP5520_EN_ALL_LEDS
1550 {
1551 .name = "adp5520-led2",
1552 .default_trigger = "none",
1553 .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1,
1554 },
1555 {
1556 .name = "adp5520-led3",
1557 .default_trigger = "none",
1558 .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2,
1559 },
1560#endif
1561};
1562
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001563static struct adp5520_leds_platform_data adp5520_leds_data = {
Michael Hennerich3ea57212009-03-28 22:15:07 +08001564 .num_leds = ARRAY_SIZE(adp5520_leds),
1565 .leds = adp5520_leds,
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001566 .fade_in = ADP5520_FADE_T_600ms,
1567 .fade_out = ADP5520_FADE_T_600ms,
1568 .led_on_time = ADP5520_LED_ONT_600ms,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001569};
1570
1571 /*
1572 * ADP5520 GPIO Data
1573 */
1574
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001575static struct adp5520_gpio_platform_data adp5520_gpio_data = {
Michael Hennerich3ea57212009-03-28 22:15:07 +08001576 .gpio_start = 50,
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001577 .gpio_en_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
1578 .gpio_pullup_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001579};
1580
1581 /*
1582 * ADP5520 Keypad Data
1583 */
1584
Michael Hennerich3ea57212009-03-28 22:15:07 +08001585static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001586 [ADP5520_KEY(0, 0)] = KEY_GRAVE,
1587 [ADP5520_KEY(0, 1)] = KEY_1,
1588 [ADP5520_KEY(0, 2)] = KEY_2,
1589 [ADP5520_KEY(0, 3)] = KEY_3,
1590 [ADP5520_KEY(1, 0)] = KEY_4,
1591 [ADP5520_KEY(1, 1)] = KEY_5,
1592 [ADP5520_KEY(1, 2)] = KEY_6,
1593 [ADP5520_KEY(1, 3)] = KEY_7,
1594 [ADP5520_KEY(2, 0)] = KEY_8,
1595 [ADP5520_KEY(2, 1)] = KEY_9,
1596 [ADP5520_KEY(2, 2)] = KEY_0,
1597 [ADP5520_KEY(2, 3)] = KEY_MINUS,
1598 [ADP5520_KEY(3, 0)] = KEY_EQUAL,
1599 [ADP5520_KEY(3, 1)] = KEY_BACKSLASH,
1600 [ADP5520_KEY(3, 2)] = KEY_BACKSPACE,
1601 [ADP5520_KEY(3, 3)] = KEY_ENTER,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001602};
1603
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001604static struct adp5520_keys_platform_data adp5520_keys_data = {
1605 .rows_en_mask = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0,
1606 .cols_en_mask = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001607 .keymap = adp5520_keymap,
1608 .keymapsize = ARRAY_SIZE(adp5520_keymap),
1609 .repeat = 0,
1610};
1611
1612 /*
1613 * ADP5520/5501 Multifuction Device Init Data
1614 */
1615
Michael Hennerich3ea57212009-03-28 22:15:07 +08001616static struct adp5520_platform_data adp5520_pdev_data = {
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001617 .backlight = &adp5520_backlight_data,
1618 .leds = &adp5520_leds_data,
1619 .gpio = &adp5520_gpio_data,
1620 .keys = &adp5520_keys_data,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001621};
1622
1623#endif
1624
Michael Hennerichba877d42009-08-27 04:09:32 +00001625#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001626static struct adp5588_gpio_platform_data adp5588_gpio_data = {
Michael Hennerichba877d42009-08-27 04:09:32 +00001627 .gpio_start = 50,
1628 .pullup_dis_mask = 0,
1629};
1630#endif
1631
Michael Hennerich78756c62009-10-13 15:28:33 +00001632#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
1633#include <linux/i2c/adp8870.h>
1634static struct led_info adp8870_leds[] = {
1635 {
1636 .name = "adp8870-led7",
1637 .default_trigger = "none",
1638 .flags = ADP8870_LED_D7 | ADP8870_LED_OFFT_600ms,
1639 },
1640};
1641
1642
1643static struct adp8870_backlight_platform_data adp8870_pdata = {
1644 .bl_led_assign = ADP8870_BL_D1 | ADP8870_BL_D2 | ADP8870_BL_D3 |
1645 ADP8870_BL_D4 | ADP8870_BL_D5 | ADP8870_BL_D6, /* 1 = Backlight 0 = Individual LED */
1646 .pwm_assign = 0, /* 1 = Enables PWM mode */
1647
1648 .bl_fade_in = ADP8870_FADE_T_1200ms, /* Backlight Fade-In Timer */
1649 .bl_fade_out = ADP8870_FADE_T_1200ms, /* Backlight Fade-Out Timer */
1650 .bl_fade_law = ADP8870_FADE_LAW_CUBIC1, /* fade-on/fade-off transfer characteristic */
1651
1652 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
1653 .abml_filt = ADP8870_BL_AMBL_FILT_320ms, /* Light sensor filter time */
1654
1655 .l1_daylight_max = ADP8870_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1656 .l1_daylight_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1657 .l2_bright_max = ADP8870_BL_CUR_mA(14), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1658 .l2_bright_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1659 .l3_office_max = ADP8870_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1660 .l3_office_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1661 .l4_indoor_max = ADP8870_BL_CUR_mA(3), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1662 .l4_indor_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1663 .l5_dark_max = ADP8870_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1664 .l5_dark_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1665
1666 .l2_trip = ADP8870_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1667 .l2_hyst = ADP8870_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1668 .l3_trip = ADP8870_L3_COMP_CURR_uA(389), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
1669 .l3_hyst = ADP8870_L3_COMP_CURR_uA(54), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
1670 .l4_trip = ADP8870_L4_COMP_CURR_uA(167), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
1671 .l4_hyst = ADP8870_L4_COMP_CURR_uA(16), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
1672 .l5_trip = ADP8870_L5_COMP_CURR_uA(43), /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1673 .l5_hyst = ADP8870_L5_COMP_CURR_uA(11), /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1674
1675 .leds = adp8870_leds,
1676 .num_leds = ARRAY_SIZE(adp8870_leds),
1677 .led_fade_law = ADP8870_FADE_LAW_SQUARE, /* fade-on/fade-off transfer characteristic */
1678 .led_fade_in = ADP8870_FADE_T_600ms,
1679 .led_fade_out = ADP8870_FADE_T_600ms,
1680 .led_on_time = ADP8870_LED_ONT_200ms,
1681};
1682#endif
1683
Sonic Zhangf32792d2010-02-09 02:47:09 +00001684#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
1685static struct regulator_consumer_supply ad5398_consumer = {
1686 .supply = "current",
1687};
1688
1689static struct regulator_init_data ad5398_regulator_data = {
1690 .constraints = {
1691 .name = "current range",
1692 .max_uA = 120000,
1693 .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
1694 },
1695 .num_consumer_supplies = 1,
1696 .consumer_supplies = &ad5398_consumer,
1697};
1698
1699static struct ad5398_platform_data ad5398_i2c_platform_data = {
1700 .current_bits = 10,
1701 .current_offset = 4,
1702 .regulator_data = &ad5398_regulator_data,
1703};
1704
1705#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
1706 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
1707static struct platform_device ad5398_virt_consumer_device = {
1708 .name = "reg-virt-consumer",
1709 .id = 0,
1710 .dev = {
1711 .platform_data = "current", /* Passed to driver */
1712 },
1713};
1714#endif
1715#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
1716 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
1717static struct regulator_bulk_data ad5398_bulk_data = {
1718 .supply = "current",
1719};
1720
1721static struct regulator_userspace_consumer_data ad5398_userspace_comsumer_data = {
1722 .name = "ad5398",
1723 .num_supplies = 1,
1724 .supplies = &ad5398_bulk_data,
1725};
1726
1727static struct platform_device ad5398_userspace_consumer_device = {
1728 .name = "reg-userspace-consumer",
1729 .id = 0,
1730 .dev = {
1731 .platform_data = &ad5398_userspace_comsumer_data,
1732 },
1733};
1734#endif
1735#endif
1736
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001737static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001738#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001739 {
Barry Song427f2772009-07-17 07:04:55 +00001740 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
Barry Song4c94c3e2009-07-07 07:41:50 +00001741 .irq = IRQ_PG5,
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001742 .platform_data = (void *)&ad7142_i2c_platform_data,
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001743 },
1744#endif
Barry Songad6720c2010-02-03 09:15:31 +00001745
1746#if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE)
1747 {
1748 I2C_BOARD_INFO("ad7150", 0x48),
1749 .irq = IRQ_PG5, /* fixme: use real interrupt number */
1750 },
1751#endif
1752
1753#if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE)
1754 {
1755 I2C_BOARD_INFO("ad7152", 0x48),
1756 },
1757#endif
1758
1759#if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE)
1760 {
1761 I2C_BOARD_INFO("ad774x", 0x48),
1762 },
1763#endif
1764
Michael Hennerichebd58332009-07-02 11:00:38 +00001765#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001766 {
1767 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001768 },
1769#endif
Michael Hennerich204844e2009-06-30 14:57:22 +00001770#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001771 {
1772 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
Michael Hennerichf5150152008-10-16 23:23:18 +08001773 .irq = IRQ_PG6,
1774 },
1775#endif
1776#if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
1777 {
1778 I2C_BOARD_INFO("ad7879", 0x2F),
1779 .irq = IRQ_PG5,
1780 .platform_data = (void *)&bfin_ad7879_ts_info,
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001781 },
1782#endif
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001783#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1784 {
1785 I2C_BOARD_INFO("adp5588-keys", 0x34),
1786 .irq = IRQ_PG0,
1787 .platform_data = (void *)&adp5588_kpad_data,
1788 },
1789#endif
Michael Hennerich3ea57212009-03-28 22:15:07 +08001790#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1791 {
1792 I2C_BOARD_INFO("pmic-adp5520", 0x32),
Mike Frysinger4f84b6e2009-06-10 20:45:48 -04001793 .irq = IRQ_PG0,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001794 .platform_data = (void *)&adp5520_pdev_data,
1795 },
1796#endif
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001797#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1798 {
1799 I2C_BOARD_INFO("adxl34x", 0x53),
1800 .irq = IRQ_PG3,
1801 .platform_data = (void *)&adxl34x_info,
1802 },
1803#endif
Michael Hennerichba877d42009-08-27 04:09:32 +00001804#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1805 {
1806 I2C_BOARD_INFO("adp5588-gpio", 0x34),
1807 .platform_data = (void *)&adp5588_gpio_data,
1808 },
1809#endif
Michael Hennerich50c4c082009-09-22 13:10:09 +00001810#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
1811 {
1812 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
1813 },
1814#endif
Michael Hennerichddcd7cb2009-09-22 15:36:55 +00001815#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1816 {
1817 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2C),
1818 },
1819#endif
Michael Hennerich78756c62009-10-13 15:28:33 +00001820#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
1821 {
1822 I2C_BOARD_INFO("adp8870", 0x2B),
1823 .platform_data = (void *)&adp8870_pdata,
1824 },
1825#endif
Cliff Caid53127f2009-10-15 02:33:04 +00001826#if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE)
1827 {
1828 I2C_BOARD_INFO("adau1371", 0x1A),
1829 },
1830#endif
Cliff Cai04267632009-10-28 06:50:36 +00001831#if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE)
1832 {
1833 I2C_BOARD_INFO("adau1761", 0x38),
1834 },
1835#endif
Cliff Caic48d7672010-02-11 09:27:18 +00001836#if defined(CONFIG_SND_SOC_ADAU1361) || defined(CONFIG_SND_SOC_ADAU1361_MODULE)
1837 {
1838 I2C_BOARD_INFO("adau1361", 0x38),
1839 },
1840#endif
Michael Hennerich1f13f2f2009-11-17 10:18:27 +00001841#if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
1842 {
1843 I2C_BOARD_INFO("ad5258", 0x18),
1844 },
1845#endif
Cliff Cai29bb3bc2010-01-14 08:28:38 +00001846#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
1847 {
1848 I2C_BOARD_INFO("ssm2602", 0x1b),
1849 },
1850#endif
Sonic Zhangf32792d2010-02-09 02:47:09 +00001851#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
1852 {
1853 I2C_BOARD_INFO("ad5398", 0xC),
1854 .platform_data = (void *)&ad5398_i2c_platform_data,
1855 },
1856#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001857};
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001858
Bryan Wu1394f032007-05-06 14:50:22 -07001859#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +00001860#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1861static struct resource bfin_sport0_uart_resources[] = {
1862 {
1863 .start = SPORT0_TCR1,
1864 .end = SPORT0_MRCS3+4,
1865 .flags = IORESOURCE_MEM,
1866 },
1867 {
1868 .start = IRQ_SPORT0_RX,
1869 .end = IRQ_SPORT0_RX+1,
1870 .flags = IORESOURCE_IRQ,
1871 },
1872 {
1873 .start = IRQ_SPORT0_ERROR,
1874 .end = IRQ_SPORT0_ERROR,
1875 .flags = IORESOURCE_IRQ,
1876 },
1877};
1878
1879unsigned short bfin_sport0_peripherals[] = {
1880 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
1881 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
1882};
1883
Bryan Wu1394f032007-05-06 14:50:22 -07001884static struct platform_device bfin_sport0_uart_device = {
1885 .name = "bfin-sport-uart",
1886 .id = 0,
Sonic Zhangdf5de262009-09-23 05:01:56 +00001887 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
1888 .resource = bfin_sport0_uart_resources,
1889 .dev = {
1890 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
1891 },
1892};
1893#endif
1894#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1895static struct resource bfin_sport1_uart_resources[] = {
1896 {
1897 .start = SPORT1_TCR1,
1898 .end = SPORT1_MRCS3+4,
1899 .flags = IORESOURCE_MEM,
1900 },
1901 {
1902 .start = IRQ_SPORT1_RX,
1903 .end = IRQ_SPORT1_RX+1,
1904 .flags = IORESOURCE_IRQ,
1905 },
1906 {
1907 .start = IRQ_SPORT1_ERROR,
1908 .end = IRQ_SPORT1_ERROR,
1909 .flags = IORESOURCE_IRQ,
1910 },
1911};
1912
1913unsigned short bfin_sport1_peripherals[] = {
1914 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
1915 P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
Bryan Wu1394f032007-05-06 14:50:22 -07001916};
1917
1918static struct platform_device bfin_sport1_uart_device = {
1919 .name = "bfin-sport-uart",
1920 .id = 1,
Sonic Zhangdf5de262009-09-23 05:01:56 +00001921 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
1922 .resource = bfin_sport1_uart_resources,
1923 .dev = {
1924 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
1925 },
Bryan Wu1394f032007-05-06 14:50:22 -07001926};
1927#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +00001928#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001929
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001930#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001931#define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
1932/* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001933
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001934#ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
1935#define PATA_INT IRQ_PF5
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001936static struct pata_platform_info bfin_pata_platform_data = {
1937 .ioport_shift = 1,
Mike Frysinger64e5c512007-10-30 11:56:13 +08001938 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001939};
1940
1941static struct resource bfin_pata_resources[] = {
1942 {
1943 .start = 0x20314020,
1944 .end = 0x2031403F,
1945 .flags = IORESOURCE_MEM,
1946 },
1947 {
1948 .start = 0x2031401C,
1949 .end = 0x2031401F,
1950 .flags = IORESOURCE_MEM,
1951 },
1952 {
1953 .start = PATA_INT,
1954 .end = PATA_INT,
1955 .flags = IORESOURCE_IRQ,
1956 },
1957};
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001958#elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
1959static struct pata_platform_info bfin_pata_platform_data = {
1960 .ioport_shift = 0,
1961};
Michael Hennerich648882d2009-04-21 12:05:50 +00001962/* CompactFlash Storage Card Memory Mapped Adressing
1963 * /REG = A11 = 1
1964 */
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001965static struct resource bfin_pata_resources[] = {
1966 {
Michael Hennerich648882d2009-04-21 12:05:50 +00001967 .start = 0x20211800,
1968 .end = 0x20211807,
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001969 .flags = IORESOURCE_MEM,
1970 },
1971 {
Michael Hennerich648882d2009-04-21 12:05:50 +00001972 .start = 0x2021180E, /* Device Ctl */
1973 .end = 0x2021180E,
Michael Hennerich2c8beb22009-03-28 22:13:43 +08001974 .flags = IORESOURCE_MEM,
1975 },
1976};
1977#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001978
1979static struct platform_device bfin_pata_device = {
1980 .name = "pata_platform",
1981 .id = -1,
1982 .num_resources = ARRAY_SIZE(bfin_pata_resources),
1983 .resource = bfin_pata_resources,
1984 .dev = {
1985 .platform_data = &bfin_pata_platform_data,
1986 }
1987};
1988#endif
1989
Michael Hennerich14b03202008-05-07 11:41:26 +08001990static const unsigned int cclk_vlev_datasheet[] =
1991{
1992 VRPAIR(VLEV_085, 250000000),
1993 VRPAIR(VLEV_090, 376000000),
1994 VRPAIR(VLEV_095, 426000000),
1995 VRPAIR(VLEV_100, 426000000),
1996 VRPAIR(VLEV_105, 476000000),
1997 VRPAIR(VLEV_110, 476000000),
1998 VRPAIR(VLEV_115, 476000000),
1999 VRPAIR(VLEV_120, 500000000),
2000 VRPAIR(VLEV_125, 533000000),
2001 VRPAIR(VLEV_130, 600000000),
2002};
2003
2004static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
2005 .tuple_tab = cclk_vlev_datasheet,
2006 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
2007 .vr_settling_time = 25 /* us */,
2008};
2009
2010static struct platform_device bfin_dpmc = {
2011 .name = "bfin dpmc",
2012 .dev = {
2013 .platform_data = &bfin_dmpc_vreg_data,
2014 },
2015};
2016
Barry Song336746e2009-10-13 09:19:18 +00002017#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2018static struct platform_device bfin_i2s = {
2019 .name = "bfin-i2s",
2020 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2021 /* TODO: add platform data here */
2022};
2023#endif
2024
Barry Song83124402009-08-06 21:03:02 +00002025#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2026static struct platform_device bfin_tdm = {
2027 .name = "bfin-tdm",
Barry Song336746e2009-10-13 09:19:18 +00002028 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2029 /* TODO: add platform data here */
2030};
2031#endif
2032
2033#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2034static struct platform_device bfin_ac97 = {
2035 .name = "bfin-ac97",
2036 .id = CONFIG_SND_BF5XX_SPORT_NUM,
Barry Song83124402009-08-06 21:03:02 +00002037 /* TODO: add platform data here */
2038};
2039#endif
2040
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002041#if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
2042#define REGULATOR_ADP122 "adp122"
2043#define REGULATOR_ADP150 "adp150"
2044
2045static struct regulator_consumer_supply adp122_consumers = {
2046 .supply = REGULATOR_ADP122,
2047};
2048
2049static struct regulator_consumer_supply adp150_consumers = {
2050 .supply = REGULATOR_ADP150,
2051};
2052
2053static struct regulator_init_data adp_switch_regulator_data[] = {
2054 {
2055 .constraints = {
2056 .name = REGULATOR_ADP122,
2057 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
2058 },
2059 .num_consumer_supplies = 1, /* only 1 */
2060 .consumer_supplies = &adp122_consumers,
2061 .driver_data = (void *)GPIO_PF2, /* gpio port only */
2062 },
2063 {
2064 .constraints = {
2065 .name = REGULATOR_ADP150,
2066 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
2067 },
2068 .num_consumer_supplies = 1, /* only 1 */
2069 .consumer_supplies = &adp150_consumers,
2070 .driver_data = (void *)GPIO_PF3, /* gpio port only */
2071 },
2072};
2073
2074static struct adp_switch_platform_data adp_switch_pdata = {
2075 .regulator_num = ARRAY_SIZE(adp_switch_regulator_data),
2076 .regulator_data = adp_switch_regulator_data,
2077};
2078
2079static struct platform_device adp_switch_device = {
2080 .name = "adp_switch",
2081 .id = 0,
2082 .dev = {
2083 .platform_data = &adp_switch_pdata,
2084 },
2085};
2086
2087#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2088 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2089static struct regulator_bulk_data adp122_bulk_data = {
2090 .supply = REGULATOR_ADP122,
2091};
2092
2093static struct regulator_userspace_consumer_data adp122_userspace_comsumer_data = {
2094 .name = REGULATOR_ADP122,
2095 .num_supplies = 1,
2096 .supplies = &adp122_bulk_data,
2097};
2098
2099static struct platform_device adp122_userspace_consumer_device = {
2100 .name = "reg-userspace-consumer",
2101 .id = 0,
2102 .dev = {
2103 .platform_data = &adp122_userspace_comsumer_data,
2104 },
2105};
2106
2107static struct regulator_bulk_data adp150_bulk_data = {
2108 .supply = REGULATOR_ADP150,
2109};
2110
2111static struct regulator_userspace_consumer_data adp150_userspace_comsumer_data = {
2112 .name = REGULATOR_ADP150,
2113 .num_supplies = 1,
2114 .supplies = &adp150_bulk_data,
2115};
2116
2117static struct platform_device adp150_userspace_consumer_device = {
2118 .name = "reg-userspace-consumer",
2119 .id = 1,
2120 .dev = {
2121 .platform_data = &adp150_userspace_comsumer_data,
2122 },
2123};
2124#endif
2125#endif
2126
2127
Bryan Wu1394f032007-05-06 14:50:22 -07002128static struct platform_device *stamp_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +08002129
2130 &bfin_dpmc,
2131
Bryan Wu1394f032007-05-06 14:50:22 -07002132#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
2133 &bfin_pcmcia_cf_device,
2134#endif
2135
2136#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
2137 &rtc_device,
2138#endif
2139
2140#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
2141 &sl811_hcd_device,
2142#endif
2143
2144#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
2145 &isp1362_hcd_device,
2146#endif
2147
Michael Hennerich3f375692008-11-18 17:48:22 +08002148#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
2149 &bfin_isp1760_device,
2150#endif
2151
Bryan Wu1394f032007-05-06 14:50:22 -07002152#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
2153 &smc91x_device,
2154#endif
2155
Alex Landauf40d24d2007-07-12 12:11:48 +08002156#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
2157 &dm9000_device,
2158#endif
2159
Barry Song706a01b2009-11-02 07:29:07 +00002160#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
2161 &bfin_can_device,
2162#endif
2163
Bryan Wu1394f032007-05-06 14:50:22 -07002164#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +08002165 &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -07002166 &bfin_mac_device,
2167#endif
2168
2169#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
2170 &net2272_bfin_device,
2171#endif
2172
2173#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002174 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -07002175#endif
2176
Cliff Cai1e9aa952009-03-28 23:28:51 +08002177#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
2178 &bfin_sport_spi0_device,
2179 &bfin_sport_spi1_device,
2180#endif
2181
Bryan Wu1394f032007-05-06 14:50:22 -07002182#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2183 &bfin_fb_device,
2184#endif
2185
Michael Hennerich2043f3f2008-10-13 14:46:30 +08002186#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
2187 &bfin_lq035q1_device,
2188#endif
2189
Bryan Wu1394f032007-05-06 14:50:22 -07002190#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00002191#ifdef CONFIG_SERIAL_BFIN_UART0
2192 &bfin_uart0_device,
2193#endif
2194#ifdef CONFIG_SERIAL_BFIN_UART1
2195 &bfin_uart1_device,
2196#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002197#endif
2198
Graf Yang5be36d22008-04-25 03:09:15 +08002199#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +08002200#ifdef CONFIG_BFIN_SIR0
2201 &bfin_sir0_device,
2202#endif
2203#ifdef CONFIG_BFIN_SIR1
2204 &bfin_sir1_device,
2205#endif
Graf Yang5be36d22008-04-25 03:09:15 +08002206#endif
2207
Bryan Wu1394f032007-05-06 14:50:22 -07002208#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
2209 &i2c_bfin_twi_device,
2210#endif
2211
2212#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +00002213#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
Bryan Wu1394f032007-05-06 14:50:22 -07002214 &bfin_sport0_uart_device,
Sonic Zhangdf5de262009-09-23 05:01:56 +00002215#endif
2216#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
Bryan Wu1394f032007-05-06 14:50:22 -07002217 &bfin_sport1_uart_device,
2218#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +00002219#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002220
2221#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2222 &bfin_pata_device,
2223#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +08002224
2225#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
2226 &bfin_device_gpiokeys,
2227#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +08002228
Mike Frysingerfc689112008-06-25 11:41:42 +08002229#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
2230 &bfin_async_nand_device,
2231#endif
2232
Mike Frysinger793dc272008-03-26 08:09:12 +08002233#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +08002234 &stamp_flash_device,
Mike Frysinger793dc272008-03-26 08:09:12 +08002235#endif
Barry Song83124402009-08-06 21:03:02 +00002236
Barry Song336746e2009-10-13 09:19:18 +00002237#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2238 &bfin_i2s,
2239#endif
2240
Barry Song83124402009-08-06 21:03:02 +00002241#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2242 &bfin_tdm,
2243#endif
Barry Song336746e2009-10-13 09:19:18 +00002244
2245#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2246 &bfin_ac97,
2247#endif
Sonic Zhangf32792d2010-02-09 02:47:09 +00002248#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2249#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2250 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2251 &ad5398_virt_consumer_device,
2252#endif
2253#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2254 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2255 &ad5398_userspace_consumer_device,
2256#endif
2257#endif
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002258
2259#if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
2260 &adp_switch_device,
2261#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2262 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2263 &adp122_userspace_consumer_device,
2264 &adp150_userspace_consumer_device,
2265#endif
2266#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002267};
2268
2269static int __init stamp_init(void)
2270{
Harvey Harrisonb85d8582008-04-23 09:39:01 +08002271 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Mike Frysingerfc689112008-06-25 11:41:42 +08002272 bfin_plat_nand_init();
Mike Frysinger0531c462010-01-19 07:04:29 +00002273 adf702x_mac_init();
Bryan Wu1394f032007-05-06 14:50:22 -07002274 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
Sonic Zhangdf5de262009-09-23 05:01:56 +00002275 i2c_register_board_info(0, bfin_i2c_board_info,
2276 ARRAY_SIZE(bfin_i2c_board_info));
Mike Frysinger5bda2722008-06-07 15:03:01 +08002277 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002278
Bryan Wu1394f032007-05-06 14:50:22 -07002279 return 0;
2280}
2281
2282arch_initcall(stamp_init);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002283
Sonic Zhangc13ce9f2009-09-23 09:37:46 +00002284
2285static struct platform_device *stamp_early_devices[] __initdata = {
2286#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
2287#ifdef CONFIG_SERIAL_BFIN_UART0
2288 &bfin_uart0_device,
2289#endif
2290#ifdef CONFIG_SERIAL_BFIN_UART1
2291 &bfin_uart1_device,
2292#endif
2293#endif
2294
2295#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
2296#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2297 &bfin_sport0_uart_device,
2298#endif
2299#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2300 &bfin_sport1_uart_device,
2301#endif
2302#endif
2303};
2304
2305void __init native_machine_early_platform_add_devices(void)
2306{
2307 printk(KERN_INFO "register early platform devices\n");
2308 early_platform_add_devices(stamp_early_devices,
2309 ARRAY_SIZE(stamp_early_devices));
2310}
2311
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002312void native_machine_restart(char *cmd)
2313{
2314 /* workaround reboot hang when booting from SPI */
2315 if ((bfin_read_SYSCR() & 0x7) == 0x3)
Sonic Zhangb52dae32009-02-04 16:49:45 +08002316 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002317}
Mike Frysinger137b1522007-11-22 16:07:03 +08002318
2319/*
2320 * Currently the MAC address is saved in Flash by U-Boot
2321 */
2322#define FLASH_MAC 0x203f0000
Mike Frysinger9862cc52007-11-15 21:21:20 +08002323void bfin_get_ether_addr(char *addr)
Mike Frysinger137b1522007-11-22 16:07:03 +08002324{
2325 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
2326 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
2327}
Mike Frysinger9862cc52007-11-15 21:21:20 +08002328EXPORT_SYMBOL(bfin_get_ether_addr);