How it works...

The DTS file for the Wandboard variant is under arch/arm/boot/dts/imx6qp-wandboard-revd1.dts and looks as follows:

#include "imx6q-wandboard-revd1.dts"                                             
#include "imx6qp.dtsi"                                                           
                                                                                 
/ {                                                                              
        model = "Wandboard i.MX6QuadPlus rev.D1";                                
}; 

With imx6q-wandboard-revd1.dts being:

#include <dt-bindings/interrupt-controller/irq.h>                                
#include "imx6q.dtsi"                                                            
#include "imx6qdl-wandboard-revd1.dtsi"                                          
                                                                                 
/ {                                                                              
        model = "Wandboard i.MX6Quad rev.D1";                                    
        compatible = "fsl,imx6q-wandboard", "fsl,imx6q";                         
};    

What we see here is a device tree root node that has no parents. The rest of the nodes will have a parent. The structure of a node can be represented as follows:

node@0{ 
  an-empty-property; 
  a-string-property = "a string"; 
  a-string-list-property = "first string", "second string"; 
  a-cell-property = <1>; 
  a-cell-property = <0x1 0x2>; 
  a-byte-data-property = [0x1 0x2 0x3 0x4]; 
  a-phandle-property = <&node1>; 
} 

The node properties can have the following characteristics:

  • Be empty
  • Contain one or more strings
  • Contain one or more unsigned 32-bit numbers, called cells
  • Contain a binary byte stream
  • Be a reference to another node, called a phandle

The device tree is initially parsed by the C preprocessor and it can include other DTS files. These include files have the same syntax and are usually appended with the dtsi suffix. File inclusion can also be performed with the device tree /include/ operator, although #include is recommended, and they should not be mixed. In this case, both imx6q.dtsi and imx6qdl-wandboard-revd1.dtsi are overlaid with the contents of imx6qp-wandboard-revd1.dts.

Device tree nodes are documented in bindings contained in the Documentation/devicetree/bindings/ directory of the kernel source. New nodes must include the corresponding bindings, and these must be reviewed and accepted by the device tree maintainers. Theoretically, all bindings need to be maintained, although it is likely this will be relaxed in the future.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset