9
0
Fork 0
Commit Graph

5 Commits

Author SHA1 Message Date
Uwe Kleine-König ef8a47a6e7 scripts: kwboot: fix detection of timeout
In function kwboot_xm_sendblock() the loop that implements retrying to
send a boot block might be quit if kwboot_tty_send or kwboot_tty_recv
return a failure. In this case the value of the variable c that is
expected to hold the response byte is uninitialized and most likely
still holds an ACK from the previous call to kwboot_xm_sendblock().

So the right thing to do is not to clobber rc if it's already != 0.

The result of this patch in my current scenario is that kwboot dies with

	xmodem: Connection timed out

when the SoC stops replying instead of continuing to try sending the
remaining blocks which results in select() blocking for one second for
each block.

Fixes: 0535713bbf ("scripts: add kwboot tool")
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
--
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>

I also tried to increase the timeout, but without success :-(. Will test
a different USB-to-RS232 adapter ...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-17 08:52:52 +01:00
Alexander Shiyan f62f3affa8 scripts/kwboot: Remove redundant assignment
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:06:11 +01:00
Sebastian Hesselbarth 4f3570c470 scripts: kwboot: fix missing soh initialization
Xmodem blocks should start with SOH but kwboot never sets the first
block byte. This fixes kwboot's Xmodem block initialization and sets
first block byte to SOH.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-18 10:53:11 +01:00
Sebastian Hesselbarth 87f486c7f1 scripts: kwboot: add support for Marvell Dove
Marvell Dove SoC also has an UART bootmode to upload payload after
powerup. In contrast to Kirkwood and Armada 370/XP, Dove does not
respond to a special sequence sent on UART0 but requires to be
booted into UART bootmode by bootstraps. This is usually done by
pressing a push button that will set bootstraps accordingly.

This patch adds a new option, documentation and corresponding prompts
to support the above requirements. Also a left-over option ('-p')
is removed.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-14 07:10:13 +02:00
Thomas Petazzoni 0535713bbf scripts: add kwboot tool
This tool is used with Marvell EBU SoC to trigger the UART boot mode
provided by the SoC BootROM, and push the bootloader image to the
target using the Xmodem protocol.

It has been taken from the U-Boot source code, with minor
modifications to make it work with Armada 370/XP platforms.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-11 17:23:36 +02:00