From: Matt Porter <mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
To: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Devicetree List
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Devicetree Spec List
<devicetree-spec-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Grant Likely
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Frank Rowand
<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Pantelis Antoniou
<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>,
Behan Webster
<behanw-k/hB3zQhLwledRVtV/plodBPR1lH4CV8@public.gmane.org>
Subject: Re: [RFC PATCH 2/5] Documentation: dt-bindings: add example DT binding document
Date: Tue, 1 Sep 2015 13:30:20 -0400 [thread overview]
Message-ID: <20150901173020.GJ24203@beef> (raw)
In-Reply-To: <CAL_JsqJy21yBGe161MrTEC1kL4UD=h+skH=mPm-vjwZ7yEHoUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Fri, Aug 28, 2015 at 01:55:11PM -0500, Rob Herring wrote:
> On Fri, Aug 28, 2015 at 12:49 PM, Matt Porter <mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> wrote:
> > On Fri, Aug 28, 2015 at 09:53:06AM -0500, Rob Herring wrote:
> >> On Fri, Aug 28, 2015 at 12:23 AM, Matt Porter <mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> wrote:
> >> > Add a skeleton DT binding document that serves as the canonical
> >> > example for implementing YAML-based DT bindings documentation.
> >> > The skeleton binding illustrates use of all fields and variations
> >> > described in the dt-binding-format.txt documentation.
> >> >
> >> > Signed-off-by: Matt Porter <mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> >> > ---
> >> > Documentation/devicetree/bindings/skeleton.yaml | 98 +++++++++++++++++++++++++
> >> > 1 file changed, 98 insertions(+)
> >> > create mode 100644 Documentation/devicetree/bindings/skeleton.yaml
> >> >
> >> > diff --git a/Documentation/devicetree/bindings/skeleton.yaml b/Documentation/devicetree/bindings/skeleton.yaml
> >> > new file mode 100644
> >> > index 0000000..175965f
> >> > --- /dev/null
> >> > +++ b/Documentation/devicetree/bindings/skeleton.yaml
> >> > @@ -0,0 +1,98 @@
> >> > +%YAML 1.2
> >> > +---
> >> > +id: skel-device
> >> > +
> >> > +title: Skeleton Device
> >> > +
> >> > +maintainer:
> >> > + - name: Skeleton Person <skel-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> >>
> >> We'd want to tie this into get_maintainers.pl obviously.
> >
> > Right, I broke my rule of "no new tags for content we don't already
> > have" by adding this. It stems out of the discussion at LPC where
> > Mark suggested we could avoid the core bindings being moved by adding
> > maintainer info into the binding itself.
>
> If you stated that rule, I missed it...
Mental list of rules I made for my initial cut at this. I was trying
really hard to have this be a cut and paste reformatting to start and
then see where comments take us.
> > This is an area where more docs are needed. Ideally, on the first pass
> > conversion we would not attempt to populate these. I had considered
> > that we *could* only add maintainer: tags on core bindings to and
> > adjust get_maintainers.pl to use that info to override the standard
> > directory-based info if it exists. I don't think it's necessary to add
> > a specific maintainer for all of the peripheral bindings if the default
> > is the subsystem maintainer and the dt list. We could at least start
> > directing core binding discussion to the -spec list which is where I
> > think you'd like it.
>
> Yes, certainly this can solve my problem around handling core bindings.
>
> Some subsystem maintainers require a driver have a maintainer. We
> could certainly enforce that too. We could probably automatically
> populate this with the original author as a starting point. OTOH,
> bindings should not change frequently.
Populating with the original author seems easy enough.
> >> > +description: >
> >> > + The Skeleton Device binding represents the SK11 device produced by
> >> > + the Skeleton Corporation. The binding can also support compatible
> >> > + clones made by second source vendors.
> >> > +
> >> > +compatible:
> >> > + - name: "skel,sk11"
> >> > + - name: "faux,fx11"
> >>
> >> Is this an OR or AND? We need both.
> >
> > True, this only covers the OR case atm.
> >
> >> The complicated case is "one of {specific names} followed by {generic name}."
> >
> > I need to rethink these. I do have deprecated: tag for that case and
> > possibly "name:" gets split to "generic:" and "specific:" and we can
> > then do the right thing.
> >
> > For the above I would have:
> >
> > compatible:
> > - specific: "skel,sk11"
> > - specific: "faux,fx11"
>
> This can still be an AND or OR relationship.
Ok, so this might need to be sequences of and: and or:
key value pairs to reflect the combinations.
> > and something like the Allwinner simple framebuffer would be:
> >
> > compatible:
> > - generic: "simple-framebuffer"
> > - specific: "allwinner,simple-framebuffer"
> >
> > where our validator would insist on seeing one of the specific: tags
> > along with the generic: tag. A lot of bindings, given current doc
> > patterns would just have two tags like above.
>
> We could follow Pantelis' suggestion and do C style logic expressions:
>
> name: ("chip1-ipblock" || "chip2-ipblock") && "generic-ipblock"
That might work. More specialized parsing, but it probably is needed
to handle property values ranges anyway.
> >> > + description: A clone of the original sk11 device
> >> > +
> >> > +required:
> >> > + - name: "reg"
> >>
> >> We definitely need type info from the start.
> >
> > Are you sure? Ugh.
> >
> > My big contention here is that we don't carry that content in the
> > docs today so we shouldn't try to add it in the initial conversion.
>
> What? We have that all over the place. Boolean properties, phandles, etc.
I mean that it's not always explicitly called out in peripheral
DT bindings...it's inconsistently documented. I think that by properly
documenting this in the generic bindings as you are suggesting and
getting those properties by reference, the task of documenting these
won't be so bad.
> > I think you are right in that we should have it documented in the
> > schema but I'm concerned that we make the starting conversion
> > effort too large by adding type info to all converted docs.
>
> How we do the conversion certainly needs to be worked out. However,
> first we need some sort of agreement that yes this looks promising
> before we spend too much time on it. We need to wait for all the YAML
> haters to come out of hiding. :) Once the direction is settled, then
I was expecting the YAML haters by now, I'll give it another few days.
:)
> we can iron out the details of the structure. Finally, then we can
> determine how to do the conversion. Just because we define how type
> information looks doesn't mean it has to be there day 1.
Agreed.
> > I think we gain a lot even without at the start, but I understand
> > why we need it and how it will help reduce the review firehose
> > with the associated validation tools.
> >
> >>
> >> > + description: chip select address of skeleton device
> >> > + reference: spi-slave
> >>
> >> I would like to not have to list properties if the inherited binding
> >> lists it. The problem is we need to say how many cells and the order
> >> (not a problem here, but for mmio devices).
> >
> > Yeah, make sense.
> >
> >> Perhaps we can list the reference at the top level for the node
> >> instead of for every property.
> >
> > That's a good point. I was wondering if per prop references would
> > get unwieldy once we actually add them into all the converted docs.
> > There's a huge number of existing docs without proper references.
>
> Yes, in many cases they are implied. It should be simple enough to
> generate the list though whether they point to the doc file or just
> list the properties.
Ok.
>
> >
> > Ok, I'll take a look at collecting references per group of properties.
> >
> >>
> >> > + - name: "spi-max-frequency"
> >> > + description: >
> >> > + Maximum SPI clocking speed of skeleton device in Hz, must be
> >> > + 1000000
> >> > + reference: spi-slave
> >>
> >> Rather than listing the property and having constraint in description,
> >> perhaps we could add constraints like this:
> >>
> >> - spi-max-frequency-range: 1000000 1000000
> >>
> >> Or groups of constraints:
> >>
> >> - spi-max-frequency-constraints:
> >> range: 1000000 1000000
> >> some-other-constraint: <value>
> >
> > I was hoping to avoid this to start due to my argument for keeping it
> > simple for the first pass at conversion. However, the latter looks
> > flexible enough. We have cases with enumerated values as well to handle
> > the require some thought.
>
> We can always add constraints as a second step, but I'd like to define
> the structure at least.
Ok, this sounds reasonable, I'm goling to take a stab at reorganizing
the format based on the big areas of references, property types, and
property constraints.
-Matt
next prev parent reply other threads:[~2015-09-01 17:30 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-28 5:23 [RFC PATCH 0/5] DT binding documents using text markup Matt Porter
[not found] ` <1440739433-6799-1-git-send-email-mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-08-28 5:23 ` [RFC PATCH 1/5] Documentation: dt-bindings: add documentation on new DT binding format Matt Porter
[not found] ` <1440739433-6799-2-git-send-email-mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-08-30 22:04 ` Frank Rowand
[not found] ` <55E37DF1.3080102-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-08 17:38 ` Matt Porter
2015-09-01 16:59 ` Tim Bird
[not found] ` <CA+bK7J76Z6H4gh-UXxMWqUYrdRx1GYKFkAAtDUszpT_8k=RCQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-08 7:55 ` David Gibson
2015-09-22 4:14 ` Matt Porter
2015-09-08 7:36 ` David Gibson
2015-08-28 5:23 ` [RFC PATCH 2/5] Documentation: dt-bindings: add example DT binding document Matt Porter
[not found] ` <1440739433-6799-3-git-send-email-mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-08-28 14:53 ` Rob Herring
[not found] ` <CAL_Jsq+FE4MCCfZC5hDhQBmM1gHibY82S9a8PC1GwsnWsPNxkg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-28 14:57 ` Pantelis Antoniou
2015-08-28 17:49 ` Matt Porter
2015-08-28 18:55 ` Rob Herring
[not found] ` <CAL_JsqJy21yBGe161MrTEC1kL4UD=h+skH=mPm-vjwZ7yEHoUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-30 22:18 ` Frank Rowand
[not found] ` <55E3812B.2090105-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-08 14:56 ` Matt Porter
2015-09-01 17:30 ` Matt Porter [this message]
2015-09-01 17:35 ` Tim Bird
[not found] ` <CA+bK7J4x2vY-tzUFWjM9KFMtvE+qW6jzmz=ZxWU9L8Mpe8Lduw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-02 8:45 ` Nicolas Ferre
[not found] ` <55E6B719.6080203-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2015-09-08 15:06 ` Matt Porter
2015-09-08 15:01 ` Matt Porter
2015-09-10 7:08 ` David Gibson
2015-09-11 4:46 ` Rob Herring
[not found] ` <55F25C95.3010104-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-09-14 8:15 ` David Gibson
2015-09-22 4:06 ` Matt Porter
2015-08-28 5:23 ` [RFC PATCH 3/5] Documentation: dt-bindings: add YAML eeprom binding Matt Porter
2015-08-28 5:23 ` [RFC PATCH 4/5] Documentation: dt-bindings: phy: add YAML generic PHY binding Matt Porter
2015-08-28 5:23 ` [RFC PATCH 5/5] Documentation: dt-bindings: phy: add YAML TI " Matt Porter
[not found] ` <1440739433-6799-6-git-send-email-mporter-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-09-01 17:42 ` Tim Bird
[not found] ` <CA+bK7J5jz0wxgA-0jY4LFUWWoTk4YzGaGSQZsdF83BnomoBx6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-08 13:47 ` Matt Porter
2015-08-28 14:26 ` [RFC PATCH 0/5] DT binding documents using text markup Rob Herring
[not found] ` <CAL_Jsq+qCJfLYxVfyQ4gAxPWLZ2=WNa0H21+cRcBi7dGVG0PMA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-28 17:13 ` Matt Porter
2015-08-31 14:05 ` Rob Herring
[not found] ` <CAL_JsqJ7C4JtjGjFJjLQpLEdzbs2rw0K0TzVNB2VjOz4Sr9Nbw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-08 14:15 ` Matt Porter
2015-09-01 17:14 ` Tim Bird
[not found] ` <CA+bK7J4Ha55oFhCYDnUcBu8ZHCP3ReB6B=7Y9Fw7CknxPcaoWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-01 17:35 ` Frank Rowand
[not found] ` <55E5E1E2.6040607-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-01 18:03 ` Tim Bird
[not found] ` <CA+bK7J6kErnKPHs=r+X9T8KBn45HptPmtMe31CoapunKpuY34Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-01 18:24 ` Rob Herring
[not found] ` <CAL_Jsq+7NQdZivTpwRDwcGrCzpcQQoV5gvSkjz3NNOWNXdBhMA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-08 14:36 ` Matt Porter
2015-09-08 19:38 ` Rob Herring
2015-09-08 14:28 ` Matt Porter
2015-09-08 14:23 ` Matt Porter
2015-09-08 14:19 ` Matt Porter
2015-08-30 22:04 ` Frank Rowand
[not found] ` <55E37DE4.4090503-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-01 17:34 ` Matt Porter
2015-09-01 16:14 ` Tim Bird
[not found] ` <CA+bK7J5MriF95d2OGAZRT8PyJkK_x5r1J1yPq2Ke=SZkit6xHA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-08 13:42 ` Matt Porter
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=20150901173020.GJ24203@beef \
--to=mporter-owpks81ov/fwk0htik3j/w@public.gmane.org \
--cc=behanw-k/hB3zQhLwledRVtV/plodBPR1lH4CV8@public.gmane.org \
--cc=devicetree-spec-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).