All of lore.kernel.org
 help / color / mirror / Atom feed
From: peng.fan@oss.nxp.com
To: ohad@wizery.com, bjorn.andersson@linaro.org,
	mathieu.poirier@linaro.org, o.rempel@pengutronix.de,
	robh+dt@kernel.org, devicetree@vger.kernel.org
Cc: shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com,
	linux-remoteproc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>
Subject: [PATCH V4 7/8] remoteproc: imx_rproc: support i.MX7ULP
Date: Thu, 15 Apr 2021 21:27:40 +0800	[thread overview]
Message-ID: <1618493261-32606-8-git-send-email-peng.fan@oss.nxp.com> (raw)
In-Reply-To: <1618493261-32606-1-git-send-email-peng.fan@oss.nxp.com>

From: Peng Fan <peng.fan@nxp.com>

i.MX7ULP A7 core runs under control of M4 core, M4 core starts by ROM
and powers most serivces used by A7 core, so A7 core has no power to
start and stop M4 core. And the M4 core's state is default RPROC_DETACHED
and remoteproc framework not able to stop the M4 core.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/remoteproc/imx_rproc.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 56dfcc1..0592865 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -136,6 +136,14 @@ static const struct imx_rproc_att imx_rproc_att_imx8mq[] = {
 	{ 0x40000000, 0x40000000, 0x80000000, 0 },
 };
 
