Sorting device tree source (dts) files



Recommended Posts

A little bit OT, but what is the recommended way to sort a dts file?
I commonly see patches, where maintainers keep requesting for nodes in a dts file to be sorted alphabetically, but didn't find any way to achieve this? I tired a simple `dtc -I dts -O dts -s xxx.dts` but the output contains symbols that I don't really need.

Link to post
Share on other sites

Donate and support the project!

When you decompile a dtb file, you will normally not get the same dts that was used for compiling. It will be a dts that will work the same as the original, but it will not keep the ordering, spacing and indentation, and not even the same identical syntax as the original one.


You should instead look for your dts in the kernel source tree. Look in /arch/arm(64)/boot/dts. For example, for Tinker Board in the Mainline kernel, it's this one: . Which, in turn, includes another source file, namely this one:

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.