From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Mon, 7 Apr 2014 22:23:44 +0200 Subject: [U-Boot] [PATCH] armv8: Flush dcache before switching to EL2 In-Reply-To: <1396302032-31292-1-git-send-email-yorksun@freescale.com> References: <1396302032-31292-1-git-send-email-yorksun@freescale.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi York, On Mon, 31 Mar 2014 14:40:32 -0700, York Sun wrote: > 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 > --- > arch/arm/lib/bootm.c | 1 + > 1 file changed, 1 insertion(+) > > 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(); Applied as a bugfix to u-boot-arm/master, thanks! Amicalement, -- Albert.