summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2016-09-28 20:50:13 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-10-04 21:14:19 +0200
commit1a64dd38544425e92de81aa505f6f390a7a53256 (patch)
tree8d6765b9ad882c03a12097c3cfec339203a52720
parent446ff0216e8df126b6bd5c284c1ba930fd8bb0ea (diff)
downloadbarebox-1a64dd38544425e92de81aa505f6f390a7a53256.tar.gz
barebox-1a64dd38544425e92de81aa505f6f390a7a53256.tar.xz
scripts: kwboot: improve diagnostic output
After entering uart boot mode the CPU prints some diagnostic messages. Showing them to the user helps her to notice when the message window was missed or there is an other problem. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--scripts/kwboot.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/kwboot.c b/scripts/kwboot.c
index 9dfaf4a8d..0a089b593 100644
--- a/scripts/kwboot.c
+++ b/scripts/kwboot.c
@@ -9,6 +9,7 @@
* 2008. Chapter 24.2 "BootROM Firmware".
*/
+#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -285,12 +286,20 @@ kwboot_bootmsg(int tty, void *msg)
}
rc = kwboot_tty_recv(tty, &c, 1, KWBOOT_MSG_RSP_TIMEO);
-
- kwboot_spinner();
+ while (!rc && c != NAK) {
+ if (c == '\\')
+ kwboot_printv("\\\\", c);
+ else if (isprint(c) || c == '\r' || c == '\n')
+ kwboot_printv("%c", c);
+ else
+ kwboot_printv("\\x%02hhx", c);
+
+ rc = kwboot_tty_recv(tty, &c, 1, KWBOOT_MSG_RSP_TIMEO);
+ }
} while (rc || c != NAK);
- kwboot_printv("\n");
+ kwboot_printv("\nGot expected NAK\n");
return rc;
}