Skip to content

Commit de9db18

Browse files
mbolivarkartben
authored andcommitted
dts: bindings: improve base.yaml descriptions
This file defines some of the most important properties in the devicetree, including core concepts like 'compatible', 'reg', and 'interrupts'. For some reason, we've never prioritized writing up proper descriptions that indicate their importance or show where the user can get more information about them in the specs or elsewhere. Give this file a once-over to improve the situation. Signed-off-by: Martí Bolívar <[email protected]> Signed-off-by: Martí Bolívar <[email protected]>
1 parent 45f50f8 commit de9db18

File tree

1 file changed

+127
-22
lines changed

1 file changed

+127
-22
lines changed

dts/bindings/base/base.yaml

Lines changed: 127 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@ include: [pm.yaml]
55
properties:
66
status:
77
type: string
8-
description: indicates the operational status of a device
8+
description: |
9+
Indicates the operational status of the hardware or other
10+
resource that the node represents. In particular:
11+
12+
- "okay" means the resource is operational and, for example,
13+
can be used by device drivers
14+
- "disabled" means the resource is not operational and the system
15+
should treat it as if it is not present
16+
17+
For details, see "2.3.4 status" in Devicetree Specification v0.4.
918
enum:
1019
- "ok" # Deprecated form
1120
- "okay"
@@ -17,93 +26,189 @@ properties:
1726
compatible:
1827
type: string-array
1928
required: true
20-
description: compatible strings
29+
description: |
30+
This property is a list of strings that essentially define what
31+
type of hardware or other resource this devicetree node
32+
represents. Each device driver checks for specific compatible
33+
property values to find the devicetree nodes that represent
34+
resources that the driver should manage.
35+
36+
The recommended format is "vendor,device", The "vendor" part is
37+
an abbreviated name of the vendor. The "device" is usually from
38+
the datasheet.
39+
40+
The compatible property can have multiple values, ordered from
41+
most- to least-specific. Having additional values is useful when the
42+
device is a specific instance of a more general family, to allow the
43+
system to match the most specific driver available.
44+
45+
For details, see "2.3.1 compatible" in Devicetree Specification v0.4.
2146
2247
reg:
2348
type: array
24-
description: register space
49+
description: |
50+
Information used to address the device. The value is specific to
51+
the device (i.e. is different depending on the compatible
52+
property).
53+
54+
The "reg" property is typically a sequence of (address, length) pairs.
55+
Each pair is called a "register block". Values are
56+
conventionally written in hex.
57+
58+
For details, see "2.3.6 reg" in Devicetree Specification v0.4.
2559
2660
reg-names:
2761
type: string-array
28-
description: name of each register space
62+
description: |
63+
Optional names given to each register block in the "reg" property.
64+
For example:
65+
66+
/ {
67+
soc {
68+
#address-cells = <1>;
69+
#size-cells = <1>;
70+
71+
uart@1000 {
72+
reg = <0x1000 0x2000>, <0x3000 0x4000>;
73+
reg-names = "foo", "bar";
74+
};
75+
};
76+
};
77+
78+
The uart@1000 node has two register blocks:
79+
80+
- one with base address 0x1000, size 0x2000, and name "foo"
81+
- another with base address 0x3000, size 0x4000, and name "bar"
2982
3083
interrupts:
3184
type: array
32-
description: interrupts for device
85+
description: |
86+
Information about interrupts generated by the device, encoded as an array
87+
of one or more interrupt specifiers. The format of the data in this property
88+
varies by where the device appears in the interrupt tree. Devices with the same
89+
"interrupt-parent" will use the same format in their interrupts properties.
90+
91+
For details, see "2.4 Interrupts and Interrupt Mapping" in
92+
Devicetree Specification v0.4.
3393
3494
# Does not follow the 'type: phandle-array' scheme, but gets type-checked
3595
# by the code. Declare it here just so that other bindings can make it
3696
# 'required: true' easily if they want to.
3797
interrupts-extended:
3898
type: compound
39-
description: extended interrupt specifier for device
99+
description: |
100+
Extended interrupt specifier for device, used as an alternative to
101+
the "interrupts" property.
102+
103+
For details, see "2.4 Interrupts and Interrupt Mapping" in
104+
Devicetree Specification v0.4.
40105
41106
interrupt-names:
42107
type: string-array
43-
description: name of each interrupt
108+
description: |
109+
Optional names given to each interrupt generated by a device.
110+
The interrupts themselves are defined in either "interrupts" or
111+
"interrupts-extended" properties.
112+
113+
For details, see "2.4 Interrupts and Interrupt Mapping" in
114+
Devicetree Specification v0.4.
44115
45116
interrupt-parent:
46117
type: phandle
47-
description: phandle to interrupt controller node
118+
description: |
119+
If present, this refers to the node which handles interrupts generated
120+
by this device.
121+
122+
For details, see "2.4 Interrupts and Interrupt Mapping" in
123+
Devicetree Specification v0.4.
48124
49125
# description of label should be given in bindings inheriting base.yaml
50126
# label property is included here to help enforce its type being string
51127
label:
52128
type: string
53-
description: No description provided for this label
129+
description: |
130+
Human readable string describing the device. Use of this property is
131+
deprecated except as needed on a case-by-case basis.
132+
133+
For details, see "4.1.2 Miscellaneous Properties" in Devicetree
134+
Specification v0.4.
54135
55136
clocks:
56137
type: phandle-array
57-
description: Clock gate information
138+
description: |
139+
Information about the device's clock providers. In general, this property
140+
should follow conventions established in the dt-schema binding:
141+
142+
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/clock/clock.yaml
58143
59144
clock-names:
60145
type: string-array
61-
description: name of each clock
146+
description: |
147+
Optional names given to each clock provider in the "clocks" property.
62148
63149
"#address-cells":
64150
type: int
65-
description: number of address cells in reg property
151+
description: |
152+
This property encodes the number of <u32> cells used by address fields
153+
in "reg" properties in this node's children.
154+
155+
For details, see "2.3.5 #address-cells and #size-cells" in Devicetree
156+
Specification v0.4.
66157
67158
"#size-cells":
68159
type: int
69-
description: number of size cells in reg property
160+
description: |
161+
This property encodes the number of <u32> cells used by size fields in
162+
"reg" properties in this node's children.
163+
164+
For details, see "2.3.5 #address-cells and #size-cells" in Devicetree
165+
Specification v0.4.
70166
71167
dmas:
72168
type: phandle-array
73-
description: DMA channels specifiers
169+
description: |
170+
DMA channel specifiers relevant to the device.
74171
75172
dma-names:
76173
type: string-array
77-
description: Provided names of DMA channel specifiers
174+
description: |
175+
Optional names given to the DMA channel specifiers in the "dmas" property.
78176
79177
io-channels:
80178
type: phandle-array
81-
description: IO channels specifiers
179+
description: |
180+
IO channel specifiers relevant to the device.
82181
83182
io-channel-names:
84183
type: string-array
85-
description: Provided names of IO channel specifiers
184+
description: |
185+
Optional names given to the IO channel specifiers in the "io-channels" property.
86186
87187
mboxes:
88188
type: phandle-array
89-
description: mailbox / IPM channels specifiers
189+
description: |
190+
Mailbox / IPM channel specifiers relevant to the device.
90191
specifier-space: mbox
91192

92193
mbox-names:
93194
type: string-array
94-
description: Provided names of mailbox / IPM channel specifiers
195+
description: |
196+
Optional names given to the mbox specifiers in the "mboxes" property.
95197
96198
power-domains:
97199
type: phandle-array
98-
description: Power domain specifiers
200+
description: |
201+
Power domain specifiers relevant to the device.
99202
100203
power-domain-names:
101204
type: string-array
102-
description: Provided names of power domain specifiers
205+
description: |
206+
Optional names given to the power domain specifiers in the "power-domains" property.
103207
104208
"#power-domain-cells":
105209
type: int
106-
description: Number of cells in power-domains property
210+
description: |
211+
Number of cells in power-domains property
107212
108213
zephyr,deferred-init:
109214
type: boolean

0 commit comments

Comments
 (0)