summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2016-11-30 15:27:19 +0800
committerYe Li <ye.li@nxp.com>2016-12-01 13:41:55 +0800
commit9bd4ab5c1b357a17d9cedd56aeb70c345fba106f (patch)
tree7b765a5690c6776c897157a9c12570a6b05d69fa
parent9ec47eac52420ce457794f82b016ced60dab2ca3 (diff)
downloadu-boot-imx-9bd4ab5c1b357a17d9cedd56aeb70c345fba106f.zip
u-boot-imx-9bd4ab5c1b357a17d9cedd56aeb70c345fba106f.tar.gz
u-boot-imx-9bd4ab5c1b357a17d9cedd56aeb70c345fba106f.tar.bz2
MLK-13545 mx7ulp: Add HAB boot support
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: Ye Li <ye.li@nxp.com>
-rw-r--r--arch/arm/cpu/armv7/mx7ulp/clock.c10
-rw-r--r--arch/arm/cpu/armv7/mx7ulp/soc.c8
-rw-r--r--arch/arm/include/asm/arch-mx7ulp/clock.h3
-rw-r--r--include/configs/mx7ulp_evk.h9
4 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/mx7ulp/clock.c b/arch/arm/cpu/armv7/mx7ulp/clock.c
index 3803204..0f3e2b3 100644
--- a/arch/arm/cpu/armv7/mx7ulp/clock.c
+++ b/arch/arm/cpu/armv7/mx7ulp/clock.c
@@ -298,6 +298,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.
*/
diff --git a/arch/arm/cpu/armv7/mx7ulp/soc.c b/arch/arm/cpu/armv7/mx7ulp/soc.c
index 04b98a0..4c77e84 100644
--- a/arch/arm/cpu/armv7/mx7ulp/soc.c
+++ b/arch/arm/cpu/armv7/mx7ulp/soc.c
@@ -9,6 +9,7 @@
#include <asm/sections.h>
#include <asm/arch/sys_proto.h>
#include <dm.h>
+#include <asm/imx-common/hab.h>
struct lpuart_serial_platdata {
void *reg;
@@ -23,6 +24,13 @@ U_BOOT_DEVICE(mx7ulp_lpuart) = {
.platdata = &mx7ulp_lpuart_data,
};
+#if defined(CONFIG_SECURE_BOOT)
+struct imx_sec_config_fuse_t const imx_sec_config_fuse = {
+ .bank = 29,
+ .word = 6,
+};
+#endif
+
static char *get_reset_cause(char *);
u32 get_cpu_rev(void)
diff --git a/arch/arm/include/asm/arch-mx7ulp/clock.h b/arch/arm/include/asm/arch-mx7ulp/clock.h
index 6da76a2..92d8b21 100644
--- a/arch/arm/include/asm/arch-mx7ulp/clock.h
+++ b/arch/arm/include/asm/arch-mx7ulp/clock.h
@@ -37,6 +37,9 @@ void enable_ocotp_clk(unsigned char enable);
#ifdef CONFIG_USB_EHCI
void enable_usboh3_clk(unsigned char enable);
#endif
+#ifdef CONFIG_SECURE_BOOT
+void hab_caam_clock_enable(unsigned char enable);
+#endif
void init_clk_usdhc(u32 index);
void clock_init(void);
#endif
diff --git a/include/configs/mx7ulp_evk.h b/include/configs/mx7ulp_evk.h
index af0cce0..054751b 100644
--- a/include/configs/mx7ulp_evk.h
+++ b/include/configs/mx7ulp_evk.h
@@ -15,6 +15,15 @@
/*Uncomment it to use plugin boot*/
/*#define CONFIG_USE_PLUGIN*/
+/*Uncomment it to use secure boot*/
+/*#define CONFIG_SECURE_BOOT*/
+
+#ifdef CONFIG_SECURE_BOOT
+#ifndef CONFIG_CSF_SIZE
+#define CONFIG_CSF_SIZE 0x4000
+#endif
+#endif
+
#define CONFIG_SYS_VSNPRINTF
#define CONFIG_BOARD_POSTCLK_INIT
#define CONFIG_IMX_FIXED_IVT_OFFSET