dm: test: Add a test for of-platdata phandles
[platform/kernel/u-boot.git] / arch / sandbox / dts / sandbox.dtsi
1 /*
2  * This is the common sandbox device-tree nodes. This is shared between sandbox
3  * and sandbox64 builds.
4  */
5
6 #define USB_CLASS_HUB                   9
7
8 / {
9         chosen {
10                 stdout-path = "/serial";
11         };
12
13         audio: audio-codec {
14                 compatible = "sandbox,audio-codec";
15                 #sound-dai-cells = <1>;
16         };
17
18         buttons {
19                 compatible = "gpio-keys";
20
21                 btn1 {
22                         gpios = <&gpio_a 3 0>;
23                         label = "button1";
24                 };
25
26                 btn2 {
27                         gpios = <&gpio_a 4 0>;
28                         label = "button2";
29                 };
30         };
31
32         clk_fixed: clk-fixed {
33                 u-boot,dm-pre-reloc;
34                 compatible = "fixed-clock";
35                 #clock-cells = <0>;
36                 clock-frequency = <1234>;
37         };
38
39         clk_sandbox: clk-sbox {
40                 u-boot,dm-pre-reloc;
41                 compatible = "sandbox,clk";
42                 #clock-cells = <1>;
43                 assigned-clocks = <&clk_sandbox 3>;
44                 assigned-clock-rates = <321>;
45         };
46
47         clk-test {
48                 u-boot,dm-pre-reloc;
49                 compatible = "sandbox,clk-test";
50                 clocks = <&clk_fixed>,
51                          <&clk_sandbox 1>,
52                          <&clk_sandbox 0>,
53                          <&clk_sandbox 3>,
54                          <&clk_sandbox 2>;
55                 clock-names = "fixed", "i2c", "spi", "uart2", "uart1";
56         };
57
58         gpio_a: gpios@0 {
59                 u-boot,dm-pre-reloc;
60                 gpio-controller;
61                 compatible = "sandbox,gpio";
62                 #gpio-cells = <1>;
63                 gpio-bank-name = "a";
64                 sandbox,gpio-count = <20>;
65         };
66
67         gpio_b: gpios@1 {
68                 u-boot,dm-pre-reloc;
69                 gpio-controller;
70                 compatible = "sandbox,gpio";
71                 #gpio-cells = <2>;
72                 gpio-bank-name = "b";
73                 sandbox,gpio-count = <10>;
74         };
75
76         hexagon {
77                 compatible = "demo-simple";
78                 colour = "white";
79                 sides = <6>;
80         };
81
82         i2c_0: i2c@0 {
83                 eeprom@2c {
84                         reg = <0x2c>;
85                         compatible = "i2c-eeprom";
86                         sandbox,emul = <&emul_eeprom>;
87                 };
88
89                 rtc_0: rtc@43 {
90                         reg = <0x43>;
91                         compatible = "sandbox-rtc";
92                         sandbox,emul = <&emul0>;
93                 };
94                 sandbox_pmic: sandbox_pmic {
95                         reg = <0x40>;
96                 };
97
98                 mc34708: pmic@41 {
99                         reg = <0x41>;
100                 };
101
102                 i2c_emul: emul {
103                         reg = <0xff>;
104                         compatible = "sandbox,i2c-emul-parent";
105                         emul_eeprom: emul-eeprom {
106                                 compatible = "sandbox,i2c-eeprom";
107                                 sandbox,filename = "i2c.bin";
108                                 sandbox,size = <256>;
109                         };
110                         emul0: emul0 {
111                                 compatible = "sandbox,i2c-rtc";
112                         };
113                 };
114         };
115
116         i2s: i2s {
117                 compatible = "sandbox,i2s";
118                 #sound-dai-cells = <1>;
119         };
120
121         lcd {
122                 u-boot,dm-pre-reloc;
123                 compatible = "sandbox,lcd-sdl";
124                 xres = <1366>;
125                 yres = <768>;
126                 log2-depth = <5>;
127         };
128
129         leds {
130                 compatible = "gpio-leds";
131
132                 iracibble {
133                         gpios = <&gpio_a 1 0>;
134                         label = "sandbox:red";
135                 };
136
137                 martinet {
138                         gpios = <&gpio_a 2 0>;
139                         label = "sandbox:green";
140                 };
141         };
142
143         pci@0 {
144                 pci@1e,0 {
145                         compatible = "sandbox,pmc";
146                         reg = <0xf000 0 0 0 0>;
147                         sandbox,emul = <&pmc_emul>;
148                         gpe0-dwx-mask = <0xf>;
149                         gpe0-dwx-shift-base = <4>;
150                         gpe0-dw = <6 7 9>;
151                         gpe0-sts = <0x20>;
152                         gpe0-en = <0x30>;
153                 };
154
155                 pci@1f,0 {
156                         compatible = "pci-generic";
157                         reg = <0xf800 0 0 0 0>;
158                         sandbox,emul = <&swap_case_emul>;
159                 };
160         };
161
162         emul {
163                 compatible = "sandbox,pci-emul-parent";
164                 pmc_emul: emul@1e,0 {
165                         compatible = "sandbox,pmc-emul";
166                 };
167                 swap_case_emul: emul@1f,0 {
168                         compatible = "sandbox,swap-case";
169                 };
170         };
171
172         pinctrl {
173                 compatible = "sandbox,pinctrl";
174                 status = "okay";
175
176                 pinctrl_i2c0: i2c0 {
177                         groups = "i2c";
178                         function = "i2c";
179                         bias-pull-up;
180                 };
181
182                 pinctrl_serial0: uart0 {
183                         groups = "serial_a";
184                         function = "serial";
185                 };
186
187                 pinctrl_onewire0: onewire0 {
188                         groups = "w1";
189                         function = "w1";
190                         bias-pull-up;
191                 };
192         };
193
194         reset@1 {
195                 compatible = "sandbox,reset";
196         };
197
198         sound {
199                 compatible = "sandbox,sound";
200                 cpu {
201                         sound-dai = <&i2s 0>;
202                 };
203
204                 codec {
205                         sound-dai = <&audio 0>;
206                 };
207         };
208
209         spi@0 {
210                 firmware_storage_spi: flash@0 {
211                         u-boot,dm-pre-reloc;
212                         reg = <0>;
213                         compatible = "spansion,m25p16", "jedec,spi-nor";
214                         spi-max-frequency = <40000000>;
215                         sandbox,filename = "spi.bin";
216                 };
217         };
218
219         spl-test {
220                 u-boot,dm-pre-reloc;
221                 compatible = "sandbox,spl-test";
222                 boolval;
223                 intval = <1>;
224                 intarray = <2 3 4>;
225                 byteval = [05];
226                 bytearray = [06];
227                 longbytearray = [09 0a 0b 0c 0d 0e 0f 10 11];
228                 stringval = "message";
229                 stringarray = "multi-word", "message";
230         };
231
232         spl-test2 {
233                 u-boot,dm-pre-reloc;
234                 compatible = "sandbox,spl-test";
235                 intval = <3>;
236                 intarray = <5>;
237                 byteval = [08];
238                 bytearray = [01 23 34];
239                 longbytearray = [09 0a 0b 0c];
240                 stringval = "message2";
241                 stringarray = "another", "multi-word", "message";
242         };
243
244         spl-test3 {
245                 u-boot,dm-pre-reloc;
246                 compatible = "sandbox,spl-test";
247                 stringarray = "one";
248         };
249
250         spl-test4 {
251                 u-boot,dm-pre-reloc;
252                 compatible = "sandbox,spl-test.2";
253         };
254
255         spl-test5 {
256                 u-boot,dm-tpl;
257                 compatible = "sandbox,spl-test";
258                 stringarray = "tpl";
259         };
260
261         spl-test6 {
262                 u-boot,dm-pre-proper;
263                 compatible = "sandbox,spl-test";
264                 stringarray = "pre-proper";
265         };
266
267         spl-test7 {
268                 u-boot,dm-spl;
269                 compatible = "sandbox,spl-test";
270                 stringarray = "spl";
271         };
272
273         square {
274                 compatible = "demo-shape";
275                 colour = "blue";
276                 sides = <4>;
277         };
278
279         timer {
280                 compatible = "sandbox,timer";
281                 clock-frequency = <1000000>;
282         };
283
284         tpm {
285                 u-boot,dm-pre-reloc;
286                 compatible = "google,sandbox-tpm";
287         };
288
289         tpm2 {
290                 compatible = "sandbox,tpm2";
291         };
292
293         triangle {
294                 compatible = "demo-shape";
295                 colour = "cyan";
296                 sides = <3>;
297                 character = <83>;
298                 light-gpios = <&gpio_a 2>, <&gpio_b 6 0>;
299         };
300
301         /* Needs to be available prior to relocation */
302         uart0: serial {
303                 u-boot,dm-spl;
304                 compatible = "sandbox,serial";
305                 sandbox,text-colour = "cyan";
306                 pinctrl-names = "default";
307                 pinctrl-0 = <&pinctrl_serial0>;
308         };
309
310         usb@0 {
311                 compatible = "sandbox,usb";
312                 status = "disabled";
313                 hub {
314                         compatible = "sandbox,usb-hub";
315                         #address-cells = <1>;
316                         #size-cells = <0>;
317                         flash-stick {
318                                 reg = <0>;
319                                 compatible = "sandbox,usb-flash";
320                         };
321                 };
322         };
323
324         usb@1 {
325                 compatible = "sandbox,usb";
326                 hub {
327                         compatible = "usb-hub";
328                         usb,device-class = <USB_CLASS_HUB>;
329                         hub-emul {
330                                 compatible = "sandbox,usb-hub";
331                                 #address-cells = <1>;
332                                 #size-cells = <0>;
333                                 flash-stick {
334                                         reg = <0>;
335                                         compatible = "sandbox,usb-flash";
336                                         sandbox,filepath = "flash.bin";
337                                 };
338                         };
339                 };
340         };
341
342         usb@2 {
343                 compatible = "sandbox,usb";
344                 status = "disabled";
345         };
346
347         spmi: spmi@0 {
348                 compatible = "sandbox,spmi";
349                 #address-cells = <0x1>;
350                 #size-cells = <0x1>;
351                 pm8916@0 {
352                         compatible = "qcom,spmi-pmic";
353                         reg = <0x0 0x1>;
354                         #address-cells = <0x1>;
355                         #size-cells = <0x1>;
356
357                         spmi_gpios: gpios@c000 {
358                                 compatible = "qcom,pm8916-gpio";
359                                 reg = <0xc000 0x400>;
360                                 gpio-controller;
361                                 gpio-count = <4>;
362                                 #gpio-cells = <2>;
363                                 gpio-bank-name="spmi";
364                         };
365                 };
366         };
367
368         axi: axi@0 {
369                 compatible = "sandbox,axi";
370                 #address-cells = <0x1>;
371                 #size-cells = <0x1>;
372                 store@0 {
373                         compatible = "sandbox,sandbox_store";
374                         reg = <0x0 0x400>;
375                 };
376         };
377
378         onewire0: onewire {
379                 compatible = "w1-gpio";
380                 gpios = <&gpio_a 8>;
381                 pinctrl-names = "default";
382                 pinctrl-0 = <&pinctrl_onewire0>;
383                 status = "okay";
384
385                 sandbox_eeprom0: sandbox_eeprom@0 {
386                         compatible = "sandbox,w1-eeprom";
387                         status = "okay";
388                 };
389         };
390
391         sandbox_tee {
392                 compatible = "sandbox,tee";
393         };
394 };
395
396 &cros_ec {
397         /*
398          * This describes the flash memory within the EC. Note
399          * that the STM32L flash erases to 0, not 0xff.
400          */
401         flash {
402                 image-pos = <0x08000000>;
403                 size = <0x20000>;
404                 erase-value = <0>;
405
406                 /* Information for sandbox */
407                 ro {
408                         image-pos = <0>;
409                         size = <0xf000>;
410                 };
411                 wp-ro {
412                         image-pos = <0xf000>;
413                         size = <0x1000>;
414                 };
415                 rw {
416                         image-pos = <0x10000>;
417                         size = <0x10000>;
418                 };
419         };
420
421         keyboard-controller {
422                 u-boot,dm-pre-reloc;
423         };
424 };