From patchwork Sun Aug 30 22:55:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 52877 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by patches.linaro.org (Postfix) with ESMTPS id D6FDD22EBF for ; Sun, 30 Aug 2015 22:59:50 +0000 (UTC) Received: by lbcli1 with SMTP id li1sf32489043lbc.2 for ; Sun, 30 Aug 2015 15:59:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=lc8DmhTAmeun0GGWPwp87PWoSCmrZaIihTCi7CiLFOg=; b=MZb+nTcUceG+MZwn9bWfZEvSuRnVE6/L77Xs24+IcjqDbIBJWAENWO3VNfBSwLxt5O M6Vt/3q7aqZaJgO/P2COaZyORfbJv4s0HxqDtbbi56aYocNrJOlTSJDsMeVL4QrYNGDL N0MK80dhMTtWp5rPQ+ckLHmK5qVcvp1WNNIeqW+5CmZl9MExLIiLV8l8YT/nz46D5V5c g0FS2pEvYdKRwbprFmcD/2FHVtDu3am4J1agH1hUbWDTmhFe4N0mF2xgIbGIzA4nfonv 8CuFgrX/DJ3oMOXSlQUP12bJ4e0jEfdBs28E+6ajKBAZ4PnnKDQIzE4vjCfLgbcWVMvb hI3Q== X-Gm-Message-State: ALoCoQkoiNS3q81mEedu5hoplt/h6MajblS2T5wPg9ePE0RlBoAaEj1uGz1zwUzaBCQH5G1Dnfvo X-Received: by 10.180.12.205 with SMTP id a13mr3946024wic.4.1440975589814; Sun, 30 Aug 2015 15:59:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.9 with SMTP id j9ls424993lae.39.gmail; Sun, 30 Aug 2015 15:59:49 -0700 (PDT) X-Received: by 10.112.52.138 with SMTP id t10mr6970990lbo.99.1440975589652; Sun, 30 Aug 2015 15:59:49 -0700 (PDT) Received: from mail-la0-x229.google.com (mail-la0-x229.google.com. [2a00:1450:4010:c03::229]) by mx.google.com with ESMTPS id y12si11761291lbm.75.2015.08.30.15.59.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Aug 2015 15:59:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::229 as permitted sender) client-ip=2a00:1450:4010:c03::229; Received: by laboe4 with SMTP id oe4so34718923lab.0 for ; Sun, 30 Aug 2015 15:59:49 -0700 (PDT) X-Received: by 10.112.77.10 with SMTP id o10mr9177770lbw.73.1440975589560; Sun, 30 Aug 2015 15:59:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.151.194 with SMTP id us2csp1271124lbb; Sun, 30 Aug 2015 15:59:48 -0700 (PDT) X-Received: by 10.180.20.48 with SMTP id k16mr16808250wie.56.1440975588892; Sun, 30 Aug 2015 15:59:48 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id a9si23768782wjb.120.2015.08.30.15.59.48; Sun, 30 Aug 2015 15:59:48 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 888D74B76D; Mon, 31 Aug 2015 00:59:03 +0200 (CEST) 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 A5PZuc0stPY1; Mon, 31 Aug 2015 00:59:03 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5E38C4B712; Mon, 31 Aug 2015 00:57:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6362F4B6CE for ; Mon, 31 Aug 2015 00:56:29 +0200 (CEST) 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 9V1pEJNudLRG for ; Mon, 31 Aug 2015 00:56:29 +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 mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) by theia.denx.de (Postfix) with ESMTPS id 507384B695 for ; Mon, 31 Aug 2015 00:56:23 +0200 (CEST) Received: by iog7 with SMTP id 7so17481168iog.2 for ; Sun, 30 Aug 2015 15:56:22 -0700 (PDT) X-Received: by 10.107.151.19 with SMTP id z19mr5111532iod.95.1440975382229; Sun, 30 Aug 2015 15:56:22 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id x3sm9297931igl.2.2015.08.30.15.56.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Aug 2015 15:56:20 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id EE7A8221E31; Sun, 30 Aug 2015 16:56:11 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sun, 30 Aug 2015 16:55:49 -0600 Message-Id: <1440975352-28528-39-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.5.0.457.gab17608 In-Reply-To: <1440975352-28528-1-git-send-email-sjg@chromium.org> References: <1440975352-28528-1-git-send-email-sjg@chromium.org> Cc: huangtao , Andre Przywara , cwx Subject: [U-Boot] [PATCH v5 38/41] arm: Turn of d-cache before i-cache X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Original-Sender: sjg@chromium.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::229 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@google.com; dmarc=fail (p=NONE dis=NONE) header.from=chromium.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Sjoerd Simons Booting the kernel fails on RK3288 (and probably other rockchip SoCs) when the i-cache is disabled/flushed before d-cache. I have not investigated whether this is due to U-Boot hanging or whether it's very early in the linux boot, but following the approach of the various rockchip U-Boot forks (first disable d-cache then i-cache) makes things work. Signed-off-by: Sjoerd Simons Reviewed-by: Simon Glass Signed-off-by: Simon Glass --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None arch/arm/cpu/armv7/cpu.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c index 0b0e500..6eac5ef 100644 --- a/arch/arm/cpu/armv7/cpu.c +++ b/arch/arm/cpu/armv7/cpu.c @@ -36,12 +36,6 @@ int cleanup_before_linux_select(int flags) disable_interrupts(); #endif - /* - * Turn off I-cache and invalidate it - */ - icache_disable(); - invalidate_icache_all(); - if (flags & CBL_DISABLE_CACHES) { /* * turn off D-cache @@ -61,7 +55,16 @@ int cleanup_before_linux_select(int flags) * to avoid coherency problems for kernel */ invalidate_dcache_all(); + + icache_disable(); + invalidate_icache_all(); } else { + /* + * Turn off I-cache and invalidate it + */ + icache_disable(); + invalidate_icache_all(); + flush_dcache_all(); invalidate_icache_all(); icache_enable();