[U-Boot] [PATCH V2 16/20] mx7ulp: Add HAB boot support
Stefano Babic
sbabic at denx.de
Sun Feb 12 09:28:00 UTC 2017
On 27/12/2016 11:04, Peng Fan wrote:
> 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 at nxp.com>
> Signed-off-by: Ye Li <ye.li at nxp.com>
> Cc: Stefano Babic <sbabic at denx.de>
> ---
>
> V2:
> New
>
> arch/arm/cpu/armv7/mx7ulp/clock.c | 10 ++++++++++
> arch/arm/cpu/armv7/mx7ulp/soc.c | 8 ++++++++
> arch/arm/imx-common/hab.c | 3 ++-
> arch/arm/include/asm/arch-mx7ulp/clock.h | 1 +
> 4 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/cpu/armv7/mx7ulp/clock.c b/arch/arm/cpu/armv7/mx7ulp/clock.c
> index 30db67d..f7eaa4b 100644
> --- a/arch/arm/cpu/armv7/mx7ulp/clock.c
> +++ b/arch/arm/cpu/armv7/mx7ulp/clock.c
> @@ -312,6 +312,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 d04edc5..6fa97bb 100644
> --- a/arch/arm/cpu/armv7/mx7ulp/soc.c
> +++ b/arch/arm/cpu/armv7/mx7ulp/soc.c
> @@ -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 */
> diff --git a/arch/arm/imx-common/hab.c b/arch/arm/imx-common/hab.c
> index 6731825..74bb3ff 100644
> --- a/arch/arm/imx-common/hab.c
> +++ b/arch/arm/imx-common/hab.c
> @@ -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) -
> diff --git a/arch/arm/include/asm/arch-mx7ulp/clock.h b/arch/arm/include/asm/arch-mx7ulp/clock.h
> index ebf32c6..170a9b3 100644
> --- a/arch/arm/include/asm/arch-mx7ulp/clock.h
> +++ b/arch/arm/include/asm/arch-mx7ulp/clock.h
> @@ -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
>
Reviewed-by : Stefano Babic <sbabic at denx.de>
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
More information about the U-Boot
mailing list