diff options
author | Tomas 'Sleep_Walker' Cech <sleep_walker@suse.cz> | 2009-05-18 09:24:14 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-06-16 09:03:34 -0400 |
commit | e6c3f4b89bf3698a6994d30de7a16ae395a81dab (patch) | |
tree | ea97f93b3b68e8be3c71d1a5bf2a40a17b7b8301 /arch/arm | |
parent | 303f2d7dc8eddc65de27d97eab0fc1c04ec4d2e1 (diff) |
[ARM] pxa/treo680: initial support
Signed-off-by: Tomáš Čech <sleep_walker@suse.cz>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-pxa/Kconfig | 10 | ||||
-rw-r--r-- | arch/arm/mach-pxa/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/treo680.h | 49 | ||||
-rw-r--r-- | arch/arm/mach-pxa/treo680.c | 612 | ||||
-rw-r--r-- | arch/arm/mm/mmu.c | 7 |
5 files changed, 679 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index f4533f8ff4e8..89c992b8f75b 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -401,6 +401,16 @@ config MACH_PALMZ72 | |||
401 | Say Y here if you intend to run this kernel on Palm Zire 72 | 401 | Say Y here if you intend to run this kernel on Palm Zire 72 |
402 | handheld computer. | 402 | handheld computer. |
403 | 403 | ||
404 | config MACH_TREO680 | ||
405 | bool "Palm Treo 680" | ||
406 | default y | ||
407 | depends on ARCH_PXA_PALM | ||
408 | select PXA27x | ||
409 | select IWMMXT | ||
410 | help | ||
411 | Say Y here if you intend to run this kernel on Palm Treo 680 | ||
412 | smartphone. | ||
413 | |||
404 | config MACH_PALMLD | 414 | config MACH_PALMLD |
405 | bool "Palm LifeDrive" | 415 | bool "Palm LifeDrive" |
406 | default y | 416 | default y |
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index d18ffef44b8c..d4c6122a342f 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
@@ -62,6 +62,7 @@ obj-$(CONFIG_MACH_PALMT5) += palmt5.o | |||
62 | obj-$(CONFIG_MACH_PALMTX) += palmtx.o | 62 | obj-$(CONFIG_MACH_PALMTX) += palmtx.o |
63 | obj-$(CONFIG_MACH_PALMLD) += palmld.o | 63 | obj-$(CONFIG_MACH_PALMLD) += palmld.o |
64 | obj-$(CONFIG_MACH_PALMZ72) += palmz72.o | 64 | obj-$(CONFIG_MACH_PALMZ72) += palmz72.o |
65 | obj-$(CONFIG_MACH_TREO680) += treo680.o | ||
65 | obj-$(CONFIG_ARCH_VIPER) += viper.o | 66 | obj-$(CONFIG_ARCH_VIPER) += viper.o |
66 | 67 | ||
67 | ifeq ($(CONFIG_MACH_ZYLONITE),y) | 68 | ifeq ($(CONFIG_MACH_ZYLONITE),y) |
diff --git a/arch/arm/mach-pxa/include/mach/treo680.h b/arch/arm/mach-pxa/include/mach/treo680.h new file mode 100644 index 000000000000..af443b24d99a --- /dev/null +++ b/arch/arm/mach-pxa/include/mach/treo680.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * GPIOs and interrupts for Palm Treo 680 smartphone | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #ifndef _INCLUDE_TREO680_H_ | ||
11 | #define _INCLUDE_TREO680_H_ | ||
12 | |||
13 | /* GPIOs */ | ||
14 | #define GPIO_NR_TREO680_POWER_DETECT 0 | ||
15 | #define GPIO_NR_TREO680_AMP_EN 27 | ||
16 | #define GPIO_NR_TREO680_KEYB_BL 24 | ||
17 | #define GPIO_NR_TREO680_VIBRATE_EN 44 | ||
18 | #define GPIO_NR_TREO680_GREEN_LED 20 | ||
19 | #define GPIO_NR_TREO680_RED_LED 79 | ||
20 | #define GPIO_NR_TREO680_SD_DETECT_N 113 | ||
21 | #define GPIO_NR_TREO680_SD_READONLY 33 | ||
22 | #define GPIO_NR_TREO680_EP_DETECT_N 116 | ||
23 | #define GPIO_NR_TREO680_SD_POWER 42 | ||
24 | #define GPIO_NR_TREO680_USB_DETECT 1 | ||
25 | #define GPIO_NR_TREO680_USB_PULLUP 114 | ||
26 | #define GPIO_NR_TREO680_GSM_POWER 40 | ||
27 | #define GPIO_NR_TREO680_GSM_RESET 87 | ||
28 | #define GPIO_NR_TREO680_GSM_WAKE 57 | ||
29 | #define GPIO_NR_TREO680_GSM_HOST_WAKE 14 | ||
30 | #define GPIO_NR_TREO680_GSM_TRIGGER 10 | ||
31 | #define GPIO_NR_TREO680_BT_EN 43 | ||
32 | #define GPIO_NR_TREO680_IR_EN 115 | ||
33 | #define GPIO_NR_TREO680_IR_TXD 47 | ||
34 | #define GPIO_NR_TREO680_BL_POWER 38 | ||
35 | #define GPIO_NR_TREO680_LCD_POWER 25 | ||
36 | |||
37 | /* Various addresses */ | ||
38 | #define TREO680_PHYS_RAM_START 0xa0000000 | ||
39 | #define TREO680_PHYS_IO_START 0x40000000 | ||
40 | #define TREO680_STR_BASE 0xa2000000 | ||
41 | |||
42 | /* BACKLIGHT */ | ||
43 | #define TREO680_MAX_INTENSITY 254 | ||
44 | #define TREO680_DEFAULT_INTENSITY 160 | ||
45 | #define TREO680_LIMIT_MASK 0x7F | ||
46 | #define TREO680_PRESCALER 63 | ||
47 | #define TREO680_PERIOD_NS 3500 | ||
48 | |||
49 | #endif | ||
diff --git a/arch/arm/mach-pxa/treo680.c b/arch/arm/mach-pxa/treo680.c new file mode 100644 index 000000000000..a06f19edebb3 --- /dev/null +++ b/arch/arm/mach-pxa/treo680.c | |||
@@ -0,0 +1,612 @@ | |||
1 | /* | ||
2 | * Hardware definitions for Palm Treo 680 | ||
3 | * | ||
4 | * Author: Tomas Cech <sleep_walker@suse.cz> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * (find more info at www.hackndev.com) | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/platform_device.h> | ||
15 | #include <linux/delay.h> | ||
16 | #include <linux/irq.h> | ||
17 | #include <linux/gpio_keys.h> | ||
18 | #include <linux/input.h> | ||
19 | #include <linux/pda_power.h> | ||
20 | #include <linux/pwm_backlight.h> | ||
21 | #include <linux/gpio.h> | ||
22 | #include <linux/wm97xx_batt.h> | ||
23 | #include <linux/power_supply.h> | ||
24 | #include <linux/sysdev.h> | ||
25 | #include <linux/w1-gpio.h> | ||
26 | |||
27 | #include <asm/mach-types.h> | ||
28 | #include <asm/mach/arch.h> | ||
29 | #include <asm/mach/map.h> | ||
30 | |||
31 | #include <mach/pxa27x.h> | ||
32 | #include <mach/pxa27x-udc.h> | ||
33 | #include <mach/audio.h> | ||
34 | #include <mach/treo680.h> | ||
35 | #include <mach/mmc.h> | ||
36 | #include <mach/pxafb.h> | ||
37 | #include <mach/irda.h> | ||
38 | #include <mach/pxa27x_keypad.h> | ||
39 | #include <mach/udc.h> | ||
40 | #include <mach/ohci.h> | ||
41 | #include <mach/pxa2xx-regs.h> | ||
42 | #include <mach/palmasoc.h> | ||
43 | #include <mach/camera.h> | ||
44 | |||
45 | #include <sound/pxa2xx-lib.h> | ||
46 | |||
47 | #include "generic.h" | ||
48 | #include "devices.h" | ||
49 | |||
50 | /****************************************************************************** | ||
51 | * Pin configuration | ||
52 | ******************************************************************************/ | ||
53 | static unsigned long treo680_pin_config[] __initdata = { | ||
54 | /* MMC */ | ||
55 | GPIO32_MMC_CLK, | ||
56 | GPIO92_MMC_DAT_0, | ||
57 | GPIO109_MMC_DAT_1, | ||
58 | GPIO110_MMC_DAT_2, | ||
59 | GPIO111_MMC_DAT_3, | ||
60 | GPIO112_MMC_CMD, | ||
61 | GPIO33_GPIO, /* SD read only */ | ||
62 | GPIO113_GPIO, /* SD detect */ | ||
63 | |||
64 | /* AC97 */ | ||
65 | GPIO28_AC97_BITCLK, | ||
66 | GPIO29_AC97_SDATA_IN_0, | ||
67 | GPIO30_AC97_SDATA_OUT, | ||
68 | GPIO31_AC97_SYNC, | ||
69 | GPIO89_AC97_SYSCLK, | ||
70 | GPIO95_AC97_nRESET, | ||
71 | |||
72 | /* IrDA */ | ||
73 | GPIO46_FICP_RXD, | ||
74 | GPIO47_FICP_TXD, | ||
75 | |||
76 | /* PWM */ | ||
77 | GPIO16_PWM0_OUT, | ||
78 | |||
79 | /* USB */ | ||
80 | GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, /* usb detect */ | ||
81 | |||
82 | /* MATRIX KEYPAD */ | ||
83 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, | ||
84 | GPIO101_KP_MKIN_1, | ||
85 | GPIO102_KP_MKIN_2, | ||
86 | GPIO97_KP_MKIN_3, | ||
87 | GPIO98_KP_MKIN_4, | ||
88 | GPIO99_KP_MKIN_5, | ||
89 | GPIO91_KP_MKIN_6, | ||
90 | GPIO13_KP_MKIN_7, | ||
91 | GPIO103_KP_MKOUT_0 | MFP_LPM_DRIVE_HIGH, | ||
92 | GPIO104_KP_MKOUT_1, | ||
93 | GPIO105_KP_MKOUT_2, | ||
94 | GPIO106_KP_MKOUT_3, | ||
95 | GPIO107_KP_MKOUT_4, | ||
96 | GPIO108_KP_MKOUT_5, | ||
97 | GPIO96_KP_MKOUT_6, | ||
98 | GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, /* Hotsync button */ | ||
99 | |||
100 | /* LCD */ | ||
101 | GPIO58_LCD_LDD_0, | ||
102 | GPIO59_LCD_LDD_1, | ||
103 | GPIO60_LCD_LDD_2, | ||
104 | GPIO61_LCD_LDD_3, | ||
105 | GPIO62_LCD_LDD_4, | ||
106 | GPIO63_LCD_LDD_5, | ||
107 | GPIO64_LCD_LDD_6, | ||
108 | GPIO65_LCD_LDD_7, | ||
109 | GPIO66_LCD_LDD_8, | ||
110 | GPIO67_LCD_LDD_9, | ||
111 | GPIO68_LCD_LDD_10, | ||
112 | GPIO69_LCD_LDD_11, | ||
113 | GPIO70_LCD_LDD_12, | ||
114 | GPIO71_LCD_LDD_13, | ||
115 | GPIO72_LCD_LDD_14, | ||
116 | GPIO73_LCD_LDD_15, | ||
117 | GPIO74_LCD_FCLK, | ||
118 | GPIO75_LCD_LCLK, | ||
119 | GPIO76_LCD_PCLK, | ||
120 | |||
121 | /* Quick Capture Interface */ | ||
122 | GPIO84_CIF_FV, | ||
123 | GPIO85_CIF_LV, | ||
124 | GPIO53_CIF_MCLK, | ||
125 | GPIO54_CIF_PCLK, | ||
126 | GPIO81_CIF_DD_0, | ||
127 | GPIO55_CIF_DD_1, | ||
128 | GPIO51_CIF_DD_2, | ||
129 | GPIO50_CIF_DD_3, | ||
130 | GPIO52_CIF_DD_4, | ||
131 | GPIO48_CIF_DD_5, | ||
132 | GPIO17_CIF_DD_6, | ||
133 | GPIO12_CIF_DD_7, | ||
134 | |||
135 | /* I2C */ | ||
136 | GPIO117_I2C_SCL, | ||
137 | GPIO118_I2C_SDA, | ||
138 | |||
139 | /* GSM */ | ||
140 | GPIO14_GPIO | WAKEUP_ON_EDGE_BOTH, /* GSM host wake up */ | ||
141 | GPIO34_FFUART_RXD, | ||
142 | GPIO35_FFUART_CTS, | ||
143 | GPIO39_FFUART_TXD, | ||
144 | GPIO41_FFUART_RTS, | ||
145 | |||
146 | /* MISC. */ | ||
147 | GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH, /* external power detect */ | ||
148 | GPIO15_GPIO | WAKEUP_ON_EDGE_BOTH, /* silent switch */ | ||
149 | GPIO116_GPIO, /* headphone detect */ | ||
150 | GPIO11_GPIO | WAKEUP_ON_EDGE_BOTH, /* bluetooth host wake up */ | ||
151 | }; | ||
152 | |||
153 | /****************************************************************************** | ||
154 | * SD/MMC card controller | ||
155 | ******************************************************************************/ | ||
156 | static int treo680_mci_init(struct device *dev, | ||
157 | irq_handler_t treo680_detect_int, void *data) | ||
158 | { | ||
159 | int err = 0; | ||
160 | |||
161 | /* Setup an interrupt for detecting card insert/remove events */ | ||
162 | err = gpio_request(GPIO_NR_TREO680_SD_DETECT_N, "SD IRQ"); | ||
163 | |||
164 | if (err) | ||
165 | goto err; | ||
166 | |||
167 | err = gpio_direction_input(GPIO_NR_TREO680_SD_DETECT_N); | ||
168 | if (err) | ||
169 | goto err2; | ||
170 | |||
171 | err = request_irq(gpio_to_irq(GPIO_NR_TREO680_SD_DETECT_N), | ||
172 | treo680_detect_int, IRQF_DISABLED | IRQF_SAMPLE_RANDOM | | ||
173 | IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, | ||
174 | "SD/MMC card detect", data); | ||
175 | |||
176 | if (err) { | ||
177 | dev_err(dev, "%s: cannot request SD/MMC card detect IRQ\n", | ||
178 | __func__); | ||
179 | goto err2; | ||
180 | } | ||
181 | |||
182 | err = gpio_request(GPIO_NR_TREO680_SD_POWER, "SD_POWER"); | ||
183 | if (err) | ||
184 | goto err3; | ||
185 | |||
186 | err = gpio_direction_output(GPIO_NR_TREO680_SD_POWER, 1); | ||
187 | if (err) | ||
188 | goto err4; | ||
189 | |||
190 | err = gpio_request(GPIO_NR_TREO680_SD_READONLY, "SD_READONLY"); | ||
191 | if (err) | ||
192 | goto err4; | ||
193 | |||
194 | err = gpio_direction_input(GPIO_NR_TREO680_SD_READONLY); | ||
195 | if (err) | ||
196 | goto err5; | ||
197 | |||
198 | return 0; | ||
199 | |||
200 | err5: | ||
201 | gpio_free(GPIO_NR_TREO680_SD_READONLY); | ||
202 | err4: | ||
203 | gpio_free(GPIO_NR_TREO680_SD_POWER); | ||
204 | err3: | ||
205 | free_irq(gpio_to_irq(GPIO_NR_TREO680_SD_DETECT_N), data); | ||
206 | err2: | ||
207 | gpio_free(GPIO_NR_TREO680_SD_DETECT_N); | ||
208 | err: | ||
209 | return err; | ||
210 | } | ||
211 | |||
212 | static void treo680_mci_exit(struct device *dev, void *data) | ||
213 | { | ||
214 | gpio_free(GPIO_NR_TREO680_SD_READONLY); | ||
215 | gpio_free(GPIO_NR_TREO680_SD_POWER); | ||
216 | free_irq(gpio_to_irq(GPIO_NR_TREO680_SD_DETECT_N), data); | ||
217 | gpio_free(GPIO_NR_TREO680_SD_DETECT_N); | ||
218 | } | ||
219 | |||
220 | static void treo680_mci_power(struct device *dev, unsigned int vdd) | ||
221 | { | ||
222 | struct pxamci_platform_data *p_d = dev->platform_data; | ||
223 | gpio_set_value(GPIO_NR_TREO680_SD_POWER, p_d->ocr_mask & (1 << vdd)); | ||
224 | } | ||
225 | |||
226 | static int treo680_mci_get_ro(struct device *dev) | ||
227 | { | ||
228 | return gpio_get_value(GPIO_NR_TREO680_SD_READONLY); | ||
229 | } | ||
230 | |||
231 | static struct pxamci_platform_data treo680_mci_platform_data = { | ||
232 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | ||
233 | .setpower = treo680_mci_power, | ||
234 | .get_ro = treo680_mci_get_ro, | ||
235 | .init = treo680_mci_init, | ||
236 | .exit = treo680_mci_exit, | ||
237 | }; | ||
238 | |||
239 | /****************************************************************************** | ||
240 | * GPIO keyboard | ||
241 | ******************************************************************************/ | ||
242 | static unsigned int treo680_matrix_keys[] = { | ||
243 | KEY(0, 0, KEY_F8), /* Red/Off/Power */ | ||
244 | KEY(0, 1, KEY_LEFT), | ||
245 | KEY(0, 2, KEY_LEFTCTRL), /* Alternate */ | ||
246 | KEY(0, 3, KEY_L), | ||
247 | KEY(0, 4, KEY_A), | ||
248 | KEY(0, 5, KEY_Q), | ||
249 | KEY(0, 6, KEY_P), | ||
250 | |||
251 | KEY(1, 0, KEY_RIGHTCTRL), /* Menu */ | ||
252 | KEY(1, 1, KEY_RIGHT), | ||
253 | KEY(1, 2, KEY_LEFTSHIFT), /* Left shift */ | ||
254 | KEY(1, 3, KEY_Z), | ||
255 | KEY(1, 4, KEY_S), | ||
256 | KEY(1, 5, KEY_W), | ||
257 | |||
258 | KEY(2, 0, KEY_F1), /* Phone */ | ||
259 | KEY(2, 1, KEY_UP), | ||
260 | KEY(2, 2, KEY_0), | ||
261 | KEY(2, 3, KEY_X), | ||
262 | KEY(2, 4, KEY_D), | ||
263 | KEY(2, 5, KEY_E), | ||
264 | |||
265 | KEY(3, 0, KEY_F10), /* Calendar */ | ||
266 | KEY(3, 1, KEY_DOWN), | ||
267 | KEY(3, 2, KEY_SPACE), | ||
268 | KEY(3, 3, KEY_C), | ||
269 | KEY(3, 4, KEY_F), | ||
270 | KEY(3, 5, KEY_R), | ||
271 | |||
272 | KEY(4, 0, KEY_F12), /* Mail */ | ||
273 | KEY(4, 1, KEY_KPENTER), | ||
274 | KEY(4, 2, KEY_RIGHTALT), /* Alt */ | ||
275 | KEY(4, 3, KEY_V), | ||
276 | KEY(4, 4, KEY_G), | ||
277 | KEY(4, 5, KEY_T), | ||
278 | |||
279 | KEY(5, 0, KEY_F9), /* Home */ | ||
280 | KEY(5, 1, KEY_PAGEUP), /* Side up */ | ||
281 | KEY(5, 2, KEY_DOT), | ||
282 | KEY(5, 3, KEY_B), | ||
283 | KEY(5, 4, KEY_H), | ||
284 | KEY(5, 5, KEY_Y), | ||
285 | |||
286 | KEY(6, 0, KEY_TAB), /* Side Activate */ | ||
287 | KEY(6, 1, KEY_PAGEDOWN), /* Side down */ | ||
288 | KEY(6, 2, KEY_ENTER), | ||
289 | KEY(6, 3, KEY_N), | ||
290 | KEY(6, 4, KEY_J), | ||
291 | KEY(6, 5, KEY_U), | ||
292 | |||
293 | KEY(7, 0, KEY_F6), /* Green/Call */ | ||
294 | KEY(7, 1, KEY_O), | ||
295 | KEY(7, 2, KEY_BACKSPACE), | ||
296 | KEY(7, 3, KEY_M), | ||
297 | KEY(7, 4, KEY_K), | ||
298 | KEY(7, 5, KEY_I), | ||
299 | }; | ||
300 | |||
301 | static struct pxa27x_keypad_platform_data treo680_keypad_platform_data = { | ||
302 | .matrix_key_rows = 8, | ||
303 | .matrix_key_cols = 7, | ||
304 | .matrix_key_map = treo680_matrix_keys, | ||
305 | .matrix_key_map_size = ARRAY_SIZE(treo680_matrix_keys), | ||
306 | .direct_key_map = { KEY_CONNECT }, | ||
307 | .direct_key_num = 1, | ||
308 | |||
309 | .debounce_interval = 30, | ||
310 | }; | ||
311 | |||
312 | /****************************************************************************** | ||
313 | * aSoC audio | ||
314 | ******************************************************************************/ | ||
315 | |||
316 | static pxa2xx_audio_ops_t treo680_ac97_pdata = { | ||
317 | .reset_gpio = 95, | ||
318 | }; | ||
319 | |||
320 | /****************************************************************************** | ||
321 | * Backlight | ||
322 | ******************************************************************************/ | ||
323 | static int treo680_backlight_init(struct device *dev) | ||
324 | { | ||
325 | int ret; | ||
326 | |||
327 | ret = gpio_request(GPIO_NR_TREO680_BL_POWER, "BL POWER"); | ||
328 | if (ret) | ||
329 | goto err; | ||
330 | ret = gpio_direction_output(GPIO_NR_TREO680_BL_POWER, 0); | ||
331 | if (ret) | ||
332 | goto err2; | ||
333 | ret = gpio_request(GPIO_NR_TREO680_LCD_POWER, "LCD POWER"); | ||
334 | if (ret) | ||
335 | goto err2; | ||
336 | ret = gpio_direction_output(GPIO_NR_TREO680_LCD_POWER, 0); | ||
337 | if (ret) | ||
338 | goto err3; | ||
339 | |||
340 | return 0; | ||
341 | err3: | ||
342 | gpio_free(GPIO_NR_TREO680_LCD_POWER); | ||
343 | err2: | ||
344 | gpio_free(GPIO_NR_TREO680_BL_POWER); | ||
345 | err: | ||
346 | return ret; | ||
347 | } | ||
348 | |||
349 | static int treo680_backlight_notify(int brightness) | ||
350 | { | ||
351 | gpio_set_value(GPIO_NR_TREO680_BL_POWER, brightness); | ||
352 | return TREO680_MAX_INTENSITY - brightness; | ||
353 | }; | ||
354 | |||
355 | static void treo680_backlight_exit(struct device *dev) | ||
356 | { | ||
357 | gpio_free(GPIO_NR_TREO680_BL_POWER); | ||
358 | gpio_free(GPIO_NR_TREO680_LCD_POWER); | ||
359 | } | ||
360 | |||
361 | static struct platform_pwm_backlight_data treo680_backlight_data = { | ||
362 | .pwm_id = 0, | ||
363 | .max_brightness = TREO680_MAX_INTENSITY, | ||
364 | .dft_brightness = TREO680_DEFAULT_INTENSITY, | ||
365 | .pwm_period_ns = TREO680_PERIOD_NS, | ||
366 | .init = treo680_backlight_init, | ||
367 | .notify = treo680_backlight_notify, | ||
368 | .exit = treo680_backlight_exit, | ||
369 | }; | ||
370 | |||
371 | static struct platform_device treo680_backlight = { | ||
372 | .name = "pwm-backlight", | ||
373 | .dev = { | ||
374 | .parent = &pxa27x_device_pwm0.dev, | ||
375 | .platform_data = &treo680_backlight_data, | ||
376 | }, | ||
377 | }; | ||
378 | |||
379 | /****************************************************************************** | ||
380 | * IrDA | ||
381 | ******************************************************************************/ | ||
382 | static void treo680_transceiver_mode(struct device *dev, int mode) | ||
383 | { | ||
384 | gpio_set_value(GPIO_NR_TREO680_IR_EN, mode & IR_OFF); | ||
385 | pxa2xx_transceiver_mode(dev, mode); | ||
386 | } | ||
387 | |||
388 | static int treo680_irda_startup(struct device *dev) | ||
389 | { | ||
390 | int err; | ||
391 | |||
392 | err = gpio_request(GPIO_NR_TREO680_IR_EN, "Ir port disable"); | ||
393 | if (err) | ||
394 | goto err1; | ||
395 | |||
396 | err = gpio_direction_output(GPIO_NR_TREO680_IR_EN, 1); | ||
397 | if (err) | ||
398 | goto err2; | ||
399 | |||
400 | return 0; | ||
401 | |||
402 | err2: | ||
403 | dev_err(dev, "treo680_irda: cannot change IR gpio direction\n"); | ||
404 | gpio_free(GPIO_NR_TREO680_IR_EN); | ||
405 | err1: | ||
406 | dev_err(dev, "treo680_irda: cannot allocate IR gpio\n"); | ||
407 | return err; | ||
408 | } | ||
409 | |||
410 | static void treo680_irda_shutdown(struct device *dev) | ||
411 | { | ||
412 | gpio_free(GPIO_NR_TREO680_AMP_EN); | ||
413 | } | ||
414 | |||
415 | static struct pxaficp_platform_data treo680_ficp_info = { | ||
416 | .transceiver_cap = IR_FIRMODE | IR_SIRMODE | IR_OFF, | ||
417 | .startup = treo680_irda_startup, | ||
418 | .shutdown = treo680_irda_shutdown, | ||
419 | .transceiver_mode = treo680_transceiver_mode, | ||
420 | }; | ||
421 | |||
422 | /****************************************************************************** | ||
423 | * UDC | ||
424 | ******************************************************************************/ | ||
425 | static struct pxa2xx_udc_mach_info treo680_udc_info __initdata = { | ||
426 | .gpio_vbus = GPIO_NR_TREO680_USB_DETECT, | ||
427 | .gpio_vbus_inverted = 1, | ||
428 | .gpio_pullup = GPIO_NR_TREO680_USB_PULLUP, | ||
429 | }; | ||
430 | |||
431 | |||
432 | /****************************************************************************** | ||
433 | * USB host | ||
434 | ******************************************************************************/ | ||
435 | static struct pxaohci_platform_data treo680_ohci_info = { | ||
436 | .port_mode = PMM_PERPORT_MODE, | ||
437 | .flags = ENABLE_PORT1 | ENABLE_PORT3, | ||
438 | .power_budget = 0, | ||
439 | }; | ||
440 | |||
441 | /****************************************************************************** | ||
442 | * Power supply | ||
443 | ******************************************************************************/ | ||
444 | static int power_supply_init(struct device *dev) | ||
445 | { | ||
446 | int ret; | ||
447 | |||
448 | ret = gpio_request(GPIO_NR_TREO680_POWER_DETECT, "CABLE_STATE_AC"); | ||
449 | if (ret) | ||
450 | goto err1; | ||
451 | ret = gpio_direction_input(GPIO_NR_TREO680_POWER_DETECT); | ||
452 | if (ret) | ||
453 | goto err2; | ||
454 | |||
455 | return 0; | ||
456 | |||
457 | err2: | ||
458 | gpio_free(GPIO_NR_TREO680_POWER_DETECT); | ||
459 | err1: | ||
460 | return ret; | ||
461 | } | ||
462 | |||
463 | static int treo680_is_ac_online(void) | ||
464 | { | ||
465 | return gpio_get_value(GPIO_NR_TREO680_POWER_DETECT); | ||
466 | } | ||
467 | |||
468 | static void power_supply_exit(struct device *dev) | ||
469 | { | ||
470 | gpio_free(GPIO_NR_TREO680_POWER_DETECT); | ||
471 | } | ||
472 | |||
473 | static char *treo680_supplicants[] = { | ||
474 | "main-battery", | ||
475 | }; | ||
476 | |||
477 | static struct pda_power_pdata power_supply_info = { | ||
478 | .init = power_supply_init, | ||
479 | .is_ac_online = treo680_is_ac_online, | ||
480 | .exit = power_supply_exit, | ||
481 | .supplied_to = treo680_supplicants, | ||
482 | .num_supplicants = ARRAY_SIZE(treo680_supplicants), | ||
483 | }; | ||
484 | |||
485 | static struct platform_device power_supply = { | ||
486 | .name = "pda-power", | ||
487 | .id = -1, | ||
488 | .dev = { | ||
489 | .platform_data = &power_supply_info, | ||
490 | }, | ||
491 | }; | ||
492 | |||
493 | /****************************************************************************** | ||
494 | * Vibra and LEDs | ||
495 | ******************************************************************************/ | ||
496 | static struct gpio_led gpio_leds[] = { | ||
497 | { | ||
498 | .name = "treo680:vibra:vibra", | ||
499 | .default_trigger = "none", | ||
500 | .gpio = GPIO_NR_TREO680_VIBRATE_EN, | ||
501 | }, | ||
502 | { | ||
503 | .name = "treo680:green:led", | ||
504 | .default_trigger = "mmc0", | ||
505 | .gpio = GPIO_NR_TREO680_GREEN_LED, | ||
506 | }, | ||
507 | { | ||
508 | .name = "treo680:keybbl:keybbl", | ||
509 | .default_trigger = "none", | ||
510 | .gpio = GPIO_NR_TREO680_KEYB_BL, | ||
511 | }, | ||
512 | }; | ||
513 | |||
514 | static struct gpio_led_platform_data gpio_led_info = { | ||
515 | .leds = gpio_leds, | ||
516 | .num_leds = ARRAY_SIZE(gpio_leds), | ||
517 | }; | ||
518 | |||
519 | static struct platform_device treo680_leds = { | ||
520 | .name = "leds-gpio", | ||
521 | .id = -1, | ||
522 | .dev = { | ||
523 | .platform_data = &gpio_led_info, | ||
524 | } | ||
525 | }; | ||
526 | |||
527 | |||
528 | /****************************************************************************** | ||
529 | * Framebuffer | ||
530 | ******************************************************************************/ | ||
531 | /* TODO: add support for 324x324 */ | ||
532 | static struct pxafb_mode_info treo680_lcd_modes[] = { | ||
533 | { | ||
534 | .pixclock = 86538, | ||
535 | .xres = 320, | ||
536 | .yres = 320, | ||
537 | .bpp = 16, | ||
538 | |||
539 | .left_margin = 20, | ||
540 | .right_margin = 8, | ||
541 | .upper_margin = 8, | ||
542 | .lower_margin = 5, | ||
543 | |||
544 | .hsync_len = 4, | ||
545 | .vsync_len = 1, | ||
546 | }, | ||
547 | }; | ||
548 | |||
549 | static struct pxafb_mach_info treo680_lcd_screen = { | ||
550 | .modes = treo680_lcd_modes, | ||
551 | .num_modes = ARRAY_SIZE(treo680_lcd_modes), | ||
552 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, | ||
553 | }; | ||
554 | |||
555 | /****************************************************************************** | ||
556 | * Power management - standby | ||
557 | ******************************************************************************/ | ||
558 | static void __init treo680_pm_init(void) | ||
559 | { | ||
560 | static u32 resume[] = { | ||
561 | 0xe3a00101, /* mov r0, #0x40000000 */ | ||
562 | 0xe380060f, /* orr r0, r0, #0x00f00000 */ | ||
563 | 0xe590f008, /* ldr pc, [r0, #0x08] */ | ||
564 | }; | ||
565 | |||
566 | /* this is where the bootloader jumps */ | ||
567 | memcpy(phys_to_virt(TREO680_STR_BASE), resume, sizeof(resume)); | ||
568 | } | ||
569 | |||
570 | /****************************************************************************** | ||
571 | * Machine init | ||
572 | ******************************************************************************/ | ||
573 | static struct platform_device *devices[] __initdata = { | ||
574 | &treo680_backlight, | ||
575 | &treo680_leds, | ||
576 | &power_supply, | ||
577 | }; | ||
578 | |||
579 | /* setup udc GPIOs initial state */ | ||
580 | static void __init treo680_udc_init(void) | ||
581 | { | ||
582 | if (!gpio_request(GPIO_NR_TREO680_USB_PULLUP, "UDC Vbus")) { | ||
583 | gpio_direction_output(GPIO_NR_TREO680_USB_PULLUP, 1); | ||
584 | gpio_free(GPIO_NR_TREO680_USB_PULLUP); | ||
585 | } | ||
586 | } | ||
587 | |||
588 | static void __init treo680_init(void) | ||
589 | { | ||
590 | treo680_pm_init(); | ||
591 | pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); | ||
592 | pxa_set_keypad_info(&treo680_keypad_platform_data); | ||
593 | set_pxa_fb_info(&treo680_lcd_screen); | ||
594 | pxa_set_mci_info(&treo680_mci_platform_data); | ||
595 | treo680_udc_init(); | ||
596 | pxa_set_udc_info(&treo680_udc_info); | ||
597 | pxa_set_ac97_info(&treo680_ac97_pdata); | ||
598 | pxa_set_ficp_info(&treo680_ficp_info); | ||
599 | pxa_set_ohci_info(&treo680_ohci_info); | ||
600 | |||
601 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
602 | } | ||
603 | |||
604 | MACHINE_START(TREO680, "Palm Treo 680") | ||
605 | .phys_io = TREO680_PHYS_IO_START, | ||
606 | .io_pg_offst = io_p2v(0x40000000), | ||
607 | .boot_params = 0xa0000100, | ||
608 | .map_io = pxa_map_io, | ||
609 | .init_irq = pxa27x_init_irq, | ||
610 | .timer = &pxa_timer, | ||
611 | .init_machine = treo680_init, | ||
612 | MACHINE_END | ||
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index e6344ece00ce..0b91bb20cf95 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -835,6 +835,13 @@ void __init reserve_node_zero(pg_data_t *pgdat) | |||
835 | BOOTMEM_EXCLUSIVE); | 835 | BOOTMEM_EXCLUSIVE); |
836 | } | 836 | } |
837 | 837 | ||
838 | if (machine_is_treo680()) { | ||
839 | reserve_bootmem_node(pgdat, 0xa0000000, 0x1000, | ||
840 | BOOTMEM_EXCLUSIVE); | ||
841 | reserve_bootmem_node(pgdat, 0xa2000000, 0x1000, | ||
842 | BOOTMEM_EXCLUSIVE); | ||
843 | } | ||
844 | |||
838 | if (machine_is_palmt5()) | 845 | if (machine_is_palmt5()) |
839 | reserve_bootmem_node(pgdat, 0xa0200000, 0x1000, | 846 | reserve_bootmem_node(pgdat, 0xa0200000, 0x1000, |
840 | BOOTMEM_EXCLUSIVE); | 847 | BOOTMEM_EXCLUSIVE); |