mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW
@ 2024-04-02  9:26 Oleksij Rempel
  2024-04-02  9:26 ` [PATCH v2 2/2] ARM: i.MX8MP: skov: add new bd500 variant support Oleksij Rempel
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Oleksij Rempel @ 2024-04-02  9:26 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

Add fallback support for currently not supported HW. Instead of
completely fail, it is better to use some kind of basic devicetree with
reduced functionality.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/boards/skov-imx8mp/board.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boards/skov-imx8mp/board.c b/arch/arm/boards/skov-imx8mp/board.c
index 3b6eb7b080..41122ea1e4 100644
--- a/arch/arm/boards/skov-imx8mp/board.c
+++ b/arch/arm/boards/skov-imx8mp/board.c
@@ -85,6 +85,10 @@ static const struct board_description imx8mp_variants[] = {
 	},
 };
 
+static const struct board_description imx8mp_basic_viariant = {
+	.dts_compatible = "skov,imx8mp-skov-basic",
+};
+
 static int skov_imx8mp_fixup(struct device_node *root, void *data)
 {
 	struct device_node *chosen = of_create_node(root, "/chosen");
@@ -171,12 +175,12 @@ static int skov_imx8mp_init_variant(struct skov_imx8mp_priv *priv)
 	priv->variant_id = v;
 
 	if (v >= ARRAY_SIZE(imx8mp_variants)) {
-		dev_err(dev, "Invalid variant %u\n", v);
-		return -EINVAL;
+		dev_warn(dev, "Unsuported variant %u. Fall back to basic variant\n", v);
+		variant = &imx8mp_basic_viariant;
+	} else {
+		variant = &imx8mp_variants[v];
 	}
 
-	variant = &imx8mp_variants[v];
-
 	if (variant->flags & SKOV_IMX8MP_HAS_HDMI) {
 		ret = skov_imx8mp_get_hdmi(dev);
 		if (ret < 0)
-- 
2.39.2




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] ARM: i.MX8MP: skov: add new bd500 variant support
  2024-04-02  9:26 [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW Oleksij Rempel
@ 2024-04-02  9:26 ` Oleksij Rempel
  2024-04-03  4:00 ` [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW Thorsten Scherer
  2024-04-03 11:28 ` Sascha Hauer
  2 siblings, 0 replies; 6+ messages in thread
From: Oleksij Rempel @ 2024-04-02  9:26 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

Add bd500 board variant.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/boards/skov-imx8mp/board.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boards/skov-imx8mp/board.c b/arch/arm/boards/skov-imx8mp/board.c
index 41122ea1e4..b6763a8f0d 100644
--- a/arch/arm/boards/skov-imx8mp/board.c
+++ b/arch/arm/boards/skov-imx8mp/board.c
@@ -83,6 +83,9 @@ static const struct board_description imx8mp_variants[] = {
 		.dts_compatible_hdmi = "skov,imx8mp-skov-revb-hdmi",
 		.flags = SKOV_IMX8MP_HAS_HDMI,
 	},
