diff options
-rw-r--r-- | tools/kwboot.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/kwboot.c b/tools/kwboot.c index 986f27c..3b45e19 100644 --- a/tools/kwboot.c +++ b/tools/kwboot.c @@ -2139,12 +2139,24 @@ main(int argc, char **argv) goto usage; } - tty = kwboot_open_tty(ttypath, imgpath ? 115200 : baudrate); + tty = kwboot_open_tty(ttypath, baudrate); if (tty < 0) { perror(ttypath); goto out; } + /* + * initial baudrate for image transfer is always 115200, + * the change to different baudrate is done only after the header is sent + */ + if (imgpath && baudrate != 115200) { + rc = kwboot_tty_change_baudrate(tty, 115200); + if (rc) { + perror(ttypath); + goto out; + } + } + if (baudrate == 115200) /* do not change baudrate during Xmodem to the same value */ baudrate = 0; |