From patchwork Mon Aug 24 11:04:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1350260 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=zouR64TE; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BZq650Mkpz9sSJ for ; Mon, 24 Aug 2020 21:05:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 25FFB8245B; Mon, 24 Aug 2020 13:04:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1598267098; bh=POCsah3B48i3hu1hhpSsykwGLJ/VZz/U34JSXTEQr3Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=zouR64TEBwU/ZC8QB2igxxlxHKYUmeG5opV8r8GdHdaVqMIXjkNYWWXGO7ehV/13z fZRxDfqiMV1mKnEF606ymiTFKJHRm16qu22MO9X3lHQKMpGb4oMeHjaAvCLDO5vl1s UK3bwwgapJL0SOYYkogoSTEizyvwfI6ASSCW444dUjq1XTzhAq16qD7DwJke+DZFWo g8AHVmc9HfA75xRA/maQzfCrHCELybKLUUJ7IZ12v0tjaD5eZuFNHEoDirjUn8IMr7 CSi22/jZt8mTGdSdaAah/0lqbLijp5Anp4WnIcK9OVvXnPDEC5V1cNBR0mI0HK0A9v cBtCILJu9hODg== Received: by phobos.denx.de (Postfix, from userid 109) id 06D328244F; Mon, 24 Aug 2020 13:04:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mx2.mailbox.org (mx2.mailbox.org [80.241.60.215]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C6F4A822D3 for ; Mon, 24 Aug 2020 13:04:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 8F8F9A1CA6; Mon, 24 Aug 2020 13:04:48 +0200 (CEST) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id ud09kceYMUWZ; Mon, 24 Aug 2020 13:04:45 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: daniel.schwierzeck@gmail.com, cchavva@marvell.com, awilliams@marvell.com Subject: [PATCH v4 6/8] mips: octeon: cache.c: Flush all pending writes in flush_dcache_range() Date: Mon, 24 Aug 2020 13:04:41 +0200 Message-Id: <20200824110443.71860-7-sr@denx.de> In-Reply-To: <20200824110443.71860-1-sr@denx.de> References: <20200824110443.71860-1-sr@denx.de> MIME-Version: 1.0 X-MBO-SPAM-Probability: * X-Rspamd-Score: 0.83 / 15.00 / 15.00 X-Rspamd-Queue-Id: 852AA126A X-Rspamd-UID: e23182 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean As noticed while working on the USB xHCI support, Octeon needs to flush all pending writes so that the values are present in the memory. Add this "syncw" instruction (twice) to flush_dcache_range(). Signed-off-by: Stefan Roese --- (no changes since v1) arch/mips/mach-octeon/cache.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/mips/mach-octeon/cache.c b/arch/mips/mach-octeon/cache.c index 9a88bb97c7..f293d65dae 100644 --- a/arch/mips/mach-octeon/cache.c +++ b/arch/mips/mach-octeon/cache.c @@ -5,14 +5,13 @@ #include -/* - * The Octeon platform is cache coherent and cache flushes and invalidates - * are not needed. Define some platform specific empty flush_foo() - * functions here to overwrite the _weak common function as a no-op. - * This effectively disables all cache operations. - */ +/* Octeon memory write barrier */ +#define CVMX_SYNCW asm volatile ("syncw\nsyncw\n" : : : "memory") + void flush_dcache_range(ulong start_addr, ulong stop) { + /* Flush all pending writes */ + CVMX_SYNCW; } void flush_cache(ulong start_addr, ulong size) @@ -21,4 +20,5 @@ void flush_cache(ulong start_addr, ulong size) void invalidate_dcache_range(ulong start_addr, ulong stop) { + /* Don't need to do anything for OCTEON */ }