All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: External dts building
Date: Fri, 15 Oct 2021 05:06:32 +0200	[thread overview]
Message-ID: <619B8C04-19A5-4D9F-89E3-B28876AF6474@benettiengineering.com> (raw)
In-Reply-To: <CAPnjgZ1KkJg1KJb7XWtNbJ+=AUuf=6Vb_y_o_coKYbb7Op9pTA@mail.gmail.com>

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


  reply	other threads:[~2021-10-15  3:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-10-16  0:31               ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=619B8C04-19A5-4D9F-89E3-B28876AF6474@benettiengineering.com \
    --to=giulio.benetti@benettiengineering.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.