summaryrefslogtreecommitdiff
path: root/plat/imx/common
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-11-28 23:42:16 -0600
committerAbel Vesa <abel.vesa@nxp.com>2018-06-11 10:32:52 +0300
commit82beeec96ad2d271881c9e97dcd5c7b57e7df3c8 (patch)
tree63a8aa3c9f690e928d7b449b84f75a84b97bf4b1 /plat/imx/common
parent1fff21f4d6a3314c8d8f181822bc8b2dcc1d61a6 (diff)
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 <ye.li@nxp.com>
Diffstat (limited to 'plat/imx/common')
-rw-r--r--plat/imx/common/include/fsl_sip.h7
-rw-r--r--plat/imx/common/sip_svc.c4
2 files changed, 11 insertions, 0 deletions
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: