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