+static const struct imx_rproc_att imx_rproc_att_imx7ulp[] = {
+	{0x1FFD0000, 0x1FFD0000, 0x30000, ATT_OWN},
+	{0x20000000, 0x20000000, 0x10000, ATT_OWN},
+	{0x2F000000, 0x2F000000, 0x20000, ATT_OWN},
+	{0x2F020000, 0x2F020000, 0x20000, ATT_OWN},
+	{0x60000000, 0x60000000, 0x40000000, 0}
+};
+
 static const struct imx_rproc_att imx_rproc_att_imx7d[] = {
 	/* dev addr , sys addr  , size	    , flags */
 	/* OCRAM_S (M4 Boot code) - alias */
@@ -196,6 +204,12 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = {
 	.method		= IMX_RPROC_MMIO,
 };
 
+static const struct imx_rproc_dcfg imx_rproc_cfg_imx7ulp = {
+	.att		= imx_rproc_att_imx7ulp,
+	.att_size	= ARRAY_SIZE(imx_rproc_att_imx7ulp),
+	.method		= IMX_RPROC_NONE,
+};
+
 static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = {
 	.src_reg	= IMX7D_SRC_SCR,
 	.src_mask	= IMX7D_M4_RST_MASK,
@@ -238,6 +252,9 @@ static int imx_rproc_stop(struct rproc *rproc)
 	struct device *dev = priv->dev;
 	int ret;
 
+	if (dcfg->method == IMX_RPROC_NONE)
+		return -EOPNOTSUPP;
+
 	ret = regmap_update_bits(priv->regmap, dcfg->src_reg,
 				 dcfg->src_mask, dcfg->src_stop);
 	if (ret)
@@ -580,8 +597,13 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv)
 	int ret;
 	u32 val;
 
-	if (dcfg->method != IMX_RPROC_MMIO)
+	switch (dcfg->method) {
+	case IMX_RPROC_NONE:
+		priv->rproc->state = RPROC_DETACHED;
 		return 0;
+	default:
+		break;
+	}
 
 	regmap = syscon_regmap_lookup_by_phandle(dev->of_node, "syscon");
 	if (IS_ERR(regmap)) {
@@ -726,6 +748,7 @@ static int imx_rproc_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id imx_rproc_of_match[] = {
+	{ .compatible = "fsl,imx7ulp-cm4", .data = &imx_rproc_cfg_imx7ulp },
 	{ .compatible = "fsl,imx7d-cm4", .data = &imx_rproc_cfg_imx7d },
 	{ .compatible = "fsl,imx6sx-cm4", .data = &imx_rproc_cfg_imx6sx },
 	{ .compatible = "fsl,imx8mq-cm4", .data = &imx_rproc_cfg_imx8mq },
-- 
2.7.4


WARNING: multiple messages have this Message-ID (diff)
From: peng.fan@oss.nxp.com
To: ohad@wizery.com, bjorn.andersson@linaro.org,
	mathieu.poirier@linaro.org, o.rempel@pengutronix.de,
	robh+dt@kernel.org, devicetree@vger.kernel.org
Cc: shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com,
	linux-remoteproc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>
Subject: [PATCH V4 7/8] remoteproc: imx_rproc: support i.MX7ULP
Date: Thu, 15 Apr 2021 21:27:40 +0800	[thread overview]
Message-ID: <1618493261-32606-8-git-send-email-peng.fan@oss.nxp.com> (raw)
In-Reply-To: <1618493261-32606-1-git-send-email-peng.fan@oss.nxp.com>

From: Peng Fan <peng.fan@nxp.com>

i.MX7ULP A7 core runs under control of M4 core, M4 core starts by ROM
and powers most serivces used by A7 core, so A7 core has no power to
start and stop M4 core. And the M4 core's state is default RPROC_DETACHED
and remoteproc framework not able to stop the M4 core.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/remoteproc/imx_rproc.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 56dfcc1..0592865 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -136,6 +136,14 @@ static const struct imx_rproc_att imx_rproc_att_imx8mq[] = {
 	{ 0x40000000, 0x40000000, 0x80000000, 0 },
 };
 
+static const struct imx_rproc_att imx_rproc_att_imx7ulp[] = {
+	{0x1FFD0000, 0x1FFD0000, 0x30000, ATT_OWN},
+	{0x20000000, 0x20000000, 0x10000, ATT_OWN},
+	{0x2F000000, 0x2F000000, 0x20000, ATT_OWN},
+	{0x2F020000, 0x2F020000, 0x20000, ATT_OWN},
+	{0x60000000, 0x60000000, 0x40000000, 0}
+};
+
 static const struct imx_rproc_att imx_rproc_att_imx7d[] = {
 	/* dev addr , sys addr  , size	    , flags */
 	/* OCRAM_S (M4 Boot code) - alias */
@@ -196,6 +204,12 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = {
 	.method		= IMX_RPROC_MMIO,
 };
 
+static const struct imx_rproc_dcfg imx_rproc_cfg_imx7ulp = {
+	.att		= imx_rproc_att_imx7ulp,
+	.att_size	= ARRAY_SIZE(imx_rproc_att_imx7ulp),
+	.method		= IMX_RPROC_NONE,
+};
+
 static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = {
 	.src_reg	= IMX7D_SRC_SCR,
 	.src_mask	= IMX7D_M4_RST_MASK,
@@ -238,6 +252,9 @@ static int imx_rproc_stop(struct rproc *rproc)
 	struct device *dev = priv->dev;
 	int ret;
 
+	if (dcfg->method == IMX_RPROC_NONE)
+		return -EOPNOTSUPP;
+
 	ret = regmap_update_bits(priv->regmap, dcfg->src_reg,
 				 dcfg->src_mask, dcfg->src_stop);
 	if (ret)
@@ -580,8 +597,13 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv)
 	int ret;
 	u32 val;
 
-	if (dcfg->method != IMX_RPROC_MMIO)
+	switch (dcfg->method) {
+	case IMX_RPROC_NONE:
+		priv->rproc->state = RPROC_DETACHED;
 		return 0;
+	default:
+		break;
+	}
 
 	regmap = syscon_regmap_lookup_by_phandle(dev->of_node, "syscon");
 	if (IS_ERR(regmap)) {
@@ -726,6 +748,7 @@ static int imx_rproc_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id imx_rproc_of_match[] = {
+	{ .compatible = "fsl,imx7ulp-cm4", .data = &imx_rproc_cfg_imx7ulp },
 	{ .compatible = "fsl,imx7d-cm4", .data = &imx_rproc_cfg_imx7d },
 	{ .compatible = "fsl,imx6sx-cm4", .data = &imx_rproc_cfg_imx6sx },
 	{ .compatible = "fsl,imx8mq-cm4", .data = &imx_rproc_cfg_imx8mq },
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-04-15 13:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 13:27 [PATCH V4 0/8] remoteproc: imx_rproc: support i.MX7ULP/8MN/8MP peng.fan
2021-04-15 13:27 ` peng.fan
2021-04-15 13:27 ` [PATCH V4 1/8] dt-bindings: remoteproc: imx_rproc: add fsl,auto-boot property peng.fan
2021-04-15 13:27   ` [PATCH V4 1/8] dt-bindings: remoteproc: imx_rproc: add fsl, auto-boot property peng.fan
2021-04-15 13:27 ` [PATCH V4 2/8] dt-bindings: remoteproc: imx_rproc: add i.MX7ULP support peng.fan
2021-04-15 13:27   ` peng.fan
2021-04-15 13:27 ` [PATCH V4 3/8] dt-bindings: remoteproc: imx_rproc: support i.MX8MN/P peng.fan
2021-04-15 13:27   ` peng.fan
2021-04-15 13:27 ` [PATCH V4 4/8] remoteproc: imx_rproc: parse fsl,auto-boot peng.fan
2021-04-15 13:27   ` peng.fan
2021-04-16 17:41   ` Mathieu Poirier
2021-04-16 17:41     ` Mathieu Poirier
2021-04-15 13:27 ` [PATCH V4 5/8] remoteproc: imx_rproc: initial support for mutilple start/stop method peng.fan
2021-04-15 13:27   ` peng.fan
2021-04-16 17:44   ` Mathieu Poirier
2021-04-16 17:44     ` Mathieu Poirier
2021-04-15 13:27 ` [PATCH V4 6/8] remoteproc: imx_rproc: make clk optional peng.fan
2021-04-15 13:27   ` peng.fan
2021-04-16 17:46   ` Mathieu Poirier
2021-04-16 17:46     ` Mathieu Poirier
2021-04-15 13:27 ` peng.fan [this message]
2021-04-15 13:27   ` [PATCH V4 7/8] remoteproc: imx_rproc: support i.MX7ULP peng.fan
2021-04-16 17:47   ` Mathieu Poirier
2021-04-16 17:47     ` Mathieu Poirier
2021-04-15 13:27 ` [PATCH V4 8/8] remoteproc: imx_rproc: support i.MX8MN/P peng.fan
2021-04-15 13:27   ` peng.fan
2021-04-16 17:58 ` [PATCH V4 0/8] remoteproc: imx_rproc: support i.MX7ULP/8MN/8MP Mathieu Poirier
2021-04-16 17:58   ` Mathieu Poirier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1618493261-32606-8-git-send-email-peng.fan@oss.nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=o.rempel@pengutronix.de \
    --cc=ohad@wizery.com \
    --cc=peng.fan@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.