mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	barebox@lists.infradead.org
Subject: Re: [PATCH] arm: stm32mp15x: Move mmc aliases to board files
Date: Mon, 7 Mar 2022 12:34:19 +0100	[thread overview]
Message-ID: <733095b9-554e-a667-47f0-6c03722bbb90@pengutronix.de> (raw)
In-Reply-To: <20220307112331.449741-1-u.kleine-koenig@pengutronix.de>

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@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@44000000/pwm};
>  		pwm2 = &{/soc/timer@40000000/pwm};
>  		pwm3 = &{/soc/timer@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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2022-03-07 11:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07 11:23 Uwe Kleine-König
2022-03-07 11:34 ` Ahmad Fatoum [this message]
2022-03-07 12:04   ` Uwe Kleine-König
2022-03-07 12:19     ` Ahmad Fatoum
2022-03-07 13:23       ` Uwe Kleine-König
2022-03-11  9:31         ` Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=733095b9-554e-a667-47f0-6c03722bbb90@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox