From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 13/16] L2x0: i.MX6: Replace magic numbers with constants
Date: Tue, 15 Mar 2016 20:33:48 -0700 [thread overview]
Message-ID: <1458099232-9050-13-git-send-email-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <1458099232-9050-1-git-send-email-andrew.smirnov@gmail.com>
Use constants instead of magic numbers for PL301 registers bits in
imx6_mmu_init()
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/include/asm/cache-l2x0.h | 8 ++++++++
arch/arm/mach-imx/imx6.c | 9 ++++++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/arch/arm/include/asm/cache-l2x0.h b/arch/arm/include/asm/cache-l2x0.h
index 963dd99..9bb245b 100644
--- a/arch/arm/include/asm/cache-l2x0.h
+++ b/arch/arm/include/asm/cache-l2x0.h
@@ -56,6 +56,14 @@
#define L2X0_LINE_TAG 0xF30
#define L2X0_DEBUG_CTRL 0xF40
#define L2X0_PREFETCH_CTRL 0xF60
+#define L2X0_DOUBLE_LINEFILL_EN (1 << 30)
+#define L2X0_INSTRUCTION_PREFETCH_EN (1 << 29)
+#define L2X0_DATA_PREFETCH_EN (1 << 28)
+#define L2X0_DOUBLE_LINEFILL_ON_WRAP_READ_DIS (1 << 27)
+#define L2X0_PREFETCH_DROP_EN (1 << 24)
+#define L2X0_INCR_DOUBLE_LINEFILL_EN (1 << 23)
+#define L2X0_ESCLUSIVE_SEQUENCE_EN (1 << 21)
+
#define L2X0_POWER_CTRL 0xF80
#define L2X0_DYNAMIC_CLK_GATING_EN (1 << 1)
#define L2X0_STNDBY_MODE_EN (1 << 0)
diff --git a/arch/arm/mach-imx/imx6.c b/arch/arm/mach-imx/imx6.c
index f80334d..db1530c 100644
--- a/arch/arm/mach-imx/imx6.c
+++ b/arch/arm/mach-imx/imx6.c
@@ -217,8 +217,10 @@ static int imx6_mmu_init(void)
/* configure the PREFETCH register */
val = readl(l2x0_base + L2X0_PREFETCH_CTRL);
- val |= 0x70800000;
-
+ val |= L2X0_DOUBLE_LINEFILL_EN |
+ L2X0_INSTRUCTION_PREFETCH_EN |
+ L2X0_DATA_PREFETCH_EN |
+ L2X0_INCR_DOUBLE_LINEFILL_EN;
/*
* The L2 cache controller(PL310) version on the i.MX6D/Q is r3p1-50rel0
* The L2 cache controller(PL310) version on the i.MX6DL/SOLO/SL is r3p2
@@ -229,7 +231,8 @@ static int imx6_mmu_init(void)
* double linefill feature. This is the default behavior.
*/
if (cpu_is_mx6q())
- val &= ~(1 << 30 | 1 << 23);
+ val &= ~(L2X0_DOUBLE_LINEFILL_EN |
+ L2X0_INCR_DOUBLE_LINEFILL_EN);
writel(val, l2x0_base + L2X0_PREFETCH_CTRL);
--
2.5.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2016-03-16 3:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-16 3:33 [PATCH 01/16] i.MX6: dts: Include local .dtsi's last Andrey Smirnov
2016-03-16 3:33 ` [PATCH 02/16] clk-imx6: Call clk_enable on mmdc_ch0_axi_podf Andrey Smirnov
2016-03-16 3:33 ` [PATCH 03/16] fec_imx: Deallocate clocks when probe fails Andrey Smirnov
2016-03-16 3:33 ` [PATCH 04/16] fec_imx: Deallocate I/O resources if " Andrey Smirnov
2016-03-16 3:33 ` [PATCH 05/16] fec_imx: Free phy_reset GPIO if when " Andrey Smirnov
2016-03-16 3:33 ` [PATCH 06/16] fec_imx: Use FEC_ECNTRL_RESET instead of a magic number Andrey Smirnov
2016-03-16 3:33 ` [PATCH 07/16] fec_imx: Impelemnt reset timeout Andrey Smirnov
2016-03-16 5:46 ` Antony Pavlov
2016-03-16 3:33 ` [PATCH 08/16] fec_imx: Deallocate DMA buffers when probe fails Andrey Smirnov
2016-03-16 3:33 ` [PATCH 09/16] fec_imx: Unregister MDIO " Andrey Smirnov
2016-03-16 3:33 ` [PATCH 10/16] i.MX: Add revision detection for i.MX6D/Q Plus Andrey Smirnov
2016-03-16 3:33 ` [PATCH 11/16] ARM: Add errata 845369 workaround Andrey Smirnov
2016-03-16 3:33 ` [PATCH 12/16] i.MX6: Apply " Andrey Smirnov
2016-03-17 7:31 ` Stefan Christ
2016-03-21 16:08 ` Andrey Smirnov
2016-03-29 16:33 ` Trent Piepho
2016-03-16 3:33 ` Andrey Smirnov [this message]
2016-03-16 3:33 ` [PATCH 14/16] i.MX6: Apply PL310 errata base on PL310's revision Andrey Smirnov
2016-03-16 3:33 ` [PATCH 15/16] i.MX6: PL310: Adjust settings for performance Andrey Smirnov
2016-03-16 3:33 ` [PATCH 16/16] common: Add EPROBE_DEFER to strerror Andrey Smirnov
2016-03-17 7:25 ` [PATCH 01/16] i.MX6: dts: Include local .dtsi's last Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1458099232-9050-13-git-send-email-andrew.smirnov@gmail.com \
--to=andrew.smirnov@gmail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox