diff options
author | Ovidiu Panait <ovpanait@gmail.com> | 2022-08-29 20:02:04 +0300 |
---|---|---|
committer | Michal Simek <michal.simek@amd.com> | 2022-09-13 11:32:48 +0200 |
commit | ae90d16ac78a2d7bd0327f71c26b46b5182315d3 (patch) | |
tree | 2ae7c84ffeecf2e751382c2b4b412a307531b87c /include | |
parent | 3f351cd358a3581844f3cacdfe60710bf925d75d (diff) | |
download | u-boot-ae90d16ac78a2d7bd0327f71c26b46b5182315d3.tar.gz u-boot-ae90d16ac78a2d7bd0327f71c26b46b5182315d3.tar.bz2 u-boot-ae90d16ac78a2d7bd0327f71c26b46b5182315d3.zip |
cmd: bdinfo: introduce bdinfo_print_size() helper
Add bdinfo_print_size() helper to display size variables (such as cache
sizes) in bdinfo format. The size is printed as "xxx Bytes", "xxx KiB",
"xxx MiB", "xxx GiB", etc as needed;
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
Link: https://lore.kernel.org/r/20220829170205.1274484-3-ovpanait@gmail.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/init.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/init.h b/include/init.h index 7b8f62c121..02bb4ce13e 100644 --- a/include/init.h +++ b/include/init.h @@ -343,6 +343,19 @@ void bdinfo_print_num_ll(const char *name, unsigned long long value); /* Print a clock speed in MHz */ void bdinfo_print_mhz(const char *name, unsigned long hz); +/** + * bdinfo_print_size - print size variables in bdinfo format + * @name: string to print before the size + * @size: size to print + * + * Helper function for displaying size variables as properly formatted bdinfo + * entries. The size is printed as "xxx Bytes", "xxx KiB", "xxx MiB", + * "xxx GiB", etc. as needed; + * + * For use in arch_print_bdinfo(). + */ +void bdinfo_print_size(const char *name, uint64_t size); + /* Show arch-specific information for the 'bd' command */ void arch_print_bdinfo(void); |