[PATCH] cmd: mmc: Print life time info

Robert Krikke robertkrikke at gmail.com
Wed Nov 2 15:17:10 CET 2022


Added life time info:
-EXT_CSD_PRE_EOL_INFO
-EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A
-EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B

Signed-off-by: Robert Krikke <robertkrikke at gmail.com>
Reviewed-by: Harm Berntsen <harm.berntsen at nedap.com>
---
 cmd/mmc.c     | 6 ++++++
 include/mmc.h | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/cmd/mmc.c b/cmd/mmc.c
index 7bd4cd9e016..b940e320295 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -127,6 +127,12 @@ static void print_mmcinfo(struct mmc *mmc)
 			}
 			wp >>= 2;
 		}
+
+		if (mmc->version >= MMC_VERSION_5_0) {
+                	printf("Pre EOL Information: 0x%02X\n", ext_csd[EXT_CSD_PRE_EOL_INFO]);
+			printf("Life Time Estimation A: 0x%02X\n", ext_csd[EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]);
+			printf("Life Time Estimation B: 0x%02X\n", ext_csd[EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]);
+		}
 	}
 }
 
diff --git a/include/mmc.h b/include/mmc.h
index f519d869725..d0c3e684595 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -242,6 +242,9 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx)
 #define EXT_CSD_HC_ERASE_GRP_SIZE	224	/* RO */
 #define EXT_CSD_BOOT_MULT		226	/* RO */
 #define EXT_CSD_GENERIC_CMD6_TIME       248     /* RO */
+#define EXT_CSD_PRE_EOL_INFO		267	/* RO */
+#define EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A	268	/* RO */
+#define EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B	269	/* RO */
 #define EXT_CSD_BKOPS_SUPPORT		502	/* RO */
 
 /*
-- 
2.38.1



More information about the U-Boot mailing list