mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jules Maselbas <jmaselbas@zdiv.net>
To: barebox@lists.infradead.org
Cc: Jules Maselbas <jmaselbas@zdiv.net>
Subject: [PATCH] mci: core: clarify comment on MMC version detection
Date: Thu, 13 Jun 2024 15:53:38 +0200	[thread overview]
Message-ID: <20240613135338.21202-1-jmaselbas@zdiv.net> (raw)

The MMC version is read from the reserved bits 125:122 in the CSD register,
theses bits are specified as SPEC_VERS by JEDEC in the eMMC standard JESD84.

Signed-off-by: Jules Maselbas <jmaselbas@zdiv.net>
---
 drivers/mci/mci-core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index de1efe3bb9..5a8f81ecb8 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -936,15 +936,15 @@ static void mci_set_bus_width(struct mci *mci, enum mci_bus_width width)
 /**
  * Extract card's version from its CSD
  * @param mci MCI instance
- * @return 0 on success
  */
 static void mci_detect_version_from_csd(struct mci *mci)
 {
 	int version;
 
 	if (mci->version == MMC_VERSION_UNKNOWN) {
-		/* the version is coded in the bits 127:126 (left aligned) */
-		version = (mci->csd[0] >> 26) & 0xf;	/* FIXME why other width? */
+		/* this should only apply to MMC card, JESD84-B51 defines
+		 * bits 125:122 as SPEC_VER (reserved bits in CSD) */
+		version = (mci->csd[0] >> 26) & 0xf;
 
 		switch (version) {
 		case 0:
-- 
2.45.0




             reply	other threads:[~2024-06-13 13:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13 13:53 Jules Maselbas [this message]
2024-06-14  6:33 ` 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=20240613135338.21202-1-jmaselbas@zdiv.net \
    --to=jmaselbas@zdiv.net \
    --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