/
good-example.yaml
233 lines (191 loc) · 5.61 KB
/
good-example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# SPDX-License-Identifier: BSD-2-Clause
# Copyright 2018 Linaro Ltd.
# Copyright 2018 Arm Ltd.
%YAML 1.2
---
$id: "http://devicetree.org/schemas/good-example.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
title: A one line title for a good binding
description: A more detailed description for a good binding example.
maintainers:
- Rob Herring <robh@kernel.org>
properties:
compatible:
oneOf:
- items:
- enum:
- vendor,soc4-ip
- vendor,soc3-ip
- vendor,soc2-ip
- enum:
- vendor,soc1-ip
- items:
- enum:
- vendor,soc1-ip
reg:
maxItems: 2
reg-names:
items:
- const: "coreAAA"
- const: "aux"
interrupts:
minItems: 1
maxItems: 2
items:
- description: 1st irq
- description: 2nd irq
interrupt-names:
minItems: 1
items:
- const: "tx irq"
- const: "rx irq"
'#interrupt-cells':
const: 2
interrupt-controller: {}
clock-frequency:
minimum: 100
maximum: 400000
clocks:
minItems: 1
maxItems: 2
items:
- description: 1st clock
- description: 2nd clock
clock-names:
items:
- const: "clk1"
- const: "clk2"
'#clock-cells':
const: 1
clock-output-names:
minItems: 1
maxItems: 2
some-gpios:
maxItems: 2
a-single-gpios:
description: A GPIO that does something
maxItems: 1
vendor,bool-prop:
$ref: "/schemas/types.yaml#/definitions/flag"
description: A vendor specific boolean property
vendor,int-prop:
allOf:
- $ref: "/schemas/types.yaml#/definitions/uint32"
- enum: [ 1, 2, 3 ]
description: Vendor specific single cell integer property
vendor,int-array-prop:
allOf:
- $ref: "/schemas/types.yaml#/definitions/uint32-array"
- items:
minimum: 5
maximum: 10
description: Vendor specific integer array property
vendor,int-array-prop-2:
allOf:
- $ref: "/schemas/types.yaml#/definitions/uint32-array"
- items:
- const: 5
- const: 10
description: Vendor specific integer array property
vendor,int-array-size-only-prop:
allOf:
- $ref: "/schemas/types.yaml#/definitions/uint32-array"
minItems: 2
maxItems: 5
description: Vendor specific integer array property with only a size
range. This can use either form of brackets.
vendor,string-prop:
allOf:
- $ref: "/schemas/types.yaml#/definitions/string"
- enum:
- foo
- bar
description: Vendor specific single string property
vendor,string-list-prop:
allOf:
- $ref: "/schemas/types.yaml#/definitions/string-array"
- minItems: 2
items:
- const: foobar
- const: foobaz
description: Vendor specific string list property
vendor,int8-prop:
$ref: /schemas/types.yaml#definitions/uint8
description: Vendor specific 8-bit integer property
vendor,int8-array-prop:
allOf:
- $ref: /schemas/types.yaml#definitions/uint8-array
- items:
- minItems: 2
maxItems: 3
description: A vendor specific uint8 array property with 2 or 3 entries
vendor,int16-prop:
allOf:
- $ref: /schemas/types.yaml#definitions/uint16
- enum: [ 1, 2, 3 ]
description: Vendor specific 16-bit integer property
vendor,int16-array-prop:
allOf:
- $ref: /schemas/types.yaml#definitions/uint16-array
- items:
- const: 1
- const: 2
description: Vendor specific 16-bit integer array property
vendor,int64-prop:
allOf:
- $ref: /schemas/types.yaml#definitions/uint64
- items:
- items:
- minimum: 0x1234
description: Vendor specific 16-bit integer property
vendor,int64-array-prop:
allOf:
- $ref: /schemas/types.yaml#definitions/uint64-array
description: Vendor specific 64-bit integer array property
vendor,phandle-prop:
$ref: "/schemas/types.yaml#/definitions/phandle"
description: Vendor specific single cell phandle property
vendor,phandle-array-prop:
allOf:
- $ref: "/schemas/types.yaml#/definitions/phandle-array"
- minItems: 2
description: Vendor specific array of phandles property
vendor,phandle-with-fixed-cells:
allOf:
- $ref: "/schemas/types.yaml#/definitions/phandle-array"
- items:
- items:
- description: the phandle to something
- description: the 1st cell data
- description: the 2nd cell data
description: Vendor specific array of phandles property
required:
- compatible
examples:
- |
/dts-v1/;
/{
model = "ARM Juno development board (r0)";
compatible = "arm,juno", "arm,vexpress";
interrupt-parent = <&gic>;
#address-cells = <2>;
#size-cells = <2>;
cpus {
#address-cells = <2>;
#size-cells = <0>;
A57_0: cpu@0 {
compatible = "arm,cortex-a57","arm,armv8";
reg = <0x0 0x0>;
device_type = "cpu";
enable-method = "psci";
};
.....
A53_0: cpu@100 {
compatible = "arm,cortex-a53","arm,armv8";
reg = <0x0 0x100>;
device_type = "cpu";
enable-method = "psci";
};
.....
};
};