From patchwork Sun Aug 16 12:01:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sjoerd Simons X-Patchwork-Id: 507845 X-Patchwork-Delegate: sjg@chromium.org 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 7E23B140134 for ; Mon, 17 Aug 2015 17:16:35 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4F5004BB68; Mon, 17 Aug 2015 09:11:45 +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 ZLhoA9Grza8x; Mon, 17 Aug 2015 09:11:45 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3CAF14BA74; Mon, 17 Aug 2015 09:10:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DAD404B61F for ; Sun, 16 Aug 2015 14:02:07 +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 h7pRFgWKe1pL for ; Sun, 16 Aug 2015 14:02:07 +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 bhuna.collabora.co.uk (bhuna.collabora.co.uk [93.93.135.160]) by theia.denx.de (Postfix) with ESMTPS id B2E354B616 for ; Sun, 16 Aug 2015 14:02:07 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sjoerd) with ESMTPSA id 5D01F609162 Received: by dusk.luon.net (Postfix, from userid 1000) id 3C96025033; Sun, 16 Aug 2015 14:01:57 +0200 (CEST) From: Sjoerd Simons To: u-boot@lists.denx.de, Simon Glass Date: Sun, 16 Aug 2015 14:01:54 +0200 Message-Id: <1439726516-5461-7-git-send-email-sjoerd.simons@collabora.co.uk> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1439726516-5461-1-git-send-email-sjoerd.simons@collabora.co.uk> References: <1439726516-5461-1-git-send-email-sjoerd.simons@collabora.co.uk> Cc: Tom Rini , Vadim Bendebury Subject: [U-Boot] [PATCH 6/8] 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: U-Boot discussion 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" 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 varoius rockchip u-boot forks (first disable d-cache then i-cache) makes things work. Signed-off-by: Sjoerd Simons Reviewed-by: Simon Glass --- 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();