From 538e394d48b7d30ddb5f405f46d4975781561dfe Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Tue, 15 Dec 2015 12:45:53 +0100 Subject: [PATCH] Allow to define particular stop character for autoboot This would be useful for boards which share serial console with some other device, like MCU, which may unintentionally interrupt boot process. It is fast and simple solution, for future we should restore functionality from original U-Boot code, with string stop sequences. --- u-boot/common/main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/u-boot/common/main.c b/u-boot/common/main.c index d5ff950..42f3d57 100644 --- a/u-boot/common/main.c +++ b/u-boot/common/main.c @@ -58,6 +58,9 @@ static char tab_seq[] = " "; /* used to expand TABs */ */ #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) static __inline__ int abortboot(int bootdelay){ +#ifdef CONFIG_AUTOBOOT_STOP_CHAR + char stopc; +#endif int abort = 0; #ifdef CONFIG_SILENT_CONSOLE @@ -85,6 +88,15 @@ static __inline__ int abortboot(int bootdelay){ /* we got a key press */ if(tstc()){ +#ifdef CONFIG_AUTOBOOT_STOP_CHAR + stopc = getc(); + if (stopc == CONFIG_AUTOBOOT_STOP_CHAR) { + abort = 1; + bootdelay = 0; + + break; + } +#else /* don't auto boot */ abort = 1; /* no more delay */ @@ -92,6 +104,7 @@ static __inline__ int abortboot(int bootdelay){ /* consume input */ (void) getc(); break; +#endif /* CONFIG_AUTOBOOT_STOP_CHAR */ } udelay(10000); } -- 2.25.1