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
13 #include <linux/clkdev.h>
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/clk-provider.h>
17 #include <linux/gpio/machine.h>
18 #include <linux/gpio.h>
19 #include <linux/delay.h>
20 #include <linux/platform_device.h>
21 #include <linux/mfd/tc6387xb.h>
22 #include <linux/mfd/tc6393xb.h>
23 #include <linux/mfd/t7l66xb.h>
24 #include <linux/mtd/rawnand.h>
25 #include <linux/mtd/partitions.h>
26 #include <linux/memblock.h>
27 #include <linux/gpio/machine.h>
29 #include <video/w100fb.h>
31 #include <asm/setup.h>
32 #include <asm/mach/arch.h>
33 #include <asm/mach-types.h>
36 #include "eseries-gpio.h"
37 #include "eseries-irq.h"
38 #include <linux/platform_data/asoc-pxa.h>
39 #include <linux/platform_data/video-pxafb.h>
41 #include <linux/platform_data/irda-pxaficp.h>
46 /* Only e800 has 128MB RAM */
47 void __init eseries_fixup(struct tag *tags, char **cmdline)
49 if (machine_is_e800())
50 memblock_add(0xa0000000, SZ_128M);
52 memblock_add(0xa0000000, SZ_64M);
55 static struct gpiod_lookup_table e7xx_gpio_vbus_gpiod_table __maybe_unused = {
56 .dev_id = "gpio-vbus",
58 GPIO_LOOKUP("gpio-pxa", GPIO_E7XX_USB_DISC,
59 "vbus", GPIO_ACTIVE_HIGH),
60 GPIO_LOOKUP("gpio-pxa", GPIO_E7XX_USB_PULLUP,
61 "pullup", GPIO_ACTIVE_LOW),
66 static struct platform_device e7xx_gpio_vbus __maybe_unused = {
71 struct pxaficp_platform_data e7xx_ficp_platform_data = {
72 .gpio_pwdown = GPIO_E7XX_IR_OFF,
73 .transceiver_cap = IR_SIRMODE | IR_OFF,
76 int eseries_tmio_enable(struct platform_device *dev)
78 /* Reset - bring SUSPEND high before PCLR */
79 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
80 gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
82 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
84 gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 1);
89 void eseries_tmio_disable(struct platform_device *dev)
91 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
92 gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
95 int eseries_tmio_suspend(struct platform_device *dev)
97 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
101 int eseries_tmio_resume(struct platform_device *dev)
103 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
108 void eseries_get_tmio_gpios(void)
110 gpio_request(GPIO_ESERIES_TMIO_SUSPEND, NULL);
111 gpio_request(GPIO_ESERIES_TMIO_PCLR, NULL);
112 gpio_direction_output(GPIO_ESERIES_TMIO_SUSPEND, 0);
113 gpio_direction_output(GPIO_ESERIES_TMIO_PCLR, 0);
116 /* TMIO controller uses the same resources on all e-series machines. */
117 struct resource eseries_tmio_resources[] = {
119 .start = PXA_CS4_PHYS,
120 .end = PXA_CS4_PHYS + 0x1fffff,
121 .flags = IORESOURCE_MEM,
124 .start = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
125 .end = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
126 .flags = IORESOURCE_IRQ,
130 /* Some e-series hardware cannot control the 32K clock */
131 static void __init __maybe_unused eseries_register_clks(void)
133 clk_register_fixed_rate(NULL, "CLK_CK32K", NULL, 0, 32768);
136 #ifdef CONFIG_MACH_E330
137 /* -------------------- e330 tc6387xb parameters -------------------- */
139 static struct tc6387xb_platform_data e330_tc6387xb_info = {
140 .enable = &eseries_tmio_enable,
141 .suspend = &eseries_tmio_suspend,
142 .resume = &eseries_tmio_resume,
145 static struct platform_device e330_tc6387xb_device = {
149 .platform_data = &e330_tc6387xb_info,
152 .resource = eseries_tmio_resources,
155 /* --------------------------------------------------------------- */
157 static struct platform_device *e330_devices[] __initdata = {
158 &e330_tc6387xb_device,
162 static void __init e330_init(void)
164 pxa_set_ffuart_info(NULL);
165 pxa_set_btuart_info(NULL);
166 pxa_set_stuart_info(NULL);
167 eseries_register_clks();
168 eseries_get_tmio_gpios();
169 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
170 platform_add_devices(ARRAY_AND_SIZE(e330_devices));
173 MACHINE_START(E330, "Toshiba e330")
174 /* Maintainer: Ian Molton (spyro@f2s.com) */
175 .atag_offset = 0x100,
176 .map_io = pxa25x_map_io,
177 .nr_irqs = ESERIES_NR_IRQS,
178 .init_irq = pxa25x_init_irq,
179 .handle_irq = pxa25x_handle_irq,
180 .fixup = eseries_fixup,
181 .init_machine = e330_init,
182 .init_time = pxa_timer_init,
183 .restart = pxa_restart,
187 #ifdef CONFIG_MACH_E350
188 /* -------------------- e350 t7l66xb parameters -------------------- */
190 static struct t7l66xb_platform_data e350_t7l66xb_info = {
191 .irq_base = IRQ_BOARD_START,
192 .enable = &eseries_tmio_enable,
193 .suspend = &eseries_tmio_suspend,
194 .resume = &eseries_tmio_resume,
197 static struct platform_device e350_t7l66xb_device = {
201 .platform_data = &e350_t7l66xb_info,
204 .resource = eseries_tmio_resources,
207 /* ---------------------------------------------------------- */
209 static struct platform_device *e350_devices[] __initdata = {
210 &e350_t7l66xb_device,
214 static void __init e350_init(void)
216 pxa_set_ffuart_info(NULL);
217 pxa_set_btuart_info(NULL);
218 pxa_set_stuart_info(NULL);
219 eseries_register_clks();
220 eseries_get_tmio_gpios();
221 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
222 platform_add_devices(ARRAY_AND_SIZE(e350_devices));
225 MACHINE_START(E350, "Toshiba e350")
226 /* Maintainer: Ian Molton (spyro@f2s.com) */
227 .atag_offset = 0x100,
228 .map_io = pxa25x_map_io,
229 .nr_irqs = ESERIES_NR_IRQS,
230 .init_irq = pxa25x_init_irq,
231 .handle_irq = pxa25x_handle_irq,
232 .fixup = eseries_fixup,
233 .init_machine = e350_init,
234 .init_time = pxa_timer_init,
235 .restart = pxa_restart,
239 #ifdef CONFIG_MACH_E400
240 /* ------------------------ E400 LCD definitions ------------------------ */
242 static struct pxafb_mode_info e400_pxafb_mode_info = {
256 static struct pxafb_mach_info e400_pxafb_mach_info = {
257 .modes = &e400_pxafb_mode_info,
259 .lcd_conn = LCD_COLOR_TFT_16BPP,
261 .pxafb_backlight_power = NULL,
264 /* ------------------------ E400 MFP config ----------------------------- */
266 static unsigned long e400_pin_config[] __initdata = {
268 GPIO15_nCS_1, /* CS1 - Flash */
269 GPIO80_nCS_4, /* CS4 - TMIO */
279 /* TMIO controller */
280 GPIO19_GPIO, /* t7l66xb #PCLR */
281 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
284 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
287 /* ---------------------------------------------------------------------- */
289 static struct mtd_partition partition_a = {
290 .name = "Internal NAND flash",
292 .size = MTDPART_SIZ_FULL,
295 static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
297 static struct nand_bbt_descr e400_t7l66xb_nand_bbt = {
301 .pattern = scan_ff_pattern
304 static struct tmio_nand_data e400_t7l66xb_nand_config = {
306 .partition = &partition_a,
307 .badblock_pattern = &e400_t7l66xb_nand_bbt,
310 static struct t7l66xb_platform_data e400_t7l66xb_info = {
311 .irq_base = IRQ_BOARD_START,
312 .enable = &eseries_tmio_enable,
313 .suspend = &eseries_tmio_suspend,
314 .resume = &eseries_tmio_resume,
316 .nand_data = &e400_t7l66xb_nand_config,
319 static struct platform_device e400_t7l66xb_device = {
323 .platform_data = &e400_t7l66xb_info,
326 .resource = eseries_tmio_resources,
329 /* ---------------------------------------------------------- */
331 static struct platform_device *e400_devices[] __initdata = {
332 &e400_t7l66xb_device,
336 static void __init e400_init(void)
338 pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config));
339 pxa_set_ffuart_info(NULL);
340 pxa_set_btuart_info(NULL);
341 pxa_set_stuart_info(NULL);
342 /* Fixme - e400 may have a switched clock */
343 eseries_register_clks();
344 eseries_get_tmio_gpios();
345 pxa_set_fb_info(NULL, &e400_pxafb_mach_info);
346 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
347 platform_add_devices(ARRAY_AND_SIZE(e400_devices));
350 MACHINE_START(E400, "Toshiba e400")
351 /* Maintainer: Ian Molton (spyro@f2s.com) */
352 .atag_offset = 0x100,
353 .map_io = pxa25x_map_io,
354 .nr_irqs = ESERIES_NR_IRQS,
355 .init_irq = pxa25x_init_irq,
356 .handle_irq = pxa25x_handle_irq,
357 .fixup = eseries_fixup,
358 .init_machine = e400_init,
359 .init_time = pxa_timer_init,
360 .restart = pxa_restart,
364 #ifdef CONFIG_MACH_E740
365 /* ------------------------ e740 video support --------------------------- */
367 static struct w100_gen_regs e740_lcd_regs = {
368 .lcd_format = 0x00008023,
369 .lcdd_cntl1 = 0x0f000000,
370 .lcdd_cntl2 = 0x0003ffff,
371 .genlcd_cntl1 = 0x00ffff03,
372 .genlcd_cntl2 = 0x003c0f03,
373 .genlcd_cntl3 = 0x000143aa,
376 static struct w100_mode e740_lcd_mode = {
383 .crtc_ss = 0x80140013,
384 .crtc_ls = 0x81150110,
385 .crtc_gs = 0x80050005,
386 .crtc_vpos_gs = 0x000a0009,
387 .crtc_rev = 0x0040010a,
388 .crtc_dclk = 0xa906000a,
389 .crtc_gclk = 0x80050108,
390 .crtc_goe = 0x80050108,
393 .pixclk_divider_rotated = 4,
394 .pixclk_src = CLK_SRC_XTAL,
396 .sysclk_src = CLK_SRC_PLL,
397 .crtc_ps1_active = 0x41060010,
400 static struct w100_gpio_regs e740_w100_gpio_info = {
401 .init_data1 = 0x21002103,
402 .gpio_dir1 = 0xffffdeff,
403 .gpio_oe1 = 0x03c00643,
404 .init_data2 = 0x003f003f,
405 .gpio_dir2 = 0xffffffff,
406 .gpio_oe2 = 0x000000ff,
409 static struct w100fb_mach_info e740_fb_info = {
410 .modelist = &e740_lcd_mode,
412 .regs = &e740_lcd_regs,
413 .gpio = &e740_w100_gpio_info,
414 .xtal_freq = 14318000,
418 static struct resource e740_fb_resources[] = {
422 .flags = IORESOURCE_MEM,
426 static struct platform_device e740_fb_device = {
430 .platform_data = &e740_fb_info,
432 .num_resources = ARRAY_SIZE(e740_fb_resources),
433 .resource = e740_fb_resources,
436 /* --------------------------- MFP Pin config -------------------------- */
438 static unsigned long e740_pin_config[] __initdata = {
440 GPIO15_nCS_1, /* CS1 - Flash */
441 GPIO79_nCS_3, /* CS3 - IMAGEON */
442 GPIO80_nCS_4, /* CS4 - TMIO */
452 /* TMIO controller */
453 GPIO19_GPIO, /* t7l66xb #PCLR */
454 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
461 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
465 GPIO29_AC97_SDATA_IN_0,
466 GPIO30_AC97_SDATA_OUT,
469 /* Audio power control */
470 GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
471 GPIO40_GPIO, /* Mic amp power */
472 GPIO41_GPIO, /* Headphone amp power */
475 GPIO8_GPIO, /* CD0 */
476 GPIO44_GPIO, /* CD1 */
477 GPIO11_GPIO, /* IRQ0 */
478 GPIO6_GPIO, /* IRQ1 */
479 GPIO27_GPIO, /* RST0 */
480 GPIO24_GPIO, /* RST1 */
481 GPIO20_GPIO, /* PWR0 */
482 GPIO23_GPIO, /* PWR1 */
495 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
498 /* -------------------- e740 t7l66xb parameters -------------------- */
500 static struct t7l66xb_platform_data e740_t7l66xb_info = {
501 .irq_base = IRQ_BOARD_START,
502 .enable = &eseries_tmio_enable,
503 .suspend = &eseries_tmio_suspend,
504 .resume = &eseries_tmio_resume,
507 static struct platform_device e740_t7l66xb_device = {
511 .platform_data = &e740_t7l66xb_info,
514 .resource = eseries_tmio_resources,
517 static struct platform_device e740_audio_device = {
518 .name = "e740-audio",
522 static struct gpiod_lookup_table e740_audio_gpio_table = {
523 .dev_id = "e740-audio",
525 GPIO_LOOKUP("gpio-pxa", GPIO_E740_WM9705_nAVDD2, "Audio power", GPIO_ACTIVE_HIGH),
526 GPIO_LOOKUP("gpio-pxa", GPIO_E740_AMP_ON, "Output amp", GPIO_ACTIVE_HIGH),
527 GPIO_LOOKUP("gpio-pxa", GPIO_E740_MIC_ON, "Mic amp", GPIO_ACTIVE_HIGH),
532 /* ----------------------------------------------------------------------- */
534 static struct platform_device *e740_devices[] __initdata = {
536 &e740_t7l66xb_device,
541 static void __init e740_init(void)
543 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
544 pxa_set_ffuart_info(NULL);
545 pxa_set_btuart_info(NULL);
546 pxa_set_stuart_info(NULL);
547 eseries_register_clks();
548 clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
549 "UDCCLK", &pxa25x_device_udc.dev),
550 eseries_get_tmio_gpios();
551 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
552 gpiod_add_lookup_table(&e740_audio_gpio_table);
553 platform_add_devices(ARRAY_AND_SIZE(e740_devices));
554 pxa_set_ac97_info(NULL);
555 pxa_set_ficp_info(&e7xx_ficp_platform_data);
558 MACHINE_START(E740, "Toshiba e740")
559 /* Maintainer: Ian Molton (spyro@f2s.com) */
560 .atag_offset = 0x100,
561 .map_io = pxa25x_map_io,
562 .nr_irqs = ESERIES_NR_IRQS,
563 .init_irq = pxa25x_init_irq,
564 .handle_irq = pxa25x_handle_irq,
565 .fixup = eseries_fixup,
566 .init_machine = e740_init,
567 .init_time = pxa_timer_init,
568 .restart = pxa_restart,
572 #ifdef CONFIG_MACH_E750
573 /* ---------------------- E750 LCD definitions -------------------- */
575 static struct w100_gen_regs e750_lcd_regs = {
576 .lcd_format = 0x00008003,
577 .lcdd_cntl1 = 0x00000000,
578 .lcdd_cntl2 = 0x0003ffff,
579 .genlcd_cntl1 = 0x00fff003,
580 .genlcd_cntl2 = 0x003c0f03,
581 .genlcd_cntl3 = 0x000143aa,
584 static struct w100_mode e750_lcd_mode = {
591 .crtc_ss = 0x80150014,
592 .crtc_ls = 0x8014000d,
593 .crtc_gs = 0xc1000005,
594 .crtc_vpos_gs = 0x00020147,
595 .crtc_rev = 0x0040010a,
596 .crtc_dclk = 0xa1700030,
597 .crtc_gclk = 0x80cc0015,
598 .crtc_goe = 0x80cc0015,
599 .crtc_ps1_active = 0x61060017,
602 .pixclk_divider_rotated = 4,
603 .pixclk_src = CLK_SRC_XTAL,
605 .sysclk_src = CLK_SRC_PLL,
608 static struct w100_gpio_regs e750_w100_gpio_info = {
609 .init_data1 = 0x01192f1b,
610 .gpio_dir1 = 0xd5ffdeff,
611 .gpio_oe1 = 0x000020bf,
612 .init_data2 = 0x010f010f,
613 .gpio_dir2 = 0xffffffff,
614 .gpio_oe2 = 0x000001cf,
617 static struct w100fb_mach_info e750_fb_info = {
618 .modelist = &e750_lcd_mode,
620 .regs = &e750_lcd_regs,
621 .gpio = &e750_w100_gpio_info,
622 .xtal_freq = 14318000,
626 static struct resource e750_fb_resources[] = {
630 .flags = IORESOURCE_MEM,
634 static struct platform_device e750_fb_device = {
638 .platform_data = &e750_fb_info,
640 .num_resources = ARRAY_SIZE(e750_fb_resources),
641 .resource = e750_fb_resources,
644 /* -------------------- e750 MFP parameters -------------------- */
646 static unsigned long e750_pin_config[] __initdata = {
648 GPIO15_nCS_1, /* CS1 - Flash */
649 GPIO79_nCS_3, /* CS3 - IMAGEON */
650 GPIO80_nCS_4, /* CS4 - TMIO */
660 /* TMIO controller */
661 GPIO19_GPIO, /* t7l66xb #PCLR */
662 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
669 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
673 GPIO29_AC97_SDATA_IN_0,
674 GPIO30_AC97_SDATA_OUT,
677 /* Audio power control */
678 GPIO4_GPIO, /* Headphone amp power */
679 GPIO7_GPIO, /* Speaker amp power */
680 GPIO37_GPIO, /* Headphone detect */
683 GPIO8_GPIO, /* CD0 */
684 GPIO44_GPIO, /* CD1 */
685 /* GPIO11_GPIO, IRQ0 */
686 GPIO6_GPIO, /* IRQ1 */
687 GPIO27_GPIO, /* RST0 */
688 GPIO24_GPIO, /* RST1 */
689 GPIO20_GPIO, /* PWR0 */
690 GPIO23_GPIO, /* PWR1 */
703 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
706 /* ----------------- e750 tc6393xb parameters ------------------ */
708 static struct tc6393xb_platform_data e750_tc6393xb_info = {
709 .irq_base = IRQ_BOARD_START,
710 .scr_pll2cr = 0x0cc1,
712 .suspend = &eseries_tmio_suspend,
713 .resume = &eseries_tmio_resume,
714 .enable = &eseries_tmio_enable,
715 .disable = &eseries_tmio_disable,
718 static struct platform_device e750_tc6393xb_device = {
722 .platform_data = &e750_tc6393xb_info,
725 .resource = eseries_tmio_resources,
728 static struct gpiod_lookup_table e750_audio_gpio_table = {
729 .dev_id = "e750-audio",
731 GPIO_LOOKUP("gpio-pxa", GPIO_E750_HP_AMP_OFF, "Output amp", GPIO_ACTIVE_LOW),
732 GPIO_LOOKUP("gpio-pxa", GPIO_E750_SPK_AMP_OFF, "Mic amp", GPIO_ACTIVE_LOW),
737 static struct platform_device e750_audio_device = {
738 .name = "e750-audio",
742 /* ------------------------------------------------------------- */
744 static struct platform_device *e750_devices[] __initdata = {
746 &e750_tc6393xb_device,
751 static void __init e750_init(void)
753 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
754 pxa_set_ffuart_info(NULL);
755 pxa_set_btuart_info(NULL);
756 pxa_set_stuart_info(NULL);
757 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
759 eseries_get_tmio_gpios();
760 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
761 gpiod_add_lookup_table(&e750_audio_gpio_table);
762 platform_add_devices(ARRAY_AND_SIZE(e750_devices));
763 pxa_set_ac97_info(NULL);
764 pxa_set_ficp_info(&e7xx_ficp_platform_data);
767 MACHINE_START(E750, "Toshiba e750")
768 /* Maintainer: Ian Molton (spyro@f2s.com) */
769 .atag_offset = 0x100,
770 .map_io = pxa25x_map_io,
771 .nr_irqs = ESERIES_NR_IRQS,
772 .init_irq = pxa25x_init_irq,
773 .handle_irq = pxa25x_handle_irq,
774 .fixup = eseries_fixup,
775 .init_machine = e750_init,
776 .init_time = pxa_timer_init,
777 .restart = pxa_restart,
781 #ifdef CONFIG_MACH_E800
782 /* ------------------------ e800 LCD definitions ------------------------- */
784 static unsigned long e800_pin_config[] __initdata = {
787 GPIO29_AC97_SDATA_IN_0,
788 GPIO30_AC97_SDATA_OUT,
795 static struct w100_gen_regs e800_lcd_regs = {
796 .lcd_format = 0x00008003,
797 .lcdd_cntl1 = 0x02a00000,
798 .lcdd_cntl2 = 0x0003ffff,
799 .genlcd_cntl1 = 0x000ff2a3,
800 .genlcd_cntl2 = 0x000002a3,
801 .genlcd_cntl3 = 0x000102aa,
804 static struct w100_mode e800_lcd_mode[2] = {
812 .crtc_ss = 0x80350034,
813 .crtc_ls = 0x802b0026,
814 .crtc_gs = 0x80160016,
815 .crtc_vpos_gs = 0x00020003,
816 .crtc_rev = 0x0040001d,
817 .crtc_dclk = 0xe0000000,
818 .crtc_gclk = 0x82a50049,
819 .crtc_goe = 0x80ee001c,
820 .crtc_ps1_active = 0x00000000,
823 .pixclk_divider_rotated = 6,
824 .pixclk_src = CLK_SRC_PLL,
826 .sysclk_src = CLK_SRC_PLL,
835 .crtc_ss = 0xd010000f,
836 .crtc_ls = 0x80070003,
837 .crtc_gs = 0x80000000,
838 .crtc_vpos_gs = 0x01460147,
839 .crtc_rev = 0x00400003,
840 .crtc_dclk = 0xa1700030,
841 .crtc_gclk = 0x814b0008,
842 .crtc_goe = 0x80cc0015,
843 .crtc_ps1_active = 0x00000000,
845 .pixclk_divider = 6, /* Wince uses 14 which gives a */
846 .pixclk_divider_rotated = 6, /* 7MHz Pclk. We use a 14MHz one */
847 .pixclk_src = CLK_SRC_PLL,
849 .sysclk_src = CLK_SRC_PLL,
854 static struct w100_gpio_regs e800_w100_gpio_info = {
855 .init_data1 = 0xc13fc019,
856 .gpio_dir1 = 0x3e40df7f,
857 .gpio_oe1 = 0x003c3000,
858 .init_data2 = 0x00000000,
859 .gpio_dir2 = 0x00000000,
860 .gpio_oe2 = 0x00000000,
863 static struct w100_mem_info e800_w100_mem_info = {
864 .ext_cntl = 0x09640011,
865 .sdram_mode_reg = 0x00600021,
866 .ext_timing_cntl = 0x10001545,
867 .io_cntl = 0x7ddd7333,
871 static void e800_tg_change(struct w100fb_par *par)
875 tmp = w100fb_gpio_read(W100_GPIO_PORT_A);
876 if (par->mode->xres == 480)
880 w100fb_gpio_write(W100_GPIO_PORT_A, tmp);
883 static struct w100_tg_info e800_tg_info = {
884 .change = e800_tg_change,
887 static struct w100fb_mach_info e800_fb_info = {
888 .modelist = e800_lcd_mode,
890 .regs = &e800_lcd_regs,
891 .gpio = &e800_w100_gpio_info,
892 .mem = &e800_w100_mem_info,
894 .xtal_freq = 16000000,
897 static struct resource e800_fb_resources[] = {
901 .flags = IORESOURCE_MEM,
905 static struct platform_device e800_fb_device = {
909 .platform_data = &e800_fb_info,
911 .num_resources = ARRAY_SIZE(e800_fb_resources),
912 .resource = e800_fb_resources,
915 /* --------------------------- UDC definitions --------------------------- */
917 static struct gpiod_lookup_table e800_gpio_vbus_gpiod_table = {
918 .dev_id = "gpio-vbus",
920 GPIO_LOOKUP("gpio-pxa", GPIO_E800_USB_DISC,
921 "vbus", GPIO_ACTIVE_HIGH),
922 GPIO_LOOKUP("gpio-pxa", GPIO_E800_USB_PULLUP,
923 "pullup", GPIO_ACTIVE_LOW),
928 static struct platform_device e800_gpio_vbus = {
934 /* ----------------- e800 tc6393xb parameters ------------------ */
936 static struct tc6393xb_platform_data e800_tc6393xb_info = {
937 .irq_base = IRQ_BOARD_START,
938 .scr_pll2cr = 0x0cc1,
940 .suspend = &eseries_tmio_suspend,
941 .resume = &eseries_tmio_resume,
942 .enable = &eseries_tmio_enable,
943 .disable = &eseries_tmio_disable,
946 static struct platform_device e800_tc6393xb_device = {
950 .platform_data = &e800_tc6393xb_info,
953 .resource = eseries_tmio_resources,
956 static struct gpiod_lookup_table e800_audio_gpio_table = {
957 .dev_id = "e800-audio",
959 GPIO_LOOKUP("gpio-pxa", GPIO_E800_HP_AMP_OFF, "Output amp", GPIO_ACTIVE_LOW),
960 GPIO_LOOKUP("gpio-pxa", GPIO_E800_SPK_AMP_ON, "Mic amp", GPIO_ACTIVE_HIGH),
965 static struct platform_device e800_audio_device = {
966 .name = "e800-audio",
970 /* ----------------------------------------------------------------------- */
972 static struct platform_device *e800_devices[] __initdata = {
974 &e800_tc6393xb_device,
979 static void __init e800_init(void)
981 pxa2xx_mfp_config(ARRAY_AND_SIZE(e800_pin_config));
982 pxa_set_ffuart_info(NULL);
983 pxa_set_btuart_info(NULL);
984 pxa_set_stuart_info(NULL);
985 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
987 eseries_get_tmio_gpios();
988 gpiod_add_lookup_table(&e800_gpio_vbus_gpiod_table);
989 gpiod_add_lookup_table(&e800_audio_gpio_table);
990 platform_add_devices(ARRAY_AND_SIZE(e800_devices));
991 pxa_set_ac97_info(NULL);
994 MACHINE_START(E800, "Toshiba e800")
995 /* Maintainer: Ian Molton (spyro@f2s.com) */
996 .atag_offset = 0x100,
997 .map_io = pxa25x_map_io,
998 .nr_irqs = ESERIES_NR_IRQS,
999 .init_irq = pxa25x_init_irq,
1000 .handle_irq = pxa25x_handle_irq,
1001 .fixup = eseries_fixup,
1002 .init_machine = e800_init,
1003 .init_time = pxa_timer_init,
1004 .restart = pxa_restart,