[U-Boot] [PATCH v2 2/8] fdt: Allow to use EMBEDDED device tree for SPL

Patrick Delaunay patrick.delaunay at st.com
Mon May 20 13:00:01 UTC 2019


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.delaunay at 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



More information about the U-Boot mailing list