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