2 * ezx.c - Common code for the EZX platform.
4 * Copyright (C) 2005-2006 Harald Welte <laforge@openezx.org>,
5 * 2007-2008 Daniel Ribeiro <drwyrm@gmail.com>,
6 * 2007-2008 Stefan Schmidt <stefan@datenfreihafen.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/platform_device.h>
17 #include <linux/delay.h>
18 #include <linux/pwm_backlight.h>
20 #include <asm/setup.h>
21 #include <mach/pxafb.h>
22 #include <mach/ohci.h>
25 #include <mach/mfp-pxa27x.h>
26 #include <mach/pxa-regs.h>
27 #include <mach/pxa2xx-regs.h>
28 #include <asm/mach-types.h>
29 #include <asm/mach/arch.h>
34 static struct platform_pwm_backlight_data ezx_backlight_data
= {
36 .max_brightness
= 1023,
37 .dft_brightness
= 1023,
38 .pwm_period_ns
= 78770,
41 static struct platform_device ezx_backlight_device
= {
42 .name
= "pwm-backlight",
44 .parent
= &pxa27x_device_pwm0
.dev
,
45 .platform_data
= &ezx_backlight_data
,
49 static struct pxafb_mode_info mode_ezx_old
= {
63 static struct pxafb_mach_info ezx_fb_info_1
= {
64 .modes
= &mode_ezx_old
,
66 .lcd_conn
= LCD_COLOR_TFT_16BPP
,
69 static struct pxafb_mode_info mode_72r89803y01
= {
84 static struct pxafb_mach_info ezx_fb_info_2
= {
85 .modes
= &mode_72r89803y01
,
87 .lcd_conn
= LCD_COLOR_TFT_18BPP
,
90 static struct platform_device
*devices
[] __initdata
= {
91 &ezx_backlight_device
,
94 static unsigned long ezx_pin_config
[] __initdata
= {
108 /* For A780 support (connected with Neptune GSM chip) */
109 GPIO30_USB_P3_2
, /* ICL_TXENB */
110 GPIO31_USB_P3_6
, /* ICL_VPOUT */
111 GPIO90_USB_P3_5
, /* ICL_VPIN */
112 GPIO91_USB_P3_1
, /* ICL_XRXD */
113 GPIO56_USB_P3_4
, /* ICL_VMOUT */
114 GPIO113_USB_P3_3
, /* /ICL_VMIN */
117 static void __init
ezx_init(void)
119 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config
));
120 pxa_set_i2c_info(NULL
);
121 if (machine_is_ezx_a780() || machine_is_ezx_e680())
122 set_pxa_fb_info(&ezx_fb_info_1
);
124 set_pxa_fb_info(&ezx_fb_info_2
);
126 platform_add_devices(devices
, ARRAY_SIZE(devices
));
129 static void __init
ezx_fixup(struct machine_desc
*desc
, struct tag
*tags
,
130 char **cmdline
, struct meminfo
*mi
)
132 /* We have two ram chips. First one with 32MB at 0xA0000000 and a second
133 * 16MB one at 0xAC000000
136 mi
->bank
[0].start
= 0xa0000000;
137 mi
->bank
[0].node
= 0;
138 mi
->bank
[0].size
= (32*1024*1024);
139 mi
->bank
[1].start
= 0xac000000;
140 mi
->bank
[1].node
= 1;
141 mi
->bank
[1].size
= (16*1024*1024);
144 #ifdef CONFIG_MACH_EZX_A780
145 MACHINE_START(EZX_A780
, "Motorola EZX A780")
146 .phys_io
= 0x40000000,
147 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
149 .boot_params
= 0xa0000100,
150 .map_io
= pxa_map_io
,
151 .init_irq
= pxa27x_init_irq
,
153 .init_machine
= &ezx_init
,
157 #ifdef CONFIG_MACH_EZX_E680
158 MACHINE_START(EZX_E680
, "Motorola EZX E680")
159 .phys_io
= 0x40000000,
160 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
162 .boot_params
= 0xa0000100,
163 .map_io
= pxa_map_io
,
164 .init_irq
= pxa27x_init_irq
,
166 .init_machine
= &ezx_init
,
170 #ifdef CONFIG_MACH_EZX_A1200
171 MACHINE_START(EZX_A1200
, "Motorola EZX A1200")
172 .phys_io
= 0x40000000,
173 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
175 .boot_params
= 0xa0000100,
176 .map_io
= pxa_map_io
,
177 .init_irq
= pxa27x_init_irq
,
179 .init_machine
= &ezx_init
,
183 #ifdef CONFIG_MACH_EZX_A910
184 MACHINE_START(EZX_A910
, "Motorola EZX A910")
185 .phys_io
= 0x40000000,
186 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
188 .boot_params
= 0xa0000100,
189 .map_io
= pxa_map_io
,
190 .init_irq
= pxa27x_init_irq
,
192 .init_machine
= &ezx_init
,
196 #ifdef CONFIG_MACH_EZX_E6
197 MACHINE_START(EZX_E6
, "Motorola EZX E6")
198 .phys_io
= 0x40000000,
199 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
201 .boot_params
= 0xa0000100,
202 .map_io
= pxa_map_io
,
203 .init_irq
= pxa27x_init_irq
,
205 .init_machine
= &ezx_init
,
209 #ifdef CONFIG_MACH_EZX_E2
210 MACHINE_START(EZX_E2
, "Motorola EZX E2")
211 .phys_io
= 0x40000000,
212 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
214 .boot_params
= 0xa0000100,
215 .map_io
= pxa_map_io
,
216 .init_irq
= pxa27x_init_irq
,
218 .init_machine
= &ezx_init
,