From 9bd4ab5c1b357a17d9cedd56aeb70c345fba106f Mon Sep 17 00:00:00 2001 From: Ye Li Date: Wed, 30 Nov 2016 15:27:19 +0800 Subject: 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 --- arch/arm/cpu/armv7/mx7ulp/clock.c | 10 ++++++++++ arch/arm/cpu/armv7/mx7ulp/soc.c | 8 ++++++++ arch/arm/include/asm/arch-mx7ulp/clock.h | 3 +++ 3 files changed, 21 insertions(+) (limited to 'arch') 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 #include #include +#include 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 -- cgit v1.1