Patchwork [U-Boot] common/main: move set_working_fdt_addr to enable usage of $fdtaddr

login
register
mail settings
Submitter Barak Wasserstrom
Date Feb. 27, 2013, 6:48 p.m.
Message ID <CD5421A2.532DC%wbarak@gmail.com>
Download mbox | patch
Permalink /patch/223682/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Barak Wasserstrom - Feb. 27, 2013, 6:48 p.m.
When using $fdtaddr in $bootcmd and $bootcmd is automatically called,
$fdtaddr is yet not defined.

Signed-off-by: Barak Wasserstrom <wbarak@gmail.com>
---
 common/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/common/main.c b/common/main.c
index e2d2e09..77b9076 100644
--- a/common/main.c
+++ b/common/main.c
@@ -378,6 +378,10 @@  void main_loop (void)
 
        bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop");
 
+#if defined CONFIG_OF_CONTROL
+       set_working_fdt_addr((void *)gd->fdt_blob);
+#endif /* CONFIG_OF_CONTROL */
+
 #ifdef CONFIG_BOOTCOUNT_LIMIT
        bootcount = bootcount_load();
        bootcount++;
@@ -500,10 +504,6 @@  void main_loop (void)
 #endif /* CONFIG_MENUKEY */
 #endif /* CONFIG_BOOTDELAY */
 
-#if defined CONFIG_OF_CONTROL
-       set_working_fdt_addr((void *)gd->fdt_blob);
-#endif /* CONFIG_OF_CONTROL */
-
        /*
         * Main Loop for Monitor Command Processing
         */