From patchwork Fri Nov 17 13:05:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 838983 X-Patchwork-Delegate: alexey.brodkin@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3ydddf3frJz9rxj for ; Sat, 18 Nov 2017 00:05:42 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 2ED16C21DE4; Fri, 17 Nov 2017 13:05:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id BE7F1C21C45; Fri, 17 Nov 2017 13:05:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9EB11C21DF0; Fri, 17 Nov 2017 13:05:11 +0000 (UTC) Received: from smtprelay.synopsys.com (smtprelay.synopsys.com [198.182.37.59]) by lists.denx.de (Postfix) with ESMTPS id 86325C21DED for ; Fri, 17 Nov 2017 13:05:11 +0000 (UTC) Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 692481E1429 for ; Fri, 17 Nov 2017 14:05:09 +0100 (CET) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id BDF95B3A; Fri, 17 Nov 2017 05:05:08 -0800 (PST) Received: from abrodkin-7440l.internal.synopsys.com (unknown [10.225.15.245]) by mailhost.synopsys.com (Postfix) with ESMTP id 7CA2CB2C; Fri, 17 Nov 2017 05:05:07 -0800 (PST) From: Alexey Brodkin To: u-boot@lists.denx.de Date: Fri, 17 Nov 2017 16:05:04 +0300 Message-Id: <1510923904-30782-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 2.7.5 Cc: Alexey Brodkin , Eugeniy Paltsev Subject: [U-Boot] [PATCH] arc: cache: Add required NOPs after invalidation of instruction cache X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" As per ARC HS databook (see chapter 5.3.3.2) it is required to add 3 NOPs after each write to IC_IVIC which we do from now on. Signed-off-by: Alexey Brodkin Cc: Eugeniy Paltsev --- arch/arc/lib/cache.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c index cbae27e9fcec..d8741fe959c3 100644 --- a/arch/arc/lib/cache.c +++ b/arch/arc/lib/cache.c @@ -278,6 +278,13 @@ void invalidate_icache_all(void) /* Any write to IC_IVIC register triggers invalidation of entire I$ */ if (icache_status()) { write_aux_reg(ARC_AUX_IC_IVIC, 1); + /* + * As per ARC HS databook (see chapter 5.3.3.2) + * it is required to add 3 NOPs after each write to IC_IVIC. + */ + __builtin_arc_nop(); + __builtin_arc_nop(); + __builtin_arc_nop(); read_aux_reg(ARC_AUX_IC_CTRL); /* blocks */ } }