Discussion:
[beagleboard] dts with #include ".dtsi" will not compile
Nic Cyn
2014-10-10 16:41:48 UTC
Permalink
Hi All

I have a flat dts file taken from the dtb file and it will re-compile just
fine with a command like

dtc -I dts -O dtb bb.dts > test.dtb

however if I edit the bb.dts file to use an include line like

#include "foo.dtsi"

I get an error "FATAL ERROR: Unable to parse input tree". This happens no
matter where I put the include line or whatever is in the .dtsi file
(including only comments). The dtc version is Version: DTC 1.4.0-gf345d9e4

My understanding is that this include should work. Is there a special
version of dtc for this or something else I am missing?
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
d***@gmail.com
2014-10-14 15:18:00 UTC
Permalink
Bump

Got no responses to this. Is there nobody who can compile the 3.14 kernel
dts files (which contain the #include tag)?

If you can compile the dts files please tell me what version of the dtc
compiler you are using ( dtc -version) and what command line you use.

I am really struggling with this. All I ever get is a "FATAL ERROR: Unable
to parse input tree"

Your assistance is much appreciated
Post by Nic Cyn
Hi All
I have a flat dts file taken from the dtb file and it will re-compile just
fine with a command like
dtc -I dts -O dtb bb.dts > test.dtb
however if I edit the bb.dts file to use an include line like
#include "foo.dtsi"
I get an error "FATAL ERROR: Unable to parse input tree". This happens no
matter where I put the include line or whatever is in the .dtsi file
(including only comments). The dtc version is Version: DTC 1.4.0-gf345d9e4
My understanding is that this include should work. Is there a special
version of dtc for this or something else I am missing?
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nic Cyn
2014-10-14 15:40:33 UTC
Permalink
Bump

I am still struggling with this. If you can compile a dts file with a
#include tag (for example the 3.14 kernel dts files) can you please tell me
the dtc compiler version you are using (dtc -version) and the command line
that works.

All I ever get is a "FATAL ERROR: Unable to parse input tree" error and I
am really struggling with this.

Your assistance is much appreciated.
Post by Nic Cyn
Hi All
I have a flat dts file taken from the dtb file and it will re-compile just
fine with a command like
dtc -I dts -O dtb bb.dts > test.dtb
however if I edit the bb.dts file to use an include line like
#include "foo.dtsi"
I get an error "FATAL ERROR: Unable to parse input tree". This happens no
matter where I put the include line or whatever is in the .dtsi file
(including only comments). The dtc version is Version: DTC 1.4.0-gf345d9e4
My understanding is that this include should work. Is there a special
version of dtc for this or something else I am missing?
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robert Nelson
2014-10-14 15:46:19 UTC
Permalink
Post by Nic Cyn
Bump
I am still struggling with this. If you can compile a dts file with a
#include tag (for example the 3.14 kernel dts files) can you please tell me
the dtc compiler version you are using (dtc -version) and the command line
that works.
All I ever get is a "FATAL ERROR: Unable to parse input tree" error and I am
really struggling with this.
Your assistance is much appreciated.
DTC src/arm/am335x-boneblack-base.dtb
DTC src/arm/am335x-bone-4dcape-70t.dtb
DTC src/arm/am437x-gp-evm.dtb
DTC src/arm/am335x-bone-lcd7-01-00a3.dtb
DTC src/arm/am335x-bone-can1.dtb
DTC src/arm/am335x-bone-lcd4-01-00a1.dtb
DTC src/arm/omap3-overo-storm-tobi.dtb
DTC src/arm/am437x-sk-evm.dtb
DTC src/arm/am335x-boneblack-audio-reva.dtb
DTC src/arm/am335x-boneblack-ttyO2.dtb
DTC src/arm/am335x-bone-audio-revb.dtb
DTC src/arm/dra72-evm.dtb
DTC src/arm/omap3-evm.dtb
DTC src/arm/am335x-boneblack-rtc-01-00a1.dtb
DTC src/arm/am3517-evm.dtb
DTC src/arm/omap4-panda-es.dtb
DTC src/arm/am335x-boneblack-bbb-exp-c.dtb
DTC src/arm/dra7-evm.dtb
***@hades:/opt/github/dtb-rebuilder$ cat
src/arm/am335x-boneblack-base.dts | grep include
#include "am33xx.dtsi"
#include "am335x-bone-common.dtsi"
#include "am335x-bone-common-pinmux.dtsi"
#include "am335x-boneblack-emmc.dtsi"
#include "am335x-boneblack-nxp-hdmi-audio.dtsi"
***@hades:/opt/github/dtb-rebuilder$ dtc --version
Version: DTC 1.4.0-gf345d9e4

Regards,
--
Robert Nelson
http://www.rcn-ee.com/
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nic Cyn
2014-10-14 16:10:21 UTC
Permalink
Thank you.

My dtc compiler version is exactly the same - not surprising since I am
using your version installed as described on
https://eewiki.net/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-Upgradedistro%22device-tree-compiler%22package

So it must be the command line. What is in the DTC script. Can you please
"cat DTC" for me.

No doubt I am missing something simple.

Much appreciated.
Post by Robert Nelson
Post by Nic Cyn
Bump
I am still struggling with this. If you can compile a dts file with a
#include tag (for example the 3.14 kernel dts files) can you please tell
me
Post by Nic Cyn
the dtc compiler version you are using (dtc -version) and the command
line
Post by Nic Cyn
that works.
All I ever get is a "FATAL ERROR: Unable to parse input tree" error and
I am
Post by Nic Cyn
really struggling with this.
Your assistance is much appreciated.
DTC src/arm/am335x-boneblack-base.dtb
DTC src/arm/am335x-bone-4dcape-70t.dtb
DTC src/arm/am437x-gp-evm.dtb
DTC src/arm/am335x-bone-lcd7-01-00a3.dtb
DTC src/arm/am335x-bone-can1.dtb
DTC src/arm/am335x-bone-lcd4-01-00a1.dtb
DTC src/arm/omap3-overo-storm-tobi.dtb
DTC src/arm/am437x-sk-evm.dtb
DTC src/arm/am335x-boneblack-audio-reva.dtb
DTC src/arm/am335x-boneblack-ttyO2.dtb
DTC src/arm/am335x-bone-audio-revb.dtb
DTC src/arm/dra72-evm.dtb
DTC src/arm/omap3-evm.dtb
DTC src/arm/am335x-boneblack-rtc-01-00a1.dtb
DTC src/arm/am3517-evm.dtb
DTC src/arm/omap4-panda-es.dtb
DTC src/arm/am335x-boneblack-bbb-exp-c.dtb
DTC src/arm/dra7-evm.dtb
src/arm/am335x-boneblack-base.dts | grep include
#include "am33xx.dtsi"
#include "am335x-bone-common.dtsi"
#include "am335x-bone-common-pinmux.dtsi"
#include "am335x-boneblack-emmc.dtsi"
#include "am335x-boneblack-nxp-hdmi-audio.dtsi"
Version: DTC 1.4.0-gf345d9e4
Regards,
--
Robert Nelson
http://www.rcn-ee.com/
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robert Nelson
2014-10-14 16:22:54 UTC
Permalink
Post by Nic Cyn
Thank you.
My dtc compiler version is exactly the same - not surprising since I am
using your version installed as described on
https://eewiki.net/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-Upgradedistro%22device-tree-compiler%22package
So it must be the command line. What is in the DTC script. Can you please
"cat DTC" for me.
No doubt I am missing something simple.
https://github.com/RobertCNelson/dtb-rebuilder/tree/3.14-ti

https://github.com/RobertCNelson/dtb-rebuilder/blob/3.14-ti/Makefile#L120

Regards,
--
Robert Nelson
http://www.rcn-ee.com/
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nic Cyn
2014-10-15 11:35:54 UTC
Permalink
Thanks. I think I now have a pretty good idea on what happens when a device
tree .dts file with .dtsi includes is compiled. I am posting a summary here
so others (if any) searching on this error message may find it.

The Makefile is basically running three commands - not one. To compile the
dts file src/arm/am335x-boneblack.dts the following commands are generated:

cpp -Wp,-MD,src/arm/.am335x-boneblack.dtb.d.pre.tmp -nostdinc -Iinclude -
Isrc/arm -Itestcase-data -undef -D__DTS__ -x assembler-with-cpp -o src/arm/.
am335x-boneblack.dtb.dts.tmp src/arm/am335x-boneblack.dts ;

dtc -O dtb -o src/arm/am335x-boneblack.dtb -b 0 -i src/arm -d src/arm/.
am335x-boneblack.dtb.d.dtc.tmp src/arm/.am335x-boneblack.dtb.dts.tmp ;

cat src/arm/.am335x-boneblack.dtb.d.pre.tmp src/arm/.am335x-boneblack.dtb.d.
dtc.tmp > src/arm/.am335x-boneblack.dtb.d


It seems the device tree compiler has no native ability to cope with
includes and so cpp is pressed into service to resolve the chains of
included .dtsi files. The upshot is that the first command (cpp...)
ultimately outputs a file named src/arm/.am335x-boneblack.dtb.dts.tmp which
is essentially the original src/arm/am335x-boneblack.dts with all the
includes recursively resolved. It also outputs a dependency file.

The second line calls dtc on the now flattened .dts source in src/arm/.
am335x-boneblack.dtb.dts.tmp file and creates the src/arm/am335x-boneblack.
dtb device tree binary and another dependency file. The third line
concatenates the dependency files from the first two steps - why it does
this I do not know. Maybe just documentation. There is also a
.am335x-bone-base.dtb.cmd file output by the makefile which contains the
above commands and some of the dependencies.
Post by Nic Cyn
Post by Nic Cyn
Thank you.
My dtc compiler version is exactly the same - not surprising since I am
using your version installed as described on
https://eewiki.net/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-Upgradedistro%22device-tree-compiler%22package
Post by Nic Cyn
So it must be the command line. What is in the DTC script. Can you
please
Post by Nic Cyn
"cat DTC" for me.
No doubt I am missing something simple.
https://github.com/RobertCNelson/dtb-rebuilder/tree/3.14-ti
https://github.com/RobertCNelson/dtb-rebuilder/blob/3.14-ti/Makefile#L120
Regards,
--
Robert Nelson
http://www.rcn-ee.com/
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...