aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYork Sun <yorksun@freescale.com>2014-03-31 14:40:32 -0700
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-04-07 22:19:00 +0200
commit88590148fa8b7e2d7ca910a7a03b5c5700af58e4 (patch)
treef7e4f3bf60c3fc2446fafb779a5bc560a2ce452f
parent0883b0b58eac1a82e4c332f4506cdaeb92e09727 (diff)
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>
-rw-r--r--arch/arm/lib/bootm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index a8295bf1f1..9782ddbb24 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -199,6 +199,7 @@ static void do_nonsec_virt_switch(void)
#ifdef CONFIG_ARM64
smp_kick_all_cpus();
+ flush_dcache_all(); /* flush cache before swtiching to EL2 */
armv8_switch_to_el2();
#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
armv8_switch_to_el1();