mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Kurz <akurz@blala.de>
To: barebox@lists.infradead.org
Cc: Alexander Kurz <akurz@blala.de>
Subject: [PATCH] mci: imx-esdhc-pbl: fix iMX50 prediv setting
Date: Sun,  3 Aug 2025 05:54:49 +0000	[thread overview]
Message-ID: <20250803055449.16318-1-akurz@blala.de> (raw)

The ESDHC3 instance is common between iMX50 and iMX53.
Extend the required quirk also to iMX50 fixing a problem that data could
not be written to an eMMC.

Fixes: 1713fa5bf0f9 ("mci: imx-esdhc-pbl: fix prediv setting")
Signed-off-by: Alexander Kurz <akurz@blala.de>
---
 drivers/mci/imx-esdhc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index 0ae0bb4ede..ae02d80443 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -22,6 +22,7 @@
 #include <gpio.h>
 #include <of_device.h>
 #include <mach/imx/generic.h>
+#include <mach/imx/imx50-regs.h>
 #include <mach/imx/imx53-regs.h>
 
 #include "sdhci.h"
@@ -97,8 +98,9 @@ static void set_sysctl(struct mci_host *mci, u32 clock, bool ddr)
 	if (esdhc_is_layerscape(host))
 		sdhc_clk >>= 1;
 
-	/* For i.MX53 eSDHCv3, SYSCTL.SDCLKFS may not be set to 0. */
-	if (cpu_is_mx53() && host->sdhci.base == (void *)MX53_ESDHC3_BASE_ADDR)
+	/* For i.MX50 and i.MX53 eSDHCv3, SYSCTL.SDCLKFS may not be set to 0. */
+	if ((cpu_is_mx50() && host->sdhci.base == (void *)MX50_ESDHC3_BASE_ADDR)
+	    || (cpu_is_mx53() && host->sdhci.base == (void *)MX53_ESDHC3_BASE_ADDR))
 		pre_div = 2;
 	else
 		pre_div = 1;
-- 
2.39.5




             reply	other threads:[~2025-08-03  6:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-03  5:54 Alexander Kurz [this message]
2025-08-05  5:00 ` 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=20250803055449.16318-1-akurz@blala.de \
    --to=akurz@blala.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