From patchwork Wed Jun 15 01:29:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 9177217 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5042760772 for ; Wed, 15 Jun 2016 01:32:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 248A228327 for ; Wed, 15 Jun 2016 01:32:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 197062833F; Wed, 15 Jun 2016 01:32:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 42D9928327 for ; Wed, 15 Jun 2016 01:32:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCzft-0000dE-JX; Wed, 15 Jun 2016 01:31:21 +0000 Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCzf7-0008Es-W7 for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2016 01:30:34 +0000 Received: by mail-pa0-x243.google.com with SMTP id us13so348994pab.1 for ; Tue, 14 Jun 2016 18:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ukppQcq0z61X2zbh/9WENFrE3UtRYD1DQ+TdwaoR5mY=; b=nyiaeyY8hVkCzdnz2yCxKfm+xJirxGTcP3xqOZx+kBJo4tm372S+9Bo7Bk0Oq7hWdK fV1VMBSlWNIOkW29WKhHvyf8LfeV8ENlcjpvBSt/QpNLqJe7/vXrOM1d9lyH4dYeyzOF aWsmulFUcMScbCPlhpnv3npoI8t1YKA4h0XEiLg6eMpSl00R4yEKlPx2yPK6Tm7U8Jkq dC3McwZMhGs1r3mgqm0HbIK4DelTheQt77M3wqgc4fDoCAP2otd53AaxU1bpfOvghYcj N3PHaTZ/GaaoGst/nkkWXcPgqo/oCoZPQz11C7boK2mDSyb2qOol6lt6rOFmLEQsGs5Z MCbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ukppQcq0z61X2zbh/9WENFrE3UtRYD1DQ+TdwaoR5mY=; b=PLOBx0h3T7ck44WN47W80ZWJ09f/gmuaWoXCQQCWm0WgsnXqhfFcVbdX+NE4hham1y ziPngmjO4mCrf6GPXQ0S7l1438p2cyxotCiCAYe40pMiOuuCnv6TQ/hWd7DL2ONIh82N icM1Dp03zUmlWC7PPoA0ibL413ujrgA1+9kh7Ru3E+TKNxR/poDgAq7uJLkUhRhNKRpO cLGtz4Cg0saQtkOyMcyD8pwkng0vodlNgF8tlRF80FTUNzNkjLgzbmZxwLe5OfZg4Q/2 t9o2rohpWcSpWDsUFJCXmoS8mYZVOxmHLnT9dMBF1sAiuioKcCfqDtcYjK0dDYd6+J2c P0zg== X-Gm-Message-State: ALyK8tLOfmSZGDGeJwuIZesxxGnzS8H3ulm2tN06gBHUK/apD1r1j60oDQ8ARTK3afjd3w== X-Received: by 10.66.230.136 with SMTP id sy8mr786211pac.130.1465954213290; Tue, 14 Jun 2016 18:30:13 -0700 (PDT) Received: from squirtle.localdomain.localdomain (c-73-225-163-254.hsd1.wa.comcast.net. [73.225.163.254]) by smtp.gmail.com with ESMTPSA id c8sm25647274pfb.33.2016.06.14.18.30.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jun 2016 18:30:12 -0700 (PDT) From: Andrey Smirnov To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 5/6] i.MX: system.c: Tweak prefetch settings for performance Date: Tue, 14 Jun 2016 18:29:52 -0700 Message-Id: <1465954193-5894-6-git-send-email-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465954193-5894-1-git-send-email-andrew.smirnov@gmail.com> References: <1465954193-5894-1-git-send-email-andrew.smirnov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160614_183034_173560_76DC2546 X-CRM114-Status: GOOD ( 12.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King , Arnd Bergmann , Andrey Smirnov , linux-kernel@vger.kernel.org, Sascha Hauer , Shawn Guo MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Update Prefetch Control Register settings to match that of Freescale's Linux tree. As the commit e3addf1b773964eac7f797e8538c69481be4279c states (author Nitin Garg): "... set Prefetch offset to 15, since it improves memcpy performance by 35%. Don't enable Incr double Linefill enable since it adversely affects memcpy performance by about 32MB/s and reads by 90MB/s. Tested with 4K to 16MB sized src and dst aligned buffer..." Those results are also corroborated by our own testing. Tested-by: Chris Healy Signed-off-by: Andrey Smirnov --- arch/arm/mach-imx/system.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c index f0a9787..9ea01e3 100644 --- a/arch/arm/mach-imx/system.c +++ b/arch/arm/mach-imx/system.c @@ -111,8 +111,12 @@ void __init imx_init_l2cache(void) val = readl_relaxed(l2x0_base + L310_PREFETCH_CTRL); val |= L310_PREFETCH_CTRL_DBL_LINEFILL | L310_PREFETCH_CTRL_INSTR_PREFETCH | - L310_PREFETCH_CTRL_DATA_PREFETCH | - L310_PREFETCH_CTRL_DBL_LINEFILL_INCR; + L310_PREFETCH_CTRL_DATA_PREFETCH; + + /* Set perfetch offset to improve performance */ + val &= ~L310_PREFETCH_CTRL_OFFSET_MASK; + val |= 15; + writel_relaxed(val, l2x0_base + L310_PREFETCH_CTRL); }