tools: kwboot: Allow non-xmodem text output from BootROM only in a specific case
authorPali Rohár <pali@kernel.org>
Fri, 24 Sep 2021 21:06:50 +0000 (23:06 +0200)
committerStefan Roese <sr@denx.de>
Fri, 1 Oct 2021 09:07:13 +0000 (11:07 +0200)
commit48b3ea66cae97a06c35f117be8613c597aa2fca8
tree8e71507b424003428d28f09445893bec87219327
parent408ea6138bc5e94245ea0ebcb87666b9a47aed99
tools: kwboot: Allow non-xmodem text output from BootROM only in a specific case

When sending image header / image data, BootROM does not send any
non-xmodem text output. We should therefore interpret unknown bytes in
the xmodem protocol as errors and resend current packet. This should
improve the transfer in case there are errors on the UART line.

Text output from BootROM may only happen after whole image header is
sent and before ACK for the last packet of image header is received.
In this case BootROM may execute code from the image, which may interact
with UART (U-Boot SPL, for example, prints stuff on UART).

Print received non-xmodem output from BootROM only in this case.

Signed-off-by: Pali Rohár <pali@kernel.org>
[ refactored & simplified ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
tools/kwboot.c