Lines Matching +full:dts +full:- +full:node

1 .. SPDX-License-Identifier: GPL-2.0
4 Devicetree Sources (DTS) Coding Style
7 When writing Devicetree Sources (DTS) please observe below guidelines. They
16 ---------------------------
18 The Devicetree Specification allows a broad range of characters in node
22 1. Node and property names can use only the following characters:
24 * Lowercase characters: [a-z]
25 * Digits: [0-9]
26 * Dash: -
30 * Lowercase characters: [a-z]
31 * Digits: [0-9]
42 gpi_dma2: dma-controller@a00000 {
43 compatible = "qcom,sm8550-gpi-dma", "qcom,sm6350-gpi-dma";
48 --------------
56 2. Nodes without unit addresses shall be ordered alpha-numerically by the node
57 name. For a few node types, they can be ordered by the main property, e.g.
60 3. When extending nodes in the board DTS via &label, the entries shall be
61 ordered either alpha-numerically or by keeping the order from DTSI, where
64 The above-described ordering rules are easy to enforce during review, reduce
66 in navigating through the DTS source.
82 dma: dma-controller@10000 {
86 clk: clock-controller@80000 {
92 /* Board DTS - alphabetical order */
102 /* Board DTS - alternative order, keep as DTSI */
112 Order of Properties in Device Node
113 ----------------------------------
121 vendor-prefixes)
122 5. Vendor-specific properties
124 7. Child nodes, where each node is preceded with a blank line
128 The above-described ordering follows this approach:
130 1. Most important properties start the node: compatible then bus addressing to
132 2. Each node will have common properties in similar place.
133 3. Status is the last information to annotate that device node is or is not
140 device_node: device-class@6789abc {
144 #dma-cells = <1>;
146 clock-names = "bus", "host";
147 #address-cells = <1>;
148 #size-cells = <1>;
149 vendor,custom-property = <2>;
152 child_node: child-class@100 {
158 /* Board DTS */
161 vdd-supply = <&board_vreg1>;
166 -----------
168 1. Use indentation according to Documentation/process/coding-style.rst.
176 thermal-sensor@c271000 {
177 compatible = "qcom,sm8550-tsens", "qcom,tsens-v2";
182 Organizing DTSI and DTS
183 -----------------------
185 The DTSI and DTS files shall be organized in a way representing the common,
186 reusable parts of hardware. Typically, this means organizing DTSI and DTS files
191 2. If applicable: DTSI with common or re-usable parts of the hardware, e.g.
192 entire System-on-Module.
193 3. DTS representing the board.
196 board DTS, not in the SoC or SoM DTSI. A partial exception is a common
197 external reference SoC input clock, which could be coded as a fixed-clock in
198 the SoC DTSI with its frequency provided by each board DTS.