Linux Device Tree Compiler (DTC)

It has been a common practice to keep a device tree of a platform scattered across multiple DTS files. Seeing all of these DTS files as a single device tree is a nightmare.

Currently everyone is using DTC compiler to convert DTS file(s) into DTB file and then use it again to convert DTB into DTS file. The problem with this approach is that DTC compiler will convert alias/device name (string) into integer (phandle). This transformation makes final DTS file less readable.

To solve this problem, I have added a new option is added in forked DTC compiler. This new option (-m or –merge) allows to generate DTS very similar to DTB but keeps device
names/aliases in their original format.

There is an another option (-g or –ignore-dead) which will be useful alongwith –merge option. This option allows DTC compiler to ignore dead aliases otherwise it will generate an error on finding dead alias.

Here is the comparison of the DTB converted into DTS using mainline and forked DTC.

dtc1

dtc2

 

 

Handy commands to convert DTB into DTS using mainline and forked DTC.

Advertisements