[U-Boot] [PATCH] fdt: allow bootdelay to be specified via device tree

Stephen Warren swarren at wwwdotorg.org
Tue May 14 20:02:56 CEST 2013


From: Stephen Warren <swarren at nvidia.com>

This can be useful to force bootcmd to execute as soon as U-Boot has
started.

My use-case is: An SoC-specific tool pushes U-Boot into RAM, along with
an image to be written to device boot flash, with the DT config property
"bootcmd" set to contain a command to write that image to flash. In this
scenario, we don't want to allow any stale bootdelay value taken from
the current flash content to affect how long it takes before the
flashing process starts.

Signed-off-by: Stephen Warren <swarren at nvidia.com>
---
 common/main.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/common/main.c b/common/main.c
index 953ef29..6bfd9f0 100644
--- a/common/main.c
+++ b/common/main.c
@@ -429,6 +429,11 @@ void main_loop (void)
 	s = getenv ("bootdelay");
 	bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
 
+#ifdef CONFIG_OF_CONTROL
+	bootdelay = fdtdec_get_config_int(gd->fdt_blob, "bootdelay",
+			bootdelay);
+#endif
+
 	debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);
 
 #if defined(CONFIG_MENU_SHOW)
-- 
1.7.10.4



More information about the U-Boot mailing list