The enhanced user area start field is 4 bytes long according to the eMMC 4.41 spec. Signed-off-by: Ben Gardiner <bengardiner@xxxxxxxxxxxxxx> --- mmc.h | 4 ++++ mmc_cmds.c | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mmc.h b/mmc.h index 3577f42..fa46c3a 100644 --- a/mmc.h +++ b/mmc.h @@ -44,6 +44,10 @@ #define EXT_CSD_RST_N_FUNCTION 162 /* R/W */ #define EXT_CSD_PARTITIONING_SUPPORT 160 /* RO */ #define EXT_CSD_PARTITION_SETTING_COMPLETED 155 /* R/W */ +#define EXT_CSD_ENH_START_ADDR_3 139 +#define EXT_CSD_ENH_START_ADDR_2 138 +#define EXT_CSD_ENH_START_ADDR_1 137 +#define EXT_CSD_ENH_START_ADDR_0 136 #define EXT_CSD_NATIVE_SECTOR_SIZE 63 /* R */ #define EXT_CSD_USE_NATIVE_SECTOR 62 /* R/W */ #define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */ diff --git a/mmc_cmds.c b/mmc_cmds.c index a2ccc1d..21d5b4f 100644 --- a/mmc_cmds.c +++ b/mmc_cmds.c @@ -756,9 +756,13 @@ int do_read_extcsd(int nargs, char **argv) printf("Enhanced User Data Area Size" " [ENH_SIZE_MULT]: 0x%06x\n", (ext_csd[142] << 16) | (ext_csd[141] << 8) | ext_csd[140]); + + reg = (ext_csd[EXT_CSD_ENH_START_ADDR_3] << 24) | + (ext_csd[EXT_CSD_ENH_START_ADDR_2] << 16) | + (ext_csd[EXT_CSD_ENH_START_ADDR_1] << 8) | + ext_csd[EXT_CSD_ENH_START_ADDR_0]; printf("Enhanced User Data Start Address" - " [ENH_START_ADDR]: 0x%06x\n", (ext_csd[139] << 16) | - (ext_csd[138] << 8) | ext_csd[137]); + " [ENH_START_ADDR]: 0x%06x\n", reg); /* A441]: reserved [135] */ printf("Bad Block Management mode" -- 1.7.3.5 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html