diff mbox

[U-Boot] Allow runtime configuration of "zero-delay" check

Message ID 1345236792-19367-1-git-send-email-joe.hershberger@ni.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Joe Hershberger Aug. 17, 2012, 8:53 p.m. UTC
Define the new "-2" value for bootdelay to mean autoboot with no delay
and don't check for an abort key (while "0" value means do check).

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
---
 README        | 2 ++
 common/main.c | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

Tom Rini Oct. 4, 2012, 1:19 a.m. UTC | #1
On Fri, Aug 17, 2012 at 10:53:12AM -0000, Joe Hershberger wrote:

> Define the new "-2" value for bootdelay to mean autoboot with no delay
> and don't check for an abort key (while "0" value means do check).
> 
> Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/README b/README
index fb9d904..da30673 100644
--- a/README
+++ b/README
@@ -679,6 +679,8 @@  The following options need to be configured:
 - Boot Delay:	CONFIG_BOOTDELAY - in seconds
 		Delay before automatically booting the default image;
 		set to -1 to disable autoboot.
+		set to -2 to autoboot with no delay and not check for abort
+		(even when CONFIG_ZERO_BOOTDELAY_CHECK is defined).
 
 		See doc/README.autoboot for these options that
 		work with CONFIG_BOOTDELAY. None are required.
diff --git a/common/main.c b/common/main.c
index 81984ac..9507cec 100644
--- a/common/main.c
+++ b/common/main.c
@@ -222,7 +222,8 @@  int abortboot(int bootdelay)
 #ifdef CONFIG_MENUPROMPT
 	printf(CONFIG_MENUPROMPT);
 #else
-	printf("Hit any key to stop autoboot: %2d ", bootdelay);
+	if (bootdelay >= 0)
+		printf("Hit any key to stop autoboot: %2d ", bootdelay);
 #endif
 
 #if defined CONFIG_ZERO_BOOTDELAY_CHECK
@@ -382,7 +383,7 @@  void main_loop (void)
 
 	debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
 
-	if (bootdelay >= 0 && s && !abortboot (bootdelay)) {
+	if (bootdelay != -1 && s && !abortboot(bootdelay)) {
 # ifdef CONFIG_AUTOBOOT_KEYED
 		int prev = disable_ctrlc(1);	/* disable Control C checking */
 # endif