All of lore.kernel.org
 help / color / mirror / Atom feed
From: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 01/18] mmc: show hardware partition sizes in mmcinfo output
Date: Tue, 23 Dec 2014 10:50:16 +0100	[thread overview]
Message-ID: <1419328233-6977-2-git-send-email-Diego.SantaCruz@spinetix.com> (raw)
In-Reply-To: <1419328233-6977-1-git-send-email-Diego.SantaCruz@spinetix.com>

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

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
---
 common/cmd_mmc.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 96478e4..fa765d7 100644
--- a/common/cmd_mmc.c
+++ b/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)
 {
-- 
2.2.1

  reply	other threads:[~2014-12-23  9:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23  9:50 [U-Boot] [PATCH v4 00/18] Support for eMMC partitioning and related fixes Diego Santa Cruz
2014-12-23  9:50 ` Diego Santa Cruz [this message]
2015-01-19 15:37   ` [U-Boot] [PATCH v4 01/18] mmc: show hardware partition sizes in mmcinfo output Pantelis Antoniou
2015-01-22 18:42   ` Stephen Warren
2015-01-22 19:45     ` Pantelis Antoniou
2015-01-22 19:59       ` Stephen Warren
2015-01-22 20:48         ` Pantelis Antoniou
2015-01-23  8:30         ` Diego Santa Cruz
2015-01-23  8:34           ` Pantelis Antoniou
2015-01-23  8:43             ` Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 02/18] mmc: extend mmcinfo to show enhanced partition attribute Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 03/18] mmc: make eMMC general purpose partition numbering match spec Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 04/18] mmc: skip mmcinfo partition info processing for eMMC < 4.41 Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 05/18] mmc: incomplete test to switch to high-capacity group size definitions Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 06/18] mmc: computation of eMMC GP partition size was missing 512 KiB factor Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 07/18] mmc: read the size of eMMC enhanced user data area Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 08/18] mmc: display size and start of eMMC enhanced user data area in mmcinfo Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 09/18] mmc: fix erase_grp_size computation with high-capacity size definition Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 10/18] mmc: read the high capacity WP group size for eMMC Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 11/18] mmc: show the erase group size and HC WP group size in mmcinfo output Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 12/18] mmc: eMMC partitioning data is not effective till partitioning completed Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 13/18] mmc: the ext_csd data may be used during init even if reading failed Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 14/18] mmc: add API to do eMMC hardware partitioning Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 15/18] mmc: add mmc hwpartition sub-command " Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 16/18] mmc: extend the mmc hardware partitioning API with write reliability Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 17/18] mmc: extend the mmc hwpartition sub-command to change " Diego Santa Cruz
2014-12-23  9:50 ` [U-Boot] [PATCH v4 18/18] mmc: extend mmcinfo output to show partition write reliability settings Diego Santa Cruz
2015-01-19 15:44 ` [U-Boot] [PATCH v4 00/18] Support for eMMC partitioning and related fixes Pantelis Antoniou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1419328233-6977-2-git-send-email-Diego.SantaCruz@spinetix.com \
    --to=diego.santacruz@spinetix.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.