Schemas for device trees
jonsmirl at gmail.com
jonsmirl at gmail.com
Thu Mar 29 01:55:15 EST 2012
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.
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?
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?
--
Jon Smirl
jonsmirl at gmail.com
More information about the devicetree-discuss
mailing list