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 */
121 static void __init ezx_init(void)
123 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
124 pxa_set_i2c_info(NULL);
125 if (machine_is_ezx_a780() || machine_is_ezx_e680())
126 set_pxa_fb_info(&ezx_fb_info_1);
128 set_pxa_fb_info(&ezx_fb_info_2);
130 platform_add_devices(devices, ARRAY_SIZE(devices));
133 static void __init ezx_fixup(struct machine_desc *desc, struct tag *tags,
134 char **cmdline, struct meminfo *mi)
136 /* We have two ram chips. First one with 32MB at 0xA0000000 and a second
137 * 16MB one at 0xAC000000
140 mi->bank[0].start = 0xa0000000;
141 mi->bank[0].node = 0;
142 mi->bank[0].size = (32*1024*1024);
143 mi->bank[1].start = 0xac000000;
144 mi->bank[1].node = 1;
145 mi->bank[1].size = (16*1024*1024);
148 #ifdef CONFIG_MACH_EZX_A780
149 MACHINE_START(EZX_A780, "Motorola EZX A780")
150 .phys_io = 0x40000000,
151 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
153 .boot_params = 0xa0000100,
154 .map_io = pxa_map_io,
155 .init_irq = pxa27x_init_irq,
157 .init_machine = &ezx_init,
161 #ifdef CONFIG_MACH_EZX_E680
162 MACHINE_START(EZX_E680, "Motorola EZX E680")
163 .phys_io = 0x40000000,
164 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
166 .boot_params = 0xa0000100,
167 .map_io = pxa_map_io,
168 .init_irq = pxa27x_init_irq,
170 .init_machine = &ezx_init,
174 #ifdef CONFIG_MACH_EZX_A1200
175 MACHINE_START(EZX_A1200, "Motorola EZX A1200")
176 .phys_io = 0x40000000,
177 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
179 .boot_params = 0xa0000100,
180 .map_io = pxa_map_io,
181 .init_irq = pxa27x_init_irq,
183 .init_machine = &ezx_init,
187 #ifdef CONFIG_MACH_EZX_A910
188 MACHINE_START(EZX_A910, "Motorola EZX A910")
189 .phys_io = 0x40000000,
190 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
192 .boot_params = 0xa0000100,
193 .map_io = pxa_map_io,
194 .init_irq = pxa27x_init_irq,
196 .init_machine = &ezx_init,
200 #ifdef CONFIG_MACH_EZX_E6
201 MACHINE_START(EZX_E6, "Motorola EZX E6")
202 .phys_io = 0x40000000,
203 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
205 .boot_params = 0xa0000100,
206 .map_io = pxa_map_io,
207 .init_irq = pxa27x_init_irq,
209 .init_machine = &ezx_init,
213 #ifdef CONFIG_MACH_EZX_E2
214 MACHINE_START(EZX_E2, "Motorola EZX E2")
215 .phys_io = 0x40000000,
216 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
218 .boot_params = 0xa0000100,
219 .map_io = pxa_map_io,
220 .init_irq = pxa27x_init_irq,
222 .init_machine = &ezx_init,