U-boot continue to use load DT from file system, this patch avoid
an error when U-Boot "Error: Out of memory" when it try to map
gd->fdt_blob (EMBEDDED pointer __dtb_dt_begin is not managed).

Signed-off-by: Patrick Delaunay <patrick.delau...@st.com>
---

Changes in v2:
- solve issue for spl sandbox with dtb

 lib/fdtdec.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index fea44a9..d25cfd6 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1491,6 +1491,12 @@ int fdtdec_setup(void)
        gd->fdt_blob = __dtb_dt_spl_begin;
 #  else
        gd->fdt_blob = __dtb_dt_begin;
+#ifdef CONFIG_SANDBOX
+       if (sandbox_read_fdt_from_file()) {
+               puts("Failed to read control FDT\n");
+               return -1;
+       }
+#endif
 #  endif
 # elif defined(CONFIG_OF_BOARD) || defined(CONFIG_OF_SEPARATE)
        /* Allow the board to override the fdt address. */
-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to