[PATCH] scripts/Makefile.lib: also consider $(CONFIG_SYS_BOARD)-u-boot.dtsi

Simon Glass sjg at chromium.org
Sat Mar 18 21:20:23 CET 2023

Hi Rasmus,

On Fri, 17 Mar 2023 at 04:26, Rasmus Villemoes
<rasmus.villemoes at prevas.dk> wrote:
> I have a couple of boards, e.g. foo21, bar33, each with a few
> different revisions, so I have
>   foo21-revA.dts
>   foo21-revB.dts
>   bar33-revA.dts
>   bar33-revB.dts
> Now the necessary U-Boot specific additions for the foo21 boards
> doesn't depend on the revision (likely for bar33), so I just want to
> have and maintain one
>   foo21-u-boot.dtsi
> But currently I need to add dummy files foo21-revA-u-boot.dtsi and
> foo21-revB-u-boot.dtsi each just containing '#include
> foo21-u-boot.dtsi'. And similarly for bar33, and all those files
> become quite unwieldy as more revisions need to be supported.
> It's quite natural to look for a file named after CONFIG_SYS_BOARD,
> with lower precedence of course than a -u-boot.dtsi file with the same
> basename as the .dts, but higher than CONFIG_SYS_SOC.
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
> ---
> Of course, this can cause unwanted changes for existing boards. But a
> bit of ad hoc scripting shows that the risk is low: I first grabbed
> all 'default "foo"' stanzas of all 'config SYS_BOARD' instances, as
> well as all values of CONFIG_SYS_BOARD set in *_defconfig files. Then
> I made a list of all existing *-u-boot.dtsi files, and from these
> removed any where there is a corresponding .dts file. That leaves just
> imx6ul
> imx8mm
> mt7620
> mt7621
> mt7622
> mt7623
> mt7628
> mt8516
> socfpga_arria10
> sunxi
> and inspecting a few of those suggests that they set SYS_SOC to the
> same as SYS_BOARD, i.e. they were already picking up the .dtsi file
> due to the SYS_SOC rule.
> Now, the only way to be really sure is to build the world
> with/without this patch and check if any .dtb file changes, but I
> don't have the means to do that. But I do notice that
>  doc/develop/devicetree/control.rst | 1 +
>  scripts/Makefile.lib               | 2 ++
>  2 files changed, 3 insertions(+)

Reviewed-by: Simon Glass <sjg at chromium.org>

There is something missing at the end of your note.

What U-Boot-specific things are you using?


More information about the U-Boot mailing list