From 1a64dd38544425e92de81aa505f6f390a7a53256 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 28 Sep 2016 20:50:13 +0200 Subject: scripts: kwboot: improve diagnostic output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Sascha Hauer --- scripts/kwboot.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/kwboot.c b/scripts/kwboot.c index 9dfaf4a8df..0a089b5936 100644 --- a/scripts/kwboot.c +++ b/scripts/kwboot.c @@ -9,6 +9,7 @@ * 2008. Chapter 24.2 "BootROM Firmware". */ +#include #include #include #include @@ -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; } -- cgit v1.2.3