]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
common: board: Update fdt_blob after relocation
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Thu, 3 Dec 2015 11:23:44 +0000 (16:53 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 3 Dec 2015 13:45:45 +0000 (14:45 +0100)
Update fdt_blob after relocation incase of CONFIG_OF_EMBED
as the fdt will be copied during u-boot relocation
updating it before relocation may cause issue with some
devices if they try to use it before it actually relocated

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
common/board_f.c
common/board_r.c

index 4aac00d7ba8aeb95bcd01542c1a45964b2497a50..53661e33cb9128731f1aef9e8d340191f7af6e10 100644 (file)
@@ -673,9 +673,6 @@ static int setup_reloc(void)
         */
        gd->reloc_off = gd->relocaddr - (CONFIG_SYS_TEXT_BASE + 0x400);
 #endif
-#endif
-#ifdef CONFIG_OF_EMBED
-       gd->fdt_blob += gd->reloc_off;
 #endif
        memcpy(gd->new_gd, (char *)gd, sizeof(gd_t));
 
index bf6c72572d7a07b0dbfb60a40fd48ea61b194bc7..5a758b00a6e022b5c80ca497cf3f6d4cc63307b7 100644 (file)
@@ -159,6 +159,14 @@ static int initr_reloc_global_data(void)
         */
        gd->env_addr += gd->relocaddr - CONFIG_SYS_MONITOR_BASE;
 #endif
+#ifdef CONFIG_OF_EMBED
+       /*
+       * The fdt_blob needs to be moved to new relocation address
+       * incase of FDT blob is embedded with in image
+       */
+       gd->fdt_blob += gd->reloc_off;
+#endif
+
        return 0;
 }