Lines Matching +full:dt +full:- +full:binding
1 .. SPDX-License-Identifier: GPL-2.0
3 Writing Devicetree Bindings in json-schema
6 Devicetree bindings are written using json-schema vocabulary. Schema files are
11 Also see :ref:`example-schema`.
14 ---------------
16 Each schema doc is a structured json-schema which is defined by a set of
17 top-level properties. Generally, there is one binding defined per file. The
18 top-level json-schema properties used are:
21 A json-schema unique identifier string. The string must be a valid
22 URI typically containing the binding's filename and path. For DT schema, it must
31 Indicates the meta-schema the schema file adheres to.
34 A one line description on the contents of the binding schema.
37 A DT specific property. Contains a list of email address(es)
38 for maintainers of this binding.
41 Optional. A multi-line text block containing any detailed
42 information about this binding. It should contain things such as what the block
47 Optional. A json-schema used to match nodes for applying the
53 include other schemas the binding conforms to. This may be schemas for a
57 A set of sub-schema defining all the DT properties for the
58 binding. The exact schema syntax depends on whether properties are known,
59 common properties (e.g. 'interrupts') or are binding/vendor specific properties.
61 A property can also define a child DT node with child properties defined
70 A list of DT properties from the 'properties' section that
75 binding. Note: YAML doesn't allow leading tabs, so spaces must be used instead.
80 ---------------
82 The 'properties' section of the schema contains all the DT properties for a
83 binding. Each property contains a set of constraints using json-schema
85 validation of DT files.
88 binding schema need to be defined such as how many values are valid or what
95 The Devicetree schemas don't exactly match the YAML encoded DT data produced by
100 The default for arrays in json-schema is they are variable sized and allow more
111 -------
116 The DT schema project must be installed in order to validate the DT schema
117 binding documents and validate DTS files using the DT schema. The DT schema
120 pip3 install git+https://github.com/devicetree-org/dt-schema.git@master
122 Several executables (dt-doc-validate, dt-mk-schema, dt-validate) will be
131 apt-get install libyaml-dev
135 dnf -y install libyaml-devel
140 The DT schema binding documents must be validated using the meta-schema (the
141 schema for the schema) to ensure they are both valid json-schema and valid
142 binding schema. All of the DT binding documents can be validated using the
147 In order to perform validation of DT source files, use the ``dtbs_check`` target::
151 Note that ``dtbs_check`` will skip any binding schema files with errors. It is
153 binding schema files.
164 make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml
165 make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml
168 json-schema Resources
169 ---------------------
172 `JSON-Schema Specifications <http://json-schema.org/>`_
176 .. _example-schema:
179 ------------------------
181 Also available as a separate file: :download:`example-schema.yaml`
183 .. literalinclude:: example-schema.yaml