diff options
author | Todd Poynor <tpoynor@mvista.com> | 2005-07-01 06:27:05 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-07-01 06:27:05 -0400 |
commit | 26705ca46bdf81113cc6729eb12b9eee2263bbfc (patch) | |
tree | f49950ea17fbdec406404144ee264fa3c6ad5c61 | |
parent | 62351cc38d3eaf3de0327054dd6ebc039f4da80d (diff) |
[PATCH] ARM: 2781/2: PXA27x Standby mode take 2
Patch from Todd Poynor
Add support for PXA27x Standby mode, a low-power mode that retains CPU
and some peripheral state (the existing "sleep" mode is a power-power
mode that retains less state). Activated via:
echo -n standby > /sys/power/state
From: David Burrage and Todd Poynor
Signed-off-by: Todd Poynor <tpoynor@mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-pxa/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa27x.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-pxa/standby.S | 32 | ||||
-rw-r--r-- | include/asm-arm/arch-pxa/pxa-regs.h | 1 |
4 files changed, 45 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index c4e6d2523585..efc2f657184e 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
@@ -24,3 +24,7 @@ obj-$(CONFIG_LEDS) += $(led-y) | |||
24 | 24 | ||
25 | # Misc features | 25 | # Misc features |
26 | obj-$(CONFIG_PM) += pm.o sleep.o | 26 | obj-$(CONFIG_PM) += pm.o sleep.o |
27 | |||
28 | ifeq ($(CONFIG_PXA27x),y) | ||
29 | obj-$(CONFIG_PM) += standby.o | ||
30 | endif | ||
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 893964fb9659..9a791b07118d 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -126,6 +126,7 @@ int pxa_cpu_pm_prepare(suspend_state_t state) | |||
126 | { | 126 | { |
127 | switch (state) { | 127 | switch (state) { |
128 | case PM_SUSPEND_MEM: | 128 | case PM_SUSPEND_MEM: |
129 | case PM_SUSPEND_STANDBY: | ||
129 | return 0; | 130 | return 0; |
130 | default: | 131 | default: |
131 | return -EINVAL; | 132 | return -EINVAL; |
@@ -138,7 +139,10 @@ void pxa_cpu_pm_enter(suspend_state_t state) | |||
138 | extern void pxa_cpu_suspend(unsigned int); | 139 | extern void pxa_cpu_suspend(unsigned int); |
139 | extern void pxa_cpu_resume(void); | 140 | extern void pxa_cpu_resume(void); |
140 | 141 | ||
141 | CKEN = CKEN22_MEMC | CKEN9_OSTIMER; | 142 | if (state == PM_SUSPEND_STANDBY) |
143 | CKEN = CKEN22_MEMC | CKEN9_OSTIMER | CKEN16_LCD |CKEN0_PWM0; | ||
144 | else | ||
145 | CKEN = CKEN22_MEMC | CKEN9_OSTIMER; | ||
142 | 146 | ||
143 | /* ensure voltage-change sequencer not initiated, which hangs */ | 147 | /* ensure voltage-change sequencer not initiated, which hangs */ |
144 | PCFR &= ~PCFR_FVC; | 148 | PCFR &= ~PCFR_FVC; |
@@ -147,6 +151,9 @@ void pxa_cpu_pm_enter(suspend_state_t state) | |||
147 | PEDR = 0xDF12FE1B; | 151 | PEDR = 0xDF12FE1B; |
148 | 152 | ||
149 | switch (state) { | 153 | switch (state) { |
154 | case PM_SUSPEND_STANDBY: | ||
155 | pxa_cpu_standby(); | ||
156 | break; | ||
150 | case PM_SUSPEND_MEM: | 157 | case PM_SUSPEND_MEM: |
151 | /* set resume return address */ | 158 | /* set resume return address */ |
152 | PSPR = virt_to_phys(pxa_cpu_resume); | 159 | PSPR = virt_to_phys(pxa_cpu_resume); |
diff --git a/arch/arm/mach-pxa/standby.S b/arch/arm/mach-pxa/standby.S new file mode 100644 index 000000000000..8a3f27b76784 --- /dev/null +++ b/arch/arm/mach-pxa/standby.S | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * PXA27x standby mode | ||
3 | * | ||
4 | * Author: David Burrage | ||
5 | * | ||
6 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | */ | ||
11 | |||
12 | #include <linux/config.h> | ||
13 | #include <linux/linkage.h> | ||
14 | #include <asm/assembler.h> | ||
15 | #include <asm/hardware.h> | ||
16 | |||
17 | #include <asm/arch/pxa-regs.h> | ||
18 | |||
19 | .text | ||
20 | |||
21 | ENTRY(pxa_cpu_standby) | ||
22 | ldr r0, =PSSR | ||
23 | mov r1, #(PSSR_PH | PSSR_STS) | ||
24 | mov r2, #2 | ||
25 | mov r3, #UNCACHED_PHYS_0 @ Read mem context in. | ||
26 | ldr ip, [r3] | ||
27 | b 1f | ||
28 | |||
29 | .align 5 | ||
30 | 1: mcr p14, 0, r2, c7, c0, 0 @ put the system into Standby | ||
31 | str r1, [r0] @ make sure PSSR_PH/STS are clear | ||
32 | mov pc, lr | ||
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index b5e54a9e9fa7..803dc92c9038 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -1505,6 +1505,7 @@ | |||
1505 | #define PSSR_OTGPH (1 << 6) /* OTG Peripheral control Hold */ | 1505 | #define PSSR_OTGPH (1 << 6) /* OTG Peripheral control Hold */ |
1506 | #define PSSR_RDH (1 << 5) /* Read Disable Hold */ | 1506 | #define PSSR_RDH (1 << 5) /* Read Disable Hold */ |
1507 | #define PSSR_PH (1 << 4) /* Peripheral Control Hold */ | 1507 | #define PSSR_PH (1 << 4) /* Peripheral Control Hold */ |
1508 | #define PSSR_STS (1 << 3) /* Standby Mode Status */ | ||
1508 | #define PSSR_VFS (1 << 2) /* VDD Fault Status */ | 1509 | #define PSSR_VFS (1 << 2) /* VDD Fault Status */ |
1509 | #define PSSR_BFS (1 << 1) /* Battery Fault Status */ | 1510 | #define PSSR_BFS (1 << 1) /* Battery Fault Status */ |
1510 | #define PSSR_SSS (1 << 0) /* Software Sleep Status */ | 1511 | #define PSSR_SSS (1 << 0) /* Software Sleep Status */ |