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 <p...@kernel.org>
---
 tools/kwboot.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/kwboot.c b/tools/kwboot.c
index 69d1be0f4823..f975c4a6c6ca 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -2128,6 +2128,10 @@ main(int argc, char **argv)
        if (!bootmsg && !term && !debugmsg && !imgpath)
                goto usage;
 
+       /* boot and debug message use baudrate 115200 */
+       if (((bootmsg && !imgpath) || debugmsg) && baudrate != 115200)
+               goto usage;
+
        ttypath = argv[optind++];
 
        if (optind != argc)
-- 
2.20.1

Reply via email to