devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: Don't assume dts files live in arch/*/boot/dts
@ 2013-05-08 10:59 Matthijs Kooijman
  2013-05-08 14:50 ` Stephen Warren
  0 siblings, 1 reply; 5+ messages in thread
From: Matthijs Kooijman @ 2013-05-08 10:59 UTC (permalink / raw)
  To: Michal Marek, Grant Likely, Rob Herring
  Cc: linux-kbuild, devicetree-discuss, linux-kernel, linux-mips,
	Stephen Warren, Matthijs Kooijman

In commit b40b25ff (kbuild: always run gcc -E on *.dts, remove cmd_dtc_cpp),
dts building was changed to always use the C preprocessor. This meant
that the .dts file passed to dtc is not the original, but the
preprocessed one.

When compiling with a separate build directory (i.e., with O=), this
preprocessed file will not live in the same directory as the original.
When the .dts file includes .dtsi files, dtc will look for them in the
build directory, not in the source directory and compilation will fail.

The commit referenced above tried to fix this by passing arch/*/boot/dts
as an include path to dtc. However, for mips, the .dts files are not in
this directory, so dts compilation on mips breaks for some targets.

Instead of hardcoding this particular include path, this commit just
uses the directory of the .dts file that is being compiled, which
effectively restores the previous behaviour wrt includes. For most .dts
files, this path is just the same as the previous hardcoded
arch/*/boot/dts path.

This was tested on a mips (rt3052) and an arm (bcm2835) target.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
---
 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 51bb3de..8337663 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -264,7 +264,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
 quiet_cmd_dtc = DTC     $@
 cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
 	$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
-		-i $(srctree)/arch/$(SRCARCH)/boot/dts $(DTC_FLAGS) \
+		-i $(dir $<) $(DTC_FLAGS) \
 		-d $(depfile).dtc $(dtc-tmp) ; \
 	cat $(depfile).pre $(depfile).dtc > $(depfile)
 
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] kbuild: Don't assume dts files live in arch/*/boot/dts
  2013-05-08 10:59 [PATCH] kbuild: Don't assume dts files live in arch/*/boot/dts Matthijs Kooijman
@ 2013-05-08 14:50 ` Stephen Warren
  2013-05-08 15:02   ` Matthijs Kooijman
  2013-05-18 18:41   ` Matthijs Kooijman
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Warren @ 2013-05-08 14:50 UTC (permalink / raw)
  To: Matthijs Kooijman
  Cc: Michal Marek, Grant Likely, Rob Herring, linux-kbuild,
	devicetree-discuss, linux-kernel, linux-mips, Stephen Warren

On 05/08/2013 04:59 AM, Matthijs Kooijman wrote:
> In commit b40b25ff (kbuild: always run gcc -E on *.dts, remove cmd_dtc_cpp),
> dts building was changed to always use the C preprocessor. This meant
> that the .dts file passed to dtc is not the original, but the
> preprocessed one.
> 
> When compiling with a separate build directory (i.e., with O=), this
> preprocessed file will not live in the same directory as the original.
> When the .dts file includes .dtsi files, dtc will look for them in the
> build directory, not in the source directory and compilation will fail.
> 
> The commit referenced above tried to fix this by passing arch/*/boot/dts
> as an include path to dtc. However, for mips, the .dts files are not in
> this directory, so dts compilation on mips breaks for some targets.
> 
> Instead of hardcoding this particular include path, this commit just
> uses the directory of the .dts file that is being compiled, which
> effectively restores the previous behaviour wrt includes. For most .dts
> files, this path is just the same as the previous hardcoded
> arch/*/boot/dts path.
> 
> This was tested on a mips (rt3052) and an arm (bcm2835) target.

Reviewed-by: Stephen Warren <swarren@nvidia.com>

