Commit | Line | Data |
---|---|---|
7dc96414 IM |
1 | /* |
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> | |
0ec3cf69 IM |
15 | #include <linux/device.h> |
16 | #include <linux/platform_device.h> | |
17 | #include <linux/fb.h> | |
b1ae1b7b IM |
18 | #include <linux/clk.h> |
19 | #include <linux/mfd/t7l66xb.h> | |
0ec3cf69 IM |
20 | |
21 | #include <video/w100fb.h> | |
7dc96414 IM |
22 | |
23 | #include <asm/setup.h> | |
24 | #include <asm/mach/arch.h> | |
25 | #include <asm/mach-types.h> | |
26 | ||
51c62982 | 27 | #include <mach/pxa25x.h> |
b1ae1b7b | 28 | #include <mach/eseries-gpio.h> |
ebcce7b1 | 29 | #include <mach/udc.h> |
36033422 | 30 | #include <mach/irda.h> |
80b02c17 | 31 | #include <mach/irqs.h> |
7dc96414 IM |
32 | |
33 | #include "generic.h" | |
34 | #include "eseries.h" | |
b1ae1b7b IM |
35 | #include "clock.h" |
36 | #include "devices.h" | |
0ec3cf69 IM |
37 | |
38 | /* ------------------------ e740 video support --------------------------- */ | |
39 | ||
40 | static struct w100_gen_regs e740_lcd_regs = { | |
41 | .lcd_format = 0x00008023, | |
42 | .lcdd_cntl1 = 0x0f000000, | |
43 | .lcdd_cntl2 = 0x0003ffff, | |
44 | .genlcd_cntl1 = 0x00ffff03, | |
45 | .genlcd_cntl2 = 0x003c0f03, | |
46 | .genlcd_cntl3 = 0x000143aa, | |
47 | }; | |
48 | ||
49 | static struct w100_mode e740_lcd_mode = { | |
50 | .xres = 240, | |
51 | .yres = 320, | |
52 | .left_margin = 20, | |
53 | .right_margin = 28, | |
54 | .upper_margin = 9, | |
55 | .lower_margin = 8, | |
56 | .crtc_ss = 0x80140013, | |
57 | .crtc_ls = 0x81150110, | |
58 | .crtc_gs = 0x80050005, | |
59 | .crtc_vpos_gs = 0x000a0009, | |
60 | .crtc_rev = 0x0040010a, | |
61 | .crtc_dclk = 0xa906000a, | |
62 | .crtc_gclk = 0x80050108, | |
63 | .crtc_goe = 0x80050108, | |
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 | .crtc_ps1_active = 0x41060010, | |
71 | }; | |
72 | ||
73 | static struct w100_gpio_regs e740_w100_gpio_info = { | |
74 | .init_data1 = 0x21002103, | |
75 | .gpio_dir1 = 0xffffdeff, | |
76 | .gpio_oe1 = 0x03c00643, | |
77 | .init_data2 = 0x003f003f, | |
78 | .gpio_dir2 = 0xffffffff, | |
79 | .gpio_oe2 = 0x000000ff, | |
80 | }; | |
81 | ||
82 | static struct w100fb_mach_info e740_fb_info = { | |
83 | .modelist = &e740_lcd_mode, | |
84 | .num_modes = 1, | |
85 | .regs = &e740_lcd_regs, | |
86 | .gpio = &e740_w100_gpio_info, | |
87 | .xtal_freq = 14318000, | |
88 | .xtal_dbl = 1, | |
89 | }; | |
90 | ||
91 | static struct resource e740_fb_resources[] = { | |
92 | [0] = { | |
93 | .start = 0x0c000000, | |
94 | .end = 0x0cffffff, | |
95 | .flags = IORESOURCE_MEM, | |
96 | }, | |
97 | }; | |
98 | ||
99 | static struct platform_device e740_fb_device = { | |
100 | .name = "w100fb", | |
101 | .id = -1, | |
102 | .dev = { | |
103 | .platform_data = &e740_fb_info, | |
104 | }, | |
105 | .num_resources = ARRAY_SIZE(e740_fb_resources), | |
106 | .resource = e740_fb_resources, | |
107 | }; | |
108 | ||
109 | /* --------------------------- MFP Pin config -------------------------- */ | |
110 | ||
7dc96414 IM |
111 | static unsigned long e740_pin_config[] __initdata = { |
112 | /* Chip selects */ | |
113 | GPIO15_nCS_1, /* CS1 - Flash */ | |
114 | GPIO79_nCS_3, /* CS3 - IMAGEON */ | |
115 | GPIO80_nCS_4, /* CS4 - TMIO */ | |
116 | ||
117 | /* Clocks */ | |
118 | GPIO12_32KHz, | |
119 | ||
120 | /* BTUART */ | |
121 | GPIO42_BTUART_RXD, | |
122 | GPIO43_BTUART_TXD, | |
123 | GPIO44_BTUART_CTS, | |
b1ae1b7b IM |
124 | |
125 | /* TMIO controller */ | |
126 | GPIO19_GPIO, /* t7l66xb #PCLR */ | |
127 | GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */ | |
7dc96414 | 128 | |
f4ad9a96 IM |
129 | /* UDC */ |
130 | GPIO13_GPIO, | |
131 | GPIO3_GPIO, | |
132 | ||
36033422 IM |
133 | /* IrDA */ |
134 | GPIO38_GPIO | MFP_LPM_DRIVE_HIGH, | |
135 | ||
7dc96414 IM |
136 | /* PC Card */ |
137 | GPIO8_GPIO, /* CD0 */ | |
138 | GPIO44_GPIO, /* CD1 */ | |
139 | GPIO11_GPIO, /* IRQ0 */ | |
140 | GPIO6_GPIO, /* IRQ1 */ | |
141 | GPIO27_GPIO, /* RST0 */ | |
142 | GPIO24_GPIO, /* RST1 */ | |
143 | GPIO20_GPIO, /* PWR0 */ | |
144 | GPIO23_GPIO, /* PWR1 */ | |
145 | GPIO48_nPOE, | |
146 | GPIO49_nPWE, | |
147 | GPIO50_nPIOR, | |
148 | GPIO51_nPIOW, | |
149 | GPIO52_nPCE_1, | |
150 | GPIO53_nPCE_2, | |
151 | GPIO54_nPSKTSEL, | |
152 | GPIO55_nPREG, | |
153 | GPIO56_nPWAIT, | |
154 | GPIO57_nIOIS16, | |
155 | ||
156 | /* wakeup */ | |
157 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, | |
158 | }; | |
159 | ||
b1ae1b7b IM |
160 | /* -------------------- e740 t7l66xb parameters -------------------- */ |
161 | ||
162 | static struct t7l66xb_platform_data e740_t7l66xb_info = { | |
163 | .irq_base = IRQ_BOARD_START, | |
164 | .enable = &eseries_tmio_enable, | |
165 | .suspend = &eseries_tmio_suspend, | |
166 | .resume = &eseries_tmio_resume, | |
167 | }; | |
168 | ||
169 | static struct platform_device e740_t7l66xb_device = { | |
170 | .name = "t7l66xb", | |
171 | .id = -1, | |
172 | .dev = { | |
173 | .platform_data = &e740_t7l66xb_info, | |
174 | }, | |
175 | .num_resources = 2, | |
176 | .resource = eseries_tmio_resources, | |
177 | }; | |
178 | ||
0ec3cf69 IM |
179 | /* ----------------------------------------------------------------------- */ |
180 | ||
181 | static struct platform_device *devices[] __initdata = { | |
182 | &e740_fb_device, | |
b1ae1b7b | 183 | &e740_t7l66xb_device, |
0ec3cf69 IM |
184 | }; |
185 | ||
7dc96414 IM |
186 | static void __init e740_init(void) |
187 | { | |
188 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config)); | |
b1ae1b7b IM |
189 | eseries_register_clks(); |
190 | clk_add_alias("CLK_CK48M", &e740_t7l66xb_device.dev, | |
191 | "UDCCLK", &pxa25x_device_udc.dev), | |
192 | eseries_get_tmio_gpios(); | |
0ec3cf69 | 193 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
ebcce7b1 | 194 | pxa_set_udc_info(&e7xx_udc_mach_info); |
36033422 IM |
195 | e7xx_irda_init(); |
196 | pxa_set_ficp_info(&e7xx_ficp_platform_data); | |
7dc96414 IM |
197 | } |
198 | ||
199 | MACHINE_START(E740, "Toshiba e740") | |
200 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | |
201 | .phys_io = 0x40000000, | |
202 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | |
203 | .boot_params = 0xa0000100, | |
204 | .map_io = pxa_map_io, | |
205 | .init_irq = pxa25x_init_irq, | |
206 | .fixup = eseries_fixup, | |
207 | .init_machine = e740_init, | |
208 | .timer = &pxa_timer, | |
209 | MACHINE_END | |
210 |