diff mbox series

[V5,5/8] remoteproc: imx_rproc: initial support for mutilple start/stop method

Message ID 1618971622-30539-6-git-send-email-peng.fan@oss.nxp.com
State Superseded
Headers show
Series remoteproc: imx_rproc: support i.MX7ULP/8MN/8MP | expand

Commit Message

Peng Fan (OSS) April 21, 2021, 2:20 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>


Add three methods IMX_RPROC_NONE(no need start/stop), IMX_RPROC_MMIO
(start/stop through mmio) and IMX_RPROC_SMC(start/stop through ARM SMCCC).

The current SoCs supported are all using IMX_RPROC_MMIO.

Signed-off-by: Peng Fan <peng.fan@nxp.com>

---
 drivers/remoteproc/imx_rproc.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

-- 
2.30.0

Comments

Mathieu Poirier May 3, 2021, 4:30 p.m. UTC | #1
On Wed, Apr 21, 2021 at 10:20:19AM +0800, peng.fan@oss.nxp.com wrote:
> From: Peng Fan <peng.fan@nxp.com>

> 

> Add three methods IMX_RPROC_NONE(no need start/stop), IMX_RPROC_MMIO

> (start/stop through mmio) and IMX_RPROC_SMC(start/stop through ARM SMCCC).

> 

> The current SoCs supported are all using IMX_RPROC_MMIO.

> 

> Signed-off-by: Peng Fan <peng.fan@nxp.com>

> ---

>  drivers/remoteproc/imx_rproc.c | 13 +++++++++++++

>  1 file changed, 13 insertions(+)


Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>


> 

> diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c

> index 06dac92e98e6..6289aeae95b6 100644

> --- a/drivers/remoteproc/imx_rproc.c

> +++ b/drivers/remoteproc/imx_rproc.c

> @@ -74,6 +74,15 @@ struct imx_rproc_att {

>  	int flags;

>  };

>  

> +/* Remote core start/stop method */

> +enum imx_rproc_method {

> +	IMX_RPROC_NONE,

> +	/* Through syscon regmap */

> +	IMX_RPROC_MMIO,

> +	/* Through ARM SMCCC */

> +	IMX_RPROC_SMC,

> +};

> +

>  struct imx_rproc_dcfg {

>  	u32				src_reg;

>  	u32				src_mask;

> @@ -81,6 +90,7 @@ struct imx_rproc_dcfg {

>  	u32				src_stop;

>  	const struct imx_rproc_att	*att;

>  	size_t				att_size;

> +	enum imx_rproc_method		method;

>  };

>  

>  struct imx_rproc {

> @@ -183,6 +193,7 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = {

>  	.src_stop	= IMX7D_M4_STOP,

>  	.att		= imx_rproc_att_imx8mq,

>  	.att_size	= ARRAY_SIZE(imx_rproc_att_imx8mq),

> +	.method		= IMX_RPROC_MMIO,

>  };

>  

>  static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = {

> @@ -192,6 +203,7 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = {

>  	.src_stop	= IMX7D_M4_STOP,

>  	.att		= imx_rproc_att_imx7d,

>  	.att_size	= ARRAY_SIZE(imx_rproc_att_imx7d),

> +	.method		= IMX_RPROC_MMIO,

>  };

>  

>  static const struct imx_rproc_dcfg imx_rproc_cfg_imx6sx = {

> @@ -201,6 +213,7 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx6sx = {

>  	.src_stop	= IMX6SX_M4_STOP,

>  	.att		= imx_rproc_att_imx6sx,

>  	.att_size	= ARRAY_SIZE(imx_rproc_att_imx6sx),

> +	.method		= IMX_RPROC_MMIO,

>  };

>  

>  static int imx_rproc_start(struct rproc *rproc)

> -- 

> 2.30.0

>
diff mbox series

Patch

diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 06dac92e98e6..6289aeae95b6 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -74,6 +74,15 @@  struct imx_rproc_att {
 	int flags;
 };
 
+/* Remote core start/stop method */
+enum imx_rproc_method {
+	IMX_RPROC_NONE,
+	/* Through syscon regmap */
+	IMX_RPROC_MMIO,
+	/* Through ARM SMCCC */
+	IMX_RPROC_SMC,
+};
+
 struct imx_rproc_dcfg {
 	u32				src_reg;
 	u32				src_mask;
@@ -81,6 +90,7 @@  struct imx_rproc_dcfg {
 	u32				src_stop;
 	const struct imx_rproc_att	*att;
 	size_t				att_size;
+	enum imx_rproc_method		method;
 };
 
 struct imx_rproc {
@@ -183,6 +193,7 @@  static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = {
 	.src_stop	= IMX7D_M4_STOP,
 	.att		= imx_rproc_att_imx8mq,
 	.att_size	= ARRAY_SIZE(imx_rproc_att_imx8mq),
+	.method		= IMX_RPROC_MMIO,
 };
 
 static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = {
@@ -192,6 +203,7 @@  static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = {
 	.src_stop	= IMX7D_M4_STOP,
 	.att		= imx_rproc_att_imx7d,
 	.att_size	= ARRAY_SIZE(imx_rproc_att_imx7d),
+	.method		= IMX_RPROC_MMIO,
 };
 
 static const struct imx_rproc_dcfg imx_rproc_cfg_imx6sx = {
@@ -201,6 +213,7 @@  static const struct imx_rproc_dcfg imx_rproc_cfg_imx6sx = {
 	.src_stop	= IMX6SX_M4_STOP,
 	.att		= imx_rproc_att_imx6sx,
 	.att_size	= ARRAY_SIZE(imx_rproc_att_imx6sx),
+	.method		= IMX_RPROC_MMIO,
 };
 
 static int imx_rproc_start(struct rproc *rproc)