]> git.sur5r.net Git - u-boot/blobdiff - common/bootm_os.c
spl: fit: Fix support for loading FPGA bitstream
[u-boot] / common / bootm_os.c
index 1feea8af175481fe0b10c2e47e84dedd7b22e744..f4bd90590944dd26c881ed7a04a05843bce0cdc5 100644 (file)
@@ -1,16 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <bootm.h>
 #include <fdt_support.h>
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #include <malloc.h>
 #include <vxworks.h>
+#include <tee/optee.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -276,6 +276,9 @@ void do_bootvx_fdt(bootm_headers_t *images)
                if (ret)
                        return;
 
+               /* Update ethernet nodes */
+               fdt_fixup_ethernet(*of_flat_tree);
+
                ret = fdt_add_subnode(*of_flat_tree, 0, "chosen");
                if ((ret >= 0 || ret == -FDT_ERR_EXISTS)) {
                        bootline = env_get("bootargs");
@@ -430,6 +433,34 @@ static int do_bootm_openrtos(int flag, int argc, char * const argv[],
 }
 #endif
 
+#ifdef CONFIG_BOOTM_OPTEE
+static int do_bootm_tee(int flag, int argc, char * const argv[],
+                       bootm_headers_t *images)
+{
+       int ret;
+
+       /* Verify OS type */
+       if (images->os.os != IH_OS_TEE) {
+               return 1;
+       };
+
+       /* Validate OPTEE header */
+       ret = optee_verify_bootm_image(images->os.image_start,
+                                      images->os.load,
+                                      images->os.image_len);
+       if (ret)
+               return ret;
+
+       /* Locate FDT etc */
+       ret = bootm_find_images(flag, argc, argv);
+       if (ret)
+               return ret;
+
+       /* From here we can run the regular linux boot path */
+       return do_bootm_linux(flag, argc, argv, images);
+}
+#endif
+
 static boot_os_fn *boot_os[] = {
        [IH_OS_U_BOOT] = do_bootm_standalone,
 #ifdef CONFIG_BOOTM_LINUX
@@ -463,6 +494,9 @@ static boot_os_fn *boot_os[] = {
 #ifdef CONFIG_BOOTM_OPENRTOS
        [IH_OS_OPENRTOS] = do_bootm_openrtos,
 #endif
+#ifdef CONFIG_BOOTM_OPTEE
+       [IH_OS_TEE] = do_bootm_tee,
+#endif
 };
 
 /* Allow for arch specific config before we boot */