mmc: show hardware partition sizes in mmcinfo output

There is currently no command that will provide an overview of the hardware
partitions present on an eMMC device, one has to switch to every partition
via "mmc dev" and run mmcinfo for each to get the partition's capacity.
This commit adds a few lines of output to mmcinfo with the sizes of the
present partitions, like this:

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
Boot Capacity: 16 MiB
RPMB Capacity: 128 KiB
GP1 Capacity: 64 MiB
GP2 Capacity: 64 MiB

panto: Minor edit removing superfluous parentheses.

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
master
Diego Santa Cruz 10 years ago committed by Pantelis Antoniou
parent 72d42bad58
commit c5f0d3f1c5
  1. 17
      common/cmd_mmc.c

@ -73,6 +73,8 @@ U_BOOT_CMD(
static void print_mmcinfo(struct mmc *mmc)
{
int i;
printf("Device: %s\n", mmc->cfg->name);
printf("Manufacturer ID: %x\n", mmc->cid[0] >> 24);
printf("OEM: %x\n", (mmc->cid[0] >> 8) & 0xffff);
@ -92,6 +94,21 @@ static void print_mmcinfo(struct mmc *mmc)
printf("Bus Width: %d-bit%s\n", mmc->bus_width,
mmc->ddr_mode ? " DDR" : "");
if (!IS_SD(mmc) && mmc->version >= MMC_VERSION_4) {
puts("User Capacity: ");
print_size(mmc->capacity_user, "\n");
puts("Boot Capacity: ");
print_size(mmc->capacity_boot, "\n");
puts("RPMB Capacity: ");
print_size(mmc->capacity_rpmb, "\n");
for (i = 0; i < ARRAY_SIZE(mmc->capacity_gp); i++) {
if (mmc->capacity_gp[i]) {
printf("GP%i Capacity: ", i);
print_size(mmc->capacity_gp[i], "\n");
}
}
}
}
static struct mmc *init_mmc_device(int dev, bool force_init)
{

Loading…
Cancel
Save