ashthespy Posted February 3, 2020 Posted February 3, 2020 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.
JMCC Posted February 3, 2020 Posted February 3, 2020 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: https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/rk3288-tinker.dts . Which, in turn, includes another source file, namely this one: https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/rk3288-tinker.dtsi
ashthespy Posted February 4, 2020 Author Posted February 4, 2020 Hmm, so while reading through a few kernel mailing lists, maintainers seem to stress that patches for device tree sources (say my_new_board.dts) should have its nodes sorted alphabetically. I was just wondering if there was a tool that does this, or is it normally done manually?
martinayotte Posted February 4, 2020 Posted February 4, 2020 10 hours ago, spy king said: or is it normally done manually? Since patches submitters are only sending patches and not the whole DTS, it is up to them to manually locate the changes correctly in the proper location to have those changes sorted in alphabetic order.
Recommended Posts