mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Tretter <m.tretter@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	 Steffen Trumtrar <s.trumtrar@pengutronix.de>,
	 BAREBOX <barebox@lists.infradead.org>
Cc: Michael Tretter <m.tretter@pengutronix.de>
Subject: [PATCH] mci: cadence: fix device tree override of host_caps
Date: Thu, 09 Apr 2026 16:15:09 +0200	[thread overview]
Message-ID: <20260409-socfpga-agilex5-sdhci-v1-1-d1753ac5defa@pengutronix.de> (raw)

The host_caps setting in the device tree shall override the default
host_caps set by the driver to allow board specific overrides.

Move the configuration of the driver default host_caps before the call
to mci_of_parse().

mci_of_parse() still has to be called in the middle of the mci
configuration, because f_max may be set in the device tree, but is used
to calculate f_min.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
 drivers/mci/cadence-sdhci.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mci/cadence-sdhci.c b/drivers/mci/cadence-sdhci.c
index ccd0f36cb033..b76c04f5e087 100644
--- a/drivers/mci/cadence-sdhci.c
+++ b/drivers/mci/cadence-sdhci.c
@@ -471,13 +471,14 @@ static int sdhci_cdns_probe(struct device *dev)
 
 	dev->priv = priv;
 
+	priv->mci.voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
+	priv->mci.host_caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
+	priv->mci.host_caps |= MMC_CAP_MMC_HIGHSPEED_52MHZ;
+
 	priv->mci.f_max = clk_get_rate(priv->biu_clk);
 	mci_of_parse(mci);
 	priv->mci.f_min = priv->mci.f_max / SDHCI_MAX_DIV_SPEC_300;
 
-	priv->mci.voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
-	priv->mci.host_caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
-	priv->mci.host_caps |= MMC_CAP_MMC_HIGHSPEED_52MHZ;
 	if (is_sd4hc) {
 		ret = sdhci_cdns4_phy_probe(dev, priv);
 	} else {

---
base-commit: 86269eff785a915cfb96f09d9c7ec81a89d33012
change-id: 20260409-socfpga-agilex5-sdhci-d4179764d02f

Best regards,
-- 
Michael Tretter <m.tretter@pengutronix.de>




             reply	other threads:[~2026-04-09 14:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 14:15 Michael Tretter [this message]
2026-04-10  7:19 ` Ahmad Fatoum
2026-04-13  7:03 ` 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=20260409-socfpga-agilex5-sdhci-v1-1-d1753ac5defa@pengutronix.de \
    --to=m.tretter@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    --cc=s.trumtrar@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