From patchwork Sun Aug 30 17:31:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sjoerd Simons X-Patchwork-Id: 52873 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id AFFC72127E for ; Sun, 30 Aug 2015 17:32:14 +0000 (UTC) Received: by labip2 with SMTP id ip2sf33200730lab.1 for ; Sun, 30 Aug 2015 10:32:13 -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=YQzFqGTH7sgm2OHZvCQowHLbZ6pocvDHKYQz0Czlg+Q=; b=X526gMMzoeWIN6bpGiRf0SJ9GpBKPN6ekGNbrbhfUSdVliu6lRHJtA/h8JiiU3YJcs NObYdShTyMouQlF+N8klc9NuCKEbJ5juzNoROgvCjBQXlzYdMYljCXtXz9Bp88cqTVop Y1/y2hkMrmcXbaSJvxAypbtLrQKZFVrQAqHGVjJ/iNlt3mjoqlzhNpsKcmCykvqnaUbk yztKyY0exP3EKhufl9ut8MgJegzaWMXwQIrVjY3yDON1YxVSGIhZVv+3hhpfjbi9LAjr YcjCSU3/rfEgu4EgmXjEo3tMgExMMw52F8OZsVVkHXh5nhotJWLr+FhrSxzgeIQHKlur 3EWQ== X-Gm-Message-State: ALoCoQnsDNvWEeHFvo3sRjvbHkplS63wuIZ3sx7SCx13b4sZdQo47cTs+GbfVf9AC1apVU66/eZ8 X-Received: by 10.194.19.33 with SMTP id b1mr5255936wje.6.1440955933723; Sun, 30 Aug 2015 10:32:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.180.227 with SMTP id dr3ls385938lac.45.gmail; Sun, 30 Aug 2015 10:32:13 -0700 (PDT) X-Received: by 10.152.203.134 with SMTP id kq6mr8813724lac.106.1440955933445; Sun, 30 Aug 2015 10:32:13 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id wj1si11260553lbb.170.2015.08.30.10.32.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Aug 2015 10:32:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbcbn3 with SMTP id bn3so49852445lbc.2 for ; Sun, 30 Aug 2015 10:32:13 -0700 (PDT) X-Received: by 10.152.207.39 with SMTP id lt7mr3334842lac.88.1440955933169; Sun, 30 Aug 2015 10:32:13 -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 us2csp1167886lbb; Sun, 30 Aug 2015 10:32:12 -0700 (PDT) X-Received: by 10.194.103.103 with SMTP id fv7mr17288500wjb.152.1440955932525; Sun, 30 Aug 2015 10:32:12 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id hr15si16855313wib.118.2015.08.30.10.32.11; Sun, 30 Aug 2015 10:32:12 -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 3A1CA4B6B4; Sun, 30 Aug 2015 19:32:04 +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 WCtNGfYBkWBQ; Sun, 30 Aug 2015 19:32:04 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 04B474B719; Sun, 30 Aug 2015 19:31:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DE4054B69C for ; Sun, 30 Aug 2015 19:31:21 +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 Zsx4UheLfRIk for ; Sun, 30 Aug 2015 19:31:21 +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 9E7B74B699 for ; Sun, 30 Aug 2015 19:31:21 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sjoerd) with ESMTPSA id 190CC5188057 Received: by dusk.luon.net (Postfix, from userid 1000) id DCC7928112; Sun, 30 Aug 2015 19:31:14 +0200 (CEST) From: Sjoerd Simons To: u-boot@lists.denx.de, Simon Glass Date: Sun, 30 Aug 2015 19:31:12 +0200 Message-Id: <1440955874-25809-7-git-send-email-sjoerd.simons@collabora.co.uk> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1440955874-25809-1-git-send-email-sjoerd.simons@collabora.co.uk> References: <1440955874-25809-1-git-send-email-sjoerd.simons@collabora.co.uk> Cc: Tom Rini , Vadim Bendebury Subject: [U-Boot] [PATCH v2 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: 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sjoerd.simons@collabora.co.uk X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 --- 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();