blob: 9a26f16c78665ea7a6865a2894382c677f1eeb6e [file] [log] [blame]
Ian Molton7dc96412008-08-19 12:14:21 +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
13#include <linux/kernel.h>
14#include <linux/init.h>
Ian Molton0ec3cf62008-08-19 13:01:28 +010015#include <linux/device.h>
16#include <linux/platform_device.h>
17#include <linux/fb.h>
Ian Moltonb1ae1b72008-09-26 13:38:59 +010018#include <linux/mfd/tc6393xb.h>
Ian Molton0ec3cf62008-08-19 13:01:28 +010019
20#include <video/w100fb.h>
Ian Molton7dc96412008-08-19 12:14:21 +010021
22#include <asm/setup.h>
23#include <asm/mach/arch.h>
24#include <asm/mach-types.h>
25
26#include <mach/mfp-pxa25x.h>
Ian Moltonb1ae1b72008-09-26 13:38:59 +010027#include <mach/pxa-regs.h>
Ian Molton7dc96412008-08-19 12:14:21 +010028#include <mach/hardware.h>
Ian Moltonb1ae1b72008-09-26 13:38:59 +010029#include <mach/eseries-gpio.h>
Ian Moltonebcce7b2008-08-19 13:34:56 +010030#include <mach/udc.h>
Ian Molton36033422008-08-24 19:21:26 +010031#include <mach/irda.h>
Russell King80b02c12009-01-08 10:01:47 +000032#include <mach/irqs.h>
Ian Molton7dc96412008-08-19 12:14:21 +010033
34#include "generic.h"
35#include "eseries.h"
Ian Moltonb1ae1b72008-09-26 13:38:59 +010036#include "clock.h"
Ian Molton7dc96412008-08-19 12:14:21 +010037
Ian Molton0ec3cf62008-08-19 13:01:28 +010038/* ---------------------- E750 LCD definitions -------------------- */
39
40static struct w100_gen_regs e750_lcd_regs = {
41 .lcd_format = 0x00008003,
42 .lcdd_cntl1 = 0x00000000,
43 .lcdd_cntl2 = 0x0003ffff,
44 .genlcd_cntl1 = 0x00fff003,
45 .genlcd_cntl2 = 0x003c0f03,
46 .genlcd_cntl3 = 0x000143aa,
47};
48
49static struct w100_mode e750_lcd_mode = {
50 .xres = 240,
51 .yres = 320,
52 .left_margin = 21,
53 .right_margin = 22,
54 .upper_margin = 5,
55 .lower_margin = 4,
56 .crtc_ss = 0x80150014,
57 .crtc_ls = 0x8014000d,
58 .crtc_gs = 0xc1000005,
59 .crtc_vpos_gs = 0x00020147,
60 .crtc_rev = 0x0040010a,
61 .crtc_dclk = 0xa1700030,
62 .crtc_gclk = 0x80cc0015,
63 .crtc_goe = 0x80cc0015,
64 .crtc_ps1_active = 0x61060017,
65 .pll_freq = 57,
66 .pixclk_divider = 4,
67 .pixclk_divider_rotated = 4,
68 .pixclk_src = CLK_SRC_XTAL,
69 .sysclk_divider = 1,
70 .sysclk_src = CLK_SRC_PLL,
71};
72
73static struct w100_gpio_regs e750_w100_gpio_info = {
74 .init_data1 = 0x01192f1b,
75 .gpio_dir1 = 0xd5ffdeff,
76 .gpio_oe1 = 0x000020bf,
77 .init_data2 = 0x010f010f,
78 .gpio_dir2 = 0xffffffff,
79 .gpio_oe2 = 0x000001cf,
80};
81
82static struct w100fb_mach_info e750_fb_info = {
83 .modelist = &e750_lcd_mode,
84 .num_modes = 1,
85 .regs = &e750_lcd_regs,
86 .gpio = &e750_w100_gpio_info,
87 .xtal_freq = 14318000,
88 .xtal_dbl = 1,
89};
90
91static struct resource e750_fb_resources[] = {
92 [0] = {
93 .start = 0x0c000000,
94 .end = 0x0cffffff,
95 .flags = IORESOURCE_MEM,
96 },
97};
98
99static struct platform_device e750_fb_device = {
100 .name = "w100fb",
101 .id = -1,
102 .dev = {
103 .platform_data = &e750_fb_info,
104 },
105 .num_resources = ARRAY_SIZE(e750_fb_resources),
106 .resource = e750_fb_resources,
107};
108
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100109/* ----------------- e750 tc6393xb parameters ------------------ */
110
111static struct tc6393xb_platform_data e750_tc6393xb_info = {
112 .irq_base = IRQ_BOARD_START,
113 .scr_pll2cr = 0x0cc1,
114 .scr_gper = 0,
115 .gpio_base = -1,
116 .suspend = &eseries_tmio_suspend,
117 .resume = &eseries_tmio_resume,
118 .enable = &eseries_tmio_enable,
119 .disable = &eseries_tmio_disable,
120};
121
122static struct platform_device e750_tc6393xb_device = {
123 .name = "tc6393xb",
124 .id = -1,
125 .dev = {
126 .platform_data = &e750_tc6393xb_info,
127 },
128 .num_resources = 2,
129 .resource = eseries_tmio_resources,
130};
131
132/* ------------------------------------------------------------- */
Ian Molton0ec3cf62008-08-19 13:01:28 +0100133
134static struct platform_device *devices[] __initdata = {
135 &e750_fb_device,
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100136 &e750_tc6393xb_device,
Ian Molton0ec3cf62008-08-19 13:01:28 +0100137};
138
139static void __init e750_init(void)
140{
Ian Moltonb1ae1b72008-09-26 13:38:59 +0100141 clk_add_alias("CLK_CK3P6MI", &e750_tc6393xb_device.dev,
142 "GPIO11_CLK", NULL),
143 eseries_get_tmio_gpios();
Ian Molton0ec3cf62008-08-19 13:01:28 +0100144 platform_add_devices(devices, ARRAY_SIZE(devices));
Ian Moltonebcce7b2008-08-19 13:34:56 +0100145 pxa_set_udc_info(&e7xx_udc_mach_info);
Ian Molton36033422008-08-24 19:21:26 +0100146 e7xx_irda_init();
147 pxa_set_ficp_info(&e7xx_ficp_platform_data);
Ian Molton0ec3cf62008-08-19 13:01:28 +0100148}
149
Ian Molton7dc96412008-08-19 12:14:21 +0100150MACHINE_START(E750, "Toshiba e750")
151 /* Maintainer: Ian Molton (spyro@f2s.com) */
152 .phys_io = 0x40000000,
153 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
154 .boot_params = 0xa0000100,
155 .map_io = pxa_map_io,
156 .init_irq = pxa25x_init_irq,
157 .fixup = eseries_fixup,
Ian Molton0ec3cf62008-08-19 13:01:28 +0100158 .init_machine = e750_init,
Ian Molton7dc96412008-08-19 12:14:21 +0100159 .timer = &pxa_timer,
160MACHINE_END
161