blob: af83caa52dd42147bc45c4fe83e5ea8a7cae2965 [file] [log] [blame]
Ian Molton7dc96412008-08-19 12:14:21 +01001/*
2 * Hardware definitions for the Toshiba eseries PDAs
3 *
4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
5 *
6 * This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
Ian Molton0ec3cf62008-08-19 13:01:28 +010015#include <linux/device.h>
16#include <linux/platform_device.h>
17#include <linux/fb.h>
Ian Moltonb1ae1b72008-09-26 13:38:59 +010018#include <linux/mfd/tc6393xb.h>
Ian Molton0ec3cf62008-08-19 13:01:28 +010019
20#include <video/w100fb.h>
Ian Molton7dc96412008-08-19 12:14:21 +010021
22#include <asm/setup.h>
23#include <asm/mach/arch.h>
24#include <asm/mach-types.h>
25
Eric Miao51c62982009-01-02 23:17:22 +080026#include <mach/pxa25x.h>
Ian Moltonb1ae1b72008-09-26 13:38:59 +010027#include <mach/eseries-gpio.h>
Ian Moltonebcce7b2008-08-19 13:34:56 +010028#include <mach/udc.h>
Ian Molton36033422008-08-24 19:21:26 +010029#include <mach/irda.h>
Russell King80b02c12009-01-08 10:01:47 +000030#include <mach/irqs.h>
Mark Brown80748fb2009-04-03 12:45:49 +010031#include <mach/audio.h>
Ian Molton7dc96412008-08-19 12:14:21 +010032
33#include "generic.h"
34#include "eseries.h"
Ian Moltonb1ae1b72008-09-26 13:38:59 +010035#include "clock.h"
Ian Molton7dc96412008-08-19 12:14:21 +010036
Ian Molton0ec3cf62008-08-19 13:01:28 +010037/* ---------------------- E750 LCD definitions -------------------- */
38
39static struct w100_gen_regs e750_lcd_regs = {
40 .lcd_format = 0x00008003,
41 .lcdd_cntl1 = 0x00000000,
42 .lcdd_cntl2 = 0x0003ffff,
43 .genlcd_cntl1 = 0x00fff003,
44 .genlcd_cntl2 = 0x003c0f03,
45 .genlcd_cntl3 = 0x000143aa,
46};
47
48static struct w100_mode e750_lcd_mode = {
49 .xres = 240,
50 .yres = 320,
51 .left_margin = 21,
52 .right_margin = 22,
53 .upper_margin = 5,
54 .lower_margin = 4,
55 .crtc_ss = 0x80150014,
56 .crtc_ls = 0x8014000d,
57 .crtc_gs = 0xc1000005,
58 .crtc_vpos_gs = 0x00020147,
59 .crtc_rev = 0x0040010a,
60 .crtc_dclk = 0xa1700030,
61 .crtc_gclk = 0x80cc0015,
62 .crtc_goe = 0x80cc0015,
63 .crtc_ps1_active = 0x61060017,
64 .pll_freq = 57,
65 .pixclk_divider = 4,
66 .pixclk_divider_rotated = 4,
67 .pixclk_src = CLK_SRC_XTAL,
68 .sysclk_divider = 1,
69 .sysclk_src = CLK_SRC_PLL,
70};
71
72static struct w100_gpio_regs e750_w100_gpio_info = {
73 .init_data1 = 0x01192f1b,
74 .gpio_dir1 = 0xd5ffdeff,
75 .gpio_oe1 = 0x000020bf,
76 .init_data2 = 0x010f010f,
77 .gpio_dir2 = 0xffffffff,
78 .gpio_oe2 = 0x000001cf,
79};
80
81static struct w100fb_mach_info e750_fb_info = {
82 .modelist = &e750_lcd_mode,
83 .num_modes = 1,
84 .regs = &e750_lcd_regs,
85 .gpio = &e750_w100_gpio_info,
86 .xtal_freq = 14318000,
87 .xtal_dbl = 1,
88};
89
90static struct resource e750_fb_resources[] = {
91 [0] = {
92 .start = 0x0c000000,
93 .end = 0x0cffffff,
94 .flags = IORESOURCE_MEM,
95 },
96};
97
98static struct platform_device e750_fb_device = {
99 .name = "w100fb",
100 .id = -1,
101 .dev = {
102 .platform_data = &e750_fb_info,
103 },
104 .num_resources = ARRAY_SIZE(e750_fb_resources),
105 .resource = e750_fb_resources,
106};
107
Ian Moltone1c4a2d2008-12-30 23:22:41 +0000108/* -------------------- e750 MFP parameters -------------------- */
109
110static unsigned long e750_pin_config[] __initdata = {
111 /* Chip selects */
112 GPIO15_nCS_1, /* CS1 - Flash */
113 GPIO79_nCS_3, /* CS3 - IMAGEON */
114 GPIO80_nCS_4, /* CS4 - TMIO */
115
116 /* Clocks */
117 GPIO11_3_6MHz,
118
119 /* BTUART */
120 GPIO42_BTUART_RXD,
121 GPIO43_BTUART_TXD,
122 GPIO44_BTUART_CTS,
123
124 /* TMIO controller */
125 GPIO19_GPIO, /* t7l66xb #PCLR */
126 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
127
128 /* UDC */
129 GPIO13_GPIO,
130 GPIO3_GPIO,
131
132 /* IrDA */
133 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
134
Eric Miaoc11b6a42010-01-04 17:00:13 +0800135 /* AC97 */
136 GPIO28_AC97_BITCLK,
137 GPIO29_AC97_SDATA_IN_0,
138 GPIO30_AC97_SDATA_OUT,
139 GPIO31_AC97_SYNC,
140
Ian Moltona7e2e732009-01-08 21:03:55 +0000141 /* Audio power control */
142 GPIO4_GPIO, /* Headphone amp power */
143 GPIO7_GPIO, /* Speaker amp power */
144 GPIO37_GPIO, /* Headphone detect */
145
Ian Moltone1c4a2d2008-12-30 23:22:41 +0000146 /* PC Card */
147 GPIO8_GPIO, /* CD0 */
148 GPIO44_GPIO, /* CD1 */
149 GPIO11_GPIO, /* IRQ0 */
150 GPIO6_GPIO, /* IRQ1 */
151 GPIO27_GPIO, /* RST0 */
152 GPIO24_GPIO, /* RST1 */
153 GPIO20_GPIO, /* PWR0 */
154 GPIO23_GPIO, /* PWR1 */
155 GPIO48_nPOE,
156 GPIO49_nPWE,
157 GPIO50_nPIOR,
158 GPIO51_nPIOW,
159 GPIO52_nPCE_1,
160 GPIO53_nPCE_2,
161 GPIO54_nPSKTSEL,
162 GPIO55_nPREG,
163 GPIO56_nPWAIT,
164 GPIO57_nIOIS16,
165
166 /* wakeup */
167 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
168};
169
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100170/* ----------------- e750 tc6393xb parameters ------------------ */
171
172static struct tc6393xb_platform_data e750_tc6393xb_info = {
173 .irq_base = IRQ_BOARD_START,
174 .scr_pll2cr = 0x0cc1,
175 .scr_gper = 0,
176 .gpio_base = -1,
177 .suspend = &eseries_tmio_suspend,
178 .resume = &eseries_tmio_resume,
179 .enable = &eseries_tmio_enable,
180 .disable = &eseries_tmio_disable,
181};
182
183static struct platform_device e750_tc6393xb_device = {
184 .name = "tc6393xb",
185 .id = -1,
186 .dev = {
187 .platform_data = &e750_tc6393xb_info,
188 },
189 .num_resources = 2,
190 .resource = eseries_tmio_resources,
191};
192
193/* ------------------------------------------------------------- */
Ian Molton0ec3cf62008-08-19 13:01:28 +0100194
195static struct platform_device *devices[] __initdata = {
196 &e750_fb_device,
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100197 &e750_tc6393xb_device,
Ian Molton0ec3cf62008-08-19 13:01:28 +0100198};
199
200static void __init e750_init(void)
201{
Ian Moltone1c4a2d2008-12-30 23:22:41 +0000202 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
Russell Kingcc155c62009-11-09 13:34:08 +0800203 pxa_set_ffuart_info(NULL);
204 pxa_set_btuart_info(NULL);
205 pxa_set_stuart_info(NULL);
Dmitry Eremin-Solenikovc68ffdd2009-03-05 18:17:53 +0300206 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100207 "GPIO11_CLK", NULL),
208 eseries_get_tmio_gpios();
Ian Molton0ec3cf62008-08-19 13:01:28 +0100209 platform_add_devices(devices, ARRAY_SIZE(devices));
Ian Moltonebcce7b2008-08-19 13:34:56 +0100210 pxa_set_udc_info(&e7xx_udc_mach_info);
Mark Brown80748fb2009-04-03 12:45:49 +0100211 pxa_set_ac97_info(NULL);
Ian Molton36033422008-08-24 19:21:26 +0100212 pxa_set_ficp_info(&e7xx_ficp_platform_data);
Ian Molton0ec3cf62008-08-19 13:01:28 +0100213}
214
Ian Molton7dc96412008-08-19 12:14:21 +0100215MACHINE_START(E750, "Toshiba e750")
216 /* Maintainer: Ian Molton (spyro@f2s.com) */
217 .phys_io = 0x40000000,
218 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
219 .boot_params = 0xa0000100,
220 .map_io = pxa_map_io,
221 .init_irq = pxa25x_init_irq,
222 .fixup = eseries_fixup,
Ian Molton0ec3cf62008-08-19 13:01:28 +0100223 .init_machine = e750_init,
Ian Molton7dc96412008-08-19 12:14:21 +0100224 .timer = &pxa_timer,
225MACHINE_END
226