[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200601175552.22286-12-mathieu.poirier@linaro.org>
Date: Mon, 1 Jun 2020 11:55:52 -0600
From: Mathieu Poirier <mathieu.poirier@...aro.org>
To: bjorn.andersson@...aro.org, ohad@...ery.com,
mcoquelin.stm32@...il.com, alexandre.torgue@...com
Cc: loic.pallardy@...com, arnaud.pouliquen@...com,
linux-remoteproc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH v4 11/11] remoteproc: stm32: Update M4 state in stm32_rproc_stop()
Update the co-processor state in function stm32_rproc_stop() so that
it can be used in scenarios where the remoteproc core is attaching
to the M4.
Mainly based on the work published by Arnaud Pouliquen [1].
[1]. https://patchwork.kernel.org/project/linux-remoteproc/list/?series=239877
Signed-off-by: Mathieu Poirier <mathieu.poirier@...aro.org>
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@...com>
---
drivers/remoteproc/stm32_rproc.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
index 77a20a638e0c..ad0307aaf3d5 100644
--- a/drivers/remoteproc/stm32_rproc.c
+++ b/drivers/remoteproc/stm32_rproc.c
@@ -503,6 +503,18 @@ static int stm32_rproc_stop(struct rproc *rproc)
}
}
+ /* update coprocessor state to OFF if available */
+ if (ddata->m4_state.map) {
+ err = regmap_update_bits(ddata->m4_state.map,
+ ddata->m4_state.reg,
+ ddata->m4_state.mask,
+ M4_STATE_OFF);
+ if (err) {
+ dev_err(&rproc->dev, "failed to set copro state\n");
+ return err;
+ }
+ }
+
return 0;
}
--
2.20.1
Powered by blists - more mailing lists