]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
armv8: Flush dcache before switching to EL2
authorYork Sun <yorksun@freescale.com>
Mon, 31 Mar 2014 21:40:32 +0000 (14:40 -0700)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Mon, 7 Apr 2014 20:19:00 +0000 (22:19 +0200)
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>
arch/arm/lib/bootm.c

index a8295bf1f1e1e0dd3bbd1d590e0065501b1d2dc2..9782ddbb244aa0ea41298998a7dbb384cd34f648 100644 (file)
@@ -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();