aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap2/pm.h2
-rw-r--r--arch/arm/mach-omap2/pm34xx.c5
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S30
3 files changed, 36 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 8d9aa3e0f635..5e0bee961850 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -90,8 +90,10 @@ extern unsigned int omap34xx_cpu_suspend_sz;
90#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) 90#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
91extern u16 pm34xx_errata; 91extern u16 pm34xx_errata;
92#define IS_PM34XX_ERRATUM(id) (pm34xx_errata & (id)) 92#define IS_PM34XX_ERRATUM(id) (pm34xx_errata & (id))
93extern void enable_omap3630_toggle_l2_on_restore(void);
93#else 94#else
94#define IS_PM34XX_ERRATUM(id) 0 95#define IS_PM34XX_ERRATUM(id) 0
96static inline void enable_omap3630_toggle_l2_on_restore(void) { }
95#endif /* defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) */ 97#endif /* defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) */
96 98
97#endif 99#endif
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 7dbc00005464..96e309d44e14 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -996,8 +996,11 @@ void omap_push_sram_idle(void)
996 996
997static void __init pm_errata_configure(void) 997static void __init pm_errata_configure(void)
998{ 998{
999 if (cpu_is_omap3630()) 999 if (cpu_is_omap3630()) {
1000 pm34xx_errata |= PM_RTA_ERRATUM_i608; 1000 pm34xx_errata |= PM_RTA_ERRATUM_i608;
1001 /* Enable the l2 cache toggling in sleep logic */
1002 enable_omap3630_toggle_l2_on_restore();
1003 }
1001} 1004}
1002 1005
1003static int __init omap3_pm_init(void) 1006static int __init omap3_pm_init(void)
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 */
119ENTRY(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 */
115ENTRY(get_es3_restore_pointer) 128ENTRY(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
306skipl2dis:
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)
345logic_l1_restore: 366logic_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
373skipl2reen:
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
680kernel_flush: 708kernel_flush:
681 .word v7_flush_dcache_all 709 .word v7_flush_dcache_all
710l2dis_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!