From: Joacim Zetterling <joacim.zetterling@westermo.com>
To: barebox@lists.infradead.org
Cc: a.fatoum@pengutronix.de
Subject: [PATCH 4/4] ARM: imx: Correct bit count function
Date: Fri, 25 Feb 2022 15:47:51 +0100 [thread overview]
Message-ID: <20220225144751.4160843-5-joacim.zetterling@westermo.com> (raw)
In-Reply-To: <20220225144751.4160843-1-joacim.zetterling@westermo.com>
Correct the imx_ddrc_count_bits which currently did a wrong
bit check (stopped after the first check).
Tested on a IMX8MN Evk with 2GB DDR4 and on a IMX8MN custom board
with 512MB LPDDR4, checked size and made memory test.
Signed-off-by: Joacim Zetterling <joacim.zetterling@westermo.com>
---
arch/arm/mach-imx/esdctl.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index 29333340318b..d3dbfff423da 100644
--- a/arch/arm/mach-imx/esdctl.c
+++ b/arch/arm/mach-imx/esdctl.c
@@ -355,8 +355,11 @@ imx_ddrc_count_bits(unsigned int bits, const u8 config[],
unsigned int config_num)
{
unsigned int i;
- for (i = 0; i < config_num && config[i] == 0b1111; i++)
- bits--;
+
+ for (i = 0; i < config_num; i++) {
+ if (config[i] == 0b1111)
+ bits--;
+ }
return bits;
}
--
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 ` [PATCH 1/4] ARM: imx: Add imx8 support for 18 bit SDRAM row size handle Joacim Zetterling
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 ` Joacim Zetterling [this message]
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-5-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