From patchwork Wed Aug 10 07:08:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 73611 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp267705qga; Wed, 10 Aug 2016 00:35:03 -0700 (PDT) X-Received: by 10.194.77.174 with SMTP id t14mr2811951wjw.146.1470814503822; Wed, 10 Aug 2016 00:35:03 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id vi10si38536725wjb.278.2016.08.10.00.35.03; Wed, 10 Aug 2016 00:35:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E5BB44BA16; Wed, 10 Aug 2016 09:35:02 +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 7uY2qRL6Zqic; Wed, 10 Aug 2016 09:35:02 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AE8BBA756E; Wed, 10 Aug 2016 09:26:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5F1484BA5C for ; Wed, 10 Aug 2016 09:07: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 D154oh2scdv3 for ; Wed, 10 Aug 2016 09:07:45 +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 conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by theia.denx.de (Postfix) with ESMTPS id 988C0A7521 for ; Wed, 10 Aug 2016 09:07:22 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id u7A76xSs005792; Wed, 10 Aug 2016 16:07:03 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com u7A76xSs005792 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1470812823; bh=Alqt30LU/7vru4yyQG/1zReRuG2/0fXPIRdQ3U1oYRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oD6L/8KzZnqwHa9L9TCmXJm1prlyo0SCt5Z9hKeLjDB1EtdaRs4pJ7ZAOoUMADFdG zYnocVUNoN8YGb4eY+diYnpTZj67x4r+1MYda81icWxMj65xhQeFjKxfN/hxuuBUwg /HtfL4AVY5TUB0OizIFrXEbpzs6ROGhHgw585evxcoaxtfMFm6SdGLLmrr5ciI0z9P 8siazRHUg0FCOL0+jN1KEed3iUiPx5xgPfHXNcPj+MbSclK8qUvWpwzBxzlFi5dBLv NLoYqt40CqeFf37uGEm+7JQKBrAdfZMzQGieqsPAzT+JLjJi5vV0StmbdfaZBhPYqP cH1Gwsps0wImA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 10 Aug 2016 16:08:42 +0900 Message-Id: <1470812929-21178-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470812929-21178-1-git-send-email-yamada.masahiro@socionext.com> References: <1470812929-21178-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 07/14] ARM: uniphier: export uniphier_cache_enable/disable functions 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" The System Cache (outer cache) is used not only as L2 cache, but also as locked SRAM. The functions for turning on/off it is necessary whether the L2 cache is enabled or not. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/arm32/cache-uniphier.c | 34 +++++++++++++++++++-------- arch/arm/mach-uniphier/arm32/cache-uniphier.h | 2 ++ 2 files changed, 26 insertions(+), 10 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/arch/arm/mach-uniphier/arm32/cache-uniphier.c b/arch/arm/mach-uniphier/arm32/cache-uniphier.c index 66e9f6b..4bb7d95 100644 --- a/arch/arm/mach-uniphier/arm32/cache-uniphier.c +++ b/arch/arm/mach-uniphier/arm32/cache-uniphier.c @@ -130,6 +130,28 @@ void uniphier_cache_touch_zero_range(u32 start, u32 end, u32 ways) UNIPHIER_SSCOQM_CM_TOUCH_ZERO); } +static void uniphier_cache_endisable(int enable) +{ + u32 tmp; + + tmp = readl(UNIPHIER_SSCC); + if (enable) + tmp |= UNIPHIER_SSCC_ON; + else + tmp &= ~UNIPHIER_SSCC_ON; + writel(tmp, UNIPHIER_SSCC); +} + +void uniphier_cache_enable(void) +{ + uniphier_cache_endisable(1); +} + +void uniphier_cache_disable(void) +{ + uniphier_cache_endisable(0); +} + #ifdef CONFIG_UNIPHIER_L2CACHE_ON void v7_outer_cache_flush_all(void) { @@ -176,21 +198,13 @@ void v7_outer_cache_inval_range(u32 start, u32 end) void v7_outer_cache_enable(void) { - u32 tmp; - writel(U32_MAX, UNIPHIER_SSCLPDAWCR); /* activate all ways */ - tmp = readl(UNIPHIER_SSCC); - tmp |= UNIPHIER_SSCC_ON; - writel(tmp, UNIPHIER_SSCC); + uniphier_cache_enable(); } void v7_outer_cache_disable(void) { - u32 tmp; - - tmp = readl(UNIPHIER_SSCC); - tmp &= ~UNIPHIER_SSCC_ON; - writel(tmp, UNIPHIER_SSCC); + uniphier_cache_disable(); } #endif diff --git a/arch/arm/mach-uniphier/arm32/cache-uniphier.h b/arch/arm/mach-uniphier/arm32/cache-uniphier.h index f67f6ae..733cd80 100644 --- a/arch/arm/mach-uniphier/arm32/cache-uniphier.h +++ b/arch/arm/mach-uniphier/arm32/cache-uniphier.h @@ -13,5 +13,7 @@ void uniphier_cache_prefetch_range(u32 start, u32 end, u32 ways); void uniphier_cache_touch_range(u32 start, u32 end, u32 ways); void uniphier_cache_touch_zero_range(u32 start, u32 end, u32 ways); +void uniphier_cache_enable(void); +void uniphier_cache_disable(void); #endif /* __CACHE_UNIPHIER_H */