Skip to content

Commit da87976

Browse files
MrVanandersson
authored andcommitted
remoteproc: imx_rproc: correct firmware reload
ENABLE_M4 should be set to 1 when loading code to TCM, otherwise you will not able to replace the firmware after you stop m4. Besides ENABLE_M4, we still need set SW_M4C_RST, because this bit will be automatically set with SW_M4C_NON_SCLR_RST set. Reviewed-by: Mathieu Poirier <[email protected]> Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent fdc1223 commit da87976

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/remoteproc/imx_rproc.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434

3535
#define IMX7D_M4_START (IMX7D_ENABLE_M4 | IMX7D_SW_M4P_RST \
3636
| IMX7D_SW_M4C_RST)
37-
#define IMX7D_M4_STOP IMX7D_SW_M4C_NON_SCLR_RST
37+
#define IMX7D_M4_STOP (IMX7D_ENABLE_M4 | IMX7D_SW_M4C_RST | \
38+
IMX7D_SW_M4C_NON_SCLR_RST)
3839

3940
/* Address: 0x020D8000 */
4041
#define IMX6SX_SRC_SCR 0x00
@@ -45,7 +46,8 @@
4546

4647
#define IMX6SX_M4_START (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4P_RST \
4748
| IMX6SX_SW_M4C_RST)
48-
#define IMX6SX_M4_STOP IMX6SX_SW_M4C_NON_SCLR_RST
49+
#define IMX6SX_M4_STOP (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4C_RST | \
50+
IMX6SX_SW_M4C_NON_SCLR_RST)
4951
#define IMX6SX_M4_RST_MASK (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4P_RST \
5052
| IMX6SX_SW_M4C_NON_SCLR_RST \
5153
| IMX6SX_SW_M4C_RST)
@@ -684,7 +686,7 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv)
684686
return ret;
685687
}
686688

687-
if (!(val & dcfg->src_stop))
689+
if ((val & dcfg->src_mask) != dcfg->src_stop)
688690
priv->rproc->state = RPROC_DETACHED;
689691

690692
return 0;

0 commit comments

Comments
 (0)