[PATCH] arm: stm32mp15x: Move mmc aliases to board files

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Mar 7 03:34:19 PST 2022


Hi,

On 07.03.22 12:23, Uwe Kleine-König wrote:
> Having the mmc aliases in stm32mp151.dtsi is surprising as depending on
> the order of includes these override the mmc ordering in
> <arm/stm32mp157c-myboard.dts>. Also the ordering of mmc devices is actually
> board specific, so it's also right to have this in the board.dts files.

NACK. MMC IPs have fixed numbering, because TF-A (and BootROM before it)
report to barebox the number of the MMC device that it succesfully booted from.

The aliases map these IDs to device tree nodes, so barebox can fix up a correct
/chosen/bootsource. Additionally having any alias at all ensures fixed naming that's
not dependent on probe order. I know that Linux maintainers seem to disagree with this,
but as far as barebox is concerned, aliases are SoC-specific, not board-specific
in general. You can override this board-level if you like, but the default should
remain.

> There is no (relevant) change intended by this patch.

I have non-upstream boards that would be broken by this. There's also a Phytec
board in next that would be broken by this. Whereas they had a fixed mmcX
before, they would now have disk0, disk1 or disk2 depending on probe order with
this patch applied.

Cheers,
Ahmad

> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> ---
>  arch/arm/dts/stm32mp151-prtt1l.dtsi  | 3 ++-
>  arch/arm/dts/stm32mp151.dtsi         | 3 ---
>  arch/arm/dts/stm32mp157c-ev1.dts     | 6 ++++++
>  arch/arm/dts/stm32mp157c-odyssey.dts | 5 +++++
>  arch/arm/dts/stm32mp15xx-dkx.dtsi    | 5 +++++
>  5 files changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/dts/stm32mp151-prtt1l.dtsi b/arch/arm/dts/stm32mp151-prtt1l.dtsi
> index 80ae72dee22a..6813cb1767f2 100644
> --- a/arch/arm/dts/stm32mp151-prtt1l.dtsi
> +++ b/arch/arm/dts/stm32mp151-prtt1l.dtsi
> @@ -16,8 +16,9 @@
>  	};
>  
>  	aliases {
> -		serial0 = &uart4;
>  		ethernet0 = &ethernet0;
> +		mmc0 = &sdmmc1;
> +		serial0 = &uart4;
>  	};
>  
>  	v3v3: fixed-regulator-v3v3 {
> diff --git a/arch/arm/dts/stm32mp151.dtsi b/arch/arm/dts/stm32mp151.dtsi
> index f1fd888fa1c6..61b022c6caba 100644
> --- a/arch/arm/dts/stm32mp151.dtsi
> +++ b/arch/arm/dts/stm32mp151.dtsi
> @@ -13,9 +13,6 @@
>  		gpio9 = &gpioj;
>  		gpio10 = &gpiok;
>  		gpio25 = &gpioz;
> -		mmc0 = &sdmmc1;
> -		mmc1 = &sdmmc2;
> -		mmc2 = &sdmmc3;
>  		pwm1 = &{/soc/timer at 44000000/pwm};
>  		pwm2 = &{/soc/timer at 40000000/pwm};
>  		pwm3 = &{/soc/timer at 40001000/pwm};
> diff --git a/arch/arm/dts/stm32mp157c-ev1.dts b/arch/arm/dts/stm32mp157c-ev1.dts
> index 742eca7a33c9..1718e847a1f4 100644
> --- a/arch/arm/dts/stm32mp157c-ev1.dts
> +++ b/arch/arm/dts/stm32mp157c-ev1.dts
> @@ -4,6 +4,12 @@
>  #include "stm32mp151.dtsi"
>  
>  / {
> +	aliases {
> +		mmc0 = &sdmmc1;
> +		mmc1 = &sdmmc2;
> +		mmc2 = &sdmmc3;
> +	};
> +
>  	chosen {
>  		environment-sd {
>  			compatible = "barebox,environment";
> diff --git a/arch/arm/dts/stm32mp157c-odyssey.dts b/arch/arm/dts/stm32mp157c-odyssey.dts
> index 0e395bdec961..8a91575b472b 100644
> --- a/arch/arm/dts/stm32mp157c-odyssey.dts
> +++ b/arch/arm/dts/stm32mp157c-odyssey.dts
> @@ -7,6 +7,11 @@
>  #include "stm32mp151.dtsi"
>  
>  / {
> +	aliases {
> +		mmc0 = &sdmmc1;
> +		mmc1 = &sdmmc2;
> +	};
> +
>  	chosen {
>  		environment-sd {
>  			compatible = "barebox,environment";
> diff --git a/arch/arm/dts/stm32mp15xx-dkx.dtsi b/arch/arm/dts/stm32mp15xx-dkx.dtsi
> index 173e64e04c1b..edb37970331a 100644
> --- a/arch/arm/dts/stm32mp15xx-dkx.dtsi
> +++ b/arch/arm/dts/stm32mp15xx-dkx.dtsi
> @@ -8,6 +8,11 @@
>  #include <dt-bindings/gpio/gpio.h>
>  
>  / {
> +	aliases {
> +		mmc0 = &sdmmc1;
> +		mmc2 = &sdmmc3;
> +	};
> +
>  	chosen {
>  		environment {
>  			compatible = "barebox,environment";
> 
> base-commit: 383f9f2d5d8db19dce05c982fa7fbfb44989ef53


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