blob: a6fff782e7a8cfcd78c0a267f5f4817dfb309c3a [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/clk.h>
19#include <linux/mfd/t7l66xb.h>
Ian Molton0ec3cf62008-08-19 13:01:28 +010020
21#include <video/w100fb.h>
Ian Molton7dc96412008-08-19 12:14:21 +010022
23#include <asm/setup.h>
24#include <asm/mach/arch.h>
25#include <asm/mach-types.h>
26
27#include <mach/mfp-pxa25x.h>
Ian Moltonb1ae1b72008-09-26 13:38:59 +010028#include <mach/pxa-regs.h>
Ian Molton7dc96412008-08-19 12:14:21 +010029#include <mach/hardware.h>
Ian Moltonb1ae1b72008-09-26 13:38:59 +010030#include <mach/eseries-gpio.h>
Ian Moltonebcce7b2008-08-19 13:34:56 +010031#include <mach/udc.h>
Ian Molton36033422008-08-24 19:21:26 +010032#include <mach/irda.h>
Russell King80b02c12009-01-08 10:01:47 +000033#include <mach/irqs.h>
Ian Molton7dc96412008-08-19 12:14:21 +010034
35#include "generic.h"
36#include "eseries.h"
Ian Moltonb1ae1b72008-09-26 13:38:59 +010037#include "clock.h"
38#include "devices.h"
Ian Molton0ec3cf62008-08-19 13:01:28 +010039
40/* ------------------------ e740 video support --------------------------- */
41
42static struct w100_gen_regs e740_lcd_regs = {
43 .lcd_format = 0x00008023,
44 .lcdd_cntl1 = 0x0f000000,
45 .lcdd_cntl2 = 0x0003ffff,
46 .genlcd_cntl1 = 0x00ffff03,
47 .genlcd_cntl2 = 0x003c0f03,
48 .genlcd_cntl3 = 0x000143aa,
49};
50
51static struct w100_mode e740_lcd_mode = {
52 .xres = 240,
53 .yres = 320,
54 .left_margin = 20,
55 .right_margin = 28,
56 .upper_margin = 9,
57 .lower_margin = 8,
58 .crtc_ss = 0x80140013,
59 .crtc_ls = 0x81150110,
60 .crtc_gs = 0x80050005,
61 .crtc_vpos_gs = 0x000a0009,
62 .crtc_rev = 0x0040010a,
63 .crtc_dclk = 0xa906000a,
64 .crtc_gclk = 0x80050108,
65 .crtc_goe = 0x80050108,
66 .pll_freq = 57,
67 .pixclk_divider = 4,
68 .pixclk_divider_rotated = 4,
69 .pixclk_src = CLK_SRC_XTAL,
70 .sysclk_divider = 1,
71 .sysclk_src = CLK_SRC_PLL,
72 .crtc_ps1_active = 0x41060010,
73};
74
75static struct w100_gpio_regs e740_w100_gpio_info = {
76 .init_data1 = 0x21002103,
77 .gpio_dir1 = 0xffffdeff,
78 .gpio_oe1 = 0x03c00643,
79 .init_data2 = 0x003f003f,
80 .gpio_dir2 = 0xffffffff,
81 .gpio_oe2 = 0x000000ff,
82};
83
84static struct w100fb_mach_info e740_fb_info = {
85 .modelist = &e740_lcd_mode,
86 .num_modes = 1,
87 .regs = &e740_lcd_regs,
88 .gpio = &e740_w100_gpio_info,
89 .xtal_freq = 14318000,
90 .xtal_dbl = 1,
91};
92
93static struct resource e740_fb_resources[] = {
94 [0] = {
95 .start = 0x0c000000,
96 .end = 0x0cffffff,
97 .flags = IORESOURCE_MEM,
98 },
99};
100
101static struct platform_device e740_fb_device = {
102 .name = "w100fb",
103 .id = -1,
104 .dev = {
105 .platform_data = &e740_fb_info,
106 },
107 .num_resources = ARRAY_SIZE(e740_fb_resources),
108 .resource = e740_fb_resources,
109};
110
111/* --------------------------- MFP Pin config -------------------------- */
112
Ian Molton7dc96412008-08-19 12:14:21 +0100113static unsigned long e740_pin_config[] __initdata = {
114 /* Chip selects */
115 GPIO15_nCS_1, /* CS1 - Flash */
116 GPIO79_nCS_3, /* CS3 - IMAGEON */
117 GPIO80_nCS_4, /* CS4 - TMIO */
118
119 /* Clocks */
120 GPIO12_32KHz,
121
122 /* BTUART */
123 GPIO42_BTUART_RXD,
124 GPIO43_BTUART_TXD,
125 GPIO44_BTUART_CTS,
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100126
127 /* TMIO controller */
128 GPIO19_GPIO, /* t7l66xb #PCLR */
129 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
Ian Molton7dc96412008-08-19 12:14:21 +0100130
Ian Moltonf4ad9a92008-09-26 13:35:28 +0100131 /* UDC */
132 GPIO13_GPIO,
133 GPIO3_GPIO,
134
Ian Molton36033422008-08-24 19:21:26 +0100135 /* IrDA */
136 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
137
Ian Molton28796ea2009-01-17 15:11:06 +0000138 /* Audio power control */
139 GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
140 GPIO40_GPIO, /* Mic amp power */
141 GPIO41_GPIO, /* Headphone amp power */
142
Ian Molton7dc96412008-08-19 12:14:21 +0100143 /* PC Card */
144 GPIO8_GPIO, /* CD0 */
145 GPIO44_GPIO, /* CD1 */
146 GPIO11_GPIO, /* IRQ0 */
147 GPIO6_GPIO, /* IRQ1 */
148 GPIO27_GPIO, /* RST0 */
149 GPIO24_GPIO, /* RST1 */
150 GPIO20_GPIO, /* PWR0 */
151 GPIO23_GPIO, /* PWR1 */
152 GPIO48_nPOE,
153 GPIO49_nPWE,
154 GPIO50_nPIOR,
155 GPIO51_nPIOW,
156 GPIO52_nPCE_1,
157 GPIO53_nPCE_2,
158 GPIO54_nPSKTSEL,
159 GPIO55_nPREG,
160 GPIO56_nPWAIT,
161 GPIO57_nIOIS16,
162
163 /* wakeup */
164 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
165};
166
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100167/* -------------------- e740 t7l66xb parameters -------------------- */
168
169static struct t7l66xb_platform_data e740_t7l66xb_info = {
170 .irq_base = IRQ_BOARD_START,
171 .enable = &eseries_tmio_enable,
172 .suspend = &eseries_tmio_suspend,
173 .resume = &eseries_tmio_resume,
174};
175
176static struct platform_device e740_t7l66xb_device = {
177 .name = "t7l66xb",
178 .id = -1,
179 .dev = {
180 .platform_data = &e740_t7l66xb_info,
181 },
182 .num_resources = 2,
183 .resource = eseries_tmio_resources,
184};
185
Ian Molton0ec3cf62008-08-19 13:01:28 +0100186/* ----------------------------------------------------------------------- */
187
188static struct platform_device *devices[] __initdata = {
189 &e740_fb_device,
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100190 &e740_t7l66xb_device,
Ian Molton0ec3cf62008-08-19 13:01:28 +0100191};
192
Ian Molton7dc96412008-08-19 12:14:21 +0100193static void __init e740_init(void)
194{
195 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100196 eseries_register_clks();
197 clk_add_alias("CLK_CK48M", &e740_t7l66xb_device.dev,
198 "UDCCLK", &pxa25x_device_udc.dev),
199 eseries_get_tmio_gpios();
Ian Molton0ec3cf62008-08-19 13:01:28 +0100200 platform_add_devices(devices, ARRAY_SIZE(devices));
Ian Moltonebcce7b2008-08-19 13:34:56 +0100201 pxa_set_udc_info(&e7xx_udc_mach_info);
Ian Molton36033422008-08-24 19:21:26 +0100202 e7xx_irda_init();
203 pxa_set_ficp_info(&e7xx_ficp_platform_data);
Ian Molton7dc96412008-08-19 12:14:21 +0100204}
205
206MACHINE_START(E740, "Toshiba e740")
207 /* Maintainer: Ian Molton (spyro@f2s.com) */
208 .phys_io = 0x40000000,
209 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
210 .boot_params = 0xa0000100,
211 .map_io = pxa_map_io,
212 .init_irq = pxa25x_init_irq,
213 .fixup = eseries_fixup,
214 .init_machine = e740_init,
215 .timer = &pxa_timer,
216MACHINE_END
217