Commit | Line | Data |
---|---|---|
1394f032 BW |
1 | /* |
2 | * File: arch/blackfin/mach-bf537/boards/stamp.c | |
3 | * Based on: arch/blackfin/mach-bf533/boards/ezkit.c | |
4 | * Author: Aidan Williams <aidan@nicta.com.au> | |
5 | * | |
6 | * Created: | |
7 | * Description: | |
8 | * | |
9 | * Modified: | |
10 | * Copyright 2005 National ICT Australia (NICTA) | |
11 | * Copyright 2004-2006 Analog Devices Inc. | |
12 | * | |
13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | |
14 | * | |
15 | * This program is free software; you can redistribute it and/or modify | |
16 | * it under the terms of the GNU General Public License as published by | |
17 | * the Free Software Foundation; either version 2 of the License, or | |
18 | * (at your option) any later version. | |
19 | * | |
20 | * This program is distributed in the hope that it will be useful, | |
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 | * GNU General Public License for more details. | |
24 | * | |
25 | * You should have received a copy of the GNU General Public License | |
26 | * along with this program; if not, see the file COPYING, or write | |
27 | * to the Free Software Foundation, Inc., | |
28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
29 | */ | |
30 | ||
31 | #include <linux/device.h> | |
fc68911e | 32 | #include <linux/kernel.h> |
1394f032 BW |
33 | #include <linux/platform_device.h> |
34 | #include <linux/mtd/mtd.h> | |
fc68911e | 35 | #include <linux/mtd/nand.h> |
1394f032 | 36 | #include <linux/mtd/partitions.h> |
fc68911e | 37 | #include <linux/mtd/plat-ram.h> |
de8c43f2 | 38 | #include <linux/mtd/physmap.h> |
1394f032 BW |
39 | #include <linux/spi/spi.h> |
40 | #include <linux/spi/flash.h> | |
41 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | |
f02bcec5 | 42 | #include <linux/usb/isp1362.h> |
1394f032 | 43 | #endif |
0a87e3e9 | 44 | #include <linux/ata_platform.h> |
1394f032 BW |
45 | #include <linux/irq.h> |
46 | #include <linux/interrupt.h> | |
81d9c7f2 | 47 | #include <linux/i2c.h> |
27f5d75a | 48 | #include <linux/usb/sl811.h> |
f79ea4cb | 49 | #include <linux/spi/mmc_spi.h> |
c6c4d7bb | 50 | #include <asm/dma.h> |
1f83b8f1 | 51 | #include <asm/bfin5xx_spi.h> |
c6c4d7bb | 52 | #include <asm/reboot.h> |
5d448dd5 | 53 | #include <asm/portmux.h> |
14b03204 | 54 | #include <asm/dpmc.h> |
1394f032 BW |
55 | |
56 | /* | |
57 | * Name the Board for the /proc/cpuinfo | |
58 | */ | |
fe85cad2 | 59 | const char bfin_board_name[] = "ADI BF537-STAMP"; |
1394f032 BW |
60 | |
61 | /* | |
62 | * Driver needs to know address, irq and flag pin. | |
63 | */ | |
64 | ||
1394f032 | 65 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
3f375690 MH |
66 | #include <linux/usb/isp1760.h> |
67 | static struct resource bfin_isp1760_resources[] = { | |
1394f032 | 68 | [0] = { |
3f375690 MH |
69 | .start = 0x203C0000, |
70 | .end = 0x203C0000 + 0x000fffff, | |
1394f032 BW |
71 | .flags = IORESOURCE_MEM, |
72 | }, | |
73 | [1] = { | |
3f375690 MH |
74 | .start = IRQ_PF7, |
75 | .end = IRQ_PF7, | |
6a6be3d1 | 76 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
1394f032 BW |
77 | }, |
78 | }; | |
79 | ||
3f375690 MH |
80 | static struct isp1760_platform_data isp1760_priv = { |
81 | .is_isp1761 = 0, | |
3f375690 MH |
82 | .bus_width_16 = 1, |
83 | .port1_otg = 0, | |
84 | .analog_oc = 0, | |
85 | .dack_polarity_high = 0, | |
86 | .dreq_polarity_high = 0, | |
1394f032 BW |
87 | }; |
88 | ||
3f375690 MH |
89 | static struct platform_device bfin_isp1760_device = { |
90 | .name = "isp1760-hcd", | |
91 | .id = 0, | |
92 | .dev = { | |
93 | .platform_data = &isp1760_priv, | |
94 | }, | |
95 | .num_resources = ARRAY_SIZE(bfin_isp1760_resources), | |
96 | .resource = bfin_isp1760_resources, | |
1394f032 | 97 | }; |
1394f032 BW |
98 | #endif |
99 | ||
2463ef22 MH |
100 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
101 | #include <linux/input.h> | |
102 | #include <linux/gpio_keys.h> | |
103 | ||
104 | static struct gpio_keys_button bfin_gpio_keys_table[] = { | |
105 | {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"}, | |
106 | {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"}, | |
107 | {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"}, | |
108 | {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"}, | |
109 | }; | |
110 | ||
111 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { | |
112 | .buttons = bfin_gpio_keys_table, | |
113 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), | |
114 | }; | |
115 | ||
116 | static struct platform_device bfin_device_gpiokeys = { | |
117 | .name = "gpio-keys", | |
118 | .dev = { | |
119 | .platform_data = &bfin_gpio_keys_data, | |
120 | }, | |
121 | }; | |
122 | #endif | |
123 | ||
cad2ab65 MF |
124 | static struct resource bfin_gpios_resources = { |
125 | .start = 0, | |
126 | .end = MAX_BLACKFIN_GPIOS - 1, | |
127 | .flags = IORESOURCE_IRQ, | |
128 | }; | |
129 | ||
130 | static struct platform_device bfin_gpios_device = { | |
131 | .name = "simple-gpio", | |
132 | .id = -1, | |
133 | .num_resources = 1, | |
134 | .resource = &bfin_gpios_resources, | |
135 | }; | |
136 | ||
1394f032 BW |
137 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
138 | static struct resource bfin_pcmcia_cf_resources[] = { | |
139 | { | |
140 | .start = 0x20310000, /* IO PORT */ | |
141 | .end = 0x20312000, | |
142 | .flags = IORESOURCE_MEM, | |
1f83b8f1 | 143 | }, { |
d2d50aa9 | 144 | .start = 0x20311000, /* Attribute Memory */ |
1394f032 BW |
145 | .end = 0x20311FFF, |
146 | .flags = IORESOURCE_MEM, | |
1f83b8f1 | 147 | }, { |
1394f032 BW |
148 | .start = IRQ_PF4, |
149 | .end = IRQ_PF4, | |
150 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | |
1f83b8f1 | 151 | }, { |
1394f032 BW |
152 | .start = 6, /* Card Detect PF6 */ |
153 | .end = 6, | |
154 | .flags = IORESOURCE_IRQ, | |
155 | }, | |
156 | }; | |
157 | ||
158 | static struct platform_device bfin_pcmcia_cf_device = { | |
159 | .name = "bfin_cf_pcmcia", | |
160 | .id = -1, | |
161 | .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources), | |
162 | .resource = bfin_pcmcia_cf_resources, | |
163 | }; | |
164 | #endif | |
165 | ||
166 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | |
167 | static struct platform_device rtc_device = { | |
168 | .name = "rtc-bfin", | |
169 | .id = -1, | |
170 | }; | |
171 | #endif | |
172 | ||
173 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | |
174 | static struct resource smc91x_resources[] = { | |
175 | { | |
176 | .name = "smc91x-regs", | |
177 | .start = 0x20300300, | |
178 | .end = 0x20300300 + 16, | |
179 | .flags = IORESOURCE_MEM, | |
1f83b8f1 | 180 | }, { |
1394f032 BW |
181 | |
182 | .start = IRQ_PF7, | |
183 | .end = IRQ_PF7, | |
184 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | |
185 | }, | |
186 | }; | |
187 | static struct platform_device smc91x_device = { | |
188 | .name = "smc91x", | |
189 | .id = 0, | |
190 | .num_resources = ARRAY_SIZE(smc91x_resources), | |
191 | .resource = smc91x_resources, | |
192 | }; | |
193 | #endif | |
194 | ||
f40d24d9 AL |
195 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
196 | static struct resource dm9000_resources[] = { | |
197 | [0] = { | |
198 | .start = 0x203FB800, | |
199 | .end = 0x203FB800 + 8, | |
200 | .flags = IORESOURCE_MEM, | |
201 | }, | |
202 | [1] = { | |
203 | .start = IRQ_PF9, | |
204 | .end = IRQ_PF9, | |
205 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE), | |
206 | }, | |
207 | }; | |
208 | ||
209 | static struct platform_device dm9000_device = { | |
210 | .name = "dm9000", | |
211 | .id = -1, | |
212 | .num_resources = ARRAY_SIZE(dm9000_resources), | |
213 | .resource = dm9000_resources, | |
214 | }; | |
215 | #endif | |
216 | ||
561cc18b MH |
217 | #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE) |
218 | static struct resource ax88180_resources[] = { | |
219 | [0] = { | |
220 | .start = 0x20300000, | |
221 | .end = 0x20300000 + 0x8000, | |
222 | .flags = IORESOURCE_MEM, | |
223 | }, | |
224 | [1] = { | |
225 | .start = IRQ_PF7, | |
226 | .end = IRQ_PF7, | |
227 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL), | |
228 | }, | |
229 | }; | |
230 | ||
231 | static struct platform_device ax88180_device = { | |
232 | .name = "ax88180", | |
233 | .id = -1, | |
234 | .num_resources = ARRAY_SIZE(ax88180_resources), | |
235 | .resource = ax88180_resources, | |
236 | }; | |
237 | #endif | |
238 | ||
1394f032 BW |
239 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) |
240 | static struct resource sl811_hcd_resources[] = { | |
241 | { | |
242 | .start = 0x20340000, | |
243 | .end = 0x20340000, | |
244 | .flags = IORESOURCE_MEM, | |
1f83b8f1 | 245 | }, { |
1394f032 BW |
246 | .start = 0x20340004, |
247 | .end = 0x20340004, | |
248 | .flags = IORESOURCE_MEM, | |
1f83b8f1 | 249 | }, { |
1394f032 BW |
250 | .start = CONFIG_USB_SL811_BFIN_IRQ, |
251 | .end = CONFIG_USB_SL811_BFIN_IRQ, | |
252 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | |
253 | }, | |
254 | }; | |
255 | ||
256 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | |
257 | void sl811_port_power(struct device *dev, int is_on) | |
258 | { | |
c6c4d7bb | 259 | gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS"); |
acbcd263 | 260 | gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on); |
1394f032 BW |
261 | } |
262 | #endif | |
263 | ||
264 | static struct sl811_platform_data sl811_priv = { | |
265 | .potpg = 10, | |
266 | .power = 250, /* == 500mA */ | |
267 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | |
268 | .port_power = &sl811_port_power, | |
269 | #endif | |
270 | }; | |
271 | ||
272 | static struct platform_device sl811_hcd_device = { | |
273 | .name = "sl811-hcd", | |
274 | .id = 0, | |
275 | .dev = { | |
276 | .platform_data = &sl811_priv, | |
277 | }, | |
278 | .num_resources = ARRAY_SIZE(sl811_hcd_resources), | |
279 | .resource = sl811_hcd_resources, | |
280 | }; | |
281 | #endif | |
282 | ||
283 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | |
284 | static struct resource isp1362_hcd_resources[] = { | |
285 | { | |
286 | .start = 0x20360000, | |
287 | .end = 0x20360000, | |
288 | .flags = IORESOURCE_MEM, | |
1f83b8f1 | 289 | }, { |
1394f032 BW |
290 | .start = 0x20360004, |
291 | .end = 0x20360004, | |
292 | .flags = IORESOURCE_MEM, | |
1f83b8f1 | 293 | }, { |
1394f032 BW |
294 | .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ, |
295 | .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ, | |
296 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | |
297 | }, | |
298 | }; | |
299 | ||
300 | static struct isp1362_platform_data isp1362_priv = { | |
301 | .sel15Kres = 1, | |
302 | .clknotstop = 0, | |
303 | .oc_enable = 0, | |
304 | .int_act_high = 0, | |
305 | .int_edge_triggered = 0, | |
306 | .remote_wakeup_connected = 0, | |
307 | .no_power_switching = 1, | |
308 | .power_switching_mode = 0, | |
309 | }; | |
310 | ||
311 | static struct platform_device isp1362_hcd_device = { | |
312 | .name = "isp1362-hcd", | |
313 | .id = 0, | |
314 | .dev = { | |
315 | .platform_data = &isp1362_priv, | |
316 | }, | |
317 | .num_resources = ARRAY_SIZE(isp1362_hcd_resources), | |
318 | .resource = isp1362_hcd_resources, | |
319 | }; | |
320 | #endif | |
321 | ||
322 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) | |
65319628 GY |
323 | static struct platform_device bfin_mii_bus = { |
324 | .name = "bfin_mii_bus", | |
325 | }; | |
326 | ||
1394f032 BW |
327 | static struct platform_device bfin_mac_device = { |
328 | .name = "bfin_mac", | |
65319628 | 329 | .dev.platform_data = &bfin_mii_bus, |
1394f032 BW |
330 | }; |
331 | #endif | |
332 | ||
333 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) | |
334 | static struct resource net2272_bfin_resources[] = { | |
335 | { | |
336 | .start = 0x20300000, | |
337 | .end = 0x20300000 + 0x100, | |
338 | .flags = IORESOURCE_MEM, | |
1f83b8f1 | 339 | }, { |
1394f032 BW |
340 | .start = IRQ_PF7, |
341 | .end = IRQ_PF7, | |
342 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | |
343 | }, | |
344 | }; | |
345 | ||
346 | static struct platform_device net2272_bfin_device = { | |
347 | .name = "net2272", | |
348 | .id = -1, | |
349 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), | |
350 | .resource = net2272_bfin_resources, | |
351 | }; | |
352 | #endif | |
353 | ||
fc68911e MF |
354 | #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) |
355 | #ifdef CONFIG_MTD_PARTITIONS | |
356 | const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; | |
357 | ||
358 | static struct mtd_partition bfin_plat_nand_partitions[] = { | |
359 | { | |
aa582977 | 360 | .name = "linux kernel(nand)", |
fc68911e MF |
361 | .size = 0x400000, |
362 | .offset = 0, | |
363 | }, { | |
aa582977 | 364 | .name = "file system(nand)", |
fc68911e MF |
365 | .size = MTDPART_SIZ_FULL, |
366 | .offset = MTDPART_OFS_APPEND, | |
367 | }, | |
368 | }; | |
369 | #endif | |
370 | ||
371 | #define BFIN_NAND_PLAT_CLE 2 | |
372 | #define BFIN_NAND_PLAT_ALE 1 | |
373 | static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) | |
374 | { | |
375 | struct nand_chip *this = mtd->priv; | |
376 | ||
377 | if (cmd == NAND_CMD_NONE) | |
378 | return; | |
379 | ||
380 | if (ctrl & NAND_CLE) | |
381 | writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE)); | |
382 | else | |
383 | writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE)); | |
384 | } | |
385 | ||
386 | #define BFIN_NAND_PLAT_READY GPIO_PF3 | |
387 | static int bfin_plat_nand_dev_ready(struct mtd_info *mtd) | |
388 | { | |
389 | return gpio_get_value(BFIN_NAND_PLAT_READY); | |
390 | } | |
391 | ||
392 | static struct platform_nand_data bfin_plat_nand_data = { | |
393 | .chip = { | |
394 | .chip_delay = 30, | |
395 | #ifdef CONFIG_MTD_PARTITIONS | |
396 | .part_probe_types = part_probes, | |
397 | .partitions = bfin_plat_nand_partitions, | |
398 | .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions), | |
399 | #endif | |
400 | }, | |
401 | .ctrl = { | |
402 | .cmd_ctrl = bfin_plat_nand_cmd_ctrl, | |
403 | .dev_ready = bfin_plat_nand_dev_ready, | |
404 | }, | |
405 | }; | |
406 | ||
407 | #define MAX(x, y) (x > y ? x : y) | |
408 | static struct resource bfin_plat_nand_resources = { | |
409 | .start = 0x20212000, | |
410 | .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)), | |
411 | .flags = IORESOURCE_IO, | |
412 | }; | |
413 | ||
414 | static struct platform_device bfin_async_nand_device = { | |
415 | .name = "gen_nand", | |
416 | .id = -1, | |
417 | .num_resources = 1, | |
418 | .resource = &bfin_plat_nand_resources, | |
419 | .dev = { | |
420 | .platform_data = &bfin_plat_nand_data, | |
421 | }, | |
422 | }; | |
423 | ||
424 | static void bfin_plat_nand_init(void) | |
425 | { | |
426 | gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat"); | |
427 | } | |
428 | #else | |
429 | static void bfin_plat_nand_init(void) {} | |
430 | #endif | |
431 | ||
793dc27b | 432 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
de8c43f2 MF |
433 | static struct mtd_partition stamp_partitions[] = { |
434 | { | |
aa582977 | 435 | .name = "bootloader(nor)", |
edf05641 | 436 | .size = 0x40000, |
de8c43f2 MF |
437 | .offset = 0, |
438 | }, { | |
aa582977 | 439 | .name = "linux kernel(nor)", |
6ecb5b6d | 440 | .size = 0x180000, |
de8c43f2 MF |
441 | .offset = MTDPART_OFS_APPEND, |
442 | }, { | |
aa582977 | 443 | .name = "file system(nor)", |
6ecb5b6d | 444 | .size = 0x400000 - 0x40000 - 0x180000 - 0x10000, |
de8c43f2 MF |
445 | .offset = MTDPART_OFS_APPEND, |
446 | }, { | |
aa582977 | 447 | .name = "MAC Address(nor)", |
de8c43f2 MF |
448 | .size = MTDPART_SIZ_FULL, |
449 | .offset = 0x3F0000, | |
450 | .mask_flags = MTD_WRITEABLE, | |
451 | } | |
452 | }; | |
453 | ||
454 | static struct physmap_flash_data stamp_flash_data = { | |
455 | .width = 2, | |
456 | .parts = stamp_partitions, | |
457 | .nr_parts = ARRAY_SIZE(stamp_partitions), | |
458 | }; | |
459 | ||
460 | static struct resource stamp_flash_resource = { | |
461 | .start = 0x20000000, | |
462 | .end = 0x203fffff, | |
463 | .flags = IORESOURCE_MEM, | |
464 | }; | |
465 | ||
466 | static struct platform_device stamp_flash_device = { | |
467 | .name = "physmap-flash", | |
468 | .id = 0, | |
469 | .dev = { | |
470 | .platform_data = &stamp_flash_data, | |
471 | }, | |
472 | .num_resources = 1, | |
473 | .resource = &stamp_flash_resource, | |
474 | }; | |
793dc27b | 475 | #endif |
de8c43f2 | 476 | |
1394f032 BW |
477 | #if defined(CONFIG_MTD_M25P80) \ |
478 | || defined(CONFIG_MTD_M25P80_MODULE) | |
479 | static struct mtd_partition bfin_spi_flash_partitions[] = { | |
480 | { | |
aa582977 | 481 | .name = "bootloader(spi)", |
edf05641 | 482 | .size = 0x00040000, |
1394f032 BW |
483 | .offset = 0, |
484 | .mask_flags = MTD_CAP_ROM | |
1f83b8f1 | 485 | }, { |
aa582977 | 486 | .name = "linux kernel(spi)", |
6ecb5b6d | 487 | .size = 0x180000, |
edf05641 | 488 | .offset = MTDPART_OFS_APPEND, |
1f83b8f1 | 489 | }, { |
aa582977 | 490 | .name = "file system(spi)", |
edf05641 MF |
491 | .size = MTDPART_SIZ_FULL, |
492 | .offset = MTDPART_OFS_APPEND, | |
1394f032 BW |
493 | } |
494 | }; | |
495 | ||
496 | static struct flash_platform_data bfin_spi_flash_data = { | |
497 | .name = "m25p80", | |
498 | .parts = bfin_spi_flash_partitions, | |
499 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), | |
88a8078b | 500 | /* .type = "m25p64", */ |
1394f032 BW |
501 | }; |
502 | ||
503 | /* SPI flash chip (m25p64) */ | |
504 | static struct bfin5xx_spi_chip spi_flash_chip_info = { | |
505 | .enable_dma = 0, /* use dma transfer with this chip*/ | |
506 | .bits_per_word = 8, | |
507 | }; | |
508 | #endif | |
509 | ||
a261eec0 MF |
510 | #if defined(CONFIG_BFIN_SPI_ADC) \ |
511 | || defined(CONFIG_BFIN_SPI_ADC_MODULE) | |
1394f032 BW |
512 | /* SPI ADC chip */ |
513 | static struct bfin5xx_spi_chip spi_adc_chip_info = { | |
514 | .enable_dma = 1, /* use dma transfer with this chip*/ | |
515 | .bits_per_word = 16, | |
516 | }; | |
517 | #endif | |
518 | ||
519 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ | |
520 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | |
521 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | |
522 | .enable_dma = 0, | |
523 | .bits_per_word = 16, | |
524 | }; | |
525 | #endif | |
526 | ||
527 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) | |
528 | static struct bfin5xx_spi_chip ad9960_spi_chip_info = { | |
529 | .enable_dma = 0, | |
530 | .bits_per_word = 16, | |
531 | }; | |
532 | #endif | |
533 | ||
f79ea4cb YL |
534 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
535 | #define MMC_SPI_CARD_DETECT_INT IRQ_PF5 | |
536 | ||
537 | static int bfin_mmc_spi_init(struct device *dev, | |
538 | irqreturn_t (*detect_int)(int, void *), void *data) | |
539 | { | |
540 | return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int, | |
541 | IRQF_TRIGGER_FALLING, "mmc-spi-detect", data); | |
542 | } | |
543 | ||
544 | static void bfin_mmc_spi_exit(struct device *dev, void *data) | |
545 | { | |
546 | free_irq(MMC_SPI_CARD_DETECT_INT, data); | |
547 | } | |
548 | ||
549 | static struct mmc_spi_platform_data bfin_mmc_spi_pdata = { | |
550 | .init = bfin_mmc_spi_init, | |
551 | .exit = bfin_mmc_spi_exit, | |
552 | .detect_delay = 100, /* msecs */ | |
553 | }; | |
554 | ||
555 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { | |
556 | .enable_dma = 0, | |
557 | .bits_per_word = 8, | |
e68d1ebc | 558 | .pio_interrupt = 0, |
f79ea4cb YL |
559 | }; |
560 | #endif | |
561 | ||
1394f032 BW |
562 | #if defined(CONFIG_PBX) |
563 | static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { | |
564 | .ctl_reg = 0x4, /* send zero */ | |
565 | .enable_dma = 0, | |
566 | .bits_per_word = 8, | |
567 | .cs_change_per_word = 1, | |
568 | }; | |
569 | #endif | |
570 | ||
1394f032 | 571 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
46aa04f9 | 572 | #include <linux/spi/ad7877.h> |
1394f032 | 573 | static struct bfin5xx_spi_chip spi_ad7877_chip_info = { |
1394f032 BW |
574 | .enable_dma = 0, |
575 | .bits_per_word = 16, | |
576 | }; | |
577 | ||
578 | static const struct ad7877_platform_data bfin_ad7877_ts_info = { | |
579 | .model = 7877, | |
580 | .vref_delay_usecs = 50, /* internal, no capacitor */ | |
581 | .x_plate_ohms = 419, | |
582 | .y_plate_ohms = 486, | |
583 | .pressure_max = 1000, | |
584 | .pressure_min = 0, | |
585 | .stopacq_polarity = 1, | |
586 | .first_conversion_delay = 3, | |
587 | .acquisition_time = 1, | |
588 | .averaging = 1, | |
589 | .pen_down_acc_interval = 1, | |
590 | }; | |
591 | #endif | |
592 | ||
46aa04f9 MH |
593 | #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE) |
594 | #include <linux/spi/ad7879.h> | |
46aa04f9 MH |
595 | static const struct ad7879_platform_data bfin_ad7879_ts_info = { |
596 | .model = 7879, /* Model = AD7879 */ | |
597 | .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */ | |
598 | .pressure_max = 10000, | |
599 | .pressure_min = 0, | |
600 | .first_conversion_delay = 3, /* wait 512us before do a first conversion */ | |
601 | .acquisition_time = 1, /* 4us acquisition time per sample */ | |
602 | .median = 2, /* do 8 measurements */ | |
603 | .averaging = 1, /* take the average of 4 middle samples */ | |
604 | .pen_down_acc_interval = 255, /* 9.4 ms */ | |
605 | .gpio_output = 1, /* configure AUX/VBAT/GPIO as GPIO output */ | |
606 | .gpio_default = 1, /* During initialization set GPIO = HIGH */ | |
607 | }; | |
608 | #endif | |
609 | ||
ffc4d8bc MH |
610 | #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE) |
611 | #include <linux/input.h> | |
612 | #include <linux/spi/adxl34x.h> | |
613 | static const struct adxl34x_platform_data adxl34x_info = { | |
614 | .x_axis_offset = 0, | |
615 | .y_axis_offset = 0, | |
616 | .z_axis_offset = 0, | |
617 | .tap_threshold = 0x31, | |
618 | .tap_duration = 0x10, | |
619 | .tap_latency = 0x60, | |
620 | .tap_window = 0xF0, | |
621 | .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN, | |
622 | .act_axis_control = 0xFF, | |
623 | .activity_threshold = 5, | |
624 | .inactivity_threshold = 3, | |
625 | .inactivity_time = 4, | |
626 | .free_fall_threshold = 0x7, | |
627 | .free_fall_time = 0x20, | |
628 | .data_rate = 0x8, | |
629 | .data_range = ADXL_FULL_RES, | |
630 | ||
631 | .ev_type = EV_ABS, | |
632 | .ev_code_x = ABS_X, /* EV_REL */ | |
633 | .ev_code_y = ABS_Y, /* EV_REL */ | |
634 | .ev_code_z = ABS_Z, /* EV_REL */ | |
635 | ||
636 | .ev_code_tap_x = BTN_TOUCH, /* EV_KEY */ | |
637 | .ev_code_tap_y = BTN_TOUCH, /* EV_KEY */ | |
638 | .ev_code_tap_z = BTN_TOUCH, /* EV_KEY */ | |
639 | ||
640 | /* .ev_code_ff = KEY_F,*/ /* EV_KEY */ | |
641 | /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */ | |
642 | .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK, | |
643 | .fifo_mode = ADXL_FIFO_STREAM, | |
644 | }; | |
645 | #endif | |
646 | ||
f5150155 MH |
647 | #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) |
648 | static struct bfin5xx_spi_chip spi_ad7879_chip_info = { | |
649 | .enable_dma = 0, | |
650 | .bits_per_word = 16, | |
651 | }; | |
652 | #endif | |
653 | ||
6e668936 MH |
654 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
655 | static struct bfin5xx_spi_chip spidev_chip_info = { | |
656 | .enable_dma = 0, | |
657 | .bits_per_word = 8, | |
658 | }; | |
659 | #endif | |
660 | ||
2043f3f7 MH |
661 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
662 | static struct bfin5xx_spi_chip lq035q1_spi_chip_info = { | |
663 | .enable_dma = 0, | |
664 | .bits_per_word = 8, | |
665 | }; | |
666 | #endif | |
667 | ||
85a192e9 MH |
668 | #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) |
669 | static struct bfin5xx_spi_chip enc28j60_spi_chip_info = { | |
670 | .enable_dma = 1, | |
671 | .bits_per_word = 8, | |
672 | .cs_gpio = GPIO_PF10, | |
673 | }; | |
674 | #endif | |
675 | ||
8e9d5c7d MH |
676 | #if defined(CONFIG_MTD_DATAFLASH) \ |
677 | || defined(CONFIG_MTD_DATAFLASH_MODULE) | |
ceac2651 MH |
678 | |
679 | static struct mtd_partition bfin_spi_dataflash_partitions[] = { | |
680 | { | |
681 | .name = "bootloader(spi)", | |
682 | .size = 0x00040000, | |
683 | .offset = 0, | |
684 | .mask_flags = MTD_CAP_ROM | |
685 | }, { | |
686 | .name = "linux kernel(spi)", | |
6ecb5b6d | 687 | .size = 0x180000, |
ceac2651 MH |
688 | .offset = MTDPART_OFS_APPEND, |
689 | }, { | |
690 | .name = "file system(spi)", | |
691 | .size = MTDPART_SIZ_FULL, | |
692 | .offset = MTDPART_OFS_APPEND, | |
693 | } | |
694 | }; | |
695 | ||
696 | static struct flash_platform_data bfin_spi_dataflash_data = { | |
697 | .name = "SPI Dataflash", | |
698 | .parts = bfin_spi_dataflash_partitions, | |
699 | .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions), | |
700 | }; | |
701 | ||
8e9d5c7d MH |
702 | /* DataFlash chip */ |
703 | static struct bfin5xx_spi_chip data_flash_chip_info = { | |
704 | .enable_dma = 0, /* use dma transfer with this chip*/ | |
705 | .bits_per_word = 8, | |
706 | }; | |
707 | #endif | |
708 | ||
1394f032 BW |
709 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
710 | #if defined(CONFIG_MTD_M25P80) \ | |
711 | || defined(CONFIG_MTD_M25P80_MODULE) | |
712 | { | |
713 | /* the modalias must be the same as spi device driver name */ | |
714 | .modalias = "m25p80", /* Name of spi_driver for this device */ | |
715 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | |
c6c4d7bb | 716 | .bus_num = 0, /* Framework bus number */ |
1394f032 BW |
717 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
718 | .platform_data = &bfin_spi_flash_data, | |
719 | .controller_data = &spi_flash_chip_info, | |
720 | .mode = SPI_MODE_3, | |
721 | }, | |
722 | #endif | |
8e9d5c7d MH |
723 | #if defined(CONFIG_MTD_DATAFLASH) \ |
724 | || defined(CONFIG_MTD_DATAFLASH_MODULE) | |
725 | { /* DataFlash chip */ | |
726 | .modalias = "mtd_dataflash", | |
ceac2651 | 727 | .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */ |
8e9d5c7d MH |
728 | .bus_num = 0, /* Framework bus number */ |
729 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ | |
ceac2651 | 730 | .platform_data = &bfin_spi_dataflash_data, |
8e9d5c7d MH |
731 | .controller_data = &data_flash_chip_info, |
732 | .mode = SPI_MODE_3, | |
733 | }, | |
734 | #endif | |
a261eec0 MF |
735 | #if defined(CONFIG_BFIN_SPI_ADC) \ |
736 | || defined(CONFIG_BFIN_SPI_ADC_MODULE) | |
1394f032 BW |
737 | { |
738 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ | |
739 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ | |
c6c4d7bb | 740 | .bus_num = 0, /* Framework bus number */ |
1394f032 BW |
741 | .chip_select = 1, /* Framework chip select. */ |
742 | .platform_data = NULL, /* No spi_driver specific config */ | |
743 | .controller_data = &spi_adc_chip_info, | |
744 | }, | |
745 | #endif | |
746 | ||
747 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ | |
748 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | |
749 | { | |
750 | .modalias = "ad1836-spi", | |
751 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | |
c6c4d7bb | 752 | .bus_num = 0, |
1394f032 BW |
753 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
754 | .controller_data = &ad1836_spi_chip_info, | |
755 | }, | |
756 | #endif | |
757 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) | |
758 | { | |
759 | .modalias = "ad9960-spi", | |
760 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ | |
c6c4d7bb | 761 | .bus_num = 0, |
1394f032 BW |
762 | .chip_select = 1, |
763 | .controller_data = &ad9960_spi_chip_info, | |
764 | }, | |
765 | #endif | |
f79ea4cb YL |
766 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
767 | { | |
768 | .modalias = "mmc_spi", | |
769 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ | |
770 | .bus_num = 0, | |
771 | .chip_select = 4, | |
772 | .platform_data = &bfin_mmc_spi_pdata, | |
773 | .controller_data = &mmc_spi_chip_info, | |
774 | .mode = SPI_MODE_3, | |
775 | }, | |
776 | #endif | |
1394f032 BW |
777 | #if defined(CONFIG_PBX) |
778 | { | |
1f83b8f1 MF |
779 | .modalias = "fxs-spi", |
780 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | |
c6c4d7bb BW |
781 | .bus_num = 0, |
782 | .chip_select = 8 - CONFIG_J11_JUMPER, | |
1f83b8f1 | 783 | .controller_data = &spi_si3xxx_chip_info, |
1394f032 BW |
784 | .mode = SPI_MODE_3, |
785 | }, | |
786 | { | |
1f83b8f1 MF |
787 | .modalias = "fxo-spi", |
788 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | |
c6c4d7bb BW |
789 | .bus_num = 0, |
790 | .chip_select = 8 - CONFIG_J19_JUMPER, | |
1f83b8f1 | 791 | .controller_data = &spi_si3xxx_chip_info, |
1394f032 BW |
792 | .mode = SPI_MODE_3, |
793 | }, | |
794 | #endif | |
1394f032 BW |
795 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
796 | { | |
797 | .modalias = "ad7877", | |
798 | .platform_data = &bfin_ad7877_ts_info, | |
799 | .irq = IRQ_PF6, | |
800 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | |
c7d48966 | 801 | .bus_num = 0, |
1394f032 BW |
802 | .chip_select = 1, |
803 | .controller_data = &spi_ad7877_chip_info, | |
804 | }, | |
805 | #endif | |
f5150155 | 806 | #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) |
46aa04f9 MH |
807 | { |
808 | .modalias = "ad7879", | |
809 | .platform_data = &bfin_ad7879_ts_info, | |
810 | .irq = IRQ_PF7, | |
811 | .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ | |
812 | .bus_num = 0, | |
813 | .chip_select = 1, | |
814 | .controller_data = &spi_ad7879_chip_info, | |
815 | .mode = SPI_CPHA | SPI_CPOL, | |
816 | }, | |
817 | #endif | |
6e668936 MH |
818 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
819 | { | |
820 | .modalias = "spidev", | |
821 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | |
822 | .bus_num = 0, | |
823 | .chip_select = 1, | |
824 | .controller_data = &spidev_chip_info, | |
825 | }, | |
826 | #endif | |
2043f3f7 MH |
827 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
828 | { | |
829 | .modalias = "bfin-lq035q1-spi", | |
830 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ | |
831 | .bus_num = 0, | |
46aa04f9 | 832 | .chip_select = 2, |
2043f3f7 MH |
833 | .controller_data = &lq035q1_spi_chip_info, |
834 | .mode = SPI_CPHA | SPI_CPOL, | |
835 | }, | |
836 | #endif | |
85a192e9 MH |
837 | #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) |
838 | { | |
839 | .modalias = "enc28j60", | |
840 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ | |
841 | .irq = IRQ_PF6, | |
842 | .bus_num = 0, | |
843 | .chip_select = 0, /* GPIO controlled SSEL */ | |
844 | .controller_data = &enc28j60_spi_chip_info, | |
845 | .mode = SPI_MODE_0, | |
846 | }, | |
847 | #endif | |
1394f032 BW |
848 | }; |
849 | ||
5bda2723 | 850 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
1394f032 | 851 | /* SPI controller data */ |
c6c4d7bb | 852 | static struct bfin5xx_spi_master bfin_spi0_info = { |
1394f032 BW |
853 | .num_chipselect = 8, |
854 | .enable_dma = 1, /* master has the ability to do dma transfer */ | |
5d448dd5 | 855 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
1394f032 BW |
856 | }; |
857 | ||
c6c4d7bb BW |
858 | /* SPI (0) */ |
859 | static struct resource bfin_spi0_resource[] = { | |
860 | [0] = { | |
861 | .start = SPI0_REGBASE, | |
862 | .end = SPI0_REGBASE + 0xFF, | |
863 | .flags = IORESOURCE_MEM, | |
864 | }, | |
865 | [1] = { | |
866 | .start = CH_SPI, | |
867 | .end = CH_SPI, | |
e68d1ebc YL |
868 | .flags = IORESOURCE_DMA, |
869 | }, | |
870 | [2] = { | |
871 | .start = IRQ_SPI, | |
872 | .end = IRQ_SPI, | |
c6c4d7bb BW |
873 | .flags = IORESOURCE_IRQ, |
874 | }, | |
875 | }; | |
876 | ||
877 | static struct platform_device bfin_spi0_device = { | |
878 | .name = "bfin-spi", | |
879 | .id = 0, /* Bus number */ | |
880 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), | |
881 | .resource = bfin_spi0_resource, | |
1394f032 | 882 | .dev = { |
c6c4d7bb | 883 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
1394f032 BW |
884 | }, |
885 | }; | |
886 | #endif /* spi master and devices */ | |
887 | ||
1e9aa955 CC |
888 | #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE) |
889 | ||
890 | /* SPORT SPI controller data */ | |
891 | static struct bfin5xx_spi_master bfin_sport_spi0_info = { | |
892 | .num_chipselect = 1, /* master only supports one device */ | |
893 | .enable_dma = 0, /* master don't support DMA */ | |
894 | .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI, | |
895 | P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0}, | |
896 | }; | |
897 | ||
898 | static struct resource bfin_sport_spi0_resource[] = { | |
899 | [0] = { | |
900 | .start = SPORT0_TCR1, | |
901 | .end = SPORT0_TCR1 + 0xFF, | |
902 | .flags = IORESOURCE_MEM, | |
903 | }, | |
904 | [1] = { | |
905 | .start = IRQ_SPORT0_ERROR, | |
906 | .end = IRQ_SPORT0_ERROR, | |
907 | .flags = IORESOURCE_IRQ, | |
908 | }, | |
909 | }; | |
910 | ||
911 | static struct platform_device bfin_sport_spi0_device = { | |
912 | .name = "bfin-sport-spi", | |
913 | .id = 1, /* Bus number */ | |
914 | .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource), | |
915 | .resource = bfin_sport_spi0_resource, | |
916 | .dev = { | |
917 | .platform_data = &bfin_sport_spi0_info, /* Passed to driver */ | |
918 | }, | |
919 | }; | |
920 | ||
921 | static struct bfin5xx_spi_master bfin_sport_spi1_info = { | |
922 | .num_chipselect = 1, /* master only supports one device */ | |
923 | .enable_dma = 0, /* master don't support DMA */ | |
924 | .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI, | |
925 | P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0}, | |
926 | }; | |
927 | ||
928 | static struct resource bfin_sport_spi1_resource[] = { | |
929 | [0] = { | |
930 | .start = SPORT1_TCR1, | |
931 | .end = SPORT1_TCR1 + 0xFF, | |
932 | .flags = IORESOURCE_MEM, | |
933 | }, | |
934 | [1] = { | |
935 | .start = IRQ_SPORT1_ERROR, | |
936 | .end = IRQ_SPORT1_ERROR, | |
937 | .flags = IORESOURCE_IRQ, | |
938 | }, | |
939 | }; | |
940 | ||
941 | static struct platform_device bfin_sport_spi1_device = { | |
942 | .name = "bfin-sport-spi", | |
943 | .id = 2, /* Bus number */ | |
944 | .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource), | |
945 | .resource = bfin_sport_spi1_resource, | |
946 | .dev = { | |
947 | .platform_data = &bfin_sport_spi1_info, /* Passed to driver */ | |
948 | }, | |
949 | }; | |
950 | ||
951 | #endif /* sport spi master and devices */ | |
952 | ||
1394f032 BW |
953 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
954 | static struct platform_device bfin_fb_device = { | |
c6c4d7bb BW |
955 | .name = "bf537-lq035", |
956 | }; | |
957 | #endif | |
958 | ||
959 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) | |
960 | static struct platform_device bfin_fb_adv7393_device = { | |
961 | .name = "bfin-adv7393", | |
1394f032 BW |
962 | }; |
963 | #endif | |
964 | ||
2043f3f7 MH |
965 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
966 | #include <asm/bfin-lq035q1.h> | |
967 | ||
968 | static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = { | |
969 | .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB, | |
46aa04f9 | 970 | .use_bl = 0, /* let something else control the LCD Blacklight */ |
2043f3f7 MH |
971 | .gpio_bl = GPIO_PF7, |
972 | }; | |
973 | ||
974 | static struct resource bfin_lq035q1_resources[] = { | |
975 | { | |
976 | .start = IRQ_PPI_ERROR, | |
977 | .end = IRQ_PPI_ERROR, | |
978 | .flags = IORESOURCE_IRQ, | |
979 | }, | |
980 | }; | |
981 | ||
982 | static struct platform_device bfin_lq035q1_device = { | |
983 | .name = "bfin-lq035q1", | |
984 | .id = -1, | |
985 | .num_resources = ARRAY_SIZE(bfin_lq035q1_resources), | |
986 | .resource = bfin_lq035q1_resources, | |
987 | .dev = { | |
988 | .platform_data = &bfin_lq035q1_data, | |
989 | }, | |
990 | }; | |
991 | #endif | |
992 | ||
1394f032 BW |
993 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
994 | static struct resource bfin_uart_resources[] = { | |
233b28a9 | 995 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
1394f032 BW |
996 | { |
997 | .start = 0xFFC00400, | |
998 | .end = 0xFFC004FF, | |
999 | .flags = IORESOURCE_MEM, | |
233b28a9 SZ |
1000 | }, |
1001 | #endif | |
1002 | #ifdef CONFIG_SERIAL_BFIN_UART1 | |
1003 | { | |
1394f032 BW |
1004 | .start = 0xFFC02000, |
1005 | .end = 0xFFC020FF, | |
1006 | .flags = IORESOURCE_MEM, | |
1007 | }, | |
233b28a9 | 1008 | #endif |
1394f032 BW |
1009 | }; |
1010 | ||
1011 | static struct platform_device bfin_uart_device = { | |
1012 | .name = "bfin-uart", | |
1013 | .id = 1, | |
1014 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | |
1015 | .resource = bfin_uart_resources, | |
1016 | }; | |
1017 | #endif | |
1018 | ||
5be36d22 | 1019 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
5be36d22 | 1020 | #ifdef CONFIG_BFIN_SIR0 |
42bd8bcb | 1021 | static struct resource bfin_sir0_resources[] = { |
5be36d22 GY |
1022 | { |
1023 | .start = 0xFFC00400, | |
1024 | .end = 0xFFC004FF, | |
1025 | .flags = IORESOURCE_MEM, | |
1026 | }, | |
42bd8bcb GY |
1027 | { |
1028 | .start = IRQ_UART0_RX, | |
1029 | .end = IRQ_UART0_RX+1, | |
1030 | .flags = IORESOURCE_IRQ, | |
1031 | }, | |
1032 | { | |
1033 | .start = CH_UART0_RX, | |
1034 | .end = CH_UART0_RX+1, | |
1035 | .flags = IORESOURCE_DMA, | |
1036 | }, | |
1037 | }; | |
1038 | ||
1039 | static struct platform_device bfin_sir0_device = { | |
1040 | .name = "bfin_sir", | |
1041 | .id = 0, | |
1042 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), | |
1043 | .resource = bfin_sir0_resources, | |
1044 | }; | |
5be36d22 GY |
1045 | #endif |
1046 | #ifdef CONFIG_BFIN_SIR1 | |
42bd8bcb | 1047 | static struct resource bfin_sir1_resources[] = { |
5be36d22 GY |
1048 | { |
1049 | .start = 0xFFC02000, | |
1050 | .end = 0xFFC020FF, | |
1051 | .flags = IORESOURCE_MEM, | |
1052 | }, | |
42bd8bcb GY |
1053 | { |
1054 | .start = IRQ_UART1_RX, | |
1055 | .end = IRQ_UART1_RX+1, | |
1056 | .flags = IORESOURCE_IRQ, | |
1057 | }, | |
1058 | { | |
1059 | .start = CH_UART1_RX, | |
1060 | .end = CH_UART1_RX+1, | |
1061 | .flags = IORESOURCE_DMA, | |
1062 | }, | |
5be36d22 GY |
1063 | }; |
1064 | ||
42bd8bcb | 1065 | static struct platform_device bfin_sir1_device = { |
5be36d22 | 1066 | .name = "bfin_sir", |
42bd8bcb GY |
1067 | .id = 1, |
1068 | .num_resources = ARRAY_SIZE(bfin_sir1_resources), | |
1069 | .resource = bfin_sir1_resources, | |
5be36d22 GY |
1070 | }; |
1071 | #endif | |
42bd8bcb | 1072 | #endif |
5be36d22 | 1073 | |
1394f032 | 1074 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
c6c4d7bb BW |
1075 | static struct resource bfin_twi0_resource[] = { |
1076 | [0] = { | |
1077 | .start = TWI0_REGBASE, | |
1078 | .end = TWI0_REGBASE, | |
1079 | .flags = IORESOURCE_MEM, | |
1080 | }, | |
1081 | [1] = { | |
1082 | .start = IRQ_TWI, | |
1083 | .end = IRQ_TWI, | |
1084 | .flags = IORESOURCE_IRQ, | |
1085 | }, | |
1086 | }; | |
1087 | ||
1394f032 BW |
1088 | static struct platform_device i2c_bfin_twi_device = { |
1089 | .name = "i2c-bfin-twi", | |
1090 | .id = 0, | |
c6c4d7bb BW |
1091 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), |
1092 | .resource = bfin_twi0_resource, | |
1394f032 BW |
1093 | }; |
1094 | #endif | |
1095 | ||
51ed9ad7 MH |
1096 | #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE) |
1097 | #include <linux/input.h> | |
f39d56ec | 1098 | #include <linux/i2c/adp5588.h> |
51ed9ad7 MH |
1099 | static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = { |
1100 | [0] = KEY_GRAVE, | |
1101 | [1] = KEY_1, | |
1102 | [2] = KEY_2, | |
1103 | [3] = KEY_3, | |
1104 | [4] = KEY_4, | |
1105 | [5] = KEY_5, | |
1106 | [6] = KEY_6, | |
1107 | [7] = KEY_7, | |
1108 | [8] = KEY_8, | |
1109 | [9] = KEY_9, | |
1110 | [10] = KEY_0, | |
1111 | [11] = KEY_MINUS, | |
1112 | [12] = KEY_EQUAL, | |
1113 | [13] = KEY_BACKSLASH, | |
1114 | [15] = KEY_KP0, | |
1115 | [16] = KEY_Q, | |
1116 | [17] = KEY_W, | |
1117 | [18] = KEY_E, | |
1118 | [19] = KEY_R, | |
1119 | [20] = KEY_T, | |
1120 | [21] = KEY_Y, | |
1121 | [22] = KEY_U, | |
1122 | [23] = KEY_I, | |
1123 | [24] = KEY_O, | |
1124 | [25] = KEY_P, | |
1125 | [26] = KEY_LEFTBRACE, | |
1126 | [27] = KEY_RIGHTBRACE, | |
1127 | [29] = KEY_KP1, | |
1128 | [30] = KEY_KP2, | |
1129 | [31] = KEY_KP3, | |
1130 | [32] = KEY_A, | |
1131 | [33] = KEY_S, | |
1132 | [34] = KEY_D, | |
1133 | [35] = KEY_F, | |
1134 | [36] = KEY_G, | |
1135 | [37] = KEY_H, | |
1136 | [38] = KEY_J, | |
1137 | [39] = KEY_K, | |
1138 | [40] = KEY_L, | |
1139 | [41] = KEY_SEMICOLON, | |
1140 | [42] = KEY_APOSTROPHE, | |
1141 | [43] = KEY_BACKSLASH, | |
1142 | [45] = KEY_KP4, | |
1143 | [46] = KEY_KP5, | |
1144 | [47] = KEY_KP6, | |
1145 | [48] = KEY_102ND, | |
1146 | [49] = KEY_Z, | |
1147 | [50] = KEY_X, | |
1148 | [51] = KEY_C, | |
1149 | [52] = KEY_V, | |
1150 | [53] = KEY_B, | |
1151 | [54] = KEY_N, | |
1152 | [55] = KEY_M, | |
1153 | [56] = KEY_COMMA, | |
1154 | [57] = KEY_DOT, | |
1155 | [58] = KEY_SLASH, | |
1156 | [60] = KEY_KPDOT, | |
1157 | [61] = KEY_KP7, | |
1158 | [62] = KEY_KP8, | |
1159 | [63] = KEY_KP9, | |
1160 | [64] = KEY_SPACE, | |
1161 | [65] = KEY_BACKSPACE, | |
1162 | [66] = KEY_TAB, | |
1163 | [67] = KEY_KPENTER, | |
1164 | [68] = KEY_ENTER, | |
1165 | [69] = KEY_ESC, | |
1166 | [70] = KEY_DELETE, | |
1167 | [74] = KEY_KPMINUS, | |
1168 | [76] = KEY_UP, | |
1169 | [77] = KEY_DOWN, | |
1170 | [78] = KEY_RIGHT, | |
1171 | [79] = KEY_LEFT, | |
1172 | }; | |
1173 | ||
1174 | static struct adp5588_kpad_platform_data adp5588_kpad_data = { | |
1175 | .rows = 8, | |
1176 | .cols = 10, | |
1177 | .keymap = adp5588_keymap, | |
1178 | .keymapsize = ARRAY_SIZE(adp5588_keymap), | |
1179 | .repeat = 0, | |
1180 | }; | |
1181 | #endif | |
1182 | ||
3ea57218 MH |
1183 | #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) |
1184 | #include <linux/mfd/adp5520.h> | |
1185 | ||
1186 | /* | |
1187 | * ADP5520/5501 Backlight Data | |
1188 | */ | |
1189 | ||
1190 | static struct adp5520_backlight_platfrom_data adp5520_backlight_data = { | |
1191 | .fade_in = FADE_T_1200ms, | |
1192 | .fade_out = FADE_T_1200ms, | |
1193 | .fade_led_law = BL_LAW_LINEAR, | |
1194 | .en_ambl_sens = 1, | |
1195 | .abml_filt = BL_AMBL_FILT_640ms, | |
1196 | .l1_daylight_max = BL_CUR_mA(15), | |
1197 | .l1_daylight_dim = BL_CUR_mA(0), | |
1198 | .l2_office_max = BL_CUR_mA(7), | |
1199 | .l2_office_dim = BL_CUR_mA(0), | |
1200 | .l3_dark_max = BL_CUR_mA(3), | |
1201 | .l3_dark_dim = BL_CUR_mA(0), | |
1202 | .l2_trip = L2_COMP_CURR_uA(700), | |
1203 | .l2_hyst = L2_COMP_CURR_uA(50), | |
1204 | .l3_trip = L3_COMP_CURR_uA(80), | |
1205 | .l3_hyst = L3_COMP_CURR_uA(20), | |
1206 | }; | |
1207 | ||
1208 | /* | |
1209 | * ADP5520/5501 LEDs Data | |
1210 | */ | |
1211 | ||
1212 | #include <linux/leds.h> | |
1213 | ||
1214 | static struct led_info adp5520_leds[] = { | |
1215 | { | |
1216 | .name = "adp5520-led1", | |
1217 | .default_trigger = "none", | |
1218 | .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | LED_OFFT_600ms, | |
1219 | }, | |
1220 | #ifdef ADP5520_EN_ALL_LEDS | |
1221 | { | |
1222 | .name = "adp5520-led2", | |
1223 | .default_trigger = "none", | |
1224 | .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1, | |
1225 | }, | |
1226 | { | |
1227 | .name = "adp5520-led3", | |
1228 | .default_trigger = "none", | |
1229 | .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2, | |
1230 | }, | |
1231 | #endif | |
1232 | }; | |
1233 | ||
1234 | static struct adp5520_leds_platfrom_data adp5520_leds_data = { | |
1235 | .num_leds = ARRAY_SIZE(adp5520_leds), | |
1236 | .leds = adp5520_leds, | |
1237 | .fade_in = FADE_T_600ms, | |
1238 | .fade_out = FADE_T_600ms, | |
1239 | .led_on_time = LED_ONT_600ms, | |
1240 | }; | |
1241 | ||
1242 | /* | |
1243 | * ADP5520 GPIO Data | |
1244 | */ | |
1245 | ||
1246 | static struct adp5520_gpio_platfrom_data adp5520_gpio_data = { | |
1247 | .gpio_start = 50, | |
1248 | .gpio_en_mask = GPIO_C1 | GPIO_C2 | GPIO_R2, | |
1249 | .gpio_pullup_mask = GPIO_C1 | GPIO_C2 | GPIO_R2, | |
1250 | }; | |
1251 | ||
1252 | /* | |
1253 | * ADP5520 Keypad Data | |
1254 | */ | |
1255 | ||
1256 | #include <linux/input.h> | |
1257 | static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = { | |
1258 | [KEY(0, 0)] = KEY_GRAVE, | |
1259 | [KEY(0, 1)] = KEY_1, | |
1260 | [KEY(0, 2)] = KEY_2, | |
1261 | [KEY(0, 3)] = KEY_3, | |
1262 | [KEY(1, 0)] = KEY_4, | |
1263 | [KEY(1, 1)] = KEY_5, | |
1264 | [KEY(1, 2)] = KEY_6, | |
1265 | [KEY(1, 3)] = KEY_7, | |
1266 | [KEY(2, 0)] = KEY_8, | |
1267 | [KEY(2, 1)] = KEY_9, | |
1268 | [KEY(2, 2)] = KEY_0, | |
1269 | [KEY(2, 3)] = KEY_MINUS, | |
1270 | [KEY(3, 0)] = KEY_EQUAL, | |
1271 | [KEY(3, 1)] = KEY_BACKSLASH, | |
1272 | [KEY(3, 2)] = KEY_BACKSPACE, | |
1273 | [KEY(3, 3)] = KEY_ENTER, | |
1274 | }; | |
1275 | ||
1276 | static struct adp5520_keys_platfrom_data adp5520_keys_data = { | |
1277 | .rows_en_mask = ROW_R3 | ROW_R2 | ROW_R1 | ROW_R0, | |
1278 | .cols_en_mask = COL_C3 | COL_C2 | COL_C1 | COL_C0, | |
1279 | .keymap = adp5520_keymap, | |
1280 | .keymapsize = ARRAY_SIZE(adp5520_keymap), | |
1281 | .repeat = 0, | |
1282 | }; | |
1283 | ||
1284 | /* | |
1285 | * ADP5520/5501 Multifuction Device Init Data | |
1286 | */ | |
1287 | ||
1288 | static struct adp5520_subdev_info adp5520_subdevs[] = { | |
1289 | { | |
1290 | .name = "adp5520-backlight", | |
1291 | .id = ID_ADP5520, | |
1292 | .platform_data = &adp5520_backlight_data, | |
1293 | }, | |
1294 | { | |
1295 | .name = "adp5520-led", | |
1296 | .id = ID_ADP5520, | |
1297 | .platform_data = &adp5520_leds_data, | |
1298 | }, | |
1299 | { | |
1300 | .name = "adp5520-gpio", | |
1301 | .id = ID_ADP5520, | |
1302 | .platform_data = &adp5520_gpio_data, | |
1303 | }, | |
1304 | { | |
1305 | .name = "adp5520-keys", | |
1306 | .id = ID_ADP5520, | |
1307 | .platform_data = &adp5520_keys_data, | |
1308 | }, | |
1309 | }; | |
1310 | ||
1311 | static struct adp5520_platform_data adp5520_pdev_data = { | |
1312 | .num_subdevs = ARRAY_SIZE(adp5520_subdevs), | |
1313 | .subdevs = adp5520_subdevs, | |
1314 | }; | |
1315 | ||
1316 | #endif | |
1317 | ||
81d9c7f2 BW |
1318 | static struct i2c_board_info __initdata bfin_i2c_board_info[] = { |
1319 | #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) | |
1320 | { | |
1321 | I2C_BOARD_INFO("ad7142_joystick", 0x2C), | |
4c94c3e0 | 1322 | .irq = IRQ_PG5, |
81d9c7f2 BW |
1323 | }, |
1324 | #endif | |
ebd58333 | 1325 | #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) |
81d9c7f2 BW |
1326 | { |
1327 | I2C_BOARD_INFO("pcf8574_lcd", 0x22), | |
81d9c7f2 BW |
1328 | }, |
1329 | #endif | |
1330 | #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) | |
1331 | { | |
1332 | I2C_BOARD_INFO("pcf8574_keypad", 0x27), | |
f5150155 MH |
1333 | .irq = IRQ_PG6, |
1334 | }, | |
1335 | #endif | |
1336 | #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE) | |
1337 | { | |
1338 | I2C_BOARD_INFO("ad7879", 0x2F), | |
1339 | .irq = IRQ_PG5, | |
1340 | .platform_data = (void *)&bfin_ad7879_ts_info, | |
81d9c7f2 BW |
1341 | }, |
1342 | #endif | |
51ed9ad7 MH |
1343 | #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE) |
1344 | { | |
1345 | I2C_BOARD_INFO("adp5588-keys", 0x34), | |
1346 | .irq = IRQ_PG0, | |
1347 | .platform_data = (void *)&adp5588_kpad_data, | |
1348 | }, | |
1349 | #endif | |
3ea57218 MH |
1350 | #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) |
1351 | { | |
1352 | I2C_BOARD_INFO("pmic-adp5520", 0x32), | |
4f84b6e0 | 1353 | .irq = IRQ_PG0, |
3ea57218 MH |
1354 | .platform_data = (void *)&adp5520_pdev_data, |
1355 | }, | |
1356 | #endif | |
ffc4d8bc MH |
1357 | #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE) |
1358 | { | |
1359 | I2C_BOARD_INFO("adxl34x", 0x53), | |
1360 | .irq = IRQ_PG3, | |
1361 | .platform_data = (void *)&adxl34x_info, | |
1362 | }, | |
1363 | #endif | |
81d9c7f2 | 1364 | }; |
81d9c7f2 | 1365 | |
1394f032 BW |
1366 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
1367 | static struct platform_device bfin_sport0_uart_device = { | |
1368 | .name = "bfin-sport-uart", | |
1369 | .id = 0, | |
1370 | }; | |
1371 | ||
1372 | static struct platform_device bfin_sport1_uart_device = { | |
1373 | .name = "bfin-sport-uart", | |
1374 | .id = 1, | |
1375 | }; | |
1376 | #endif | |
1377 | ||
c6c4d7bb | 1378 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
2c8beb2c MH |
1379 | #define CF_IDE_NAND_CARD_USE_HDD_INTERFACE |
1380 | /* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */ | |
c6c4d7bb | 1381 | |
2c8beb2c MH |
1382 | #ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE |
1383 | #define PATA_INT IRQ_PF5 | |
c6c4d7bb BW |
1384 | static struct pata_platform_info bfin_pata_platform_data = { |
1385 | .ioport_shift = 1, | |
64e5c512 | 1386 | .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED, |
c6c4d7bb BW |
1387 | }; |
1388 | ||
1389 | static struct resource bfin_pata_resources[] = { | |
1390 | { | |
1391 | .start = 0x20314020, | |
1392 | .end = 0x2031403F, | |
1393 | .flags = IORESOURCE_MEM, | |
1394 | }, | |
1395 | { | |
1396 | .start = 0x2031401C, | |
1397 | .end = 0x2031401F, | |
1398 | .flags = IORESOURCE_MEM, | |
1399 | }, | |
1400 | { | |
1401 | .start = PATA_INT, | |
1402 | .end = PATA_INT, | |
1403 | .flags = IORESOURCE_IRQ, | |
1404 | }, | |
1405 | }; | |
2c8beb2c MH |
1406 | #elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE) |
1407 | static struct pata_platform_info bfin_pata_platform_data = { | |
1408 | .ioport_shift = 0, | |
1409 | }; | |
648882d9 MH |
1410 | /* CompactFlash Storage Card Memory Mapped Adressing |
1411 | * /REG = A11 = 1 | |
1412 | */ | |
2c8beb2c MH |
1413 | static struct resource bfin_pata_resources[] = { |
1414 | { | |
648882d9 MH |
1415 | .start = 0x20211800, |
1416 | .end = 0x20211807, | |
2c8beb2c MH |
1417 | .flags = IORESOURCE_MEM, |
1418 | }, | |
1419 | { | |
648882d9 MH |
1420 | .start = 0x2021180E, /* Device Ctl */ |
1421 | .end = 0x2021180E, | |
2c8beb2c MH |
1422 | .flags = IORESOURCE_MEM, |
1423 | }, | |
1424 | }; | |
1425 | #endif | |
c6c4d7bb BW |
1426 | |
1427 | static struct platform_device bfin_pata_device = { | |
1428 | .name = "pata_platform", | |
1429 | .id = -1, | |
1430 | .num_resources = ARRAY_SIZE(bfin_pata_resources), | |
1431 | .resource = bfin_pata_resources, | |
1432 | .dev = { | |
1433 | .platform_data = &bfin_pata_platform_data, | |
1434 | } | |
1435 | }; | |
1436 | #endif | |
1437 | ||
14b03204 MH |
1438 | static const unsigned int cclk_vlev_datasheet[] = |
1439 | { | |
1440 | VRPAIR(VLEV_085, 250000000), | |
1441 | VRPAIR(VLEV_090, 376000000), | |
1442 | VRPAIR(VLEV_095, 426000000), | |
1443 | VRPAIR(VLEV_100, 426000000), | |
1444 | VRPAIR(VLEV_105, 476000000), | |
1445 | VRPAIR(VLEV_110, 476000000), | |
1446 | VRPAIR(VLEV_115, 476000000), | |
1447 | VRPAIR(VLEV_120, 500000000), | |
1448 | VRPAIR(VLEV_125, 533000000), | |
1449 | VRPAIR(VLEV_130, 600000000), | |
1450 | }; | |
1451 | ||
1452 | static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = { | |
1453 | .tuple_tab = cclk_vlev_datasheet, | |
1454 | .tabsize = ARRAY_SIZE(cclk_vlev_datasheet), | |
1455 | .vr_settling_time = 25 /* us */, | |
1456 | }; | |
1457 | ||
1458 | static struct platform_device bfin_dpmc = { | |
1459 | .name = "bfin dpmc", | |
1460 | .dev = { | |
1461 | .platform_data = &bfin_dmpc_vreg_data, | |
1462 | }, | |
1463 | }; | |
1464 | ||
1394f032 | 1465 | static struct platform_device *stamp_devices[] __initdata = { |
14b03204 MH |
1466 | |
1467 | &bfin_dpmc, | |
1468 | ||
1394f032 BW |
1469 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
1470 | &bfin_pcmcia_cf_device, | |
1471 | #endif | |
1472 | ||
1473 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | |
1474 | &rtc_device, | |
1475 | #endif | |
1476 | ||
1477 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) | |
1478 | &sl811_hcd_device, | |
1479 | #endif | |
1480 | ||
1481 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | |
1482 | &isp1362_hcd_device, | |
1483 | #endif | |
1484 | ||
3f375690 MH |
1485 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
1486 | &bfin_isp1760_device, | |
1487 | #endif | |
1488 | ||
1394f032 BW |
1489 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
1490 | &smc91x_device, | |
1491 | #endif | |
1492 | ||
f40d24d9 AL |
1493 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
1494 | &dm9000_device, | |
1495 | #endif | |
1496 | ||
561cc18b MH |
1497 | #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE) |
1498 | &ax88180_device, | |
1499 | #endif | |
1500 | ||
1394f032 | 1501 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
65319628 | 1502 | &bfin_mii_bus, |
1394f032 BW |
1503 | &bfin_mac_device, |
1504 | #endif | |
1505 | ||
1506 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) | |
1507 | &net2272_bfin_device, | |
1508 | #endif | |
1509 | ||
1510 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | |
c6c4d7bb | 1511 | &bfin_spi0_device, |
1394f032 BW |
1512 | #endif |
1513 | ||
1e9aa955 CC |
1514 | #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE) |
1515 | &bfin_sport_spi0_device, | |
1516 | &bfin_sport_spi1_device, | |
1517 | #endif | |
1518 | ||
1394f032 BW |
1519 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
1520 | &bfin_fb_device, | |
1521 | #endif | |
1522 | ||
2043f3f7 MH |
1523 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
1524 | &bfin_lq035q1_device, | |
1525 | #endif | |
1526 | ||
c6c4d7bb BW |
1527 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) |
1528 | &bfin_fb_adv7393_device, | |
1529 | #endif | |
1530 | ||
1394f032 BW |
1531 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
1532 | &bfin_uart_device, | |
1533 | #endif | |
1534 | ||
5be36d22 | 1535 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
42bd8bcb GY |
1536 | #ifdef CONFIG_BFIN_SIR0 |
1537 | &bfin_sir0_device, | |
1538 | #endif | |
1539 | #ifdef CONFIG_BFIN_SIR1 | |
1540 | &bfin_sir1_device, | |
1541 | #endif | |
5be36d22 GY |
1542 | #endif |
1543 | ||
1394f032 BW |
1544 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
1545 | &i2c_bfin_twi_device, | |
1546 | #endif | |
1547 | ||
1548 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | |
1549 | &bfin_sport0_uart_device, | |
1550 | &bfin_sport1_uart_device, | |
1551 | #endif | |
c6c4d7bb BW |
1552 | |
1553 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | |
1554 | &bfin_pata_device, | |
1555 | #endif | |
2463ef22 MH |
1556 | |
1557 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | |
1558 | &bfin_device_gpiokeys, | |
1559 | #endif | |
cad2ab65 MF |
1560 | |
1561 | &bfin_gpios_device, | |
793dc27b | 1562 | |
fc68911e MF |
1563 | #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) |
1564 | &bfin_async_nand_device, | |
1565 | #endif | |
1566 | ||
793dc27b | 1567 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
de8c43f2 | 1568 | &stamp_flash_device, |
793dc27b | 1569 | #endif |
1394f032 BW |
1570 | }; |
1571 | ||
1572 | static int __init stamp_init(void) | |
1573 | { | |
b85d858b | 1574 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
81d9c7f2 BW |
1575 | i2c_register_board_info(0, bfin_i2c_board_info, |
1576 | ARRAY_SIZE(bfin_i2c_board_info)); | |
fc68911e | 1577 | bfin_plat_nand_init(); |
1394f032 | 1578 | platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); |
5bda2723 | 1579 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
c6c4d7bb | 1580 | |
648882d9 MH |
1581 | #if (defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)) \ |
1582 | && defined(PATA_INT) | |
c6c4d7bb BW |
1583 | irq_desc[PATA_INT].status |= IRQ_NOAUTOEN; |
1584 | #endif | |
81d9c7f2 | 1585 | |
1394f032 BW |
1586 | return 0; |
1587 | } | |
1588 | ||
1589 | arch_initcall(stamp_init); | |
c6c4d7bb BW |
1590 | |
1591 | void native_machine_restart(char *cmd) | |
1592 | { | |
1593 | /* workaround reboot hang when booting from SPI */ | |
1594 | if ((bfin_read_SYSCR() & 0x7) == 0x3) | |
b52dae31 | 1595 | bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS); |
c6c4d7bb | 1596 | } |
137b1529 MF |
1597 | |
1598 | /* | |
1599 | * Currently the MAC address is saved in Flash by U-Boot | |
1600 | */ | |
1601 | #define FLASH_MAC 0x203f0000 | |
9862cc52 | 1602 | void bfin_get_ether_addr(char *addr) |
137b1529 MF |
1603 | { |
1604 | *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC); | |
1605 | *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4); | |
1606 | } | |
9862cc52 | 1607 | EXPORT_SYMBOL(bfin_get_ether_addr); |