summaryrefslogtreecommitdiff
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2021-04-08 09:44:48 +0800
committerBjorn Andersson <bjorn.andersson@linaro.org>2021-04-13 21:10:32 -0500
commit10a3d4079eaea06472f1981152e2840e7232ffa9 (patch)
tree8555a6e6d3fab74d9bef79e6f88efc8f40142222 /drivers/remoteproc
parentf638a19775ae60ae919ff604fdc04362ff4f817f (diff)
remoteproc: imx_rproc: move memory parsing to rproc_ops
Use the rproc_ops::prepare() hook for doing memory resources reallocation when reattaching a remote procesor. Suggested-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/1617846289-13496-4-git-send-email-peng.fan@oss.nxp.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/imx_rproc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index b05aae0ad7a2..7cd09971d1a4 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -317,7 +317,7 @@ static int imx_rproc_mem_release(struct rproc *rproc,
return 0;
}
-static int imx_rproc_parse_memory_regions(struct rproc *rproc)
+static int imx_rproc_prepare(struct rproc *rproc)
{
struct imx_rproc *priv = rproc->priv;
struct device_node *np = priv->dev->of_node;
@@ -363,10 +363,7 @@ static int imx_rproc_parse_memory_regions(struct rproc *rproc)
static int imx_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
{
- int ret = imx_rproc_parse_memory_regions(rproc);
-
- if (ret)
- return ret;
+ int ret;
ret = rproc_elf_load_rsc_table(rproc, fw);
if (ret)
@@ -399,6 +396,7 @@ static void imx_rproc_kick(struct rproc *rproc, int vqid)
}
static const struct rproc_ops imx_rproc_ops = {
+ .prepare = imx_rproc_prepare,
.start = imx_rproc_start,
.stop = imx_rproc_stop,
.kick = imx_rproc_kick,