arm: plat-samsung: check processor type before cache restoration in resume
Subsystems (3)
PATCH v3 1/1 arm: plat-samsung: check processor type before cache restoration in resume
Only cortex-a9 based samsung platforms have l2x0 cache controller. Hence check the same before restoring the cache in resume.
This is needed for single kernel image.
---
changes in v2:
- check processor midr instead of checking all soc ids as suggested by Kukjin
changes in v3:
- simplify by reading midr in assembly as per Russell
arch/arm/plat-samsung/s5p-sleep.S | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/plat-samsung/s5p-sleep.S +9 -0
@@ -25,6 +25,9 @@ #include <asm/asm-offsets.h> #include <asm/hardware/cache-l2x0.h> +#define CPU_MASK 0xff0ffff0 +#define CPU_CORTEX_A9 0x410fc090 + /* * The following code is located into the .data section. This is to * allow l2x0_regs_phys to be accessed with a relative load while we
@@ -51,6 +54,12 @@ ENTRY(s3c_cpu_resume) #ifdef CONFIG_CACHE_L2X0 + mrc p15, 0, r0, c0, c0, 0 + ldr r1, =CPU_MASK + and r0, r0, r1 + ldr r1, =CPU_CORTEX_A9 + cmp r0, r1 + bne resume_l2on adr r0, l2x0_regs_phys ldr r0, [r0] ldr r1, [r0, #L2X0_R_PHY_BASE]
Signature · 1 line
1.7.9.5
PATCH v3 1/1 arm: plat-samsung: check processor type before cache restoration in resume
Quoted 47 lines · Inderpal Singh
Only cortex-a9 based samsung platforms have l2x0 cache controller. Hence check the same before restoring the cache in resume.
This is needed for single kernel image.
Signed-off-by Inderpal Singh <[email protected]>---
changes in v2:
- check processor midr instead of checking all soc ids as suggested by Kukjinchanges in v3:
- simplify by reading midr in assembly as per Russellarch/arm/plat-samsung/s5p-sleep.S | 9 +++++++++ 1 file changed, 9 insertions(+)arch/arm/plat-samsung/s5p- renamed from arch/arm/plat-samsung/s5p-sleep.S +0
-0
sleep.S
index bdf6dad..6e15993 100644arch/arm/plat-samsung/s5p-sleep.S +9
-1@@ -25,6 +25,9 @@ #include <asm/asm-offsets.h> #include <asm/hardware/cache-l2x0.h> +#define CPU_MASK 0xff0ffff0 +#define CPU_CORTEX_A9 0x410fc090 + /* * The following code is located into the .data section. This is to * allow l2x0_regs_phys to be accessed with a relative load while we@@ -51,6 +54,12 @@ ENTRY(s3c_cpu_resume) #ifdef CONFIG_CACHE_L2X0 + mrc p15, 0, r0, c0, c0, 0 + ldr r1, =CPU_MASK + and r0, r0, r1 + ldr r1, =CPU_CORTEX_A9 + cmp r0, r1 + bne resume_l2on adr r0, l2x0_regs_phys ldr r0, [r0] ldr r1, [r0, #L2X0_R_PHY_BASE] --
Quoted 1 line
1.7.9.5
Looks good to me, applied.
Thanks.
- Kukjin