summaryrefslogtreecommitdiff
path: root/lib/fdtdec.c
diff options
context:
space:
mode:
authorCooper Jr., Franklin <fcooper@ti.com>2017-06-16 17:25:07 -0500
committerTom Rini <trini@konsulko.com>2017-07-10 14:25:52 -0400
commit2059ecf30f389ec0e396fccc067f6f9fecb36a2c (patch)
treea1e25e06d51ee190bb1cb3a51faf8a6cfe2e20d0 /lib/fdtdec.c
parent92926bc80c5330d7ee71d0e56926264bce9dea3b (diff)
fdt: Enable selecting correct DTB from appended FIT Image
This patch gives U-boot the runtime support to have the board specific code decide which FDT to use. This is especially useful for devices that need this type of runtime determination and also doesn't use SPL. Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'lib/fdtdec.c')
-rw-r--r--lib/fdtdec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 91503b8cb9..fbb48bf74d 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -4,6 +4,7 @@
*/
#ifndef USE_HOSTCC
+#include <boot_fit.h>
#include <common.h>
#include <dm.h>
#include <errno.h>
@@ -1221,6 +1222,15 @@ int fdtdec_setup(void)
gd->fdt_blob = (ulong *)&_image_binary_end;
else
gd->fdt_blob = (ulong *)&__bss_end;
+
+# elif defined CONFIG_FIT_EMBED
+ gd->fdt_blob = locate_dtb_in_fit(&_end);
+
+ if (gd->fdt_blob == NULL || gd->fdt_blob <= ((void *)&_end)) {
+ puts("Failed to find proper dtb in embedded FIT Image\n");
+ return -1;
+ }
+
# else
/* FDT is at end of image */
gd->fdt_blob = (ulong *)&_end;