* [RFC PATCH 0/1] Only build dtc when DTC= is not set on the command line @ 2024-10-11 14:05 Jes Sorensen 2024-10-11 14:05 ` [PATCH 1/1] Skip building dtc if a prebuilt binary is specified via DTC= Jes Sorensen 0 siblings, 1 reply; 7+ messages in thread From: Jes Sorensen @ 2024-10-11 14:05 UTC (permalink / raw) To: devicetree; +Cc: tnovak, Jes Sorensen From: Jes Sorensen <jes@trained-monkey.org> RFC on Android it is quite common to have a prebuilt version of dtc. In this case one doesn't really want to build dtc in the kernel tree, as it is unused and to avoid the risk of mixing and matching dtc versions. This is the simplest fix I see for this. An alternative would be to define a new DTC_USE_PREBUILT flag. Thoughts? Jes Jes Sorensen (1): Skip building dtc if a prebuilt binary is specified via DTC= scripts/dtc/Makefile | 3 +++ 1 file changed, 3 insertions(+) -- 2.46.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/1] Skip building dtc if a prebuilt binary is specified via DTC= 2024-10-11 14:05 [RFC PATCH 0/1] Only build dtc when DTC= is not set on the command line Jes Sorensen @ 2024-10-11 14:05 ` Jes Sorensen 2024-10-11 22:46 ` Rob Herring 0 siblings, 1 reply; 7+ messages in thread From: Jes Sorensen @ 2024-10-11 14:05 UTC (permalink / raw) To: devicetree; +Cc: tnovak, Jes Sorensen From: Jes Sorensen <jes@trained-monkey.org> For Android it is common to use a prebuilt dtc, speficied via DTC=. In this case building dtc as part of the kernel is not necessary, and even unwanted to avoid mix and match between two different versions of dtc. Signed-off-by: Jes Sorensen <jes@trained-monkey.org> --- scripts/dtc/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile index b47f4daa4515..3b683dc7e582 100644 --- a/scripts/dtc/Makefile +++ b/scripts/dtc/Makefile @@ -2,8 +2,11 @@ # scripts/dtc makefile # *** Also keep .gitignore in sync when changing *** +# If a prebuilt dtc binary is specificed, don't build dtc +ifeq ($(DTC),) hostprogs-always-$(CONFIG_DTC) += dtc fdtoverlay hostprogs-always-$(CHECK_DTBS) += dtc +endif dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ srcpos.o checks.o util.o -- 2.46.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] Skip building dtc if a prebuilt binary is specified via DTC= 2024-10-11 14:05 ` [PATCH 1/1] Skip building dtc if a prebuilt binary is specified via DTC= Jes Sorensen @ 2024-10-11 22:46 ` Rob Herring 2024-10-14 14:40 ` Jes Sorensen 0 siblings, 1 reply; 7+ messages in thread From: Rob Herring @ 2024-10-11 22:46 UTC (permalink / raw) To: Jes Sorensen; +Cc: devicetree, tnovak, Jes Sorensen On Fri, Oct 11, 2024 at 9:05 AM Jes Sorensen <jes.sorensen@gmail.com> wrote: > > From: Jes Sorensen <jes@trained-monkey.org> > > For Android it is common to use a prebuilt dtc, speficied via DTC=. In > this case building dtc as part of the kernel is not necessary, and even > unwanted to avoid mix and match between two different versions of dtc. > > Signed-off-by: Jes Sorensen <jes@trained-monkey.org> > --- > scripts/dtc/Makefile | 3 +++ > 1 file changed, 3 insertions(+) Well, this one is much simpler than a prior attempt[1] and may be acceptable. But I wonder if something is not handled here. I think lack of external fdtoverlay support makes this incomplete. Rob [1] https://lore.kernel.org/all/20240815110059.4912-1-tianyuanhao3@163.com/ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] Skip building dtc if a prebuilt binary is specified via DTC= 2024-10-11 22:46 ` Rob Herring @ 2024-10-14 14:40 ` Jes Sorensen 2024-10-14 14:48 ` Rob Herring 0 siblings, 1 reply; 7+ messages in thread From: Jes Sorensen @ 2024-10-14 14:40 UTC (permalink / raw) To: Rob Herring; +Cc: devicetree, tnovak, Jes Sorensen On 10/11/24 18:46, Rob Herring wrote: > On Fri, Oct 11, 2024 at 9:05 AM Jes Sorensen <jes.sorensen@gmail.com> wrote: >> >> From: Jes Sorensen <jes@trained-monkey.org> >> >> For Android it is common to use a prebuilt dtc, speficied via DTC=. In >> this case building dtc as part of the kernel is not necessary, and even >> unwanted to avoid mix and match between two different versions of dtc. >> >> Signed-off-by: Jes Sorensen <jes@trained-monkey.org> >> --- >> scripts/dtc/Makefile | 3 +++ >> 1 file changed, 3 insertions(+) > > Well, this one is much simpler than a prior attempt[1] and may be > acceptable. But I wonder if something is not handled here. > > I think lack of external fdtoverlay support makes this incomplete. So I was thinking about that. The only places I see in the tree that reference fdtoverlay are scripts/make_fit.py, scripts/Makefile.dtbs, and scripts/dtc/Makefile. I don't see anything calling make_fit.py. We can either exclude fdtoverlay from this, or assume that if one explicitly sets prebuilts, fdtoverlay is there too. Thoughts? Thanks, Jes ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] Skip building dtc if a prebuilt binary is specified via DTC= 2024-10-14 14:40 ` Jes Sorensen @ 2024-10-14 14:48 ` Rob Herring 2024-10-14 14:49 ` Jes Sorensen 0 siblings, 1 reply; 7+ messages in thread From: Rob Herring @ 2024-10-14 14:48 UTC (permalink / raw) To: Jes Sorensen; +Cc: devicetree, tnovak On Mon, Oct 14, 2024 at 9:41 AM Jes Sorensen <jes@trained-monkey.org> wrote: > > On 10/11/24 18:46, Rob Herring wrote: > > On Fri, Oct 11, 2024 at 9:05 AM Jes Sorensen <jes.sorensen@gmail.com> wrote: > >> > >> From: Jes Sorensen <jes@trained-monkey.org> > >> > >> For Android it is common to use a prebuilt dtc, speficied via DTC=. In > >> this case building dtc as part of the kernel is not necessary, and even > >> unwanted to avoid mix and match between two different versions of dtc. > >> > >> Signed-off-by: Jes Sorensen <jes@trained-monkey.org> > >> --- > >> scripts/dtc/Makefile | 3 +++ > >> 1 file changed, 3 insertions(+) > > > > Well, this one is much simpler than a prior attempt[1] and may be > > acceptable. But I wonder if something is not handled here. > > > > I think lack of external fdtoverlay support makes this incomplete. > > So I was thinking about that. The only places I see in the tree that > reference fdtoverlay are scripts/make_fit.py, scripts/Makefile.dtbs, and > scripts/dtc/Makefile. I don't see anything calling make_fit.py. "make dtbs" will use fdtoverlay if there are any base+overlay targets which there are an increasing number of. > We can either exclude fdtoverlay from this, or assume that if one > explicitly sets prebuilts, fdtoverlay is there too. Currently, if you set DTC you'll get external dtc plus in-tree fdtoverlay. With your patch, you'll get external dtc plus a build error because $(objtree)/scripts/dtc/fdtoverlay does not exist. Neither case is ideal. Rob ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] Skip building dtc if a prebuilt binary is specified via DTC= 2024-10-14 14:48 ` Rob Herring @ 2024-10-14 14:49 ` Jes Sorensen 2024-10-14 15:17 ` Rob Herring 0 siblings, 1 reply; 7+ messages in thread From: Jes Sorensen @ 2024-10-14 14:49 UTC (permalink / raw) To: Rob Herring; +Cc: devicetree, tnovak On 10/14/24 10:48, Rob Herring wrote: > On Mon, Oct 14, 2024 at 9:41 AM Jes Sorensen <jes@trained-monkey.org> wrote: >> >> On 10/11/24 18:46, Rob Herring wrote: >>> On Fri, Oct 11, 2024 at 9:05 AM Jes Sorensen <jes.sorensen@gmail.com> wrote: >>>> >>>> From: Jes Sorensen <jes@trained-monkey.org> >>>> >>>> For Android it is common to use a prebuilt dtc, speficied via DTC=. In >>>> this case building dtc as part of the kernel is not necessary, and even >>>> unwanted to avoid mix and match between two different versions of dtc. >>>> >>>> Signed-off-by: Jes Sorensen <jes@trained-monkey.org> >>>> --- >>>> scripts/dtc/Makefile | 3 +++ >>>> 1 file changed, 3 insertions(+) >>> >>> Well, this one is much simpler than a prior attempt[1] and may be >>> acceptable. But I wonder if something is not handled here. >>> >>> I think lack of external fdtoverlay support makes this incomplete. >> >> So I was thinking about that. The only places I see in the tree that >> reference fdtoverlay are scripts/make_fit.py, scripts/Makefile.dtbs, and >> scripts/dtc/Makefile. I don't see anything calling make_fit.py. > > "make dtbs" will use fdtoverlay if there are any base+overlay targets > which there are an increasing number of. > >> We can either exclude fdtoverlay from this, or assume that if one >> explicitly sets prebuilts, fdtoverlay is there too. > > Currently, if you set DTC you'll get external dtc plus in-tree > fdtoverlay. With your patch, you'll get external dtc plus a build > error because $(objtree)/scripts/dtc/fdtoverlay does not exist. > Neither case is ideal. Agree, what path calls fdtoverlay ? I didn't see anything calling that script. Thanks, Jes ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] Skip building dtc if a prebuilt binary is specified via DTC= 2024-10-14 14:49 ` Jes Sorensen @ 2024-10-14 15:17 ` Rob Herring 0 siblings, 0 replies; 7+ messages in thread From: Rob Herring @ 2024-10-14 15:17 UTC (permalink / raw) To: Jes Sorensen; +Cc: devicetree, tnovak On Mon, Oct 14, 2024 at 10:05 AM Jes Sorensen <jes@trained-monkey.org> wrote: > > On 10/14/24 10:48, Rob Herring wrote: > > On Mon, Oct 14, 2024 at 9:41 AM Jes Sorensen <jes@trained-monkey.org> wrote: > >> > >> On 10/11/24 18:46, Rob Herring wrote: > >>> On Fri, Oct 11, 2024 at 9:05 AM Jes Sorensen <jes.sorensen@gmail.com> wrote: > >>>> > >>>> From: Jes Sorensen <jes@trained-monkey.org> > >>>> > >>>> For Android it is common to use a prebuilt dtc, speficied via DTC=. In > >>>> this case building dtc as part of the kernel is not necessary, and even > >>>> unwanted to avoid mix and match between two different versions of dtc. > >>>> > >>>> Signed-off-by: Jes Sorensen <jes@trained-monkey.org> > >>>> --- > >>>> scripts/dtc/Makefile | 3 +++ > >>>> 1 file changed, 3 insertions(+) > >>> > >>> Well, this one is much simpler than a prior attempt[1] and may be > >>> acceptable. But I wonder if something is not handled here. > >>> > >>> I think lack of external fdtoverlay support makes this incomplete. > >> > >> So I was thinking about that. The only places I see in the tree that > >> reference fdtoverlay are scripts/make_fit.py, scripts/Makefile.dtbs, and > >> scripts/dtc/Makefile. I don't see anything calling make_fit.py. > > > > "make dtbs" will use fdtoverlay if there are any base+overlay targets > > which there are an increasing number of. > > > >> We can either exclude fdtoverlay from this, or assume that if one > >> explicitly sets prebuilts, fdtoverlay is there too. > > > > Currently, if you set DTC you'll get external dtc plus in-tree > > fdtoverlay. With your patch, you'll get external dtc plus a build > > error because $(objtree)/scripts/dtc/fdtoverlay does not exist. > > Neither case is ideal. > > Agree, what path calls fdtoverlay ? I didn't see anything calling that > script. It is the same magic used used to combine object files for a module. Anywhere you have "foo-dtbs = base.dtb overlay.dtbo \n dtbs-y += foo.dtb", foo.dtb will be built by applying the overlay with fdtoverlay. Rob ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-10-14 15:18 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-10-11 14:05 [RFC PATCH 0/1] Only build dtc when DTC= is not set on the command line Jes Sorensen 2024-10-11 14:05 ` [PATCH 1/1] Skip building dtc if a prebuilt binary is specified via DTC= Jes Sorensen 2024-10-11 22:46 ` Rob Herring 2024-10-14 14:40 ` Jes Sorensen 2024-10-14 14:48 ` Rob Herring 2024-10-14 14:49 ` Jes Sorensen 2024-10-14 15:17 ` Rob Herring
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).