aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-12 09:04:37 -0600
committerBin Meng <bmeng@tinylab.org>2023-07-17 13:38:34 +0800
commit347a845aec18561d36299b0735c47c2b3f45bc71 (patch)
tree68188c6812827b4dd1a2bf20afaecf5bce20fc38 /test
parent43b6fa9c1464e0918004dc03be03acd3c40bcc25 (diff)
downloadu-boot-347a845aec18561d36299b0735c47c2b3f45bc71.zip
u-boot-347a845aec18561d36299b0735c47c2b3f45bc71.tar.gz
u-boot-347a845aec18561d36299b0735c47c2b3f45bc71.tar.bz2
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 <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: squashed in 20230716033929.253357-2-sjg@chromium.org] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/cmd/bdinfo.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/cmd/bdinfo.c b/test/cmd/bdinfo.c
index cddf1a4..6480393 100644
--- a/test/cmd/bdinfo.c
+++ b/test/cmd/bdinfo.c
@@ -16,6 +16,7 @@
#include <env.h>
#include <lmb.h>
#include <net.h>
+#include <serial.h>
#include <video.h>
#include <vsprintf.h>
#include <asm/cache.h>
@@ -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;