From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: str@pengutronix.de, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master] ARM: i.MX8: esdctl: fix breakage for multi-SoC i.MX8M
Date: Wed, 13 May 2026 11:14:52 +0200 [thread overview]
Message-ID: <20260513091516.3434125-1-a.fatoum@pengutronix.de> (raw)
Only the i.MX8MP supports ECC out of the i.MX8M* family, so checking
DDRC_ECCCFG0 on the other SoCs is incorrect.
Guard the check behind a cpu_is_mx8mp(), which expands to 0 if
CONFIG_ARCH_IMX8MP is not defined and to
imx_cpu_type == IMX_CPU_IMX8MP otherwise.
Fixes: 0651254b9450 ("arm: mach-imx: esdctl.c: Add support for imx8mp inline ECC")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/mach-imx/esdctl.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index 605d5efe9bde..788459076aa2 100644
--- a/arch/arm/mach-imx/esdctl.c
+++ b/arch/arm/mach-imx/esdctl.c
@@ -14,6 +14,7 @@
#include <linux/bitfield.h>
#include <asm/barebox-arm.h>
#include <asm/memory.h>
+#include <mach/imx/generic.h>
#include <mach/imx/esdctl.h>
#include <mach/imx/esdctl-v4.h>
#include <mach/imx/imx6-mmdc.h>
@@ -1151,7 +1152,11 @@ resource_size_t imx8m_barebox_earlymem_size(unsigned buswidth)
{
resource_size_t size;
- if (imx_esdctl_ecc_enabled(IOMEM(MX8M_DDRC_CTL_BASE_ADDR)))
+ /* NOTE: This expects that imx_set_cpu_type() has been called beforehand,
+ * which the common entry points in atf.c all do. If this didn't happen,
+ * we assume ECC to not be available, which is a safe bet.
+ */
+ if (cpu_is_mx8mp() && imx_esdctl_ecc_enabled(IOMEM(MX8M_DDRC_CTL_BASE_ADDR)))
size = imx8m_ddrc_ecc_sdram_size(NULL, NULL, buswidth);
else
size = imx8m_ddrc_sdram_size(buswidth);
--
2.47.3
next reply other threads:[~2026-05-13 9:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 9:14 Ahmad Fatoum [this message]
2026-05-15 9:28 ` 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=20260513091516.3434125-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=str@pengutronix.de \
/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