summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYork Sun <yorksun@freescale.com>2014-03-31 21:40:32 (GMT)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-04-07 20:19:00 (GMT)
commit88590148fa8b7e2d7ca910a7a03b5c5700af58e4 (patch)
treef7e4f3bf60c3fc2446fafb779a5bc560a2ce452f /arch
parent0883b0b58eac1a82e4c332f4506cdaeb92e09727 (diff)
downloadu-boot-fsl-qoriq-88590148fa8b7e2d7ca910a7a03b5c5700af58e4.tar.xz
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>
Diffstat (limited to 'arch')
-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 a8295bf..9782ddb 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();