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