This is an old revision of the document!


Proper .dts file design.

Every distinct board merits its own .dts file, as in:

  • am335x-boneblack.dts
  • am335x-boneblack-wireless.dts
  • am335x-boneblue.dts
  • am335x-bone.dts
  • am335x-bonegreen.dts
  • am335x-bonegreen-wireless.dts

There is no reason to make local copies of kernel-supplied .dtsi files and alter them; such files should be included as is, and all alterations should be made in the .dts file or a more general board-related .dtsi file supplied by that developer. Any alterations that involve actual removal of included content should be done via one of the two directives:

  • /delete-property/
  • /delete-node/

This functionality was introduced into the Linux kernel file scripts/dtc/dtc-lexer.l file in Sept of 2012:

commit cd296721a9645f9f28800a072490fa15458d1fb7
Author: Stephen Warren <swarren@nvidia.com>
Date:   Fri Sep 28 21:25:59 2012 +0000

    dtc: import latest upstream dtc
    
    This updates scripts/dtc to commit 317a5d9 "dtc: zero out new label
    objects" from git://git.jdl.com/software/dtc.git.
    
    This adds features such as:
    * /bits/ syntax for cell data.
    * Math expressions within cell data.
    * The ability to delete properties or nodes.
    * Support for #line directives in the input file, which allows the use of
      cpp on *.dts.
    * -i command-line option (/include/ path)
    * -W/-E command-line options for error/warning control.
    * Removal of spew to STDOUT containing the filename being compiled.
    * Many additions to the libfdt API.
    
    Signed-off-by: Stephen Warren <swarren@nvidia.com>
    Acked-by: Jon Loeliger <jdl@jdl.com>
    Signed-off-by: Rob Herring <rob.herring@calxeda.com>

Examples can be seen here.

  • proper_device_tree_design.1542536944.txt.gz
  • Last modified: 2018/11/18 10:29
  • by rpjday