]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_mmc.c
mmc: show hardware partition sizes in mmcinfo output
[karo-tx-uboot.git] / common / cmd_mmc.c
index 1e40983c757b1d71efb7ee1a4e7e5d2b6e44734a..cdcbf5f80f9be5b718a52ecefeccc6796ccfbb07 100644 (file)
@@ -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);
@@ -90,7 +92,23 @@ static void print_mmcinfo(struct mmc *mmc)
        puts("Capacity: ");
        print_size(mmc->capacity, "\n");
 
-       printf("Bus Width: %d-bit\n", mmc->bus_width);
+       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)
 {
@@ -602,7 +620,7 @@ static cmd_tbl_t cmd_mmc[] = {
        U_BOOT_CMD_MKENT(list, 1, 1, do_mmc_list, "", ""),
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
        U_BOOT_CMD_MKENT(bootbus, 5, 0, do_mmc_bootbus, "", ""),
-       U_BOOT_CMD_MKENT(bootpart-resize, 3, 0, do_mmc_boot_resize, "", ""),
+       U_BOOT_CMD_MKENT(bootpart-resize, 4, 0, do_mmc_boot_resize, "", ""),
        U_BOOT_CMD_MKENT(partconf, 5, 0, do_mmc_partconf, "", ""),
        U_BOOT_CMD_MKENT(rst-function, 3, 0, do_mmc_rst_func, "", ""),
 #endif