imx: imx8m: add imximage-8mp-lpddr4.cfg
[oweals/u-boot.git] / common / image-fdt.c
index e70da3dcb33aaeb2bf72c3950b23949647751e18..48388488d98defeeabd7641000d68f517aaf6a1f 100644 (file)
 #include <common.h>
 #include <fdt_support.h>
 #include <fdtdec.h>
+#include <env.h>
 #include <errno.h>
 #include <image.h>
 #include <linux/libfdt.h>
 #include <mapmem.h>
 #include <asm/io.h>
+#include <tee/optee.h>
 
 #ifndef CONFIG_SYS_FDT_PAD
 #define CONFIG_SYS_FDT_PAD 0x3000
@@ -560,6 +562,13 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
                }
        }
 
+       fdt_ret = optee_copy_fdt_nodes(gd->fdt_blob, blob);
+       if (fdt_ret) {
+               printf("ERROR: transfer of optee nodes to new fdt failed: %s\n",
+                      fdt_strerror(fdt_ret));
+               goto err;
+       }
+
        /* Delete the old LMB reservation */
        if (lmb)
                lmb_free(lmb, (phys_addr_t)(u32)(uintptr_t)blob,