(although I wonder if the .dts files shouldn't be in a standard location?)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kbuild: Don't assume dts files live in arch/*/boot/dts
  2013-05-08 14:50 ` Stephen Warren
@ 2013-05-08 15:02   ` Matthijs Kooijman
  2013-05-18 18:41   ` Matthijs Kooijman
  1 sibling, 0 replies; 5+ messages in thread
From: Matthijs Kooijman @ 2013-05-08 15:02 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Michal Marek, Grant Likely, Rob Herring, linux-kbuild,
	devicetree-discuss, linux-kernel, linux-mips, Stephen Warren

Hey Stephen,

On Wed, May 08, 2013 at 08:50:49AM -0600, Stephen Warren wrote:
> On 05/08/2013 04:59 AM, Matthijs Kooijman wrote:
> > ...
> > The commit referenced above tried to fix this by passing arch/*/boot/dts
> > as an include path to dtc. However, for mips, the .dts files are not in
> > this directory, so dts compilation on mips breaks for some targets.
> > ...
>
> (although I wonder if the .dts files shouldn't be in a standard location?)

On mips, I think the dts files are stored together with the soc code in
per-manufacturer directories, which probably works for them.

Regardless of that discussion, I think my patch makes the dts handling
code more generic, so it's probably a good idea to include it anyway.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kbuild: Don't assume dts files live in arch/*/boot/dts
  2013-05-08 14:50 ` Stephen Warren
  2013-05-08 15:02   ` Matthijs Kooijman
@ 2013-05-18 18:41   ` Matthijs Kooijman
  2013-05-23  8:15     ` Michal Marek
  1 sibling, 1 reply; 5+ messages in thread
From: Matthijs Kooijman @ 2013-05-18 18:41 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Michal Marek, Grant Likely, Rob Herring, linux-kbuild,
	devicetree-discuss, linux-kernel, linux-mips, Stephen Warren

Hi Michal,

On Wed, May 08, 2013 at 08:50:49AM -0600, Stephen Warren wrote:
> On 05/08/2013 04:59 AM, Matthijs Kooijman wrote:
> > In commit b40b25ff (kbuild: always run gcc -E on *.dts, remove cmd_dtc_cpp),
> > dts building was changed to always use the C preprocessor. This meant
> > that the .dts file passed to dtc is not the original, but the
> > preprocessed one.
> > 
> > When compiling with a separate build directory (i.e., with O=), this
> > preprocessed file will not live in the same directory as the original.
> > When the .dts file includes .dtsi files, dtc will look for them in the
> > build directory, not in the source directory and compilation will fail.
> > 
> > The commit referenced above tried to fix this by passing arch/*/boot/dts
> > as an include path to dtc. However, for mips, the .dts files are not in
> > this directory, so dts compilation on mips breaks for some targets.
> > 
> > Instead of hardcoding this particular include path, this commit just
> > uses the directory of the .dts file that is being compiled, which
> > effectively restores the previous behaviour wrt includes. For most .dts
> > files, this path is just the same as the previous hardcoded
> > arch/*/boot/dts path.
> > 
> > This was tested on a mips (rt3052) and an arm (bcm2835) target.
> 
> Reviewed-by: Stephen Warren <swarren@nvidia.com>

Did this patch look ok to you? If so, could you pick it up and send it
over to Linus for 3.10 (or should I send it directly)?

Gr.

Matthijs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kbuild: Don't assume dts files live in arch/*/boot/dts
  2013-05-18 18:41   ` Matthijs Kooijman
@ 2013-05-23  8:15     ` Michal Marek
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Marek @ 2013-05-23  8:15 UTC (permalink / raw)
  To: Stephen Warren, Grant Likely, Rob Herring, linux-kbuild,
	devicetree-discuss, linux-kernel, linux-mips, Stephen Warren

On 18.5.2013 20:41, Matthijs Kooijman wrote:
> Hi Michal,
> 
> On Wed, May 08, 2013 at 08:50:49AM -0600, Stephen Warren wrote:
>> On 05/08/2013 04:59 AM, Matthijs Kooijman wrote:
>>> In commit b40b25ff (kbuild: always run gcc -E on *.dts, remove cmd_dtc_cpp),
>>> dts building was changed to always use the C preprocessor. This meant
>>> that the .dts file passed to dtc is not the original, but the
>>> preprocessed one.
>>>
>>> When compiling with a separate build directory (i.e., with O=), this
>>> preprocessed file will not live in the same directory as the original.
>>> When the .dts file includes .dtsi files, dtc will look for them in the
>>> build directory, not in the source directory and compilation will fail.
>>>
>>> The commit referenced above tried to fix this by passing arch/*/boot/dts
>>> as an include path to dtc. However, for mips, the .dts files are not in
>>> this directory, so dts compilation on mips breaks for some targets.
>>>
>>> Instead of hardcoding this particular include path, this commit just
>>> uses the directory of the .dts file that is being compiled, which
>>> effectively restores the previous behaviour wrt includes. For most .dts
>>> files, this path is just the same as the previous hardcoded
>>> arch/*/boot/dts path.
>>>
>>> This was tested on a mips (rt3052) and an arm (bcm2835) target.
>>
>> Reviewed-by: Stephen Warren <swarren@nvidia.com>
> 
> Did this patch look ok to you? If so, could you pick it up and send it
> over to Linus for 3.10 (or should I send it directly)?

I applied the patch to kbuild.git#rc-fixes now.

Michal

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-23  8:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-08 10:59 [PATCH] kbuild: Don't assume dts files live in arch/*/boot/dts Matthijs Kooijman
2013-05-08 14:50 ` Stephen Warren
2013-05-08 15:02   ` Matthijs Kooijman
2013-05-18 18:41   ` Matthijs Kooijman
2013-05-23  8:15     ` Michal Marek

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).