]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - lib/fdtdec.c
dm: spl: Support device tree when BSS is in a different section
[karo-tx-uboot.git] / lib / fdtdec.c
index e1df144db0537c08c6009d01ebe8984607043539..c1b517706d105b94b72e944edceff08e46454ff9 100644 (file)
@@ -1222,8 +1222,11 @@ int fdtdec_setup(void)
        gd->fdt_blob = __dtb_dt_begin;
 # elif defined CONFIG_OF_SEPARATE
 #  ifdef CONFIG_SPL_BUILD
-       /* FDT is at end of BSS */
-       gd->fdt_blob = (ulong *)&__bss_end;
+       /* FDT is at end of BSS unless it is in a different memory region */
+       if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS))
+               gd->fdt_blob = (ulong *)&_image_binary_end;
+       else
+               gd->fdt_blob = (ulong *)&__bss_end;
 #  else
        /* FDT is at end of image */
        gd->fdt_blob = (ulong *)&_end;