msm: idle-v7: Write Krait-specific bits before WFI

Certain variants of the Krait processor require a
modification of an implementation-defined register prior to
executing the WFI instruction.

Change-Id: I6f0ff0b7622f00003d6e80e04514883d75a715a2
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
This commit is contained in:
Stepan Moskovchenko 2012-07-03 19:10:44 -07:00 committed by Stephen Boyd
parent 4286d98937
commit 55002bbe2a

View file

@ -28,6 +28,35 @@
#endif
ENTRY(msm_arch_idle)
#ifdef CONFIG_ARCH_MSM_KRAIT
mrc p15, 0, r0, c0, c0, 0
bic r1, r0, #0xff
movw r2, #0x0400
movt r2, #0x511F
movw r3, #0x0600
movt r3, #0x510F
cmp r2, r1
cmpne r3, r1
bne go_wfi
mrs r0, cpsr
cpsid if
mrc p15, 7, r1, c15, c0, 5
bic r2, r1, #0x20000
mcr p15, 7, r2, c15, c0, 5
isb
go_wfi:
wfi
bne wfi_done
mcr p15, 7, r1, c15, c0, 5
isb
msr cpsr_c, r0
wfi_done:
bx lr
#else
wfi
#ifdef CONFIG_ARCH_MSM8X60
mrc p14, 1, r1, c1, c5, 4 /* read ETM PDSR to clear sticky bit */
@ -35,6 +64,7 @@ ENTRY(msm_arch_idle)
isb
#endif
bx lr
#endif
ENTRY(msm_pm_collapse)
#if defined(CONFIG_MSM_FIQ_SUPPORT)