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