+	[2] = {
+		.dts_compatible = "skov,imx8mp-skov-revc-bd500",
+	},
 };
 
 static const struct board_description imx8mp_basic_viariant = {
-- 
2.39.2




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW
  2024-04-02  9:26 [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW Oleksij Rempel
  2024-04-02  9:26 ` [PATCH v2 2/2] ARM: i.MX8MP: skov: add new bd500 variant support Oleksij Rempel
@ 2024-04-03  4:00 ` Thorsten Scherer
  2024-04-03  4:29   ` Oleksij Rempel
  2024-04-03 11:29   ` Sascha Hauer
  2024-04-03 11:28 ` Sascha Hauer
  2 siblings, 2 replies; 6+ messages in thread
From: Thorsten Scherer @ 2024-04-03  4:00 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: barebox

Hi Oleksij,

I spotted some typos.

On Tue, Apr 02, 2024 at 11:26:53AM +0200, Oleksij Rempel wrote:
> Add fallback support for currently not supported HW. Instead of
> completely fail, it is better to use some kind of basic devicetree with
> reduced functionality.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  arch/arm/boards/skov-imx8mp/board.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boards/skov-imx8mp/board.c b/arch/arm/boards/skov-imx8mp/board.c
> index 3b6eb7b080..41122ea1e4 100644
> --- a/arch/arm/boards/skov-imx8mp/board.c
> +++ b/arch/arm/boards/skov-imx8mp/board.c
> @@ -85,6 +85,10 @@ static const struct board_description imx8mp_variants[] = {
>  	},
>  };
>  
> +static const struct board_description imx8mp_basic_viariant = {

s/imx8mp_basic_viariant/imx8mp_basic_variant/

> +	.dts_compatible = "skov,imx8mp-skov-basic",
> +};
> +
>  static int skov_imx8mp_fixup(struct device_node *root, void *data)
>  {
>  	struct device_node *chosen = of_create_node(root, "/chosen");
> @@ -171,12 +175,12 @@ static int skov_imx8mp_init_variant(struct skov_imx8mp_priv *priv)
>  	priv->variant_id = v;
>  
>  	if (v >= ARRAY_SIZE(imx8mp_variants)) {
> -		dev_err(dev, "Invalid variant %u\n", v);
> -		return -EINVAL;
> +		dev_warn(dev, "Unsuported variant %u. Fall back to basic variant\n", v);

s/Unsuported/Unsupported/

> +		variant = &imx8mp_basic_viariant;

s/imx8mp_basic_viariant/imx8mp_basic_variant/

> +	} else {
> +		variant = &imx8mp_variants[v];
>  	}
>  
> -	variant = &imx8mp_variants[v];
> -
>  	if (variant->flags & SKOV_IMX8MP_HAS_HDMI) {
>  		ret = skov_imx8mp_get_hdmi(dev);
>  		if (ret < 0)
> -- 
> 2.39.2
> 
> 

Best regards
Thorsten



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW
  2024-04-03  4:00 ` [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW Thorsten Scherer
@ 2024-04-03  4:29   ` Oleksij Rempel
  2024-04-03 11:29   ` Sascha Hauer
  1 sibling, 0 replies; 6+ messages in thread
From: Oleksij Rempel @ 2024-04-03  4:29 UTC (permalink / raw)
  To: Thorsten Scherer; +Cc: barebox

On Wed, Apr 03, 2024 at 06:00:56AM +0200, Thorsten Scherer wrote:
> Hi Oleksij,
> 
> I spotted some typos.

Thank you!

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW
  2024-04-02  9:26 [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW Oleksij Rempel
  2024-04-02  9:26 ` [PATCH v2 2/2] ARM: i.MX8MP: skov: add new bd500 variant support Oleksij Rempel
  2024-04-03  4:00 ` [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW Thorsten Scherer
@ 2024-04-03 11:28 ` Sascha Hauer
  2 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2024-04-03 11:28 UTC (permalink / raw)
  To: barebox, Oleksij Rempel


On Tue, 02 Apr 2024 11:26:53 +0200, Oleksij Rempel wrote:
> Add fallback support for currently not supported HW. Instead of
> completely fail, it is better to use some kind of basic devicetree with
> reduced functionality.
> 
> 

Applied, thanks!

[1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW
      https://git.pengutronix.de/cgit/barebox/commit/?id=b3b526447a61 (link may not be stable)
[2/2] ARM: i.MX8MP: skov: add new bd500 variant support
      https://git.pengutronix.de/cgit/barebox/commit/?id=6cf809a063ed (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW
  2024-04-03  4:00 ` [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW Thorsten Scherer
  2024-04-03  4:29   ` Oleksij Rempel
@ 2024-04-03 11:29   ` Sascha Hauer
  1 sibling, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2024-04-03 11:29 UTC (permalink / raw)
  To: Thorsten Scherer; +Cc: Oleksij Rempel, barebox

On Wed, Apr 03, 2024 at 06:00:56AM +0200, Thorsten Scherer wrote:
> Hi Oleksij,
> 
> I spotted some typos.
> 
> On Tue, Apr 02, 2024 at 11:26:53AM +0200, Oleksij Rempel wrote:
> > Add fallback support for currently not supported HW. Instead of
> > completely fail, it is better to use some kind of basic devicetree with
> > reduced functionality.
> > 
> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > ---
> >  arch/arm/boards/skov-imx8mp/board.c | 12 ++++++++----
> >  1 file changed, 8 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/arm/boards/skov-imx8mp/board.c b/arch/arm/boards/skov-imx8mp/board.c
> > index 3b6eb7b080..41122ea1e4 100644
> > --- a/arch/arm/boards/skov-imx8mp/board.c
> > +++ b/arch/arm/boards/skov-imx8mp/board.c
> > @@ -85,6 +85,10 @@ static const struct board_description imx8mp_variants[] = {
> >  	},
> >  };
> >  
> > +static const struct board_description imx8mp_basic_viariant = {
> 
> s/imx8mp_basic_viariant/imx8mp_basic_variant/
> 
> > +	.dts_compatible = "skov,imx8mp-skov-basic",
> > +};
> > +
> >  static int skov_imx8mp_fixup(struct device_node *root, void *data)
> >  {
> >  	struct device_node *chosen = of_create_node(root, "/chosen");
> > @@ -171,12 +175,12 @@ static int skov_imx8mp_init_variant(struct skov_imx8mp_priv *priv)
> >  	priv->variant_id = v;
> >  
> >  	if (v >= ARRAY_SIZE(imx8mp_variants)) {
> > -		dev_err(dev, "Invalid variant %u\n", v);
> > -		return -EINVAL;
> > +		dev_warn(dev, "Unsuported variant %u. Fall back to basic variant\n", v);
> 
> s/Unsuported/Unsupported/
> 
> > +		variant = &imx8mp_basic_viariant;
> 
> s/imx8mp_basic_viariant/imx8mp_basic_variant/

Fixed while applying.

Thanks
 Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-03 11:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02  9:26 [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW Oleksij Rempel
2024-04-02  9:26 ` [PATCH v2 2/2] ARM: i.MX8MP: skov: add new bd500 variant support Oleksij Rempel
2024-04-03  4:00 ` [PATCH v2 1/2] ARM: i.MX8MP: skov: add fallback for unsupported HW Thorsten Scherer
2024-04-03  4:29   ` Oleksij Rempel
2024-04-03 11:29   ` Sascha Hauer
2024-04-03 11:28 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox