diff mbox series

[5/9] remoteproc: imx_rproc: parse early-booted property

Message ID 1582097265-20170-6-git-send-email-peng.fan@nxp.com (mailing list archive)
State New, archived
Headers show
Series remoteproc: imx_rproc: support i.MX8/8M/7ULP | expand

Commit Message

Peng Fan Feb. 19, 2020, 7:27 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>

If early-property exists, there is no need to check syscon.
Just mark early_boot as true.

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

Comments

Mathieu Poirier Feb. 21, 2020, 9:56 p.m. UTC | #1
On Wed, Feb 19, 2020 at 03:27:41PM +0800, peng.fan@nxp.com wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> If early-property exists, there is no need to check syscon.
> Just mark early_boot as true.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/remoteproc/imx_rproc.c | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
> index b9fabe269fd2..e31ea1090cf3 100644
> --- a/drivers/remoteproc/imx_rproc.c
> +++ b/drivers/remoteproc/imx_rproc.c
> @@ -483,7 +483,9 @@ static int imx_rproc_configure_mode(struct imx_rproc *priv)
>  	int ret;
>  	u32 val;
>  
> -	if (of_get_property(dev->of_node, "early-booted", NULL)) {
> +	if (dcfg->variants == IMX7ULP) {

Where does dcfg->variants comes from?  

This patch doesn't compile, nor does the one before it.  I will not review
another patchset like that. 

> +		priv->early_boot = true;
> +	} else if (of_get_property(dev->of_node, "early-booted", NULL)) {
>  		priv->early_boot = true;
>  	} else {
>  		ret = regmap_read(priv->regmap, dcfg->src_reg, &val);
> @@ -509,15 +511,17 @@ static int imx_rproc_probe(struct platform_device *pdev)
>  	struct rproc *rproc;
>  	struct regmap_config config = { .name = "imx-rproc" };
>  	const struct imx_rproc_dcfg *dcfg;
> -	struct regmap *regmap;
> +	struct regmap *regmap = NULL;
>  	int ret;
>  
> -	regmap = syscon_regmap_lookup_by_phandle(np, "syscon");
> -	if (IS_ERR(regmap)) {
> -		dev_err(dev, "failed to find syscon\n");
> -		return PTR_ERR(regmap);
> +	if (!of_get_property(np, "early-booted", NULL)) {
> +		regmap = syscon_regmap_lookup_by_phandle(np, "syscon");
> +		if (IS_ERR(regmap)) {
> +			dev_err(dev, "failed to find syscon\n");
> +			return PTR_ERR(regmap);
> +		}
> +		regmap_attach_dev(dev, regmap, &config);
>  	}
> -	regmap_attach_dev(dev, regmap, &config);
>  
>  	/* set some other name then imx */
>  	rproc = rproc_alloc(dev, "imx-rproc", &imx_rproc_ops,
> -- 
> 2.16.4
>
Peng Fan Feb. 23, 2020, 12:11 a.m. UTC | #2
> Subject: Re: [PATCH 5/9] remoteproc: imx_rproc: parse early-booted property
> 
> On Wed, Feb 19, 2020 at 03:27:41PM +0800, peng.fan@nxp.com wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > If early-property exists, there is no need to check syscon.
> > Just mark early_boot as true.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  drivers/remoteproc/imx_rproc.c | 18 +++++++++++-------
> >  1 file changed, 11 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/remoteproc/imx_rproc.c
> > b/drivers/remoteproc/imx_rproc.c index b9fabe269fd2..e31ea1090cf3
> > 100644
> > --- a/drivers/remoteproc/imx_rproc.c
> > +++ b/drivers/remoteproc/imx_rproc.c
> > @@ -483,7 +483,9 @@ static int imx_rproc_configure_mode(struct
> imx_rproc *priv)
> >  	int ret;
> >  	u32 val;
> >
> > -	if (of_get_property(dev->of_node, "early-booted", NULL)) {
> > +	if (dcfg->variants == IMX7ULP) {
> 
> Where does dcfg->variants comes from?
> 
> This patch doesn't compile, nor does the one before it.  I will not review
> another patchset like that.

Ah. Weird. variants should be variant. 
See https://patchwork.kernel.org/patch/11390559/

I need wait early boot related functions in
remoteproc-core.c ready, then post v2.

Thanks,
Peng.
> 
> > +		priv->early_boot = true;
> > +	} else if (of_get_property(dev->of_node, "early-booted", NULL)) {
> >  		priv->early_boot = true;
> >  	} else {
> >  		ret = regmap_read(priv->regmap, dcfg->src_reg, &val); @@ -509,15
> > +511,17 @@ static int imx_rproc_probe(struct platform_device *pdev)
> >  	struct rproc *rproc;
> >  	struct regmap_config config = { .name = "imx-rproc" };
> >  	const struct imx_rproc_dcfg *dcfg;
> > -	struct regmap *regmap;
> > +	struct regmap *regmap = NULL;
> >  	int ret;
> >
> > -	regmap = syscon_regmap_lookup_by_phandle(np, "syscon");
> > -	if (IS_ERR(regmap)) {
> > -		dev_err(dev, "failed to find syscon\n");
> > -		return PTR_ERR(regmap);
> > +	if (!of_get_property(np, "early-booted", NULL)) {
> > +		regmap = syscon_regmap_lookup_by_phandle(np, "syscon");
> > +		if (IS_ERR(regmap)) {
> > +			dev_err(dev, "failed to find syscon\n");
> > +			return PTR_ERR(regmap);
> > +		}
> > +		regmap_attach_dev(dev, regmap, &config);
> >  	}
> > -	regmap_attach_dev(dev, regmap, &config);
> >
> >  	/* set some other name then imx */
> >  	rproc = rproc_alloc(dev, "imx-rproc", &imx_rproc_ops,
> > --
> > 2.16.4
> >
diff mbox series

Patch

diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index b9fabe269fd2..e31ea1090cf3 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -483,7 +483,9 @@  static int imx_rproc_configure_mode(struct imx_rproc *priv)
 	int ret;
 	u32 val;
 
-	if (of_get_property(dev->of_node, "early-booted", NULL)) {
+	if (dcfg->variants == IMX7ULP) {
+		priv->early_boot = true;
+	} else if (of_get_property(dev->of_node, "early-booted", NULL)) {
 		priv->early_boot = true;
 	} else {
 		ret = regmap_read(priv->regmap, dcfg->src_reg, &val);
@@ -509,15 +511,17 @@  static int imx_rproc_probe(struct platform_device *pdev)
 	struct rproc *rproc;
 	struct regmap_config config = { .name = "imx-rproc" };
 	const struct imx_rproc_dcfg *dcfg;
-	struct regmap *regmap;
+	struct regmap *regmap = NULL;
 	int ret;
 
-	regmap = syscon_regmap_lookup_by_phandle(np, "syscon");
-	if (IS_ERR(regmap)) {
-		dev_err(dev, "failed to find syscon\n");
-		return PTR_ERR(regmap);
+	if (!of_get_property(np, "early-booted", NULL)) {
+		regmap = syscon_regmap_lookup_by_phandle(np, "syscon");
+		if (IS_ERR(regmap)) {
+			dev_err(dev, "failed to find syscon\n");
+			return PTR_ERR(regmap);
+		}
+		regmap_attach_dev(dev, regmap, &config);
 	}
-	regmap_attach_dev(dev, regmap, &config);
 
 	/* set some other name then imx */
 	rproc = rproc_alloc(dev, "imx-rproc", &imx_rproc_ops,