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

Rasmus Villemoes rasmus.villemoes at prevas.dk
Thu May 4 14:35:56 CEST 2023


On 03/05/2023 16.54, Tom Rini wrote:
> On Wed, May 03, 2023 at 09:51:58AM -0400, Tom Rini wrote:
>> On Mon, May 01, 2023 at 10:49:22AM +0200, Rasmus Villemoes wrote:
>>> On 27/04/2023 19.31, Tom Rini wrote:
>>>>>
>>>>> Well, I'm not sure there's a use case for building all of the extra
>>>>> device trees. I think what I'll do right now is fire off a CI run (or a
>>>>> few, in the event of problems) where we just use the logic of
>>>>> 3609e1dc5f4d and see what falls down.
>>>>
>>>> So this gets us a few failures.  You can see them on
>>>> https://source.denx.de/u-boot/u-boot/-/jobs/618127 but one type of
>>>> failure seems to be the case where CONFIG_DEFAULT_DEVICE_TREE isn't
>>>> contained in CONFIG_OF_LIST (ls1088aqds_tfa for example) and the other
>>>> case is where CONFIG_OF_LIST != CONFIG_SPL_OF_LIST and this fails
>>>> because fdtgrep runs NOT on spl/arch/.../foo.dtb but rather
>>>> arch/.../foo.dtb and so we don't have the dtb file around.
>>>>
>>>
>>> Hm, the former sounds like a bug in the defconfig, the second sounds
>>> like a legit use case (or why would we have SPL_OF_LIST). Anyway, both
>>> should be fixable by just changing the logic of scripts/Makefile.dts a
>>> little; say add the union of DEFAULT_DEVICE_TREE, OF_LIST and
>>> SPL_OF_LIST to dtb-y. Something like
>>>
>>> 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)))
>>
>> OK, lemme see what happens now.  Assuming this is enough, please post as
>> a proper patch, thanks!
> 
> The one last problem now is on stm32mp15_dhcor_basic which is a
> defconfig missing one from OF_LIST but including it in the its file, so
> the above is the patch we need.
> 

Hm, well, for now I think at least all .dtbo targets need to be left in
the Makefiles, since nothing in the defconfig tells us to build those.
Maybe the CI build will complete because missing those dtbos will just
be seen as random missing binary blobs, but it's something that needs to
be thought of.

There's no CONFIG knob to mention the required dtbos, and adding them to
OF_LIST doesn't work because those are without the .dtb suffix (we add
that in Makefile.dts).

But maybe we can just leave the dtbos in the Makefile (perhaps per SOC
or whatever) - they are explicitly _not_ built with the special U-Boot
.dtb rule, so doesn't depend on config options and don't have magic
.dtsi files included. There's anyway so few of them so far that it'd
still be a massive win to trim the Makefiles of the .dtb rules.

I just sent two Makefile.lib patches related to the dtb/dtbo logic, but
they are not strictly required for sorting this out. But I do think we
should do the .dts->.dtso renames sooner rather than later.

Rasmus



More information about the U-Boot mailing list