Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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