fdt: Load boot command from device tree
Load boot command from /config/bootcmd of device tree if present. Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org> Signed-off-by: Che-Liang Chiou <clchiou@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
202ff75375
commit
224b72e639
|
@ -30,6 +30,7 @@
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <watchdog.h>
|
#include <watchdog.h>
|
||||||
#include <command.h>
|
#include <command.h>
|
||||||
|
#include <fdtdec.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
#ifdef CONFIG_MODEM_SUPPORT
|
#ifdef CONFIG_MODEM_SUPPORT
|
||||||
|
@ -40,6 +41,10 @@
|
||||||
#include <hush.h>
|
#include <hush.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_OF_CONTROL
|
||||||
|
#include <fdtdec.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <post.h>
|
#include <post.h>
|
||||||
#include <linux/ctype.h>
|
#include <linux/ctype.h>
|
||||||
#include <menu.h>
|
#include <menu.h>
|
||||||
|
@ -284,7 +289,10 @@ void main_loop (void)
|
||||||
int rc = 1;
|
int rc = 1;
|
||||||
int flag;
|
int flag;
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) && \
|
||||||
|
defined(CONFIG_OF_CONTROL)
|
||||||
|
char *env;
|
||||||
|
#endif
|
||||||
#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
|
#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
|
||||||
char *s;
|
char *s;
|
||||||
int bootdelay;
|
int bootdelay;
|
||||||
|
@ -380,6 +388,12 @@ void main_loop (void)
|
||||||
else
|
else
|
||||||
#endif /* CONFIG_BOOTCOUNT_LIMIT */
|
#endif /* CONFIG_BOOTCOUNT_LIMIT */
|
||||||
s = getenv ("bootcmd");
|
s = getenv ("bootcmd");
|
||||||
|
#ifdef CONFIG_OF_CONTROL
|
||||||
|
/* Allow the fdt to override the boot command */
|
||||||
|
env = fdtdec_get_config_string(gd->fdt_blob, "bootcmd");
|
||||||
|
if (env)
|
||||||
|
s = env;
|
||||||
|
#endif /* CONFIG_OF_CONTROL */
|
||||||
|
|
||||||
debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
|
debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue