From patchwork Mon Aug 8 18:13:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 656917 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 3s7QYJ0PlWz9t0M for ; Tue, 9 Aug 2016 04:14:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 960C3A7595; Mon, 8 Aug 2016 20:14:18 +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 XJ3df1bX8W5g; Mon, 8 Aug 2016 20:14:18 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 16780A75B9; Mon, 8 Aug 2016 20:13:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 625BBA7519 for ; Mon, 8 Aug 2016 20:13:33 +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 7Gq-itBS1pAe for ; Mon, 8 Aug 2016 20:13:33 +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 3B7B8A751E for ; Mon, 8 Aug 2016 20:13:28 +0200 (CEST) Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 9938143448E; Mon, 8 Aug 2016 19:13:28 +0100 (BST) From: Vladimir Zapolskiy To: Nobuhiro Iwamatsu Date: Mon, 8 Aug 2016 21:13:17 +0300 Message-Id: <1470680002-16354-2-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_191328_651916_AC03708B X-CRM114-Status: GOOD ( 11.45 ) Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/6] sh4: cache: correct dcache flush to invalidate with write-back 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" In common usecases flush_cache() assumes both cache invalidation and write-back to memory, thus in flush_dcache_range() implementation change SH4 cache write-back only instruction 'ocbwb' with cache purge instruction 'ocbp', according to the User's Manual there should be no performance penalty for that. Note that under circumstances only cache invalidation is expected from flush_cache() call, in these occasional cases the current version of flush_cache() works, which is a wrapper over invalidate_dcache_range() at the moment, this will be fixed in the following change. Signed-off-by: Vladimir Zapolskiy --- arch/sh/cpu/sh4/cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sh/cpu/sh4/cache.c b/arch/sh/cpu/sh4/cache.c index e1ee970..b3e5fd5 100644 --- a/arch/sh/cpu/sh4/cache.c +++ b/arch/sh/cpu/sh4/cache.c @@ -97,7 +97,7 @@ void flush_dcache_range(unsigned long start, unsigned long end) start &= ~(L1_CACHE_BYTES - 1); for (v = start; v < end; v += L1_CACHE_BYTES) { - asm volatile ("ocbwb %0" : /* no output */ + asm volatile ("ocbp %0" : /* no output */ : "m" (__m(v))); } }