From patchwork Tue Jun 7 15:29:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 9161689 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 2F45060571 for ; Tue, 7 Jun 2016 15:31:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 215BE2521F for ; Tue, 7 Jun 2016 15:31:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 165C727248; Tue, 7 Jun 2016 15:31:48 +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 CE15A2521F for ; Tue, 7 Jun 2016 15:31: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 1bAIxY-0004EH-2t; Tue, 07 Jun 2016 15:30:28 +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 1bAIxG-0002uD-Bo for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2016 15:30:11 +0000 Received: by mail-pa0-x243.google.com with SMTP id fg1so14438896pad.3 for ; Tue, 07 Jun 2016 08:29: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=krRiflV6XcWtTzehpdSUgBM/TLSa8NEy77usZl/l7XQ=; b=EDYeOg7nRG3Nw4Q8633lG8qaQ74LGR1ylVhHkK1CN/1kbjh8XmlqaX4CKcdqr5i7v2 yqSafSjaK06m/D/swj+SBQ2bXHVykR/cJWVAwPGbeBC1jpntsesy+ar8Yb0x1kdToKNC qbgAuyinqbAUBYkJ4zvst4k76Jsp+pNY5MMEaBQmBHzY9hL+8FHN3fd6ukwHO8CfgK22 9fda0qSsoRMeLw4K6+TFswAzaiIaXDqn9vHxY6ycXibcpn82c5KAf88VL5kcq6jjBktr Gd8ipHEKoyTzVGtvpqMqDQ25duvl+Y7QuRnG52NGEGeh+GyOQeGlF2pKltKkqC4RSpMc tsWA== 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=krRiflV6XcWtTzehpdSUgBM/TLSa8NEy77usZl/l7XQ=; b=AjODA4hWdwvI6iBPQKCe9Y7uFbglKyQCG4f5BdARTma6Rs01BCN/HRZ8CpwcdF0gTz um93HDKHG3GhzXZcE8CuujaO1NaZN33I67Wi/n9/kEZq8ZEtEG36A2UOxoJ+dEbzC1s8 3R+qNXK1YJZTvUURw9pUg7on13e65HInNvhkS00WDVgJxAz/+HED8DvwOjbZAr7b9qz0 yM5O67N3MmWGb+ZEXDW2pJYAL3RFnMW6ul/1wmeYx/PGHIXHju1Fqaf23n7LT8AlNiUG Y6lPMAnmb+5tfkYeAI7MvmcazoUzoTqlgzGJrixizx0v8rr6u3AizxJcEQziHvs+w+2l 3SdQ== X-Gm-Message-State: ALyK8tKSo3p2K8fwii/rADuSUcrBDAmZQUBS/fnn3BkvWmqbU+agGFYmyZ4Kyh13jEkMiQ== X-Received: by 10.66.168.42 with SMTP id zt10mr14821pab.132.1465313389669; Tue, 07 Jun 2016 08:29: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 dr4sm33973707pac.11.2016.06.07.08.29.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jun 2016 08:29:49 -0700 (PDT) From: Andrey Smirnov To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3] i.MX: system.c: Replace magic numbers Date: Tue, 7 Jun 2016 08:29:26 -0700 Message-Id: <1465313366-5182-3-git-send-email-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465313366-5182-1-git-send-email-andrew.smirnov@gmail.com> References: <1465313366-5182-1-git-send-email-andrew.smirnov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160607_083010_435512_2FE14628 X-CRM114-Status: GOOD ( 10.93 ) 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 , 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 --- 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); }