dtc(the device tree compiler)
dtc basically takes a device-tree in a given format and outputs a device-tree in another format. The currently supported formats are:
Input formats:
- "dtb": "blob" format, that is a flattened device-tree block
with header all in a binary blob.
- "dts": "source" format. This is a text file containing a
"source" for a device-tree. The format is defined later
in this chapter.
- "fs" format. This is a representation equivalent to the
output of /proc/device-tree, that is nodes are directories
and properties are files
Output formats:
- "dtb": "blob" format
- "dts": "source" format
- "asm": assembly language file. This is a file that can be
sourced by gas to generate a device-tree "blob". That file
can then simply be added to your Makefile. Additionally,
the assembly file exports some symbols that can be used.
The syntax of the dtc tool is
dtc [-I <input-format>] [-O <output-format>]
[-o output-filename] [-V output_version] input_filename
The “output_version” defines what version of the “blob” format will be generated. Supported versions are 1,2,3 and 16. The default is currently version 3 but that may change in the future to version 16.
Additionally, dtc performs various sanity checks on the tree, like the uniqueness of linux, phandle properties, validity of strings, etc…
The format of the .dts “source” file is “C” like, supports C and C++ style comments.