GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / arm / mach-pxa / eseries.c
blob20c99d0029f05f2d892d9167e03adbe11082a374
1 /*
2 * Hardware definitions for the Toshiba eseries PDAs
4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
6 * This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/gpio.h>
16 #include <linux/delay.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>
24 #include <video/w100fb.h>
26 #include <asm/setup.h>
27 #include <asm/mach/arch.h>
28 #include <asm/mach-types.h>
30 #include <mach/pxa25x.h>
31 #include <mach/eseries-gpio.h>
32 #include <mach/audio.h>
33 #include <mach/pxafb.h>
34 #include <mach/udc.h>
35 #include <mach/irda.h>
37 #include "devices.h"
38 #include "generic.h"
39 #include "clock.h"
41 /* Only e800 has 128MB RAM */
42 void __init eseries_fixup(struct machine_desc *desc,
43 struct tag *tags, char **cmdline, struct meminfo *mi)
45 mi->nr_banks=1;
46 mi->bank[0].start = 0xa0000000;
47 if (machine_is_e800())
48 mi->bank[0].size = (128*1024*1024);
49 else
50 mi->bank[0].size = (64*1024*1024);
53 struct pxa2xx_udc_mach_info e7xx_udc_mach_info = {
54 .gpio_vbus = GPIO_E7XX_USB_DISC,
55 .gpio_pullup = GPIO_E7XX_USB_PULLUP,
56 .gpio_pullup_inverted = 1
59 struct pxaficp_platform_data e7xx_ficp_platform_data = {
60 .gpio_pwdown = GPIO_E7XX_IR_OFF,
61 .transceiver_cap = IR_SIRMODE | IR_OFF,
64 int eseries_tmio_enable(struct platform_device *dev)
66 /* Reset - bring SUSPEND high before PCLR */
67 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
68 gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
69 msleep(1);
70 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
71 msleep(1);
72 gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 1);
73 msleep(1);
74 return 0;
77 int eseries_tmio_disable(struct platform_device *dev)
79 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
80 gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
81 return 0;
84 int eseries_tmio_suspend(struct platform_device *dev)
86 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
87 return 0;
90 int eseries_tmio_resume(struct platform_device *dev)
92 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
93 msleep(1);
94 return 0;
97 void eseries_get_tmio_gpios(void)
99 gpio_request(GPIO_ESERIES_TMIO_SUSPEND, NULL);
100 gpio_request(GPIO_ESERIES_TMIO_PCLR, NULL);
101 gpio_direction_output(GPIO_ESERIES_TMIO_SUSPEND, 0);
102 gpio_direction_output(GPIO_ESERIES_TMIO_PCLR, 0);
105 /* TMIO controller uses the same resources on all e-series machines. */
106 struct resource eseries_tmio_resources[] = {
107 [0] = {
108 .start = PXA_CS4_PHYS,
109 .end = PXA_CS4_PHYS + 0x1fffff,
110 .flags = IORESOURCE_MEM,
112 [1] = {
113 .start = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ),
114 .end = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ),
115 .flags = IORESOURCE_IRQ,
119 /* Some e-series hardware cannot control the 32K clock */
120 static void clk_32k_dummy(struct clk *clk)
124 static const struct clkops clk_32k_dummy_ops = {
125 .enable = clk_32k_dummy,
126 .disable = clk_32k_dummy,
129 static struct clk tmio_dummy_clk = {
130 .ops = &clk_32k_dummy_ops,
131 .rate = 32768,
134 static struct clk_lookup eseries_clkregs[] = {
135 INIT_CLKREG(&tmio_dummy_clk, NULL, "CLK_CK32K"),
138 void eseries_register_clks(void)
140 clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs));
143 #ifdef CONFIG_MACH_E330
144 /* -------------------- e330 tc6387xb parameters -------------------- */
146 static struct tc6387xb_platform_data e330_tc6387xb_info = {
147 .enable = &eseries_tmio_enable,
148 .disable = &eseries_tmio_disable,
149 .suspend = &eseries_tmio_suspend,
150 .resume = &eseries_tmio_resume,
153 static struct platform_device e330_tc6387xb_device = {
154 .name = "tc6387xb",
155 .id = -1,
156 .dev = {
157 .platform_data = &e330_tc6387xb_info,
159 .num_resources = 2,
160 .resource = eseries_tmio_resources,
163 /* --------------------------------------------------------------- */
165 static struct platform_device *e330_devices[] __initdata = {
166 &e330_tc6387xb_device,
169 static void __init e330_init(void)
171 pxa_set_ffuart_info(NULL);
172 pxa_set_btuart_info(NULL);
173 pxa_set_stuart_info(NULL);
174 eseries_register_clks();
175 eseries_get_tmio_gpios();
176 platform_add_devices(ARRAY_AND_SIZE(e330_devices));
177 pxa_set_udc_info(&e7xx_udc_mach_info);
180 MACHINE_START(E330, "Toshiba e330")
181 /* Maintainer: Ian Molton (spyro@f2s.com) */
182 .phys_io = 0x40000000,
183 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
184 .boot_params = 0xa0000100,
185 .map_io = pxa_map_io,
186 .init_irq = pxa25x_init_irq,
187 .fixup = eseries_fixup,
188 .init_machine = e330_init,
189 .timer = &pxa_timer,
190 MACHINE_END
191 #endif
193 #ifdef CONFIG_MACH_E350
194 /* -------------------- e350 t7l66xb parameters -------------------- */
196 static struct t7l66xb_platform_data e350_t7l66xb_info = {
197 .irq_base = IRQ_BOARD_START,
198 .enable = &eseries_tmio_enable,
199 .suspend = &eseries_tmio_suspend,
200 .resume = &eseries_tmio_resume,
203 static struct platform_device e350_t7l66xb_device = {
204 .name = "t7l66xb",
205 .id = -1,
206 .dev = {
207 .platform_data = &e350_t7l66xb_info,
209 .num_resources = 2,
210 .resource = eseries_tmio_resources,
213 /* ---------------------------------------------------------- */
215 static struct platform_device *e350_devices[] __initdata = {
216 &e350_t7l66xb_device,
219 static void __init e350_init(void)
221 pxa_set_ffuart_info(NULL);
222 pxa_set_btuart_info(NULL);
223 pxa_set_stuart_info(NULL);
224 eseries_register_clks();
225 eseries_get_tmio_gpios();
226 platform_add_devices(ARRAY_AND_SIZE(e350_devices));
227 pxa_set_udc_info(&e7xx_udc_mach_info);
230 MACHINE_START(E350, "Toshiba e350")
231 /* Maintainer: Ian Molton (spyro@f2s.com) */
232 .phys_io = 0x40000000,
233 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
234 .boot_params = 0xa0000100,
235 .map_io = pxa_map_io,
236 .init_irq = pxa25x_init_irq,
237 .fixup = eseries_fixup,
238 .init_machine = e350_init,
239 .timer = &pxa_timer,
240 MACHINE_END
241 #endif
243 #ifdef CONFIG_MACH_E400
244 /* ------------------------ E400 LCD definitions ------------------------ */
246 static struct pxafb_mode_info e400_pxafb_mode_info = {
247 .pixclock = 140703,
248 .xres = 240,
249 .yres = 320,
250 .bpp = 16,
251 .hsync_len = 4,
252 .left_margin = 28,
253 .right_margin = 8,
254 .vsync_len = 3,
255 .upper_margin = 5,
256 .lower_margin = 6,
257 .sync = 0,
260 static struct pxafb_mach_info e400_pxafb_mach_info = {
261 .modes = &e400_pxafb_mode_info,
262 .num_modes = 1,
263 .lcd_conn = LCD_COLOR_TFT_16BPP,
264 .lccr3 = 0,
265 .pxafb_backlight_power = NULL,
268 /* ------------------------ E400 MFP config ----------------------------- */
270 static unsigned long e400_pin_config[] __initdata = {
271 /* Chip selects */
272 GPIO15_nCS_1, /* CS1 - Flash */
273 GPIO80_nCS_4, /* CS4 - TMIO */
275 /* Clocks */
276 GPIO12_32KHz,
278 /* BTUART */
279 GPIO42_BTUART_RXD,
280 GPIO43_BTUART_TXD,
281 GPIO44_BTUART_CTS,
283 /* TMIO controller */
284 GPIO19_GPIO, /* t7l66xb #PCLR */
285 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
287 /* wakeup */
288 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
291 /* ---------------------------------------------------------------------- */
293 static struct mtd_partition partition_a = {
294 .name = "Internal NAND flash",
295 .offset = 0,
296 .size = MTDPART_SIZ_FULL,
299 static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
301 static struct nand_bbt_descr e400_t7l66xb_nand_bbt = {
302 .options = 0,
303 .offs = 4,
304 .len = 2,
305 .pattern = scan_ff_pattern
308 static struct tmio_nand_data e400_t7l66xb_nand_config = {
309 .num_partitions = 1,
310 .partition = &partition_a,
311 .badblock_pattern = &e400_t7l66xb_nand_bbt,
314 static struct t7l66xb_platform_data e400_t7l66xb_info = {
315 .irq_base = IRQ_BOARD_START,
316 .enable = &eseries_tmio_enable,
317 .suspend = &eseries_tmio_suspend,
318 .resume = &eseries_tmio_resume,
320 .nand_data = &e400_t7l66xb_nand_config,
323 static struct platform_device e400_t7l66xb_device = {
324 .name = "t7l66xb",
325 .id = -1,
326 .dev = {
327 .platform_data = &e400_t7l66xb_info,
329 .num_resources = 2,
330 .resource = eseries_tmio_resources,
333 /* ---------------------------------------------------------- */
335 static struct platform_device *e400_devices[] __initdata = {
336 &e400_t7l66xb_device,
339 static void __init e400_init(void)
341 pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config));
342 pxa_set_ffuart_info(NULL);
343 pxa_set_btuart_info(NULL);
344 pxa_set_stuart_info(NULL);
345 eseries_register_clks();
346 eseries_get_tmio_gpios();
347 set_pxa_fb_info(&e400_pxafb_mach_info);
348 platform_add_devices(ARRAY_AND_SIZE(e400_devices));
349 pxa_set_udc_info(&e7xx_udc_mach_info);
352 MACHINE_START(E400, "Toshiba e400")
353 /* Maintainer: Ian Molton (spyro@f2s.com) */
354 .phys_io = 0x40000000,
355 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
356 .boot_params = 0xa0000100,
357 .map_io = pxa_map_io,
358 .init_irq = pxa25x_init_irq,
359 .fixup = eseries_fixup,
360 .init_machine = e400_init,
361 .timer = &pxa_timer,
362 MACHINE_END
363 #endif
365 #ifdef CONFIG_MACH_E740
366 /* ------------------------ e740 video support --------------------------- */
368 static struct w100_gen_regs e740_lcd_regs = {
369 .lcd_format = 0x00008023,
370 .lcdd_cntl1 = 0x0f000000,
371 .lcdd_cntl2 = 0x0003ffff,
372 .genlcd_cntl1 = 0x00ffff03,
373 .genlcd_cntl2 = 0x003c0f03,
374 .genlcd_cntl3 = 0x000143aa,
377 static struct w100_mode e740_lcd_mode = {
378 .xres = 240,
379 .yres = 320,
380 .left_margin = 20,
381 .right_margin = 28,
382 .upper_margin = 9,
383 .lower_margin = 8,
384 .crtc_ss = 0x80140013,
385 .crtc_ls = 0x81150110,
386 .crtc_gs = 0x80050005,
387 .crtc_vpos_gs = 0x000a0009,
388 .crtc_rev = 0x0040010a,
389 .crtc_dclk = 0xa906000a,
390 .crtc_gclk = 0x80050108,
391 .crtc_goe = 0x80050108,
392 .pll_freq = 57,
393 .pixclk_divider = 4,
394 .pixclk_divider_rotated = 4,
395 .pixclk_src = CLK_SRC_XTAL,
396 .sysclk_divider = 1,
397 .sysclk_src = CLK_SRC_PLL,
398 .crtc_ps1_active = 0x41060010,
401 static struct w100_gpio_regs e740_w100_gpio_info = {
402 .init_data1 = 0x21002103,
403 .gpio_dir1 = 0xffffdeff,
404 .gpio_oe1 = 0x03c00643,
405 .init_data2 = 0x003f003f,
406 .gpio_dir2 = 0xffffffff,
407 .gpio_oe2 = 0x000000ff,
410 static struct w100fb_mach_info e740_fb_info = {
411 .modelist = &e740_lcd_mode,
412 .num_modes = 1,
413 .regs = &e740_lcd_regs,
414 .gpio = &e740_w100_gpio_info,
415 .xtal_freq = 14318000,
416 .xtal_dbl = 1,
419 static struct resource e740_fb_resources[] = {
420 [0] = {
421 .start = 0x0c000000,
422 .end = 0x0cffffff,
423 .flags = IORESOURCE_MEM,
427 static struct platform_device e740_fb_device = {
428 .name = "w100fb",
429 .id = -1,
430 .dev = {
431 .platform_data = &e740_fb_info,
433 .num_resources = ARRAY_SIZE(e740_fb_resources),
434 .resource = e740_fb_resources,
437 /* --------------------------- MFP Pin config -------------------------- */
439 static unsigned long e740_pin_config[] __initdata = {
440 /* Chip selects */
441 GPIO15_nCS_1, /* CS1 - Flash */
442 GPIO79_nCS_3, /* CS3 - IMAGEON */
443 GPIO80_nCS_4, /* CS4 - TMIO */
445 /* Clocks */
446 GPIO12_32KHz,
448 /* BTUART */
449 GPIO42_BTUART_RXD,
450 GPIO43_BTUART_TXD,
451 GPIO44_BTUART_CTS,
453 /* TMIO controller */
454 GPIO19_GPIO, /* t7l66xb #PCLR */
455 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
457 /* UDC */
458 GPIO13_GPIO,
459 GPIO3_GPIO,
461 /* IrDA */
462 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
464 /* AC97 */
465 GPIO28_AC97_BITCLK,
466 GPIO29_AC97_SDATA_IN_0,
467 GPIO30_AC97_SDATA_OUT,
468 GPIO31_AC97_SYNC,
470 /* Audio power control */
471 GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
472 GPIO40_GPIO, /* Mic amp power */
473 GPIO41_GPIO, /* Headphone amp power */
475 /* PC Card */
476 GPIO8_GPIO, /* CD0 */
477 GPIO44_GPIO, /* CD1 */
478 GPIO11_GPIO, /* IRQ0 */
479 GPIO6_GPIO, /* IRQ1 */
480 GPIO27_GPIO, /* RST0 */
481 GPIO24_GPIO, /* RST1 */
482 GPIO20_GPIO, /* PWR0 */
483 GPIO23_GPIO, /* PWR1 */
484 GPIO48_nPOE,
485 GPIO49_nPWE,
486 GPIO50_nPIOR,
487 GPIO51_nPIOW,
488 GPIO52_nPCE_1,
489 GPIO53_nPCE_2,
490 GPIO54_nPSKTSEL,
491 GPIO55_nPREG,
492 GPIO56_nPWAIT,
493 GPIO57_nIOIS16,
495 /* wakeup */
496 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
499 /* -------------------- e740 t7l66xb parameters -------------------- */
501 static struct t7l66xb_platform_data e740_t7l66xb_info = {
502 .irq_base = IRQ_BOARD_START,
503 .enable = &eseries_tmio_enable,
504 .suspend = &eseries_tmio_suspend,
505 .resume = &eseries_tmio_resume,
508 static struct platform_device e740_t7l66xb_device = {
509 .name = "t7l66xb",
510 .id = -1,
511 .dev = {
512 .platform_data = &e740_t7l66xb_info,
514 .num_resources = 2,
515 .resource = eseries_tmio_resources,
518 /* ----------------------------------------------------------------------- */
520 static struct platform_device *e740_devices[] __initdata = {
521 &e740_fb_device,
522 &e740_t7l66xb_device,
525 static void __init e740_init(void)
527 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
528 pxa_set_ffuart_info(NULL);
529 pxa_set_btuart_info(NULL);
530 pxa_set_stuart_info(NULL);
531 eseries_register_clks();
532 clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
533 "UDCCLK", &pxa25x_device_udc.dev),
534 eseries_get_tmio_gpios();
535 platform_add_devices(ARRAY_AND_SIZE(e740_devices));
536 pxa_set_udc_info(&e7xx_udc_mach_info);
537 pxa_set_ac97_info(NULL);
538 pxa_set_ficp_info(&e7xx_ficp_platform_data);
541 MACHINE_START(E740, "Toshiba e740")
542 /* Maintainer: Ian Molton (spyro@f2s.com) */
543 .phys_io = 0x40000000,
544 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
545 .boot_params = 0xa0000100,
546 .map_io = pxa_map_io,
547 .init_irq = pxa25x_init_irq,
548 .fixup = eseries_fixup,
549 .init_machine = e740_init,
550 .timer = &pxa_timer,
551 MACHINE_END
552 #endif
554 #ifdef CONFIG_MACH_E750
555 /* ---------------------- E750 LCD definitions -------------------- */
557 static struct w100_gen_regs e750_lcd_regs = {
558 .lcd_format = 0x00008003,
559 .lcdd_cntl1 = 0x00000000,
560 .lcdd_cntl2 = 0x0003ffff,
561 .genlcd_cntl1 = 0x00fff003,
562 .genlcd_cntl2 = 0x003c0f03,
563 .genlcd_cntl3 = 0x000143aa,
566 static struct w100_mode e750_lcd_mode = {
567 .xres = 240,
568 .yres = 320,
569 .left_margin = 21,
570 .right_margin = 22,
571 .upper_margin = 5,
572 .lower_margin = 4,
573 .crtc_ss = 0x80150014,
574 .crtc_ls = 0x8014000d,
575 .crtc_gs = 0xc1000005,
576 .crtc_vpos_gs = 0x00020147,
577 .crtc_rev = 0x0040010a,
578 .crtc_dclk = 0xa1700030,
579 .crtc_gclk = 0x80cc0015,
580 .crtc_goe = 0x80cc0015,
581 .crtc_ps1_active = 0x61060017,
582 .pll_freq = 57,
583 .pixclk_divider = 4,
584 .pixclk_divider_rotated = 4,
585 .pixclk_src = CLK_SRC_XTAL,
586 .sysclk_divider = 1,
587 .sysclk_src = CLK_SRC_PLL,
590 static struct w100_gpio_regs e750_w100_gpio_info = {
591 .init_data1 = 0x01192f1b,
592 .gpio_dir1 = 0xd5ffdeff,
593 .gpio_oe1 = 0x000020bf,
594 .init_data2 = 0x010f010f,
595 .gpio_dir2 = 0xffffffff,
596 .gpio_oe2 = 0x000001cf,
599 static struct w100fb_mach_info e750_fb_info = {
600 .modelist = &e750_lcd_mode,
601 .num_modes = 1,
602 .regs = &e750_lcd_regs,
603 .gpio = &e750_w100_gpio_info,
604 .xtal_freq = 14318000,
605 .xtal_dbl = 1,
608 static struct resource e750_fb_resources[] = {
609 [0] = {
610 .start = 0x0c000000,
611 .end = 0x0cffffff,
612 .flags = IORESOURCE_MEM,
616 static struct platform_device e750_fb_device = {
617 .name = "w100fb",
618 .id = -1,
619 .dev = {
620 .platform_data = &e750_fb_info,
622 .num_resources = ARRAY_SIZE(e750_fb_resources),
623 .resource = e750_fb_resources,
626 /* -------------------- e750 MFP parameters -------------------- */
628 static unsigned long e750_pin_config[] __initdata = {
629 /* Chip selects */
630 GPIO15_nCS_1, /* CS1 - Flash */
631 GPIO79_nCS_3, /* CS3 - IMAGEON */
632 GPIO80_nCS_4, /* CS4 - TMIO */
634 /* Clocks */
635 GPIO11_3_6MHz,
637 /* BTUART */
638 GPIO42_BTUART_RXD,
639 GPIO43_BTUART_TXD,
640 GPIO44_BTUART_CTS,
642 /* TMIO controller */
643 GPIO19_GPIO, /* t7l66xb #PCLR */
644 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
646 /* UDC */
647 GPIO13_GPIO,
648 GPIO3_GPIO,
650 /* IrDA */
651 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
653 /* AC97 */
654 GPIO28_AC97_BITCLK,
655 GPIO29_AC97_SDATA_IN_0,
656 GPIO30_AC97_SDATA_OUT,
657 GPIO31_AC97_SYNC,
659 /* Audio power control */
660 GPIO4_GPIO, /* Headphone amp power */
661 GPIO7_GPIO, /* Speaker amp power */
662 GPIO37_GPIO, /* Headphone detect */
664 /* PC Card */
665 GPIO8_GPIO, /* CD0 */
666 GPIO44_GPIO, /* CD1 */
667 GPIO11_GPIO, /* IRQ0 */
668 GPIO6_GPIO, /* IRQ1 */
669 GPIO27_GPIO, /* RST0 */
670 GPIO24_GPIO, /* RST1 */
671 GPIO20_GPIO, /* PWR0 */
672 GPIO23_GPIO, /* PWR1 */
673 GPIO48_nPOE,
674 GPIO49_nPWE,
675 GPIO50_nPIOR,
676 GPIO51_nPIOW,
677 GPIO52_nPCE_1,
678 GPIO53_nPCE_2,
679 GPIO54_nPSKTSEL,
680 GPIO55_nPREG,
681 GPIO56_nPWAIT,
682 GPIO57_nIOIS16,
684 /* wakeup */
685 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
688 /* ----------------- e750 tc6393xb parameters ------------------ */
690 static struct tc6393xb_platform_data e750_tc6393xb_info = {
691 .irq_base = IRQ_BOARD_START,
692 .scr_pll2cr = 0x0cc1,
693 .scr_gper = 0,
694 .gpio_base = -1,
695 .suspend = &eseries_tmio_suspend,
696 .resume = &eseries_tmio_resume,
697 .enable = &eseries_tmio_enable,
698 .disable = &eseries_tmio_disable,
701 static struct platform_device e750_tc6393xb_device = {
702 .name = "tc6393xb",
703 .id = -1,
704 .dev = {
705 .platform_data = &e750_tc6393xb_info,
707 .num_resources = 2,
708 .resource = eseries_tmio_resources,
711 /* ------------------------------------------------------------- */
713 static struct platform_device *e750_devices[] __initdata = {
714 &e750_fb_device,
715 &e750_tc6393xb_device,
718 static void __init e750_init(void)
720 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
721 pxa_set_ffuart_info(NULL);
722 pxa_set_btuart_info(NULL);
723 pxa_set_stuart_info(NULL);
724 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
725 "GPIO11_CLK", NULL),
726 eseries_get_tmio_gpios();
727 platform_add_devices(ARRAY_AND_SIZE(e750_devices));
728 pxa_set_udc_info(&e7xx_udc_mach_info);
729 pxa_set_ac97_info(NULL);
730 pxa_set_ficp_info(&e7xx_ficp_platform_data);
733 MACHINE_START(E750, "Toshiba e750")
734 /* Maintainer: Ian Molton (spyro@f2s.com) */
735 .phys_io = 0x40000000,
736 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
737 .boot_params = 0xa0000100,
738 .map_io = pxa_map_io,
739 .init_irq = pxa25x_init_irq,
740 .fixup = eseries_fixup,
741 .init_machine = e750_init,
742 .timer = &pxa_timer,
743 MACHINE_END
744 #endif
746 #ifdef CONFIG_MACH_E800
747 /* ------------------------ e800 LCD definitions ------------------------- */
749 static unsigned long e800_pin_config[] __initdata = {
750 /* AC97 */
751 GPIO28_AC97_BITCLK,
752 GPIO29_AC97_SDATA_IN_0,
753 GPIO30_AC97_SDATA_OUT,
754 GPIO31_AC97_SYNC,
757 static struct w100_gen_regs e800_lcd_regs = {
758 .lcd_format = 0x00008003,
759 .lcdd_cntl1 = 0x02a00000,
760 .lcdd_cntl2 = 0x0003ffff,
761 .genlcd_cntl1 = 0x000ff2a3,
762 .genlcd_cntl2 = 0x000002a3,
763 .genlcd_cntl3 = 0x000102aa,
766 static struct w100_mode e800_lcd_mode[2] = {
767 [0] = {
768 .xres = 480,
769 .yres = 640,
770 .left_margin = 52,
771 .right_margin = 148,
772 .upper_margin = 2,
773 .lower_margin = 6,
774 .crtc_ss = 0x80350034,
775 .crtc_ls = 0x802b0026,
776 .crtc_gs = 0x80160016,
777 .crtc_vpos_gs = 0x00020003,
778 .crtc_rev = 0x0040001d,
779 .crtc_dclk = 0xe0000000,
780 .crtc_gclk = 0x82a50049,
781 .crtc_goe = 0x80ee001c,
782 .crtc_ps1_active = 0x00000000,
783 .pll_freq = 128,
784 .pixclk_divider = 4,
785 .pixclk_divider_rotated = 6,
786 .pixclk_src = CLK_SRC_PLL,
787 .sysclk_divider = 0,
788 .sysclk_src = CLK_SRC_PLL,
790 [1] = {
791 .xres = 240,
792 .yres = 320,
793 .left_margin = 15,
794 .right_margin = 88,
795 .upper_margin = 0,
796 .lower_margin = 7,
797 .crtc_ss = 0xd010000f,
798 .crtc_ls = 0x80070003,
799 .crtc_gs = 0x80000000,
800 .crtc_vpos_gs = 0x01460147,
801 .crtc_rev = 0x00400003,
802 .crtc_dclk = 0xa1700030,
803 .crtc_gclk = 0x814b0008,
804 .crtc_goe = 0x80cc0015,
805 .crtc_ps1_active = 0x00000000,
806 .pll_freq = 100,
807 .pixclk_divider = 6, /* Wince uses 14 which gives a */
808 .pixclk_divider_rotated = 6, /* 7MHz Pclk. We use a 14MHz one */
809 .pixclk_src = CLK_SRC_PLL,
810 .sysclk_divider = 0,
811 .sysclk_src = CLK_SRC_PLL,
816 static struct w100_gpio_regs e800_w100_gpio_info = {
817 .init_data1 = 0xc13fc019,
818 .gpio_dir1 = 0x3e40df7f,
819 .gpio_oe1 = 0x003c3000,
820 .init_data2 = 0x00000000,
821 .gpio_dir2 = 0x00000000,
822 .gpio_oe2 = 0x00000000,
825 static struct w100_mem_info e800_w100_mem_info = {
826 .ext_cntl = 0x09640011,
827 .sdram_mode_reg = 0x00600021,
828 .ext_timing_cntl = 0x10001545,
829 .io_cntl = 0x7ddd7333,
830 .size = 0x1fffff,
833 static void e800_tg_change(struct w100fb_par *par)
835 unsigned long tmp;
837 tmp = w100fb_gpio_read(W100_GPIO_PORT_A);
838 if (par->mode->xres == 480)
839 tmp |= 0x100;
840 else
841 tmp &= ~0x100;
842 w100fb_gpio_write(W100_GPIO_PORT_A, tmp);
845 static struct w100_tg_info e800_tg_info = {
846 .change = e800_tg_change,
849 static struct w100fb_mach_info e800_fb_info = {
850 .modelist = e800_lcd_mode,
851 .num_modes = 2,
852 .regs = &e800_lcd_regs,
853 .gpio = &e800_w100_gpio_info,
854 .mem = &e800_w100_mem_info,
855 .tg = &e800_tg_info,
856 .xtal_freq = 16000000,
859 static struct resource e800_fb_resources[] = {
860 [0] = {
861 .start = 0x0c000000,
862 .end = 0x0cffffff,
863 .flags = IORESOURCE_MEM,
867 static struct platform_device e800_fb_device = {
868 .name = "w100fb",
869 .id = -1,
870 .dev = {
871 .platform_data = &e800_fb_info,
873 .num_resources = ARRAY_SIZE(e800_fb_resources),
874 .resource = e800_fb_resources,
877 /* --------------------------- UDC definitions --------------------------- */
879 static struct pxa2xx_udc_mach_info e800_udc_mach_info = {
880 .gpio_vbus = GPIO_E800_USB_DISC,
881 .gpio_pullup = GPIO_E800_USB_PULLUP,
882 .gpio_pullup_inverted = 1
885 /* ----------------- e800 tc6393xb parameters ------------------ */
887 static struct tc6393xb_platform_data e800_tc6393xb_info = {
888 .irq_base = IRQ_BOARD_START,
889 .scr_pll2cr = 0x0cc1,
890 .scr_gper = 0,
891 .gpio_base = -1,
892 .suspend = &eseries_tmio_suspend,
893 .resume = &eseries_tmio_resume,
894 .enable = &eseries_tmio_enable,
895 .disable = &eseries_tmio_disable,
898 static struct platform_device e800_tc6393xb_device = {
899 .name = "tc6393xb",
900 .id = -1,
901 .dev = {
902 .platform_data = &e800_tc6393xb_info,
904 .num_resources = 2,
905 .resource = eseries_tmio_resources,
908 /* ----------------------------------------------------------------------- */
910 static struct platform_device *e800_devices[] __initdata = {
911 &e800_fb_device,
912 &e800_tc6393xb_device,
915 static void __init e800_init(void)
917 pxa2xx_mfp_config(ARRAY_AND_SIZE(e800_pin_config));
918 pxa_set_ffuart_info(NULL);
919 pxa_set_btuart_info(NULL);
920 pxa_set_stuart_info(NULL);
921 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
922 "GPIO11_CLK", NULL),
923 eseries_get_tmio_gpios();
924 platform_add_devices(ARRAY_AND_SIZE(e800_devices));
925 pxa_set_udc_info(&e800_udc_mach_info);
926 pxa_set_ac97_info(NULL);
929 MACHINE_START(E800, "Toshiba e800")
930 /* Maintainer: Ian Molton (spyro@f2s.com) */
931 .phys_io = 0x40000000,
932 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
933 .boot_params = 0xa0000100,
934 .map_io = pxa_map_io,
935 .init_irq = pxa25x_init_irq,
936 .fixup = eseries_fixup,
937 .init_machine = e800_init,
938 .timer = &pxa_timer,
939 MACHINE_END
940 #endif