[PATCH] mci: core: clarify comment on MMC version detection

Jules Maselbas jmaselbas at zdiv.net
Thu Jun 13 06:53:38 PDT 2024


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 at 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




More information about the barebox mailing list