From: Frank Li <Frank.li@nxp.com>
To: Conor Dooley <conor@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
conor+dt@kernel.org, devicetree@vger.kernel.org,
imx@lists.linux.dev, krzk+dt@kernel.org, robh@kernel.org,
shawnguo@kernel.org, festevam@gmail.com
Subject: Re: Device tree node order sort tool
Date: Wed, 18 Sep 2024 11:07:32 -0400 [thread overview]
Message-ID: <ZurstMFJ4ZCFhZT6@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20240918-igloo-unspoken-45443a52e338@squawk>
On Wed, Sep 18, 2024 at 09:17:37AM +0100, Conor Dooley wrote:
> On Wed, Sep 18, 2024 at 10:03:32AM +0200, Krzysztof Kozlowski wrote:
> > 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 concur, it is a useful 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).
>
> I think it's fine to pick whatever is used by іmx/nxp and start with
> that style, get something working and then decide based on whether or
> not there are many users (or interest) if it is worth allowing the
> "style" to be configured.
>
> >
> > > 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.
It should be good for less special case. I got some comments during dts
review such as
#gpio-cells just before gpio-controller, the same as
#interrupt-cells before interrupt-controller.
*-names after *.
Does above rule is widely adaptive?
Frank
>
> We may not, but I don't think there's anything wrong with the order that
> Frank has chosen here being a ‶default".
> That said, I'd not enjoy getting a bunch of patches for the platforms
> that I maintain redoing things in this order, so it is worth asking the
> platform maintainer for their take on whether it should be used for
> anything other than new code, before sending a rake of patches.
At beginning, I just want to compare upstream dts and downstream dts
easily. I supposed just help new code.
>
> Cheers,
> Conor.
next prev parent reply other threads:[~2024-09-18 15:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-17 15:43 Device tree node order sort tool Frank Li
2024-09-18 8:03 ` Krzysztof Kozlowski
2024-09-18 8:17 ` Conor Dooley
2024-09-18 15:07 ` Frank Li [this message]
2024-09-26 9:04 ` Shawn Guo
2024-09-26 15:09 ` Frank Li
2024-09-27 7:32 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZurstMFJ4ZCFhZT6@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=robh@kernel.org \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox