aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-12-23 13:06:37 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-12-23 13:06:37 -0500
commit40321fd21c1eb1fb1886eea73b5f87c5e41ff2fb (patch)
tree0d949c487ba15c4c8198a69cd7b8c0cdb5773af4
parentd83a12a40915774332cec625856c2e7ba9033e15 (diff)
parent3b24f30c4f678cfab5c6d090af9559fefa37cc41 (diff)
Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 into devel
Conflicts: arch/arm/mach-pxa/am200epd.c arch/arm/mach-pxa/ezx.c
-rw-r--r--arch/arm/mach-pxa/Kconfig27
-rw-r--r--arch/arm/mach-pxa/Makefile4
-rw-r--r--arch/arm/mach-pxa/am200epd.c4
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c29
-rw-r--r--arch/arm/mach-pxa/e400.c2
-rw-r--r--arch/arm/mach-pxa/ezx.c700
-rw-r--r--arch/arm/mach-pxa/gumstix.c15
-rw-r--r--arch/arm/mach-pxa/imote2.c575
-rw-r--r--arch/arm/mach-pxa/include/mach/gumstix.h4
-rw-r--r--arch/arm/mach-pxa/include/mach/littleton.h11
-rw-r--r--arch/arm/mach-pxa/include/mach/pxafb.h5
-rw-r--r--arch/arm/mach-pxa/include/mach/regs-lcd.h7
-rw-r--r--arch/arm/mach-pxa/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-pxa/littleton.c73
-rw-r--r--arch/arm/mach-pxa/magician.c7
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c6
-rw-r--r--arch/arm/mach-pxa/saar.c421
-rw-r--r--drivers/video/pxafb.c102
18 files changed, 1828 insertions, 166 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 6755c7d6bb31..8eea7306f29b 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -27,15 +27,26 @@ endmenu
27endif 27endif
28 28
29config ARCH_GUMSTIX 29config ARCH_GUMSTIX
30 bool "Gumstix XScale boards" 30 bool "Gumstix XScale 255 boards"
31 select PXA25x
31 help 32 help
32 Say Y here if you intend to run this kernel on a 33 Say Y here if you intend to run this kernel on
33 Gumstix Full Function Minature Computer. 34 Basix, Connex, ws-200ax, ws-400ax systems
34 35
35config MACH_GUMSTIX_F 36choice
36 bool "Basix, Connex, ws-200ax, ws-400ax systems" 37 prompt "Gumstix Carrier/Expansion Board"
37 depends on ARCH_GUMSTIX 38 depends on ARCH_GUMSTIX
38 select PXA25x 39
40config GUMSTIX_AM200EPD
41 bool "Enable AM200EPD board support"
42
43endchoice
44
45config MACH_INTELMOTE2
46 bool "Intel Mote 2 Platform"
47 select PXA27x
48 select IWMMXT
49 select PXA_HAVE_BOARD_IRQS
39 50
40config ARCH_LUBBOCK 51config ARCH_LUBBOCK
41 bool "Intel DBPXA250 Development Platform" 52 bool "Intel DBPXA250 Development Platform"
@@ -348,10 +359,6 @@ config PCM990_DISPLAY_NONE
348 359
349endchoice 360endchoice
350 361
351config MACH_AM200EPD
352 depends on MACH_GUMSTIX_F
353 bool "Enable AM200EPD board support"
354
355config PXA_EZX 362config PXA_EZX
356 bool "Motorola EZX Platform" 363 bool "Motorola EZX Platform"
357 select PXA27x 364 select PXA27x
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index dc184eae5109..7b28bb561d63 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -27,7 +27,7 @@ obj-$(CONFIG_CPU_PXA930) += pxa930.o
27 27
28# Specific board support 28# Specific board support
29obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o 29obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o
30obj-$(CONFIG_MACH_AM200EPD) += am200epd.o 30obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o
31obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o 31obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
32obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o 32obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
33obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o 33obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
@@ -70,6 +70,8 @@ obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx.o cm-x255.o cm-x270.o
70obj-$(CONFIG_MACH_CM_X300) += cm-x300.o 70obj-$(CONFIG_MACH_CM_X300) += cm-x300.o
71obj-$(CONFIG_PXA_EZX) += ezx.o 71obj-$(CONFIG_PXA_EZX) += ezx.o
72 72
73obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o
74
73# Support for blinky lights 75# Support for blinky lights
74led-y := leds.o 76led-y := leds.o
75led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o 77led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o
diff --git a/arch/arm/mach-pxa/am200epd.c b/arch/arm/mach-pxa/am200epd.c
index 3a4f8d855a52..77ee80e5e47b 100644
--- a/arch/arm/mach-pxa/am200epd.c
+++ b/arch/arm/mach-pxa/am200epd.c
@@ -344,7 +344,7 @@ static unsigned long am200_pin_config[] __initdata = {
344 GPIO16_GPIO, 344 GPIO16_GPIO,
345}; 345};
346 346
347static int __init am200_init(void) 347int __init am200_init(void)
348{ 348{
349 int ret; 349 int ret;
350 350
@@ -382,8 +382,6 @@ static int __init am200_init(void)
382module_param(panel_type, uint, 0); 382module_param(panel_type, uint, 0);
383MODULE_PARM_DESC(panel_type, "Select the panel type: 6, 8, 97"); 383MODULE_PARM_DESC(panel_type, "Select the panel type: 6, 8, 97");
384 384
385module_init(am200_init);
386
387MODULE_DESCRIPTION("board driver for am200 metronome epd kit"); 385MODULE_DESCRIPTION("board driver for am200 metronome epd kit");
388MODULE_AUTHOR("Jaya Kumar"); 386MODULE_AUTHOR("Jaya Kumar");
389MODULE_LICENSE("GPL"); 387MODULE_LICENSE("GPL");
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index 0b3ce3b6d896..d99fd9e4d888 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -210,10 +210,8 @@ static struct pxafb_mode_info generic_stn_320x240_mode = {
210static struct pxafb_mach_info generic_stn_320x240 = { 210static struct pxafb_mach_info generic_stn_320x240 = {
211 .modes = &generic_stn_320x240_mode, 211 .modes = &generic_stn_320x240_mode,
212 .num_modes = 1, 212 .num_modes = 1,
213 .lccr0 = 0, 213 .lcd_conn = LCD_COLOR_STN_8BPP | LCD_PCLK_EDGE_FALL |\
214 .lccr3 = (LCCR3_PixClkDiv(0x03) | 214 LCD_AC_BIAS_FREQ(0xff),
215 LCCR3_Acb(0xff) |
216 LCCR3_PCP),
217 .cmap_inverse = 0, 215 .cmap_inverse = 0,
218 .cmap_static = 0, 216 .cmap_static = 0,
219}; 217};
@@ -236,10 +234,8 @@ static struct pxafb_mode_info generic_tft_640x480_mode = {
236static struct pxafb_mach_info generic_tft_640x480 = { 234static struct pxafb_mach_info generic_tft_640x480 = {
237 .modes = &generic_tft_640x480_mode, 235 .modes = &generic_tft_640x480_mode,
238 .num_modes = 1, 236 .num_modes = 1,
239 .lccr0 = (LCCR0_PAS), 237 .lcd_conn = LCD_COLOR_TFT_8BPP | LCD_PCLK_EDGE_FALL |\
240 .lccr3 = (LCCR3_PixClkDiv(0x01) | 238 LCD_AC_BIAS_FREQ(0xff),
241 LCCR3_Acb(0xff) |
242 LCCR3_PCP),
243 .cmap_inverse = 0, 239 .cmap_inverse = 0,
244 .cmap_static = 0, 240 .cmap_static = 0,
245}; 241};
@@ -263,9 +259,7 @@ static struct pxafb_mode_info generic_crt_640x480_mode = {
263static struct pxafb_mach_info generic_crt_640x480 = { 259static struct pxafb_mach_info generic_crt_640x480 = {
264 .modes = &generic_crt_640x480_mode, 260 .modes = &generic_crt_640x480_mode,
265 .num_modes = 1, 261 .num_modes = 1,
266 .lccr0 = (LCCR0_PAS), 262 .lcd_conn = LCD_COLOR_TFT_8BPP | LCD_AC_BIAS_FREQ(0xff),
267 .lccr3 = (LCCR3_PixClkDiv(0x01) |
268 LCCR3_Acb(0xff)),
269 .cmap_inverse = 0, 263 .cmap_inverse = 0,
270 .cmap_static = 0, 264 .cmap_static = 0,
271}; 265};
@@ -289,9 +283,7 @@ static struct pxafb_mode_info generic_crt_800x600_mode = {
289static struct pxafb_mach_info generic_crt_800x600 = { 283static struct pxafb_mach_info generic_crt_800x600 = {
290 .modes = &generic_crt_800x600_mode, 284 .modes = &generic_crt_800x600_mode,
291 .num_modes = 1, 285 .num_modes = 1,
292 .lccr0 = (LCCR0_PAS), 286 .lcd_conn = LCD_COLOR_TFT_8BPP | LCD_AC_BIAS_FREQ(0xff),
293 .lccr3 = (LCCR3_PixClkDiv(0x02) |
294 LCCR3_Acb(0xff)),
295 .cmap_inverse = 0, 287 .cmap_inverse = 0,
296 .cmap_static = 0, 288 .cmap_static = 0,
297}; 289};
@@ -314,10 +306,7 @@ static struct pxafb_mode_info generic_tft_320x240_mode = {
314static struct pxafb_mach_info generic_tft_320x240 = { 306static struct pxafb_mach_info generic_tft_320x240 = {
315 .modes = &generic_tft_320x240_mode, 307 .modes = &generic_tft_320x240_mode,
316 .num_modes = 1, 308 .num_modes = 1,
317 .lccr0 = (LCCR0_PAS), 309 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_AC_BIAS_FREQ(0xff),
318 .lccr3 = (LCCR3_PixClkDiv(0x06) |
319 LCCR3_Acb(0xff) |
320 LCCR3_PCP),
321 .cmap_inverse = 0, 310 .cmap_inverse = 0,
322 .cmap_static = 0, 311 .cmap_static = 0,
323}; 312};
@@ -341,9 +330,7 @@ static struct pxafb_mode_info generic_stn_640x480_mode = {
341static struct pxafb_mach_info generic_stn_640x480 = { 330static struct pxafb_mach_info generic_stn_640x480 = {
342 .modes = &generic_stn_640x480_mode, 331 .modes = &generic_stn_640x480_mode,
343 .num_modes = 1, 332 .num_modes = 1,
344 .lccr0 = 0, 333 .lcd_conn = LCD_COLOR_STN_8BPP | LCD_AC_BIAS_FREQ(0xff),
345 .lccr3 = (LCCR3_PixClkDiv(0x02) |
346 LCCR3_Acb(0xff)),
347 .cmap_inverse = 0, 334 .cmap_inverse = 0,
348 .cmap_static = 0, 335 .cmap_static = 0,
349}; 336};
diff --git a/arch/arm/mach-pxa/e400.c b/arch/arm/mach-pxa/e400.c
index 7716ad0c3b34..bed0336aca3d 100644
--- a/arch/arm/mach-pxa/e400.c
+++ b/arch/arm/mach-pxa/e400.c
@@ -52,7 +52,7 @@ static struct pxafb_mode_info e400_pxafb_mode_info = {
52static struct pxafb_mach_info e400_pxafb_mach_info = { 52static struct pxafb_mach_info e400_pxafb_mach_info = {
53 .modes = &e400_pxafb_mode_info, 53 .modes = &e400_pxafb_mode_info,
54 .num_modes = 1, 54 .num_modes = 1,
55 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, 55 .lcd_conn = LCD_COLOR_TFT_16BPP,
56 .lccr3 = 0, 56 .lccr3 = 0,
57 .pxafb_backlight_power = NULL, 57 .pxafb_backlight_power = NULL,
58}; 58};
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 3e6aa33a2c7c..df5f822f3b6c 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -16,12 +16,14 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/pwm_backlight.h> 18#include <linux/pwm_backlight.h>
19#include <linux/input.h>
19 20
20#include <asm/setup.h> 21#include <asm/setup.h>
21#include <mach/pxafb.h> 22#include <mach/pxafb.h>
22#include <mach/ohci.h> 23#include <mach/ohci.h>
23#include <mach/i2c.h> 24#include <mach/i2c.h>
24#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <mach/pxa27x_keypad.h>
25 27
26#include <mach/mfp-pxa27x.h> 28#include <mach/mfp-pxa27x.h>
27#include <mach/pxa-regs.h> 29#include <mach/pxa-regs.h>
@@ -102,124 +104,732 @@ static unsigned long ezx_pin_config[] __initdata = {
102 GPIO44_BTUART_CTS, 104 GPIO44_BTUART_CTS,
103 GPIO45_BTUART_RTS, 105 GPIO45_BTUART_RTS,
104 106
105 /* STUART */
106 GPIO46_STUART_RXD,
107 GPIO47_STUART_TXD,
108
109 /* For A780 support (connected with Neptune GSM chip) */
110 GPIO30_USB_P3_2, /* ICL_TXENB */
111 GPIO31_USB_P3_6, /* ICL_VPOUT */
112 GPIO90_USB_P3_5, /* ICL_VPIN */
113 GPIO91_USB_P3_1, /* ICL_XRXD */
114 GPIO56_USB_P3_4, /* ICL_VMOUT */
115 GPIO113_USB_P3_3, /* /ICL_VMIN */
116
117 /* I2C */ 107 /* I2C */
118 GPIO117_I2C_SCL, 108 GPIO117_I2C_SCL,
119 GPIO118_I2C_SDA, 109 GPIO118_I2C_SDA,
110
111 /* PCAP SSP */
112 GPIO29_SSP1_SCLK,
113 GPIO25_SSP1_TXD,
114 GPIO26_SSP1_RXD,
115 GPIO24_GPIO, /* pcap chip select */
116 GPIO1_GPIO, /* pcap interrupt */
117 GPIO4_GPIO, /* WDI_AP */
118 GPIO55_GPIO, /* SYS_RESTART */
119
120 /* MMC */
121 GPIO32_MMC_CLK,
122 GPIO92_MMC_DAT_0,
123 GPIO109_MMC_DAT_1,
124 GPIO110_MMC_DAT_2,
125 GPIO111_MMC_DAT_3,
126 GPIO112_MMC_CMD,
127 GPIO11_GPIO, /* mmc detect */
128
129 /* usb to external transceiver */
130 GPIO34_USB_P2_2,
131 GPIO35_USB_P2_1,
132 GPIO36_USB_P2_4,
133 GPIO39_USB_P2_6,
134 GPIO40_USB_P2_5,
135 GPIO53_USB_P2_3,
136
137 /* usb to Neptune GSM chip */
138 GPIO30_USB_P3_2,
139 GPIO31_USB_P3_6,
140 GPIO90_USB_P3_5,
141 GPIO91_USB_P3_1,
142 GPIO56_USB_P3_4,
143 GPIO113_USB_P3_3,
144};
145
146#if defined(CONFIG_MACH_EZX_A780) || defined(CONFIG_MACH_EZX_E680)
147static unsigned long gen1_pin_config[] __initdata = {
148 /* flip / lockswitch */
149 GPIO12_GPIO,
150
151 /* bluetooth (bcm2035) */
152 GPIO14_GPIO | WAKEUP_ON_LEVEL_HIGH, /* HOSTWAKE */
153 GPIO48_GPIO, /* RESET */
154 GPIO28_GPIO, /* WAKEUP */
155
156 /* Neptune handshake */
157 GPIO0_GPIO | WAKEUP_ON_LEVEL_HIGH, /* BP_RDY */
158 GPIO57_GPIO, /* AP_RDY */
159 GPIO13_GPIO | WAKEUP_ON_LEVEL_HIGH, /* WDI */
160 GPIO3_GPIO | WAKEUP_ON_LEVEL_HIGH, /* WDI2 */
161 GPIO82_GPIO, /* RESET */
162 GPIO99_GPIO, /* TC_MM_EN */
163
164 /* sound */
165 GPIO52_SSP3_SCLK,
166 GPIO83_SSP3_SFRM,
167 GPIO81_SSP3_TXD,
168 GPIO89_SSP3_RXD,
169
170 /* ssp2 pins to in */
171 GPIO22_GPIO, /* SSP2_SCLK */
172 GPIO37_GPIO, /* SSP2_SFRM */
173 GPIO38_GPIO, /* SSP2_TXD */
174 GPIO88_GPIO, /* SSP2_RXD */
175
176 /* camera */
177 GPIO23_CIF_MCLK,
178 GPIO54_CIF_PCLK,
179 GPIO85_CIF_LV,
180 GPIO84_CIF_FV,
181 GPIO27_CIF_DD_0,
182 GPIO114_CIF_DD_1,
183 GPIO51_CIF_DD_2,
184 GPIO115_CIF_DD_3,
185 GPIO95_CIF_DD_4,
186 GPIO94_CIF_DD_5,
187 GPIO17_CIF_DD_6,
188 GPIO108_CIF_DD_7,
189 GPIO50_GPIO, /* CAM_EN */
190 GPIO19_GPIO, /* CAM_RST */
191
192 /* EMU */
193 GPIO120_GPIO, /* EMU_MUX1 */
194 GPIO119_GPIO, /* EMU_MUX2 */
195 GPIO86_GPIO, /* SNP_INT_CTL */
196 GPIO87_GPIO, /* SNP_INT_IN */
197};
198#endif
199
200#if defined(CONFIG_MACH_EZX_A1200) || defined(CONFIG_MACH_EZX_A910) || \
201 defined(CONFIG_MACH_EZX_E2) || defined(CONFIG_MACH_EZX_E6)
202static unsigned long gen2_pin_config[] __initdata = {
203 /* flip / lockswitch */
204 GPIO15_GPIO,
205
206 /* EOC */
207 GPIO10_GPIO,
208
209 /* bluetooth (bcm2045) */
210 GPIO13_GPIO | WAKEUP_ON_LEVEL_HIGH, /* HOSTWAKE */
211 GPIO37_GPIO, /* RESET */
212 GPIO57_GPIO, /* WAKEUP */
213
214 /* Neptune handshake */
215 GPIO0_GPIO | WAKEUP_ON_LEVEL_HIGH, /* BP_RDY */
216 GPIO96_GPIO, /* AP_RDY */
217 GPIO3_GPIO | WAKEUP_ON_LEVEL_HIGH, /* WDI */
218 GPIO116_GPIO, /* RESET */
219 GPIO41_GPIO, /* BP_FLASH */
220
221 /* sound */
222 GPIO52_SSP3_SCLK,
223 GPIO83_SSP3_SFRM,
224 GPIO81_SSP3_TXD,
225 GPIO82_SSP3_RXD,
226
227 /* ssp2 pins to in */
228 GPIO22_GPIO, /* SSP2_SCLK */
229 GPIO14_GPIO, /* SSP2_SFRM */
230 GPIO38_GPIO, /* SSP2_TXD */
231 GPIO88_GPIO, /* SSP2_RXD */
232
233 /* camera */
234 GPIO23_CIF_MCLK,
235 GPIO54_CIF_PCLK,
236 GPIO85_CIF_LV,
237 GPIO84_CIF_FV,
238 GPIO27_CIF_DD_0,
239 GPIO114_CIF_DD_1,
240 GPIO51_CIF_DD_2,
241 GPIO115_CIF_DD_3,
242 GPIO95_CIF_DD_4,
243 GPIO48_CIF_DD_5,
244 GPIO93_CIF_DD_6,
245 GPIO12_CIF_DD_7,
246 GPIO50_GPIO, /* CAM_EN */
247 GPIO28_GPIO, /* CAM_RST */
248 GPIO17_GPIO, /* CAM_FLASH */
249};
250#endif
251
252#ifdef CONFIG_MACH_EZX_A780
253static unsigned long a780_pin_config[] __initdata = {
254 /* keypad */
255 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,
256 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
257 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
258 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
259 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
260 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
261 GPIO103_KP_MKOUT_0,
262 GPIO104_KP_MKOUT_1,
263 GPIO105_KP_MKOUT_2,
264 GPIO106_KP_MKOUT_3,
265 GPIO107_KP_MKOUT_4,
266
267 /* attenuate sound */
268 GPIO96_GPIO,
269};
270#endif
271
272#ifdef CONFIG_MACH_EZX_E680
273static unsigned long e680_pin_config[] __initdata = {
274 /* keypad */
275 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,
276 GPIO96_KP_DKIN_3 | WAKEUP_ON_LEVEL_HIGH,
277 GPIO97_KP_DKIN_4 | WAKEUP_ON_LEVEL_HIGH,
278 GPIO98_KP_DKIN_5 | WAKEUP_ON_LEVEL_HIGH,
279 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
280 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
281 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
282 GPIO103_KP_MKOUT_0,
283 GPIO104_KP_MKOUT_1,
284 GPIO105_KP_MKOUT_2,
285 GPIO106_KP_MKOUT_3,
286
287 /* MIDI */
288 GPIO79_GPIO, /* VA_SEL_BUL */
289 GPIO80_GPIO, /* FLT_SEL_BUL */
290 GPIO78_GPIO, /* MIDI_RESET */
291 GPIO33_GPIO, /* MIDI_CS */
292 GPIO15_GPIO, /* MIDI_IRQ */
293 GPIO49_GPIO, /* MIDI_NPWE */
294 GPIO18_GPIO, /* MIDI_RDY */
295
296 /* leds */
297 GPIO46_GPIO,
298 GPIO47_GPIO,
299};
300#endif
301
302#ifdef CONFIG_MACH_EZX_A1200
303static unsigned long a1200_pin_config[] __initdata = {
304 /* keypad */
305 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
306 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
307 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
308 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
309 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
310 GPIO103_KP_MKOUT_0,
311 GPIO104_KP_MKOUT_1,
312 GPIO105_KP_MKOUT_2,
313 GPIO106_KP_MKOUT_3,
314 GPIO107_KP_MKOUT_4,
315 GPIO108_KP_MKOUT_5,
316};
317#endif
318
319#ifdef CONFIG_MACH_EZX_A910
320static unsigned long a910_pin_config[] __initdata = {
321 /* keypad */
322 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
323 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
324 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
325 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
326 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
327 GPIO103_KP_MKOUT_0,
328 GPIO104_KP_MKOUT_1,
329 GPIO105_KP_MKOUT_2,
330 GPIO106_KP_MKOUT_3,
331 GPIO107_KP_MKOUT_4,
332 GPIO108_KP_MKOUT_5,
333
334 /* WLAN */
335 GPIO89_GPIO, /* RESET */
336 GPIO33_GPIO, /* WAKEUP */
337 GPIO94_GPIO | WAKEUP_ON_LEVEL_HIGH, /* HOSTWAKE */
338
339 /* MMC CS */
340 GPIO20_GPIO,
341};
342#endif
343
344#ifdef CONFIG_MACH_EZX_E2
345static unsigned long e2_pin_config[] __initdata = {
346 /* keypad */
347 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
348 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
349 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
350 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
351 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
352 GPIO103_KP_MKOUT_0,
353 GPIO104_KP_MKOUT_1,
354 GPIO105_KP_MKOUT_2,
355 GPIO106_KP_MKOUT_3,
356 GPIO107_KP_MKOUT_4,
357 GPIO108_KP_MKOUT_5,
358};
359#endif
360
361#ifdef CONFIG_MACH_EZX_E6
362static unsigned long e6_pin_config[] __initdata = {
363 /* keypad */
364 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
365 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
366 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
367 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
368 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
369 GPIO103_KP_MKOUT_0,
370 GPIO104_KP_MKOUT_1,
371 GPIO105_KP_MKOUT_2,
372 GPIO106_KP_MKOUT_3,
373 GPIO107_KP_MKOUT_4,
374 GPIO108_KP_MKOUT_5,
375};
376#endif
377
378/* KEYPAD */
379#ifdef CONFIG_MACH_EZX_A780
380static unsigned int a780_key_map[] = {
381 KEY(0, 0, KEY_SEND),
382 KEY(0, 1, KEY_BACK),
383 KEY(0, 2, KEY_END),
384 KEY(0, 3, KEY_PAGEUP),
385 KEY(0, 4, KEY_UP),
386
387 KEY(1, 0, KEY_NUMERIC_1),
388 KEY(1, 1, KEY_NUMERIC_2),
389 KEY(1, 2, KEY_NUMERIC_3),
390 KEY(1, 3, KEY_SELECT),
391 KEY(1, 4, KEY_KPENTER),
392
393 KEY(2, 0, KEY_NUMERIC_4),
394 KEY(2, 1, KEY_NUMERIC_5),
395 KEY(2, 2, KEY_NUMERIC_6),
396 KEY(2, 3, KEY_RECORD),
397 KEY(2, 4, KEY_LEFT),
398
399 KEY(3, 0, KEY_NUMERIC_7),
400 KEY(3, 1, KEY_NUMERIC_8),
401 KEY(3, 2, KEY_NUMERIC_9),
402 KEY(3, 3, KEY_HOME),
403 KEY(3, 4, KEY_RIGHT),
404
405 KEY(4, 0, KEY_NUMERIC_STAR),
406 KEY(4, 1, KEY_NUMERIC_0),
407 KEY(4, 2, KEY_NUMERIC_POUND),
408 KEY(4, 3, KEY_PAGEDOWN),
409 KEY(4, 4, KEY_DOWN),
410};
411
412static struct pxa27x_keypad_platform_data a780_keypad_platform_data = {
413 .matrix_key_rows = 5,
414 .matrix_key_cols = 5,
415 .matrix_key_map = a780_key_map,
416 .matrix_key_map_size = ARRAY_SIZE(a780_key_map),
417
418 .direct_key_map = { KEY_CAMERA },
419 .direct_key_num = 1,
420
421 .debounce_interval = 30,
422};
423#endif /* CONFIG_MACH_EZX_A780 */
424
425#ifdef CONFIG_MACH_EZX_E680
426static unsigned int e680_key_map[] = {
427 KEY(0, 0, KEY_UP),
428 KEY(0, 1, KEY_RIGHT),
429 KEY(0, 2, KEY_RESERVED),
430 KEY(0, 3, KEY_SEND),
431
432 KEY(1, 0, KEY_DOWN),
433 KEY(1, 1, KEY_LEFT),
434 KEY(1, 2, KEY_PAGEUP),
435 KEY(1, 3, KEY_PAGEDOWN),
436
437 KEY(2, 0, KEY_RESERVED),
438 KEY(2, 1, KEY_RESERVED),
439 KEY(2, 2, KEY_RESERVED),
440 KEY(2, 3, KEY_KPENTER),
441};
442
443static struct pxa27x_keypad_platform_data e680_keypad_platform_data = {
444 .matrix_key_rows = 3,
445 .matrix_key_cols = 4,
446 .matrix_key_map = e680_key_map,
447 .matrix_key_map_size = ARRAY_SIZE(e680_key_map),
448
449 .direct_key_map = {
450 KEY_CAMERA,
451 KEY_RESERVED,
452 KEY_RESERVED,
453 KEY_F1,
454 KEY_CANCEL,
455 KEY_F2,
456 },
457 .direct_key_num = 6,
458
459 .debounce_interval = 30,
460};
461#endif /* CONFIG_MACH_EZX_E680 */
462
463#ifdef CONFIG_MACH_EZX_A1200
464static unsigned int a1200_key_map[] = {
465 KEY(0, 0, KEY_RESERVED),
466 KEY(0, 1, KEY_RIGHT),
467 KEY(0, 2, KEY_PAGEDOWN),
468 KEY(0, 3, KEY_RESERVED),
469 KEY(0, 4, KEY_RESERVED),
470 KEY(0, 5, KEY_RESERVED),
471
472 KEY(1, 0, KEY_RESERVED),
473 KEY(1, 1, KEY_DOWN),
474 KEY(1, 2, KEY_CAMERA),
475 KEY(1, 3, KEY_RESERVED),
476 KEY(1, 4, KEY_RESERVED),
477 KEY(1, 5, KEY_RESERVED),
478
479 KEY(2, 0, KEY_RESERVED),
480 KEY(2, 1, KEY_KPENTER),
481 KEY(2, 2, KEY_RECORD),
482 KEY(2, 3, KEY_RESERVED),
483 KEY(2, 4, KEY_RESERVED),
484 KEY(2, 5, KEY_SELECT),
485
486 KEY(3, 0, KEY_RESERVED),
487 KEY(3, 1, KEY_UP),
488 KEY(3, 2, KEY_SEND),
489 KEY(3, 3, KEY_RESERVED),
490 KEY(3, 4, KEY_RESERVED),
491 KEY(3, 5, KEY_RESERVED),
492
493 KEY(4, 0, KEY_RESERVED),
494 KEY(4, 1, KEY_LEFT),
495 KEY(4, 2, KEY_PAGEUP),
496 KEY(4, 3, KEY_RESERVED),
497 KEY(4, 4, KEY_RESERVED),
498 KEY(4, 5, KEY_RESERVED),
499};
500
501static struct pxa27x_keypad_platform_data a1200_keypad_platform_data = {
502 .matrix_key_rows = 5,
503 .matrix_key_cols = 6,
504 .matrix_key_map = a1200_key_map,
505 .matrix_key_map_size = ARRAY_SIZE(a1200_key_map),
506
507 .debounce_interval = 30,
508};
509#endif /* CONFIG_MACH_EZX_A1200 */
510
511#ifdef CONFIG_MACH_EZX_E6
512static unsigned int e6_key_map[] = {
513 KEY(0, 0, KEY_RESERVED),
514 KEY(0, 1, KEY_RIGHT),
515 KEY(0, 2, KEY_PAGEDOWN),
516 KEY(0, 3, KEY_RESERVED),
517 KEY(0, 4, KEY_RESERVED),
518 KEY(0, 5, KEY_NEXTSONG),
519
520 KEY(1, 0, KEY_RESERVED),
521 KEY(1, 1, KEY_DOWN),
522 KEY(1, 2, KEY_PROG1),
523 KEY(1, 3, KEY_RESERVED),
524 KEY(1, 4, KEY_RESERVED),
525 KEY(1, 5, KEY_RESERVED),
526
527 KEY(2, 0, KEY_RESERVED),
528 KEY(2, 1, KEY_ENTER),
529 KEY(2, 2, KEY_CAMERA),
530 KEY(2, 3, KEY_RESERVED),
531 KEY(2, 4, KEY_RESERVED),
532 KEY(2, 5, KEY_WWW),
533
534 KEY(3, 0, KEY_RESERVED),
535 KEY(3, 1, KEY_UP),
536 KEY(3, 2, KEY_SEND),
537 KEY(3, 3, KEY_RESERVED),
538 KEY(3, 4, KEY_RESERVED),
539 KEY(3, 5, KEY_PLAYPAUSE),
540
541 KEY(4, 0, KEY_RESERVED),
542 KEY(4, 1, KEY_LEFT),
543 KEY(4, 2, KEY_PAGEUP),
544 KEY(4, 3, KEY_RESERVED),
545 KEY(4, 4, KEY_RESERVED),
546 KEY(4, 5, KEY_PREVIOUSSONG),
547};
548
549static struct pxa27x_keypad_platform_data e6_keypad_platform_data = {
550 .matrix_key_rows = 5,
551 .matrix_key_cols = 6,
552 .matrix_key_map = e6_key_map,
553 .matrix_key_map_size = ARRAY_SIZE(e6_key_map),
554
555 .debounce_interval = 30,
556};
557#endif /* CONFIG_MACH_EZX_E6 */
558
559#ifdef CONFIG_MACH_EZX_A910
560static unsigned int a910_key_map[] = {
561 KEY(0, 0, KEY_NUMERIC_6),
562 KEY(0, 1, KEY_RIGHT),
563 KEY(0, 2, KEY_PAGEDOWN),
564 KEY(0, 3, KEY_KPENTER),
565 KEY(0, 4, KEY_NUMERIC_5),
566 KEY(0, 5, KEY_CAMERA),
567
568 KEY(1, 0, KEY_NUMERIC_8),
569 KEY(1, 1, KEY_DOWN),
570 KEY(1, 2, KEY_RESERVED),
571 KEY(1, 3, KEY_F1), /* Left SoftKey */
572 KEY(1, 4, KEY_NUMERIC_STAR),
573 KEY(1, 5, KEY_RESERVED),
574
575 KEY(2, 0, KEY_NUMERIC_7),
576 KEY(2, 1, KEY_NUMERIC_9),
577 KEY(2, 2, KEY_RECORD),
578 KEY(2, 3, KEY_F2), /* Right SoftKey */
579 KEY(2, 4, KEY_BACK),
580 KEY(2, 5, KEY_SELECT),
581
582 KEY(3, 0, KEY_NUMERIC_2),
583 KEY(3, 1, KEY_UP),
584 KEY(3, 2, KEY_SEND),
585 KEY(3, 3, KEY_NUMERIC_0),
586 KEY(3, 4, KEY_NUMERIC_1),
587 KEY(3, 5, KEY_RECORD),
588
589 KEY(4, 0, KEY_NUMERIC_4),
590 KEY(4, 1, KEY_LEFT),
591 KEY(4, 2, KEY_PAGEUP),
592 KEY(4, 3, KEY_NUMERIC_POUND),
593 KEY(4, 4, KEY_NUMERIC_3),
594 KEY(4, 5, KEY_RESERVED),
120}; 595};
121 596
122static void __init ezx_init(void) 597static struct pxa27x_keypad_platform_data a910_keypad_platform_data = {
598 .matrix_key_rows = 5,
599 .matrix_key_cols = 6,
600 .matrix_key_map = a910_key_map,
601 .matrix_key_map_size = ARRAY_SIZE(a910_key_map),
602
603 .debounce_interval = 30,
604};
605#endif /* CONFIG_MACH_EZX_A910 */
606
607#ifdef CONFIG_MACH_EZX_E2
608static unsigned int e2_key_map[] = {
609 KEY(0, 0, KEY_NUMERIC_6),
610 KEY(0, 1, KEY_RIGHT),
611 KEY(0, 2, KEY_NUMERIC_9),
612 KEY(0, 3, KEY_NEXTSONG),
613 KEY(0, 4, KEY_NUMERIC_5),
614 KEY(0, 5, KEY_F1), /* Left SoftKey */
615
616 KEY(1, 0, KEY_NUMERIC_8),
617 KEY(1, 1, KEY_DOWN),
618 KEY(1, 2, KEY_RESERVED),
619 KEY(1, 3, KEY_PAGEUP),
620 KEY(1, 4, KEY_NUMERIC_STAR),
621 KEY(1, 5, KEY_F2), /* Right SoftKey */
622
623 KEY(2, 0, KEY_NUMERIC_7),
624 KEY(2, 1, KEY_KPENTER),
625 KEY(2, 2, KEY_RECORD),
626 KEY(2, 3, KEY_PAGEDOWN),
627 KEY(2, 4, KEY_BACK),
628 KEY(2, 5, KEY_NUMERIC_0),
629
630 KEY(3, 0, KEY_NUMERIC_2),
631 KEY(3, 1, KEY_UP),
632 KEY(3, 2, KEY_SEND),
633 KEY(3, 3, KEY_PLAYPAUSE),
634 KEY(3, 4, KEY_NUMERIC_1),
635 KEY(3, 5, KEY_SOUND), /* Music SoftKey */
636
637 KEY(4, 0, KEY_NUMERIC_4),
638 KEY(4, 1, KEY_LEFT),
639 KEY(4, 2, KEY_NUMERIC_POUND),
640 KEY(4, 3, KEY_PREVIOUSSONG),
641 KEY(4, 4, KEY_NUMERIC_3),
642 KEY(4, 5, KEY_RESERVED),
643};
644
645static struct pxa27x_keypad_platform_data e2_keypad_platform_data = {
646 .matrix_key_rows = 5,
647 .matrix_key_cols = 6,
648 .matrix_key_map = e2_key_map,
649 .matrix_key_map_size = ARRAY_SIZE(e2_key_map),
650
651 .debounce_interval = 30,
652};
653#endif /* CONFIG_MACH_EZX_E2 */
654
655#ifdef CONFIG_MACH_EZX_A780
656static void __init a780_init(void)
123{ 657{
124 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); 658 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
659 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
660 pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config));
661
125 pxa_set_i2c_info(NULL); 662 pxa_set_i2c_info(NULL);
126 if (machine_is_ezx_a780() || machine_is_ezx_e680())
127 set_pxa_fb_info(&ezx_fb_info_1);
128 else
129 set_pxa_fb_info(&ezx_fb_info_2);
130 663
131 platform_add_devices(devices, ARRAY_SIZE(devices)); 664 set_pxa_fb_info(&ezx_fb_info_1);
132}
133 665
134static void __init ezx_fixup(struct machine_desc *desc, struct tag *tags, 666 pxa_set_keypad_info(&a780_keypad_platform_data);
135 char **cmdline, struct meminfo *mi) 667
136{ 668 platform_add_devices(devices, ARRAY_SIZE(devices));
137 /* We have two ram chips. First one with 32MB at 0xA0000000 and a second
138 * 16MB one at 0xAC000000
139 */
140 mi->nr_banks = 2;
141 mi->bank[0].start = 0xa0000000;
142 mi->bank[0].node = 0;
143 mi->bank[0].size = (32*1024*1024);
144 mi->bank[1].start = 0xac000000;
145 mi->bank[1].node = 1;
146 mi->bank[1].size = (16*1024*1024);
147} 669}
148 670
149#ifdef CONFIG_MACH_EZX_A780
150MACHINE_START(EZX_A780, "Motorola EZX A780") 671MACHINE_START(EZX_A780, "Motorola EZX A780")
151 .phys_io = 0x40000000, 672 .phys_io = 0x40000000,
152 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 673 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
153 .fixup = ezx_fixup,
154 .boot_params = 0xa0000100, 674 .boot_params = 0xa0000100,
155 .map_io = pxa_map_io, 675 .map_io = pxa_map_io,
156 .init_irq = pxa27x_init_irq, 676 .init_irq = pxa27x_init_irq,
157 .timer = &pxa_timer, 677 .timer = &pxa_timer,
158 .init_machine = &ezx_init, 678 .init_machine = a780_init,
159MACHINE_END 679MACHINE_END
160#endif 680#endif
161 681
162#ifdef CONFIG_MACH_EZX_E680 682#ifdef CONFIG_MACH_EZX_E680
683static struct i2c_board_info __initdata e680_i2c_board_info[] = {
684 { I2C_BOARD_INFO("tea5767", 0x81) },
685};
686
687static void __init e680_init(void)
688{
689 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
690 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
691 pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config));
692
693 pxa_set_i2c_info(NULL);
694 i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info));
695
696 set_pxa_fb_info(&ezx_fb_info_1);
697
698 pxa_set_keypad_info(&e680_keypad_platform_data);
699
700 platform_add_devices(devices, ARRAY_SIZE(devices));
701}
702
163MACHINE_START(EZX_E680, "Motorola EZX E680") 703MACHINE_START(EZX_E680, "Motorola EZX E680")
164 .phys_io = 0x40000000, 704 .phys_io = 0x40000000,
165 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 705 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
166 .fixup = ezx_fixup,
167 .boot_params = 0xa0000100, 706 .boot_params = 0xa0000100,
168 .map_io = pxa_map_io, 707 .map_io = pxa_map_io,
169 .init_irq = pxa27x_init_irq, 708 .init_irq = pxa27x_init_irq,
170 .timer = &pxa_timer, 709 .timer = &pxa_timer,
171 .init_machine = &ezx_init, 710 .init_machine = e680_init,
172MACHINE_END 711MACHINE_END
173#endif 712#endif
174 713
175#ifdef CONFIG_MACH_EZX_A1200 714#ifdef CONFIG_MACH_EZX_A1200
715static struct i2c_board_info __initdata a1200_i2c_board_info[] = {
716 { I2C_BOARD_INFO("tea5767", 0x81) },
717};
718
719static void __init a1200_init(void)
720{
721 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
722 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
723 pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config));
724
725 pxa_set_i2c_info(NULL);
726 i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info));
727
728 set_pxa_fb_info(&ezx_fb_info_2);
729
730 pxa_set_keypad_info(&a1200_keypad_platform_data);
731
732 platform_add_devices(devices, ARRAY_SIZE(devices));
733}
734
176MACHINE_START(EZX_A1200, "Motorola EZX A1200") 735MACHINE_START(EZX_A1200, "Motorola EZX A1200")
177 .phys_io = 0x40000000, 736 .phys_io = 0x40000000,
178 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 737 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
179 .fixup = ezx_fixup,
180 .boot_params = 0xa0000100, 738 .boot_params = 0xa0000100,
181 .map_io = pxa_map_io, 739 .map_io = pxa_map_io,
182 .init_irq = pxa27x_init_irq, 740 .init_irq = pxa27x_init_irq,
183 .timer = &pxa_timer, 741 .timer = &pxa_timer,
184 .init_machine = &ezx_init, 742 .init_machine = a1200_init,
185MACHINE_END 743MACHINE_END
186#endif 744#endif
187 745
188#ifdef CONFIG_MACH_EZX_A910 746#ifdef CONFIG_MACH_EZX_A910
747static void __init a910_init(void)
748{
749 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
750 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
751 pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config));
752
753 pxa_set_i2c_info(NULL);
754
755 set_pxa_fb_info(&ezx_fb_info_2);
756
757 pxa_set_keypad_info(&a910_keypad_platform_data);
758
759 platform_add_devices(devices, ARRAY_SIZE(devices));
760}
761
189MACHINE_START(EZX_A910, "Motorola EZX A910") 762MACHINE_START(EZX_A910, "Motorola EZX A910")
190 .phys_io = 0x40000000, 763 .phys_io = 0x40000000,
191 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 764 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
192 .fixup = ezx_fixup,
193 .boot_params = 0xa0000100, 765 .boot_params = 0xa0000100,
194 .map_io = pxa_map_io, 766 .map_io = pxa_map_io,
195 .init_irq = pxa27x_init_irq, 767 .init_irq = pxa27x_init_irq,
196 .timer = &pxa_timer, 768 .timer = &pxa_timer,
197 .init_machine = &ezx_init, 769 .init_machine = a910_init,
198MACHINE_END 770MACHINE_END
199#endif 771#endif
200 772
201#ifdef CONFIG_MACH_EZX_E6 773#ifdef CONFIG_MACH_EZX_E6
774static struct i2c_board_info __initdata e6_i2c_board_info[] = {
775 { I2C_BOARD_INFO("tea5767", 0x81) },
776};
777
778static void __init e6_init(void)
779{
780 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
781 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
782 pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config));
783
784 pxa_set_i2c_info(NULL);
785 i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info));
786
787 set_pxa_fb_info(&ezx_fb_info_2);
788
789 pxa_set_keypad_info(&e6_keypad_platform_data);
790
791 platform_add_devices(devices, ARRAY_SIZE(devices));
792}
793
202MACHINE_START(EZX_E6, "Motorola EZX E6") 794MACHINE_START(EZX_E6, "Motorola EZX E6")
203 .phys_io = 0x40000000, 795 .phys_io = 0x40000000,
204 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 796 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
205 .fixup = ezx_fixup,
206 .boot_params = 0xa0000100, 797 .boot_params = 0xa0000100,
207 .map_io = pxa_map_io, 798 .map_io = pxa_map_io,
208 .init_irq = pxa27x_init_irq, 799 .init_irq = pxa27x_init_irq,
209 .timer = &pxa_timer, 800 .timer = &pxa_timer,
210 .init_machine = &ezx_init, 801 .init_machine = e6_init,
211MACHINE_END 802MACHINE_END
212#endif 803#endif
213 804
214#ifdef CONFIG_MACH_EZX_E2 805#ifdef CONFIG_MACH_EZX_E2
806static struct i2c_board_info __initdata e2_i2c_board_info[] = {
807 { I2C_BOARD_INFO("tea5767", 0x81) },
808};
809
810static void __init e2_init(void)
811{
812 pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
813 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
814 pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config));
815
816 pxa_set_i2c_info(NULL);
817 i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info));
818
819 set_pxa_fb_info(&ezx_fb_info_2);
820
821 pxa_set_keypad_info(&e2_keypad_platform_data);
822
823 platform_add_devices(devices, ARRAY_SIZE(devices));
824}
825
215MACHINE_START(EZX_E2, "Motorola EZX E2") 826MACHINE_START(EZX_E2, "Motorola EZX E2")
216 .phys_io = 0x40000000, 827 .phys_io = 0x40000000,
217 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 828 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
218 .fixup = ezx_fixup,
219 .boot_params = 0xa0000100, 829 .boot_params = 0xa0000100,
220 .map_io = pxa_map_io, 830 .map_io = pxa_map_io,
221 .init_irq = pxa27x_init_irq, 831 .init_irq = pxa27x_init_irq,
222 .timer = &pxa_timer, 832 .timer = &pxa_timer,
223 .init_machine = &ezx_init, 833 .init_machine = e2_init,
224MACHINE_END 834MACHINE_END
225#endif 835#endif
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
index 06bc6674b015..e296ce11658c 100644
--- a/arch/arm/mach-pxa/gumstix.c
+++ b/arch/arm/mach-pxa/gumstix.c
@@ -186,6 +186,20 @@ static unsigned long gumstix_pin_config[] __initdata = {
186 GPIO8_MMC_CS0, 186 GPIO8_MMC_CS0,
187}; 187};
188 188
189int __attribute__((weak)) am200_init(void)
190{
191 return 0;
192}
193
194static void __init carrier_board_init(void)
195{
196 /*
197 * put carrier/expansion board init here if
198 * they cannot be detected programatically
199 */
200 am200_init();
201}
202
189static void __init gumstix_init(void) 203static void __init gumstix_init(void)
190{ 204{
191 pxa2xx_mfp_config(ARRAY_AND_SIZE(gumstix_pin_config)); 205 pxa2xx_mfp_config(ARRAY_AND_SIZE(gumstix_pin_config));
@@ -194,6 +208,7 @@ static void __init gumstix_init(void)
194 gumstix_udc_init(); 208 gumstix_udc_init();
195 gumstix_mmc_init(); 209 gumstix_mmc_init();
196 (void) platform_add_devices(devices, ARRAY_SIZE(devices)); 210 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
211 carrier_board_init();
197} 212}
198 213
199MACHINE_START(GUMSTIX, "Gumstix") 214MACHINE_START(GUMSTIX, "Gumstix")
diff --git a/arch/arm/mach-pxa/imote2.c b/arch/arm/mach-pxa/imote2.c
new file mode 100644
index 000000000000..364c5e271330
--- /dev/null
+++ b/arch/arm/mach-pxa/imote2.c
@@ -0,0 +1,575 @@
1/*
2 * linux/arch/arm/mach-pxa/imote2.c
3 *
4 * Author: Ed C. Epp
5 * Created: Nov 05, 2002
6 * Copyright: Intel Corp.
7 *
8 * Modified 2008: Jonathan Cameron
9 *
10 * The Imote2 is a wireless sensor node platform sold
11 * by Crossbow (www.xbow.com).
12 */
13
14#include <linux/init.h>
15#include <linux/device.h>
16#include <linux/mtd/mtd.h>
17#include <linux/mtd/partitions.h>
18#include <linux/platform_device.h>
19#include <linux/regulator/machine.h>
20#include <linux/gpio.h>
21#include <linux/leds.h>
22#include <linux/spi/spi.h>
23#include <linux/i2c.h>
24#include <linux/mfd/da903x.h>
25
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/flash.h>
30
31#include <mach/i2c.h>
32#include <mach/pxa-regs.h>
33#include <mach/pxa2xx-regs.h>
34#include <mach/mfp-pxa27x.h>
35#include <mach/regs-ssp.h>
36#include <mach/udc.h>
37#include <mach/mmc.h>
38#include <mach/pxa2xx_spi.h>
39#include <mach/pxa27x-udc.h>
40
41#include "devices.h"
42#include "generic.h"
43
44static unsigned long imote2_pin_config[] __initdata = {
45
46 /* Device Identification for wakeup*/
47 GPIO102_GPIO,
48
49 /* Button */
50 GPIO91_GPIO,
51
52 /* DA9030 */
53 GPIO1_GPIO,
54
55 /* MMC */
56 GPIO32_MMC_CLK,
57 GPIO112_MMC_CMD,
58 GPIO92_MMC_DAT_0,
59 GPIO109_MMC_DAT_1,
60 GPIO110_MMC_DAT_2,
61 GPIO111_MMC_DAT_3,
62
63 /* 802.15.4 radio - driver out of mainline */
64 GPIO22_GPIO, /* CC_RSTN */
65 GPIO114_GPIO, /* CC_FIFO */
66 GPIO116_GPIO, /* CC_CCA */
67 GPIO0_GPIO, /* CC_FIFOP */
68 GPIO16_GPIO, /* CCSFD */
69 GPIO39_GPIO, /* CSn */
70 GPIO115_GPIO, /* Power enable */
71
72 /* I2C */
73 GPIO117_I2C_SCL,
74 GPIO118_I2C_SDA,
75
76 /* SSP 3 - 802.15.4 radio */
77 GPIO39_GPIO, /* Chip Select */
78 GPIO34_SSP3_SCLK,
79 GPIO35_SSP3_TXD,
80 GPIO41_SSP3_RXD,
81
82 /* SSP 2 - to daughter boards */
83 GPIO37_GPIO, /* Chip Select */
84 GPIO36_SSP2_SCLK,
85 GPIO38_SSP2_TXD,
86 GPIO11_SSP2_RXD,
87
88 /* SSP 1 - to daughter boards */
89 GPIO24_GPIO, /* Chip Select */
90 GPIO23_SSP1_SCLK,
91 GPIO25_SSP1_TXD,
92 GPIO26_SSP1_RXD,
93
94 /* BTUART Basic Connector*/
95 GPIO42_BTUART_RXD,
96 GPIO43_BTUART_TXD,
97 GPIO44_BTUART_CTS,
98 GPIO45_BTUART_RTS,
99
100 /* STUART Serial console via debug board*/
101 GPIO46_STUART_RXD,
102 GPIO47_STUART_TXD,
103
104 /* Basic sensor board */
105 GPIO96_GPIO, /* accelerometer interrupt */
106 GPIO99_GPIO, /* ADC interrupt */
107
108 /* Connector pins specified as gpios */
109 GPIO94_GPIO, /* large basic connector pin 14 */
110 GPIO10_GPIO, /* large basic connector pin 23 */
111
112 /* LEDS */
113 GPIO103_GPIO, /* red led */
114 GPIO104_GPIO, /* green led */
115 GPIO105_GPIO, /* blue led */
116};
117
118static struct gpio_led imote2_led_pins[] = {
119 {
120 .name = "imote2:red",
121 .gpio = 103,
122 .active_low = 1,
123 }, {
124 .name = "imote2:green",
125 .gpio = 104,
126 .active_low = 1,
127 }, {
128 .name = "imote2:blue",
129 .gpio = 105,
130 .active_low = 1,
131 },
132};
133
134static struct gpio_led_platform_data imote2_led_data = {
135 .num_leds = ARRAY_SIZE(imote2_led_pins),
136 .leds = imote2_led_pins,
137};
138
139static struct platform_device imote2_leds = {
140 .name = "leds-gpio",
141 .id = -1,
142 .dev = {
143 .platform_data = &imote2_led_data,
144 },
145};
146
147/* Reverse engineered partly from Platformx drivers */
148enum imote2_ldos{
149 vcc_vref,
150 vcc_cc2420,
151 vcc_mica,
152 vcc_bt,
153 /* The two voltages available to sensor boards */
154 vcc_sensor_1_8,
155 vcc_sensor_3,
156
157 vcc_sram_ext, /* directly connected to the pxa271 */
158 vcc_pxa_pll,
159 vcc_pxa_usim, /* Reference voltage for certain gpios */
160 vcc_pxa_mem,
161 vcc_pxa_flash,
162 vcc_pxa_core, /*Dc-Dc buck not yet supported */
163 vcc_lcd,
164 vcc_bb,
165 vcc_bbio,
166 vcc_io, /* cc2420 802.15.4 radio and pxa vcc_io ?*/
167};
168
169/* The values of the various regulator constraints are obviously dependent
170 * on exactly what is wired to each ldo. Unfortunately this information is
171 * not generally available. More information has been requested from Xbow
172 * but as of yet they haven't been forthcoming.
173 *
174 * Some of these are clearly Stargate 2 related (no way of plugging
175 * in an lcd on the IM2 for example!).
176 */
177static struct regulator_init_data imote2_ldo_init_data[] = {
178 [vcc_bbio] = {
179 .constraints = { /* board default 1.8V */
180 .name = "vcc_bbio",
181 .min_uV = 1800000,
182 .max_uV = 1800000,
183 },
184 },
185 [vcc_bb] = {
186 .constraints = { /* board default 2.8V */
187 .name = "vcc_bb",
188 .min_uV = 2700000,
189 .max_uV = 3000000,
190 },
191 },
192 [vcc_pxa_flash] = {
193 .constraints = {/* default is 1.8V */
194 .name = "vcc_pxa_flash",
195 .min_uV = 1800000,
196 .max_uV = 1800000,
197 },
198 },
199 [vcc_cc2420] = { /* also vcc_io */
200 .constraints = {
201 /* board default is 2.8V */
202 .name = "vcc_cc2420",
203 .min_uV = 2700000,
204 .max_uV = 3300000,
205 },
206 },
207 [vcc_vref] = { /* Reference for what? */
208 .constraints = { /* default 1.8V */
209 .name = "vcc_vref",
210 .min_uV = 1800000,
211 .max_uV = 1800000,
212 },
213 },
214 [vcc_sram_ext] = {
215 .constraints = { /* default 2.8V */
216 .name = "vcc_sram_ext",
217 .min_uV = 2800000,
218 .max_uV = 2800000,
219 },
220 },
221 [vcc_mica] = {
222 .constraints = { /* default 2.8V */
223 .name = "vcc_mica",
224 .min_uV = 2800000,
225 .max_uV = 2800000,
226 },
227 },
228 [vcc_bt] = {
229 .constraints = { /* default 2.8V */
230 .name = "vcc_bt",
231 .min_uV = 2800000,
232 .max_uV = 2800000,
233 },
234 },
235 [vcc_lcd] = {
236 .constraints = { /* default 2.8V */
237 .name = "vcc_lcd",
238 .min_uV = 2700000,
239 .max_uV = 3300000,
240 },
241 },
242 [vcc_io] = { /* Same or higher than everything
243 * bar vccbat and vccusb */
244 .constraints = { /* default 2.8V */
245 .name = "vcc_io",
246 .min_uV = 2692000,
247 .max_uV = 3300000,
248 },
249 },
250 [vcc_sensor_1_8] = {
251 .constraints = { /* default 1.8V */
252 .name = "vcc_sensor_1_8",
253 .min_uV = 1800000,
254 .max_uV = 1800000,
255 },
256 },
257 [vcc_sensor_3] = { /* curiously default 2.8V */
258 .constraints = {
259 .name = "vcc_sensor_3",
260 .min_uV = 2800000,
261 .max_uV = 3000000,
262 },
263 },
264 [vcc_pxa_pll] = { /* 1.17V - 1.43V, default 1.3V*/
265 .constraints = {
266 .name = "vcc_pxa_pll",
267 .min_uV = 1170000,
268 .max_uV = 1430000,
269 },
270 },
271 [vcc_pxa_usim] = {
272 .constraints = { /* default 1.8V */
273 .name = "vcc_pxa_usim",
274 .min_uV = 1710000,
275 .max_uV = 2160000,
276 },
277 },
278 [vcc_pxa_mem] = {
279 .constraints = { /* default 1.8V */
280 .name = "vcc_pxa_mem",
281 .min_uV = 1800000,
282 .max_uV = 1800000,
283 },
284 },
285};
286
287static struct da903x_subdev_info imote2_da9030_subdevs[] = {
288 {
289 .name = "da903x-regulator",
290 .id = DA9030_ID_LDO2,
291 .platform_data = &imote2_ldo_init_data[vcc_bbio],
292 }, {
293 .name = "da903x-regulator",
294 .id = DA9030_ID_LDO3,
295 .platform_data = &imote2_ldo_init_data[vcc_bb],
296 }, {
297 .name = "da903x-regulator",
298 .id = DA9030_ID_LDO4,
299 .platform_data = &imote2_ldo_init_data[vcc_pxa_flash],
300 }, {
301 .name = "da903x-regulator",
302 .id = DA9030_ID_LDO5,
303 .platform_data = &imote2_ldo_init_data[vcc_cc2420],
304 }, {
305 .name = "da903x-regulator",
306 .id = DA9030_ID_LDO6,
307 .platform_data = &imote2_ldo_init_data[vcc_vref],
308 }, {
309 .name = "da903x-regulator",
310 .id = DA9030_ID_LDO7,
311 .platform_data = &imote2_ldo_init_data[vcc_sram_ext],
312 }, {
313 .name = "da903x-regulator",
314 .id = DA9030_ID_LDO8,
315 .platform_data = &imote2_ldo_init_data[vcc_mica],
316 }, {
317 .name = "da903x-regulator",
318 .id = DA9030_ID_LDO9,
319 .platform_data = &imote2_ldo_init_data[vcc_bt],
320 }, {
321 .name = "da903x-regulator",
322 .id = DA9030_ID_LDO10,
323 .platform_data = &imote2_ldo_init_data[vcc_sensor_1_8],
324 }, {
325 .name = "da903x-regulator",
326 .id = DA9030_ID_LDO11,
327 .platform_data = &imote2_ldo_init_data[vcc_sensor_3],
328 }, {
329 .name = "da903x-regulator",
330 .id = DA9030_ID_LDO12,
331 .platform_data = &imote2_ldo_init_data[vcc_lcd],
332 }, {
333 .name = "da903x-regulator",
334 .id = DA9030_ID_LDO15,
335 .platform_data = &imote2_ldo_init_data[vcc_pxa_pll],
336 }, {
337 .name = "da903x-regulator",
338 .id = DA9030_ID_LDO17,
339 .platform_data = &imote2_ldo_init_data[vcc_pxa_usim],
340 }, {
341 .name = "da903x-regulator",
342 .id = DA9030_ID_LDO18,
343 .platform_data = &imote2_ldo_init_data[vcc_io],
344 }, {
345 .name = "da903x-regulator",
346 .id = DA9030_ID_LDO19,
347 .platform_data = &imote2_ldo_init_data[vcc_pxa_mem],
348 },
349};
350
351static struct da903x_platform_data imote2_da9030_pdata = {
352 .num_subdevs = ARRAY_SIZE(imote2_da9030_subdevs),
353 .subdevs = imote2_da9030_subdevs,
354};
355
356/* As the the imote2 doesn't currently have a conventional SD slot
357 * there is no option to hotplug cards, making all this rather simple
358 */
359static int imote2_mci_get_ro(struct device *dev)
360{
361 return 0;
362}
363
364/* Rather simple case as hotplugging not possible */
365static struct pxamci_platform_data imote2_mci_platform_data = {
366 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* default anyway */
367 .get_ro = imote2_mci_get_ro,
368};
369
370static struct mtd_partition imote2flash_partitions[] = {
371 {
372 .name = "Bootloader",
373 .size = 0x00040000,
374 .offset = 0,
375 .mask_flags = MTD_WRITEABLE,
376 }, {
377 .name = "Kernel",
378 .size = 0x00200000,
379 .offset = 0x00040000,
380 .mask_flags = 0,
381 }, {
382 .name = "Filesystem",
383 .size = 0x01DC0000,
384 .offset = 0x00240000,
385 .mask_flags = 0,
386 },
387};
388
389static struct resource flash_resources = {
390 .start = PXA_CS0_PHYS,
391 .end = PXA_CS0_PHYS + SZ_32M - 1,
392 .flags = IORESOURCE_MEM,
393};
394
395static struct flash_platform_data imote2_flash_data = {
396 .map_name = "cfi_probe",
397 .parts = imote2flash_partitions,
398 .nr_parts = ARRAY_SIZE(imote2flash_partitions),
399 .name = "PXA27xOnChipROM",
400 .width = 2,
401};
402
403static struct platform_device imote2_flash_device = {
404 .name = "pxa2xx-flash",
405 .id = 0,
406 .dev = {
407 .platform_data = &imote2_flash_data,
408 },
409 .resource = &flash_resources,
410 .num_resources = 1,
411};
412
413/* Some of the drivers here are out of kernel at the moment (parts of IIO)
414 * and it may be a while before they are in the mainline.
415 */
416static struct i2c_board_info __initdata imote2_i2c_board_info[] = {
417 { /* UCAM sensor board */
418 .type = "max1238",
419 .addr = 0x35,
420 }, { /* ITS400 Sensor board only */
421 .type = "max1363",
422 .addr = 0x34,
423 /* Through a nand gate - Also beware, on V2 sensor board the
424 * pull up resistors are missing.
425 */
426 .irq = IRQ_GPIO(99),
427 }, { /* ITS400 Sensor board only */
428 .type = "tsl2561",
429 .addr = 0x49,
430 /* Through a nand gate - Also beware, on V2 sensor board the
431 * pull up resistors are missing.
432 */
433 .irq = IRQ_GPIO(99),
434 }, { /* ITS400 Sensor board only */
435 .type = "tmp175",
436 .addr = 0x4A,
437 .irq = IRQ_GPIO(96),
438 },
439};
440
441static struct i2c_board_info __initdata imote2_pwr_i2c_board_info[] = {
442 {
443 .type = "da9030",
444 .addr = 0x49,
445 .platform_data = &imote2_da9030_pdata,
446 .irq = gpio_to_irq(1),
447 },
448};
449
450static struct pxa2xx_spi_master pxa_ssp_master_0_info = {
451 .num_chipselect = 1,
452};
453
454static struct pxa2xx_spi_master pxa_ssp_master_1_info = {
455 .num_chipselect = 1,
456};
457
458static struct pxa2xx_spi_master pxa_ssp_master_2_info = {
459 .num_chipselect = 1,
460};
461
462/* Patch posted by Eric Miao <eric.miao@marvell.com> will remove
463 * the need for these functions.
464 */
465static void spi1control(u32 command)
466{
467 gpio_set_value(24, command & PXA2XX_CS_ASSERT ? 0 : 1);
468};
469
470static void spi3control(u32 command)
471{
472 gpio_set_value(39, command & PXA2XX_CS_ASSERT ? 0 : 1);
473};
474
475static struct pxa2xx_spi_chip staccel_chip_info = {
476 .tx_threshold = 8,
477 .rx_threshold = 8,
478 .dma_burst_size = 8,
479 .timeout = 235,
480 .cs_control = spi1control,
481};
482
483static struct pxa2xx_spi_chip cc2420_info = {
484 .tx_threshold = 8,
485 .rx_threshold = 8,
486 .dma_burst_size = 8,
487 .timeout = 235,
488 .cs_control = spi3control,
489};
490
491static struct spi_board_info spi_board_info[] __initdata = {
492 { /* Driver in IIO */
493 .modalias = "lis3l02dq",
494 .max_speed_hz = 8000000,/* 8MHz max spi frequency at 3V */
495 .bus_num = 1,
496 .chip_select = 0,
497 .controller_data = &staccel_chip_info,
498 .irq = IRQ_GPIO(96),
499 }, { /* Driver out of kernel as it needs considerable rewriting */
500 .modalias = "cc2420",
501 .max_speed_hz = 6500000,
502 .bus_num = 3,
503 .chip_select = 0,
504 .controller_data = &cc2420_info,
505 },
506};
507
508static void im2_udc_command(int cmd)
509{
510 switch (cmd) {
511 case PXA2XX_UDC_CMD_CONNECT:
512 UP2OCR |= UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE;
513 break;
514 case PXA2XX_UDC_CMD_DISCONNECT:
515 UP2OCR &= ~(UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE);
516 break;
517 }
518}
519
520static struct pxa2xx_udc_mach_info imote2_udc_info __initdata = {
521 .udc_command = im2_udc_command,
522};
523
524static struct platform_device *imote2_devices[] = {
525 &imote2_flash_device,
526 &imote2_leds,
527};
528
529static struct i2c_pxa_platform_data i2c_pwr_pdata = {
530 .fast_mode = 1,
531};
532
533static struct i2c_pxa_platform_data i2c_pdata = {
534 .fast_mode = 1,
535};
536
537static void __init imote2_init(void)
538{
539
540 pxa2xx_mfp_config(ARRAY_AND_SIZE(imote2_pin_config));
541 /* SPI chip select directions - all other directions should
542 * be handled by drivers.*/
543 gpio_direction_output(37, 0);
544 gpio_direction_output(24, 0);
545 gpio_direction_output(39, 0);
546
547 platform_add_devices(imote2_devices, ARRAY_SIZE(imote2_devices));
548
549 pxa2xx_set_spi_info(1, &pxa_ssp_master_0_info);
550 pxa2xx_set_spi_info(2, &pxa_ssp_master_1_info);
551 pxa2xx_set_spi_info(3, &pxa_ssp_master_2_info);
552
553 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
554
555 i2c_register_board_info(0, imote2_i2c_board_info,
556 ARRAY_SIZE(imote2_i2c_board_info));
557 i2c_register_board_info(1, imote2_pwr_i2c_board_info,
558 ARRAY_SIZE(imote2_pwr_i2c_board_info));
559
560 pxa27x_set_i2c_power_info(&i2c_pwr_pdata);
561 pxa_set_i2c_info(&i2c_pdata);
562
563 pxa_set_mci_info(&imote2_mci_platform_data);
564 pxa_set_udc_info(&imote2_udc_info);
565}
566
567MACHINE_START(INTELMOTE2, "IMOTE 2")
568 .phys_io = 0x40000000,
569 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
570 .map_io = pxa_map_io,
571 .init_irq = pxa27x_init_irq,
572 .timer = &pxa_timer,
573 .init_machine = imote2_init,
574 .boot_params = 0xA0000100,
575MACHINE_END
diff --git a/arch/arm/mach-pxa/include/mach/gumstix.h b/arch/arm/mach-pxa/include/mach/gumstix.h
index 42ee1956750e..099f54a41de4 100644
--- a/arch/arm/mach-pxa/include/mach/gumstix.h
+++ b/arch/arm/mach-pxa/include/mach/gumstix.h
@@ -94,3 +94,7 @@ has detected a cable insertion; driven low otherwise. */
94#define GPIO26_PRDY_nBSY_MD (GPIO26_PRDY_nBSY | GPIO_IN) 94#define GPIO26_PRDY_nBSY_MD (GPIO26_PRDY_nBSY | GPIO_IN)
95#define GPIO27_PRDY_nBSY_MD (GPIO27_PRDY_nBSY | GPIO_IN) 95#define GPIO27_PRDY_nBSY_MD (GPIO27_PRDY_nBSY | GPIO_IN)
96#define GPIO36_nCD_MD (GPIO36_nCD | GPIO_IN) 96#define GPIO36_nCD_MD (GPIO36_nCD | GPIO_IN)
97
98/* for expansion boards that can't be programatically detected */
99extern int am200_init(void);
100
diff --git a/arch/arm/mach-pxa/include/mach/littleton.h b/arch/arm/mach-pxa/include/mach/littleton.h
index 5c4e320c1437..6c9b21c51322 100644
--- a/arch/arm/mach-pxa/include/mach/littleton.h
+++ b/arch/arm/mach-pxa/include/mach/littleton.h
@@ -1,8 +1,13 @@
1#ifndef __ASM_ARCH_ZYLONITE_H 1#ifndef __ASM_ARCH_LITTLETON_H
2#define __ASM_ARCH_ZYLONITE_H 2#define __ASM_ARCH_LITTLETON_H
3
4#include <mach/gpio.h>
3 5
4#define LITTLETON_ETH_PHYS 0x30000000 6#define LITTLETON_ETH_PHYS 0x30000000
5 7
6#define LITTLETON_GPIO_LCD_CS (17) 8#define LITTLETON_GPIO_LCD_CS (17)
7 9
8#endif /* __ASM_ARCH_ZYLONITE_H */ 10#define EXT0_GPIO_BASE (NR_BUILTIN_GPIO)
11#define EXT0_GPIO(x) (EXT0_GPIO_BASE + (x))
12
13#endif /* __ASM_ARCH_LITTLETON_H */
diff --git a/arch/arm/mach-pxa/include/mach/pxafb.h b/arch/arm/mach-pxa/include/mach/pxafb.h
index cbda4d35c421..4201a889ff4e 100644
--- a/arch/arm/mach-pxa/include/mach/pxafb.h
+++ b/arch/arm/mach-pxa/include/mach/pxafb.h
@@ -48,6 +48,7 @@
48#define LCD_MONO_DSTN_8BPP ((8 << 4) | LCD_TYPE_MONO_DSTN) 48#define LCD_MONO_DSTN_8BPP ((8 << 4) | LCD_TYPE_MONO_DSTN)
49#define LCD_COLOR_STN_8BPP ((8 << 4) | LCD_TYPE_COLOR_STN) 49#define LCD_COLOR_STN_8BPP ((8 << 4) | LCD_TYPE_COLOR_STN)
50#define LCD_COLOR_DSTN_16BPP ((16 << 4) | LCD_TYPE_COLOR_DSTN) 50#define LCD_COLOR_DSTN_16BPP ((16 << 4) | LCD_TYPE_COLOR_DSTN)
51#define LCD_COLOR_TFT_8BPP ((8 << 4) | LCD_TYPE_COLOR_TFT)
51#define LCD_COLOR_TFT_16BPP ((16 << 4) | LCD_TYPE_COLOR_TFT) 52#define LCD_COLOR_TFT_16BPP ((16 << 4) | LCD_TYPE_COLOR_TFT)
52#define LCD_COLOR_TFT_18BPP ((18 << 4) | LCD_TYPE_COLOR_TFT) 53#define LCD_COLOR_TFT_18BPP ((18 << 4) | LCD_TYPE_COLOR_TFT)
53#define LCD_SMART_PANEL_8BPP ((8 << 4) | LCD_TYPE_SMART_PANEL) 54#define LCD_SMART_PANEL_8BPP ((8 << 4) | LCD_TYPE_SMART_PANEL)
@@ -94,6 +95,10 @@ struct pxafb_mode_info {
94 * in pxa27x and pxa3xx, initialize them to the same value or 95 * in pxa27x and pxa3xx, initialize them to the same value or
95 * the larger one will be used 96 * the larger one will be used
96 * 3. same to {rd,wr}_pulse_width 97 * 3. same to {rd,wr}_pulse_width
98 *
99 * 4. LCD_PCLK_EDGE_{RISE,FALL} controls the L_PCLK_WR polarity
100 * 5. sync & FB_SYNC_HOR_HIGH_ACT controls the L_LCLK_A0
101 * 6. sync & FB_SYNC_VERT_HIGH_ACT controls the L_LCLK_RD
97 */ 102 */
98 unsigned a0csrd_set_hld; /* A0 and CS Setup/Hold Time before/after L_FCLK_RD */ 103 unsigned a0csrd_set_hld; /* A0 and CS Setup/Hold Time before/after L_FCLK_RD */
99 unsigned a0cswr_set_hld; /* A0 and CS Setup/Hold Time before/after L_PCLK_WR */ 104 unsigned a0cswr_set_hld; /* A0 and CS Setup/Hold Time before/after L_PCLK_WR */
diff --git a/arch/arm/mach-pxa/include/mach/regs-lcd.h b/arch/arm/mach-pxa/include/mach/regs-lcd.h
index c689c4ea769c..f817878d256b 100644
--- a/arch/arm/mach-pxa/include/mach/regs-lcd.h
+++ b/arch/arm/mach-pxa/include/mach/regs-lcd.h
@@ -177,4 +177,11 @@
177 177
178#define SMART_CMD(x) (SMART_CMD_WRITE_COMMAND | ((x) & 0xff)) 178#define SMART_CMD(x) (SMART_CMD_WRITE_COMMAND | ((x) & 0xff))
179#define SMART_DAT(x) (SMART_CMD_WRITE_DATA | ((x) & 0xff)) 179#define SMART_DAT(x) (SMART_CMD_WRITE_DATA | ((x) & 0xff))
180
181/* SMART_DELAY() is introduced for software controlled delay primitive which
182 * can be inserted between command sequences, unused command 0x6 is used here
183 * and delay ranges from 0ms ~ 255ms
184 */
185#define SMART_CMD_DELAY (0x6 << 9)
186#define SMART_DELAY(ms) (SMART_CMD_DELAY | ((ms) & 0xff))
180#endif /* __ASM_ARCH_REGS_LCD_H */ 187#endif /* __ASM_ARCH_REGS_LCD_H */
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h
index a9a4f302b6ef..f4b029c03957 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -35,7 +35,7 @@ static inline void flush(void)
35 35
36static inline void arch_decomp_setup(void) 36static inline void arch_decomp_setup(void)
37{ 37{
38 if (machine_is_littleton()) 38 if (machine_is_littleton() || machine_is_intelmote2())
39 UART = STUART; 39 UART = STUART;
40} 40}
41 41
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index 5609f52e36b1..31da7f3c06f6 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -23,6 +23,10 @@
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/spi/spi.h> 24#include <linux/spi/spi.h>
25#include <linux/smc91x.h> 25#include <linux/smc91x.h>
26#include <linux/i2c.h>
27#include <linux/leds.h>
28#include <linux/mfd/da903x.h>
29#include <linux/i2c/max732x.h>
26 30
27#include <asm/types.h> 31#include <asm/types.h>
28#include <asm/setup.h> 32#include <asm/setup.h>
@@ -40,6 +44,7 @@
40#include <mach/pxafb.h> 44#include <mach/pxafb.h>
41#include <mach/ssp.h> 45#include <mach/ssp.h>
42#include <mach/pxa2xx_spi.h> 46#include <mach/pxa2xx_spi.h>
47#include <mach/i2c.h>
43#include <mach/pxa27x_keypad.h> 48#include <mach/pxa27x_keypad.h>
44#include <mach/pxa3xx_nand.h> 49#include <mach/pxa3xx_nand.h>
45#include <mach/littleton.h> 50#include <mach/littleton.h>
@@ -314,6 +319,73 @@ static void __init littleton_init_nand(void)
314static inline void littleton_init_nand(void) {} 319static inline void littleton_init_nand(void) {}
315#endif /* CONFIG_MTD_NAND_PXA3xx || CONFIG_MTD_NAND_PXA3xx_MODULE */ 320#endif /* CONFIG_MTD_NAND_PXA3xx || CONFIG_MTD_NAND_PXA3xx_MODULE */
316 321
322#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
323static struct led_info littleton_da9034_leds[] = {
324 [0] = {
325 .name = "littleton:keypad1",
326 .flags = DA9034_LED_RAMP,
327 },
328 [1] = {
329 .name = "littleton:keypad2",
330 .flags = DA9034_LED_RAMP,
331 },
332 [2] = {
333 .name = "littleton:vibra",
334 .flags = 0,
335 },
336};
337
338static struct da903x_subdev_info littleton_da9034_subdevs[] = {
339 {
340 .name = "da903x-led",
341 .id = DA9034_ID_LED_1,
342 .platform_data = &littleton_da9034_leds[0],
343 }, {
344 .name = "da903x-led",
345 .id = DA9034_ID_LED_2,
346 .platform_data = &littleton_da9034_leds[1],
347 }, {
348 .name = "da903x-led",
349 .id = DA9034_ID_VIBRA,
350 .platform_data = &littleton_da9034_leds[2],
351 }, {
352 .name = "da903x-backlight",
353 .id = DA9034_ID_WLED,
354 },
355};
356
357static struct da903x_platform_data littleton_da9034_info = {
358 .num_subdevs = ARRAY_SIZE(littleton_da9034_subdevs),
359 .subdevs = littleton_da9034_subdevs,
360};
361
362static struct max732x_platform_data littleton_max7320_info = {
363 .gpio_base = EXT0_GPIO_BASE,
364};
365
366static struct i2c_board_info littleton_i2c_info[] = {
367 [0] = {
368 .type = "da9034",
369 .addr = 0x34,
370 .platform_data = &littleton_da9034_info,
371 .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO18)),
372 },
373 [1] = {
374 .type = "max7320",
375 .addr = 0x50,
376 .platform_data = &littleton_max7320_info,
377 },
378};
379
380static void __init littleton_init_i2c(void)
381{
382 pxa_set_i2c_info(NULL);
383 i2c_register_board_info(0, ARRAY_AND_SIZE(littleton_i2c_info));
384}
385#else
386static inline void littleton_init_i2c(void) {}
387#endif /* CONFIG_I2C_PXA || CONFIG_I2C_PXA_MODULE */
388
317static void __init littleton_init(void) 389static void __init littleton_init(void)
318{ 390{
319 /* initialize MFP configurations */ 391 /* initialize MFP configurations */
@@ -326,6 +398,7 @@ static void __init littleton_init(void)
326 platform_device_register(&smc91x_device); 398 platform_device_register(&smc91x_device);
327 399
328 littleton_init_spi(); 400 littleton_init_spi();
401 littleton_init_i2c();
329 littleton_init_lcd(); 402 littleton_init_lcd();
330 littleton_init_keypad(); 403 littleton_init_keypad();
331 littleton_init_nand(); 404 littleton_init_nand();
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index bf59cec27def..21b821e1a60d 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -336,8 +336,7 @@ static struct pxafb_mach_info toppoly_info = {
336 .modes = toppoly_modes, 336 .modes = toppoly_modes,
337 .num_modes = 1, 337 .num_modes = 1,
338 .fixed_modes = 1, 338 .fixed_modes = 1,
339 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, 339 .lcd_conn = LCD_COLOR_TFT_16BPP,
340 .lccr3 = LCCR3_PixRsEdg,
341 .pxafb_lcd_power = toppoly_lcd_power, 340 .pxafb_lcd_power = toppoly_lcd_power,
342}; 341};
343 342
@@ -345,8 +344,8 @@ static struct pxafb_mach_info samsung_info = {
345 .modes = samsung_modes, 344 .modes = samsung_modes,
346 .num_modes = 1, 345 .num_modes = 1,
347 .fixed_modes = 1, 346 .fixed_modes = 1,
348 .lccr0 = LCCR0_LDDALT | LCCR0_Color | LCCR0_Sngl | LCCR0_Act, 347 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL |\
349 .lccr3 = LCCR3_PixFlEdg, 348 LCD_ALTERNATE_MAPPING,
350 .pxafb_lcd_power = samsung_lcd_power, 349 .pxafb_lcd_power = samsung_lcd_power,
351}; 350};
352 351
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index 3ea01e0eac63..34841c72815f 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -104,8 +104,7 @@ static struct pxafb_mode_info fb_info_sharp_lq084v1dg21 = {
104static struct pxafb_mach_info pcm990_fbinfo __initdata = { 104static struct pxafb_mach_info pcm990_fbinfo __initdata = {
105 .modes = &fb_info_sharp_lq084v1dg21, 105 .modes = &fb_info_sharp_lq084v1dg21,
106 .num_modes = 1, 106 .num_modes = 1,
107 .lccr0 = LCCR0_PAS, 107 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
108 .lccr3 = LCCR3_PCP,
109 .pxafb_lcd_power = pcm990_lcd_power, 108 .pxafb_lcd_power = pcm990_lcd_power,
110}; 109};
111#elif defined(CONFIG_PCM990_DISPLAY_NEC) 110#elif defined(CONFIG_PCM990_DISPLAY_NEC)
@@ -127,8 +126,7 @@ struct pxafb_mode_info fb_info_nec_nl6448bc20_18d = {
127static struct pxafb_mach_info pcm990_fbinfo __initdata = { 126static struct pxafb_mach_info pcm990_fbinfo __initdata = {
128 .modes = &fb_info_nec_nl6448bc20_18d, 127 .modes = &fb_info_nec_nl6448bc20_18d,
129 .num_modes = 1, 128 .num_modes = 1,
130 .lccr0 = LCCR0_Act, 129 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
131 .lccr3 = LCCR3_PixFlEdg,
132 .pxafb_lcd_power = pcm990_lcd_power, 130 .pxafb_lcd_power = pcm990_lcd_power,
133}; 131};
134#endif 132#endif
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c
index e7ea91ce7f02..5d02a7325586 100644
--- a/arch/arm/mach-pxa/saar.c
+++ b/arch/arm/mach-pxa/saar.c
@@ -17,19 +17,44 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/delay.h>
21#include <linux/fb.h>
22#include <linux/i2c.h>
20#include <linux/smc91x.h> 23#include <linux/smc91x.h>
24#include <linux/mfd/da903x.h>
21 25
22#include <asm/mach-types.h> 26#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
24#include <mach/hardware.h> 28#include <mach/hardware.h>
25#include <mach/pxa3xx-regs.h> 29#include <mach/pxa3xx-regs.h>
26#include <mach/mfp-pxa930.h> 30#include <mach/mfp-pxa930.h>
31#include <mach/i2c.h>
32#include <mach/regs-lcd.h>
33#include <mach/pxafb.h>
27 34
28#include "devices.h" 35#include "devices.h"
29#include "generic.h" 36#include "generic.h"
30 37
38#define GPIO_LCD_RESET (16)
39
31/* SAAR MFP configurations */ 40/* SAAR MFP configurations */
32static mfp_cfg_t saar_mfp_cfg[] __initdata = { 41static mfp_cfg_t saar_mfp_cfg[] __initdata = {
42 /* LCD */
43 GPIO23_LCD_DD0,
44 GPIO24_LCD_DD1,
45 GPIO25_LCD_DD2,
46 GPIO26_LCD_DD3,
47 GPIO27_LCD_DD4,
48 GPIO28_LCD_DD5,
49 GPIO29_LCD_DD6,
50 GPIO44_LCD_DD7,
51 GPIO21_LCD_CS,
52 GPIO22_LCD_VSYNC,
53 GPIO17_LCD_FCLK_RD,
54 GPIO18_LCD_LCLK_A0,
55 GPIO19_LCD_PCLK_WR,
56 GPIO16_GPIO, /* LCD reset */
57
33 /* Ethernet */ 58 /* Ethernet */
34 DF_nCS1_nCS3, 59 DF_nCS1_nCS3,
35 GPIO97_GPIO, 60 GPIO97_GPIO,
@@ -64,12 +89,408 @@ static struct platform_device smc91x_device = {
64 }, 89 },
65}; 90};
66 91
92#if defined(CONFIG_FB_PXA) || (CONFIG_FB_PXA_MODULE)
93static uint16_t lcd_power_on[] = {
94 /* single frame */
95 SMART_CMD_NOOP,
96 SMART_CMD(0x00),
97 SMART_DELAY(0),
98
99 SMART_CMD_NOOP,
100 SMART_CMD(0x00),
101 SMART_DELAY(0),
102
103 SMART_CMD_NOOP,
104 SMART_CMD(0x00),
105 SMART_DELAY(0),
106
107 SMART_CMD_NOOP,
108 SMART_CMD(0x00),
109 SMART_DELAY(10),
110
111 /* calibration control */
112 SMART_CMD(0x00),
113 SMART_CMD(0xA4),
114 SMART_DAT(0x80),
115 SMART_DAT(0x01),
116 SMART_DELAY(150),
117
118 /*Power-On Init sequence*/
119 SMART_CMD(0x00), /* output ctrl */
120 SMART_CMD(0x01),
121 SMART_DAT(0x01),
122 SMART_DAT(0x00),
123 SMART_CMD(0x00), /* wave ctrl */
124 SMART_CMD(0x02),
125 SMART_DAT(0x07),
126 SMART_DAT(0x00),
127 SMART_CMD(0x00),
128 SMART_CMD(0x03), /* entry mode */
129 SMART_DAT(0xD0),
130 SMART_DAT(0x30),
131 SMART_CMD(0x00),
132 SMART_CMD(0x08), /* display ctrl 2 */
133 SMART_DAT(0x08),
134 SMART_DAT(0x08),
135 SMART_CMD(0x00),
136 SMART_CMD(0x09), /* display ctrl 3 */
137 SMART_DAT(0x04),
138 SMART_DAT(0x2F),
139 SMART_CMD(0x00),
140 SMART_CMD(0x0A), /* display ctrl 4 */
141 SMART_DAT(0x00),
142 SMART_DAT(0x08),
143 SMART_CMD(0x00),
144 SMART_CMD(0x0D), /* Frame Marker position */
145 SMART_DAT(0x00),
146 SMART_DAT(0x08),
147 SMART_CMD(0x00),
148 SMART_CMD(0x60), /* Driver output control */
149 SMART_DAT(0x27),
150 SMART_DAT(0x00),
151 SMART_CMD(0x00),
152 SMART_CMD(0x61), /* Base image display control */
153 SMART_DAT(0x00),
154 SMART_DAT(0x01),
155 SMART_CMD(0x00),
156 SMART_CMD(0x30), /* Y settings 30h-3Dh */
157 SMART_DAT(0x07),
158 SMART_DAT(0x07),
159 SMART_CMD(0x00),
160 SMART_CMD(0x31),
161 SMART_DAT(0x00),
162 SMART_DAT(0x07),
163 SMART_CMD(0x00),
164 SMART_CMD(0x32), /* Timing(3), ASW HOLD=0.5CLK */
165 SMART_DAT(0x04),
166 SMART_DAT(0x00),
167 SMART_CMD(0x00),
168 SMART_CMD(0x33), /* Timing(4), CKV ST=0CLK, CKV ED=1CLK */
169 SMART_DAT(0x03),
170 SMART_DAT(0x03),
171 SMART_CMD(0x00),
172 SMART_CMD(0x34),
173 SMART_DAT(0x00),
174 SMART_DAT(0x00),
175 SMART_CMD(0x00),
176 SMART_CMD(0x35),
177 SMART_DAT(0x02),
178 SMART_DAT(0x05),
179 SMART_CMD(0x00),
180 SMART_CMD(0x36),
181 SMART_DAT(0x1F),
182 SMART_DAT(0x1F),
183 SMART_CMD(0x00),
184 SMART_CMD(0x37),
185 SMART_DAT(0x07),
186 SMART_DAT(0x07),
187 SMART_CMD(0x00),
188 SMART_CMD(0x38),
189 SMART_DAT(0x00),
190 SMART_DAT(0x07),
191 SMART_CMD(0x00),
192 SMART_CMD(0x39),
193 SMART_DAT(0x04),
194 SMART_DAT(0x00),
195 SMART_CMD(0x00),
196 SMART_CMD(0x3A),
197 SMART_DAT(0x03),
198 SMART_DAT(0x03),
199 SMART_CMD(0x00),
200 SMART_CMD(0x3B),
201 SMART_DAT(0x00),
202 SMART_DAT(0x00),
203 SMART_CMD(0x00),
204 SMART_CMD(0x3C),
205 SMART_DAT(0x02),
206 SMART_DAT(0x05),
207 SMART_CMD(0x00),
208 SMART_CMD(0x3D),
209 SMART_DAT(0x1F),
210 SMART_DAT(0x1F),
211 SMART_CMD(0x00), /* Display control 1 */
212 SMART_CMD(0x07),
213 SMART_DAT(0x00),
214 SMART_DAT(0x01),
215 SMART_CMD(0x00), /* Power control 5 */
216 SMART_CMD(0x17),
217 SMART_DAT(0x00),
218 SMART_DAT(0x01),
219 SMART_CMD(0x00), /* Power control 1 */
220 SMART_CMD(0x10),
221 SMART_DAT(0x10),
222 SMART_DAT(0xB0),
223 SMART_CMD(0x00), /* Power control 2 */
224 SMART_CMD(0x11),
225 SMART_DAT(0x01),
226 SMART_DAT(0x30),
227 SMART_CMD(0x00), /* Power control 3 */
228 SMART_CMD(0x12),
229 SMART_DAT(0x01),
230 SMART_DAT(0x9E),
231 SMART_CMD(0x00), /* Power control 4 */
232 SMART_CMD(0x13),
233 SMART_DAT(0x17),
234 SMART_DAT(0x00),
235 SMART_CMD(0x00), /* Power control 3 */
236 SMART_CMD(0x12),
237 SMART_DAT(0x01),
238 SMART_DAT(0xBE),
239 SMART_DELAY(100),
240
241 /* display mode : 240*320 */
242 SMART_CMD(0x00), /* RAM address set(H) 0*/
243 SMART_CMD(0x20),
244 SMART_DAT(0x00),
245 SMART_DAT(0x00),
246 SMART_CMD(0x00), /* RAM address set(V) 4*/
247 SMART_CMD(0x21),
248 SMART_DAT(0x00),
249 SMART_DAT(0x00),
250 SMART_CMD(0x00), /* Start of Window RAM address set(H) 8*/
251 SMART_CMD(0x50),
252 SMART_DAT(0x00),
253 SMART_DAT(0x00),
254 SMART_CMD(0x00), /* End of Window RAM address set(H) 12*/
255 SMART_CMD(0x51),
256 SMART_DAT(0x00),
257 SMART_DAT(0xEF),
258 SMART_CMD(0x00), /* Start of Window RAM address set(V) 16*/
259 SMART_CMD(0x52),
260 SMART_DAT(0x00),
261 SMART_DAT(0x00),
262 SMART_CMD(0x00), /* End of Window RAM address set(V) 20*/
263 SMART_CMD(0x53),
264 SMART_DAT(0x01),
265 SMART_DAT(0x3F),
266 SMART_CMD(0x00), /* Panel interface control 1 */
267 SMART_CMD(0x90),
268 SMART_DAT(0x00),
269 SMART_DAT(0x1A),
270 SMART_CMD(0x00), /* Panel interface control 2 */
271 SMART_CMD(0x92),
272 SMART_DAT(0x04),
273 SMART_DAT(0x00),
274 SMART_CMD(0x00), /* Panel interface control 3 */
275 SMART_CMD(0x93),
276 SMART_DAT(0x00),
277 SMART_DAT(0x05),
278 SMART_DELAY(20),
279};
280
281static uint16_t lcd_panel_on[] = {
282 SMART_CMD(0x00),
283 SMART_CMD(0x07),
284 SMART_DAT(0x00),
285 SMART_DAT(0x21),
286 SMART_DELAY(1),
287
288 SMART_CMD(0x00),
289 SMART_CMD(0x07),
290 SMART_DAT(0x00),
291 SMART_DAT(0x61),
292 SMART_DELAY(100),
293
294 SMART_CMD(0x00),
295 SMART_CMD(0x07),
296 SMART_DAT(0x01),
297 SMART_DAT(0x73),
298 SMART_DELAY(1),
299};
300
301static uint16_t lcd_panel_off[] = {
302 SMART_CMD(0x00),
303 SMART_CMD(0x07),
304 SMART_DAT(0x00),
305 SMART_DAT(0x72),
306 SMART_DELAY(40),
307
308 SMART_CMD(0x00),
309 SMART_CMD(0x07),
310 SMART_DAT(0x00),
311 SMART_DAT(0x01),
312 SMART_DELAY(1),
313
314 SMART_CMD(0x00),
315 SMART_CMD(0x07),
316 SMART_DAT(0x00),
317 SMART_DAT(0x00),
318 SMART_DELAY(1),
319};
320
321static uint16_t lcd_power_off[] = {
322 SMART_CMD(0x00),
323 SMART_CMD(0x10),
324 SMART_DAT(0x00),
325 SMART_DAT(0x80),
326
327 SMART_CMD(0x00),
328 SMART_CMD(0x11),
329 SMART_DAT(0x01),
330 SMART_DAT(0x60),
331
332 SMART_CMD(0x00),
333 SMART_CMD(0x12),
334 SMART_DAT(0x01),
335 SMART_DAT(0xAE),
336 SMART_DELAY(40),
337
338 SMART_CMD(0x00),
339 SMART_CMD(0x10),
340 SMART_DAT(0x00),
341 SMART_DAT(0x00),
342};
343
344static uint16_t update_framedata[] = {
345 /* set display ram: 240*320 */
346 SMART_CMD(0x00), /* RAM address set(H) 0*/
347 SMART_CMD(0x20),
348 SMART_DAT(0x00),
349 SMART_DAT(0x00),
350 SMART_CMD(0x00), /* RAM address set(V) 4*/
351 SMART_CMD(0x21),
352 SMART_DAT(0x00),
353 SMART_DAT(0x00),
354 SMART_CMD(0x00), /* Start of Window RAM address set(H) 8 */
355 SMART_CMD(0x50),
356 SMART_DAT(0x00),
357 SMART_DAT(0x00),
358 SMART_CMD(0x00), /* End of Window RAM address set(H) 12 */
359 SMART_CMD(0x51),
360 SMART_DAT(0x00),
361 SMART_DAT(0xEF),
362 SMART_CMD(0x00), /* Start of Window RAM address set(V) 16 */
363 SMART_CMD(0x52),
364 SMART_DAT(0x00),
365 SMART_DAT(0x00),
366 SMART_CMD(0x00), /* End of Window RAM address set(V) 20 */
367 SMART_CMD(0x53),
368 SMART_DAT(0x01),
369 SMART_DAT(0x3F),
370
371 /* wait for vsync cmd before transferring frame data */
372 SMART_CMD_WAIT_FOR_VSYNC,
373
374 /* write ram */
375 SMART_CMD(0x00),
376 SMART_CMD(0x22),
377
378 /* write frame data */
379 SMART_CMD_WRITE_FRAME,
380};
381
382static void ltm022a97a_lcd_power(int on, struct fb_var_screeninfo *var)
383{
384 static int pin_requested = 0;
385 struct fb_info *info = container_of(var, struct fb_info, var);
386 int err;
387
388 if (!pin_requested) {
389 err = gpio_request(GPIO_LCD_RESET, "lcd reset");
390 if (err) {
391 pr_err("failed to request gpio for LCD reset\n");
392 return;
393 }
394
395 gpio_direction_output(GPIO_LCD_RESET, 0);
396 pin_requested = 1;
397 }
398
399 if (on) {
400 gpio_set_value(GPIO_LCD_RESET, 0); msleep(100);
401 gpio_set_value(GPIO_LCD_RESET, 1); msleep(10);
402
403 pxafb_smart_queue(info, ARRAY_AND_SIZE(lcd_power_on));
404 pxafb_smart_queue(info, ARRAY_AND_SIZE(lcd_panel_on));
405 } else {
406 pxafb_smart_queue(info, ARRAY_AND_SIZE(lcd_panel_off));
407 pxafb_smart_queue(info, ARRAY_AND_SIZE(lcd_power_off));
408 }
409
410 err = pxafb_smart_flush(info);
411 if (err)
412 pr_err("%s: timed out\n", __func__);
413}
414
415static void ltm022a97a_update(struct fb_info *info)
416{
417 pxafb_smart_queue(info, ARRAY_AND_SIZE(update_framedata));
418 pxafb_smart_flush(info);
419}
420
421static struct pxafb_mode_info toshiba_ltm022a97a_modes[] = {
422 [0] = {
423 .xres = 240,
424 .yres = 320,
425 .bpp = 16,
426 .a0csrd_set_hld = 30,
427 .a0cswr_set_hld = 30,
428 .wr_pulse_width = 30,
429 .rd_pulse_width = 30,
430 .op_hold_time = 30,
431 .cmd_inh_time = 60,
432
433 /* L_LCLK_A0 and L_LCLK_RD active low */
434 .sync = FB_SYNC_HOR_HIGH_ACT |
435 FB_SYNC_VERT_HIGH_ACT,
436 },
437};
438
439static struct pxafb_mach_info saar_lcd_info = {
440 .modes = toshiba_ltm022a97a_modes,
441 .num_modes = 1,
442 .lcd_conn = LCD_SMART_PANEL_8BPP | LCD_PCLK_EDGE_FALL,
443 .pxafb_lcd_power = ltm022a97a_lcd_power,
444 .smart_update = ltm022a97a_update,
445};
446
447static void __init saar_init_lcd(void)
448{
449 set_pxa_fb_info(&saar_lcd_info);
450}
451#else
452static inline void saar_init_lcd(void) {}
453#endif
454
455#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
456static struct da903x_subdev_info saar_da9034_subdevs[] = {
457 [0] = {
458 .name = "da903x-backlight",
459 .id = DA9034_ID_WLED,
460 },
461};
462
463static struct da903x_platform_data saar_da9034_info = {
464 .num_subdevs = ARRAY_SIZE(saar_da9034_subdevs),
465 .subdevs = saar_da9034_subdevs,
466};
467
468static struct i2c_board_info saar_i2c_info[] = {
469 [0] = {
470 .type = "da9034",
471 .addr = 0x34,
472 .platform_data = &saar_da9034_info,
473 .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
474 },
475};
476
477static void __init saar_init_i2c(void)
478{
479 pxa_set_i2c_info(NULL);
480 i2c_register_board_info(0, ARRAY_AND_SIZE(saar_i2c_info));
481}
482#else
483static inline void saar_init_i2c(void) {}
484#endif
67static void __init saar_init(void) 485static void __init saar_init(void)
68{ 486{
69 /* initialize MFP configurations */ 487 /* initialize MFP configurations */
70 pxa3xx_mfp_config(ARRAY_AND_SIZE(saar_mfp_cfg)); 488 pxa3xx_mfp_config(ARRAY_AND_SIZE(saar_mfp_cfg));
71 489
72 platform_device_register(&smc91x_device); 490 platform_device_register(&smc91x_device);
491
492 saar_init_i2c();
493 saar_init_lcd();
73} 494}
74 495
75MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)") 496MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)")
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index afe7a65c5603..d0fd22e06737 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -50,7 +50,6 @@
50#include <asm/irq.h> 50#include <asm/irq.h>
51#include <asm/div64.h> 51#include <asm/div64.h>
52#include <mach/pxa-regs.h> 52#include <mach/pxa-regs.h>
53#include <mach/pxa2xx-gpio.h>
54#include <mach/bitfield.h> 53#include <mach/bitfield.h>
55#include <mach/pxafb.h> 54#include <mach/pxafb.h>
56 55
@@ -724,12 +723,19 @@ int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int n_cmds)
724 int i; 723 int i;
725 struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); 724 struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb);
726 725
727 /* leave 2 commands for INTERRUPT and WAIT_FOR_SYNC */ 726 for (i = 0; i < n_cmds; i++, cmds++) {
728 for (i = 0; i < n_cmds; i++) { 727 /* if it is a software delay, flush and delay */
728 if ((*cmds & 0xff00) == SMART_CMD_DELAY) {
729 pxafb_smart_flush(info);
730 mdelay(*cmds & 0xff);
731 continue;
732 }
733
734 /* leave 2 commands for INTERRUPT and WAIT_FOR_SYNC */
729 if (fbi->n_smart_cmds == CMD_BUFF_SIZE - 8) 735 if (fbi->n_smart_cmds == CMD_BUFF_SIZE - 8)
730 pxafb_smart_flush(info); 736 pxafb_smart_flush(info);
731 737
732 fbi->smart_cmds[fbi->n_smart_cmds++] = *cmds++; 738 fbi->smart_cmds[fbi->n_smart_cmds++] = *cmds;
733 } 739 }
734 740
735 return 0; 741 return 0;
@@ -761,7 +767,9 @@ static void setup_smart_timing(struct pxafb_info *fbi,
761 LCCR1_HorSnchWdth(__smart_timing(t3, lclk)); 767 LCCR1_HorSnchWdth(__smart_timing(t3, lclk));
762 768
763 fbi->reg_lccr2 = LCCR2_DisHght(var->yres); 769 fbi->reg_lccr2 = LCCR2_DisHght(var->yres);
764 fbi->reg_lccr3 = LCCR3_PixClkDiv(__smart_timing(t4, lclk)); 770 fbi->reg_lccr3 = fbi->lccr3 | LCCR3_PixClkDiv(__smart_timing(t4, lclk));
771 fbi->reg_lccr3 |= (var->sync & FB_SYNC_HOR_HIGH_ACT) ? LCCR3_HSP : 0;
772 fbi->reg_lccr3 |= (var->sync & FB_SYNC_VERT_HIGH_ACT) ? LCCR3_VSP : 0;
765 773
766 /* FIXME: make this configurable */ 774 /* FIXME: make this configurable */
767 fbi->reg_cmdcr = 1; 775 fbi->reg_cmdcr = 1;
@@ -786,11 +794,15 @@ static int pxafb_smart_thread(void *arg)
786 if (try_to_freeze()) 794 if (try_to_freeze())
787 continue; 795 continue;
788 796
797 mutex_lock(&fbi->ctrlr_lock);
798
789 if (fbi->state == C_ENABLE) { 799 if (fbi->state == C_ENABLE) {
790 inf->smart_update(&fbi->fb); 800 inf->smart_update(&fbi->fb);
791 complete(&fbi->refresh_done); 801 complete(&fbi->refresh_done);
792 } 802 }
793 803
804 mutex_unlock(&fbi->ctrlr_lock);
805
794 set_current_state(TASK_INTERRUPTIBLE); 806 set_current_state(TASK_INTERRUPTIBLE);
795 schedule_timeout(30 * HZ / 1000); 807 schedule_timeout(30 * HZ / 1000);
796 } 808 }
@@ -801,14 +813,19 @@ static int pxafb_smart_thread(void *arg)
801 813
802static int pxafb_smart_init(struct pxafb_info *fbi) 814static int pxafb_smart_init(struct pxafb_info *fbi)
803{ 815{
804 if (!(fbi->lccr0 | LCCR0_LCDT)) 816 if (!(fbi->lccr0 & LCCR0_LCDT))
805 return 0; 817 return 0;
806 818
819 fbi->smart_cmds = (uint16_t *) fbi->dma_buff->cmd_buff;
820 fbi->n_smart_cmds = 0;
821
822 init_completion(&fbi->command_done);
823 init_completion(&fbi->refresh_done);
824
807 fbi->smart_thread = kthread_run(pxafb_smart_thread, fbi, 825 fbi->smart_thread = kthread_run(pxafb_smart_thread, fbi,
808 "lcd_refresh"); 826 "lcd_refresh");
809 if (IS_ERR(fbi->smart_thread)) { 827 if (IS_ERR(fbi->smart_thread)) {
810 printk(KERN_ERR "%s: unable to create kernel thread\n", 828 pr_err("%s: unable to create kernel thread\n", __func__);
811 __func__);
812 return PTR_ERR(fbi->smart_thread); 829 return PTR_ERR(fbi->smart_thread);
813 } 830 }
814 831
@@ -824,7 +841,9 @@ int pxafb_smart_flush(struct fb_info *info)
824{ 841{
825 return 0; 842 return 0;
826} 843}
827#endif /* CONFIG_FB_SMART_PANEL */ 844
845static inline int pxafb_smart_init(struct pxafb_info *fbi) { return 0; }
846#endif /* CONFIG_FB_PXA_SMARTPANEL */
828 847
829static void setup_parallel_timing(struct pxafb_info *fbi, 848static void setup_parallel_timing(struct pxafb_info *fbi,
830 struct fb_var_screeninfo *var) 849 struct fb_var_screeninfo *var)
@@ -986,57 +1005,6 @@ static inline void __pxafb_lcd_power(struct pxafb_info *fbi, int on)
986 fbi->lcd_power(on, &fbi->fb.var); 1005 fbi->lcd_power(on, &fbi->fb.var);
987} 1006}
988 1007
989static void pxafb_setup_gpio(struct pxafb_info *fbi)
990{
991 int gpio, ldd_bits;
992 unsigned int lccr0 = fbi->lccr0;
993
994 /*
995 * setup is based on type of panel supported
996 */
997
998 /* 4 bit interface */
999 if ((lccr0 & LCCR0_CMS) == LCCR0_Mono &&
1000 (lccr0 & LCCR0_SDS) == LCCR0_Sngl &&
1001 (lccr0 & LCCR0_DPD) == LCCR0_4PixMono)
1002 ldd_bits = 4;
1003
1004 /* 8 bit interface */
1005 else if (((lccr0 & LCCR0_CMS) == LCCR0_Mono &&
1006 ((lccr0 & LCCR0_SDS) == LCCR0_Dual ||
1007 (lccr0 & LCCR0_DPD) == LCCR0_8PixMono)) ||
1008 ((lccr0 & LCCR0_CMS) == LCCR0_Color &&
1009 (lccr0 & LCCR0_PAS) == LCCR0_Pas &&
1010 (lccr0 & LCCR0_SDS) == LCCR0_Sngl))
1011 ldd_bits = 8;
1012
1013 /* 16 bit interface */
1014 else if ((lccr0 & LCCR0_CMS) == LCCR0_Color &&
1015 ((lccr0 & LCCR0_SDS) == LCCR0_Dual ||
1016 (lccr0 & LCCR0_PAS) == LCCR0_Act))
1017 ldd_bits = 16;
1018
1019 else {
1020 printk(KERN_ERR "pxafb_setup_gpio: unable to determine "
1021 "bits per pixel\n");
1022 return;
1023 }
1024
1025 for (gpio = 58; ldd_bits; gpio++, ldd_bits--)
1026 pxa_gpio_mode(gpio | GPIO_ALT_FN_2_OUT);
1027 /* 18 bit interface */
1028 if (fbi->fb.var.bits_per_pixel > 16) {
1029 pxa_gpio_mode(86 | GPIO_ALT_FN_2_OUT);
1030 pxa_gpio_mode(87 | GPIO_ALT_FN_2_OUT);
1031 }
1032 pxa_gpio_mode(GPIO74_LCD_FCLK_MD);
1033 pxa_gpio_mode(GPIO75_LCD_LCLK_MD);
1034 pxa_gpio_mode(GPIO76_LCD_PCLK_MD);
1035
1036 if ((lccr0 & LCCR0_PAS) == 0)
1037 pxa_gpio_mode(GPIO77_LCD_ACBIAS_MD);
1038}
1039
1040static void pxafb_enable_controller(struct pxafb_info *fbi) 1008static void pxafb_enable_controller(struct pxafb_info *fbi)
1041{ 1009{
1042 pr_debug("pxafb: Enabling LCD controller\n"); 1010 pr_debug("pxafb: Enabling LCD controller\n");
@@ -1179,7 +1147,6 @@ static void set_ctrlr_state(struct pxafb_info *fbi, u_int state)
1179 if (old_state == C_ENABLE) { 1147 if (old_state == C_ENABLE) {
1180 __pxafb_lcd_power(fbi, 0); 1148 __pxafb_lcd_power(fbi, 0);
1181 pxafb_disable_controller(fbi); 1149 pxafb_disable_controller(fbi);
1182 pxafb_setup_gpio(fbi);
1183 pxafb_enable_controller(fbi); 1150 pxafb_enable_controller(fbi);
1184 __pxafb_lcd_power(fbi, 1); 1151 __pxafb_lcd_power(fbi, 1);
1185 } 1152 }
@@ -1202,7 +1169,6 @@ static void set_ctrlr_state(struct pxafb_info *fbi, u_int state)
1202 */ 1169 */
1203 if (old_state != C_ENABLE) { 1170 if (old_state != C_ENABLE) {
1204 fbi->state = C_ENABLE; 1171 fbi->state = C_ENABLE;
1205 pxafb_setup_gpio(fbi);
1206 pxafb_enable_controller(fbi); 1172 pxafb_enable_controller(fbi);
1207 __pxafb_lcd_power(fbi, 1); 1173 __pxafb_lcd_power(fbi, 1);
1208 __pxafb_backlight_power(fbi, 1); 1174 __pxafb_backlight_power(fbi, 1);
@@ -1340,11 +1306,6 @@ static int __devinit pxafb_map_video_memory(struct pxafb_info *fbi)
1340 fbi->palette_cpu = (u16 *) fbi->dma_buff->palette; 1306 fbi->palette_cpu = (u16 *) fbi->dma_buff->palette;
1341 1307
1342 pr_debug("pxafb: palette_mem_size = 0x%08x\n", fbi->palette_size*sizeof(u16)); 1308 pr_debug("pxafb: palette_mem_size = 0x%08x\n", fbi->palette_size*sizeof(u16));
1343
1344#ifdef CONFIG_FB_PXA_SMARTPANEL
1345 fbi->smart_cmds = (uint16_t *) fbi->dma_buff->cmd_buff;
1346 fbi->n_smart_cmds = 0;
1347#endif
1348 } 1309 }
1349 1310
1350 return fbi->map_cpu ? 0 : -ENOMEM; 1311 return fbi->map_cpu ? 0 : -ENOMEM;
@@ -1466,10 +1427,6 @@ static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev)
1466 INIT_WORK(&fbi->task, pxafb_task); 1427 INIT_WORK(&fbi->task, pxafb_task);
1467 mutex_init(&fbi->ctrlr_lock); 1428 mutex_init(&fbi->ctrlr_lock);
1468 init_completion(&fbi->disable_done); 1429 init_completion(&fbi->disable_done);
1469#ifdef CONFIG_FB_PXA_SMARTPANEL
1470 init_completion(&fbi->command_done);
1471 init_completion(&fbi->refresh_done);
1472#endif
1473 1430
1474 return fbi; 1431 return fbi;
1475} 1432}
@@ -1801,13 +1758,12 @@ static int __devinit pxafb_probe(struct platform_device *dev)
1801 goto failed_free_mem; 1758 goto failed_free_mem;
1802 } 1759 }
1803 1760
1804#ifdef CONFIG_FB_PXA_SMARTPANEL
1805 ret = pxafb_smart_init(fbi); 1761 ret = pxafb_smart_init(fbi);
1806 if (ret) { 1762 if (ret) {
1807 dev_err(&dev->dev, "failed to initialize smartpanel\n"); 1763 dev_err(&dev->dev, "failed to initialize smartpanel\n");
1808 goto failed_free_irq; 1764 goto failed_free_irq;
1809 } 1765 }
1810#endif 1766
1811 /* 1767 /*
1812 * This makes sure that our colour bitfield 1768 * This makes sure that our colour bitfield
1813 * descriptors are correctly initialised. 1769 * descriptors are correctly initialised.