summaryrefslogtreecommitdiff
path: root/tools/kwboot.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-03-07 19:03:07 +0100
committerStefan Roese <sr@denx.de>2022-03-14 14:04:18 +0100
commita79dea29127d2840277e6edc0f5c71dc1daec82b (patch)
treeef8d669138e834baaec6633e6f53a9b49838079e /tools/kwboot.c
parentc96137000e4cf486dcb164fd67a1a0b5b2fb99c6 (diff)
downloadu-boot-socfpga-a79dea29127d2840277e6edc0f5c71dc1daec82b.tar.gz
tools: kwboot: Allow to specify custom baudrate only in supported operations
Custom baudrate different than 115200 may be specified only when kwboot is not going to send boot/debug message pattern or when it is going to send boot message pattern with image file (in which case baudrate change happens after sending kwbimage header). BootROM detects boot/debug message pattern only at baudrate 115200. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'tools/kwboot.c')
-rw-r--r--tools/kwboot.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 69d1be0f48..986f27c201 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -2133,6 +2133,12 @@ main(int argc, char **argv)
if (optind != argc)
goto usage;
+ /* boot and debug message use baudrate 115200 */
+ if (((bootmsg && !imgpath) || debugmsg) && baudrate != 115200) {
+ fprintf(stderr, "Baudrate other than 115200 cannot be used for this operation.\n");
+ goto usage;
+ }
+
tty = kwboot_open_tty(ttypath, imgpath ? 115200 : baudrate);
if (tty < 0) {
perror(ttypath);