aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/include/mach/pm.h4
-rw-r--r--arch/arm/mach-pxa/mfp-pxa2xx.c4
-rw-r--r--arch/arm/mach-pxa/palmz72.c1
-rw-r--r--arch/arm/mach-pxa/pm.c1
-rw-r--r--arch/arm/mach-pxa/pxa25x.c3
-rw-r--r--arch/arm/mach-pxa/pxa27x.c11
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c14
-rw-r--r--arch/arm/mach-pxa/raumfeld.c36
-rw-r--r--arch/arm/mach-pxa/sleep.S55
-rw-r--r--arch/arm/mach-pxa/zeus.c3
10 files changed, 58 insertions, 74 deletions
diff --git a/arch/arm/mach-pxa/include/mach/pm.h b/arch/arm/mach-pxa/include/mach/pm.h
index f15afe012995..51558bcee999 100644
--- a/arch/arm/mach-pxa/include/mach/pm.h
+++ b/arch/arm/mach-pxa/include/mach/pm.h
@@ -22,8 +22,8 @@ struct pxa_cpu_pm_fns {
22extern struct pxa_cpu_pm_fns *pxa_cpu_pm_fns; 22extern struct pxa_cpu_pm_fns *pxa_cpu_pm_fns;
23 23
24/* sleep.S */ 24/* sleep.S */
25extern void pxa25x_cpu_suspend(unsigned int, long); 25extern int pxa25x_finish_suspend(unsigned long);
26extern void pxa27x_cpu_suspend(unsigned int, long); 26extern int pxa27x_finish_suspend(unsigned long);
27 27
28extern int pxa_pm_enter(suspend_state_t state); 28extern int pxa_pm_enter(suspend_state_t state);
29extern int pxa_pm_prepare(void); 29extern int pxa_pm_prepare(void);
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
index 87ae3129f4f7..b27544bcafcb 100644
--- a/arch/arm/mach-pxa/mfp-pxa2xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa2xx.c
@@ -347,9 +347,9 @@ static int pxa2xx_mfp_suspend(void)
347 if ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) && 347 if ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) &&
348 (GPDR(i) & GPIO_bit(i))) { 348 (GPDR(i) & GPIO_bit(i))) {
349 if (GPLR(i) & GPIO_bit(i)) 349 if (GPLR(i) & GPIO_bit(i))
350 PGSR(i) |= GPIO_bit(i); 350 PGSR(gpio_to_bank(i)) |= GPIO_bit(i);
351 else 351 else
352 PGSR(i) &= ~GPIO_bit(i); 352 PGSR(gpio_to_bank(i)) &= ~GPIO_bit(i);
353 } 353 }
354 } 354 }
355 355
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index 65f24f0b77e8..5a5329bc33f1 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -33,6 +33,7 @@
33#include <linux/i2c-gpio.h> 33#include <linux/i2c-gpio.h>
34 34
35#include <asm/mach-types.h> 35#include <asm/mach-types.h>
36#include <asm/suspend.h>
36#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
37#include <asm/mach/map.h> 38#include <asm/mach/map.h>
38 39
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index 51e1583265b2..37178a8559b1 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -42,7 +42,6 @@ int pxa_pm_enter(suspend_state_t state)
42 42
43 /* *** go zzz *** */ 43 /* *** go zzz *** */
44 pxa_cpu_pm_fns->enter(state); 44 pxa_cpu_pm_fns->enter(state);
45 cpu_init();
46 45
47 if (state != PM_SUSPEND_STANDBY && pxa_cpu_pm_fns->restore) { 46 if (state != PM_SUSPEND_STANDBY && pxa_cpu_pm_fns->restore) {
48 /* after sleeping, validate the checksum */ 47 /* after sleeping, validate the checksum */
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index fed363cec9c6..9c434d21a271 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -25,6 +25,7 @@
25#include <linux/irq.h> 25#include <linux/irq.h>
26 26
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28#include <asm/suspend.h>
28#include <mach/hardware.h> 29#include <mach/hardware.h>
29#include <mach/irqs.h> 30#include <mach/irqs.h>
30#include <mach/gpio.h> 31#include <mach/gpio.h>
@@ -244,7 +245,7 @@ static void pxa25x_cpu_pm_enter(suspend_state_t state)
244 245
245 switch (state) { 246 switch (state) {
246 case PM_SUSPEND_MEM: 247 case PM_SUSPEND_MEM:
247 pxa25x_cpu_suspend(PWRMODE_SLEEP, PLAT_PHYS_OFFSET - PAGE_OFFSET); 248 cpu_suspend(PWRMODE_SLEEP, pxa25x_finish_suspend);
248 break; 249 break;
249 } 250 }
250} 251}
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 2fecbec58d88..9d2400b5f503 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -24,6 +24,7 @@
24#include <asm/mach/map.h> 24#include <asm/mach/map.h>
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <asm/irq.h> 26#include <asm/irq.h>
27#include <asm/suspend.h>
27#include <mach/irqs.h> 28#include <mach/irqs.h>
28#include <mach/gpio.h> 29#include <mach/gpio.h>
29#include <mach/pxa27x.h> 30#include <mach/pxa27x.h>
@@ -284,6 +285,11 @@ void pxa27x_cpu_pm_restore(unsigned long *sleep_save)
284void pxa27x_cpu_pm_enter(suspend_state_t state) 285void pxa27x_cpu_pm_enter(suspend_state_t state)
285{ 286{
286 extern void pxa_cpu_standby(void); 287 extern void pxa_cpu_standby(void);
288#ifndef CONFIG_IWMMXT
289 u64 acc0;
290
291 asm volatile("mra %Q0, %R0, acc0" : "=r" (acc0));
292#endif
287 293
288 /* ensure voltage-change sequencer not initiated, which hangs */ 294 /* ensure voltage-change sequencer not initiated, which hangs */
289 PCFR &= ~PCFR_FVC; 295 PCFR &= ~PCFR_FVC;
@@ -299,7 +305,10 @@ void pxa27x_cpu_pm_enter(suspend_state_t state)
299 pxa_cpu_standby(); 305 pxa_cpu_standby();
300 break; 306 break;
301 case PM_SUSPEND_MEM: 307 case PM_SUSPEND_MEM:
302 pxa27x_cpu_suspend(pwrmode, PLAT_PHYS_OFFSET - PAGE_OFFSET); 308 cpu_suspend(pwrmode, pxa27x_finish_suspend);
309#ifndef CONFIG_IWMMXT
310 asm volatile("mar acc0, %Q0, %R0" : "=r" (acc0));
311#endif
303 break; 312 break;
304 } 313 }
305} 314}
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 8521d7d6f1da..ef1c56a67afc 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -24,6 +24,7 @@
24#include <linux/i2c/pxa-i2c.h> 24#include <linux/i2c/pxa-i2c.h>
25 25
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <asm/suspend.h>
27#include <mach/hardware.h> 28#include <mach/hardware.h>
28#include <mach/gpio.h> 29#include <mach/gpio.h>
29#include <mach/pxa3xx-regs.h> 30#include <mach/pxa3xx-regs.h>
@@ -141,8 +142,13 @@ static void pxa3xx_cpu_pm_suspend(void)
141{ 142{
142 volatile unsigned long *p = (volatile void *)0xc0000000; 143 volatile unsigned long *p = (volatile void *)0xc0000000;
143 unsigned long saved_data = *p; 144 unsigned long saved_data = *p;
145#ifndef CONFIG_IWMMXT
146 u64 acc0;
144 147
145 extern void pxa3xx_cpu_suspend(long); 148 asm volatile("mra %Q0, %R0, acc0" : "=r" (acc0));
149#endif
150
151 extern int pxa3xx_finish_suspend(unsigned long);
146 152
147 /* resuming from D2 requires the HSIO2/BOOT/TPM clocks enabled */ 153 /* resuming from D2 requires the HSIO2/BOOT/TPM clocks enabled */
148 CKENA |= (1 << CKEN_BOOT) | (1 << CKEN_TPM); 154 CKENA |= (1 << CKEN_BOOT) | (1 << CKEN_TPM);
@@ -162,11 +168,15 @@ static void pxa3xx_cpu_pm_suspend(void)
162 /* overwrite with the resume address */ 168 /* overwrite with the resume address */
163 *p = virt_to_phys(cpu_resume); 169 *p = virt_to_phys(cpu_resume);
164 170
165 pxa3xx_cpu_suspend(PLAT_PHYS_OFFSET - PAGE_OFFSET); 171 cpu_suspend(0, pxa3xx_finish_suspend);
166 172
167 *p = saved_data; 173 *p = saved_data;
168 174
169 AD3ER = 0; 175 AD3ER = 0;
176
177#ifndef CONFIG_IWMMXT
178 asm volatile("mar acc0, %Q0, %R0" : "=r" (acc0));
179#endif
170} 180}
171 181
172static void pxa3xx_cpu_pm_enter(suspend_state_t state) 182static void pxa3xx_cpu_pm_enter(suspend_state_t state)
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index d130f77b6d11..2f37d43f51b6 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -573,10 +573,10 @@ static struct pxafb_mode_info sharp_lq043t3dx02_mode = {
573 .xres = 480, 573 .xres = 480,
574 .yres = 272, 574 .yres = 272,
575 .bpp = 16, 575 .bpp = 16,
576 .hsync_len = 4, 576 .hsync_len = 41,
577 .left_margin = 2, 577 .left_margin = 2,
578 .right_margin = 1, 578 .right_margin = 1,
579 .vsync_len = 1, 579 .vsync_len = 10,
580 .upper_margin = 3, 580 .upper_margin = 3,
581 .lower_margin = 1, 581 .lower_margin = 1,
582 .sync = 0, 582 .sync = 0,
@@ -596,29 +596,31 @@ static void __init raumfeld_lcd_init(void)
596{ 596{
597 int ret; 597 int ret;
598 598
599 pxa_set_fb_info(NULL, &raumfeld_sharp_lcd_info);
600
601 /* Earlier devices had the backlight regulator controlled
602 * via PWM, later versions use another controller for that */
603 if ((system_rev & 0xff) < 2) {
604 mfp_cfg_t raumfeld_pwm_pin_config = GPIO17_PWM0_OUT;
605 pxa3xx_mfp_config(&raumfeld_pwm_pin_config, 1);
606 platform_device_register(&raumfeld_pwm_backlight_device);
607 } else
608 platform_device_register(&raumfeld_lt3593_device);
609
610 ret = gpio_request(GPIO_TFT_VA_EN, "display VA enable"); 599 ret = gpio_request(GPIO_TFT_VA_EN, "display VA enable");
611 if (ret < 0) 600 if (ret < 0)
612 pr_warning("Unable to request GPIO_TFT_VA_EN\n"); 601 pr_warning("Unable to request GPIO_TFT_VA_EN\n");
613 else 602 else
614 gpio_direction_output(GPIO_TFT_VA_EN, 1); 603 gpio_direction_output(GPIO_TFT_VA_EN, 1);
615 604
605 msleep(100);
606
616 ret = gpio_request(GPIO_DISPLAY_ENABLE, "display enable"); 607 ret = gpio_request(GPIO_DISPLAY_ENABLE, "display enable");
617 if (ret < 0) 608 if (ret < 0)
618 pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n"); 609 pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n");
619 else 610 else
620 gpio_direction_output(GPIO_DISPLAY_ENABLE, 1); 611 gpio_direction_output(GPIO_DISPLAY_ENABLE, 1);
621 612
613 /* Hardware revision 2 has the backlight regulator controlled
614 * by an LT3593, earlier and later devices use PWM for that. */
615 if ((system_rev & 0xff) == 2) {
616 platform_device_register(&raumfeld_lt3593_device);
617 } else {
618 mfp_cfg_t raumfeld_pwm_pin_config = GPIO17_PWM0_OUT;
619 pxa3xx_mfp_config(&raumfeld_pwm_pin_config, 1);
620 platform_device_register(&raumfeld_pwm_backlight_device);
621 }
622
623 pxa_set_fb_info(NULL, &raumfeld_sharp_lcd_info);
622 platform_device_register(&pxa3xx_device_gcu); 624 platform_device_register(&pxa3xx_device_gcu);
623} 625}
624 626
@@ -657,10 +659,10 @@ static struct lis3lv02d_platform_data lis3_pdata = {
657 659
658#define SPI_AK4104 \ 660#define SPI_AK4104 \
659{ \ 661{ \
660 .modalias = "ak4104", \ 662 .modalias = "ak4104-codec", \
661 .max_speed_hz = 10000, \ 663 .max_speed_hz = 10000, \
662 .bus_num = 0, \ 664 .bus_num = 0, \
663 .chip_select = 0, \ 665 .chip_select = 0, \
664 .controller_data = (void *) GPIO_SPDIF_CS, \ 666 .controller_data = (void *) GPIO_SPDIF_CS, \
665} 667}
666 668
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
index 6f5368899d84..1e544be9905d 100644
--- a/arch/arm/mach-pxa/sleep.S
+++ b/arch/arm/mach-pxa/sleep.S
@@ -24,20 +24,9 @@
24 24
25#ifdef CONFIG_PXA3xx 25#ifdef CONFIG_PXA3xx
26/* 26/*
27 * pxa3xx_cpu_suspend() - forces CPU into sleep state (S2D3C4) 27 * pxa3xx_finish_suspend() - forces CPU into sleep state (S2D3C4)
28 *
29 * r0 = v:p offset
30 */ 28 */
31ENTRY(pxa3xx_cpu_suspend) 29ENTRY(pxa3xx_finish_suspend)
32
33#ifndef CONFIG_IWMMXT
34 mra r2, r3, acc0
35#endif
36 stmfd sp!, {r2 - r12, lr} @ save registers on stack
37 mov r1, r0
38 ldr r3, =pxa_cpu_resume @ resume function
39 bl cpu_suspend
40
41 mov r0, #0x06 @ S2D3C4 mode 30 mov r0, #0x06 @ S2D3C4 mode
42 mcr p14, 0, r0, c7, c0, 0 @ enter sleep 31 mcr p14, 0, r0, c7, c0, 0 @ enter sleep
43 32
@@ -46,28 +35,18 @@ ENTRY(pxa3xx_cpu_suspend)
46 35
47#ifdef CONFIG_PXA27x 36#ifdef CONFIG_PXA27x
48/* 37/*
49 * pxa27x_cpu_suspend() 38 * pxa27x_finish_suspend()
50 * 39 *
51 * Forces CPU into sleep state. 40 * Forces CPU into sleep state.
52 * 41 *
53 * r0 = value for PWRMODE M field for desired sleep state 42 * r0 = value for PWRMODE M field for desired sleep state
54 * r1 = v:p offset
55 */ 43 */
56ENTRY(pxa27x_cpu_suspend) 44ENTRY(pxa27x_finish_suspend)
57
58#ifndef CONFIG_IWMMXT
59 mra r2, r3, acc0
60#endif
61 stmfd sp!, {r2 - r12, lr} @ save registers on stack
62 mov r4, r0 @ save sleep mode
63 ldr r3, =pxa_cpu_resume @ resume function
64 bl cpu_suspend
65
66 @ Put the processor to sleep 45 @ Put the processor to sleep
67 @ (also workaround for sighting 28071) 46 @ (also workaround for sighting 28071)
68 47
69 @ prepare value for sleep mode 48 @ prepare value for sleep mode
70 mov r1, r4 @ sleep mode 49 mov r1, r0 @ sleep mode
71 50
72 @ prepare pointer to physical address 0 (virtual mapping in generic.c) 51 @ prepare pointer to physical address 0 (virtual mapping in generic.c)
73 mov r2, #UNCACHED_PHYS_0 52 mov r2, #UNCACHED_PHYS_0
@@ -99,21 +78,16 @@ ENTRY(pxa27x_cpu_suspend)
99 78
100#ifdef CONFIG_PXA25x 79#ifdef CONFIG_PXA25x
101/* 80/*
102 * pxa25x_cpu_suspend() 81 * pxa25x_finish_suspend()
103 * 82 *
104 * Forces CPU into sleep state. 83 * Forces CPU into sleep state.
105 * 84 *
106 * r0 = value for PWRMODE M field for desired sleep state 85 * r0 = value for PWRMODE M field for desired sleep state
107 * r1 = v:p offset
108 */ 86 */
109 87
110ENTRY(pxa25x_cpu_suspend) 88ENTRY(pxa25x_finish_suspend)
111 stmfd sp!, {r2 - r12, lr} @ save registers on stack
112 mov r4, r0 @ save sleep mode
113 ldr r3, =pxa_cpu_resume @ resume function
114 bl cpu_suspend
115 @ prepare value for sleep mode 89 @ prepare value for sleep mode
116 mov r1, r4 @ sleep mode 90 mov r1, r0 @ sleep mode
117 91
118 @ prepare pointer to physical address 0 (virtual mapping in generic.c) 92 @ prepare pointer to physical address 0 (virtual mapping in generic.c)
119 mov r2, #UNCACHED_PHYS_0 93 mov r2, #UNCACHED_PHYS_0
@@ -195,16 +169,3 @@ pxa_cpu_do_suspend:
195 mcr p14, 0, r1, c7, c0, 0 @ PWRMODE 169 mcr p14, 0, r1, c7, c0, 0 @ PWRMODE
196 170
19720: b 20b @ loop waiting for sleep 17120: b 20b @ loop waiting for sleep
198
199/*
200 * pxa_cpu_resume()
201 *
202 * entry point from bootloader into kernel during resume
203 */
204 .align 5
205pxa_cpu_resume:
206 ldmfd sp!, {r2, r3}
207#ifndef CONFIG_IWMMXT
208 mar acc0, r2, r3
209#endif
210 ldmfd sp!, {r4 - r12, pc} @ return to caller
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index 00363c7ac182..9b99cc164de5 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -31,6 +31,7 @@
31#include <linux/can/platform/mcp251x.h> 31#include <linux/can/platform/mcp251x.h>
32 32
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/suspend.h>
34#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
35#include <asm/mach/map.h> 36#include <asm/mach/map.h>
36 37
@@ -676,7 +677,7 @@ static struct pxa2xx_udc_mach_info zeus_udc_info = {
676static void zeus_power_off(void) 677static void zeus_power_off(void)
677{ 678{
678 local_irq_disable(); 679 local_irq_disable();
679 pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP, PLAT_PHYS_OFFSET - PAGE_OFFSET); 680 cpu_suspend(PWRMODE_DEEPSLEEP, pxa27x_finish_suspend);
680} 681}
681#else 682#else
682#define zeus_power_off NULL 683#define zeus_power_off NULL