From bfbf223ed855d31085d0a6469aa94357ae0c3674 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Wed, 1 Apr 2020 17:22:36 +0800 Subject: MLK-23727 imx8mp/n: support stop M7 Support stop M7 with SIP call. Per IC team, to rekick M7 need follow steps. If M7 already in WFI, perform below steps. a) Set [0x303A_002C].0=0 [ request SLEEPHOLDREQn ] b) Wait [0x303A_00EC].1 = 0 [ wait SLEEPHOLDACKn ] c) Set GPR.CPUWAIT=1 d) Set [0x303A_002C].0=1 [ de-assert SLEEPHOLDREQn ] e) Set SRC_M7_RCR[3:0] = 0xE0 [ reset M7 core/plat ] f) Wait SRC_M7_RCR[3:0] = 0x8 g) Init TCM or DDR h) Set GPR.INITVTOR i) Set GPR.CPUWAIT=0, M7 starting running Add a timeout check, if timeout, still perform force reset, in this way no need to rely on M7 team's image wfi support ready. Return a1,a2 to caller to check timeout or reset fail. Reviewed-by: Jacky Bai Signed-off-by: Peng Fan --- plat/imx/common/imx_sip_svc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plat/imx/common/imx_sip_svc.c') diff --git a/plat/imx/common/imx_sip_svc.c b/plat/imx/common/imx_sip_svc.c index 74b59e83..2fad4740 100644 --- a/plat/imx/common/imx_sip_svc.c +++ b/plat/imx/common/imx_sip_svc.c @@ -34,7 +34,7 @@ static uintptr_t imx_sip_handler(unsigned int smc_fid, SMC_RET1(handle, imx_gpc_handler(smc_fid, x1, x2, x3)); break; case IMX_SIP_SRC: - SMC_RET1(handle, imx_src_handler(smc_fid, x1, x2, x3)); + SMC_RET1(handle, imx_src_handler(smc_fid, x1, x2, x3, handle)); break; case IMX_SIP_DDR_DVFS: return dram_dvfs_handler(smc_fid, handle, x1, x2, x3); @@ -52,7 +52,7 @@ static uintptr_t imx_sip_handler(unsigned int smc_fid, SMC_RET1(handle, imx_gpc_handler(smc_fid, x1, x2, x3)); break; case IMX_SIP_SRC: - SMC_RET1(handle, imx_src_handler(smc_fid, x1, x2, x3)); + SMC_RET1(handle, imx_src_handler(smc_fid, x1, x2, x3, handle)); break; case IMX_SIP_HAB: SMC_RET1(handle, imx_hab_handler(smc_fid, x1, x2, x3, x4)); -- cgit v1.2.3