[PATCH v4 12/45] bdinfo: Show the RAM top and approximate stack pointer
Simon Glass
sjg at chromium.org
Mon Jun 19 13:59:27 CEST 2023
These are useful pieces of information when debugging. The RAM top shows
where U-Boot started allocating memory from, before it relocated. The
stack pointer can be checked to ensure it is in the correct region.
Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Nikhil M Jain <n-jain1 at ti.com>
Tested-by: Nikhil M Jain <n-jain1 at ti.com>
---
(no changes since v1)
cmd/Kconfig | 8 ++++++++
cmd/bdinfo.c | 5 +++++
2 files changed, 13 insertions(+)
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 365371fb511a..a449593c2064 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -135,6 +135,14 @@ config CMD_BDI
help
Print board info
+config CMD_BDINFO_EXTRA
+ bool "bdinfo extra features"
+ default y if SANDBOX || X86
+ help
+ Show additional information about the board. This uses a little more
+ code space but provides more options, particularly those useful for
+ bringup, development and debugging.
+
config CMD_CONFIG
bool "config"
default SANDBOX
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 365357ca545f..4bd21c9ea4b4 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -152,6 +152,11 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
printf("devicetree = %s\n", fdtdec_get_srcname());
}
+ if (IS_ENABLED(CONFIG_CMD_BDINFO_EXTRA)) {
+ bdinfo_print_num_ll("stack ptr", (ulong)&bd);
+ bdinfo_print_num_ll("ram_top ptr", (ulong)gd->ram_top);
+ }
+
arch_print_bdinfo();
return 0;
--
2.41.0.162.gfafddb0af9-goog
More information about the U-Boot
mailing list