[PATCH] ARM: riotboard: drop static barebox-environment handling

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Apr 16 05:15:06 PDT 2025


Hello Marco,

On 4/16/25 12:31, Marco Felsch wrote:
> Since commit 9f868f78bc54 ("environment: use barebox environment from
> GPT partitions") barebox can try to find the barebox-environment based
> on a GPT partition GUID.
> 
> Make use of this mechanism and drop the barebox local of-partition for
> the eMMC device and let the user-space provide the correct
> barebox-environment location if any.
> 
> This also fixes environment handling if booted from a SD card since SD
> card boots make use of eMMC barebox environment at the moment.

I agree that we want to nudge users towards making use of a GPT
partition with the correct type GUID, but breaking them and expecting
them to repartition leaves a sour taste.

How about we change barebox,environment to barebox,environment-fallback
as compatible and then make use of it only if no other environment has
been found (including any on a GPT-partitioned bootsource).

If a barebox,environment-fallback is used, a NOTICE level message should
alert the user to this fact. They can then either:

  - Repartition to avoid the message
  - Switch to barebox,environment if they explicitly want to hardcode
    the location (e.g. in deployed systems or when it's on raw flash)

I think with these semantics, we could switch over EVKs in-tree
to the new compatible.

Cheers,
Ahmad

> 
> Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
> ---
>  arch/arm/dts/imx6s-riotboard.dts | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/arch/arm/dts/imx6s-riotboard.dts b/arch/arm/dts/imx6s-riotboard.dts
> index 57817c1197a7..cca34d6dba95 100644
> --- a/arch/arm/dts/imx6s-riotboard.dts
> +++ b/arch/arm/dts/imx6s-riotboard.dts
> @@ -11,11 +11,6 @@
>  / {
>  	chosen {
>  		stdout-path = &uart2;
> -
> -		environment {
> -			compatible = "barebox,environment";
> -			device-path = &environment_usdhc4;
> -		};
>  	};
>  };
>  
> @@ -31,11 +26,6 @@ partition at 0 {
>  		label = "barebox";
>  		reg = <0x0 0xe0000>;
>  	};
> -
> -	environment_usdhc4: partition at e0000 {
> -		label = "barebox-environment";
> -		reg = <0xe0000 0x20000>;
> -	};
>  };
>  
>  &clks {

-- 
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 |




More information about the barebox mailing list