Re: [RFC] Introducing yamldt, a yaml to dtb compiler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I'll randomly choose this point in the thread to jump in...

On Wed, Aug 2, 2017 at 4:09 PM, David Gibson
<david@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, Jul 27, 2017 at 08:51:40PM -0400, Tom Rini wrote:
>> If the common dts source file was in yaml, binding docs would be written
>> so that we could use them as validation and hey, the above wouldn't ever
>> have happened.  And I'm sure this is not the only example that's in-tree
>> right now.  These kind of problems create an artificially high barrier
>> to entry in a rather important area of the kernel (you can't trust the
>> docs, you have to check around the code too, and of course the code
>> might have moved since the docs were written).
>
> Yeah, problems like that suck.  But I don't see that going to YAML
> helps avoid them.  It may have a number of neat things it can do, but
> yaml won't magically give you a way to match against bindings.  You'd
> still need to define a way of describing bindings (on top of yaml or
> otherwise) and implement the matching of DTs against bindings.

I'm going to try and apply a few constraints. I'm using the following
assumptions for my reply.
1) DTS files exist, will continue to exist, and new ones will be
created for the foreseeable future.
2) DTB is the format that the kernel and U-Boot consume
3) Therefore the DTS->DTB workflow is the important one. Anything that
falls outside of that may be interesting, but it distracts from the
immediate problem and I don't want to talk about it here.

For schema documentation and checking, I've been investigating how to
use JSON Schema to enforce DT bindings. Specifically, I've been using
the JSONSchema Python library which strictly speaking doesn't operate
on JSON or YAML, but instead operates directly on Python data
structures. If that data happens to be imported from a DTS or DTB, the
JSON Schema engine doesn't care.

The work Pantelis has done here is important because it defines a
specific data model for DT data. That data model must be defined
before schema files can be written, otherwise they'll be testing for
the wrong things. However, rather than defining a language specific
data model (ie. Python), specifying it in YAML means it doesn't depend
on any particular language.

g.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux