From patchwork Mon Aug 8 18:13:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 656913 X-Patchwork-Delegate: iwamatsu@nigauri.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 3s7QXF3NSqz9t0M for ; Tue, 9 Aug 2016 04:13:49 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 87708A74FB; Mon, 8 Aug 2016 20:13:44 +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 IiUYjFKWmaWk; Mon, 8 Aug 2016 20:13:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 243C4A7535; Mon, 8 Aug 2016 20:13:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D5604A751B for ; Mon, 8 Aug 2016 20:13:32 +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 15fhrcn01KlT for ; Mon, 8 Aug 2016 20:13:32 +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.mleia.com (mleia.com [178.79.152.223]) by theia.denx.de (Postfix) with ESMTPS id B21FCA74F1 for ; Mon, 8 Aug 2016 20:13:32 +0200 (CEST) Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 54EA143452F; Mon, 8 Aug 2016 19:13:30 +0100 (BST) From: Vladimir Zapolskiy To: Nobuhiro Iwamatsu Date: Mon, 8 Aug 2016 21:13:22 +0300 Message-Id: <1470680002-16354-7-git-send-email-vz@mleia.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1470680002-16354-1-git-send-email-vz@mleia.com> References: <1470680002-16354-1-git-send-email-vz@mleia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20160808_191330_370593_B78FB6BE X-CRM114-Status: GOOD ( 12.79 ) Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 6/6] sh4: cache: move exported cache manipulation functions into cache.c 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" No functional change, moving cache manipulation functions into cache.c allows to collect all of them in a single location and as a pleasant side effect cache_control() function can be unexported now. Signed-off-by: Vladimir Zapolskiy --- arch/sh/cpu/sh4/cache.c | 39 ++++++++++++++++++++++++++++++++++++--- arch/sh/cpu/sh4/cpu.c | 34 ---------------------------------- arch/sh/include/asm/cache.h | 2 -- 3 files changed, 36 insertions(+), 39 deletions(-) diff --git a/arch/sh/cpu/sh4/cache.c b/arch/sh/cpu/sh4/cache.c index 7750f0f..6175c67 100644 --- a/arch/sh/cpu/sh4/cache.c +++ b/arch/sh/cpu/sh4/cache.c @@ -1,6 +1,6 @@ /* - * (C) Copyright 2007 - * Nobuhiro Iwamatsu + * (C) Copyright 2016 Vladimir Zapolskiy + * (C) Copyright 2007 Nobuhiro Iwamatsu * * SPDX-License-Identifier: GPL-2.0+ */ @@ -35,7 +35,7 @@ static inline void cache_wback_all(void) #define CACHE_ENABLE 0 #define CACHE_DISABLE 1 -int cache_control(unsigned int cmd) +static int cache_control(unsigned int cmd) { unsigned long ccr; @@ -75,3 +75,36 @@ void invalidate_dcache_range(unsigned long start, unsigned long end) : "m" (__m(v))); } } + +void flush_cache(unsigned long addr, unsigned long size) +{ + flush_dcache_range(addr , addr + size); +} + +void icache_enable(void) +{ + cache_control(CACHE_ENABLE); +} + +void icache_disable(void) +{ + cache_control(CACHE_DISABLE); +} + +int icache_status(void) +{ + return 0; +} + +void dcache_enable(void) +{ +} + +void dcache_disable(void) +{ +} + +int dcache_status(void) +{ + return 0; +} diff --git a/arch/sh/cpu/sh4/cpu.c b/arch/sh/cpu/sh4/cpu.c index e6b5c86..aa8d4df 100644 --- a/arch/sh/cpu/sh4/cpu.c +++ b/arch/sh/cpu/sh4/cpu.c @@ -9,7 +9,6 @@ #include #include #include -#include int checkcpu(void) { @@ -35,39 +34,6 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } -void flush_cache (unsigned long addr, unsigned long size) -{ - flush_dcache_range(addr , addr + size); -} - -void icache_enable (void) -{ - cache_control(0); -} - -void icache_disable (void) -{ - cache_control(1); -} - -int icache_status (void) -{ - return 0; -} - -void dcache_enable (void) -{ -} - -void dcache_disable (void) -{ -} - -int dcache_status (void) -{ - return 0; -} - int cpu_eth_init(bd_t *bis) { #ifdef CONFIG_SH_ETHER diff --git a/arch/sh/include/asm/cache.h b/arch/sh/include/asm/cache.h index abaf405..b548a35 100644 --- a/arch/sh/include/asm/cache.h +++ b/arch/sh/include/asm/cache.h @@ -3,8 +3,6 @@ #if defined(CONFIG_CPU_SH4) -int cache_control(unsigned int cmd); - #define L1_CACHE_BYTES 32 struct __large_struct { unsigned long buf[100]; };