mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] dts target: How do I pass a device tree include directory?
@ 2017-02-27 13:46 Dörfler Florian
  2017-03-08  9:38 ` Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Dörfler Florian @ 2017-02-27 13:46 UTC (permalink / raw)
  To: ptxdist

Hi All

I try to compile a device tree from sources that are lying in the barebox tree. The device tree uses #includes and #defines that should be processed by the CPP. When I run the dtc.targetinstall step, I get the following error:

--------------------
target: imx6-foo.dtb
--------------------

CPP ptxdist_project/platform-foo/state/imx6-foo.dts.tmp
/bar/ptxdist_project/platform-foo/build-target/barebox/arch/arm/dts/imx6-foo.dts:14:26: fatal error: arm/imx6q.dtsi: No such file or directory
 #include <arm/imx6q.dtsi>
                          ^
compilation terminated.

The path arm/imx6q.dtsi is under a different include directory: /bar/ptxdist_project/platform-foo/build-target/barebox/dts/src

I added the include path both like so:
PTXCONF_DTC_OFTREE_DTS_PATH=${BAREBOX_DIR}/arch/arm/dts:${BAREBOX_DIR}/dts/src
And so:
DTC_EXTRA_ARGS=-i ${BAREBOX_DIR}/dts/src

But the former only seems to be used to search for the .dts file and the latter is only passed to dtc, not the preprocessor that runs before it. I looked at the cpp command invocation that causes the problem:
    cpp \
	-Wp,-MD,${tmp_deps} \
	-Wp,-MT,${tmp_dts} \
	-nostdinc \
	${no_linemarker} \
	-I$(dirname "${dts}") \
	-I${dts_kernel_dir}/arch/${dts_kernel_arch}/boot/dts \
	-I${dts_kernel_dir}/arch/${dts_kernel_arch}/boot/dts/include \
	-I${dts_kernel_dir}/drivers/of/testcase-data \
	-I${dts_kernel_dir}/include \
	-undef -D__DTS__ -x assembler-with-cpp \
	-o ${tmp_dts} \
	${dts} &&

Which only seems really work for device trees that are stored in the kernel source tree (or need no include directories). So is it currently not possible to use custom include directories for the device tree or do I go about it the wrong way?

I am using ptxdist-2015.02.0, but the current master looks like it works the same way.

Regards
Florian

--
Florian Dörfler, Development Engineer
Direct +41 (0)43 456 16 01  .  Phone +41 (0)43 456 16 00  .  www.scs.ch
Supercomputing Systems AG  .  Technoparkstrasse 1  .  CH-8005 Zürich


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] dts target: How do I pass a device tree include directory?
  2017-02-27 13:46 [ptxdist] dts target: How do I pass a device tree include directory? Dörfler Florian
@ 2017-03-08  9:38 ` Michael Olbrich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Olbrich @ 2017-03-08  9:38 UTC (permalink / raw)
  To: ptxdist

Hi,

On Mon, Feb 27, 2017 at 01:46:09PM +0000, Dörfler Florian wrote:
> I try to compile a device tree from sources that are lying in the barebox
> tree. The device tree uses #includes and #defines that should be processed by
> the CPP. When I run the dtc.targetinstall step, I get the following error:
> 
> --------------------
> target: imx6-foo.dtb
> --------------------
> 
> CPP ptxdist_project/platform-foo/state/imx6-foo.dts.tmp
> /bar/ptxdist_project/platform-foo/build-target/barebox/arch/arm/dts/imx6-foo.dts:14:26: fatal error: arm/imx6q.dtsi: No such file or directory
>  #include <arm/imx6q.dtsi>
>                           ^
> compilation terminated.
> 
> The path arm/imx6q.dtsi is under a different include directory: /bar/ptxdist_project/platform-foo/build-target/barebox/dts/src
> 
> I added the include path both like so:
> PTXCONF_DTC_OFTREE_DTS_PATH=${BAREBOX_DIR}/arch/arm/dts:${BAREBOX_DIR}/dts/src
> And so:
> DTC_EXTRA_ARGS=-i ${BAREBOX_DIR}/dts/src
> 
> But the former only seems to be used to search for the .dts file and the latter is only passed to dtc, not the preprocessor that runs before it. I looked at the cpp command invocation that causes the problem:
>     cpp \
> 	-Wp,-MD,${tmp_deps} \
> 	-Wp,-MT,${tmp_dts} \
> 	-nostdinc \
> 	${no_linemarker} \
> 	-I$(dirname "${dts}") \
> 	-I${dts_kernel_dir}/arch/${dts_kernel_arch}/boot/dts \
> 	-I${dts_kernel_dir}/arch/${dts_kernel_arch}/boot/dts/include \
> 	-I${dts_kernel_dir}/drivers/of/testcase-data \
> 	-I${dts_kernel_dir}/include \
> 	-undef -D__DTS__ -x assembler-with-cpp \
> 	-o ${tmp_dts} \
> 	${dts} &&
> 
> Which only seems really work for device trees that are stored in the kernel
> source tree (or need no include directories). So is it currently not possible
> to use custom include directories for the device tree or do I go about it the
> wrong way?

This is not supported. You could change the commandline with a custom
version of scripts/lib/ptxd_make_dts_dtc.sh in your BSP but then you may
run into dependency problems. This is only intended to work with the
kernel.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2017-03-08  9:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-27 13:46 [ptxdist] dts target: How do I pass a device tree include directory? Dörfler Florian
2017-03-08  9:38 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox