From: Krzysztof Kozlowski <krzk@kernel.org>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
devicetree-spec@vger.kernel.org
Cc: "kernel@pengutronix.de" <kernel@pengutronix.de>,
quentin.schulz@cherry.de
Subject: Re: SoC-specific device tree aliases?
Date: Mon, 17 Nov 2025 08:38:48 +0100 [thread overview]
Message-ID: <58816b68-3b09-4320-9a4e-09f2c2b2d0fa@kernel.org> (raw)
In-Reply-To: <ebc08400-c16d-4ed0-b487-9aabe13bbf0f@pengutronix.de>
On 13/11/2025 09:28, Ahmad Fatoum wrote:
> Hello,
>
> With /chosen/bootsource now part of dt-schema, I would like to raise a
> related point: The need for SoC-specific device tree aliases.
>
> For many SoCs, there is a canonical numbering for peripherals; it's used
> in the datasheet and BootROMs often makes use of it at runtime to report
> the bootsource as a pair:
>
> - One value to enumerate type of boot medium (e.g. mmc, spi-nor..)
> - Another value that describes which instance (e.g. SDHC1, SPI3, ...)
>
> Some examples, where this is the case, are AT91, STM32MP or i.MX.
>
> barebox has traditionally used /aliases to translate BootROM information
> to a device tree node to fixup /chosen/bootsource.
>
> This doesn't work out for many newer SoC support, because of different
> expectations: For upstream, aliases are relevant to a board, while
> barebox traditionally expected them to be SoC-specific (because they
> used to be on i.MX, probably).
Please state exactly the problem - you have aliases in DTS but
bootsource in DTSI? Then that's clearly mixup - you need to define them
in the same place. Aliases are in DTS (I see here other thread on that),
so stdout-path is also in DTS.
Or you don't have bootsource in DTSI at all because barebox invents it
regardless of actual aliases? Then shouldn't this be an obvious issue?
You cannot have barebox as second source of aliases.
>
> To accommodate this, barebox nowadays extends upstream device trees with
> /chosen/barebox,bootsource-${alias} properties, which can be used as
> translation table instead of aliases.
>
> This solves the issue, but there is occasional breakage when upstream
> decides to remove aliases from the SoC DTSI and move them into the
> boards until barebox is made to add the /chosen/barebox, overrides.
>
> As described above, I think the data sheet numbering is pretty much an
> aspect of the hardware and it has a place in the upstream SoC DTSI.
>
>
> So what are the thoughts on adding /soc/aliases or some other top-level
> node to hold this information?
> Or would a h"ardware-label" property or similar be more tenable?
So you want to map full node path to some alias, so later you can map
that alias back to full node path, right? This sounds like quite
redundant information in DTS just to avoid impact of node reshuffling
(like unit address changes). In DTS-source-code realm, we solved it with
phandles. Maybe this would help here?
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-11-17 7:38 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 8:28 SoC-specific device tree aliases? Ahmad Fatoum
2025-11-13 18:04 ` Rob Herring
2025-11-13 19:17 ` Doug Anderson
2025-11-13 20:24 ` Heiko Stübner
2025-11-14 9:13 ` Ahmad Fatoum
2025-11-17 7:38 ` Krzysztof Kozlowski [this message]
2025-11-17 8:26 ` Sascha Hauer
2025-11-17 9:52 ` Krzysztof Kozlowski
2025-11-17 10:34 ` Sascha Hauer
2025-11-17 10:41 ` Krzysztof Kozlowski
2025-11-17 12:56 ` Marc Kleine-Budde
2025-11-17 13:18 ` Krzysztof Kozlowski
2025-11-17 14:52 ` Sascha Hauer
2025-11-17 14:57 ` Krzysztof Kozlowski
2025-11-17 15:23 ` Sascha Hauer
2025-11-17 15:44 ` Krzysztof Kozlowski
2025-11-17 16:06 ` Rob Herring
2025-11-17 16:29 ` Krzysztof Kozlowski
2025-12-03 10:16 ` Ahmad Fatoum
2025-12-03 10:25 ` Krzysztof Kozlowski
2025-12-03 10:36 ` Matthias Schiffer
2025-12-03 11:08 ` Krzysztof Kozlowski
2025-12-03 11:37 ` Ahmad Fatoum
2025-12-03 17:51 ` Rob Herring
2025-12-04 7:59 ` Sascha Hauer
2025-12-04 13:44 ` Rob Herring
2025-12-03 11:20 ` Marc Kleine-Budde
2025-12-03 11:24 ` Krzysztof Kozlowski
2025-12-03 11:34 ` Ahmad Fatoum
2025-12-04 18:51 ` Tom Rini
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=58816b68-3b09-4320-9a4e-09f2c2b2d0fa@kernel.org \
--to=krzk@kernel.org \
--cc=a.fatoum@pengutronix.de \
--cc=conor+dt@kernel.org \
--cc=devicetree-spec@vger.kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=quentin.schulz@cherry.de \
--cc=robh@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).