Commit 88590148fa8b7e2d7ca910a7a03b5c5700af58e4

Authored by York Sun
Committed by Albert ARIBAUD
1 parent 0883b0b58e

armv8: Flush dcache before switching to EL2

For ARMv8, U-boot has been running at EL3 with cache and MMU enabled.
Without proper setup for EL2, cache and MMU are both disabled (out of
reset). Before switching, we need to flush the dcache to make sure the
data is in the main memory.

Signed-off-by: York Sun <yorksun@freescale.com>
Acked-by: David.Feng <fenghua@phytium.com.cn>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

arch/arm/lib/bootm.c
... ... @@ -199,6 +199,7 @@
199 199  
200 200 #ifdef CONFIG_ARM64
201 201 smp_kick_all_cpus();
  202 + flush_dcache_all(); /* flush cache before swtiching to EL2 */
202 203 armv8_switch_to_el2();
203 204 #ifdef CONFIG_ARMV8_SWITCH_TO_EL1
204 205 armv8_switch_to_el1();