From: Peng Fan Date: Fri, 14 May 2021 10:58:33 +0000 (+0800) Subject: LF-3779 remoteproc: imx_rproc: fix earlyboot detection X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~71 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=5.10.35-05035-g08680b128d38;p=linux.git 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 --- 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);