On Tue, Sep 17, 2024 at 11:43:53AM -0400, Frank Li wrote: > All: > I write a simple tools to sort device tree to make sure nodes and > properties sort as correct order. > https://github.com/lznuaa/dt-format > > There are many dt files, which have node order trivial issue, when > try to upstream. To reduce reviewer's time, dt-format can help correct the > order. > Hey Frank, Cool idea! > I just want to make sure my understand about node order is correct. > > Rule 1: node@hexvalue, order by hexvalue > Rule 2: label: node, order by node name > Rule 3: node, order by node name > Rule 3: &label order by label Some subsystems have different ordering, like expressed in DTS coding style: 1. DTS: keep order of DTSI file 2. DTSI: group similar nodes together (e.g. serial engines). > Rule 4: children node already after property > Rule 5: "status" always is last one. > Rule 6: property order as below list[unfinished], otherwise, order > by name. > > compatible > reg > reg-names > ranges Up to here everything above seems about right, except above caveats. > #interrupt-cells > interrupt-controller > interrupts > interrupt-names > #gpio-cells > gpio-controller > gpio-ranges > #address-cells > #size-cells > clocks > clock-names > assigned-clocks > assigned-clock-parents > assigned-clock-rates > dmas > dma-names I don't think we have defined order for these. Best regards, Krzysztof