summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFranck Jullien <franck.jullien@gmail.com>2014-05-21 21:43:16 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-05-22 08:05:54 +0200
commit28a0770e236803a3f02473b3a291fc8d94ac1984 (patch)
treef6faf7b22024321a9a6c4bdb7168b666d0d0b0be
parentf81f26afbdca2192143de93cdbc3c5eb7c121fc7 (diff)
downloadbarebox-28a0770e236803a3f02473b3a291fc8d94ac1984.tar.gz
barebox-28a0770e236803a3f02473b3a291fc8d94ac1984.tar.xz
devinfo: add human readable size after memory range
It's not always easy to know what is the size of a parition. This patch adds the size of a memory range in human readable format. We now have for example: `---- cfi_flash0 `---- nor0 `---- 0x00000000-0x00ffffff ( 16 MiB): /dev/nor0 `---- 0x00000000-0x0001ffff ( 128 KiB): /dev/env0 `---- 0x00020000-0x0011ffff ( 1 MiB): /dev/fpga0 `---- 0x00120000-0x0019ffff ( 512 KiB): /dev/self0 `---- 0x001a0000-0x00d9ffff ( 12 MiB): /dev/linux `---- 0x00da0000-0x00ffffff ( 2.4 MiB): /dev/elf Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--commands/devinfo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/commands/devinfo.c b/commands/devinfo.c
index 806e45c9ba..75bc9d44b4 100644
--- a/commands/devinfo.c
+++ b/commands/devinfo.c
@@ -33,9 +33,10 @@ static int do_devinfo_subtree(struct device_d *dev, int depth)
list_for_each_entry(cdev, &dev->cdevs, devices_list) {
for (i = 0; i < depth + 1; i++)
printf(" ");
- printf("`---- 0x%08llx-0x%08llx: /dev/%s\n",
+ printf("`---- 0x%08llx-0x%08llx (%10s): /dev/%s\n",
cdev->offset,
cdev->offset + cdev->size - 1,
+ size_human_readable(cdev->size),
cdev->name);
}
} else {