Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
comparing_device_trees_with_dtx_diff [2018/11/17 16:09] – [Preparing for comparison] rpjdaycomparing_device_trees_with_dtx_diff [2018/11/17 18:33] (current) – [Comparing two .dts files already in the kernel source tree (Part deux)] rpjday
Line 50: Line 50:
         .. etc etc ...         .. etc etc ...
 </code> </code>
 +
 +===== Comparing two .dts files already in the kernel source tree (Part deux) =====
 +
 +In the above example, you were located in the root directory of the relevant kernel source tree, which is the default for the ''dtx_diff'' script, where it knows how to process device tree source file includes. If, however, you're in the actual underlying ''dts'' directory (or somewhere else in the kernel source tree), you can't just run the script as is since it won't know the kernel source tree to use to process ''include'' directives:
 +
 +<code>
 +$ cd arch/arm/boot/dts
 +$ dtx_diff imx6q{,p}-sabresd.dts
 +
 +... snip ...
 +
 +In file included from imx6qp.dtsi:43:0,
 +                 from imx6qp-sabresd.dts:45:
 +imx6q.dtsi:11:50: error: no include path in which to search for dt-bindings/interrupt-controller/irq.h
 + #include <dt-bindings/interrupt-controller/irq.h>
 +
 +... snip ...
 +
 +  ./arch/arm/ does not exist
 +  Is $ARCH='arm' correct?
 +  Possible fix: use '-s' option
 +
 +  ./arch/arm/ does not exist
 +  Is $ARCH='arm' correct?
 +  Possible fix: use '-s' option
 +  Possible fix: use '-S' option
 +
 +  Possible fix: use '-S' option
 +$
 +</code>
 +
 +Instead, you need to use one of these two variations, depending on whether you're in a Git repository, or just a regular source tree:
 +
 +<code>
 +$ dtx_diff -s ~/k/git imx6q{,p}-sabresd.dts    (specify source tree with ''-s'')
 +$ dtx_diff -S imx6q{,p}-sabresd.dts            (''-S'' means this is a Git repo)
 +</code>
 +
 +In short, as long as you're still inside the relevant kernel source tree, comparisons will work -- you just need to make sure the ''dtx_diff'' script is told where the top of the kernel source tree is.
 +
 +===== Comparing two device tree files out of tree -- apparent bug =====
 +
 +What doesn't seem to work is comparing two device tree files that are outside the confines of a kernel source tree, even if you identify the kernel source tree. Below, I copy the same two files to ''/tmp'' and try to do the comparison there, referring back to the same kernel source tree:
 +
 +<code>
 +$ cp imx6q{,p}-sabresd.dts /tmp
 +$ cd /tmp
 +$ dtx_diff -s ~/k/git imx6q{,p}-sabresd.dts
 +imx6qp-sabresd.dts:45:10: fatal error: imx6qp.dtsi: No such file or directory
 + #include "imx6qp.dtsi"
 +          ^~~~~~~~~~~~~
 +imx6q-sabresd.dts:15:10: fatal error: imx6q.dtsi: No such file or directory
 + #include "imx6q.dtsi"
 +          ^~~~~~~~~~~~
 +compilation terminated.
 +compilation terminated.
 +Error: imx6qp-sabresd.dts:43.9-10 Error: imx6q-sabresd.dts:13.9-10 syntax errorsyntax error
 +
 +FATAL ERROR: FATAL ERROR: Unable to parse input tree
 +Unable to parse input tree
 +
 +Possible hints to resolve the above error:
 +
 +  (hints might not fix the problem)
 +Possible hints to resolve the above error:
 +  (hints might not fix the problem)
 +
 +
 +  No hints available.
 +  No hints available.
 +$
 +</code>
 +
 +I have no idea why this fails -- obviously, even when telling ''dtx_diff'' where the kernel source tree is, the include search path is not being set correctly. I've already reported this as an apparent bug to the device tree mailing list.
  • comparing_device_trees_with_dtx_diff.1542470970.txt.gz
  • Last modified: 2018/11/17 16:09
  • by rpjday