From: Joacim Zetterling <joacim.zetterling@westermo.com>
To: barebox@lists.infradead.org
Cc: a.fatoum@pengutronix.de
Subject: [PATCH 1/4] ARM: imx: Add imx8 support for 18 bit SDRAM row size handle
Date: Fri, 25 Feb 2022 15:47:48 +0100 [thread overview]
Message-ID: <20220225144751.4160843-2-joacim.zetterling@westermo.com> (raw)
In-Reply-To: <20220225144751.4160843-1-joacim.zetterling@westermo.com>
The current row calculation in imx_ddrc_sdram_size only handle a
row size up to 16 bit, the row size of the imx8mn DDR4 needs 17 bits.
We need to add DDRC_ADDRMAP7_ROW_B16 and DDRC_ADDRMAP7_ROW_B17 in
the row check table to support a 18 bit row size.
Consulting the reference manual for imx8mm, imx8mn and imx8mq derivates
for 18 bit row size support and it is fin by them.
Signed-off-by: Joacim Zetterling <joacim.zetterling@westermo.com>
---
arch/arm/mach-imx/esdctl.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index e56da3cb76d4..8e2d9e0c115c 100644
--- a/arch/arm/mach-imx/esdctl.c
+++ b/arch/arm/mach-imx/esdctl.c
@@ -427,7 +427,8 @@ static resource_size_t imx8m_ddrc_sdram_size(void __iomem *ddrc)
readl(ddrc + DDRC_ADDRMAP(4)),
readl(ddrc + DDRC_ADDRMAP(5)),
readl(ddrc + DDRC_ADDRMAP(6)),
- readl(ddrc + DDRC_ADDRMAP(7))
+ readl(ddrc + DDRC_ADDRMAP(7)),
+ readl(ddrc + DDRC_ADDRMAP(8))
};
const u8 col_b[] = {
/*
@@ -445,15 +446,8 @@ static resource_size_t imx8m_ddrc_sdram_size(void __iomem *ddrc)
FIELD_GET(DDRC_ADDRMAP2_COL_B4, addrmap[2]),
};
const u8 row_b[] = {
- /*
- * FIXME: RM mentions the following fields as being
- * present, but looking at the code generated by DDR
- * tool it doesn't look like those registers are
- * really implemented/used.
- *
- * FIELD_GET(DDRC_ADDRMAP7_ROW_B17, addrmap[7]),
- * FIELD_GET(DDRC_ADDRMAP7_ROW_B16, addrmap[7]),
- */
+ FIELD_GET(DDRC_ADDRMAP7_ROW_B17, addrmap[7]),
+ FIELD_GET(DDRC_ADDRMAP7_ROW_B16, addrmap[7]),
FIELD_GET(DDRC_ADDRMAP6_ROW_B15, addrmap[6]),
FIELD_GET(DDRC_ADDRMAP6_ROW_B14, addrmap[6]),
FIELD_GET(DDRC_ADDRMAP6_ROW_B13, addrmap[6]),
--
2.25.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2022-02-25 14:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-25 14:47 [PATCH 0/4] ARM: imx: Fix problem with imx8 SDRAM size calculation Joacim Zetterling
2022-02-25 14:47 ` Joacim Zetterling [this message]
2022-02-25 14:47 ` [PATCH 2/4] ARM: imx: Add imx8 support for SDRAM with two or more bank groups Joacim Zetterling
2022-02-25 14:47 ` [PATCH 3/4] ARM: imx: Correct mem size calculation for 4/8/16/32 bit bus width Joacim Zetterling
2022-02-25 14:47 ` [PATCH 4/4] ARM: imx: Correct bit count function Joacim Zetterling
2022-02-28 9:46 ` [PATCH 0/4] ARM: imx: Fix problem with imx8 SDRAM size calculation Sascha Hauer
2022-02-28 10:06 ` 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=20220225144751.4160843-2-joacim.zetterling@westermo.com \
--to=joacim.zetterling@westermo.com \
--cc=a.fatoum@pengutronix.de \
--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