xref: /linux/drivers/of/unittest-data/tests-overlay.dtsi (revision e0bf6c5ca2d3281f231c5f0c9bf145e9513644de)
1
2/ {
3	testcase-data {
4		overlay-node {
5
6			/* test bus */
7			selftestbus: test-bus {
8				compatible = "simple-bus";
9				#address-cells = <1>;
10				#size-cells = <0>;
11
12				selftest100: test-selftest100 {
13					compatible = "selftest";
14					status = "okay";
15					reg = <100>;
16				};
17
18				selftest101: test-selftest101 {
19					compatible = "selftest";
20					status = "disabled";
21					reg = <101>;
22				};
23
24				selftest0: test-selftest0 {
25					compatible = "selftest";
26					status = "disabled";
27					reg = <0>;
28				};
29
30				selftest1: test-selftest1 {
31					compatible = "selftest";
32					status = "okay";
33					reg = <1>;
34				};
35
36				selftest2: test-selftest2 {
37					compatible = "selftest";
38					status = "disabled";
39					reg = <2>;
40				};
41
42				selftest3: test-selftest3 {
43					compatible = "selftest";
44					status = "okay";
45					reg = <3>;
46				};
47
48				selftest5: test-selftest5 {
49					compatible = "selftest";
50					status = "disabled";
51					reg = <5>;
52				};
53
54				selftest6: test-selftest6 {
55					compatible = "selftest";
56					status = "disabled";
57					reg = <6>;
58				};
59
60				selftest7: test-selftest7 {
61					compatible = "selftest";
62					status = "disabled";
63					reg = <7>;
64				};
65
66				selftest8: test-selftest8 {
67					compatible = "selftest";
68					status = "disabled";
69					reg = <8>;
70				};
71
72				i2c-test-bus {
73					compatible = "selftest-i2c-bus";
74					status = "okay";
75					reg = <50>;
76
77					#address-cells = <1>;
78					#size-cells = <0>;
79
80					test-selftest12 {
81						reg = <8>;
82						compatible = "selftest-i2c-dev";
83						status = "disabled";
84					};
85
86					test-selftest13 {
87						reg = <9>;
88						compatible = "selftest-i2c-dev";
89						status = "okay";
90					};
91
92					test-selftest14 {
93						reg = <10>;
94						compatible = "selftest-i2c-mux";
95						status = "okay";
96
97						#address-cells = <1>;
98						#size-cells = <0>;
99
100						i2c@0 {
101							#address-cells = <1>;
102							#size-cells = <0>;
103							reg = <0>;
104
105							test-mux-dev {
106								reg = <32>;
107								compatible = "selftest-i2c-dev";
108								status = "okay";
109							};
110						};
111					};
112				};
113			};
114		};
115
116		/* test enable using absolute target path */
117		overlay0 {
118			fragment@0 {
119				target-path = "/testcase-data/overlay-node/test-bus/test-selftest0";
120				__overlay__ {
121					status = "okay";
122				};
123			};
124		};
125
126		/* test disable using absolute target path */
127		overlay1 {
128			fragment@0 {
129				target-path = "/testcase-data/overlay-node/test-bus/test-selftest1";
130				__overlay__ {
131					status = "disabled";
132				};
133			};
134		};
135
136		/* test enable using label */
137		overlay2 {
138			fragment@0 {
139				target = <&selftest2>;
140				__overlay__ {
141					status = "okay";
142				};
143			};
144		};
145
146		/* test disable using label */
147		overlay3 {
148			fragment@0 {
149				target = <&selftest3>;
150				__overlay__ {
151					status = "disabled";
152				};
153			};
154		};
155
156		/* test insertion of a full node */
157		overlay4 {
158			fragment@0 {
159				target = <&selftestbus>;
160				__overlay__ {
161
162					/* suppress DTC warning */
163					#address-cells = <1>;
164					#size-cells = <0>;
165
166					test-selftest4 {
167						compatible = "selftest";
168						status = "okay";
169						reg = <4>;
170					};
171				};
172			};
173		};
174
175		/* test overlay apply revert */
176		overlay5 {
177			fragment@0 {
178				target-path = "/testcase-data/overlay-node/test-bus/test-selftest5";
179				__overlay__ {
180					status = "okay";
181				};
182			};
183		};
184
185		/* test overlays application and removal in sequence */
186		overlay6 {
187			fragment@0 {
188				target-path = "/testcase-data/overlay-node/test-bus/test-selftest6";
189				__overlay__ {
190					status = "okay";
191				};
192			};
193		};
194		overlay7 {
195			fragment@0 {
196				target-path = "/testcase-data/overlay-node/test-bus/test-selftest7";
197				__overlay__ {
198					status = "okay";
199				};
200			};
201		};
202
203		/* test overlays application and removal in bad sequence */
204		overlay8 {
205			fragment@0 {
206				target-path = "/testcase-data/overlay-node/test-bus/test-selftest8";
207				__overlay__ {
208					status = "okay";
209				};
210			};
211		};
212		overlay9 {
213			fragment@0 {
214				target-path = "/testcase-data/overlay-node/test-bus/test-selftest8";
215				__overlay__ {
216					property-foo = "bar";
217				};
218			};
219		};
220
221		overlay10 {
222			fragment@0 {
223				target-path = "/testcase-data/overlay-node/test-bus";
224				__overlay__ {
225
226					/* suppress DTC warning */
227					#address-cells = <1>;
228					#size-cells = <0>;
229
230					test-selftest10 {
231						compatible = "selftest";
232						status = "okay";
233						reg = <10>;
234
235						#address-cells = <1>;
236						#size-cells = <0>;
237
238						test-selftest101 {
239							compatible = "selftest";
240							status = "okay";
241							reg = <1>;
242						};
243
244					};
245				};
246			};
247		};
248
249		overlay11 {
250			fragment@0 {
251				target-path = "/testcase-data/overlay-node/test-bus";
252				__overlay__ {
253
254					/* suppress DTC warning */
255					#address-cells = <1>;
256					#size-cells = <0>;
257
258					test-selftest11 {
259						compatible = "selftest";
260						status = "okay";
261						reg = <11>;
262
263						#address-cells = <1>;
264						#size-cells = <0>;
265
266						test-selftest111 {
267							compatible = "selftest";
268							status = "okay";
269							reg = <1>;
270						};
271
272					};
273				};
274			};
275		};
276
277		/* test enable using absolute target path (i2c) */
278		overlay12 {
279			fragment@0 {
280				target-path = "/testcase-data/overlay-node/test-bus/i2c-test-bus/test-selftest12";
281				__overlay__ {
282					status = "okay";
283				};
284			};
285		};
286
287		/* test disable using absolute target path (i2c) */
288		overlay13 {
289			fragment@0 {
290				target-path = "/testcase-data/overlay-node/test-bus/i2c-test-bus/test-selftest13";
291				__overlay__ {
292					status = "disabled";
293				};
294			};
295		};
296
297		/* test mux overlay */
298		overlay15 {
299			fragment@0 {
300				target-path = "/testcase-data/overlay-node/test-bus/i2c-test-bus";
301				__overlay__ {
302					#address-cells = <1>;
303					#size-cells = <0>;
304					test-selftest15 {
305						reg = <11>;
306						compatible = "selftest-i2c-mux";
307						status = "okay";
308
309						#address-cells = <1>;
310						#size-cells = <0>;
311
312						i2c@0 {
313							#address-cells = <1>;
314							#size-cells = <0>;
315							reg = <0>;
316
317							test-mux-dev {
318								reg = <32>;
319								compatible = "selftest-i2c-dev";
320								status = "okay";
321							};
322						};
323					};
324				};
325			};
326		};
327
328	};
329};
330