
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?
Thanks in advance Best regards
Giulio Benetti Benetti Engineering sas

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.

Il giorno 14 ott 2021, alle ore 15:45, Tom Rini trini@konsulko.com ha scritto:
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.
Ok, thank you. Is there already a thread about this?
Best regards Giulio Benetti Benetti Engineering sas
-- Tom

On Thu, Oct 14, 2021 at 08:08:37PM +0200, Giulio Benetti wrote:
Il giorno 14 ott 2021, alle ore 15:45, Tom Rini trini@konsulko.com ha scritto:
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.
Ok, thank you. Is there already a thread about this?
https://lore.kernel.org/u-boot/20211013010120.96851-1-sjg@chromium.org/ is the start of it.

On 10/14/21 8:22 PM, Tom Rini wrote:
On Thu, Oct 14, 2021 at 08:08:37PM +0200, Giulio Benetti wrote:
Il giorno 14 ott 2021, alle ore 15:45, Tom Rini trini@konsulko.com ha scritto:
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.
Ok, thank you. Is there already a thread about this?
https://lore.kernel.org/u-boot/20211013010120.96851-1-sjg@chromium.org/ is the start of it.
Thank you

Hi,
On Thu, 14 Oct 2021 at 07:46, Tom Rini trini@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' ?
Regards, Simon

Hi Simon,
Il giorno 14 ott 2021, alle ore 20:24, Simon Glass sjg@chromium.org ha scritto:
Hi,
On Thu, 14 Oct 2021 at 07:46, Tom Rini trini@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.
Best regards Giulio
Regards, Simon

Hi Giulio,
On Thu, 14 Oct 2021 at 13:23, Giulio Benetti giulio.benetti@benettiengineering.com wrote:
Hi Simon,
Il giorno 14 ott 2021, alle ore 20:24, Simon Glass sjg@chromium.org ha scritto:
Hi,
On Thu, 14 Oct 2021 at 07:46, Tom Rini trini@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?
Regards, Simon

Hi Simon,
Il giorno 14 ott 2021, alle ore 22:43, Simon Glass sjg@chromium.org ha scritto:
Hi Giulio,
On Thu, 14 Oct 2021 at 13:23, Giulio Benetti giulio.benetti@benettiengineering.com wrote:
Hi Simon,
Il giorno 14 ott 2021, alle ore 20:24, Simon Glass sjg@chromium.org ha scritto:
Hi,
On Thu, 14 Oct 2021 at 07:46, Tom Rini trini@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...
Sorry if this e-mail is html but I’m on mobile :-/
Best regards Giulio Benetti
Regards, Simon

Hi Giulio,
On Thu, 14 Oct 2021 at 15:12, Giulio Benetti giulio.benetti@benettiengineering.com wrote:
Hi Simon,
Il giorno 14 ott 2021, alle ore 22:43, Simon Glass sjg@chromium.org ha scritto:
Hi Giulio,
On Thu, 14 Oct 2021 at 13:23, Giulio Benetti giulio.benetti@benettiengineering.com wrote:
Hi Simon,
Il giorno 14 ott 2021, alle ore 20:24, Simon Glass sjg@chromium.org ha scritto:
Hi,
On Thu, 14 Oct 2021 at 07:46, Tom Rini trini@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...
How about not disabling CONFIG_DEFAULT_DEVICE_TREE ? That should work OK.
Regards, Simon
Sorry if this e-mail is html but I’m on mobile :-/
Best regards Giulio Benetti
Regards, Simon

Hi Simon,
Il giorno 15 ott 2021, alle ore 02:53, Simon Glass sjg@chromium.org ha scritto:
Hi Giulio,
On Thu, 14 Oct 2021 at 15:12, Giulio Benetti giulio.benetti@benettiengineering.com wrote:
Hi Simon,
Il giorno 14 ott 2021, alle ore 22:43, Simon Glass sjg@chromium.org ha scritto:
Hi Giulio,
On Thu, 14 Oct 2021 at 13:23, Giulio Benetti giulio.benetti@benettiengineering.com wrote:
Hi Simon,
Il giorno 14 ott 2021, alle ore 20:24, Simon Glass sjg@chromium.org ha scritto:
Hi,
On Thu, 14 Oct 2021 at 07:46, Tom Rini trini@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...
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

Hi Giulio,
On Thu, 14 Oct 2021 at 21:06, Giulio Benetti giulio.benetti@benettiengineering.com wrote:
Hi Simon,
Il giorno 15 ott 2021, alle ore 02:53, Simon Glass sjg@chromium.org ha scritto:
Hi Giulio,
On Thu, 14 Oct 2021 at 15:12, Giulio Benetti giulio.benetti@benettiengineering.com wrote:
Hi Simon,
Il giorno 14 ott 2021, alle ore 22:43, Simon Glass sjg@chromium.org ha scritto:
Hi Giulio,
On Thu, 14 Oct 2021 at 13:23, Giulio Benetti giulio.benetti@benettiengineering.com wrote:
Hi Simon,
Il giorno 14 ott 2021, alle ore 20:24, Simon Glass sjg@chromium.org ha scritto:
Hi,
On Thu, 14 Oct 2021 at 07:46, Tom Rini trini@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...
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:
- patch uboot adding the dts and the entry in dts/Makefile
- 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?
Have you tried EXT_DTB? It looks like DEVICE_TREE is designed for changing the name of the file.
EXT_DTB=/tmp/b/sandbox/u-boot.dtb CROSS_COMPILE=/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- make O=/tmp/b/snow -j30 snow_defconfig all
You need to compile it first though.
For your case, I did a bisect with:
git bisect run make -s DEVICE_TREE=try CROSS_COMPILE=/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- O=/tmp/b/snow -j30 mrproper snow_defconfig all
and got:
a3444bd09af (refs/bisect/bad) Revert "Ensure device tree DTS is compiled"
+Masahiro Yamada who might know
BTW if you rely on this feature, once it is working again, we should add a test for it.
Regards, Simon
participants (3)
-
Giulio Benetti
-
Simon Glass
-
Tom Rini