]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[ARM] 2787/2: PXA27x low power modes support
authorTodd Poynor <tpoynor@mvista.com>
Fri, 28 Oct 2005 15:25:01 +0000 (16:25 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 28 Oct 2005 15:25:01 +0000 (16:25 +0100)
Patch from Todd Poynor

Add symbols for PXA2xx PWRMODE register M field that selects low-power
mode, replace unadorned constants.  Honor power mode parameter of
pxa_cpu_suspend(mode), no longer force to 3 (sleep).  Full Deep Sleep
low-power mode support for PXA27x is pending generic PM interfaces to
select more than 2 suspend-to-RAM-style power modes, but this is
expected soon. This can be hardcoded in the meantime by replacing the
pxa_cpu_suspend() parameter value.  From David Burrage and Todd Poynor.
Try #2 removes one of the register copies and moves the code to save the
pxa_cpu_suspend parameter to immediately surround the call that requires
the parameter value be preserved.

Signed-off-by: Todd Poynor <tpoynor@mvista.com>
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/sleep.S
arch/arm/mach-pxa/standby.S
include/asm-arm/arch-pxa/pxa-regs.h

index 7869c3b4e62f0447eee5737dc855b0b99afe5d10..573a5758e781c366138de117529b92c04a71acce 100644 (file)
@@ -129,7 +129,7 @@ void pxa_cpu_pm_enter(suspend_state_t state)
        case PM_SUSPEND_MEM:
                /* set resume return address */
                PSPR = virt_to_phys(pxa_cpu_resume);
-               pxa_cpu_suspend(3);
+               pxa_cpu_suspend(PWRMODE_SLEEP);
                break;
        }
 }
index 9a791b07118df2a71163db05cb476d5a44b614b7..09a5d593f04b27c2558850e76c0e99dcee861967 100644 (file)
@@ -157,7 +157,7 @@ void pxa_cpu_pm_enter(suspend_state_t state)
        case PM_SUSPEND_MEM:
                /* set resume return address */
                PSPR = virt_to_phys(pxa_cpu_resume);
-               pxa_cpu_suspend(3);
+               pxa_cpu_suspend(PWRMODE_SLEEP);
                break;
        }
 }
index 5786ccad938cef12878a7c5a19db33617e16c50d..c9862688ff3d6694f6e812717bdb41eeb2e84cc6 100644 (file)
@@ -28,7 +28,9 @@
 /*
  * pxa_cpu_suspend()
  *
- * Forces CPU into sleep state
+ * Forces CPU into sleep state.
+ *
+ * r0 = value for PWRMODE M field for desired sleep state
  */
 
 ENTRY(pxa_cpu_suspend)
@@ -53,6 +55,7 @@ ENTRY(pxa_cpu_suspend)
        mov     r10, sp
        stmfd   sp!, {r3 - r10}
 
+       mov r5, r0                              @ save sleep mode
        @ preserve phys address of stack
        mov     r0, sp
        bl      sleep_phys_sp
@@ -66,7 +69,7 @@ ENTRY(pxa_cpu_suspend)
        @ (also workaround for sighting 28071)
 
        @ prepare value for sleep mode
-       mov     r1, #3                          @ sleep mode
+       mov     r1, r5                          @ sleep mode
 
        @ prepare pointer to physical address 0 (virtual mapping in generic.c)
        mov     r2, #UNCACHED_PHYS_0
index 8a3f27b76784e6bc1d8d6434865c906e6821ee89..6f6dbbd0802137f9d9cbe6d811226e54a2b3b238 100644 (file)
@@ -21,7 +21,7 @@
 ENTRY(pxa_cpu_standby)
        ldr     r0, =PSSR
        mov     r1, #(PSSR_PH | PSSR_STS)
-       mov     r2, #2
+       mov     r2, #PWRMODE_STANDBY
        mov     r3, #UNCACHED_PHYS_0    @ Read mem context in.
        ldr     ip, [r3]
        b       1f
index 3af7165ab0d738702eff0d17e43f3348d5158750..a6a34edec813304f7b3d031585e59c60905b5b0a 100644 (file)
 
 #endif
 
+/* PWRMODE register M field values */
+
+#define PWRMODE_IDLE           0x1
+#define PWRMODE_STANDBY                0x2
+#define PWRMODE_SLEEP          0x3
+#define PWRMODE_DEEPSLEEP      0x7
+
 #endif