summaryrefslogtreecommitdiff
path: root/tools/kwboot.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-01-25 18:13:01 +0100
committerStefan Roese <sr@denx.de>2022-01-31 10:23:38 +0100
commit8bd15fd1146e13bba4b6d0166e5db4ce10ecf59d (patch)
tree013852965077405926f30152305a42668d352d9a /tools/kwboot.c
parentef95143df4caaf8c144f33ad685d1c51f530f06b (diff)
downloadu-boot-socfpga-8bd15fd1146e13bba4b6d0166e5db4ce10ecf59d.tar.gz
tools: kwboot: Wait blk_rsp_timeo when flushing
Use the blk_rsp_timeo variable when sleeping before flushing tty. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'tools/kwboot.c')
-rw-r--r--tools/kwboot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 82cfd9a827..1477c0f078 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -1081,8 +1081,8 @@ kwboot_xmodem(int tty, const void *_img, size_t size, int baudrate)
*/
hdrsz += (KWBOOT_XM_BLKSZ - hdrsz % KWBOOT_XM_BLKSZ) % KWBOOT_XM_BLKSZ;
- kwboot_printv("Waiting 2s and flushing tty\n");
- sleep(2); /* flush isn't effective without it */
+ kwboot_printv("Waiting %d ms and flushing tty\n", blk_rsp_timeo);
+ usleep(blk_rsp_timeo * 1000);
tcflush(tty, TCIOFLUSH);
pnum = 1;