1 // SPDX-License-Identifier: GPL-2.0-only
3 * Hardware definitions for the Toshiba eseries PDAs
5 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
8 #include <linux/clkdev.h>
9 #include <linux/kernel.h>
10 #include <linux/init.h>
11 #include <linux/clk-provider.h>
12 #include <linux/gpio/machine.h>
13 #include <linux/gpio.h>
14 #include <linux/delay.h>
15 #include <linux/platform_device.h>
16 #include <linux/mfd/tc6387xb.h>
17 #include <linux/mfd/tc6393xb.h>
18 #include <linux/mfd/t7l66xb.h>
19 #include <linux/mtd/rawnand.h>
20 #include <linux/mtd/partitions.h>
21 #include <linux/memblock.h>
22 #include <linux/gpio/machine.h>
24 #include <video/w100fb.h>
26 #include <asm/setup.h>
27 #include <asm/mach/arch.h>
28 #include <asm/mach-types.h>
31 #include "eseries-gpio.h"
32 #include "eseries-irq.h"
33 #include <linux/platform_data/asoc-pxa.h>
34 #include <linux/platform_data/video-pxafb.h>
36 #include <linux/platform_data/irda-pxaficp.h>
41 /* Only e800 has 128MB RAM */
42 void __init eseries_fixup(struct tag *tags, char **cmdline)
44 if (machine_is_e800())
45 memblock_add(0xa0000000, SZ_128M);
47 memblock_add(0xa0000000, SZ_64M);
50 static struct gpiod_lookup_table e7xx_gpio_vbus_gpiod_table __maybe_unused = {
51 .dev_id = "gpio-vbus",
53 GPIO_LOOKUP("gpio-pxa", GPIO_E7XX_USB_DISC,
54 "vbus", GPIO_ACTIVE_HIGH),
55 GPIO_LOOKUP("gpio-pxa", GPIO_E7XX_USB_PULLUP,
56 "pullup", GPIO_ACTIVE_LOW),
61 static struct platform_device e7xx_gpio_vbus __maybe_unused = {
66 struct pxaficp_platform_data e7xx_ficp_platform_data = {
67 .gpio_pwdown = GPIO_E7XX_IR_OFF,
68 .transceiver_cap = IR_SIRMODE | IR_OFF,
71 int eseries_tmio_enable(struct platform_device *dev)
73 /* Reset - bring SUSPEND high before PCLR */
74 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
75 gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
77 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
79 gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 1);
84 void eseries_tmio_disable(struct platform_device *dev)
86 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
87 gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
90 int eseries_tmio_suspend(struct platform_device *dev)
92 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
96 int eseries_tmio_resume(struct platform_device *dev)
98 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
103 void eseries_get_tmio_gpios(void)
105 gpio_request(GPIO_ESERIES_TMIO_SUSPEND, NULL);
106 gpio_request(GPIO_ESERIES_TMIO_PCLR, NULL);
107 gpio_direction_output(GPIO_ESERIES_TMIO_SUSPEND, 0);
108 gpio_direction_output(GPIO_ESERIES_TMIO_PCLR, 0);
111 /* TMIO controller uses the same resources on all e-series machines. */
112 struct resource eseries_tmio_resources[] = {
114 .start = PXA_CS4_PHYS,
115 .end = PXA_CS4_PHYS + 0x1fffff,
116 .flags = IORESOURCE_MEM,
119 .start = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
120 .end = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
121 .flags = IORESOURCE_IRQ,
125 /* Some e-series hardware cannot control the 32K clock */
126 static void __init __maybe_unused eseries_register_clks(void)
128 clk_register_fixed_rate(NULL, "CLK_CK32K", NULL, 0, 32768);
131 #ifdef CONFIG_MACH_E330
132 /* -------------------- e330 tc6387xb parameters -------------------- */
134 static struct tc6387xb_platform_data e330_tc6387xb_info = {
135 .enable = &eseries_tmio_enable,
136 .suspend = &eseries_tmio_suspend,
137 .resume = &eseries_tmio_resume,
140 static struct platform_device e330_tc6387xb_device = {
144 .platform_data = &e330_tc6387xb_info,
147 .resource = eseries_tmio_resources,
150 /* --------------------------------------------------------------- */
152 static struct platform_device *e330_devices[] __initdata = {
153 &e330_tc6387xb_device,
157 static void __init e330_init(void)
159 pxa_set_ffuart_info(NULL);
160 pxa_set_btuart_info(NULL);
161 pxa_set_stuart_info(NULL);
162 eseries_register_clks();
163 eseries_get_tmio_gpios();
164 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
165 platform_add_devices(ARRAY_AND_SIZE(e330_devices));
168 MACHINE_START(E330, "Toshiba e330")
169 /* Maintainer: Ian Molton (spyro@f2s.com) */
170 .atag_offset = 0x100,
171 .map_io = pxa25x_map_io,
172 .nr_irqs = ESERIES_NR_IRQS,
173 .init_irq = pxa25x_init_irq,
174 .handle_irq = pxa25x_handle_irq,
175 .fixup = eseries_fixup,
176 .init_machine = e330_init,
177 .init_time = pxa_timer_init,
178 .restart = pxa_restart,
182 #ifdef CONFIG_MACH_E350
183 /* -------------------- e350 t7l66xb parameters -------------------- */
185 static struct t7l66xb_platform_data e350_t7l66xb_info = {
186 .irq_base = IRQ_BOARD_START,
187 .enable = &eseries_tmio_enable,
188 .suspend = &eseries_tmio_suspend,
189 .resume = &eseries_tmio_resume,
192 static struct platform_device e350_t7l66xb_device = {
196 .platform_data = &e350_t7l66xb_info,
199 .resource = eseries_tmio_resources,
202 /* ---------------------------------------------------------- */
204 static struct platform_device *e350_devices[] __initdata = {
205 &e350_t7l66xb_device,
209 static void __init e350_init(void)
211 pxa_set_ffuart_info(NULL);
212 pxa_set_btuart_info(NULL);
213 pxa_set_stuart_info(NULL);
214 eseries_register_clks();
215 eseries_get_tmio_gpios();
216 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
217 platform_add_devices(ARRAY_AND_SIZE(e350_devices));
220 MACHINE_START(E350, "Toshiba e350")
221 /* Maintainer: Ian Molton (spyro@f2s.com) */
222 .atag_offset = 0x100,
223 .map_io = pxa25x_map_io,
224 .nr_irqs = ESERIES_NR_IRQS,
225 .init_irq = pxa25x_init_irq,
226 .handle_irq = pxa25x_handle_irq,
227 .fixup = eseries_fixup,
228 .init_machine = e350_init,
229 .init_time = pxa_timer_init,
230 .restart = pxa_restart,
234 #ifdef CONFIG_MACH_E400
235 /* ------------------------ E400 LCD definitions ------------------------ */
237 static struct pxafb_mode_info e400_pxafb_mode_info = {
251 static struct pxafb_mach_info e400_pxafb_mach_info = {
252 .modes = &e400_pxafb_mode_info,
254 .lcd_conn = LCD_COLOR_TFT_16BPP,
256 .pxafb_backlight_power = NULL,
259 /* ------------------------ E400 MFP config ----------------------------- */
261 static unsigned long e400_pin_config[] __initdata = {
263 GPIO15_nCS_1, /* CS1 - Flash */
264 GPIO80_nCS_4, /* CS4 - TMIO */
274 /* TMIO controller */
275 GPIO19_GPIO, /* t7l66xb #PCLR */
276 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
279 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
282 /* ---------------------------------------------------------------------- */
284 static struct mtd_partition partition_a = {
285 .name = "Internal NAND flash",
287 .size = MTDPART_SIZ_FULL,
290 static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
292 static struct nand_bbt_descr e400_t7l66xb_nand_bbt = {
296 .pattern = scan_ff_pattern
299 static struct tmio_nand_data e400_t7l66xb_nand_config = {
301 .partition = &partition_a,
302 .badblock_pattern = &e400_t7l66xb_nand_bbt,
305 static struct t7l66xb_platform_data e400_t7l66xb_info = {
306 .irq_base = IRQ_BOARD_START,
307 .enable = &eseries_tmio_enable,
308 .suspend = &eseries_tmio_suspend,
309 .resume = &eseries_tmio_resume,
311 .nand_data = &e400_t7l66xb_nand_config,
314 static struct platform_device e400_t7l66xb_device = {
318 .platform_data = &e400_t7l66xb_info,
321 .resource = eseries_tmio_resources,
324 /* ---------------------------------------------------------- */
326 static struct platform_device *e400_devices[] __initdata = {
327 &e400_t7l66xb_device,
331 static void __init e400_init(void)
333 pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config));
334 pxa_set_ffuart_info(NULL);
335 pxa_set_btuart_info(NULL);
336 pxa_set_stuart_info(NULL);
337 /* Fixme - e400 may have a switched clock */
338 eseries_register_clks();
339 eseries_get_tmio_gpios();
340 pxa_set_fb_info(NULL, &e400_pxafb_mach_info);
341 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
342 platform_add_devices(ARRAY_AND_SIZE(e400_devices));
345 MACHINE_START(E400, "Toshiba e400")
346 /* Maintainer: Ian Molton (spyro@f2s.com) */
347 .atag_offset = 0x100,
348 .map_io = pxa25x_map_io,
349 .nr_irqs = ESERIES_NR_IRQS,
350 .init_irq = pxa25x_init_irq,
351 .handle_irq = pxa25x_handle_irq,
352 .fixup = eseries_fixup,
353 .init_machine = e400_init,
354 .init_time = pxa_timer_init,
355 .restart = pxa_restart,
359 #ifdef CONFIG_MACH_E740
360 /* ------------------------ e740 video support --------------------------- */
362 static struct w100_gen_regs e740_lcd_regs = {
363 .lcd_format = 0x00008023,
364 .lcdd_cntl1 = 0x0f000000,
365 .lcdd_cntl2 = 0x0003ffff,
366 .genlcd_cntl1 = 0x00ffff03,
367 .genlcd_cntl2 = 0x003c0f03,
368 .genlcd_cntl3 = 0x000143aa,
371 static struct w100_mode e740_lcd_mode = {
378 .crtc_ss = 0x80140013,
379 .crtc_ls = 0x81150110,
380 .crtc_gs = 0x80050005,
381 .crtc_vpos_gs = 0x000a0009,
382 .crtc_rev = 0x0040010a,
383 .crtc_dclk = 0xa906000a,
384 .crtc_gclk = 0x80050108,
385 .crtc_goe = 0x80050108,
388 .pixclk_divider_rotated = 4,
389 .pixclk_src = CLK_SRC_XTAL,
391 .sysclk_src = CLK_SRC_PLL,
392 .crtc_ps1_active = 0x41060010,
395 static struct w100_gpio_regs e740_w100_gpio_info = {
396 .init_data1 = 0x21002103,
397 .gpio_dir1 = 0xffffdeff,
398 .gpio_oe1 = 0x03c00643,
399 .init_data2 = 0x003f003f,
400 .gpio_dir2 = 0xffffffff,
401 .gpio_oe2 = 0x000000ff,
404 static struct w100fb_mach_info e740_fb_info = {
405 .modelist = &e740_lcd_mode,
407 .regs = &e740_lcd_regs,
408 .gpio = &e740_w100_gpio_info,
409 .xtal_freq = 14318000,
413 static struct resource e740_fb_resources[] = {
417 .flags = IORESOURCE_MEM,
421 static struct platform_device e740_fb_device = {
425 .platform_data = &e740_fb_info,
427 .num_resources = ARRAY_SIZE(e740_fb_resources),
428 .resource = e740_fb_resources,
431 /* --------------------------- MFP Pin config -------------------------- */
433 static unsigned long e740_pin_config[] __initdata = {
435 GPIO15_nCS_1, /* CS1 - Flash */
436 GPIO79_nCS_3, /* CS3 - IMAGEON */
437 GPIO80_nCS_4, /* CS4 - TMIO */
447 /* TMIO controller */
448 GPIO19_GPIO, /* t7l66xb #PCLR */
449 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
456 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
460 GPIO29_AC97_SDATA_IN_0,
461 GPIO30_AC97_SDATA_OUT,
464 /* Audio power control */
465 GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
466 GPIO40_GPIO, /* Mic amp power */
467 GPIO41_GPIO, /* Headphone amp power */
470 GPIO8_GPIO, /* CD0 */
471 GPIO44_GPIO, /* CD1 */
472 GPIO11_GPIO, /* IRQ0 */
473 GPIO6_GPIO, /* IRQ1 */
474 GPIO27_GPIO, /* RST0 */
475 GPIO24_GPIO, /* RST1 */
476 GPIO20_GPIO, /* PWR0 */
477 GPIO23_GPIO, /* PWR1 */
490 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
493 /* -------------------- e740 t7l66xb parameters -------------------- */
495 static struct t7l66xb_platform_data e740_t7l66xb_info = {
496 .irq_base = IRQ_BOARD_START,
497 .enable = &eseries_tmio_enable,
498 .suspend = &eseries_tmio_suspend,
499 .resume = &eseries_tmio_resume,
502 static struct platform_device e740_t7l66xb_device = {
506 .platform_data = &e740_t7l66xb_info,
509 .resource = eseries_tmio_resources,
512 static struct platform_device e740_audio_device = {
513 .name = "e740-audio",
517 static struct gpiod_lookup_table e740_audio_gpio_table = {
518 .dev_id = "e740-audio",
520 GPIO_LOOKUP("gpio-pxa", GPIO_E740_WM9705_nAVDD2, "Audio power", GPIO_ACTIVE_HIGH),
521 GPIO_LOOKUP("gpio-pxa", GPIO_E740_AMP_ON, "Output amp", GPIO_ACTIVE_HIGH),
522 GPIO_LOOKUP("gpio-pxa", GPIO_E740_MIC_ON, "Mic amp", GPIO_ACTIVE_HIGH),
527 /* ----------------------------------------------------------------------- */
529 static struct platform_device *e740_devices[] __initdata = {
531 &e740_t7l66xb_device,
536 static void __init e740_init(void)
538 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
539 pxa_set_ffuart_info(NULL);
540 pxa_set_btuart_info(NULL);
541 pxa_set_stuart_info(NULL);
542 eseries_register_clks();
543 clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
544 "UDCCLK", &pxa25x_device_udc.dev),
545 eseries_get_tmio_gpios();
546 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
547 gpiod_add_lookup_table(&e740_audio_gpio_table);
548 platform_add_devices(ARRAY_AND_SIZE(e740_devices));
549 pxa_set_ac97_info(NULL);
550 pxa_set_ficp_info(&e7xx_ficp_platform_data);
553 MACHINE_START(E740, "Toshiba e740")
554 /* Maintainer: Ian Molton (spyro@f2s.com) */
555 .atag_offset = 0x100,
556 .map_io = pxa25x_map_io,
557 .nr_irqs = ESERIES_NR_IRQS,
558 .init_irq = pxa25x_init_irq,
559 .handle_irq = pxa25x_handle_irq,
560 .fixup = eseries_fixup,
561 .init_machine = e740_init,
562 .init_time = pxa_timer_init,
563 .restart = pxa_restart,
567 #ifdef CONFIG_MACH_E750
568 /* ---------------------- E750 LCD definitions -------------------- */
570 static struct w100_gen_regs e750_lcd_regs = {
571 .lcd_format = 0x00008003,
572 .lcdd_cntl1 = 0x00000000,
573 .lcdd_cntl2 = 0x0003ffff,
574 .genlcd_cntl1 = 0x00fff003,
575 .genlcd_cntl2 = 0x003c0f03,
576 .genlcd_cntl3 = 0x000143aa,
579 static struct w100_mode e750_lcd_mode = {
586 .crtc_ss = 0x80150014,
587 .crtc_ls = 0x8014000d,
588 .crtc_gs = 0xc1000005,
589 .crtc_vpos_gs = 0x00020147,
590 .crtc_rev = 0x0040010a,
591 .crtc_dclk = 0xa1700030,
592 .crtc_gclk = 0x80cc0015,
593 .crtc_goe = 0x80cc0015,
594 .crtc_ps1_active = 0x61060017,
597 .pixclk_divider_rotated = 4,
598 .pixclk_src = CLK_SRC_XTAL,
600 .sysclk_src = CLK_SRC_PLL,
603 static struct w100_gpio_regs e750_w100_gpio_info = {
604 .init_data1 = 0x01192f1b,
605 .gpio_dir1 = 0xd5ffdeff,
606 .gpio_oe1 = 0x000020bf,
607 .init_data2 = 0x010f010f,
608 .gpio_dir2 = 0xffffffff,
609 .gpio_oe2 = 0x000001cf,
612 static struct w100fb_mach_info e750_fb_info = {
613 .modelist = &e750_lcd_mode,
615 .regs = &e750_lcd_regs,
616 .gpio = &e750_w100_gpio_info,
617 .xtal_freq = 14318000,
621 static struct resource e750_fb_resources[] = {
625 .flags = IORESOURCE_MEM,
629 static struct platform_device e750_fb_device = {
633 .platform_data = &e750_fb_info,
635 .num_resources = ARRAY_SIZE(e750_fb_resources),
636 .resource = e750_fb_resources,
639 /* -------------------- e750 MFP parameters -------------------- */
641 static unsigned long e750_pin_config[] __initdata = {
643 GPIO15_nCS_1, /* CS1 - Flash */
644 GPIO79_nCS_3, /* CS3 - IMAGEON */
645 GPIO80_nCS_4, /* CS4 - TMIO */
655 /* TMIO controller */
656 GPIO19_GPIO, /* t7l66xb #PCLR */
657 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
664 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
668 GPIO29_AC97_SDATA_IN_0,
669 GPIO30_AC97_SDATA_OUT,
672 /* Audio power control */
673 GPIO4_GPIO, /* Headphone amp power */
674 GPIO7_GPIO, /* Speaker amp power */
675 GPIO37_GPIO, /* Headphone detect */
678 GPIO8_GPIO, /* CD0 */
679 GPIO44_GPIO, /* CD1 */
680 /* GPIO11_GPIO, IRQ0 */
681 GPIO6_GPIO, /* IRQ1 */
682 GPIO27_GPIO, /* RST0 */
683 GPIO24_GPIO, /* RST1 */
684 GPIO20_GPIO, /* PWR0 */
685 GPIO23_GPIO, /* PWR1 */
698 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
701 /* ----------------- e750 tc6393xb parameters ------------------ */
703 static struct tc6393xb_platform_data e750_tc6393xb_info = {
704 .irq_base = IRQ_BOARD_START,
705 .scr_pll2cr = 0x0cc1,
707 .suspend = &eseries_tmio_suspend,
708 .resume = &eseries_tmio_resume,
709 .enable = &eseries_tmio_enable,
710 .disable = &eseries_tmio_disable,
713 static struct platform_device e750_tc6393xb_device = {
717 .platform_data = &e750_tc6393xb_info,
720 .resource = eseries_tmio_resources,
723 static struct gpiod_lookup_table e750_audio_gpio_table = {
724 .dev_id = "e750-audio",
726 GPIO_LOOKUP("gpio-pxa", GPIO_E750_HP_AMP_OFF, "Output amp", GPIO_ACTIVE_LOW),
727 GPIO_LOOKUP("gpio-pxa", GPIO_E750_SPK_AMP_OFF, "Mic amp", GPIO_ACTIVE_LOW),
732 static struct platform_device e750_audio_device = {
733 .name = "e750-audio",
737 /* ------------------------------------------------------------- */
739 static struct platform_device *e750_devices[] __initdata = {
741 &e750_tc6393xb_device,
746 static void __init e750_init(void)
748 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
749 pxa_set_ffuart_info(NULL);
750 pxa_set_btuart_info(NULL);
751 pxa_set_stuart_info(NULL);
752 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
754 eseries_get_tmio_gpios();
755 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
756 gpiod_add_lookup_table(&e750_audio_gpio_table);
757 platform_add_devices(ARRAY_AND_SIZE(e750_devices));
758 pxa_set_ac97_info(NULL);
759 pxa_set_ficp_info(&e7xx_ficp_platform_data);
762 MACHINE_START(E750, "Toshiba e750")
763 /* Maintainer: Ian Molton (spyro@f2s.com) */
764 .atag_offset = 0x100,
765 .map_io = pxa25x_map_io,
766 .nr_irqs = ESERIES_NR_IRQS,
767 .init_irq = pxa25x_init_irq,
768 .handle_irq = pxa25x_handle_irq,
769 .fixup = eseries_fixup,
770 .init_machine = e750_init,
771 .init_time = pxa_timer_init,
772 .restart = pxa_restart,
776 #ifdef CONFIG_MACH_E800
777 /* ------------------------ e800 LCD definitions ------------------------- */
779 static unsigned long e800_pin_config[] __initdata = {
782 GPIO29_AC97_SDATA_IN_0,
783 GPIO30_AC97_SDATA_OUT,
790 static struct w100_gen_regs e800_lcd_regs = {
791 .lcd_format = 0x00008003,
792 .lcdd_cntl1 = 0x02a00000,
793 .lcdd_cntl2 = 0x0003ffff,
794 .genlcd_cntl1 = 0x000ff2a3,
795 .genlcd_cntl2 = 0x000002a3,
796 .genlcd_cntl3 = 0x000102aa,
799 static struct w100_mode e800_lcd_mode[2] = {
807 .crtc_ss = 0x80350034,
808 .crtc_ls = 0x802b0026,
809 .crtc_gs = 0x80160016,
810 .crtc_vpos_gs = 0x00020003,
811 .crtc_rev = 0x0040001d,
812 .crtc_dclk = 0xe0000000,
813 .crtc_gclk = 0x82a50049,
814 .crtc_goe = 0x80ee001c,
815 .crtc_ps1_active = 0x00000000,
818 .pixclk_divider_rotated = 6,
819 .pixclk_src = CLK_SRC_PLL,
821 .sysclk_src = CLK_SRC_PLL,
830 .crtc_ss = 0xd010000f,
831 .crtc_ls = 0x80070003,
832 .crtc_gs = 0x80000000,
833 .crtc_vpos_gs = 0x01460147,
834 .crtc_rev = 0x00400003,
835 .crtc_dclk = 0xa1700030,
836 .crtc_gclk = 0x814b0008,
837 .crtc_goe = 0x80cc0015,
838 .crtc_ps1_active = 0x00000000,
840 .pixclk_divider = 6, /* Wince uses 14 which gives a */
841 .pixclk_divider_rotated = 6, /* 7MHz Pclk. We use a 14MHz one */
842 .pixclk_src = CLK_SRC_PLL,
844 .sysclk_src = CLK_SRC_PLL,
849 static struct w100_gpio_regs e800_w100_gpio_info = {
850 .init_data1 = 0xc13fc019,
851 .gpio_dir1 = 0x3e40df7f,
852 .gpio_oe1 = 0x003c3000,
853 .init_data2 = 0x00000000,
854 .gpio_dir2 = 0x00000000,
855 .gpio_oe2 = 0x00000000,
858 static struct w100_mem_info e800_w100_mem_info = {
859 .ext_cntl = 0x09640011,
860 .sdram_mode_reg = 0x00600021,
861 .ext_timing_cntl = 0x10001545,
862 .io_cntl = 0x7ddd7333,
866 static void e800_tg_change(struct w100fb_par *par)
870 tmp = w100fb_gpio_read(W100_GPIO_PORT_A);
871 if (par->mode->xres == 480)
875 w100fb_gpio_write(W100_GPIO_PORT_A, tmp);
878 static struct w100_tg_info e800_tg_info = {
879 .change = e800_tg_change,
882 static struct w100fb_mach_info e800_fb_info = {
883 .modelist = e800_lcd_mode,
885 .regs = &e800_lcd_regs,
886 .gpio = &e800_w100_gpio_info,
887 .mem = &e800_w100_mem_info,
889 .xtal_freq = 16000000,
892 static struct resource e800_fb_resources[] = {
896 .flags = IORESOURCE_MEM,
900 static struct platform_device e800_fb_device = {
904 .platform_data = &e800_fb_info,
906 .num_resources = ARRAY_SIZE(e800_fb_resources),
907 .resource = e800_fb_resources,
910 /* --------------------------- UDC definitions --------------------------- */
912 static struct gpiod_lookup_table e800_gpio_vbus_gpiod_table = {
913 .dev_id = "gpio-vbus",
915 GPIO_LOOKUP("gpio-pxa", GPIO_E800_USB_DISC,
916 "vbus", GPIO_ACTIVE_HIGH),
917 GPIO_LOOKUP("gpio-pxa", GPIO_E800_USB_PULLUP,
918 "pullup", GPIO_ACTIVE_LOW),
923 static struct platform_device e800_gpio_vbus = {
929 /* ----------------- e800 tc6393xb parameters ------------------ */
931 static struct tc6393xb_platform_data e800_tc6393xb_info = {
932 .irq_base = IRQ_BOARD_START,
933 .scr_pll2cr = 0x0cc1,
935 .suspend = &eseries_tmio_suspend,
936 .resume = &eseries_tmio_resume,
937 .enable = &eseries_tmio_enable,
938 .disable = &eseries_tmio_disable,
941 static struct platform_device e800_tc6393xb_device = {
945 .platform_data = &e800_tc6393xb_info,
948 .resource = eseries_tmio_resources,
951 static struct gpiod_lookup_table e800_audio_gpio_table = {
952 .dev_id = "e800-audio",
954 GPIO_LOOKUP("gpio-pxa", GPIO_E800_HP_AMP_OFF, "Output amp", GPIO_ACTIVE_LOW),
955 GPIO_LOOKUP("gpio-pxa", GPIO_E800_SPK_AMP_ON, "Mic amp", GPIO_ACTIVE_HIGH),
960 static struct platform_device e800_audio_device = {
961 .name = "e800-audio",
965 /* ----------------------------------------------------------------------- */
967 static struct platform_device *e800_devices[] __initdata = {
969 &e800_tc6393xb_device,
974 static void __init e800_init(void)
976 pxa2xx_mfp_config(ARRAY_AND_SIZE(e800_pin_config));
977 pxa_set_ffuart_info(NULL);
978 pxa_set_btuart_info(NULL);
979 pxa_set_stuart_info(NULL);
980 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
982 eseries_get_tmio_gpios();
983 gpiod_add_lookup_table(&e800_gpio_vbus_gpiod_table);
984 gpiod_add_lookup_table(&e800_audio_gpio_table);
985 platform_add_devices(ARRAY_AND_SIZE(e800_devices));
986 pxa_set_ac97_info(NULL);
989 MACHINE_START(E800, "Toshiba e800")
990 /* Maintainer: Ian Molton (spyro@f2s.com) */
991 .atag_offset = 0x100,
992 .map_io = pxa25x_map_io,
993 .nr_irqs = ESERIES_NR_IRQS,
994 .init_irq = pxa25x_init_irq,
995 .handle_irq = pxa25x_handle_irq,
996 .fixup = eseries_fixup,
997 .init_machine = e800_init,
998 .init_time = pxa_timer_init,
999 .restart = pxa_restart,