summaryrefslogtreecommitdiff
path: root/common/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/main.c')
-rw-r--r--common/main.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/main.c b/common/main.c
index 61c6cac..8052d42 100644
--- a/common/main.c
+++ b/common/main.c
@@ -333,6 +333,20 @@ err:
hang();
}
+static void process_fdt_options(const void *blob)
+{
+ ulong addr;
+
+ /* Add an env variable to point to a kernel payload, if available */
+ addr = fdtdec_get_config_int(gd->fdt_blob, "kernel-offset", 0);
+ if (addr)
+ setenv_addr("kernaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
+
+ /* Add an env variable to point to a root disk, if available */
+ addr = fdtdec_get_config_int(gd->fdt_blob, "rootdisk-offset", 0);
+ if (addr)
+ setenv_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
+}
#endif /* CONFIG_OF_CONTROL */
@@ -451,6 +465,8 @@ void main_loop (void)
if (env)
s = env;
+ process_fdt_options(gd->fdt_blob);
+
/*
* If the bootsecure option was chosen, use secure_boot_cmd().
* Always use 'env' in this case, since bootsecure requres that the