From patchwork Mon Apr 18 10:28:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 611647 X-Patchwork-Delegate: alexey.brodkin@gmail.com 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 3qpPXk2pnCz9s2k for ; Mon, 18 Apr 2016 20:29:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5FC81A7498; Mon, 18 Apr 2016 12:29:53 +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 swHjIyrdE3jp; Mon, 18 Apr 2016 12:29:53 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A94BAA754E; Mon, 18 Apr 2016 12:29:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7EE6AA754E for ; Mon, 18 Apr 2016 12:29:01 +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 L8rJFQtnF9tS for ; Mon, 18 Apr 2016 12:29:00 +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 smtprelay.synopsys.com (smtprelay.synopsys.com [198.182.47.9]) by theia.denx.de (Postfix) with ESMTPS id 49EFAA7498 for ; Mon, 18 Apr 2016 12:28:52 +0200 (CEST) Received: from dc8secmta1.synopsys.com (dc8secmta1.synopsys.com [10.13.218.200]) by smtprelay.synopsys.com (Postfix) with ESMTP id 4223F24E1F1D for ; Mon, 18 Apr 2016 03:28:47 -0700 (PDT) Received: from dc8secmta1.internal.synopsys.com (dc8secmta1.internal.synopsys.com [127.0.0.1]) by dc8secmta1.internal.synopsys.com (Service) with ESMTP id B6EB927113 for ; Mon, 18 Apr 2016 03:28:47 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by dc8secmta1.internal.synopsys.com (Service) with ESMTP id 9AF2D27102 for ; Mon, 18 Apr 2016 03:28:47 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 8B04E4CE; Mon, 18 Apr 2016 03:28:47 -0700 (PDT) Received: from abrodkin-7440l.internal.synopsys.com (unknown [10.121.8.96]) by mailhost.synopsys.com (Postfix) with ESMTP id AAE1E4CD; Mon, 18 Apr 2016 03:28:46 -0700 (PDT) From: Alexey Brodkin To: u-boot@lists.denx.de Date: Mon, 18 Apr 2016 13:28:39 +0300 Message-Id: <1460975319-6187-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 2.5.5 Cc: Alexey Brodkin Subject: [U-Boot] [PATCH] arc/cache: really do flush_dcache_all() even if IOC exists 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" flush_dcache_all() is used in the very end of U-Boot self relocation to write back all copied and then patched code and data to their new location in the very end of available memory space. Since that has nothing to do with IO (i.e. no external DMA happens here) IOC won't help here and we need to write back data cache contents manually. Signed-off-by: Alexey Brodkin --- arch/arc/lib/cache.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c index 56988dd..d1fb661 100644 --- a/arch/arc/lib/cache.c +++ b/arch/arc/lib/cache.c @@ -430,13 +430,10 @@ void invalidate_dcache_all(void) void flush_dcache_all(void) { -#ifdef CONFIG_ISA_ARCV2 - if (!ioc_exists) -#endif - __dc_entire_op(OP_FLUSH); + __dc_entire_op(OP_FLUSH); #ifdef CONFIG_ISA_ARCV2 - if (slc_exists && !ioc_exists) + if (slc_exists) __slc_entire_op(OP_FLUSH); #endif }