aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/sleep.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/sleep.S')
-rw-r--r--arch/arm/mach-pxa/sleep.S56
1 files changed, 50 insertions, 6 deletions
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
index 16cad2c2497c..5786ccad938c 100644
--- a/arch/arm/mach-pxa/sleep.S
+++ b/arch/arm/mach-pxa/sleep.S
@@ -18,6 +18,11 @@
18 18
19#include <asm/arch/pxa-regs.h> 19#include <asm/arch/pxa-regs.h>
20 20
21#ifdef CONFIG_PXA27x // workaround for Errata 50
22#define MDREFR_KDIV 0x200a4000 // all banks
23#define CCCR_SLEEP 0x00000107 // L=7 2N=2 A=0 PPDIS=0 CPDIS=0
24#endif
25
21 .text 26 .text
22 27
23/* 28/*
@@ -28,7 +33,9 @@
28 33
29ENTRY(pxa_cpu_suspend) 34ENTRY(pxa_cpu_suspend)
30 35
36#ifndef CONFIG_IWMMXT
31 mra r2, r3, acc0 37 mra r2, r3, acc0
38#endif
32 stmfd sp!, {r2 - r12, lr} @ save registers on stack 39 stmfd sp!, {r2 - r12, lr} @ save registers on stack
33 40
34 @ get coprocessor registers 41 @ get coprocessor registers
@@ -61,14 +68,23 @@ ENTRY(pxa_cpu_suspend)
61 @ prepare value for sleep mode 68 @ prepare value for sleep mode
62 mov r1, #3 @ sleep mode 69 mov r1, #3 @ sleep mode
63 70
64 @ prepare to put SDRAM into self-refresh manually 71 @ prepare pointer to physical address 0 (virtual mapping in generic.c)
72 mov r2, #UNCACHED_PHYS_0
73
74 @ prepare SDRAM refresh settings
65 ldr r4, =MDREFR 75 ldr r4, =MDREFR
66 ldr r5, [r4] 76 ldr r5, [r4]
77
78 @ enable SDRAM self-refresh mode
67 orr r5, r5, #MDREFR_SLFRSH 79 orr r5, r5, #MDREFR_SLFRSH
68 80
69 @ prepare pointer to physical address 0 (virtual mapping in generic.c) 81#ifdef CONFIG_PXA27x
70 mov r2, #UNCACHED_PHYS_0 82 @ set SDCLKx divide-by-2 bits (this is part of a workaround for Errata 50)
83 ldr r6, =MDREFR_KDIV
84 orr r5, r5, r6
85#endif
71 86
87#ifdef CONFIG_PXA25x
72 @ Intel PXA255 Specification Update notes problems 88 @ Intel PXA255 Specification Update notes problems
73 @ about suspending with PXBus operating above 133MHz 89 @ about suspending with PXBus operating above 133MHz
74 @ (see Errata 31, GPIO output signals, ... unpredictable in sleep 90 @ (see Errata 31, GPIO output signals, ... unpredictable in sleep
@@ -100,6 +116,18 @@ ENTRY(pxa_cpu_suspend)
100 mov r0, #0 116 mov r0, #0
101 mcr p14, 0, r0, c6, c0, 0 117 mcr p14, 0, r0, c6, c0, 0
102 orr r0, r0, #2 @ initiate change bit 118 orr r0, r0, #2 @ initiate change bit
119#endif
120#ifdef CONFIG_PXA27x
121 @ Intel PXA270 Specification Update notes problems sleeping
122 @ with core operating above 91 MHz
123 @ (see Errata 50, ...processor does not exit from sleep...)
124
125 ldr r6, =CCCR
126 ldr r8, [r6] @ keep original value for resume
127
128 ldr r7, =CCCR_SLEEP @ prepare CCCR sleep value
129 mov r0, #0x2 @ prepare value for CLKCFG
130#endif
103 131
104 @ align execution to a cache line 132 @ align execution to a cache line
105 b 1f 133 b 1f
@@ -111,6 +139,7 @@ ENTRY(pxa_cpu_suspend)
111 @ All needed values are now in registers. 139 @ All needed values are now in registers.
112 @ These last instructions should be in cache 140 @ These last instructions should be in cache
113 141
142#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
114 @ initiate the frequency change... 143 @ initiate the frequency change...
115 str r7, [r6] 144 str r7, [r6]
116 mcr p14, 0, r0, c6, c0, 0 145 mcr p14, 0, r0, c6, c0, 0
@@ -118,14 +147,27 @@ ENTRY(pxa_cpu_suspend)
118 @ restore the original cpu speed value for resume 147 @ restore the original cpu speed value for resume
119 str r8, [r6] 148 str r8, [r6]
120 149
121 @ put SDRAM into self-refresh 150 @ need 6 13-MHz cycles before changing PWRMODE
122 str r5, [r4] 151 @ just set frequency to 91-MHz... 6*91/13 = 42
152
153 mov r0, #42
15410: subs r0, r0, #1
155 bne 10b
156#endif
157
158 @ Do not reorder...
159 @ Intel PXA270 Specification Update notes problems performing
160 @ external accesses after SDRAM is put in self-refresh mode
161 @ (see Errata 39 ...hangs when entering self-refresh mode)
123 162
124 @ force address lines low by reading at physical address 0 163 @ force address lines low by reading at physical address 0
125 ldr r3, [r2] 164 ldr r3, [r2]
126 165
166 @ put SDRAM into self-refresh
167 str r5, [r4]
168
127 @ enter sleep mode 169 @ enter sleep mode
128 mcr p14, 0, r1, c7, c0, 0 170 mcr p14, 0, r1, c7, c0, 0 @ PWRMODE
129 171
13020: b 20b @ loop waiting for sleep 17220: b 20b @ loop waiting for sleep
131 173
@@ -188,7 +230,9 @@ resume_after_mmu:
188 bl cpu_xscale_proc_init 230 bl cpu_xscale_proc_init
189#endif 231#endif
190 ldmfd sp!, {r2, r3} 232 ldmfd sp!, {r2, r3}
233#ifndef CONFIG_IWMMXT
191 mar acc0, r2, r3 234 mar acc0, r2, r3
235#endif
192 ldmfd sp!, {r4 - r12, pc} @ return to caller 236 ldmfd sp!, {r4 - r12, pc} @ return to caller
193 237
194 238