mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mci: core: clarify comment on MMC version detection
@ 2024-06-13 13:53 Jules Maselbas
  2024-06-14  6:33 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Jules Maselbas @ 2024-06-13 13:53 UTC (permalink / raw)
  To: barebox; +Cc: Jules Maselbas

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mci: core: clarify comment on MMC version detection
  2024-06-13 13:53 [PATCH] mci: core: clarify comment on MMC version detection Jules Maselbas
@ 2024-06-14  6:33 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-06-14  6:33 UTC (permalink / raw)
  To: barebox, Jules Maselbas


On Thu, 13 Jun 2024 15:53:38 +0200, Jules Maselbas wrote:
> 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.
> 
> 

Applied, thanks!

[1/1] mci: core: clarify comment on MMC version detection
      https://git.pengutronix.de/cgit/barebox/commit/?id=d77277c301e7 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-14  6:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-13 13:53 [PATCH] mci: core: clarify comment on MMC version detection Jules Maselbas
2024-06-14  6:33 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox