diff options
author | Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com> | 2010-12-20 15:05:07 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-12-21 17:45:51 -0500 |
commit | c4236d2e7913d18d058a018f0d19473eb6a11a3c (patch) | |
tree | b90600a00f6dd27eb03f7a278a5959a5f7d5b6a6 /arch/arm/mach-omap2/sleep34xx.S | |
parent | 458e999eb14a301d4176783c8fcb277f5d009b4e (diff) |
OMAP3630: PM: Disable L2 cache while invalidating L2 cache
While coming out of MPU OSWR/OFF states, L2 controller is reseted.
The reset behavior is implementation specific as per ARMv7 TRM and
hence $L2 needs to be invalidated before it's use. Since the
AUXCTRL register is also reconfigured, disable L2 cache before
invalidating it and re-enables it afterwards. This is as per
Cortex-A8 ARM documentation.
Currently this is identified as being needed on OMAP3630 as the
disable/enable is done from "public side" while, on OMAP3430, this
is done in the "secure side".
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Tony Lindgren <tony@atomide.com>
Acked-by: Jean Pihet <j-pihet@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[nm@ti.com: ported to 2.6.37-rc2, added hooks to enable the logic only on 3630]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/sleep34xx.S')
-rw-r--r-- | arch/arm/mach-omap2/sleep34xx.S | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 4abf447fddfc..50887c75a3b8 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S | |||
@@ -111,6 +111,19 @@ ENTRY(get_omap3630_restore_pointer_sz) | |||
111 | .word . - get_omap3630_restore_pointer | 111 | .word . - get_omap3630_restore_pointer |
112 | 112 | ||
113 | .text | 113 | .text |
114 | /* | ||
115 | * L2 cache needs to be toggled for stable OFF mode functionality on 3630. | ||
116 | * This function sets up a fflag that will allow for this toggling to take | ||
117 | * place on 3630. Hopefully some version in the future maynot need this | ||
118 | */ | ||
119 | ENTRY(enable_omap3630_toggle_l2_on_restore) | ||
120 | stmfd sp!, {lr} @ save registers on stack | ||
121 | /* Setup so that we will disable and enable l2 */ | ||
122 | mov r1, #0x1 | ||
123 | str r1, l2dis_3630 | ||
124 | ldmfd sp!, {pc} @ restore regs and return | ||
125 | |||
126 | .text | ||
114 | /* Function call to get the restore pointer for for ES3 to resume from OFF */ | 127 | /* Function call to get the restore pointer for for ES3 to resume from OFF */ |
115 | ENTRY(get_es3_restore_pointer) | 128 | ENTRY(get_es3_restore_pointer) |
116 | stmfd sp!, {lr} @ save registers on stack | 129 | stmfd sp!, {lr} @ save registers on stack |
@@ -283,6 +296,14 @@ restore: | |||
283 | moveq r9, #0x3 @ MPU OFF => L1 and L2 lost | 296 | moveq r9, #0x3 @ MPU OFF => L1 and L2 lost |
284 | movne r9, #0x1 @ Only L1 and L2 lost => avoid L2 invalidation | 297 | movne r9, #0x1 @ Only L1 and L2 lost => avoid L2 invalidation |
285 | bne logic_l1_restore | 298 | bne logic_l1_restore |
299 | |||
300 | ldr r0, l2dis_3630 | ||
301 | cmp r0, #0x1 @ should we disable L2 on 3630? | ||
302 | bne skipl2dis | ||
303 | mrc p15, 0, r0, c1, c0, 1 | ||
304 | bic r0, r0, #2 @ disable L2 cache | ||
305 | mcr p15, 0, r0, c1, c0, 1 | ||
306 | skipl2dis: | ||
286 | ldr r0, control_stat | 307 | ldr r0, control_stat |
287 | ldr r1, [r0] | 308 | ldr r1, [r0] |
288 | and r1, #0x700 | 309 | and r1, #0x700 |
@@ -343,6 +364,13 @@ smi: .word 0xE1600070 @ Call SMI monitor (smieq) | |||
343 | mov r12, #0x2 | 364 | mov r12, #0x2 |
344 | .word 0xE1600070 @ Call SMI monitor (smieq) | 365 | .word 0xE1600070 @ Call SMI monitor (smieq) |
345 | logic_l1_restore: | 366 | logic_l1_restore: |
367 | ldr r1, l2dis_3630 | ||
368 | cmp r1, #0x1 @ Do we need to re-enable L2 on 3630? | ||
369 | bne skipl2reen | ||
370 | mrc p15, 0, r1, c1, c0, 1 | ||
371 | orr r1, r1, #2 @ re-enable L2 cache | ||
372 | mcr p15, 0, r1, c1, c0, 1 | ||
373 | skipl2reen: | ||
346 | mov r1, #0 | 374 | mov r1, #0 |
347 | /* Invalidate all instruction caches to PoU | 375 | /* Invalidate all instruction caches to PoU |
348 | * and flush branch target cache */ | 376 | * and flush branch target cache */ |
@@ -679,6 +707,8 @@ control_mem_rta: | |||
679 | .word CONTROL_MEM_RTA_CTRL | 707 | .word CONTROL_MEM_RTA_CTRL |
680 | kernel_flush: | 708 | kernel_flush: |
681 | .word v7_flush_dcache_all | 709 | .word v7_flush_dcache_all |
710 | l2dis_3630: | ||
711 | .word 0 | ||
682 | /* | 712 | /* |
683 | * When exporting to userspace while the counters are in SRAM, | 713 | * When exporting to userspace while the counters are in SRAM, |
684 | * these 2 words need to be at the end to facilitate retrival! | 714 | * these 2 words need to be at the end to facilitate retrival! |