diff mbox series

[5/6] Makefile: tune the include order

Message ID 20240327-imx93-of-v1-5-afab6b31422a@nxp.com
State Superseded
Delegated to: Fabio Estevam
Headers show
Series imx93-11x11-evk: convert to OF_UPSTREAM | expand

Commit Message

Peng Fan (OSS) March 27, 2024, 2:10 p.m. UTC
From: Peng Fan <peng.fan@nxp.com>

For OF_UPSTREAM support, the U-Boot headers under dt-bindings/ maybe
different with OF_UPSTREAM headers. So let OF_UPSTREAM headers be
included first when migrating to OF_UPSTREAM.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Sumit Garg March 27, 2024, 1:21 p.m. UTC | #1
Hi Peng,

On Wed, 27 Mar 2024 at 18:41, Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> For OF_UPSTREAM support, the U-Boot headers under dt-bindings/ maybe
> different with OF_UPSTREAM headers. So let OF_UPSTREAM headers be
> included first when migrating to OF_UPSTREAM.

No, please don't do that. The current include order gives preference
to the U-Boot headers under dt-bindings/ such that we don't break
platforms which haven't converted to OF_UPSTREAM.

So while migrating to OF_UPSTREAM, you should just drop redundant
headers under dt-bindings/ instead.

-Sumit

>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  Makefile | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index b80924241ec..b9c2d896c2e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -827,6 +827,7 @@ KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g)
>  # Use UBOOTINCLUDE when you must reference the include/ directory.
>  # Needed to be compatible with the O= option
>  UBOOTINCLUDE    := \
> +       -I$(srctree)/dts/upstream/include \
>         -Iinclude \
>         $(if $(KBUILD_SRC), -I$(srctree)/include) \
>         $(if $(CONFIG_$(SPL_)SYS_THUMB_BUILD), \
> @@ -835,8 +836,7 @@ UBOOTINCLUDE    := \
>                                 -I$(srctree)/arch/arm/thumb1/include), \
>                         -I$(srctree)/arch/arm/thumb1/include)) \
>         -I$(srctree)/arch/$(ARCH)/include \
> -       -include $(srctree)/include/linux/kconfig.h \
> -       -I$(srctree)/dts/upstream/include
> +       -include $(srctree)/include/linux/kconfig.h
>
>  NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
>
> @@ -907,7 +907,7 @@ ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y)
>  PLATFORM_LIBGCC = arch/$(ARCH)/lib/lib.a
>  else
>  ifndef CONFIG_CC_IS_CLANG
> -PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`) -lgcc
> +PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`)
>  endif
>  endif
>  PLATFORM_LIBS += $(PLATFORM_LIBGCC)
>
> --
> 2.35.3
>
Peng Fan March 27, 2024, 1:31 p.m. UTC | #2
> Subject: Re: [PATCH 5/6] Makefile: tune the include order
> 
> Hi Peng,
> 
> On Wed, 27 Mar 2024 at 18:41, Peng Fan (OSS) <peng.fan@oss.nxp.com>
> wrote:
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > For OF_UPSTREAM support, the U-Boot headers under dt-bindings/ maybe
> > different with OF_UPSTREAM headers. So let OF_UPSTREAM headers be
> > included first when migrating to OF_UPSTREAM.
> 
> No, please don't do that. The current include order gives preference to the U-
> Boot headers under dt-bindings/ such that we don't break platforms which
> haven't converted to OF_UPSTREAM.
> 
> So while migrating to OF_UPSTREAM, you should just drop redundant
> headers under dt-bindings/ instead.

But while in the middle that some boards using OF_UPSTREAM, some not,
we could not drop that.

I could sync the dt-bindings header first to avoid break anyway.

Regards,
Peng.

