Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] ARM: 2650/1: PXA27x sleep - workaround Errata 39 & 50 (Patch 2667)

Patch from Jeff Lackey

This patch updates arch/arm/mach-pxa/sleep.S to support
the PXA270 CPU. It works around Errata 39 & 50 from the
Intel(R) PXA27x Processor Family Specification Update.

Signed-off-by: Jeff Lackey
Signed-off-by: Russell King

authored by

Jeff Lackey and committed by
Russell King
41130d37 eec99e34

+52 -8
+52 -8
arch/arm/mach-pxa/sleep.S
··· 18 18 19 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 26 .text 22 27 23 28 /* ··· 33 28 34 29 ENTRY(pxa_cpu_suspend) 35 30 31 + #ifndef CONFIG_IWMMXT 36 32 mra r2, r3, acc0 33 + #endif 37 34 stmfd sp!, {r2 - r12, lr} @ save registers on stack 38 35 39 36 @ get coprocessor registers ··· 68 61 @ prepare value for sleep mode 69 62 mov r1, #3 @ sleep mode 70 63 71 - @ prepare to put SDRAM into self-refresh manually 72 - ldr r4, =MDREFR 73 - ldr r5, [r4] 74 - orr r5, r5, #MDREFR_SLFRSH 75 - 76 64 @ prepare pointer to physical address 0 (virtual mapping in generic.c) 77 65 mov r2, #UNCACHED_PHYS_0 78 66 67 + @ prepare SDRAM refresh settings 68 + ldr r4, =MDREFR 69 + ldr r5, [r4] 70 + 71 + @ enable SDRAM self-refresh mode 72 + orr r5, r5, #MDREFR_SLFRSH 73 + 74 + #ifdef CONFIG_PXA27x 75 + @ set SDCLKx divide-by-2 bits (this is part of a workaround for Errata 50) 76 + ldr r6, =MDREFR_KDIV 77 + orr r5, r5, r6 78 + #endif 79 + 80 + #ifdef CONFIG_PXA25x 79 81 @ Intel PXA255 Specification Update notes problems 80 82 @ about suspending with PXBus operating above 133MHz 81 83 @ (see Errata 31, GPIO output signals, ... unpredictable in sleep ··· 116 100 mov r0, #0 117 101 mcr p14, 0, r0, c6, c0, 0 118 102 orr r0, r0, #2 @ initiate change bit 103 + #endif 104 + #ifdef CONFIG_PXA27x 105 + @ Intel PXA270 Specification Update notes problems sleeping 106 + @ with core operating above 91 MHz 107 + @ (see Errata 50, ...processor does not exit from sleep...) 108 + 109 + ldr r6, =CCCR 110 + ldr r8, [r6] @ keep original value for resume 111 + 112 + ldr r7, =CCCR_SLEEP @ prepare CCCR sleep value 113 + mov r0, #0x2 @ prepare value for CLKCFG 114 + #endif 119 115 120 116 @ align execution to a cache line 121 117 b 1f ··· 139 111 @ All needed values are now in registers. 140 112 @ These last instructions should be in cache 141 113 114 + #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) 142 115 @ initiate the frequency change... 143 116 str r7, [r6] 144 117 mcr p14, 0, r0, c6, c0, 0 ··· 147 118 @ restore the original cpu speed value for resume 148 119 str r8, [r6] 149 120 150 - @ put SDRAM into self-refresh 151 - str r5, [r4] 121 + @ need 6 13-MHz cycles before changing PWRMODE 122 + @ just set frequency to 91-MHz... 6*91/13 = 42 123 + 124 + mov r0, #42 125 + 10: subs r0, r0, #1 126 + bne 10b 127 + #endif 128 + 129 + @ Do not reorder... 130 + @ Intel PXA270 Specification Update notes problems performing 131 + @ external accesses after SDRAM is put in self-refresh mode 132 + @ (see Errata 39 ...hangs when entering self-refresh mode) 152 133 153 134 @ force address lines low by reading at physical address 0 154 135 ldr r3, [r2] 155 136 137 + @ put SDRAM into self-refresh 138 + str r5, [r4] 139 + 156 140 @ enter sleep mode 157 - mcr p14, 0, r1, c7, c0, 0 141 + mcr p14, 0, r1, c7, c0, 0 @ PWRMODE 158 142 159 143 20: b 20b @ loop waiting for sleep 160 144 ··· 230 188 bl cpu_xscale_proc_init 231 189 #endif 232 190 ldmfd sp!, {r2, r3} 191 + #ifndef CONFIG_IWMMXT 233 192 mar acc0, r2, r3 193 + #endif 234 194 ldmfd sp!, {r4 - r12, pc} @ return to caller 235 195 236 196