From patchwork Mon Jun 13 05:55:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 9172013 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 3B51F60573 for ; Mon, 13 Jun 2016 05:57:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FC20200E7 for ; Mon, 13 Jun 2016 05:57:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 249F925EF7; Mon, 13 Jun 2016 05:57:41 +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 DCA08200E7 for ; Mon, 13 Jun 2016 05:57:40 +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 1bCKrG-00045t-GA; Mon, 13 Jun 2016 05:56:22 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCKr2-0003wz-VA for linux-arm-kernel@lists.infradead.org; Mon, 13 Jun 2016 05:56:09 +0000 Received: by mail-pf0-x241.google.com with SMTP id 66so7997512pfy.1 for ; Sun, 12 Jun 2016 22:55:50 -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=hqLfqUsrlDtClv/WaAbGpN5571Ij5b7TZbn5SvFCvYA=; b=zt1S0R0415C1XuVOiap6V94MDjrkR6tYHTV6qRsRAm6VGD6/dWJ01ByVeMlnVw5XLx ZYz1OlXViQIjk4vzIlKbaS63BUz2BFzbjfmlESfWZZBwPwQq9g8SjtzK2fjIuftJVMEJ RU13LNWL6O/yulhCC2TXHVkZmFVIYRagmRtbPOTWUXcQO1QKF95Zd4sfGT/cUSO/QQey 21I/0GQoj77GoSZdRQ2DXaHSGs7Pyjn2lamOFikfk7svY8TlNIV18ZaJAtoLwPrRa5Gm yrG7ePclOIiJ51X2XHBnDJ/9eoZbVYompeLQwlK5d++LUlQX9bbTwrYaUQHvVeaVMR+O 1+oA== 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=hqLfqUsrlDtClv/WaAbGpN5571Ij5b7TZbn5SvFCvYA=; b=KSURyMetIags723OafOQ1Ri0ALyIcb5lj0xkuv9gbUr8z7X/6JwgUPcxkdybikYg2p 5z5ZnFxc8CsZJaTRIlm/ERHvsmxp68y8jtQZVwPGI+Z9bWx7p09DCKHdEf0WNsGoClGC U1VsC0BczBD+7rmWP1CTheXKP0J54OPLXS2JiorCKYA4cIKEU4n1RUExu2EqzQEJwGeI 1vEFwEFzytb9XRkZ5MIp36gKKq/S9RxwPthxXKj6zUZBE5BfGEGks7RIRVbWylytTrov s+nownTVguWJDOejv8mxZgL4fRdBI/BnlNa56GqiyWSV+7zAphok9wL+p9f240nBB4Ze MQhg== X-Gm-Message-State: ALyK8tIRZo+e+TOKyuiKLxUtWPI0RGjvCNqeVzyLr+e7AgKvXvEshI4whXhFj8bEsdj5Cg== X-Received: by 10.98.34.15 with SMTP id i15mr19838606pfi.29.1465797349020; Sun, 12 Jun 2016 22:55:49 -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 fl1sm34039523pab.43.2016.06.12.22.55.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jun 2016 22:55:48 -0700 (PDT) From: Andrey Smirnov To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3] i.MX: system.c: Replace magic numbers Date: Sun, 12 Jun 2016 22:55:29 -0700 Message-Id: <1465797329-22537-3-git-send-email-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465797329-22537-1-git-send-email-andrew.smirnov@gmail.com> References: <1465797329-22537-1-git-send-email-andrew.smirnov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160612_225609_044077_F0F71CF8 X-CRM114-Status: GOOD ( 10.54 ) 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: Andrey Smirnov , Shawn Guo , Russell King , linux-kernel@vger.kernel.org, Sascha Hauer 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 Signed-off-by: Andrey Smirnov --- RESEND, now with Russell King on CC list. arch/arm/include/asm/hardware/cache-l2x0.h | 7 +++++++ arch/arm/mach-imx/system.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h index 3a5ec1c..5e27162 100644 --- a/arch/arm/include/asm/hardware/cache-l2x0.h +++ b/arch/arm/include/asm/hardware/cache-l2x0.h @@ -61,6 +61,13 @@ #define L2X0_LINE_TAG 0xF30 #define L2X0_DEBUG_CTRL 0xF40 #define L310_PREFETCH_CTRL 0xF60 +#define L310_DOUBLE_LINEFILL_EN BIT(30) +#define L310_INSTRUCTION_PREFETCH_EN BIT(29) +#define L310_DATA_PREFETCH_EN BIT(28) +#define L310_DOUBLE_LINEFILL_ON_WRAP_READ_DIS BIT(27) +#define L310_PREFETCH_DROP_EN BIT(24) +#define L310_INCR_DOUBLE_LINEFILL_EN BIT(23) +#define L310_ESCLUSIVE_SEQUENCE_EN BIT(21) #define L310_POWER_CTRL 0xF80 #define L310_DYNAMIC_CLK_GATING_EN (1 << 1) #define L310_STNDBY_MODE_EN (1 << 0) diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c index b153376..bd9a96b 100644 --- a/arch/arm/mach-imx/system.c +++ b/arch/arm/mach-imx/system.c @@ -109,7 +109,10 @@ void __init imx_init_l2cache(void) if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) { /* Configure the L2 PREFETCH and POWER registers */ val = readl_relaxed(l2x0_base + L310_PREFETCH_CTRL); - val |= 0x70800000; + val |= L310_DOUBLE_LINEFILL_EN | + L310_INSTRUCTION_PREFETCH_EN | + L310_DATA_PREFETCH_EN | + L310_INCR_DOUBLE_LINEFILL_EN; writel_relaxed(val, l2x0_base + L310_PREFETCH_CTRL); }