> 
> -Sumit
> 
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  Makefile | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index b80924241ec..b9c2d896c2e 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -827,6 +827,7 @@ KBUILD_HOSTCFLAGS += $(if
> > $(CONFIG_TOOLS_DEBUG),-g)  # Use UBOOTINCLUDE when you must
> reference the include/ directory.
> >  # Needed to be compatible with the O= option
> >  UBOOTINCLUDE    := \
> > +       -I$(srctree)/dts/upstream/include \
> >         -Iinclude \
> >         $(if $(KBUILD_SRC), -I$(srctree)/include) \
> >         $(if $(CONFIG_$(SPL_)SYS_THUMB_BUILD), \
> > @@ -835,8 +836,7 @@ UBOOTINCLUDE    := \
> >                                 -I$(srctree)/arch/arm/thumb1/include), \
> >                         -I$(srctree)/arch/arm/thumb1/include)) \
> >         -I$(srctree)/arch/$(ARCH)/include \
> > -       -include $(srctree)/include/linux/kconfig.h \
> > -       -I$(srctree)/dts/upstream/include
> > +       -include $(srctree)/include/linux/kconfig.h
> >
> >  NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC)
> > -print-file-name=include)
> >
> > @@ -907,7 +907,7 @@ ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y)
> > PLATFORM_LIBGCC = arch/$(ARCH)/lib/lib.a  else  ifndef
> > CONFIG_CC_IS_CLANG -PLATFORM_LIBGCC := -L $(shell dirname `$(CC)
> > $(c_flags) -print-libgcc-file-name`) -lgcc
> > +PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags)
> > +-print-libgcc-file-name`)
> >  endif
> >  endif
> >  PLATFORM_LIBS += $(PLATFORM_LIBGCC)
> >
> > --
> > 2.35.3
> >
Sumit Garg March 27, 2024, 2:07 p.m. UTC | #3
On Wed, 27 Mar 2024 at 19:01, Peng Fan <peng.fan@nxp.com> wrote:
>
> > Subject: Re: [PATCH 5/6] Makefile: tune the include order
> >
> > Hi Peng,
> >
> > On Wed, 27 Mar 2024 at 18:41, Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > wrote:
> > >
> > > From: Peng Fan <peng.fan@nxp.com>
> > >
> > > For OF_UPSTREAM support, the U-Boot headers under dt-bindings/ maybe
> > > different with OF_UPSTREAM headers. So let OF_UPSTREAM headers be
> > > included first when migrating to OF_UPSTREAM.
> >
> > No, please don't do that. The current include order gives preference to the U-
> > Boot headers under dt-bindings/ such that we don't break platforms which
> > haven't converted to OF_UPSTREAM.
> >
> > So while migrating to OF_UPSTREAM, you should just drop redundant
> > headers under dt-bindings/ instead.
>
> But while in the middle that some boards using OF_UPSTREAM, some not,
> we could not drop that.

That's the real reason why we should try to migrate to OF_UPSTREAM at
SoC level rather than at board level. If a particular board isn't
supported upstream then they can opt out for the time being.

>
> I could sync the dt-bindings header first to avoid break anyway.

Once you do that sync then there won't be any reason to keep headers
under dt-bindings/.

-Sumit

>
> Regards,
> Peng.
>
> >
> > -Sumit
> >
> > >
> > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > ---
> > >  Makefile | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/Makefile b/Makefile
> > > index b80924241ec..b9c2d896c2e 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -827,6 +827,7 @@ KBUILD_HOSTCFLAGS += $(if
> > > $(CONFIG_TOOLS_DEBUG),-g)  # Use UBOOTINCLUDE when you must
> > reference the include/ directory.
> > >  # Needed to be compatible with the O= option
> > >  UBOOTINCLUDE    := \
> > > +       -I$(srctree)/dts/upstream/include \
> > >         -Iinclude \
> > >         $(if $(KBUILD_SRC), -I$(srctree)/include) \
> > >         $(if $(CONFIG_$(SPL_)SYS_THUMB_BUILD), \
> > > @@ -835,8 +836,7 @@ UBOOTINCLUDE    := \
> > >                                 -I$(srctree)/arch/arm/thumb1/include), \
> > >                         -I$(srctree)/arch/arm/thumb1/include)) \
> > >         -I$(srctree)/arch/$(ARCH)/include \
> > > -       -include $(srctree)/include/linux/kconfig.h \
> > > -       -I$(srctree)/dts/upstream/include
> > > +       -include $(srctree)/include/linux/kconfig.h
> > >
> > >  NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC)
> > > -print-file-name=include)
> > >
> > > @@ -907,7 +907,7 @@ ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y)
> > > PLATFORM_LIBGCC = arch/$(ARCH)/lib/lib.a  else  ifndef
> > > CONFIG_CC_IS_CLANG -PLATFORM_LIBGCC := -L $(shell dirname `$(CC)
> > > $(c_flags) -print-libgcc-file-name`) -lgcc
> > > +PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags)
> > > +-print-libgcc-file-name`)
> > >  endif
> > >  endif
> > >  PLATFORM_LIBS += $(PLATFORM_LIBGCC)
> > >
> > > --
> > > 2.35.3
> > >
Fabio Estevam March 27, 2024, 2:13 p.m. UTC | #4
Peng,

On Wed, Mar 27, 2024 at 11:07 AM Sumit Garg <sumit.garg@linaro.org> wrote:

> That's the real reason why we should try to migrate to OF_UPSTREAM at
> SoC level rather than at board level. If a particular board isn't
> supported upstream then they can opt out for the time being.

All the imx93 boards in U-Boot are supported by the upstream kernel, so, yes,
please migrate all of them to  OF_UPSTREAM.
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index b80924241ec..b9c2d896c2e 100644
--- a/Makefile
+++ b/Makefile
@@ -827,6 +827,7 @@  KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g)
 # Use UBOOTINCLUDE when you must reference the include/ directory.
 # Needed to be compatible with the O= option
 UBOOTINCLUDE    := \
+	-I$(srctree)/dts/upstream/include \
 	-Iinclude \
 	$(if $(KBUILD_SRC), -I$(srctree)/include) \
 	$(if $(CONFIG_$(SPL_)SYS_THUMB_BUILD), \
@@ -835,8 +836,7 @@  UBOOTINCLUDE    := \
 				-I$(srctree)/arch/arm/thumb1/include), \
 			-I$(srctree)/arch/arm/thumb1/include)) \
 	-I$(srctree)/arch/$(ARCH)/include \
-	-include $(srctree)/include/linux/kconfig.h \
-	-I$(srctree)/dts/upstream/include
+	-include $(srctree)/include/linux/kconfig.h
 
 NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
 
@@ -907,7 +907,7 @@  ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y)
 PLATFORM_LIBGCC = arch/$(ARCH)/lib/lib.a
 else
 ifndef CONFIG_CC_IS_CLANG
-PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`) -lgcc
+PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`)
 endif
 endif
 PLATFORM_LIBS += $(PLATFORM_LIBGCC)