From 82beeec96ad2d271881c9e97dcd5c7b57e7df3c8 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Tue, 28 Nov 2017 23:42:16 -0600 Subject: imx8mq: Add HAB support Since the HAB only works in secure mode. The BL33 runs at EL2 non-secure can't intialize the HAB successfully. So add the SIP call for these HAB interfaces, BL33 will trap to ATF to run the HAB. The HAB codes locates in ROM, and need to access OCRAM, CAAM RAM and DDR to authenticate image. Add these relevant memory region to MMU. Also extend the stack size of each core to avoid stack overflow by HAB. Signed-off-by: Ye Li --- plat/imx/common/include/fsl_sip.h | 7 +++++++ plat/imx/common/sip_svc.c | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'plat/imx/common') diff --git a/plat/imx/common/include/fsl_sip.h b/plat/imx/common/include/fsl_sip.h index db4dae61..9103bcc3 100644 --- a/plat/imx/common/include/fsl_sip.h +++ b/plat/imx/common/include/fsl_sip.h @@ -38,4 +38,11 @@ #define FSL_SIP_GET_SOC_INFO 0xc2000006 +#define FSL_SIP_HAB 0xc2000007 +#define FSL_SIP_HAB_AUTHENTICATE 0x00 +#define FSL_SIP_HAB_ENTRY 0x01 +#define FSL_SIP_HAB_EXIT 0x02 +#define FSL_SIP_HAB_REPORT_EVENT 0x03 +#define FSL_SIP_HAB_REPORT_STATUS 0x04 + #endif diff --git a/plat/imx/common/sip_svc.c b/plat/imx/common/sip_svc.c index 1885261d..7ac1ecdc 100644 --- a/plat/imx/common/sip_svc.c +++ b/plat/imx/common/sip_svc.c @@ -46,6 +46,7 @@ extern int imx_srtc_handler(uint32_t smc_fid, void *handle, u_register_t x1, extern int lpddr4_dvfs_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2, u_register_t x3); extern int imx_src_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2, u_register_t x3); extern int imx_soc_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2, u_register_t x3); +extern int imx_hab_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2, u_register_t x3, u_register_t x4); /* Setup i.MX platform specific services Services */ static int32_t plat_svc_setup(void) @@ -124,6 +125,9 @@ uintptr_t imx_svc_smc_handler(uint32_t smc_fid, case FSL_SIP_GET_SOC_INFO: SMC_RET1(handle, imx_soc_handler(smc_fid, x1, x2, x3)); break; + case FSL_SIP_HAB: + SMC_RET1(handle, imx_hab_handler(smc_fid, x1, x2, x3, x4)); + break; #endif #if (defined(PLAT_IMX8QM) || defined(PLAT_IMX8QXP)) case FSL_SIP_CPUFREQ: -- cgit v1.2.3