diff options
author | Eric Miao <eric.y.miao@gmail.com> | 2010-06-20 08:35:32 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-08-05 02:32:20 -0400 |
commit | e478fe4cd50b86e95fadc415438b63fa94060b7d (patch) | |
tree | 20746778b4fd49cd29aa5014c69097262ca5de7a /arch/arm/mach-pxa/eseries.c | |
parent | 09a5358d1ed3e023313e551599bb547edfbf1cbf (diff) |
[ARM] pxa: merge all eseries board code into eseries.c
Cc: Ian Molton <spyro@f2s.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/eseries.c')
-rw-r--r-- | arch/arm/mach-pxa/eseries.c | 809 |
1 files changed, 809 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c index 96ed13081639..1d67f027bea7 100644 --- a/arch/arm/mach-pxa/eseries.c +++ b/arch/arm/mach-pxa/eseries.c | |||
@@ -15,6 +15,13 @@ | |||
15 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
16 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/mfd/tc6387xb.h> | ||
19 | #include <linux/mfd/tc6393xb.h> | ||
20 | #include <linux/mfd/t7l66xb.h> | ||
21 | #include <linux/mtd/nand.h> | ||
22 | #include <linux/mtd/partitions.h> | ||
23 | |||
24 | #include <video/w100fb.h> | ||
18 | 25 | ||
19 | #include <asm/setup.h> | 26 | #include <asm/setup.h> |
20 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
@@ -22,9 +29,12 @@ | |||
22 | 29 | ||
23 | #include <mach/pxa25x.h> | 30 | #include <mach/pxa25x.h> |
24 | #include <mach/eseries-gpio.h> | 31 | #include <mach/eseries-gpio.h> |
32 | #include <mach/audio.h> | ||
33 | #include <mach/pxafb.h> | ||
25 | #include <mach/udc.h> | 34 | #include <mach/udc.h> |
26 | #include <mach/irda.h> | 35 | #include <mach/irda.h> |
27 | 36 | ||
37 | #include "devices.h" | ||
28 | #include "generic.h" | 38 | #include "generic.h" |
29 | #include "clock.h" | 39 | #include "clock.h" |
30 | 40 | ||
@@ -131,3 +141,802 @@ void eseries_register_clks(void) | |||
131 | clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs)); | 141 | clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs)); |
132 | } | 142 | } |
133 | 143 | ||
144 | #ifdef CONFIG_MACH_E330 | ||
145 | /* -------------------- e330 tc6387xb parameters -------------------- */ | ||
146 | |||
147 | static struct tc6387xb_platform_data e330_tc6387xb_info = { | ||
148 | .enable = &eseries_tmio_enable, | ||
149 | .disable = &eseries_tmio_disable, | ||
150 | .suspend = &eseries_tmio_suspend, | ||
151 | .resume = &eseries_tmio_resume, | ||
152 | }; | ||
153 | |||
154 | static struct platform_device e330_tc6387xb_device = { | ||
155 | .name = "tc6387xb", | ||
156 | .id = -1, | ||
157 | .dev = { | ||
158 | .platform_data = &e330_tc6387xb_info, | ||
159 | }, | ||
160 | .num_resources = 2, | ||
161 | .resource = eseries_tmio_resources, | ||
162 | }; | ||
163 | |||
164 | /* --------------------------------------------------------------- */ | ||
165 | |||
166 | static struct platform_device *e330_devices[] __initdata = { | ||
167 | &e330_tc6387xb_device, | ||
168 | }; | ||
169 | |||
170 | static void __init e330_init(void) | ||
171 | { | ||
172 | pxa_set_ffuart_info(NULL); | ||
173 | pxa_set_btuart_info(NULL); | ||
174 | pxa_set_stuart_info(NULL); | ||
175 | eseries_register_clks(); | ||
176 | eseries_get_tmio_gpios(); | ||
177 | platform_add_devices(ARRAY_AND_SIZE(e330_devices)); | ||
178 | pxa_set_udc_info(&e7xx_udc_mach_info); | ||
179 | } | ||
180 | |||
181 | MACHINE_START(E330, "Toshiba e330") | ||
182 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | ||
183 | .phys_io = 0x40000000, | ||
184 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
185 | .boot_params = 0xa0000100, | ||
186 | .map_io = pxa_map_io, | ||
187 | .init_irq = pxa25x_init_irq, | ||
188 | .fixup = eseries_fixup, | ||
189 | .init_machine = e330_init, | ||
190 | .timer = &pxa_timer, | ||
191 | MACHINE_END | ||
192 | #endif | ||
193 | |||
194 | #ifdef CONFIG_MACH_E350 | ||
195 | /* -------------------- e350 t7l66xb parameters -------------------- */ | ||
196 | |||
197 | static struct t7l66xb_platform_data e350_t7l66xb_info = { | ||
198 | .irq_base = IRQ_BOARD_START, | ||
199 | .enable = &eseries_tmio_enable, | ||
200 | .suspend = &eseries_tmio_suspend, | ||
201 | .resume = &eseries_tmio_resume, | ||
202 | }; | ||
203 | |||
204 | static struct platform_device e350_t7l66xb_device = { | ||
205 | .name = "t7l66xb", | ||
206 | .id = -1, | ||
207 | .dev = { | ||
208 | .platform_data = &e350_t7l66xb_info, | ||
209 | }, | ||
210 | .num_resources = 2, | ||
211 | .resource = eseries_tmio_resources, | ||
212 | }; | ||
213 | |||
214 | /* ---------------------------------------------------------- */ | ||
215 | |||
216 | static struct platform_device *e350_devices[] __initdata = { | ||
217 | &e350_t7l66xb_device, | ||
218 | }; | ||
219 | |||
220 | static void __init e350_init(void) | ||
221 | { | ||
222 | pxa_set_ffuart_info(NULL); | ||
223 | pxa_set_btuart_info(NULL); | ||
224 | pxa_set_stuart_info(NULL); | ||
225 | eseries_register_clks(); | ||
226 | eseries_get_tmio_gpios(); | ||
227 | platform_add_devices(ARRAY_AND_SIZE(e350_devices)); | ||
228 | pxa_set_udc_info(&e7xx_udc_mach_info); | ||
229 | } | ||
230 | |||
231 | MACHINE_START(E350, "Toshiba e350") | ||
232 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | ||
233 | .phys_io = 0x40000000, | ||
234 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
235 | .boot_params = 0xa0000100, | ||
236 | .map_io = pxa_map_io, | ||
237 | .init_irq = pxa25x_init_irq, | ||
238 | .fixup = eseries_fixup, | ||
239 | .init_machine = e350_init, | ||
240 | .timer = &pxa_timer, | ||
241 | MACHINE_END | ||
242 | #endif | ||
243 | |||
244 | #ifdef CONFIG_MACH_E400 | ||
245 | /* ------------------------ E400 LCD definitions ------------------------ */ | ||
246 | |||
247 | static struct pxafb_mode_info e400_pxafb_mode_info = { | ||
248 | .pixclock = 140703, | ||
249 | .xres = 240, | ||
250 | .yres = 320, | ||
251 | .bpp = 16, | ||
252 | .hsync_len = 4, | ||
253 | .left_margin = 28, | ||
254 | .right_margin = 8, | ||
255 | .vsync_len = 3, | ||
256 | .upper_margin = 5, | ||
257 | .lower_margin = 6, | ||
258 | .sync = 0, | ||
259 | }; | ||
260 | |||
261 | static struct pxafb_mach_info e400_pxafb_mach_info = { | ||
262 | .modes = &e400_pxafb_mode_info, | ||
263 | .num_modes = 1, | ||
264 | .lcd_conn = LCD_COLOR_TFT_16BPP, | ||
265 | .lccr3 = 0, | ||
266 | .pxafb_backlight_power = NULL, | ||
267 | }; | ||
268 | |||
269 | /* ------------------------ E400 MFP config ----------------------------- */ | ||
270 | |||
271 | static unsigned long e400_pin_config[] __initdata = { | ||
272 | /* Chip selects */ | ||
273 | GPIO15_nCS_1, /* CS1 - Flash */ | ||
274 | GPIO80_nCS_4, /* CS4 - TMIO */ | ||
275 | |||
276 | /* Clocks */ | ||
277 | GPIO12_32KHz, | ||
278 | |||
279 | /* BTUART */ | ||
280 | GPIO42_BTUART_RXD, | ||
281 | GPIO43_BTUART_TXD, | ||
282 | GPIO44_BTUART_CTS, | ||
283 | |||
284 | /* TMIO controller */ | ||
285 | GPIO19_GPIO, /* t7l66xb #PCLR */ | ||
286 | GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */ | ||
287 | |||
288 | /* wakeup */ | ||
289 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, | ||
290 | }; | ||
291 | |||
292 | /* ---------------------------------------------------------------------- */ | ||
293 | |||
294 | static struct mtd_partition partition_a = { | ||
295 | .name = "Internal NAND flash", | ||
296 | .offset = 0, | ||
297 | .size = MTDPART_SIZ_FULL, | ||
298 | }; | ||
299 | |||
300 | static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; | ||
301 | |||
302 | static struct nand_bbt_descr e400_t7l66xb_nand_bbt = { | ||
303 | .options = 0, | ||
304 | .offs = 4, | ||
305 | .len = 2, | ||
306 | .pattern = scan_ff_pattern | ||
307 | }; | ||
308 | |||
309 | static struct tmio_nand_data e400_t7l66xb_nand_config = { | ||
310 | .num_partitions = 1, | ||
311 | .partition = &partition_a, | ||
312 | .badblock_pattern = &e400_t7l66xb_nand_bbt, | ||
313 | }; | ||
314 | |||
315 | static struct t7l66xb_platform_data e400_t7l66xb_info = { | ||
316 | .irq_base = IRQ_BOARD_START, | ||
317 | .enable = &eseries_tmio_enable, | ||
318 | .suspend = &eseries_tmio_suspend, | ||
319 | .resume = &eseries_tmio_resume, | ||
320 | |||
321 | .nand_data = &e400_t7l66xb_nand_config, | ||
322 | }; | ||
323 | |||
324 | static struct platform_device e400_t7l66xb_device = { | ||
325 | .name = "t7l66xb", | ||
326 | .id = -1, | ||
327 | .dev = { | ||
328 | .platform_data = &e400_t7l66xb_info, | ||
329 | }, | ||
330 | .num_resources = 2, | ||
331 | .resource = eseries_tmio_resources, | ||
332 | }; | ||
333 | |||
334 | /* ---------------------------------------------------------- */ | ||
335 | |||
336 | static struct platform_device *e400_devices[] __initdata = { | ||
337 | &e400_t7l66xb_device, | ||
338 | }; | ||
339 | |||
340 | static void __init e400_init(void) | ||
341 | { | ||
342 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config)); | ||
343 | pxa_set_ffuart_info(NULL); | ||
344 | pxa_set_btuart_info(NULL); | ||
345 | pxa_set_stuart_info(NULL); | ||
346 | /* Fixme - e400 may have a switched clock */ | ||
347 | eseries_register_clks(); | ||
348 | eseries_get_tmio_gpios(); | ||
349 | set_pxa_fb_info(&e400_pxafb_mach_info); | ||
350 | platform_add_devices(ARRAY_AND_SIZE(e400_devices)); | ||
351 | pxa_set_udc_info(&e7xx_udc_mach_info); | ||
352 | } | ||
353 | |||
354 | MACHINE_START(E400, "Toshiba e400") | ||
355 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | ||
356 | .phys_io = 0x40000000, | ||
357 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
358 | .boot_params = 0xa0000100, | ||
359 | .map_io = pxa_map_io, | ||
360 | .init_irq = pxa25x_init_irq, | ||
361 | .fixup = eseries_fixup, | ||
362 | .init_machine = e400_init, | ||
363 | .timer = &pxa_timer, | ||
364 | MACHINE_END | ||
365 | #endif | ||
366 | |||
367 | #ifdef CONFIG_MACH_E740 | ||
368 | /* ------------------------ e740 video support --------------------------- */ | ||
369 | |||
370 | static struct w100_gen_regs e740_lcd_regs = { | ||
371 | .lcd_format = 0x00008023, | ||
372 | .lcdd_cntl1 = 0x0f000000, | ||
373 | .lcdd_cntl2 = 0x0003ffff, | ||
374 | .genlcd_cntl1 = 0x00ffff03, | ||
375 | .genlcd_cntl2 = 0x003c0f03, | ||
376 | .genlcd_cntl3 = 0x000143aa, | ||
377 | }; | ||
378 | |||
379 | static struct w100_mode e740_lcd_mode = { | ||
380 | .xres = 240, | ||
381 | .yres = 320, | ||
382 | .left_margin = 20, | ||
383 | .right_margin = 28, | ||
384 | .upper_margin = 9, | ||
385 | .lower_margin = 8, | ||
386 | .crtc_ss = 0x80140013, | ||
387 | .crtc_ls = 0x81150110, | ||
388 | .crtc_gs = 0x80050005, | ||
389 | .crtc_vpos_gs = 0x000a0009, | ||
390 | .crtc_rev = 0x0040010a, | ||
391 | .crtc_dclk = 0xa906000a, | ||
392 | .crtc_gclk = 0x80050108, | ||
393 | .crtc_goe = 0x80050108, | ||
394 | .pll_freq = 57, | ||
395 | .pixclk_divider = 4, | ||
396 | .pixclk_divider_rotated = 4, | ||
397 | .pixclk_src = CLK_SRC_XTAL, | ||
398 | .sysclk_divider = 1, | ||
399 | .sysclk_src = CLK_SRC_PLL, | ||
400 | .crtc_ps1_active = 0x41060010, | ||
401 | }; | ||
402 | |||
403 | static struct w100_gpio_regs e740_w100_gpio_info = { | ||
404 | .init_data1 = 0x21002103, | ||
405 | .gpio_dir1 = 0xffffdeff, | ||
406 | .gpio_oe1 = 0x03c00643, | ||
407 | .init_data2 = 0x003f003f, | ||
408 | .gpio_dir2 = 0xffffffff, | ||
409 | .gpio_oe2 = 0x000000ff, | ||
410 | }; | ||
411 | |||
412 | static struct w100fb_mach_info e740_fb_info = { | ||
413 | .modelist = &e740_lcd_mode, | ||
414 | .num_modes = 1, | ||
415 | .regs = &e740_lcd_regs, | ||
416 | .gpio = &e740_w100_gpio_info, | ||
417 | .xtal_freq = 14318000, | ||
418 | .xtal_dbl = 1, | ||
419 | }; | ||
420 | |||
421 | static struct resource e740_fb_resources[] = { | ||
422 | [0] = { | ||
423 | .start = 0x0c000000, | ||
424 | .end = 0x0cffffff, | ||
425 | .flags = IORESOURCE_MEM, | ||
426 | }, | ||
427 | }; | ||
428 | |||
429 | static struct platform_device e740_fb_device = { | ||
430 | .name = "w100fb", | ||
431 | .id = -1, | ||
432 | .dev = { | ||
433 | .platform_data = &e740_fb_info, | ||
434 | }, | ||
435 | .num_resources = ARRAY_SIZE(e740_fb_resources), | ||
436 | .resource = e740_fb_resources, | ||
437 | }; | ||
438 | |||
439 | /* --------------------------- MFP Pin config -------------------------- */ | ||
440 | |||
441 | static unsigned long e740_pin_config[] __initdata = { | ||
442 | /* Chip selects */ | ||
443 | GPIO15_nCS_1, /* CS1 - Flash */ | ||
444 | GPIO79_nCS_3, /* CS3 - IMAGEON */ | ||
445 | GPIO80_nCS_4, /* CS4 - TMIO */ | ||
446 | |||
447 | /* Clocks */ | ||
448 | GPIO12_32KHz, | ||
449 | |||
450 | /* BTUART */ | ||
451 | GPIO42_BTUART_RXD, | ||
452 | GPIO43_BTUART_TXD, | ||
453 | GPIO44_BTUART_CTS, | ||
454 | |||
455 | /* TMIO controller */ | ||
456 | GPIO19_GPIO, /* t7l66xb #PCLR */ | ||
457 | GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */ | ||
458 | |||
459 | /* UDC */ | ||
460 | GPIO13_GPIO, | ||
461 | GPIO3_GPIO, | ||
462 | |||
463 | /* IrDA */ | ||
464 | GPIO38_GPIO | MFP_LPM_DRIVE_HIGH, | ||
465 | |||
466 | /* AC97 */ | ||
467 | GPIO28_AC97_BITCLK, | ||
468 | GPIO29_AC97_SDATA_IN_0, | ||
469 | GPIO30_AC97_SDATA_OUT, | ||
470 | GPIO31_AC97_SYNC, | ||
471 | |||
472 | /* Audio power control */ | ||
473 | GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */ | ||
474 | GPIO40_GPIO, /* Mic amp power */ | ||
475 | GPIO41_GPIO, /* Headphone amp power */ | ||
476 | |||
477 | /* PC Card */ | ||
478 | GPIO8_GPIO, /* CD0 */ | ||
479 | GPIO44_GPIO, /* CD1 */ | ||
480 | GPIO11_GPIO, /* IRQ0 */ | ||
481 | GPIO6_GPIO, /* IRQ1 */ | ||
482 | GPIO27_GPIO, /* RST0 */ | ||
483 | GPIO24_GPIO, /* RST1 */ | ||
484 | GPIO20_GPIO, /* PWR0 */ | ||
485 | GPIO23_GPIO, /* PWR1 */ | ||
486 | GPIO48_nPOE, | ||
487 | GPIO49_nPWE, | ||
488 | GPIO50_nPIOR, | ||
489 | GPIO51_nPIOW, | ||
490 | GPIO52_nPCE_1, | ||
491 | GPIO53_nPCE_2, | ||
492 | GPIO54_nPSKTSEL, | ||
493 | GPIO55_nPREG, | ||
494 | GPIO56_nPWAIT, | ||
495 | GPIO57_nIOIS16, | ||
496 | |||
497 | /* wakeup */ | ||
498 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, | ||
499 | }; | ||
500 | |||
501 | /* -------------------- e740 t7l66xb parameters -------------------- */ | ||
502 | |||
503 | static struct t7l66xb_platform_data e740_t7l66xb_info = { | ||
504 | .irq_base = IRQ_BOARD_START, | ||
505 | .enable = &eseries_tmio_enable, | ||
506 | .suspend = &eseries_tmio_suspend, | ||
507 | .resume = &eseries_tmio_resume, | ||
508 | }; | ||
509 | |||
510 | static struct platform_device e740_t7l66xb_device = { | ||
511 | .name = "t7l66xb", | ||
512 | .id = -1, | ||
513 | .dev = { | ||
514 | .platform_data = &e740_t7l66xb_info, | ||
515 | }, | ||
516 | .num_resources = 2, | ||
517 | .resource = eseries_tmio_resources, | ||
518 | }; | ||
519 | |||
520 | /* ----------------------------------------------------------------------- */ | ||
521 | |||
522 | static struct platform_device *e740_devices[] __initdata = { | ||
523 | &e740_fb_device, | ||
524 | &e740_t7l66xb_device, | ||
525 | }; | ||
526 | |||
527 | static void __init e740_init(void) | ||
528 | { | ||
529 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config)); | ||
530 | pxa_set_ffuart_info(NULL); | ||
531 | pxa_set_btuart_info(NULL); | ||
532 | pxa_set_stuart_info(NULL); | ||
533 | eseries_register_clks(); | ||
534 | clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name, | ||
535 | "UDCCLK", &pxa25x_device_udc.dev), | ||
536 | eseries_get_tmio_gpios(); | ||
537 | platform_add_devices(ARRAY_AND_SIZE(e740_devices)); | ||
538 | pxa_set_udc_info(&e7xx_udc_mach_info); | ||
539 | pxa_set_ac97_info(NULL); | ||
540 | pxa_set_ficp_info(&e7xx_ficp_platform_data); | ||
541 | } | ||
542 | |||
543 | MACHINE_START(E740, "Toshiba e740") | ||
544 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | ||
545 | .phys_io = 0x40000000, | ||
546 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
547 | .boot_params = 0xa0000100, | ||
548 | .map_io = pxa_map_io, | ||
549 | .init_irq = pxa25x_init_irq, | ||
550 | .fixup = eseries_fixup, | ||
551 | .init_machine = e740_init, | ||
552 | .timer = &pxa_timer, | ||
553 | MACHINE_END | ||
554 | #endif | ||
555 | |||
556 | #ifdef CONFIG_MACH_E750 | ||
557 | /* ---------------------- E750 LCD definitions -------------------- */ | ||
558 | |||
559 | static struct w100_gen_regs e750_lcd_regs = { | ||
560 | .lcd_format = 0x00008003, | ||
561 | .lcdd_cntl1 = 0x00000000, | ||
562 | .lcdd_cntl2 = 0x0003ffff, | ||
563 | .genlcd_cntl1 = 0x00fff003, | ||
564 | .genlcd_cntl2 = 0x003c0f03, | ||
565 | .genlcd_cntl3 = 0x000143aa, | ||
566 | }; | ||
567 | |||
568 | static struct w100_mode e750_lcd_mode = { | ||
569 | .xres = 240, | ||
570 | .yres = 320, | ||
571 | .left_margin = 21, | ||
572 | .right_margin = 22, | ||
573 | .upper_margin = 5, | ||
574 | .lower_margin = 4, | ||
575 | .crtc_ss = 0x80150014, | ||
576 | .crtc_ls = 0x8014000d, | ||
577 | .crtc_gs = 0xc1000005, | ||
578 | .crtc_vpos_gs = 0x00020147, | ||
579 | .crtc_rev = 0x0040010a, | ||
580 | .crtc_dclk = 0xa1700030, | ||
581 | .crtc_gclk = 0x80cc0015, | ||
582 | .crtc_goe = 0x80cc0015, | ||
583 | .crtc_ps1_active = 0x61060017, | ||
584 | .pll_freq = 57, | ||
585 | .pixclk_divider = 4, | ||
586 | .pixclk_divider_rotated = 4, | ||
587 | .pixclk_src = CLK_SRC_XTAL, | ||
588 | .sysclk_divider = 1, | ||
589 | .sysclk_src = CLK_SRC_PLL, | ||
590 | }; | ||
591 | |||
592 | static struct w100_gpio_regs e750_w100_gpio_info = { | ||
593 | .init_data1 = 0x01192f1b, | ||
594 | .gpio_dir1 = 0xd5ffdeff, | ||
595 | .gpio_oe1 = 0x000020bf, | ||
596 | .init_data2 = 0x010f010f, | ||
597 | .gpio_dir2 = 0xffffffff, | ||
598 | .gpio_oe2 = 0x000001cf, | ||
599 | }; | ||
600 | |||
601 | static struct w100fb_mach_info e750_fb_info = { | ||
602 | .modelist = &e750_lcd_mode, | ||
603 | .num_modes = 1, | ||
604 | .regs = &e750_lcd_regs, | ||
605 | .gpio = &e750_w100_gpio_info, | ||
606 | .xtal_freq = 14318000, | ||
607 | .xtal_dbl = 1, | ||
608 | }; | ||
609 | |||
610 | static struct resource e750_fb_resources[] = { | ||
611 | [0] = { | ||
612 | .start = 0x0c000000, | ||
613 | .end = 0x0cffffff, | ||
614 | .flags = IORESOURCE_MEM, | ||
615 | }, | ||
616 | }; | ||
617 | |||
618 | static struct platform_device e750_fb_device = { | ||
619 | .name = "w100fb", | ||
620 | .id = -1, | ||
621 | .dev = { | ||
622 | .platform_data = &e750_fb_info, | ||
623 | }, | ||
624 | .num_resources = ARRAY_SIZE(e750_fb_resources), | ||
625 | .resource = e750_fb_resources, | ||
626 | }; | ||
627 | |||
628 | /* -------------------- e750 MFP parameters -------------------- */ | ||
629 | |||
630 | static unsigned long e750_pin_config[] __initdata = { | ||
631 | /* Chip selects */ | ||
632 | GPIO15_nCS_1, /* CS1 - Flash */ | ||
633 | GPIO79_nCS_3, /* CS3 - IMAGEON */ | ||
634 | GPIO80_nCS_4, /* CS4 - TMIO */ | ||
635 | |||
636 | /* Clocks */ | ||
637 | GPIO11_3_6MHz, | ||
638 | |||
639 | /* BTUART */ | ||
640 | GPIO42_BTUART_RXD, | ||
641 | GPIO43_BTUART_TXD, | ||
642 | GPIO44_BTUART_CTS, | ||
643 | |||
644 | /* TMIO controller */ | ||
645 | GPIO19_GPIO, /* t7l66xb #PCLR */ | ||
646 | GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */ | ||
647 | |||
648 | /* UDC */ | ||
649 | GPIO13_GPIO, | ||
650 | GPIO3_GPIO, | ||
651 | |||
652 | /* IrDA */ | ||
653 | GPIO38_GPIO | MFP_LPM_DRIVE_HIGH, | ||
654 | |||
655 | /* AC97 */ | ||
656 | GPIO28_AC97_BITCLK, | ||
657 | GPIO29_AC97_SDATA_IN_0, | ||
658 | GPIO30_AC97_SDATA_OUT, | ||
659 | GPIO31_AC97_SYNC, | ||
660 | |||
661 | /* Audio power control */ | ||
662 | GPIO4_GPIO, /* Headphone amp power */ | ||
663 | GPIO7_GPIO, /* Speaker amp power */ | ||
664 | GPIO37_GPIO, /* Headphone detect */ | ||
665 | |||
666 | /* PC Card */ | ||
667 | GPIO8_GPIO, /* CD0 */ | ||
668 | GPIO44_GPIO, /* CD1 */ | ||
669 | GPIO11_GPIO, /* IRQ0 */ | ||
670 | GPIO6_GPIO, /* IRQ1 */ | ||
671 | GPIO27_GPIO, /* RST0 */ | ||
672 | GPIO24_GPIO, /* RST1 */ | ||
673 | GPIO20_GPIO, /* PWR0 */ | ||
674 | GPIO23_GPIO, /* PWR1 */ | ||
675 | GPIO48_nPOE, | ||
676 | GPIO49_nPWE, | ||
677 | GPIO50_nPIOR, | ||
678 | GPIO51_nPIOW, | ||
679 | GPIO52_nPCE_1, | ||
680 | GPIO53_nPCE_2, | ||
681 | GPIO54_nPSKTSEL, | ||
682 | GPIO55_nPREG, | ||
683 | GPIO56_nPWAIT, | ||
684 | GPIO57_nIOIS16, | ||
685 | |||
686 | /* wakeup */ | ||
687 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, | ||
688 | }; | ||
689 | |||
690 | /* ----------------- e750 tc6393xb parameters ------------------ */ | ||
691 | |||
692 | static struct tc6393xb_platform_data e750_tc6393xb_info = { | ||
693 | .irq_base = IRQ_BOARD_START, | ||
694 | .scr_pll2cr = 0x0cc1, | ||
695 | .scr_gper = 0, | ||
696 | .gpio_base = -1, | ||
697 | .suspend = &eseries_tmio_suspend, | ||
698 | .resume = &eseries_tmio_resume, | ||
699 | .enable = &eseries_tmio_enable, | ||
700 | .disable = &eseries_tmio_disable, | ||
701 | }; | ||
702 | |||
703 | static struct platform_device e750_tc6393xb_device = { | ||
704 | .name = "tc6393xb", | ||
705 | .id = -1, | ||
706 | .dev = { | ||
707 | .platform_data = &e750_tc6393xb_info, | ||
708 | }, | ||
709 | .num_resources = 2, | ||
710 | .resource = eseries_tmio_resources, | ||
711 | }; | ||
712 | |||
713 | /* ------------------------------------------------------------- */ | ||
714 | |||
715 | static struct platform_device *e750_devices[] __initdata = { | ||
716 | &e750_fb_device, | ||
717 | &e750_tc6393xb_device, | ||
718 | }; | ||
719 | |||
720 | static void __init e750_init(void) | ||
721 | { | ||
722 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config)); | ||
723 | pxa_set_ffuart_info(NULL); | ||
724 | pxa_set_btuart_info(NULL); | ||
725 | pxa_set_stuart_info(NULL); | ||
726 | clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name, | ||
727 | "GPIO11_CLK", NULL), | ||
728 | eseries_get_tmio_gpios(); | ||
729 | platform_add_devices(ARRAY_AND_SIZE(e750_devices)); | ||
730 | pxa_set_udc_info(&e7xx_udc_mach_info); | ||
731 | pxa_set_ac97_info(NULL); | ||
732 | pxa_set_ficp_info(&e7xx_ficp_platform_data); | ||
733 | } | ||
734 | |||
735 | MACHINE_START(E750, "Toshiba e750") | ||
736 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | ||
737 | .phys_io = 0x40000000, | ||
738 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
739 | .boot_params = 0xa0000100, | ||
740 | .map_io = pxa_map_io, | ||
741 | .init_irq = pxa25x_init_irq, | ||
742 | .fixup = eseries_fixup, | ||
743 | .init_machine = e750_init, | ||
744 | .timer = &pxa_timer, | ||
745 | MACHINE_END | ||
746 | #endif | ||
747 | |||
748 | #ifdef CONFIG_MACH_E800 | ||
749 | /* ------------------------ e800 LCD definitions ------------------------- */ | ||
750 | |||
751 | static unsigned long e800_pin_config[] __initdata = { | ||
752 | /* AC97 */ | ||
753 | GPIO28_AC97_BITCLK, | ||
754 | GPIO29_AC97_SDATA_IN_0, | ||
755 | GPIO30_AC97_SDATA_OUT, | ||
756 | GPIO31_AC97_SYNC, | ||
757 | }; | ||
758 | |||
759 | static struct w100_gen_regs e800_lcd_regs = { | ||
760 | .lcd_format = 0x00008003, | ||
761 | .lcdd_cntl1 = 0x02a00000, | ||
762 | .lcdd_cntl2 = 0x0003ffff, | ||
763 | .genlcd_cntl1 = 0x000ff2a3, | ||
764 | .genlcd_cntl2 = 0x000002a3, | ||
765 | .genlcd_cntl3 = 0x000102aa, | ||
766 | }; | ||
767 | |||
768 | static struct w100_mode e800_lcd_mode[2] = { | ||
769 | [0] = { | ||
770 | .xres = 480, | ||
771 | .yres = 640, | ||
772 | .left_margin = 52, | ||
773 | .right_margin = 148, | ||
774 | .upper_margin = 2, | ||
775 | .lower_margin = 6, | ||
776 | .crtc_ss = 0x80350034, | ||
777 | .crtc_ls = 0x802b0026, | ||
778 | .crtc_gs = 0x80160016, | ||
779 | .crtc_vpos_gs = 0x00020003, | ||
780 | .crtc_rev = 0x0040001d, | ||
781 | .crtc_dclk = 0xe0000000, | ||
782 | .crtc_gclk = 0x82a50049, | ||
783 | .crtc_goe = 0x80ee001c, | ||
784 | .crtc_ps1_active = 0x00000000, | ||
785 | .pll_freq = 128, | ||
786 | .pixclk_divider = 4, | ||
787 | .pixclk_divider_rotated = 6, | ||
788 | .pixclk_src = CLK_SRC_PLL, | ||
789 | .sysclk_divider = 0, | ||
790 | .sysclk_src = CLK_SRC_PLL, | ||
791 | }, | ||
792 | [1] = { | ||
793 | .xres = 240, | ||
794 | .yres = 320, | ||
795 | .left_margin = 15, | ||
796 | .right_margin = 88, | ||
797 | .upper_margin = 0, | ||
798 | .lower_margin = 7, | ||
799 | .crtc_ss = 0xd010000f, | ||
800 | .crtc_ls = 0x80070003, | ||
801 | .crtc_gs = 0x80000000, | ||
802 | .crtc_vpos_gs = 0x01460147, | ||
803 | .crtc_rev = 0x00400003, | ||
804 | .crtc_dclk = 0xa1700030, | ||
805 | .crtc_gclk = 0x814b0008, | ||
806 | .crtc_goe = 0x80cc0015, | ||
807 | .crtc_ps1_active = 0x00000000, | ||
808 | .pll_freq = 100, | ||
809 | .pixclk_divider = 6, /* Wince uses 14 which gives a */ | ||
810 | .pixclk_divider_rotated = 6, /* 7MHz Pclk. We use a 14MHz one */ | ||
811 | .pixclk_src = CLK_SRC_PLL, | ||
812 | .sysclk_divider = 0, | ||
813 | .sysclk_src = CLK_SRC_PLL, | ||
814 | } | ||
815 | }; | ||
816 | |||
817 | |||
818 | static struct w100_gpio_regs e800_w100_gpio_info = { | ||
819 | .init_data1 = 0xc13fc019, | ||
820 | .gpio_dir1 = 0x3e40df7f, | ||
821 | .gpio_oe1 = 0x003c3000, | ||
822 | .init_data2 = 0x00000000, | ||
823 | .gpio_dir2 = 0x00000000, | ||
824 | .gpio_oe2 = 0x00000000, | ||
825 | }; | ||
826 | |||
827 | static struct w100_mem_info e800_w100_mem_info = { | ||
828 | .ext_cntl = 0x09640011, | ||
829 | .sdram_mode_reg = 0x00600021, | ||
830 | .ext_timing_cntl = 0x10001545, | ||
831 | .io_cntl = 0x7ddd7333, | ||
832 | .size = 0x1fffff, | ||
833 | }; | ||
834 | |||
835 | static void e800_tg_change(struct w100fb_par *par) | ||
836 | { | ||
837 | unsigned long tmp; | ||
838 | |||
839 | tmp = w100fb_gpio_read(W100_GPIO_PORT_A); | ||
840 | if (par->mode->xres == 480) | ||
841 | tmp |= 0x100; | ||
842 | else | ||
843 | tmp &= ~0x100; | ||
844 | w100fb_gpio_write(W100_GPIO_PORT_A, tmp); | ||
845 | } | ||
846 | |||
847 | static struct w100_tg_info e800_tg_info = { | ||
848 | .change = e800_tg_change, | ||
849 | }; | ||
850 | |||
851 | static struct w100fb_mach_info e800_fb_info = { | ||
852 | .modelist = e800_lcd_mode, | ||
853 | .num_modes = 2, | ||
854 | .regs = &e800_lcd_regs, | ||
855 | .gpio = &e800_w100_gpio_info, | ||
856 | .mem = &e800_w100_mem_info, | ||
857 | .tg = &e800_tg_info, | ||
858 | .xtal_freq = 16000000, | ||
859 | }; | ||
860 | |||
861 | static struct resource e800_fb_resources[] = { | ||
862 | [0] = { | ||
863 | .start = 0x0c000000, | ||
864 | .end = 0x0cffffff, | ||
865 | .flags = IORESOURCE_MEM, | ||
866 | }, | ||
867 | }; | ||
868 | |||
869 | static struct platform_device e800_fb_device = { | ||
870 | .name = "w100fb", | ||
871 | .id = -1, | ||
872 | .dev = { | ||
873 | .platform_data = &e800_fb_info, | ||
874 | }, | ||
875 | .num_resources = ARRAY_SIZE(e800_fb_resources), | ||
876 | .resource = e800_fb_resources, | ||
877 | }; | ||
878 | |||
879 | /* --------------------------- UDC definitions --------------------------- */ | ||
880 | |||
881 | static struct pxa2xx_udc_mach_info e800_udc_mach_info = { | ||
882 | .gpio_vbus = GPIO_E800_USB_DISC, | ||
883 | .gpio_pullup = GPIO_E800_USB_PULLUP, | ||
884 | .gpio_pullup_inverted = 1 | ||
885 | }; | ||
886 | |||
887 | /* ----------------- e800 tc6393xb parameters ------------------ */ | ||
888 | |||
889 | static struct tc6393xb_platform_data e800_tc6393xb_info = { | ||
890 | .irq_base = IRQ_BOARD_START, | ||
891 | .scr_pll2cr = 0x0cc1, | ||
892 | .scr_gper = 0, | ||
893 | .gpio_base = -1, | ||
894 | .suspend = &eseries_tmio_suspend, | ||
895 | .resume = &eseries_tmio_resume, | ||
896 | .enable = &eseries_tmio_enable, | ||
897 | .disable = &eseries_tmio_disable, | ||
898 | }; | ||
899 | |||
900 | static struct platform_device e800_tc6393xb_device = { | ||
901 | .name = "tc6393xb", | ||
902 | .id = -1, | ||
903 | .dev = { | ||
904 | .platform_data = &e800_tc6393xb_info, | ||
905 | }, | ||
906 | .num_resources = 2, | ||
907 | .resource = eseries_tmio_resources, | ||
908 | }; | ||
909 | |||
910 | /* ----------------------------------------------------------------------- */ | ||
911 | |||
912 | static struct platform_device *e800_devices[] __initdata = { | ||
913 | &e800_fb_device, | ||
914 | &e800_tc6393xb_device, | ||
915 | }; | ||
916 | |||
917 | static void __init e800_init(void) | ||
918 | { | ||
919 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e800_pin_config)); | ||
920 | pxa_set_ffuart_info(NULL); | ||
921 | pxa_set_btuart_info(NULL); | ||
922 | pxa_set_stuart_info(NULL); | ||
923 | clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name, | ||
924 | "GPIO11_CLK", NULL), | ||
925 | eseries_get_tmio_gpios(); | ||
926 | platform_add_devices(ARRAY_AND_SIZE(e800_devices)); | ||
927 | pxa_set_udc_info(&e800_udc_mach_info); | ||
928 | pxa_set_ac97_info(NULL); | ||
929 | } | ||
930 | |||
931 | MACHINE_START(E800, "Toshiba e800") | ||
932 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | ||
933 | .phys_io = 0x40000000, | ||
934 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
935 | .boot_params = 0xa0000100, | ||
936 | .map_io = pxa_map_io, | ||
937 | .init_irq = pxa25x_init_irq, | ||
938 | .fixup = eseries_fixup, | ||
939 | .init_machine = e800_init, | ||
940 | .timer = &pxa_timer, | ||
941 | MACHINE_END | ||
942 | #endif | ||