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 <Diego.SantaCruz@spinetix.com>
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index cdcbf5f..d95cfaa 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -96,16 +96,22 @@
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");
}
}
}