From 08680b128d388724755e849ef72bc5644268a44b Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Fri, 14 May 2021 18:58:33 +0800 Subject: [PATCH] LF-3779 remoteproc: imx_rproc: fix earlyboot detection Here the earlyboot detection updated to use 0xB for the low four bits. The previous detection not work, because with BIT0 set, BIT1 will be automatically set, and BIT3 are also set by us. So we detect BIT[3,1,0] here. Reviewed-by: Ye Li Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index b0161fcaf2dc..63de50470fd0 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -37,7 +37,8 @@ #define IMX7D_M4_START (IMX7D_ENABLE_M4 | IMX7D_SW_M4P_RST \ | IMX7D_SW_M4C_RST) -#define IMX7D_M4_STOP (IMX7D_ENABLE_M4 | IMX7D_SW_M4C_NON_SCLR_RST) +#define IMX7D_M4_STOP (IMX7D_ENABLE_M4 | IMX7D_SW_M4C_RST | \ + IMX7D_SW_M4C_NON_SCLR_RST) /* Address: 0x020D8000 */ #define IMX6SX_SRC_SCR 0x00 @@ -1019,7 +1020,7 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv) dev_err(dev, "Failed to read src\n"); return ret; } - priv->early_boot = !(val & dcfg->src_stop); + priv->early_boot = ((val & dcfg->src_mask) != dcfg->src_stop); break; case IMX_ARM_SMCCC: arm_smccc_smc(IMX_SIP_SRC, IMX_SIP_SRC_M4_STARTED, 0, 0, 0, 0, 0, 0, &res); -- 2.17.1