From patchwork Mon Mar 31 21:40:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: York Sun X-Patchwork-Id: 335609 X-Patchwork-Delegate: albert.aribaud@free.fr Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 7F0041400D3 for ; Tue, 1 Apr 2014 08:56:39 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C328A4B5FF; Mon, 31 Mar 2014 23:56:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MTynka5mDt16; Mon, 31 Mar 2014 23:56:37 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 51C9F4B623; Mon, 31 Mar 2014 23:56:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 89F614B623 for ; Mon, 31 Mar 2014 23:56:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rl4ovV0TGDuR for ; Mon, 31 Mar 2014 23:56:28 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from tx2outboundpool.messaging.microsoft.com (tx2ehsobe001.messaging.microsoft.com [65.55.88.11]) by theia.denx.de (Postfix) with ESMTPS id 7C8614B5FF for ; Mon, 31 Mar 2014 23:56:24 +0200 (CEST) Received: from mail29-tx2-R.bigfish.com (10.9.14.244) by TX2EHSOBE009.bigfish.com (10.9.40.29) with Microsoft SMTP Server id 14.1.225.22; Mon, 31 Mar 2014 21:41:15 +0000 Received: from mail29-tx2 (localhost [127.0.0.1]) by mail29-tx2-R.bigfish.com (Postfix) with ESMTP id 4132A2000D7; Mon, 31 Mar 2014 21:41:15 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h2189h1d1ah1d2ah21bch1fc6hzz1de098h8275bh1de097hz2dh2a8h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh2222h224fh1fb3h1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1e23h1fe8h1ff5h2218h2216h226dh22d0h24afh2327h2336h2438h2461h2487h24d7h2516h2545h255eh25cch25f6h2605h268bh1155h) Received: from mail29-tx2 (localhost.localdomain [127.0.0.1]) by mail29-tx2 (MessageSwitch) id 1396302072378098_27063; Mon, 31 Mar 2014 21:41:12 +0000 (UTC) Received: from TX2EHSMHS011.bigfish.com (unknown [10.9.14.244]) by mail29-tx2.bigfish.com (Postfix) with ESMTP id 58734400073; Mon, 31 Mar 2014 21:40:55 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS011.bigfish.com (10.9.99.111) with Microsoft SMTP Server (TLS) id 14.16.227.3; Mon, 31 Mar 2014 21:40:53 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.3.158.2; Mon, 31 Mar 2014 21:40:53 +0000 Received: from oslab-l1.am.freescale.net ([10.214.87.234]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s2VLef8V020547; Mon, 31 Mar 2014 14:40:47 -0700 From: York Sun To: Date: Mon, 31 Mar 2014 14:40:32 -0700 Message-ID: <1396302032-31292-1-git-send-email-yorksun@freescale.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-FOPE-CONNECTOR: Id%0$Dn%FREESCALE.MAIL.ONMICROSOFT.COM$RO%1$TLS%0$FQDN%$TlsDn% Cc: u-boot@lists.denx.de, York Sun Subject: [U-Boot] [PATCH] armv8: Flush dcache before switching to EL2 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Acked-by: David.Feng --- 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();