External dts building

Giulio Benetti giulio.benetti at benettiengineering.com
Fri Oct 15 05:06:32 CEST 2021


Hi Simon,

> Il giorno 15 ott 2021, alle ore 02:53, Simon Glass <sjg at chromium.org> ha scritto:
> 
> Hi Giulio,
> 
>> On Thu, 14 Oct 2021 at 15:12, Giulio Benetti
>> <giulio.benetti at benettiengineering.com> wrote:
>> 
>> Hi Simon,
>> 
>> Il giorno 14 ott 2021, alle ore 22:43, Simon Glass <sjg at chromium.org> ha scritto:
>> 
>> Hi Giulio,
>> 
>> On Thu, 14 Oct 2021 at 13:23, Giulio Benetti
>> <giulio.benetti at benettiengineering.com> wrote:
>> 
>> 
>> Hi Simon,
>> 
>> 
>> Il giorno 14 ott 2021, alle ore 20:24, Simon Glass <sjg at chromium.org> ha scritto:
>> 
>> 
>> Hi,
>> 
>> 
>> On Thu, 14 Oct 2021 at 07:46, Tom Rini <trini at konsulko.com> wrote:
>> 
>> 
>> On Thu, Oct 14, 2021 at 02:53:30AM +0200, Giulio Benetti wrote:
>> 
>> 
>> Hello All,
>> 
>> 
>> is there a way to pass a dts file without touching the arch/arm/boot/dts/Makefile?
>> 
>> 
>> On Buildroot we support the possibility to pass an external dts by copying it to the uboot sources to
>> 
>> be built but since uboot version 2020.01 it doesn’t work anymore.
>> 
>> 
>> So I’ve proposed a patch to prepend the dts file in the Makefile above, but this has drawbacks, like we reconfigure(it keeps adding files every time).
>> 
>> 
>> So I ask you, is there a more canonical way already to achieve this?
>> 
>> 
>> Not exactly, and it's something we're very much actively discussing
>> 
>> right now.
>> 
>> 
>> Are you using 'make DEVICE_TREE=xxx' ?
>> 
>> 
>> Yes but it doesn’t work if you don’t add an entry into arch/arm/dts/Makefile
>> 
>> Before version 2020.01 worked, but not after it.
>> 
>> 
>> What board are you building?
>> 
>> 
>> A20-OLinuXino-Lime_defconfig for but without CONFIG_DEFAULT_DEVICE_TREE undefined,
>> so if you try to pass DEVICE_TREE= pointing to an external .dts file copied to arch/arm/dts/ make doesn’t find the entry in Makefile and it can’t build it.
>> 
>> This is useful in build systems like Buildroot where you can provide an external defconfig as well as an external .dts file.
>> 
>> So here the solution I see is to create an entry in arch/arm/dts/Makefile on the top of the file afte copying the .dts file we want to build.
>> But on Buildroot they’ve pointed me to ask upstream(here) if there’s a more canonical way or to work together to achieve the goal:
>> 
>> https://patchwork.ozlabs.org/project/buildroot/patch/20210209201303.195093-1-giulio.benetti@benettiengineering.com/
> 
> How about not disabling CONFIG_DEFAULT_DEVICE_TREE ? That should work OK.

But if I’m not wrong the problem of the dts/Makefile remains. If .dts file is not assigned to dtb-y it won’t be built.

And in the case of Buildroot we have 2 ways to use external dts files:
1) patch uboot adding the dts and the entry in dts/Makefile
2) copy .dts file(let’s say located in ~/my-folder/my.dts) to arch/arm/dts/my.dts and prepend
the dtb-y += my.dts in arch/arm/dts/Makefile and here problem arises.
Because it can work once but we need to make it possible to have ‘make uboot-rebuild/reconfigure’
(Buildroot has such targets). This way is not easy at all to prepend the dtb-y at the top of the file without re-prepending it again and again.

It worked up to uboot < 2020.01, but I still haven’t bisected to see the “offending” commit.
Maybe I can try and find out why it behaves like that.

What about that?

Best regards
Giulio

> 
> Regards,
> Simon
> 
>> 
>> Sorry if this e-mail is html but I’m on mobile :-/
>> 
>> Best regards
>> Giulio Benetti
>> 
>> 
>> Regards,
>> Simon



More information about the U-Boot mailing list