test: Add tests for misc uclass
[platform/kernel/u-boot.git] / arch / sandbox / dts / test.dts
1 /dts-v1/;
2
3 / {
4         model = "sandbox";
5         compatible = "sandbox";
6         #address-cells = <1>;
7         #size-cells = <1>;
8
9         aliases {
10                 console = &uart0;
11                 eth0 = "/eth@10002000";
12                 eth3 = &eth_3;
13                 eth5 = &eth_5;
14                 i2c0 = "/i2c@0";
15                 mmc0 = "/mmc0";
16                 mmc1 = "/mmc1";
17                 pci0 = &pci0;
18                 pci1 = &pci1;
19                 pci2 = &pci2;
20                 remoteproc1 = &rproc_1;
21                 remoteproc2 = &rproc_2;
22                 rtc0 = &rtc_0;
23                 rtc1 = &rtc_1;
24                 spi0 = "/spi@0";
25                 testfdt6 = "/e-test";
26                 testbus3 = "/some-bus";
27                 testfdt0 = "/some-bus/c-test@0";
28                 testfdt1 = "/some-bus/c-test@1";
29                 testfdt3 = "/b-test";
30                 testfdt5 = "/some-bus/c-test@5";
31                 testfdt8 = "/a-test";
32                 fdt-dummy0 = "/translation-test@8000/dev@0,0";
33                 fdt-dummy1 = "/translation-test@8000/dev@1,100";
34                 fdt-dummy2 = "/translation-test@8000/dev@2,200";
35                 fdt-dummy3 = "/translation-test@8000/noxlatebus@3,300/dev@42";
36                 usb0 = &usb_0;
37                 usb1 = &usb_1;
38                 usb2 = &usb_2;
39         };
40
41         a-test {
42                 reg = <0 1>;
43                 compatible = "denx,u-boot-fdt-test";
44                 ping-expect = <0>;
45                 ping-add = <0>;
46                 u-boot,dm-pre-reloc;
47                 test-gpios = <&gpio_a 1>, <&gpio_a 4>, <&gpio_b 5 0 3 2 1>,
48                         <0>, <&gpio_a 12>;
49                 test2-gpios = <&gpio_a 1>, <&gpio_a 4>, <&gpio_b 6 1 3 2 1>,
50                         <&gpio_b 7 2 3 2 1>, <&gpio_b 8 4 3 2 1>,
51                         <&gpio_b 9 0xc 3 2 1>;
52         };
53
54         junk {
55                 reg = <1 1>;
56                 compatible = "not,compatible";
57         };
58
59         no-compatible {
60                 reg = <2 1>;
61         };
62
63         b-test {
64                 reg = <3 1>;
65                 compatible = "denx,u-boot-fdt-test";
66                 ping-expect = <3>;
67                 ping-add = <3>;
68         };
69
70         phy_provider0: gen_phy@0 {
71                 compatible = "sandbox,phy";
72                 #phy-cells = <1>;
73         };
74
75         phy_provider1: gen_phy@1 {
76                 compatible = "sandbox,phy";
77                 #phy-cells = <0>;
78                 broken;
79         };
80
81         gen_phy_user: gen_phy_user {
82                 compatible = "simple-bus";
83                 phys = <&phy_provider0 0>, <&phy_provider0 1>, <&phy_provider1>;
84                 phy-names = "phy1", "phy2", "phy3";
85         };
86
87         some-bus {
88                 #address-cells = <1>;
89                 #size-cells = <0>;
90                 compatible = "denx,u-boot-test-bus";
91                 reg = <3 1>;
92                 ping-expect = <4>;
93                 ping-add = <4>;
94                 c-test@5 {
95                         compatible = "denx,u-boot-fdt-test";
96                         reg = <5>;
97                         ping-expect = <5>;
98                         ping-add = <5>;
99                 };
100                 c-test@0 {
101                         compatible = "denx,u-boot-fdt-test";
102                         reg = <0>;
103                         ping-expect = <6>;
104                         ping-add = <6>;
105                 };
106                 c-test@1 {
107                         compatible = "denx,u-boot-fdt-test";
108                         reg = <1>;
109                         ping-expect = <7>;
110                         ping-add = <7>;
111                 };
112         };
113
114         d-test {
115                 reg = <3 1>;
116                 ping-expect = <6>;
117                 ping-add = <6>;
118                 compatible = "google,another-fdt-test";
119         };
120
121         e-test {
122                 reg = <3 1>;
123                 ping-expect = <6>;
124                 ping-add = <6>;
125                 compatible = "google,another-fdt-test";
126         };
127
128         f-test {
129                 compatible = "denx,u-boot-fdt-test";
130         };
131
132         g-test {
133                 compatible = "denx,u-boot-fdt-test";
134         };
135
136         clocks {
137                 clk_fixed: clk-fixed {
138                         compatible = "fixed-clock";
139                         #clock-cells = <0>;
140                         clock-frequency = <1234>;
141                 };
142         };
143
144         clk_sandbox: clk-sbox {
145                 compatible = "sandbox,clk";
146                 #clock-cells = <1>;
147         };
148
149         clk-test {
150                 compatible = "sandbox,clk-test";
151                 clocks = <&clk_fixed>,
152                          <&clk_sandbox 1>,
153                          <&clk_sandbox 0>;
154                 clock-names = "fixed", "i2c", "spi";
155         };
156
157         eth@10002000 {
158                 compatible = "sandbox,eth";
159                 reg = <0x10002000 0x1000>;
160                 fake-host-hwaddr = [00 00 66 44 22 00];
161         };
162
163         eth_5: eth@10003000 {
164                 compatible = "sandbox,eth";
165                 reg = <0x10003000 0x1000>;
166                 fake-host-hwaddr = [00 00 66 44 22 11];
167         };
168
169         eth_3: sbe5 {
170                 compatible = "sandbox,eth";
171                 reg = <0x10005000 0x1000>;
172                 fake-host-hwaddr = [00 00 66 44 22 33];
173         };
174
175         eth@10004000 {
176                 compatible = "sandbox,eth";
177                 reg = <0x10004000 0x1000>;
178                 fake-host-hwaddr = [00 00 66 44 22 22];
179         };
180
181         gpio_a: base-gpios {
182                 compatible = "sandbox,gpio";
183                 gpio-controller;
184                 #gpio-cells = <1>;
185                 gpio-bank-name = "a";
186                 sandbox,gpio-count = <20>;
187         };
188
189         gpio_b: extra-gpios {
190                 compatible = "sandbox,gpio";
191                 gpio-controller;
192                 #gpio-cells = <5>;
193                 gpio-bank-name = "b";
194                 sandbox,gpio-count = <10>;
195         };
196
197         i2c@0 {
198                 #address-cells = <1>;
199                 #size-cells = <0>;
200                 reg = <0 1>;
201                 compatible = "sandbox,i2c";
202                 clock-frequency = <100000>;
203                 eeprom@2c {
204                         reg = <0x2c>;
205                         compatible = "i2c-eeprom";
206                         emul {
207                                 compatible = "sandbox,i2c-eeprom";
208                                 sandbox,filename = "i2c.bin";
209                                 sandbox,size = <256>;
210                         };
211                 };
212
213                 rtc_0: rtc@43 {
214                         reg = <0x43>;
215                         compatible = "sandbox-rtc";
216                         emul {
217                                 compatible = "sandbox,i2c-rtc";
218                         };
219                 };
220
221                 rtc_1: rtc@61 {
222                         reg = <0x61>;
223                         compatible = "sandbox-rtc";
224                         emul {
225                                 compatible = "sandbox,i2c-rtc";
226                         };
227                 };
228
229                 sandbox_pmic: sandbox_pmic {
230                         reg = <0x40>;
231                 };
232
233                 mc34708: pmic@41 {
234                         reg = <0x41>;
235                 };
236         };
237
238         adc@0 {
239                 compatible = "sandbox,adc";
240                 vdd-supply = <&buck2>;
241                 vss-microvolts = <0>;
242         };
243
244         lcd {
245                 u-boot,dm-pre-reloc;
246                 compatible = "sandbox,lcd-sdl";
247                 xres = <1366>;
248                 yres = <768>;
249         };
250
251         leds {
252                 compatible = "gpio-leds";
253
254                 iracibble {
255                         gpios = <&gpio_a 1 0>;
256                         label = "sandbox:red";
257                 };
258
259                 martinet {
260                         gpios = <&gpio_a 2 0>;
261                         label = "sandbox:green";
262                 };
263
264                 default_on {
265                         gpios = <&gpio_a 5 0>;
266                         label = "sandbox:default_on";
267                         default-state = "on";
268                 };
269
270                 default_off {
271                         gpios = <&gpio_a 6 0>;
272                         label = "sandbox:default_off";
273                         default-state = "off";
274                 };
275         };
276
277         mbox: mbox {
278                 compatible = "sandbox,mbox";
279                 #mbox-cells = <1>;
280         };
281
282         mbox-test {
283                 compatible = "sandbox,mbox-test";
284                 mboxes = <&mbox 100>, <&mbox 1>;
285                 mbox-names = "other", "test";
286         };
287
288         misc-test {
289                 compatible = "sandbox,misc_sandbox";
290         };
291
292         mmc2 {
293                 compatible = "sandbox,mmc";
294         };
295
296         mmc1 {
297                 compatible = "sandbox,mmc";
298         };
299
300         mmc0 {
301                 compatible = "sandbox,mmc";
302         };
303
304         pci0: pci-controller0 {
305                 compatible = "sandbox,pci";
306                 device_type = "pci";
307                 #address-cells = <3>;
308                 #size-cells = <2>;
309                 ranges = <0x02000000 0 0x10000000 0x10000000 0 0x2000
310                                 0x01000000 0 0x20000000 0x20000000 0 0x2000>;
311                 pci@0,0 {
312                         compatible = "pci-generic";
313                         reg = <0x0000 0 0 0 0>;
314                         emul@0,0 {
315                                 compatible = "sandbox,swap-case";
316                         };
317                 };
318                 pci@1f,0 {
319                         compatible = "pci-generic";
320                         reg = <0xf800 0 0 0 0>;
321                         emul@1f,0 {
322                                 compatible = "sandbox,swap-case";
323                         };
324                 };
325         };
326
327         pci1: pci-controller1 {
328                 compatible = "sandbox,pci";
329                 device_type = "pci";
330                 #address-cells = <3>;
331                 #size-cells = <2>;
332                 ranges = <0x02000000 0 0x30000000 0x30000000 0 0x2000
333                                 0x01000000 0 0x40000000 0x40000000 0 0x2000>;
334                 sandbox,dev-info = <0x08 0x00 0x1234 0x5678
335                                     0x0c 0x00 0x1234 0x5678>;
336         };
337
338         pci2: pci-controller2 {
339                 compatible = "sandbox,pci";
340                 device_type = "pci";
341                 #address-cells = <3>;
342                 #size-cells = <2>;
343                 ranges = <0x02000000 0 0x50000000 0x50000000 0 0x2000
344                                 0x01000000 0 0x60000000 0x60000000 0 0x2000>;
345                 sandbox,dev-info = <0x08 0x00 0x1234 0x5678>;
346                 pci@1f,0 {
347                         compatible = "pci-generic";
348                         reg = <0xf800 0 0 0 0>;
349                         emul@1f,0 {
350                                 compatible = "sandbox,swap-case";
351                         };
352                 };
353         };
354
355         probing {
356                 compatible = "simple-bus";
357                 test1 {
358                         compatible = "denx,u-boot-probe-test";
359                 };
360
361                 test2 {
362                         compatible = "denx,u-boot-probe-test";
363                 };
364
365                 test3 {
366                         compatible = "denx,u-boot-probe-test";
367                 };
368
369                 test4 {
370                         compatible = "denx,u-boot-probe-test";
371                 };
372         };
373
374         pwrdom: power-domain {
375                 compatible = "sandbox,power-domain";
376                 #power-domain-cells = <1>;
377         };
378
379         power-domain-test {
380                 compatible = "sandbox,power-domain-test";
381                 power-domains = <&pwrdom 2>;
382         };
383
384         pwm {
385                 compatible = "sandbox,pwm";
386         };
387
388         pwm2 {
389                 compatible = "sandbox,pwm";
390         };
391
392         ram {
393                 compatible = "sandbox,ram";
394         };
395
396         reset@0 {
397                 compatible = "sandbox,warm-reset";
398         };
399
400         reset@1 {
401                 compatible = "sandbox,reset";
402         };
403
404         resetc: reset-ctl {
405                 compatible = "sandbox,reset-ctl";
406                 #reset-cells = <1>;
407         };
408
409         reset-ctl-test {
410                 compatible = "sandbox,reset-ctl-test";
411                 resets = <&resetc 100>, <&resetc 2>;
412                 reset-names = "other", "test";
413         };
414
415         rproc_1: rproc@1 {
416                 compatible = "sandbox,test-processor";
417                 remoteproc-name = "remoteproc-test-dev1";
418         };
419
420         rproc_2: rproc@2 {
421                 compatible = "sandbox,test-processor";
422                 internal-memory-mapped;
423                 remoteproc-name = "remoteproc-test-dev2";
424         };
425
426         smem@0 {
427                 compatible = "sandbox,smem";
428         };
429
430         spi@0 {
431                 #address-cells = <1>;
432                 #size-cells = <0>;
433                 reg = <0 1>;
434                 compatible = "sandbox,spi";
435                 cs-gpios = <0>, <&gpio_a 0>;
436                 spi.bin@0 {
437                         reg = <0>;
438                         compatible = "spansion,m25p16", "spi-flash";
439                         spi-max-frequency = <40000000>;
440                         sandbox,filename = "spi.bin";
441                 };
442         };
443
444         syscon@0 {
445                 compatible = "sandbox,syscon0";
446                 reg = <0x10 4>;
447         };
448
449         syscon@1 {
450                 compatible = "sandbox,syscon1";
451                 reg = <0x20 5
452                         0x28 6
453                         0x30 7
454                         0x38 8>;
455         };
456
457         syscon@2 {
458                 compatible = "simple-mfd", "syscon";
459                 reg = <0x40 5
460                         0x48 6
461                         0x50 7
462                         0x58 8>;
463         };
464
465         timer {
466                 compatible = "sandbox,timer";
467                 clock-frequency = <1000000>;
468         };
469
470         tpm2 {
471                 compatible = "sandbox,tpm2";
472         };
473
474         uart0: serial {
475                 compatible = "sandbox,serial";
476                 u-boot,dm-pre-reloc;
477         };
478
479         usb_0: usb@0 {
480                 compatible = "sandbox,usb";
481                 status = "disabled";
482                 hub {
483                         compatible = "sandbox,usb-hub";
484                         #address-cells = <1>;
485                         #size-cells = <0>;
486                         flash-stick {
487                                 reg = <0>;
488                                 compatible = "sandbox,usb-flash";
489                         };
490                 };
491         };
492
493         usb_1: usb@1 {
494                 compatible = "sandbox,usb";
495                 hub {
496                         compatible = "usb-hub";
497                         usb,device-class = <9>;
498                         hub-emul {
499                                 compatible = "sandbox,usb-hub";
500                                 #address-cells = <1>;
501                                 #size-cells = <0>;
502                                 flash-stick@0 {
503                                         reg = <0>;
504                                         compatible = "sandbox,usb-flash";
505                                         sandbox,filepath = "testflash.bin";
506                                 };
507
508                                 flash-stick@1 {
509                                         reg = <1>;
510                                         compatible = "sandbox,usb-flash";
511                                         sandbox,filepath = "testflash1.bin";
512                                 };
513
514                                 flash-stick@2 {
515                                         reg = <2>;
516                                         compatible = "sandbox,usb-flash";
517                                         sandbox,filepath = "testflash2.bin";
518                                 };
519
520                                 keyb@3 {
521                                         reg = <3>;
522                                         compatible = "sandbox,usb-keyb";
523                                 };
524
525                         };
526                 };
527         };
528
529         usb_2: usb@2 {
530                 compatible = "sandbox,usb";
531                 status = "disabled";
532         };
533
534         spmi: spmi@0 {
535                 compatible = "sandbox,spmi";
536                 #address-cells = <0x1>;
537                 #size-cells = <0x1>;
538                 pm8916@0 {
539                         compatible = "qcom,spmi-pmic";
540                         reg = <0x0 0x1>;
541                         #address-cells = <0x1>;
542                         #size-cells = <0x1>;
543
544                         spmi_gpios: gpios@c000 {
545                                 compatible = "qcom,pm8916-gpio";
546                                 reg = <0xc000 0x400>;
547                                 gpio-controller;
548                                 gpio-count = <4>;
549                                 #gpio-cells = <2>;
550                                 gpio-bank-name="spmi";
551                         };
552                 };
553         };
554
555         wdt0: wdt@0 {
556                 compatible = "sandbox,wdt";
557         };
558
559         chosen {
560                 #address-cells = <1>;
561                 #size-cells = <1>;
562                 chosen-test {
563                         compatible = "denx,u-boot-fdt-test";
564                         reg = <9 1>;
565                 };
566         };
567
568         translation-test@8000 {
569                 compatible = "simple-bus";
570                 reg = <0x8000 0x4000>;
571
572                 #address-cells = <0x2>;
573                 #size-cells = <0x1>;
574
575                 ranges = <0 0x0 0x8000 0x1000
576                           1 0x100 0x9000 0x1000
577                           2 0x200 0xA000 0x1000
578                           3 0x300 0xB000 0x1000
579                          >;
580
581                 dev@0,0 {
582                         compatible = "denx,u-boot-fdt-dummy";
583                         reg = <0 0x0 0x1000>;
584                 };
585
586                 dev@1,100 {
587                         compatible = "denx,u-boot-fdt-dummy";
588                         reg = <1 0x100 0x1000>;
589
590                 };
591
592                 dev@2,200 {
593                         compatible = "denx,u-boot-fdt-dummy";
594                         reg = <2 0x200 0x1000>;
595                 };
596
597
598                 noxlatebus@3,300 {
599                         compatible = "simple-bus";
600                         reg = <3 0x300 0x1000>;
601
602                         #address-cells = <0x1>;
603                         #size-cells = <0x0>;
604
605                         dev@42 {
606                                 compatible = "denx,u-boot-fdt-dummy";
607                                 reg = <0x42>;
608                         };
609                 };
610         };
611 };
612
613 #include "sandbox_pmic.dtsi"