]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - arch/arm/mach-pxa/eseries.c
Merge branch 'master' into for-next
[mirror_ubuntu-hirsute-kernel.git] / arch / arm / mach-pxa / eseries.c
CommitLineData
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
2d34e507 13#include <linux/clkdev.h>
28365488 14#include <linux/kernel.h>
3abcd199 15#include <linux/init.h>
8e3afafe 16#include <linux/clk-provider.h>
fdabc466 17#include <linux/gpio/machine.h>
36033422 18#include <linux/gpio.h>
b1ae1b7b 19#include <linux/delay.h>
36033422 20#include <linux/platform_device.h>
e478fe4c
EM
21#include <linux/mfd/tc6387xb.h>
22#include <linux/mfd/tc6393xb.h>
23#include <linux/mfd/t7l66xb.h>
d4092d76 24#include <linux/mtd/rawnand.h>
e478fe4c 25#include <linux/mtd/partitions.h>
1c2f87c2 26#include <linux/memblock.h>
e478fe4c
EM
27
28#include <video/w100fb.h>
3abcd199
IM
29
30#include <asm/setup.h>
31#include <asm/mach/arch.h>
3abcd199
IM
32#include <asm/mach-types.h>
33
4c25c5d2 34#include "pxa25x.h"
ebcce7b1 35#include <mach/eseries-gpio.h>
4c25c5d2 36#include "eseries-irq.h"
e478fe4c 37#include <mach/audio.h>
293b2da1 38#include <linux/platform_data/video-pxafb.h>
4c25c5d2 39#include "udc.h"
293b2da1 40#include <linux/platform_data/irda-pxaficp.h>
28365488 41
e478fe4c 42#include "devices.h"
877e03d4 43#include "generic.h"
3abcd199
IM
44
45/* Only e800 has 128MB RAM */
1c2f87c2 46void __init eseries_fixup(struct tag *tags, char **cmdline)
3abcd199 47{
3abcd199 48 if (machine_is_e800())
1c2f87c2 49 memblock_add(0xa0000000, SZ_128M);
3abcd199 50 else
1c2f87c2 51 memblock_add(0xa0000000, SZ_64M);
3abcd199
IM
52}
53
fdabc466
LW
54static 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 },
ebcce7b1
IM
63};
64
0a137a1a 65static struct platform_device e7xx_gpio_vbus __maybe_unused = {
133dce06
DB
66 .name = "gpio-vbus",
67 .id = -1,
133dce06
DB
68};
69
36033422 70struct pxaficp_platform_data e7xx_ficp_platform_data = {
c4bd0172
MV
71 .gpio_pwdown = GPIO_E7XX_IR_OFF,
72 .transceiver_cap = IR_SIRMODE | IR_OFF,
36033422
IM
73};
74
b1ae1b7b
IM
75int 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
88int 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
95int eseries_tmio_suspend(struct platform_device *dev)
96{
97 gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
98 return 0;
99}
100
101int 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
108void 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. */
117struct resource eseries_tmio_resources[] = {
118 [0] = {
119 .start = PXA_CS4_PHYS,
120 .end = PXA_CS4_PHYS + 0x1fffff,
121 .flags = IORESOURCE_MEM,
122 },
123 [1] = {
6384fdad
HZ
124 .start = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
125 .end = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
b1ae1b7b
IM
126 .flags = IORESOURCE_IRQ,
127 },
128};
129
130/* Some e-series hardware cannot control the 32K clock */
0a137a1a 131static void __init __maybe_unused eseries_register_clks(void)
b1ae1b7b 132{
e4c740e2 133 clk_register_fixed_rate(NULL, "CLK_CK32K", NULL, 0, 32768);
b1ae1b7b
IM
134}
135
e478fe4c
EM
136#ifdef CONFIG_MACH_E330
137/* -------------------- e330 tc6387xb parameters -------------------- */
138
139static 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
146static 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
158static struct platform_device *e330_devices[] __initdata = {
159 &e330_tc6387xb_device,
133dce06 160 &e7xx_gpio_vbus,
e478fe4c
EM
161};
162
163static 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();
fdabc466 170 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
e478fe4c 171 platform_add_devices(ARRAY_AND_SIZE(e330_devices));
e478fe4c
EM
172}
173
174MACHINE_START(E330, "Toshiba e330")
175 /* Maintainer: Ian Molton (spyro@f2s.com) */
7375aba6 176 .atag_offset = 0x100,
851982c1 177 .map_io = pxa25x_map_io,
6ac6b817 178 .nr_irqs = ESERIES_NR_IRQS,
e478fe4c 179 .init_irq = pxa25x_init_irq,
8a97ae2f 180 .handle_irq = pxa25x_handle_irq,
e478fe4c
EM
181 .fixup = eseries_fixup,
182 .init_machine = e330_init,
6bb27d73 183 .init_time = pxa_timer_init,
271a74fc 184 .restart = pxa_restart,
e478fe4c
EM
185MACHINE_END
186#endif
187
188#ifdef CONFIG_MACH_E350
189/* -------------------- e350 t7l66xb parameters -------------------- */
190
191static 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
198static 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
210static struct platform_device *e350_devices[] __initdata = {
211 &e350_t7l66xb_device,
133dce06 212 &e7xx_gpio_vbus,
e478fe4c
EM
213};
214
215static 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();
fdabc466 222 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
e478fe4c 223 platform_add_devices(ARRAY_AND_SIZE(e350_devices));
e478fe4c
EM
224}
225
226MACHINE_START(E350, "Toshiba e350")
227 /* Maintainer: Ian Molton (spyro@f2s.com) */
7375aba6 228 .atag_offset = 0x100,
851982c1 229 .map_io = pxa25x_map_io,
6ac6b817 230 .nr_irqs = ESERIES_NR_IRQS,
e478fe4c 231 .init_irq = pxa25x_init_irq,
8a97ae2f 232 .handle_irq = pxa25x_handle_irq,
e478fe4c
EM
233 .fixup = eseries_fixup,
234 .init_machine = e350_init,
6bb27d73 235 .init_time = pxa_timer_init,
271a74fc 236 .restart = pxa_restart,
e478fe4c
EM
237MACHINE_END
238#endif
239
240#ifdef CONFIG_MACH_E400
241/* ------------------------ E400 LCD definitions ------------------------ */
242
243static 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
257static 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
267static 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
290static struct mtd_partition partition_a = {
291 .name = "Internal NAND flash",
292 .offset = 0,
293 .size = MTDPART_SIZ_FULL,
294};
295
296static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
297
298static struct nand_bbt_descr e400_t7l66xb_nand_bbt = {
299 .options = 0,
300 .offs = 4,
301 .len = 2,
302 .pattern = scan_ff_pattern
303};
304
305static 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
311static 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
320static 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
332static struct platform_device *e400_devices[] __initdata = {
333 &e400_t7l66xb_device,
133dce06 334 &e7xx_gpio_vbus,
e478fe4c
EM
335};
336
337static 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();
4321e1a1 346 pxa_set_fb_info(NULL, &e400_pxafb_mach_info);
fdabc466 347 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
e478fe4c 348 platform_add_devices(ARRAY_AND_SIZE(e400_devices));
e478fe4c
EM
349}
350
351MACHINE_START(E400, "Toshiba e400")
352 /* Maintainer: Ian Molton (spyro@f2s.com) */
7375aba6 353 .atag_offset = 0x100,
851982c1 354 .map_io = pxa25x_map_io,
6ac6b817 355 .nr_irqs = ESERIES_NR_IRQS,
e478fe4c 356 .init_irq = pxa25x_init_irq,
8a97ae2f 357 .handle_irq = pxa25x_handle_irq,
e478fe4c
EM
358 .fixup = eseries_fixup,
359 .init_machine = e400_init,
6bb27d73 360 .init_time = pxa_timer_init,
271a74fc 361 .restart = pxa_restart,
e478fe4c
EM
362MACHINE_END
363#endif
364
365#ifdef CONFIG_MACH_E740
366/* ------------------------ e740 video support --------------------------- */
367
368static 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
377static 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
401static 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
410static 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
419static struct resource e740_fb_resources[] = {
420 [0] = {
421 .start = 0x0c000000,
422 .end = 0x0cffffff,
423 .flags = IORESOURCE_MEM,
424 },
425};
426
427static 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
439static 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
501static 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
508static 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
62133829
AL
518static struct platform_device e740_audio_device = {
519 .name = "e740-audio",
520 .id = -1,
521};
522
e478fe4c
EM
523/* ----------------------------------------------------------------------- */
524
525static struct platform_device *e740_devices[] __initdata = {
526 &e740_fb_device,
527 &e740_t7l66xb_device,
133dce06 528 &e7xx_gpio_vbus,
62133829 529 &e740_audio_device,
e478fe4c
EM
530};
531
532static 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();
fdabc466 542 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
e478fe4c 543 platform_add_devices(ARRAY_AND_SIZE(e740_devices));
e478fe4c
EM
544 pxa_set_ac97_info(NULL);
545 pxa_set_ficp_info(&e7xx_ficp_platform_data);
546}
547
548MACHINE_START(E740, "Toshiba e740")
549 /* Maintainer: Ian Molton (spyro@f2s.com) */
7375aba6 550 .atag_offset = 0x100,
851982c1 551 .map_io = pxa25x_map_io,
6ac6b817 552 .nr_irqs = ESERIES_NR_IRQS,
e478fe4c 553 .init_irq = pxa25x_init_irq,
8a97ae2f 554 .handle_irq = pxa25x_handle_irq,
e478fe4c
EM
555 .fixup = eseries_fixup,
556 .init_machine = e740_init,
6bb27d73 557 .init_time = pxa_timer_init,
271a74fc 558 .restart = pxa_restart,
e478fe4c
EM
559MACHINE_END
560#endif
561
562#ifdef CONFIG_MACH_E750
563/* ---------------------- E750 LCD definitions -------------------- */
564
565static 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
574static 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
598static 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
607static 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
616static struct resource e750_fb_resources[] = {
617 [0] = {
618 .start = 0x0c000000,
619 .end = 0x0cffffff,
620 .flags = IORESOURCE_MEM,
621 },
622};
623
624static 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
636static 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 */
70d64048 675 /* GPIO11_GPIO, IRQ0 */
e478fe4c
EM
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
698static struct tc6393xb_platform_data e750_tc6393xb_info = {
699 .irq_base = IRQ_BOARD_START,
700 .scr_pll2cr = 0x0cc1,
701 .scr_gper = 0,
702 .gpio_base = -1,
703 .suspend = &eseries_tmio_suspend,
704 .resume = &eseries_tmio_resume,
705 .enable = &eseries_tmio_enable,
706 .disable = &eseries_tmio_disable,
707};
708
709static struct platform_device e750_tc6393xb_device = {
710 .name = "tc6393xb",
711 .id = -1,
712 .dev = {
713 .platform_data = &e750_tc6393xb_info,
714 },
715 .num_resources = 2,
716 .resource = eseries_tmio_resources,
717};
718
5eb2c3d9
AL
719static struct platform_device e750_audio_device = {
720 .name = "e750-audio",
721 .id = -1,
722};
723
e478fe4c
EM
724/* ------------------------------------------------------------- */
725
726static struct platform_device *e750_devices[] __initdata = {
727 &e750_fb_device,
728 &e750_tc6393xb_device,
133dce06 729 &e7xx_gpio_vbus,
5eb2c3d9 730 &e750_audio_device,
e478fe4c
EM
731};
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();
fdabc466 742 gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
e478fe4c 743 platform_add_devices(ARRAY_AND_SIZE(e750_devices));
e478fe4c
EM
744 pxa_set_ac97_info(NULL);
745 pxa_set_ficp_info(&e7xx_ficp_platform_data);
746}
747
748MACHINE_START(E750, "Toshiba e750")
749 /* Maintainer: Ian Molton (spyro@f2s.com) */
7375aba6 750 .atag_offset = 0x100,
851982c1 751 .map_io = pxa25x_map_io,
6ac6b817 752 .nr_irqs = ESERIES_NR_IRQS,
e478fe4c 753 .init_irq = pxa25x_init_irq,
8a97ae2f 754 .handle_irq = pxa25x_handle_irq,
e478fe4c
EM
755 .fixup = eseries_fixup,
756 .init_machine = e750_init,
6bb27d73 757 .init_time = pxa_timer_init,
271a74fc 758 .restart = pxa_restart,
e478fe4c
EM
759MACHINE_END
760#endif
761
762#ifdef CONFIG_MACH_E800
763/* ------------------------ e800 LCD definitions ------------------------- */
764
765static 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,
70d64048
RJ
771
772 /* tc6393xb */
773 GPIO11_3_6MHz,
e478fe4c
EM
774};
775
776static struct w100_gen_regs e800_lcd_regs = {
777 .lcd_format = 0x00008003,
778 .lcdd_cntl1 = 0x02a00000,
779 .lcdd_cntl2 = 0x0003ffff,
780 .genlcd_cntl1 = 0x000ff2a3,
781 .genlcd_cntl2 = 0x000002a3,
782 .genlcd_cntl3 = 0x000102aa,
783};
784
785static struct w100_mode e800_lcd_mode[2] = {
786 [0] = {
787 .xres = 480,
788 .yres = 640,
789 .left_margin = 52,
790 .right_margin = 148,
791 .upper_margin = 2,
792 .lower_margin = 6,
793 .crtc_ss = 0x80350034,
794 .crtc_ls = 0x802b0026,
795 .crtc_gs = 0x80160016,
796 .crtc_vpos_gs = 0x00020003,
797 .crtc_rev = 0x0040001d,
798 .crtc_dclk = 0xe0000000,
799 .crtc_gclk = 0x82a50049,
800 .crtc_goe = 0x80ee001c,
801 .crtc_ps1_active = 0x00000000,
802 .pll_freq = 128,
803 .pixclk_divider = 4,
804 .pixclk_divider_rotated = 6,
805 .pixclk_src = CLK_SRC_PLL,
806 .sysclk_divider = 0,
807 .sysclk_src = CLK_SRC_PLL,
808 },
809 [1] = {
810 .xres = 240,
811 .yres = 320,
812 .left_margin = 15,
813 .right_margin = 88,
814 .upper_margin = 0,
815 .lower_margin = 7,
816 .crtc_ss = 0xd010000f,
817 .crtc_ls = 0x80070003,
818 .crtc_gs = 0x80000000,
819 .crtc_vpos_gs = 0x01460147,
820 .crtc_rev = 0x00400003,
821 .crtc_dclk = 0xa1700030,
822 .crtc_gclk = 0x814b0008,
823 .crtc_goe = 0x80cc0015,
824 .crtc_ps1_active = 0x00000000,
825 .pll_freq = 100,
826 .pixclk_divider = 6, /* Wince uses 14 which gives a */
827 .pixclk_divider_rotated = 6, /* 7MHz Pclk. We use a 14MHz one */
828 .pixclk_src = CLK_SRC_PLL,
829 .sysclk_divider = 0,
830 .sysclk_src = CLK_SRC_PLL,
831 }
832};
833
834
835static struct w100_gpio_regs e800_w100_gpio_info = {
836 .init_data1 = 0xc13fc019,
837 .gpio_dir1 = 0x3e40df7f,
838 .gpio_oe1 = 0x003c3000,
839 .init_data2 = 0x00000000,
840 .gpio_dir2 = 0x00000000,
841 .gpio_oe2 = 0x00000000,
842};
843
844static struct w100_mem_info e800_w100_mem_info = {
845 .ext_cntl = 0x09640011,
846 .sdram_mode_reg = 0x00600021,
847 .ext_timing_cntl = 0x10001545,
848 .io_cntl = 0x7ddd7333,
849 .size = 0x1fffff,
850};
851
852static void e800_tg_change(struct w100fb_par *par)
853{
854 unsigned long tmp;
855
856 tmp = w100fb_gpio_read(W100_GPIO_PORT_A);
857 if (par->mode->xres == 480)
858 tmp |= 0x100;
859 else
860 tmp &= ~0x100;
861 w100fb_gpio_write(W100_GPIO_PORT_A, tmp);
862}
863
864static struct w100_tg_info e800_tg_info = {
865 .change = e800_tg_change,
866};
867
868static struct w100fb_mach_info e800_fb_info = {
869 .modelist = e800_lcd_mode,
870 .num_modes = 2,
871 .regs = &e800_lcd_regs,
872 .gpio = &e800_w100_gpio_info,
873 .mem = &e800_w100_mem_info,
874 .tg = &e800_tg_info,
875 .xtal_freq = 16000000,
876};
877
878static struct resource e800_fb_resources[] = {
879 [0] = {
880 .start = 0x0c000000,
881 .end = 0x0cffffff,
882 .flags = IORESOURCE_MEM,
883 },
884};
885
886static struct platform_device e800_fb_device = {
887 .name = "w100fb",
888 .id = -1,
889 .dev = {
890 .platform_data = &e800_fb_info,
891 },
892 .num_resources = ARRAY_SIZE(e800_fb_resources),
893 .resource = e800_fb_resources,
894};
895
896/* --------------------------- UDC definitions --------------------------- */
897
fdabc466
LW
898static struct gpiod_lookup_table e800_gpio_vbus_gpiod_table = {
899 .dev_id = "gpio-vbus",
900 .table = {
901 GPIO_LOOKUP("gpio-pxa", GPIO_E800_USB_DISC,
902 "vbus", GPIO_ACTIVE_HIGH),
903 GPIO_LOOKUP("gpio-pxa", GPIO_E800_USB_PULLUP,
904 "pullup", GPIO_ACTIVE_LOW),
905 { },
906 },
e478fe4c
EM
907};
908
133dce06
DB
909static struct platform_device e800_gpio_vbus = {
910 .name = "gpio-vbus",
911 .id = -1,
133dce06
DB
912};
913
914
e478fe4c
EM
915/* ----------------- e800 tc6393xb parameters ------------------ */
916
917static struct tc6393xb_platform_data e800_tc6393xb_info = {
918 .irq_base = IRQ_BOARD_START,
919 .scr_pll2cr = 0x0cc1,
920 .scr_gper = 0,
921 .gpio_base = -1,
922 .suspend = &eseries_tmio_suspend,
923 .resume = &eseries_tmio_resume,
924 .enable = &eseries_tmio_enable,
925 .disable = &eseries_tmio_disable,
926};
927
928static struct platform_device e800_tc6393xb_device = {
929 .name = "tc6393xb",
930 .id = -1,
931 .dev = {
932 .platform_data = &e800_tc6393xb_info,
933 },
934 .num_resources = 2,
935 .resource = eseries_tmio_resources,
936};
937
1eb0202d
AL
938static struct platform_device e800_audio_device = {
939 .name = "e800-audio",
940 .id = -1,
941};
942
e478fe4c
EM
943/* ----------------------------------------------------------------------- */
944
945static struct platform_device *e800_devices[] __initdata = {
946 &e800_fb_device,
947 &e800_tc6393xb_device,
133dce06 948 &e800_gpio_vbus,
1eb0202d 949 &e800_audio_device,
e478fe4c
EM
950};
951
952static void __init e800_init(void)
953{
954 pxa2xx_mfp_config(ARRAY_AND_SIZE(e800_pin_config));
955 pxa_set_ffuart_info(NULL);
956 pxa_set_btuart_info(NULL);
957 pxa_set_stuart_info(NULL);
958 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
959 "GPIO11_CLK", NULL),
960 eseries_get_tmio_gpios();
fdabc466 961 gpiod_add_lookup_table(&e800_gpio_vbus_gpiod_table);
e478fe4c 962 platform_add_devices(ARRAY_AND_SIZE(e800_devices));
e478fe4c
EM
963 pxa_set_ac97_info(NULL);
964}
965
966MACHINE_START(E800, "Toshiba e800")
967 /* Maintainer: Ian Molton (spyro@f2s.com) */
7375aba6 968 .atag_offset = 0x100,
851982c1 969 .map_io = pxa25x_map_io,
6ac6b817 970 .nr_irqs = ESERIES_NR_IRQS,
e478fe4c 971 .init_irq = pxa25x_init_irq,
8a97ae2f 972 .handle_irq = pxa25x_handle_irq,
e478fe4c
EM
973 .fixup = eseries_fixup,
974 .init_machine = e800_init,
6bb27d73 975 .init_time = pxa_timer_init,
271a74fc 976 .restart = pxa_restart,
e478fe4c
EM
977MACHINE_END
978#endif