From patchwork Sun Jun 19 01:09:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 9185995 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 7DA016075F for ; Sun, 19 Jun 2016 01:11:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C1E8269A3 for ; Sun, 19 Jun 2016 01:11:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EE832793B; Sun, 19 Jun 2016 01:11:26 +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 E5921269A3 for ; Sun, 19 Jun 2016 01:11:25 +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 1bERFb-0004Bt-7A; Sun, 19 Jun 2016 01:10:11 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bERFY-0002tE-2r for linux-arm-kernel@lists.infradead.org; Sun, 19 Jun 2016 01:10:08 +0000 Received: by mail-pf0-x242.google.com with SMTP id t190so8799978pfb.2 for ; Sat, 18 Jun 2016 18:09:51 -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=Fpk6U4yIfBlf+4E2jKO3WXiPNJRJcBn75u79IrcWF+k=; b=U3UEnVY3qPi8KT3WRkiWRfDVGst3Er/OqzJeCP1LKeBkHrB3UvxFM2SN5pZXpR+92i LsyeU1Ey3Nt/Oc4Xr4wzSBfc8Au0oeZGucwno7I79RLy6tZwBVrrSfwvRsOY0jwZ9rvv JqZgpg/CXZZ2kOVazPcJaa2wP9vVI6OLT6s0L8zk+NY9qOG5PgRfKa9Hp/DWPJZwHIze ITBH7g12QUQSh4pPugwHoG52Ez+Ki+Dle6EqiC5U5SVt9RH05DO5LKIeyNeK2FnwJHrL yVXyPx5trdzOgin2dehntH30pZaMLHZctmQW/a4s9E6nGsZ5byB7y/2pmKqUfJJJg8jg KFhA== 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=Fpk6U4yIfBlf+4E2jKO3WXiPNJRJcBn75u79IrcWF+k=; b=Cqv2VdJ9AK28fEDs3doB4bIyvxjrHNNyiF58lRPQZA3aDbiHM6meSM41UFoHHEQaYZ 510j3Y+ZEedarViLS4/RNWqS+szwqjpm8bB2I2+sl16EmVw/+PA+1RgASEtOtJPrlJiv gN/Wwv9LNZCh4+qMRyZ9FCMTJKpfNU3QCsZGPdSB/GBkt4i3xctKzbSneusBSIe5fdqu I/2JdVv1FoY4/Ilj0QmlmDk1tBKnuanDqDBWZV59wcR6S0JGfdh/WW0VVW9q0fD4oXIQ L/oyck8Nti290QTBHvdddrypVziolCNRGd/wmwF+bbmFhwbSDkYYBIlTpmvzNW646G6l KBZg== X-Gm-Message-State: ALyK8tKHcr7IZqij06YBp89osJ25ohGPOS8RFI9qX3QD6ITLwYv1TALCNtMDrdeZyqzZMg== X-Received: by 10.98.106.133 with SMTP id f127mr12131447pfc.139.1466298591038; Sat, 18 Jun 2016 18:09:51 -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 ln4sm15258402pab.38.2016.06.18.18.09.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jun 2016 18:09:50 -0700 (PDT) From: Andrey Smirnov To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 4/5] i.MX: system.c: Tweak prefetch settings for performance Date: Sat, 18 Jun 2016 18:09:30 -0700 Message-Id: <1466298571-7888-5-git-send-email-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1466298571-7888-1-git-send-email-andrew.smirnov@gmail.com> References: <1466298571-7888-1-git-send-email-andrew.smirnov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160618_181008_187848_10EC37DE X-CRM114-Status: GOOD ( 11.99 ) 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 , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , 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. Acked-by: Arnd Bergmann 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 76d7ebe..bf7ab77 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); }