* [PATCH] scripts/Makefile.dts: tweak logic for deciding which dtbs to build
@ 2023-05-04 11:33 Rasmus Villemoes
2023-05-04 15:51 ` Tom Rini
2023-05-15 21:12 ` Tom Rini
0 siblings, 2 replies; 4+ messages in thread
From: Rasmus Villemoes @ 2023-05-04 11:33 UTC (permalink / raw)
To: u-boot; +Cc: Tom Rini, Simon Glass, Rasmus Villemoes
The idea in 3609e1dc5f4d (dts: automatically build necessary .dtb
files) was fine, but the implementation was suboptimal due to some
misunderstandings on my part (and possibly defects in some defconfig
files):
- Sometimes DEFAULT_DEVICE_TREE is not included in OF_LIST or
SPL_OF_LIST
- SPL_OF_LIST is not always a subset of OF_LIST
- While SPL_OF_LIST governs the list of dtbs relevant to SPL (i.e.,
may be built into an
SPL-with-bunch-of-dtbs-to-choose-between-at-runtime), those dtbs are
not actually _built_ during the SPL build phase, i.e. when $(SPL_)
would expand to SPL_. fdtgrep runs on the artifacts produced during
the ordinary U-Boot build.
Tweak the logic so that we simply add the union of all dtbs mentioned
in either DEFAULT_DEVICE_TREE, OF_LIST and SPL_OF_LIST to dtb-y. That
should, for real, ensure that we always build all the dtbs that is
relevant to the current board, and should in turn enable us to
massively simplify arch/*/dts/Makefile.
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
Per https://lore.kernel.org/u-boot/20230503145438.GB1134230@bill-the-cat/
I guess one could apply make's built-in sort function since the RHS is
very likely to contain some duplicates, but I don't think it really
matters. So for now I'm just posting the version of the patch that Tom
tested.
scripts/Makefile.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/Makefile.dts b/scripts/Makefile.dts
index 2561025da8..5e2429c617 100644
--- a/scripts/Makefile.dts
+++ b/scripts/Makefile.dts
@@ -1,3 +1,3 @@
# SPDX-License-Identifier: GPL-2.0+
-dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_$(SPL_)OF_LIST)))
+dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
--
2.37.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] scripts/Makefile.dts: tweak logic for deciding which dtbs to build
2023-05-04 11:33 [PATCH] scripts/Makefile.dts: tweak logic for deciding which dtbs to build Rasmus Villemoes
@ 2023-05-04 15:51 ` Tom Rini
2023-05-05 0:40 ` Simon Glass
2023-05-15 21:12 ` Tom Rini
1 sibling, 1 reply; 4+ messages in thread
From: Tom Rini @ 2023-05-04 15:51 UTC (permalink / raw)
To: Rasmus Villemoes; +Cc: u-boot, Simon Glass
[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]
On Thu, May 04, 2023 at 01:33:08PM +0200, Rasmus Villemoes wrote:
> The idea in 3609e1dc5f4d (dts: automatically build necessary .dtb
> files) was fine, but the implementation was suboptimal due to some
> misunderstandings on my part (and possibly defects in some defconfig
> files):
>
> - Sometimes DEFAULT_DEVICE_TREE is not included in OF_LIST or
> SPL_OF_LIST
>
> - SPL_OF_LIST is not always a subset of OF_LIST
>
> - While SPL_OF_LIST governs the list of dtbs relevant to SPL (i.e.,
> may be built into an
> SPL-with-bunch-of-dtbs-to-choose-between-at-runtime), those dtbs are
> not actually _built_ during the SPL build phase, i.e. when $(SPL_)
> would expand to SPL_. fdtgrep runs on the artifacts produced during
> the ordinary U-Boot build.
>
> Tweak the logic so that we simply add the union of all dtbs mentioned
> in either DEFAULT_DEVICE_TREE, OF_LIST and SPL_OF_LIST to dtb-y. That
> should, for real, ensure that we always build all the dtbs that is
> relevant to the current board, and should in turn enable us to
> massively simplify arch/*/dts/Makefile.
>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Tested-by: Tom Rini <trini@konsulko.com>
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scripts/Makefile.dts: tweak logic for deciding which dtbs to build
2023-05-04 15:51 ` Tom Rini
@ 2023-05-05 0:40 ` Simon Glass
0 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2023-05-05 0:40 UTC (permalink / raw)
To: Tom Rini; +Cc: Rasmus Villemoes, u-boot
On Thu, 4 May 2023 at 09:51, Tom Rini <trini@konsulko.com> wrote:
>
> On Thu, May 04, 2023 at 01:33:08PM +0200, Rasmus Villemoes wrote:
>
> > The idea in 3609e1dc5f4d (dts: automatically build necessary .dtb
> > files) was fine, but the implementation was suboptimal due to some
> > misunderstandings on my part (and possibly defects in some defconfig
> > files):
> >
> > - Sometimes DEFAULT_DEVICE_TREE is not included in OF_LIST or
> > SPL_OF_LIST
> >
> > - SPL_OF_LIST is not always a subset of OF_LIST
> >
> > - While SPL_OF_LIST governs the list of dtbs relevant to SPL (i.e.,
> > may be built into an
> > SPL-with-bunch-of-dtbs-to-choose-between-at-runtime), those dtbs are
> > not actually _built_ during the SPL build phase, i.e. when $(SPL_)
> > would expand to SPL_. fdtgrep runs on the artifacts produced during
> > the ordinary U-Boot build.
> >
> > Tweak the logic so that we simply add the union of all dtbs mentioned
> > in either DEFAULT_DEVICE_TREE, OF_LIST and SPL_OF_LIST to dtb-y. That
> > should, for real, ensure that we always build all the dtbs that is
> > relevant to the current board, and should in turn enable us to
> > massively simplify arch/*/dts/Makefile.
> >
> > Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
>
> Tested-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scripts/Makefile.dts: tweak logic for deciding which dtbs to build
2023-05-04 11:33 [PATCH] scripts/Makefile.dts: tweak logic for deciding which dtbs to build Rasmus Villemoes
2023-05-04 15:51 ` Tom Rini
@ 2023-05-15 21:12 ` Tom Rini
1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2023-05-15 21:12 UTC (permalink / raw)
To: Rasmus Villemoes; +Cc: u-boot, Simon Glass
[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]
On Thu, May 04, 2023 at 01:33:08PM +0200, Rasmus Villemoes wrote:
> The idea in 3609e1dc5f4d (dts: automatically build necessary .dtb
> files) was fine, but the implementation was suboptimal due to some
> misunderstandings on my part (and possibly defects in some defconfig
> files):
>
> - Sometimes DEFAULT_DEVICE_TREE is not included in OF_LIST or
> SPL_OF_LIST
>
> - SPL_OF_LIST is not always a subset of OF_LIST
>
> - While SPL_OF_LIST governs the list of dtbs relevant to SPL (i.e.,
> may be built into an
> SPL-with-bunch-of-dtbs-to-choose-between-at-runtime), those dtbs are
> not actually _built_ during the SPL build phase, i.e. when $(SPL_)
> would expand to SPL_. fdtgrep runs on the artifacts produced during
> the ordinary U-Boot build.
>
> Tweak the logic so that we simply add the union of all dtbs mentioned
> in either DEFAULT_DEVICE_TREE, OF_LIST and SPL_OF_LIST to dtb-y. That
> should, for real, ensure that we always build all the dtbs that is
> relevant to the current board, and should in turn enable us to
> massively simplify arch/*/dts/Makefile.
>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> Tested-by: Tom Rini <trini@konsulko.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot/next, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-15 21:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-04 11:33 [PATCH] scripts/Makefile.dts: tweak logic for deciding which dtbs to build Rasmus Villemoes
2023-05-04 15:51 ` Tom Rini
2023-05-05 0:40 ` Simon Glass
2023-05-15 21:12 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.