home | list info | list archive | date index | thread index

[OCLUG-Tech] question about how similar device tree .dts files can be

  • Subject: [OCLUG-Tech] question about how similar device tree .dts files can be
  • From: "Robert P. J. Day" <rpjday [ at ] crashcourse [ dot ] ca>
  • Date: Wed, 6 Sep 2017 08:52:27 -0400 (EDT)
  was just puttering around designing a couple .dts files for two very
slightly different variants of the same board, and wondered whether
one could (justifiably) have two .dts files that differed only in the
root "compatible" property.

  here are a couple examples *close* to what i'm asking about from the
current kernel source tree:


imx6q-nitrogen6_max.dts:
-----------------------

    #include "imx6q.dtsi"
    #include "imx6qdl-nitrogen6_max.dtsi"

    / {
        model = "Boundary Devices i.MX6 Quad Nitrogen6_MAX Board";
        compatible = "boundary,imx6q-nitrogen6_max", "fsl,imx6q";
    };


imx6q-nitrogen6_som2.dts:
------------------------

    #include "imx6q.dtsi"
    #include "imx6qdl-nitrogen6_som2.dtsi"

    / {
        model = "Boundary Devices i.MX6 Quad Nitrogen6_SOM2 Board";
        compatible = "boundary,imx6q-nitrogen6_som2", "fsl,imx6q";
    };


now i *realize* that those two .dts files don't include precisely the
same underlying .dtsi files, but what if they *did*? what effective
difference would they represent if the only actual difference was the
root-level "compatible" property:

 * compatible = "boundary,imx6q-nitrogen6_max", "fsl,imx6q";
 * compatible = "boundary,imx6q-nitrogen6_som2", "fsl,imx6q";

i realize that different drivers can specify their device tree
compatibility, but most of the time, it's not so precise as to be at
the most specific value of that property. unsurprisingly, lots of code
in the kernel specifies a compatibility with "fsl,imx6q", but i
checked and nothing registers a compatibility with specifically either
of those two closely-related boundary devices boards so, in that case,
if that was the only difference, then there really would be no
difference.

  but in weird situations, is it possible to have a situation where
that target board compatibility difference really would distinguish
between something in the kernel code? can anyone point to an example
in the kernel code that is that specific?

  in any event, i'm fairly convinced that that is a really bad idea,
but just wondering if it's possible.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================