diff mbox

[RFC,1/2] Makefile: Add arch/arch/$(hdr-arch)/boot in header include path

Message ID 1360918364-27960-1-git-send-email-hdoyu@nvidia.com
State Changes Requested, archived
Headers show

Commit Message

Hiroshi Doyu Feb. 15, 2013, 8:52 a.m. UTC
With a new feature dtc+cpp, DT can introduces some definitions in its
header files for their own. Some of those DT info can be used in
kernel source as well, instead of having the duplicate info in kernel
headers. This patch allows kernel source to include those DT
headers. For example:

+ #include <dts/tegra20-car.h>

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Warren Feb. 15, 2013, 4:25 p.m. UTC | #1
On 02/15/2013 01:52 AM, Hiroshi Doyu wrote:
> With a new feature dtc+cpp, DT can introduces some definitions in its
> header files for their own. Some of those DT info can be used in
> kernel source as well, instead of having the duplicate info in kernel
> headers. This patch allows kernel source to include those DT
> headers. For example:
> 
> + #include <dts/tegra20-car.h>

Since this is devicetree-related, the DT maintainers should also be
CC'd. I've added them on this email, hence quoting the entire patch.

> 
> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
> ---
>  Makefile |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 0b4bf62..7f54cdb 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -364,7 +364,7 @@ LINUXINCLUDE    := \
>  		-I$(srctree)/arch/$(hdr-arch)/include \
>  		-Iarch/$(hdr-arch)/include/generated \
>  		$(if $(KBUILD_SRC), -I$(srctree)/include) \
> -		-Iinclude \
> +		-Iinclude -Iarch/$(hdr-arch)/boot \
>  		$(USERINCLUDE)
>  
>  KBUILD_CPPFLAGS := -D__KERNEL__
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Marek Feb. 18, 2013, 1:26 p.m. UTC | #2
On 15.2.2013 17:25, Stephen Warren wrote:
> On 02/15/2013 01:52 AM, Hiroshi Doyu wrote:
>> This patch allows kernel source to include those DT
>> headers. For example:
>>
>> + #include <dts/tegra20-car.h>
>>
>> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
>> ---
>>  Makefile |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 0b4bf62..7f54cdb 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -364,7 +364,7 @@ LINUXINCLUDE    := \
>>  		-I$(srctree)/arch/$(hdr-arch)/include \
>>  		-Iarch/$(hdr-arch)/include/generated \
>>  		$(if $(KBUILD_SRC), -I$(srctree)/include) \
>> -		-Iinclude \
>> +		-Iinclude -Iarch/$(hdr-arch)/boot \

Would it be possible to use a new directory for this? At least POWER and
x86 have several unrelated headers in their arch/*/boot that are only
meant for the bootstrap code.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Warren Feb. 19, 2013, 5:18 p.m. UTC | #3
On 02/18/2013 06:26 AM, Michal Marek wrote:
> On 15.2.2013 17:25, Stephen Warren wrote:
>> On 02/15/2013 01:52 AM, Hiroshi Doyu wrote:
>>> This patch allows kernel source to include those DT
>>> headers. For example:
>>>
>>> + #include <dts/tegra20-car.h>
>>>
>>> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
>>> ---
>>>  Makefile |    2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index 0b4bf62..7f54cdb 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -364,7 +364,7 @@ LINUXINCLUDE    := \
>>>  		-I$(srctree)/arch/$(hdr-arch)/include \
>>>  		-Iarch/$(hdr-arch)/include/generated \
>>>  		$(if $(KBUILD_SRC), -I$(srctree)/include) \
>>> -		-Iinclude \
>>> +		-Iinclude -Iarch/$(hdr-arch)/boot \
> 
> Would it be possible to use a new directory for this? At least POWER and
> x86 have several unrelated headers in their arch/*/boot that are only
> meant for the bootstrap code.

The need here is to allow access to headers in
arch/$(hdr-arch)/boot/dts, but passing the directory above that allows
including files as <dts/foo.h> which is nice. That's the rationale for
this patch.

But as I mentioned in other threads, I wonder if we should put the
header files in arch/$(hdr-arch)/boot/dts at all;
Documentation/devicetree/bindings/... would keep the headers adjacent to
the documentation for the bindings themselves, and the headers really
are part of the binding definitions... That would avoid the issue Michal
pointed out, and I think clean up the dtc+cpp include path usage too.

Grant, what are your thoughts?
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 0b4bf62..7f54cdb 100644
--- a/Makefile
+++ b/Makefile
@@ -364,7 +364,7 @@  LINUXINCLUDE    := \
 		-I$(srctree)/arch/$(hdr-arch)/include \
 		-Iarch/$(hdr-arch)/include/generated \
 		$(if $(KBUILD_SRC), -I$(srctree)/include) \
-		-Iinclude \
+		-Iinclude -Iarch/$(hdr-arch)/boot \
 		$(USERINCLUDE)
 
 KBUILD_CPPFLAGS := -D__KERNEL__