u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* External dts building
@ 2021-10-14  0:53 Giulio Benetti
  2021-10-14 13:45 ` Tom Rini
  0 siblings, 1 reply; 12+ messages in thread
From: Giulio Benetti @ 2021-10-14  0:53 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: External dts building
  2021-10-14  0:53 External dts building Giulio Benetti
@ 2021-10-14 13:45 ` Tom Rini
  2021-10-14 18:08   ` Giulio Benetti
  2021-10-14 18:24   ` Simon Glass
  0 siblings, 2 replies; 12+ messages in thread
From: Tom Rini @ 2021-10-14 13:45 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: u-boot

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

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.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: External dts building
  2021-10-14 13:45 ` Tom Rini
@ 2021-10-14 18:08   ` Giulio Benetti
  2021-10-14 18:22     ` Tom Rini
  2021-10-14 18:24   ` Simon Glass
  1 sibling, 1 reply; 12+ messages in thread
From: Giulio Benetti @ 2021-10-14 18:08 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot


> 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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: External dts building
  2021-10-14 18:08   ` Giulio Benetti
@ 2021-10-14 18:22     ` Tom Rini
  2021-10-14 21:27       ` Giulio Benetti
  0 siblings, 1 reply; 12+ messages in thread
From: Tom Rini @ 2021-10-14 18:22 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: u-boot

[-- Attachment #1: Type: text/plain, Size: 1052 bytes --]

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.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: External dts building
  2021-10-14 13:45 ` Tom Rini
  2021-10-14 18:08   ` Giulio Benetti
@ 2021-10-14 18:24   ` Simon Glass
  2021-10-14 19:23     ` Giulio Benetti
  1 sibling, 1 reply; 12+ messages in thread
From: Simon Glass @ 2021-10-14 18:24 UTC (permalink / raw)
  To: Tom Rini; +Cc: Giulio Benetti, U-Boot Mailing List

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: External dts building
  2021-10-14 18:24   ` Simon Glass
@ 2021-10-14 19:23     ` Giulio Benetti
  2021-10-14 20:43       ` Simon Glass
  0 siblings, 1 reply; 12+ messages in thread
From: Giulio Benetti @ 2021-10-14 19:23 UTC (permalink / raw)
  To: Simon Glass; +Cc: Tom Rini, U-Boot Mailing List

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: External dts building
  2021-10-14 19:23     ` Giulio Benetti
@ 2021-10-14 20:43       ` Simon Glass
  2021-10-14 21:12         ` Giulio Benetti
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Glass @ 2021-10-14 20:43 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: Tom Rini, U-Boot Mailing List

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: External dts building
  2021-10-14 20:43       ` Simon Glass
@ 2021-10-14 21:12         ` Giulio Benetti
  2021-10-15  0:53           ` Simon Glass
  0 siblings, 1 reply; 12+ messages in thread
From: Giulio Benetti @ 2021-10-14 21:12 UTC (permalink / raw)
  To: Simon Glass; +Cc: Tom Rini, U-Boot Mailing List

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-giulio.benetti@benettiengineering.com/

Sorry if this e-mail is html but I’m on mobile :-/

Best regards
Giulio Benetti

> 
> Regards,
> Simon

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: External dts building
  2021-10-14 18:22     ` Tom Rini
@ 2021-10-14 21:27       ` Giulio Benetti
  0 siblings, 0 replies; 12+ messages in thread
From: Giulio Benetti @ 2021-10-14 21:27 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot

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

-- 
Giulio Benetti
Benetti Engineering sas

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: External dts building
  2021-10-14 21:12         ` Giulio Benetti
@ 2021-10-15  0:53           ` Simon Glass
  2021-10-15  3:06             ` Giulio Benetti
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Glass @ 2021-10-15  0:53 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: Tom Rini, U-Boot Mailing List

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-giulio.benetti@benettiengineering.com/

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: External dts building
  2021-10-15  0:53           ` Simon Glass
@ 2021-10-15  3:06             ` Giulio Benetti
  2021-10-16  0:31               ` Simon Glass
  0 siblings, 1 reply; 12+ messages in thread
From: Giulio Benetti @ 2021-10-15  3:06 UTC (permalink / raw)
  To: Simon Glass; +Cc: Tom Rini, U-Boot Mailing List

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-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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: External dts building
  2021-10-15  3:06             ` Giulio Benetti
@ 2021-10-16  0:31               ` Simon Glass
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2021-10-16  0:31 UTC (permalink / raw)
  To: Giulio Benetti, Masahiro Yamada; +Cc: Tom Rini, U-Boot Mailing List

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-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?

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-10-16  0:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14  0:53 External dts building Giulio Benetti
2021-10-14 13:45 ` Tom Rini
2021-10-14 18:08   ` Giulio Benetti
2021-10-14 18:22     ` Tom Rini
2021-10-14 21:27       ` Giulio Benetti
2021-10-14 18:24   ` Simon Glass
2021-10-14 19:23     ` Giulio Benetti
2021-10-14 20:43       ` Simon Glass
2021-10-14 21:12         ` Giulio Benetti
2021-10-15  0:53           ` Simon Glass
2021-10-15  3:06             ` Giulio Benetti
2021-10-16  0:31               ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).