From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rajesh Bhagat Date: Wed, 3 Oct 2018 17:07:11 +0530 Subject: [U-Boot] [PATCH 28/53] armv8: layerscape: secure boot support for environment selection In-Reply-To: <20181003113736.14981-1-rajesh.bhagat@nxp.com> References: <20181003113736.14981-1-rajesh.bhagat@nxp.com> Message-ID: <20181003113736.14981-29-rajesh.bhagat@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Add secure boot support for environment selection. Signed-off-by: Pankit Garg Signed-off-by: Rajesh Bhagat --- arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c index 1ab4d93638..063a8fea55 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c @@ -33,6 +33,9 @@ #ifdef CONFIG_TFABOOT #include +#ifdef CONFIG_CHAIN_OF_TRUST +#include +#endif #endif DECLARE_GLOBAL_DATA_PTR; @@ -738,6 +741,14 @@ 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; +#endif + switch (src) { case BOOT_SOURCE_IFC_NOR: env_loc = ENVL_FLASH; @@ -765,6 +776,9 @@ enum env_location env_get_location(enum env_operation op, int prio) break; } +#ifdef CONFIG_CHAIN_OF_TRUST +done: +#endif return env_loc; } -- 2.17.1