[Letux-kernel] dt-bindings: converting .txt to .yaml

H. Nikolaus Schaller hns at goldelico.com
Tue Oct 22 21:14:11 CEST 2019


After searching a full day I think I have found it deeply buried...

https://lwn.net/Articles/771621/
says in "Current status and further plans":

	"An additional tool, doc2yaml, exists in Herring's tree, but has not been submitted;
	 the script can be used for a preliminary conversion of a device-tree binding file in the current text format to the YAML one."

That is what I have been searching for.

THE TOOL IS HERE:

	https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git/log/?h=yaml-bindings

Should be prominently documented somewhere!

Well, while I agree on all goals of the approach:
  https://elinux.org/images/6/6b/LPC2018_json-schema_for_Devicetree.pdf

	• 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

the first bullet point "Human friendly" is something to doubt.
Doubtlessly, "YAML" is well "Human readable" - but is it also "Human writable"?
And, it only needs to be machine readable...

As a kernel bindings developer I only have to care about writing the yaml schemes.

Unfortunately, the set of tools to *write* dt-bindings.yaml seems to be almost non-existant.

Ok, let's stop complaining and better give the doc2yaml tool a try to show what it does.

BR,
Nikolaus



More information about the Letux-kernel mailing list