diff mbox series

[v2,2/9] cmd: bdinfo: Implement support for printing memory layout via bdinfo -m

Message ID 20231007214106.15744-2-marek.vasut+renesas@mailbox.org
State Accepted
Commit f1774a80307c357ab26f8ee42c5b082a902393b6
Delegated to: Tom Rini
Headers show
Series [v2,1/9] cmd: bdinfo: Optionally use getopt and implement bdinfo -a | expand

Commit Message

Marek Vasut Oct. 7, 2023, 9:40 p.m. UTC
Add support for printing memory layout only via 'bdinfo -m' .

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Nikhil M Jain <n-jain1@ti.com>
Cc: Simon Glass <sjg@chromium.org>
---
V2: Add RB from Simon
---
 cmd/bdinfo.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 2c0d5e9c01b..c720ee6f9b6 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -193,10 +193,13 @@  int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 		return bdinfo_print_all(bd);
 
 	getopt_init_state(&gs);
-	while ((opt = getopt(&gs, argc, argv, "a")) > 0) {
+	while ((opt = getopt(&gs, argc, argv, "am")) > 0) {
 		switch (opt) {
 		case 'a':
 			return bdinfo_print_all(bd);
+		case 'm':
+			print_bi_dram(bd);
+			return CMD_RET_SUCCESS;
 		default:
 			return CMD_RET_USAGE;
 		}