From patchwork Sun Mar 9 16:18:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Albert ARIBAUD X-Patchwork-Id: 328360 X-Patchwork-Delegate: albert.aribaud@free.fr 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 5CF1F2C00BA for ; Mon, 10 Mar 2014 03:19:32 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 947754B629; Sun, 9 Mar 2014 17:19:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 va-gC3zj+qu5; Sun, 9 Mar 2014 17:19:21 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 760ED4B615; Sun, 9 Mar 2014 17:19:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 08C414B600 for ; Sun, 9 Mar 2014 17:18:52 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 u2MZvXgWPBtS for ; Sun, 9 Mar 2014 17:18:46 +0100 (CET) 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 smtp1-g21.free.fr (smtp1-g21.free.fr [212.27.42.1]) by theia.denx.de (Postfix) with ESMTP id 22D9D4B605 for ; Sun, 9 Mar 2014 17:18:45 +0100 (CET) Received: from localhost.localdomain (unknown [IPv6:2a01:e35:2eb9:21:e06c:dde6:71ad:a4ee]) (Authenticated sender: aribaud.smtp) by smtp1-g21.free.fr (Postfix) with ESMTPSA id 5F1B29400B7; Sun, 9 Mar 2014 17:18:40 +0100 (CET) From: Albert ARIBAUD To: U-Boot Date: Sun, 9 Mar 2014 17:18:19 +0100 Message-Id: <1394381903-7007-2-git-send-email-albert.u.boot@aribaud.net> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1394381903-7007-1-git-send-email-albert.u.boot@aribaud.net> References: <1394381903-7007-1-git-send-email-albert.u.boot@aribaud.net> Subject: [U-Boot] [PATCH v2 1/5] arm1136: move cache code from start.S to cache.c X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de arch/arm/cpu/arm1136/start.S contain a cache flushing function. Remove the function and move its code into arch/arm/lib/cache.c. Signed-off-by: Albert ARIBAUD --- Changes in v2: None arch/arm/cpu/arm1136/start.S | 10 ---------- arch/arm/lib/cache.c | 13 ++++++++++--- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S index 3e2358e..0085754 100644 --- a/arch/arm/cpu/arm1136/start.S +++ b/arch/arm/cpu/arm1136/start.S @@ -333,14 +333,4 @@ fiq: bl do_fiq #endif - .align 5 -.global arm1136_cache_flush -arm1136_cache_flush: -#if !defined(CONFIG_SYS_ICACHE_OFF) - mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache -#endif -#if !defined(CONFIG_SYS_DCACHE_OFF) - mcr p15, 0, r1, c7, c14, 0 @ invalidate D cache -#endif - mov pc, lr @ back to caller #endif /* CONFIG_SPL_BUILD */ diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c index 6cc136a..4f6b9f0 100644 --- a/arch/arm/lib/cache.c +++ b/arch/arm/lib/cache.c @@ -12,16 +12,23 @@ void __flush_cache(unsigned long start, unsigned long size) { #if defined(CONFIG_ARM1136) - void arm1136_cache_flush(void); - arm1136_cache_flush(); +#if !defined(CONFIG_SYS_ICACHE_OFF) + asm("mcr p15, 0, r1, c7, c5, 0"); /* invalidate I cache */ #endif + +#if !defined(CONFIG_SYS_DCACHE_OFF) + asm("mcr p15, 0, r1, c7, c14, 0"); /* Clean+invalidate D cache */ +#endif + +#endif /* CONFIG_ARM1136 */ + #ifdef CONFIG_ARM926EJS /* test and clean, page 2-23 of arm926ejs manual */ asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory"); /* disable write buffer as well (page 2-22) */ asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0)); -#endif +#endif /* CONFIG_ARM926EJS */ return; } void flush_cache(unsigned long start, unsigned long size)