Skip to contentSkip to conversation

mmc: add support for JESD84-B51B with CSD_REV 9

PATCH In review Gregory Baudet 2 participants 2 messages Jan 30 – Feb 3 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: add support for JESD84-B51B with CSD_REV 9

This patch allows correct version detection for newer eMMC devices following the 5.1B version of the standard. This new version of the standard introduces CSD revision 9, and a new decoding rule of the MDT field in CID register.

Cc Peng Fang <[email protected]>
Cc Jaehoon Chung <[email protected]>
---
 drivers/mmc/mmc.c | 3 ++-
 include/mmc.h     | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/mmc.c +2 -1
index 7dadff27abe..d9e6860bc74 100644
@@ -2343,7 +2343,8 @@ static int mmc_startup_v4(struct mmc *mmc)
 		MMC_VERSION_4_41,
 		MMC_VERSION_4_5,
 		MMC_VERSION_5_0,
-		MMC_VERSION_5_1
+		MMC_VERSION_5_1,
+		MMC_VERSION_5_1B
 	};
 
 #if CONFIG_IS_ENABLED(MMC_TINY)
include/mmc.h +1 -0
index 51d3f2f8dd5..47b0f11877d 100644
@@ -54,6 +54,7 @@ struct bd_info;
 #define MMC_VERSION_4_5		MAKE_MMC_VERSION(4, 5, 0)
 #define MMC_VERSION_5_0		MAKE_MMC_VERSION(5, 0, 0)
 #define MMC_VERSION_5_1		MAKE_MMC_VERSION(5, 1, 0)
+#define MMC_VERSION_5_1B	MAKE_MMC_VERSION(5, 1, 1)
 
 #define MMC_CAP(mode)		(1 << mode)
 #define MMC_MODE_HS		(MMC_CAP(MMC_HS) | MMC_CAP(SD_HS))
Signature · 1 line
2.51.0
#1 lore raw
Quoted 32 lines · Gregory Baudet

This patch allows correct version detection for newer eMMC devices following the 5.1B version of the standard. This new version of the standard introduces CSD revision 9, and a new decoding rule of the MDT field in CID register.

Cc Peng Fang <[email protected]>
Cc Jaehoon Chung <[email protected]>

---
drivers/mmc/mmc.c | 3 ++-
include/mmc.h | 1 +

2 files changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/mmc.c +2 -1
index 7dadff27abe..d9e6860bc74 100644
@@ -2343,7 +2343,8 @@ static int mmc_startup_v4(struct mmc *mmc)
 		MMC_VERSION_4_41,
 		MMC_VERSION_4_5,
 		MMC_VERSION_5_0,
-		MMC_VERSION_5_1
+		MMC_VERSION_5_1,
+		MMC_VERSION_5_1B
 	};
 
 #if CONFIG_IS_ENABLED(MMC_TINY)
include/mmc.h +0 -0
index 51d3f2f8dd5..47b0f11877d 100644

include/mmc.h struct bd_info; · line 60

Quoted 7 lines
include/mmc.h +1 -0
@@ -54,6 +54,7 @@ struct bd_info;
 #define MMC_VERSION_4_5		MAKE_MMC_VERSION(4, 5, 0)
 #define MMC_VERSION_5_0		MAKE_MMC_VERSION(5, 0, 0)
 #define MMC_VERSION_5_1		MAKE_MMC_VERSION(5, 1, 0)
+#define MMC_VERSION_5_1B	MAKE_MMC_VERSION(5, 1, 1)
 
 #define MMC_CAP(mode)		(1 << mode)
 #define MMC_MODE_HS		(MMC_CAP(MMC_HS) | MMC_CAP(SD_HS))

The changes looks good to me. But I would see whether this has been tested on real devices.

Thanks,
Peng

Quoted 4 lines
Signature · 1 line
2.51.0