Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-spi
[oweals/u-boot.git] / arch / arm / cpu / armv8 / fsl-layerscape / cpu.c
index bbe3c88d4ac07f1747170f11934fe28f9f946f20..26f4fdacdb829019e6a5832228becc8bcca5027f 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <env.h>
 #include <fsl_ddr_sdram.h>
 #include <asm/io.h>
 #include <linux/errno.h>
@@ -32,7 +33,7 @@
 #include <fsl_qbman.h>
 
 #ifdef CONFIG_TFABOOT
-#include <environment.h>
+#include <env_internal.h>
 #ifdef CONFIG_CHAIN_OF_TRUST
 #include <fsl_validate.h>
 #endif
@@ -808,12 +809,8 @@ enum env_location env_get_location(enum env_operation op, int prio)
        if (prio)
                return ENVL_UNKNOWN;
 
-#ifdef CONFIG_CHAIN_OF_TRUST
-       /* Check Boot Mode
-        * If Boot Mode is Secure, return ENVL_NOWHERE
-        */
-       if (fsl_check_boot_mode_secure() == 1)
-               goto done;
+#ifdef CONFIG_ENV_IS_NOWHERE
+       return env_loc;
 #endif
 
        switch (src) {
@@ -843,9 +840,6 @@ enum env_location env_get_location(enum env_operation op, int prio)
                break;
        }
 
-#ifdef CONFIG_CHAIN_OF_TRUST
-done:
-#endif
        return env_loc;
 }
 #endif /* CONFIG_TFABOOT */