[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221102112451.128110-3-peng.fan@oss.nxp.com>
Date: Wed, 2 Nov 2022 19:24:51 +0800
From: "Peng Fan (OSS)" <peng.fan@....nxp.com>
To: andersson@...nel.org, mathieu.poirier@...aro.org,
shawnguo@...nel.org, s.hauer@...gutronix.de, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org
Cc: kernel@...gutronix.de, festevam@...il.com, linux-imx@....com,
linux-remoteproc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, Peng Fan <peng.fan@....com>
Subject: [PATCH V2 2/2] remoteproc: imx_rproc: delay after kick remote processor
From: Peng Fan <peng.fan@....com>
There is case that after remoteproc start remote processor[M4], the M4
runs slow and before M4 finish its own rpmsg framework initialization,
linux sends out vring kick message, then M4 firmware drops the kick
message. Some NXP released Cortex-M[x] images has such limitation that
it requires linux sends out vring kick message after M4 firmware finish
its rpmsg framework initialization.
So add delay before linux send out vring kick message.
Signed-off-by: Peng Fan <peng.fan@....com>
---
drivers/remoteproc/imx_rproc.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 9fc978e0393c..aa4e06f54f27 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -6,6 +6,7 @@
#include <dt-bindings/firmware/imx/rsrc.h>
#include <linux/arm-smccc.h>
#include <linux/clk.h>
+#include <linux/delay.h>
#include <linux/err.h>
#include <linux/firmware/imx/sci.h>
#include <linux/interrupt.h>
@@ -110,6 +111,7 @@ struct imx_rproc {
u32 core_index;
struct device **pd_dev;
struct device_link **pd_dev_link;
+ u32 startup_delay;
};
static const struct imx_rproc_att imx_rproc_att_imx93[] = {
@@ -382,6 +384,9 @@ static int imx_rproc_start(struct rproc *rproc)
if (ret)
dev_err(dev, "Failed to enable remote core!\n");
+ if (priv->startup_delay)
+ msleep_interruptible(priv->startup_delay);
+
return ret;
}
@@ -1087,6 +1092,10 @@ static int imx_rproc_probe(struct platform_device *pdev)
if (rproc->state != RPROC_DETACHED)
rproc->auto_boot = of_property_read_bool(np, "fsl,auto-boot");
+ ret = of_property_read_u32(np, "fsl,startup-delay-ms", &priv->startup_delay);
+ if (ret)
+ priv->startup_delay = 0;
+
ret = rproc_add(rproc);
if (ret) {
dev_err(dev, "rproc_add failed\n");
--
2.37.1
Powered by blists - more mailing lists