From c3dbb4f9b7539e39d418fd1f518129fd60c8eca9 Mon Sep 17 00:00:00 2001 From: Diego Santa Cruz Date: Tue, 23 Dec 2014 10:50:17 +0100 Subject: mmc: extend mmcinfo to show enhanced partition attribute This extends the mmcinfo command's output to show which eMMC partitions have the enhanced attribute set. Note that the eMMC spec says that if the enhanced attribute is supported then the boot and RPMB partitions are of the enhanced type. The output of mmcinfo becomes: Device: OMAP SD/MMC Manufacturer ID: fe OEM: 14e Name: MMC16 Tran Speed: 52000000 Rd Block Len: 512 MMC version 4.41 High Capacity: Yes Capacity: 13.8 GiB Bus Width: 4-bit User Capacity: 13.8 GiB ENH Boot Capacity: 16 MiB ENH RPMB Capacity: 128 KiB ENH GP1 Capacity: 64 MiB ENH GP2 Capacity: 64 MiB ENH Signed-off-by: Diego Santa Cruz --- common/cmd_mmc.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'common/cmd_mmc.c') diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index cdcbf5f80f..d95cfaa4f8 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -96,16 +96,22 @@ static void print_mmcinfo(struct mmc *mmc) mmc->ddr_mode ? " DDR" : ""); if (!IS_SD(mmc) && mmc->version >= MMC_VERSION_4) { + bool has_enh = (mmc->part_support & ENHNCD_SUPPORT) != 0; puts("User Capacity: "); - print_size(mmc->capacity_user, "\n"); + print_size(mmc->capacity_user, + has_enh && (mmc->part_attr & EXT_CSD_ENH_USR) ? + " ENH\n" : "\n"); puts("Boot Capacity: "); - print_size(mmc->capacity_boot, "\n"); + print_size(mmc->capacity_boot, has_enh ? " ENH\n" : "\n"); puts("RPMB Capacity: "); - print_size(mmc->capacity_rpmb, "\n"); + print_size(mmc->capacity_rpmb, has_enh ? " ENH\n" : "\n"); for (i = 0; i < ARRAY_SIZE(mmc->capacity_gp); i++) { + bool is_enh = has_enh && + (mmc->part_attr & EXT_CSD_ENH_GP(i)); if (mmc->capacity_gp[i]) { printf("GP%i Capacity: ", i); - print_size(mmc->capacity_gp[i], "\n"); + print_size(mmc->capacity_gp[i], + is_enh ? " ENH\n" : "\n"); } } } -- cgit v1.2.1