devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: "jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: Schemas for device trees
Date: Wed, 28 Mar 2012 17:02:35 -0600	[thread overview]
Message-ID: <20120328230235.98E0D3E0FC9@localhost> (raw)
In-Reply-To: <CAKON4OyW00PUX3-50GrMSa0RhXLHZX3abjQmVHHiYPY2DCN=mw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Wed, 28 Mar 2012 10:55:15 -0400, "jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> I'm putting together a device tree for a new platform and when looking
> at the other trees everything is kind of chaotic in regards to the
> various subsystems.
> 
> Is the existing DT include mechanism powerful enough to describe
> generic fragments? And we're just missing the core fragments for
> generic SPI, MMC, audio, etc.

Yes, pretty much.  There is work going on now to define common
bus-specific bindings that can be used by all relevant drivers.

SPI is there
MMC is currently being discussed
audio is in progress

> 
> In the XML world you can make schemas that describe what is legally
> allowed in an XML document. Device trees don't seem to any any kind of
> schema mechanism describing what is and isn't legal to put in a tree.
> 
> Instead of recreating the entire world of schemas, has anyone looked
> at using XML schemas to define what is a valid device tree and then
> write a tool to validate the existing device trees?

Not that I know of.  dtc does minimal static validation of the output,
but it is not remotely enough.

> A neat feature of XML schemas is the ability to include fragment
> schemas. For example you'd have a base schema and then depending on
> the core processor bring in schema fragments for mmc, audio, spi, etc.
>  I still can't figure out the right way to put audio into a device
> tree.
> 
> Another example, the voltage-ranges attribute for a spi mmc slot.
> voltage-ranges = <3200 3400>; I had to go look at the source code for
> this attribute to determine what the legal ranges were. A validating
> schema would contain the legal ranges.
> 
> Aren't the files in Documentation/devicetree/bindings really just
> schemas written in English with no automated way of checking the DTS
> files against them?

Yes, they really are.  I've been thinking for a long time that it
would be much better to have a binding markup that can be parsed both
into human readable documentation and validation of device tree data.

Can you put together an example of what it would look like using the
xml schema?

g.

  parent reply	other threads:[~2012-03-28 23:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-28 14:55 Schemas for device trees jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found] ` <CAKON4OyW00PUX3-50GrMSa0RhXLHZX3abjQmVHHiYPY2DCN=mw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-28 23:02   ` Grant Likely [this message]
2012-03-29  2:17     ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]       ` <CAKON4OyuU_M_DEAoqs9tRrHZEDu6GfSt+Sm7-qY8na_VSB4iUw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-30  1:59         ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w
     [not found]           ` <CAKON4OwTiH9gKY-_m8mz3M0Fn31LLOvG4Y7UNWO0HgJhRk5xrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-02 13:38             ` jonsmirl-Re5JQEeQqe8AvxtiuMwx3w

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=20120328230235.98E0D3E0FC9@localhost \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=jonsmirl-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).