Devicetree Schema Documentation and Validation

Devicetree Schema Documentation

and Validation

Grant Likely - Arm

Devicetree Schema Documentation and

Validation

The problem: too easy to get devicetree wrong

¡ñ Data must be encoded in very specific ways

¡ñ Toolchain provides little validation

¡ñ No checks against documented schema (aka. bindings)

¡ð

¡ð

Schemas are loosely structure prose

Not machine readable

¡ñ Steep learning curve

Project Goals

¡ñ Define a DT schema language

¡ð

¡ð

¡ð

Human friendly

Machine readable

Include binding documentation

¡ñ Better tooling

¡ð

¡ð

¡ð

Validate DTS files at build time

Validate DT Schema files are in the correct format

Useful error and warning messages

¡ñ Leverage existing technology

¡ð

Use existing schema validation framework

¡ö

¡ð

¡ð

Extended to handle quirks of DT

Don¡¯t write a lot of code!

Don¡¯t define an entirely new language!

¡ñ Generate Specification Documentation from Schema files

Prototype Implementation



Based on:

¡ñ Python3

¡ñ YAML 1.2 file format

¡ñ JSON Schema vocabulary

¡ð

As implemented in Python jsonschema library

¡ñ Sphinx-Doc extension

~250 lines of python code

~250 lines of metaschema files

~250 lines of schema files

YAML File Format



¡ñ Human friendly

¡ñ Portable

¡ñ Structured

¡ñ Simple transcode DTS to YAML

¡ñ Extensible with custom datatypes

¡ñ Superset of JSON

%YAML 1.2

--YAML: YAML Ain't Markup Language

What It Is: YAML is a human friendly data serialization

standard for all programming languages.

YAML Resources:

YAML 1.2 (3rd Edition):

YAML 1.1 (2nd Edition):

YAML 1.0 (1st Edition):

YAML Issues Page:

YAML Mailing List: yaml-core@lists.

YAML IRC Channel: "#yaml on irc."

YAML Cookbook (Ruby):

(local)

YAML Reference Parser:

Projects:

C/C++ Libraries:

- libyaml

#

- Syck

#

- yaml-cpp

#

Python:

- PyYAML

#

- ruamel.yaml

#

"C" Fast YAML 1.1

(dated) "C" YAML 1.0

C++ YAML 1.2 implementation

YAML 1.1, pure python and libyaml binding

YAML 1.2, update of PyYAML with round-tripping

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download