Message ID | 1399306150-932-5-git-send-email-sjg@chromium.org |
---|---|
State | RFC |
Headers | show |
On 05/05/2014 10:09 AM, Simon Glass wrote: > Linux supports this, and if we are to have compatible device tree files, > U-Boot should also. > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > # Modified for U-Boot > dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \ > -I$(srctree)/arch/$(ARCH)/dts \ > + -I$(srctree)/include \ > -undef -D__DTS__ I don't think we should add the top-level include/ directory to the DT include path. That is something I very specifically avoided in the kernel Makefiles. If we did allow this, then DTs could start including arbitrary U-Boot header files, rather than just header files intended to be used in DT bindings, and that would then make the DT files used in U-Boot not portable to the Linux kernel, or any standalone DT file repository which may appear. Instead, let's create a standalone root directory for the DT include files, and add that to the DT header path. We can add this DT-specific include path to the include patch for U-Boot C code if needed. Perhaps we can create a top-level dt/include/ or device-tree/include directory for this?
Hi Simon, Stephen, On Mon, 05 May 2014 10:54:52 -0600 Stephen Warren <swarren@wwwdotorg.org> wrote: > On 05/05/2014 10:09 AM, Simon Glass wrote: > > Linux supports this, and if we are to have compatible device tree files, > > U-Boot should also. > > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > > > # Modified for U-Boot > > dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \ > > -I$(srctree)/arch/$(ARCH)/dts \ > > + -I$(srctree)/include \ > > -undef -D__DTS__ > > I don't think we should add the top-level include/ directory to the DT > include path. That is something I very specifically avoided in the > kernel Makefiles. If we did allow this, then DTs could start including > arbitrary U-Boot header files, rather than just header files intended to > be used in DT bindings, and that would then make the DT files used in > U-Boot not portable to the Linux kernel, or any standalone DT file > repository which may appear. > > Instead, let's create a standalone root directory for the DT include > files, and add that to the DT header path. We can add this DT-specific > include path to the include patch for U-Boot C code if needed. > > Perhaps we can create a top-level dt/include/ or device-tree/include > directory for this? I agree with Stephen. I hesitate to add the top-level include/ to the path. If we try to follow the Linux style, we can add the include path "-I$(srctree)/arch/$(ARCH)/dts/include and create symbolic links to include/dt-bindings. Best Regards Masahiro Yamada
Hi Stephen and Masahiro On 6 May 2014 20:15, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote: > Hi Simon, Stephen, > > On Mon, 05 May 2014 10:54:52 -0600 > Stephen Warren <swarren@wwwdotorg.org> wrote: > > > On 05/05/2014 10:09 AM, Simon Glass wrote: > > > Linux supports this, and if we are to have compatible device tree > files, > > > U-Boot should also. > > > > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > > > > > # Modified for U-Boot > > > dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc > \ > > > -I$(srctree)/arch/$(ARCH)/dts \ > > > + -I$(srctree)/include \ > > > -undef -D__DTS__ > > > > I don't think we should add the top-level include/ directory to the DT > > include path. That is something I very specifically avoided in the > > kernel Makefiles. If we did allow this, then DTs could start including > > arbitrary U-Boot header files, rather than just header files intended to > > be used in DT bindings, and that would then make the DT files used in > > U-Boot not portable to the Linux kernel, or any standalone DT file > > repository which may appear. > > > > Instead, let's create a standalone root directory for the DT include > > files, and add that to the DT header path. We can add this DT-specific > > include path to the include patch for U-Boot C code if needed. > > > > Perhaps we can create a top-level dt/include/ or device-tree/include > > directory for this? > > I agree with Stephen. > I hesitate to add the top-level include/ to the path. > > If we try to follow the Linux style, > we can add the include path "-I$(srctree)/arch/$(ARCH)/dts/include > and create symbolic links to include/dt-bindings. > Yes that's fine. So long as we can use include files it is OK with me. Regards, Simon
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index a04439d..10358ba 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -153,6 +153,7 @@ ld_flags = $(LDFLAGS) $(ldflags-y) # Modified for U-Boot dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \ -I$(srctree)/arch/$(ARCH)/dts \ + -I$(srctree)/include \ -undef -D__DTS__ # Finds the multi-part object the current object will be linked into
Linux supports this, and if we are to have compatible device tree files, U-Boot should also. Signed-off-by: Simon Glass <sjg@chromium.org> --- Changes in v2: - Add new patch to support include files for .dts files scripts/Makefile.lib | 1 + 1 file changed, 1 insertion(+)