mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/2] mci: core: check for both 3.3v and 1.8v DDR support
Date: Thu, 23 Nov 2023 11:38:07 +0100	[thread overview]
Message-ID: <20231123103808.432548-1-a.fatoum@pengutronix.de> (raw)

We don't yet support the higher speed modes that require voltage
switching, so regulator interaction in barebox was so far limited to
enabling the supply. barebox also doesn't keep track what voltage the
eMMC is running on, so it doesn't know whether MMC_CAP_MMC_1_8V_DDR
or MMC_CAP_MMC_3_3V_DDR is the correct bit to check. Let's just accept
either until we add support for higher speed modes. barebox will
fallback to the non-DDR speed mode anyway if it fails to read the
ext_csd using it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mci/mci-core.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 175753cca5d7..07eca96a9d61 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1289,7 +1289,13 @@ static int mci_mmc_select_hs_ddr(struct mci *mci)
 	struct mci_host *host = mci->host;
 	int ret;
 
-	if (!(mci_caps(mci) & MMC_CAP_MMC_1_8V_DDR))
+	/*
+	 * barebox MCI core does not change voltage, so we don't know here
+	 * if we should check for the 1.8v or 3.3v mode. Until we support
+	 * higher speed modes that require voltage switching like HS200/HS400,
+	 * let's just check for either bit.
+	 */
+	if (!(mci_caps(mci) & (MMC_CAP_MMC_1_8V_DDR | MMC_CAP_MMC_3_3V_DDR)))
 		return 0;
 
 	ret = mci_mmc_try_bus_width(mci, host->bus_width, MMC_TIMING_MMC_DDR52);
-- 
2.39.2




             reply	other threads:[~2023-11-23 10:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23 10:38 Ahmad Fatoum [this message]
2023-11-23 10:38 ` [PATCH 2/2] mci: stm32_sdmmc2: enable eMMC 52MHz DDR mode Ahmad Fatoum
2023-11-23 10:54   ` Ahmad Fatoum
2023-11-23 14:54 ` [PATCH 1/2] mci: core: check for both 3.3v and 1.8v DDR support 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=20231123103808.432548-1-a.fatoum@pengutronix.de \
    --to=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