diff --git a/common/main.c b/common/main.c
index 61c6cac882150acaba23f032b2ef4bb14c0d4bca..8052d4222ec82b8ddd9d9b2b0528bfb6ff67c9bd 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