Skip to contentSkip to conversation

mx5: Add HAB boot support

PATCH New andrej.rosano at f-secure.com 1 participant 1 message Feb 14, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mx5: Add HAB boot support

From: Andrej Rosano <[email protected]>

Add SEC_CONFIG[1] fuse checking.

---
 arch/arm/mach-imx/Makefile  | 5 +++++
 arch/arm/mach-imx/hab.c     | 5 +++++
 arch/arm/mach-imx/mx5/soc.c | 8 ++++++++
 drivers/crypto/fsl/Makefile | 2 ++
 4 files changed, 20 insertions(+)
arch/arm/mach-imx/Makefile +5 -0
index 95a542fa01..687c28c932 100644
@@ -49,14 +49,19 @@ ifeq ($(SOC),$(filter $(SOC),mx7ulp))
 obj-y  += cache.o
 obj-$(CONFIG_SECURE_BOOT) += hab.o
 endif
+ifeq ($(SOC),$(filter $(SOC),mx5))
+obj-$(CONFIG_SECURE_BOOT) += hab.o
+endif
 ifeq ($(SOC),$(filter $(SOC),vf610))
 obj-y += ddrmc-vf610.o
 endif
 ifneq ($(CONFIG_SPL_BUILD),y)
 obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
 obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
+ifneq ($(SOC),$(filter $(SOC),mx5))
 obj-$(CONFIG_CMD_DEKBLOB) += cmd_dek.o
 endif
+endif
 
 PLUGIN = board/$(BOARDDIR)/plugin
 
arch/arm/mach-imx/hab.c +5 -0
index 5f197775c1..a2b91af7d5 100644
@@ -498,7 +498,9 @@ int imx_hab_authenticate_image(uint32_t ddr_start, uint32_t image_size,
 	printf("\nAuthenticate image from DDR location 0x%x...\n",
 	       ddr_start);
 
+#if !defined(CONFIG_MX5)
 	hab_caam_clock_enable(1);
+#endif
 
 	/* Calculate IVT address header */
 	ivt_addr = ddr_start + ivt_offset;
@@ -592,7 +594,10 @@ hab_exit_failure_print_status:
 #endif
 
 hab_caam_clock_disable:
+
+#if !defined(CONFIG_MX5)
 	hab_caam_clock_enable(0);
+#endif
 
 	if (load_addr != 0)
 		result = 0;
arch/arm/mach-imx/mx5/soc.c +8 -0
index 2b63871bc4..fab3958702 100644
@@ -15,11 +15,19 @@
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/mach-imx/boot_mode.h>
+#include <asm/mach-imx/hab.h>
 
 #if !(defined(CONFIG_MX51) || defined(CONFIG_MX53))
 #error "CPU_TYPE not defined"
 #endif
 
+#if defined(CONFIG_SECURE_BOOT)
+struct imx_sec_config_fuse_t const imx_sec_config_fuse = {
+	.bank = 0,
+	.word = 4,
+};
+#endif
+
 u32 get_cpu_rev(void)
 {
 #ifdef CONFIG_MX51
drivers/crypto/fsl/Makefile +2 -0
index ea878e1822..13e4a95459 100644
@@ -6,6 +6,8 @@
 
 obj-y += sec.o
 obj-$(CONFIG_FSL_CAAM) += jr.o fsl_hash.o jobdesc.o error.o
+ifneq ($(SOC),$(filter $(SOC),mx5))
 obj-$(CONFIG_CMD_BLOB) += fsl_blob.o
 obj-$(CONFIG_CMD_DEKBLOB) += fsl_blob.o
+endif
 obj-$(CONFIG_RSA_FREESCALE_EXP) += fsl_rsa.o
Signature · 1 line
2.16.1