mx7ulp: Add HAB boot support
authorPeng Fan <peng.fan@nxp.com>
Wed, 22 Feb 2017 08:21:53 +0000 (16:21 +0800)
committerStefano Babic <sbabic@denx.de>
Fri, 17 Mar 2017 08:27:08 +0000 (09:27 +0100)
Add CAAM clock functions, SEC_CONFIG[1] fuse checking, and default CSF
size for HAB support boot on mx7ulp.

Users need to uncomment the CONFIG_SECURE_BOOT in mx7ulp_evk.h to build
secure uboot.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by : Stefano Babic <sbabic@denx.de>

arch/arm/cpu/armv7/mx7ulp/clock.c
arch/arm/cpu/armv7/mx7ulp/soc.c
arch/arm/imx-common/hab.c
arch/arm/include/asm/arch-mx7ulp/clock.h

index 1c072b8198dcf00305510057bc874248a8b5d7c3..77b282addd6e0f08889eca71b49c9a403efa4ff8 100644 (file)
@@ -313,6 +313,16 @@ void clock_init(void)
        enable_usboh3_clk(1);
 }
 
+#ifdef CONFIG_SECURE_BOOT
+void hab_caam_clock_enable(unsigned char enable)
+{
+       if (enable)
+              pcc_clock_enable(PER_CLK_CAAM, true);
+       else
+              pcc_clock_enable(PER_CLK_CAAM, false);
+}
+#endif
+
 /*
  * Dump some core clockes.
  */
index 8713e9bf80a66ebd10f8256823cc528a90b2bb37..4fd4c3a32fefedf79fdf4ec55623a02f430ddda0 100644 (file)
@@ -7,9 +7,17 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
+#include <asm/imx-common/hab.h>
 
 static char *get_reset_cause(char *);
 
+#if defined(CONFIG_SECURE_BOOT)
+struct imx_sec_config_fuse_t const imx_sec_config_fuse = {
+       .bank = 29,
+       .word = 6,
+};
+#endif
+
 u32 get_cpu_rev(void)
 {
        /* Temporally hard code the CPU rev to 0x73, rev 1.0. Fix it later */
index 7449487f0d5777236de822cc33c8419ee8a0635c..523d0e3b387619312695ced69b29096c15319b94 100644 (file)
@@ -77,7 +77,8 @@
 #define MX6DLS_PU_IROM_MMU_EN_VAR      0x00901dd0
 #define MX6SL_PU_IROM_MMU_EN_VAR       0x00900a18
 #define IS_HAB_ENABLED_BIT \
-       (is_soc_type(MXC_SOC_MX7) ? 0x2000000 : 0x2)
+       (is_soc_type(MXC_SOC_MX7ULP) ? 0x80000000 :     \
+        (is_soc_type(MXC_SOC_MX7) ? 0x2000000 : 0x2))
 
 /*
  * +------------+  0x0 (DDR_UIMAGE_START) -
index ebf32c6c2c92919453e8f9b24b2804fd35951070..170a9b3a7c8dde7514112521e95f3a26611d34b2 100644 (file)
@@ -39,4 +39,5 @@ void enable_usboh3_clk(unsigned char enable);
 #endif
 void init_clk_usdhc(u32 index);
 void clock_init(void);
+void hab_caam_clock_enable(unsigned char enable);
 #endif