Lines Matching +full:dts +full:- +full:bindings
1 .. _dt-binding-compat:
3 Introduction to Devicetree Bindings
8 For a detailed syntax reference, see :ref:`dt-bindings-file-syntax`.
10 Devicetree nodes are matched to bindings using their :ref:`compatible
11 properties <dt-important-props>`.
18 .. _dt-bindings-simple-example:
25 .. code-block:: devicetree
27 /* Node in a DTS file */
28 bar-device {
29 compatible = "foo-company,bar-device";
30 num-foos = <3>;
35 .. code-block:: yaml
39 compatible: "foo-company,bar-device"
42 num-foos:
46 The build system matches the ``bar-device`` node to its YAML binding because
49 What the build system does with bindings
52 The build system uses bindings both to validate devicetree nodes and to convert
54 <dt-outputs>` header file.
57 required ``num-foos`` property is present in the ``bar-device`` node, and that
60 The build system will then generate a macro for the ``bar-device`` node's
61 ``num-foos`` property, which will expand to the integer literal ``3``. This
63 discussed later in this guide in :ref:`dt-from-c`.
66 has no ``num-foos`` property, and this property is marked required in the
69 .. code-block:: devicetree
71 bad-node {
72 compatible = "foo-company,bar-device";
75 Other ways nodes are matched to bindings
79 system looks for compatible bindings in the listed order and uses the first
84 .. code-block:: devicetree
86 baz-device {
87 compatible = "foo-company,baz-device", "generic-baz-device";
90 The ``baz-device`` node would get matched to a binding with a ``compatible:
91 "generic-baz-device"`` line if the build system can't find a binding with a
92 ``compatible: "foo-company,baz-device"`` line.
94 Nodes without compatible properties can be matched to bindings associated with
95 their parent nodes. These are called "child bindings". If a node describes
97 account when matching nodes to bindings. (See :ref:`dt-bindings-on-bus` for
100 See :ref:`dt-zephyr-user` for information about a special node that doesn't
103 .. _dt-where-bindings-are-located:
105 Where bindings are located
109 above example binding would be named :file:`foo-company,bar-device.yaml` by
112 The build system looks for bindings in :file:`dts/bindings`
115 - the zephyr repository
116 - your :ref:`application source directory <application>`
117 - your :ref:`board directory <board_porting_guide>`
118 - any :ref:`shield directories <shields>`
119 - any directories manually included in the :ref:`DTS_ROOT <dts_root>`
121 - any :ref:`module <modules>` that defines a ``dts_root`` in its
125 subdirectories, when matching nodes to bindings. A file is considered YAML if
130 The binding files must be located somewhere inside the :file:`dts/bindings`
133 For example, if :file:`my-app` is your application directory, then you must
134 place application-specific bindings inside :file:`my-app/dts/bindings`. So
135 :file:`my-app/dts/bindings/serial/my-company,my-serial-port.yaml` would be
136 found, but :file:`my-app/my-company,my-serial-port.yaml` would be ignored.