From 347a845aec18561d36299b0735c47c2b3f45bc71 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 12 Jul 2023 09:04:37 -0600 Subject: bdinfo: Show information about the serial port It is useful to see the detailed setting of the serial port, e.g. to allow setting up earlycon or console for Linux. Add this output to the 'bdinfo' command. Signed-off-by: Simon Glass Reviewed-by: Bin Meng [bmeng: squashed in 20230716033929.253357-2-sjg@chromium.org] Signed-off-by: Bin Meng --- test/cmd/bdinfo.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/cmd') diff --git a/test/cmd/bdinfo.c b/test/cmd/bdinfo.c index cddf1a46d49..6480393fd5d 100644 --- a/test/cmd/bdinfo.c +++ b/test/cmd/bdinfo.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -191,6 +192,19 @@ static int bdinfo_test_move(struct unit_test_state *uts) ut_assert_nextline("devicetree = %s", fdtdec_get_srcname()); } + if (IS_ENABLED(CONFIG_DM_SERIAL)) { + struct serial_device_info info; + + ut_assertnonnull(gd->cur_serial_dev); + ut_assertok(serial_getinfo(gd->cur_serial_dev, &info)); + + ut_assertok(test_num_l(uts, "serial addr", info.addr)); + ut_assertok(test_num_l(uts, " width", info.reg_width)); + ut_assertok(test_num_l(uts, " shift", info.reg_shift)); + ut_assertok(test_num_l(uts, " offset", info.reg_offset)); + ut_assertok(test_num_l(uts, " clock", info.clock)); + } + ut_assertok(ut_check_console_end(uts)); return 0; -- cgit v1.2.3 From b279f5170a807a87a5726bcbeb0bc98937102eee Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 15 Jul 2023 21:38:46 -0600 Subject: bdinfo: Show the RAM top and approximate stack pointer 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 Reviewed-by: Nikhil M Jain Reviewed-by: Bin Meng Tested-by: Nikhil M Jain --- test/cmd/bdinfo.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/cmd') diff --git a/test/cmd/bdinfo.c b/test/cmd/bdinfo.c index 6480393fd5d..8c09281cac0 100644 --- a/test/cmd/bdinfo.c +++ b/test/cmd/bdinfo.c @@ -205,6 +205,13 @@ static int bdinfo_test_move(struct unit_test_state *uts) ut_assertok(test_num_l(uts, " clock", info.clock)); } + if (IS_ENABLED(CONFIG_CMD_BDINFO_EXTRA)) { + ut_assert_nextlinen("stack ptr"); + ut_assertok(test_num_ll(uts, "ram_top ptr", + (unsigned long long)gd->ram_top)); + ut_assertok(test_num_l(uts, "malloc base", gd_malloc_start())); + } + ut_assertok(ut_check_console_end(uts)); return 0; -- cgit v1.2.3