blob: f79a610c62fc36c629002b855da09800883055a9 [file] [log] [blame]
Ian Molton3abcd192007-11-19 13:16:56 +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
Ian Molton28365482008-08-09 21:48:45 +010013#include <linux/kernel.h>
Ian Molton3abcd192007-11-19 13:16:56 +010014#include <linux/init.h>
Ian Molton36033422008-08-24 19:21:26 +010015#include <linux/gpio.h>
Ian Moltonb1ae1b72008-09-26 13:38:59 +010016#include <linux/delay.h>
Ian Molton36033422008-08-24 19:21:26 +010017#include <linux/platform_device.h>
Eric Miaoe478fe42010-06-20 20:35:32 +080018#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>
Dmitry Eremin-Solenikov133dce02011-02-14 15:33:16 +030023#include <linux/usb/gpio_vbus.h>
Eric Miaoe478fe42010-06-20 20:35:32 +080024
25#include <video/w100fb.h>
Ian Molton3abcd192007-11-19 13:16:56 +010026
27#include <asm/setup.h>
28#include <asm/mach/arch.h>
Ian Molton3abcd192007-11-19 13:16:56 +010029#include <asm/mach-types.h>
30
Eric Miao51c62982009-01-02 23:17:22 +080031#include <mach/pxa25x.h>
Ian Moltonebcce7b2008-08-19 13:34:56 +010032#include <mach/eseries-gpio.h>
Haojian Zhuang6ac6b812010-08-20 15:23:59 +080033#include <mach/eseries-irq.h>
Eric Miaoe478fe42010-06-20 20:35:32 +080034#include <mach/audio.h>
35#include <mach/pxafb.h>
Ian Moltonebcce7b2008-08-19 13:34:56 +010036#include <mach/udc.h>
Ian Molton36033422008-08-24 19:21:26 +010037#include <mach/irda.h>
Ian Molton28365482008-08-09 21:48:45 +010038
Eric Miaoe478fe42010-06-20 20:35:32 +080039#include "devices.h"
Ian Molton877e03d2008-06-25 22:22:49 +010040#include "generic.h"
Ian Moltonb1ae1b72008-09-26 13:38:59 +010041#include "clock.h"
Ian Molton3abcd192007-11-19 13:16:56 +010042
43/* Only e800 has 128MB RAM */
Russell King0744a3e2010-12-20 10:37:50 +000044void __init eseries_fixup(struct tag *tags, char **cmdline, struct meminfo *mi)
Ian Molton3abcd192007-11-19 13:16:56 +010045{
46 mi->nr_banks=1;
47 mi->bank[0].start = 0xa0000000;
Ian Molton3abcd192007-11-19 13:16:56 +010048 if (machine_is_e800())
49 mi->bank[0].size = (128*1024*1024);
50 else
51 mi->bank[0].size = (64*1024*1024);
52}
53
Dmitry Eremin-Solenikov133dce02011-02-14 15:33:16 +030054struct gpio_vbus_mach_info e7xx_udc_info = {
Ian Moltonebcce7b2008-08-19 13:34:56 +010055 .gpio_vbus = GPIO_E7XX_USB_DISC,
56 .gpio_pullup = GPIO_E7XX_USB_PULLUP,
57 .gpio_pullup_inverted = 1
58};
59
Dmitry Eremin-Solenikov133dce02011-02-14 15:33:16 +030060static struct platform_device e7xx_gpio_vbus = {
61 .name = "gpio-vbus",
62 .id = -1,
63 .dev = {
64 .platform_data = &e7xx_udc_info,
65 },
66};
67
Ian Molton36033422008-08-24 19:21:26 +010068struct pxaficp_platform_data e7xx_ficp_platform_data = {
Marek Vasutc4bd0172009-07-17 12:50:43 +020069 .gpio_pwdown = GPIO_E7XX_IR_OFF,
70 .transceiver_cap = IR_SIRMODE | IR_OFF,
Ian Molton36033422008-08-24 19:21:26 +010071};
72
Ian Moltonb1ae1b72008-09-26 13:38:59 +010073int 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
86int 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
93int eseries_tmio_suspend(struct platform_device *dev)
94{
95 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
96 return 0;
97}
98
99int 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
106void 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. */
115struct resource eseries_tmio_resources[] = {
116 [0] = {
117 .start = PXA_CS4_PHYS,
118 .end = PXA_CS4_PHYS + 0x1fffff,
119 .flags = IORESOURCE_MEM,
120 },
121 [1] = {
Haojian Zhuang6384fda2011-10-10 14:21:08 +0800122 .start = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
123 .end = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100124 .flags = IORESOURCE_IRQ,
125 },
126};
127
128/* Some e-series hardware cannot control the 32K clock */
129static void clk_32k_dummy(struct clk *clk)
130{
131}
132
133static const struct clkops clk_32k_dummy_ops = {
134 .enable = clk_32k_dummy,
135 .disable = clk_32k_dummy,
136};
137
138static struct clk tmio_dummy_clk = {
139 .ops = &clk_32k_dummy_ops,
140 .rate = 32768,
141};
142
143static struct clk_lookup eseries_clkregs[] = {
144 INIT_CLKREG(&tmio_dummy_clk, NULL, "CLK_CK32K"),
145};
146
Russell King955d2952011-10-27 11:37:47 +0100147static void __init eseries_register_clks(void)
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100148{
Russell King0a0300d2010-01-12 12:28:00 +0000149 clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs));
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100150}
151
Eric Miaoe478fe42010-06-20 20:35:32 +0800152#ifdef CONFIG_MACH_E330
153/* -------------------- e330 tc6387xb parameters -------------------- */
154
155static 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
162static 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
174static struct platform_device *e330_devices[] __initdata = {
175 &e330_tc6387xb_device,
Dmitry Eremin-Solenikov133dce02011-02-14 15:33:16 +0300176 &e7xx_gpio_vbus,
Eric Miaoe478fe42010-06-20 20:35:32 +0800177};
178
179static 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));
Eric Miaoe478fe42010-06-20 20:35:32 +0800187}
188
189MACHINE_START(E330, "Toshiba e330")
190 /* Maintainer: Ian Molton (spyro@f2s.com) */
Nicolas Pitre7375aba2011-07-05 22:38:15 -0400191 .atag_offset = 0x100,
Marek Vasut851982c2010-10-11 02:20:19 +0200192 .map_io = pxa25x_map_io,
Haojian Zhuang6ac6b812010-08-20 15:23:59 +0800193 .nr_irqs = ESERIES_NR_IRQS,
Eric Miaoe478fe42010-06-20 20:35:32 +0800194 .init_irq = pxa25x_init_irq,
Eric Miao8a97ae22011-05-18 21:30:04 +0800195 .handle_irq = pxa25x_handle_irq,
Eric Miaoe478fe42010-06-20 20:35:32 +0800196 .fixup = eseries_fixup,
197 .init_machine = e330_init,
198 .timer = &pxa_timer,
Russell King271a74f2011-11-04 14:15:53 +0000199 .restart = pxa_restart,
Eric Miaoe478fe42010-06-20 20:35:32 +0800200MACHINE_END
201#endif
202
203#ifdef CONFIG_MACH_E350
204/* -------------------- e350 t7l66xb parameters -------------------- */
205
206static struct t7l66xb_platform_data e350_t7l66xb_info = {
207 .irq_base = IRQ_BOARD_START,
208 .enable = &eseries_tmio_enable,
209 .suspend = &eseries_tmio_suspend,
210 .resume = &eseries_tmio_resume,
211};
212
213static struct platform_device e350_t7l66xb_device = {
214 .name = "t7l66xb",
215 .id = -1,
216 .dev = {
217 .platform_data = &e350_t7l66xb_info,
218 },
219 .num_resources = 2,
220 .resource = eseries_tmio_resources,
221};
222
223/* ---------------------------------------------------------- */
224
225static struct platform_device *e350_devices[] __initdata = {
226 &e350_t7l66xb_device,
Dmitry Eremin-Solenikov133dce02011-02-14 15:33:16 +0300227 &e7xx_gpio_vbus,
Eric Miaoe478fe42010-06-20 20:35:32 +0800228};
229
230static void __init e350_init(void)
231{
232 pxa_set_ffuart_info(NULL);
233 pxa_set_btuart_info(NULL);
234 pxa_set_stuart_info(NULL);
235 eseries_register_clks();
236 eseries_get_tmio_gpios();
237 platform_add_devices(ARRAY_AND_SIZE(e350_devices));
Eric Miaoe478fe42010-06-20 20:35:32 +0800238}
239
240MACHINE_START(E350, "Toshiba e350")
241 /* Maintainer: Ian Molton (spyro@f2s.com) */
Nicolas Pitre7375aba2011-07-05 22:38:15 -0400242 .atag_offset = 0x100,
Marek Vasut851982c2010-10-11 02:20:19 +0200243 .map_io = pxa25x_map_io,
Haojian Zhuang6ac6b812010-08-20 15:23:59 +0800244 .nr_irqs = ESERIES_NR_IRQS,
Eric Miaoe478fe42010-06-20 20:35:32 +0800245 .init_irq = pxa25x_init_irq,
Eric Miao8a97ae22011-05-18 21:30:04 +0800246 .handle_irq = pxa25x_handle_irq,
Eric Miaoe478fe42010-06-20 20:35:32 +0800247 .fixup = eseries_fixup,
248 .init_machine = e350_init,
249 .timer = &pxa_timer,
Russell King271a74f2011-11-04 14:15:53 +0000250 .restart = pxa_restart,
Eric Miaoe478fe42010-06-20 20:35:32 +0800251MACHINE_END
252#endif
253
254#ifdef CONFIG_MACH_E400
255/* ------------------------ E400 LCD definitions ------------------------ */
256
257static struct pxafb_mode_info e400_pxafb_mode_info = {
258 .pixclock = 140703,
259 .xres = 240,
260 .yres = 320,
261 .bpp = 16,
262 .hsync_len = 4,
263 .left_margin = 28,
264 .right_margin = 8,
265 .vsync_len = 3,
266 .upper_margin = 5,
267 .lower_margin = 6,
268 .sync = 0,
269};
270
271static struct pxafb_mach_info e400_pxafb_mach_info = {
272 .modes = &e400_pxafb_mode_info,
273 .num_modes = 1,
274 .lcd_conn = LCD_COLOR_TFT_16BPP,
275 .lccr3 = 0,
276 .pxafb_backlight_power = NULL,
277};
278
279/* ------------------------ E400 MFP config ----------------------------- */
280
281static unsigned long e400_pin_config[] __initdata = {
282 /* Chip selects */
283 GPIO15_nCS_1, /* CS1 - Flash */
284 GPIO80_nCS_4, /* CS4 - TMIO */
285
286 /* Clocks */
287 GPIO12_32KHz,
288
289 /* BTUART */
290 GPIO42_BTUART_RXD,
291 GPIO43_BTUART_TXD,
292 GPIO44_BTUART_CTS,
293
294 /* TMIO controller */
295 GPIO19_GPIO, /* t7l66xb #PCLR */
296 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
297
298 /* wakeup */
299 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
300};
301
302/* ---------------------------------------------------------------------- */
303
304static struct mtd_partition partition_a = {
305 .name = "Internal NAND flash",
306 .offset = 0,
307 .size = MTDPART_SIZ_FULL,
308};
309
310static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
311
312static struct nand_bbt_descr e400_t7l66xb_nand_bbt = {
313 .options = 0,
314 .offs = 4,
315 .len = 2,
316 .pattern = scan_ff_pattern
317};
318
319static struct tmio_nand_data e400_t7l66xb_nand_config = {
320 .num_partitions = 1,
321 .partition = &partition_a,
322 .badblock_pattern = &e400_t7l66xb_nand_bbt,
323};
324
325static struct t7l66xb_platform_data e400_t7l66xb_info = {
326 .irq_base = IRQ_BOARD_START,
327 .enable = &eseries_tmio_enable,
328 .suspend = &eseries_tmio_suspend,
329 .resume = &eseries_tmio_resume,
330
331 .nand_data = &e400_t7l66xb_nand_config,
332};
333
334static struct platform_device e400_t7l66xb_device = {
335 .name = "t7l66xb",
336 .id = -1,
337 .dev = {
338 .platform_data = &e400_t7l66xb_info,
339 },
340 .num_resources = 2,
341 .resource = eseries_tmio_resources,
342};
343
344/* ---------------------------------------------------------- */
345
346static struct platform_device *e400_devices[] __initdata = {
347 &e400_t7l66xb_device,
Dmitry Eremin-Solenikov133dce02011-02-14 15:33:16 +0300348 &e7xx_gpio_vbus,
Eric Miaoe478fe42010-06-20 20:35:32 +0800349};
350
351static void __init e400_init(void)
352{
353 pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config));
354 pxa_set_ffuart_info(NULL);
355 pxa_set_btuart_info(NULL);
356 pxa_set_stuart_info(NULL);
357 /* Fixme - e400 may have a switched clock */
358 eseries_register_clks();
359 eseries_get_tmio_gpios();
Russell King - ARM Linux4321e1a2011-02-15 15:37:30 +0800360 pxa_set_fb_info(NULL, &e400_pxafb_mach_info);
Eric Miaoe478fe42010-06-20 20:35:32 +0800361 platform_add_devices(ARRAY_AND_SIZE(e400_devices));
Eric Miaoe478fe42010-06-20 20:35:32 +0800362}
363
364MACHINE_START(E400, "Toshiba e400")
365 /* Maintainer: Ian Molton (spyro@f2s.com) */
Nicolas Pitre7375aba2011-07-05 22:38:15 -0400366 .atag_offset = 0x100,
Marek Vasut851982c2010-10-11 02:20:19 +0200367 .map_io = pxa25x_map_io,
Haojian Zhuang6ac6b812010-08-20 15:23:59 +0800368 .nr_irqs = ESERIES_NR_IRQS,
Eric Miaoe478fe42010-06-20 20:35:32 +0800369 .init_irq = pxa25x_init_irq,
Eric Miao8a97ae22011-05-18 21:30:04 +0800370 .handle_irq = pxa25x_handle_irq,
Eric Miaoe478fe42010-06-20 20:35:32 +0800371 .fixup = eseries_fixup,
372 .init_machine = e400_init,
373 .timer = &pxa_timer,
Russell King271a74f2011-11-04 14:15:53 +0000374 .restart = pxa_restart,
Eric Miaoe478fe42010-06-20 20:35:32 +0800375MACHINE_END
376#endif
377
378#ifdef CONFIG_MACH_E740
379/* ------------------------ e740 video support --------------------------- */
380
381static struct w100_gen_regs e740_lcd_regs = {
382 .lcd_format = 0x00008023,
383 .lcdd_cntl1 = 0x0f000000,
384 .lcdd_cntl2 = 0x0003ffff,
385 .genlcd_cntl1 = 0x00ffff03,
386 .genlcd_cntl2 = 0x003c0f03,
387 .genlcd_cntl3 = 0x000143aa,
388};
389
390static struct w100_mode e740_lcd_mode = {
391 .xres = 240,
392 .yres = 320,
393 .left_margin = 20,
394 .right_margin = 28,
395 .upper_margin = 9,
396 .lower_margin = 8,
397 .crtc_ss = 0x80140013,
398 .crtc_ls = 0x81150110,
399 .crtc_gs = 0x80050005,
400 .crtc_vpos_gs = 0x000a0009,
401 .crtc_rev = 0x0040010a,
402 .crtc_dclk = 0xa906000a,
403 .crtc_gclk = 0x80050108,
404 .crtc_goe = 0x80050108,
405 .pll_freq = 57,
406 .pixclk_divider = 4,
407 .pixclk_divider_rotated = 4,
408 .pixclk_src = CLK_SRC_XTAL,
409 .sysclk_divider = 1,
410 .sysclk_src = CLK_SRC_PLL,
411 .crtc_ps1_active = 0x41060010,
412};
413
414static struct w100_gpio_regs e740_w100_gpio_info = {
415 .init_data1 = 0x21002103,
416 .gpio_dir1 = 0xffffdeff,
417 .gpio_oe1 = 0x03c00643,
418 .init_data2 = 0x003f003f,
419 .gpio_dir2 = 0xffffffff,
420 .gpio_oe2 = 0x000000ff,
421};
422
423static struct w100fb_mach_info e740_fb_info = {
424 .modelist = &e740_lcd_mode,
425 .num_modes = 1,
426 .regs = &e740_lcd_regs,
427 .gpio = &e740_w100_gpio_info,
428 .xtal_freq = 14318000,
429 .xtal_dbl = 1,
430};
431
432static struct resource e740_fb_resources[] = {
433 [0] = {
434 .start = 0x0c000000,
435 .end = 0x0cffffff,
436 .flags = IORESOURCE_MEM,
437 },
438};
439
440static struct platform_device e740_fb_device = {
441 .name = "w100fb",
442 .id = -1,
443 .dev = {
444 .platform_data = &e740_fb_info,
445 },
446 .num_resources = ARRAY_SIZE(e740_fb_resources),
447 .resource = e740_fb_resources,
448};
449
450/* --------------------------- MFP Pin config -------------------------- */
451
452static unsigned long e740_pin_config[] __initdata = {
453 /* Chip selects */
454 GPIO15_nCS_1, /* CS1 - Flash */
455 GPIO79_nCS_3, /* CS3 - IMAGEON */
456 GPIO80_nCS_4, /* CS4 - TMIO */
457
458 /* Clocks */
459 GPIO12_32KHz,
460
461 /* BTUART */
462 GPIO42_BTUART_RXD,
463 GPIO43_BTUART_TXD,
464 GPIO44_BTUART_CTS,
465
466 /* TMIO controller */
467 GPIO19_GPIO, /* t7l66xb #PCLR */
468 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
469
470 /* UDC */
471 GPIO13_GPIO,
472 GPIO3_GPIO,
473
474 /* IrDA */
475 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
476
477 /* AC97 */
478 GPIO28_AC97_BITCLK,
479 GPIO29_AC97_SDATA_IN_0,
480 GPIO30_AC97_SDATA_OUT,
481 GPIO31_AC97_SYNC,
482
483 /* Audio power control */
484 GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
485 GPIO40_GPIO, /* Mic amp power */
486 GPIO41_GPIO, /* Headphone amp power */
487
488 /* PC Card */
489 GPIO8_GPIO, /* CD0 */
490 GPIO44_GPIO, /* CD1 */
491 GPIO11_GPIO, /* IRQ0 */
492 GPIO6_GPIO, /* IRQ1 */
493 GPIO27_GPIO, /* RST0 */
494 GPIO24_GPIO, /* RST1 */
495 GPIO20_GPIO, /* PWR0 */
496 GPIO23_GPIO, /* PWR1 */
497 GPIO48_nPOE,
498 GPIO49_nPWE,
499 GPIO50_nPIOR,
500 GPIO51_nPIOW,
501 GPIO52_nPCE_1,
502 GPIO53_nPCE_2,
503 GPIO54_nPSKTSEL,
504 GPIO55_nPREG,
505 GPIO56_nPWAIT,
506 GPIO57_nIOIS16,
507
508 /* wakeup */
509 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
510};
511
512/* -------------------- e740 t7l66xb parameters -------------------- */
513
514static struct t7l66xb_platform_data e740_t7l66xb_info = {
515 .irq_base = IRQ_BOARD_START,
516 .enable = &eseries_tmio_enable,
517 .suspend = &eseries_tmio_suspend,
518 .resume = &eseries_tmio_resume,
519};
520
521static struct platform_device e740_t7l66xb_device = {
522 .name = "t7l66xb",
523 .id = -1,
524 .dev = {
525 .platform_data = &e740_t7l66xb_info,
526 },
527 .num_resources = 2,
528 .resource = eseries_tmio_resources,
529};
530
531/* ----------------------------------------------------------------------- */
532
533static struct platform_device *e740_devices[] __initdata = {
534 &e740_fb_device,
535 &e740_t7l66xb_device,
Dmitry Eremin-Solenikov133dce02011-02-14 15:33:16 +0300536 &e7xx_gpio_vbus,
Eric Miaoe478fe42010-06-20 20:35:32 +0800537};
538
539static void __init e740_init(void)
540{
541 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
542 pxa_set_ffuart_info(NULL);
543 pxa_set_btuart_info(NULL);
544 pxa_set_stuart_info(NULL);
545 eseries_register_clks();
546 clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
547 "UDCCLK", &pxa25x_device_udc.dev),
548 eseries_get_tmio_gpios();
549 platform_add_devices(ARRAY_AND_SIZE(e740_devices));
Eric Miaoe478fe42010-06-20 20:35:32 +0800550 pxa_set_ac97_info(NULL);
551 pxa_set_ficp_info(&e7xx_ficp_platform_data);
552}
553
554MACHINE_START(E740, "Toshiba e740")
555 /* Maintainer: Ian Molton (spyro@f2s.com) */
Nicolas Pitre7375aba2011-07-05 22:38:15 -0400556 .atag_offset = 0x100,
Marek Vasut851982c2010-10-11 02:20:19 +0200557 .map_io = pxa25x_map_io,
Haojian Zhuang6ac6b812010-08-20 15:23:59 +0800558 .nr_irqs = ESERIES_NR_IRQS,
Eric Miaoe478fe42010-06-20 20:35:32 +0800559 .init_irq = pxa25x_init_irq,
Eric Miao8a97ae22011-05-18 21:30:04 +0800560 .handle_irq = pxa25x_handle_irq,
Eric Miaoe478fe42010-06-20 20:35:32 +0800561 .fixup = eseries_fixup,
562 .init_machine = e740_init,
563 .timer = &pxa_timer,
Russell King271a74f2011-11-04 14:15:53 +0000564 .restart = pxa_restart,
Eric Miaoe478fe42010-06-20 20:35:32 +0800565MACHINE_END
566#endif
567
568#ifdef CONFIG_MACH_E750
569/* ---------------------- E750 LCD definitions -------------------- */
570
571static struct w100_gen_regs e750_lcd_regs = {
572 .lcd_format = 0x00008003,
573 .lcdd_cntl1 = 0x00000000,
574 .lcdd_cntl2 = 0x0003ffff,
575 .genlcd_cntl1 = 0x00fff003,
576 .genlcd_cntl2 = 0x003c0f03,
577 .genlcd_cntl3 = 0x000143aa,
578};
579
580static struct w100_mode e750_lcd_mode = {
581 .xres = 240,
582 .yres = 320,
583 .left_margin = 21,
584 .right_margin = 22,
585 .upper_margin = 5,
586 .lower_margin = 4,
587 .crtc_ss = 0x80150014,
588 .crtc_ls = 0x8014000d,
589 .crtc_gs = 0xc1000005,
590 .crtc_vpos_gs = 0x00020147,
591 .crtc_rev = 0x0040010a,
592 .crtc_dclk = 0xa1700030,
593 .crtc_gclk = 0x80cc0015,
594 .crtc_goe = 0x80cc0015,
595 .crtc_ps1_active = 0x61060017,
596 .pll_freq = 57,
597 .pixclk_divider = 4,
598 .pixclk_divider_rotated = 4,
599 .pixclk_src = CLK_SRC_XTAL,
600 .sysclk_divider = 1,
601 .sysclk_src = CLK_SRC_PLL,
602};
603
604static struct w100_gpio_regs e750_w100_gpio_info = {
605 .init_data1 = 0x01192f1b,
606 .gpio_dir1 = 0xd5ffdeff,
607 .gpio_oe1 = 0x000020bf,
608 .init_data2 = 0x010f010f,
609 .gpio_dir2 = 0xffffffff,
610 .gpio_oe2 = 0x000001cf,
611};
612
613static struct w100fb_mach_info e750_fb_info = {
614 .modelist = &e750_lcd_mode,
615 .num_modes = 1,
616 .regs = &e750_lcd_regs,
617 .gpio = &e750_w100_gpio_info,
618 .xtal_freq = 14318000,
619 .xtal_dbl = 1,
620};
621
622static struct resource e750_fb_resources[] = {
623 [0] = {
624 .start = 0x0c000000,
625 .end = 0x0cffffff,
626 .flags = IORESOURCE_MEM,
627 },
628};
629
630static struct platform_device e750_fb_device = {
631 .name = "w100fb",
632 .id = -1,
633 .dev = {
634 .platform_data = &e750_fb_info,
635 },
636 .num_resources = ARRAY_SIZE(e750_fb_resources),
637 .resource = e750_fb_resources,
638};
639
640/* -------------------- e750 MFP parameters -------------------- */
641
642static unsigned long e750_pin_config[] __initdata = {
643 /* Chip selects */
644 GPIO15_nCS_1, /* CS1 - Flash */
645 GPIO79_nCS_3, /* CS3 - IMAGEON */
646 GPIO80_nCS_4, /* CS4 - TMIO */
647
648 /* Clocks */
649 GPIO11_3_6MHz,
650
651 /* BTUART */
652 GPIO42_BTUART_RXD,
653 GPIO43_BTUART_TXD,
654 GPIO44_BTUART_CTS,
655
656 /* TMIO controller */
657 GPIO19_GPIO, /* t7l66xb #PCLR */
658 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
659
660 /* UDC */
661 GPIO13_GPIO,
662 GPIO3_GPIO,
663
664 /* IrDA */
665 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
666
667 /* AC97 */
668 GPIO28_AC97_BITCLK,
669 GPIO29_AC97_SDATA_IN_0,
670 GPIO30_AC97_SDATA_OUT,
671 GPIO31_AC97_SYNC,
672
673 /* Audio power control */
674 GPIO4_GPIO, /* Headphone amp power */
675 GPIO7_GPIO, /* Speaker amp power */
676 GPIO37_GPIO, /* Headphone detect */
677
678 /* PC Card */
679 GPIO8_GPIO, /* CD0 */
680 GPIO44_GPIO, /* CD1 */
681 GPIO11_GPIO, /* IRQ0 */
682 GPIO6_GPIO, /* IRQ1 */
683 GPIO27_GPIO, /* RST0 */
684 GPIO24_GPIO, /* RST1 */
685 GPIO20_GPIO, /* PWR0 */
686 GPIO23_GPIO, /* PWR1 */
687 GPIO48_nPOE,
688 GPIO49_nPWE,
689 GPIO50_nPIOR,
690 GPIO51_nPIOW,
691 GPIO52_nPCE_1,
692 GPIO53_nPCE_2,
693 GPIO54_nPSKTSEL,
694 GPIO55_nPREG,
695 GPIO56_nPWAIT,
696 GPIO57_nIOIS16,
697
698 /* wakeup */
699 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
700};
701
702/* ----------------- e750 tc6393xb parameters ------------------ */
703
704static struct tc6393xb_platform_data e750_tc6393xb_info = {
705 .irq_base = IRQ_BOARD_START,
706 .scr_pll2cr = 0x0cc1,
707 .scr_gper = 0,
708 .gpio_base = -1,
709 .suspend = &eseries_tmio_suspend,
710 .resume = &eseries_tmio_resume,
711 .enable = &eseries_tmio_enable,
712 .disable = &eseries_tmio_disable,
713};
714
715static struct platform_device e750_tc6393xb_device = {
716 .name = "tc6393xb",
717 .id = -1,
718 .dev = {
719 .platform_data = &e750_tc6393xb_info,
720 },
721 .num_resources = 2,
722 .resource = eseries_tmio_resources,
723};
724
725/* ------------------------------------------------------------- */
726
727static struct platform_device *e750_devices[] __initdata = {
728 &e750_fb_device,
729 &e750_tc6393xb_device,
Dmitry Eremin-Solenikov133dce02011-02-14 15:33:16 +0300730 &e7xx_gpio_vbus,
Eric Miaoe478fe42010-06-20 20:35:32 +0800731};
732
733static void __init e750_init(void)
734{
735 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
736 pxa_set_ffuart_info(NULL);
737 pxa_set_btuart_info(NULL);
738 pxa_set_stuart_info(NULL);
739 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
740 "GPIO11_CLK", NULL),
741 eseries_get_tmio_gpios();
742 platform_add_devices(ARRAY_AND_SIZE(e750_devices));
Eric Miaoe478fe42010-06-20 20:35:32 +0800743 pxa_set_ac97_info(NULL);
744 pxa_set_ficp_info(&e7xx_ficp_platform_data);
745}
746
747MACHINE_START(E750, "Toshiba e750")
748 /* Maintainer: Ian Molton (spyro@f2s.com) */
Nicolas Pitre7375aba2011-07-05 22:38:15 -0400749 .atag_offset = 0x100,
Marek Vasut851982c2010-10-11 02:20:19 +0200750 .map_io = pxa25x_map_io,
Haojian Zhuang6ac6b812010-08-20 15:23:59 +0800751 .nr_irqs = ESERIES_NR_IRQS,
Eric Miaoe478fe42010-06-20 20:35:32 +0800752 .init_irq = pxa25x_init_irq,
Eric Miao8a97ae22011-05-18 21:30:04 +0800753 .handle_irq = pxa25x_handle_irq,
Eric Miaoe478fe42010-06-20 20:35:32 +0800754 .fixup = eseries_fixup,
755 .init_machine = e750_init,
756 .timer = &pxa_timer,
Russell King271a74f2011-11-04 14:15:53 +0000757 .restart = pxa_restart,
Eric Miaoe478fe42010-06-20 20:35:32 +0800758MACHINE_END
759#endif
760
761#ifdef CONFIG_MACH_E800
762/* ------------------------ e800 LCD definitions ------------------------- */
763
764static 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
772static struct w100_gen_regs e800_lcd_regs = {
773 .lcd_format = 0x00008003,
774 .lcdd_cntl1 = 0x02a00000,
775 .lcdd_cntl2 = 0x0003ffff,
776 .genlcd_cntl1 = 0x000ff2a3,
777 .genlcd_cntl2 = 0x000002a3,
778 .genlcd_cntl3 = 0x000102aa,
779};
780
781static struct w100_mode e800_lcd_mode[2] = {
782 [0] = {
783 .xres = 480,
784 .yres = 640,
785 .left_margin = 52,
786 .right_margin = 148,
787 .upper_margin = 2,
788 .lower_margin = 6,
789 .crtc_ss = 0x80350034,
790 .crtc_ls = 0x802b0026,
791 .crtc_gs = 0x80160016,
792 .crtc_vpos_gs = 0x00020003,
793 .crtc_rev = 0x0040001d,
794 .crtc_dclk = 0xe0000000,
795 .crtc_gclk = 0x82a50049,
796 .crtc_goe = 0x80ee001c,
797 .crtc_ps1_active = 0x00000000,
798 .pll_freq = 128,
799 .pixclk_divider = 4,
800 .pixclk_divider_rotated = 6,
801 .pixclk_src = CLK_SRC_PLL,
802 .sysclk_divider = 0,
803 .sysclk_src = CLK_SRC_PLL,
804 },
805 [1] = {
806 .xres = 240,
807 .yres = 320,
808 .left_margin = 15,
809 .right_margin = 88,
810 .upper_margin = 0,
811 .lower_margin = 7,
812 .crtc_ss = 0xd010000f,
813 .crtc_ls = 0x80070003,
814 .crtc_gs = 0x80000000,
815 .crtc_vpos_gs = 0x01460147,
816 .crtc_rev = 0x00400003,
817 .crtc_dclk = 0xa1700030,
818 .crtc_gclk = 0x814b0008,
819 .crtc_goe = 0x80cc0015,
820 .crtc_ps1_active = 0x00000000,
821 .pll_freq = 100,
822 .pixclk_divider = 6, /* Wince uses 14 which gives a */
823 .pixclk_divider_rotated = 6, /* 7MHz Pclk. We use a 14MHz one */
824 .pixclk_src = CLK_SRC_PLL,
825 .sysclk_divider = 0,
826 .sysclk_src = CLK_SRC_PLL,
827 }
828};
829
830
831static struct w100_gpio_regs e800_w100_gpio_info = {
832 .init_data1 = 0xc13fc019,
833 .gpio_dir1 = 0x3e40df7f,
834 .gpio_oe1 = 0x003c3000,
835 .init_data2 = 0x00000000,
836 .gpio_dir2 = 0x00000000,
837 .gpio_oe2 = 0x00000000,
838};
839
840static struct w100_mem_info e800_w100_mem_info = {
841 .ext_cntl = 0x09640011,
842 .sdram_mode_reg = 0x00600021,
843 .ext_timing_cntl = 0x10001545,
844 .io_cntl = 0x7ddd7333,
845 .size = 0x1fffff,
846};
847
848static void e800_tg_change(struct w100fb_par *par)
849{
850 unsigned long tmp;
851
852 tmp = w100fb_gpio_read(W100_GPIO_PORT_A);
853 if (par->mode->xres == 480)
854 tmp |= 0x100;
855 else
856 tmp &= ~0x100;
857 w100fb_gpio_write(W100_GPIO_PORT_A, tmp);
858}
859
860static struct w100_tg_info e800_tg_info = {
861 .change = e800_tg_change,
862};
863
864static struct w100fb_mach_info e800_fb_info = {
865 .modelist = e800_lcd_mode,
866 .num_modes = 2,
867 .regs = &e800_lcd_regs,
868 .gpio = &e800_w100_gpio_info,
869 .mem = &e800_w100_mem_info,
870 .tg = &e800_tg_info,
871 .xtal_freq = 16000000,
872};
873
874static struct resource e800_fb_resources[] = {
875 [0] = {
876 .start = 0x0c000000,
877 .end = 0x0cffffff,
878 .flags = IORESOURCE_MEM,
879 },
880};
881
882static struct platform_device e800_fb_device = {
883 .name = "w100fb",
884 .id = -1,
885 .dev = {
886 .platform_data = &e800_fb_info,
887 },
888 .num_resources = ARRAY_SIZE(e800_fb_resources),
889 .resource = e800_fb_resources,
890};
891
892/* --------------------------- UDC definitions --------------------------- */
893
Dmitry Eremin-Solenikov133dce02011-02-14 15:33:16 +0300894static struct gpio_vbus_mach_info e800_udc_info = {
Eric Miaoe478fe42010-06-20 20:35:32 +0800895 .gpio_vbus = GPIO_E800_USB_DISC,
896 .gpio_pullup = GPIO_E800_USB_PULLUP,
897 .gpio_pullup_inverted = 1
898};
899
Dmitry Eremin-Solenikov133dce02011-02-14 15:33:16 +0300900static struct platform_device e800_gpio_vbus = {
901 .name = "gpio-vbus",
902 .id = -1,
903 .dev = {
904 .platform_data = &e800_udc_info,
905 },
906};
907
908
Eric Miaoe478fe42010-06-20 20:35:32 +0800909/* ----------------- e800 tc6393xb parameters ------------------ */
910
911static struct tc6393xb_platform_data e800_tc6393xb_info = {
912 .irq_base = IRQ_BOARD_START,
913 .scr_pll2cr = 0x0cc1,
914 .scr_gper = 0,
915 .gpio_base = -1,
916 .suspend = &eseries_tmio_suspend,
917 .resume = &eseries_tmio_resume,
918 .enable = &eseries_tmio_enable,
919 .disable = &eseries_tmio_disable,
920};
921
922static struct platform_device e800_tc6393xb_device = {
923 .name = "tc6393xb",
924 .id = -1,
925 .dev = {
926 .platform_data = &e800_tc6393xb_info,
927 },
928 .num_resources = 2,
929 .resource = eseries_tmio_resources,
930};
931
932/* ----------------------------------------------------------------------- */
933
934static struct platform_device *e800_devices[] __initdata = {
935 &e800_fb_device,
936 &e800_tc6393xb_device,
Dmitry Eremin-Solenikov133dce02011-02-14 15:33:16 +0300937 &e800_gpio_vbus,
Eric Miaoe478fe42010-06-20 20:35:32 +0800938};
939
940static void __init e800_init(void)
941{
942 pxa2xx_mfp_config(ARRAY_AND_SIZE(e800_pin_config));
943 pxa_set_ffuart_info(NULL);
944 pxa_set_btuart_info(NULL);
945 pxa_set_stuart_info(NULL);
946 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
947 "GPIO11_CLK", NULL),
948 eseries_get_tmio_gpios();
949 platform_add_devices(ARRAY_AND_SIZE(e800_devices));
Eric Miaoe478fe42010-06-20 20:35:32 +0800950 pxa_set_ac97_info(NULL);
951}
952
953MACHINE_START(E800, "Toshiba e800")
954 /* Maintainer: Ian Molton (spyro@f2s.com) */
Nicolas Pitre7375aba2011-07-05 22:38:15 -0400955 .atag_offset = 0x100,
Marek Vasut851982c2010-10-11 02:20:19 +0200956 .map_io = pxa25x_map_io,
Haojian Zhuang6ac6b812010-08-20 15:23:59 +0800957 .nr_irqs = ESERIES_NR_IRQS,
Eric Miaoe478fe42010-06-20 20:35:32 +0800958 .init_irq = pxa25x_init_irq,
Eric Miao8a97ae22011-05-18 21:30:04 +0800959 .handle_irq = pxa25x_handle_irq,
Eric Miaoe478fe42010-06-20 20:35:32 +0800960 .fixup = eseries_fixup,
961 .init_machine = e800_init,
962 .timer = &pxa_timer,
Russell King271a74f2011-11-04 14:15:53 +0000963 .restart = pxa_restart,
Eric Miaoe478fe42010-06-20 20:35:32 +0800964MACHINE_END
965#endif