blob: c93ce7128942bc50342a82d6cafd27ef0ff04825 [file] [log] [blame]
Simon Glass4cc43bf2021-08-18 21:40:25 -06001// SPDX-License-Identifier: GPL-2.0+
Simon Glass28db4692019-05-18 11:59:41 -06002/*
3 * This is the common sandbox device-tree nodes. This is shared between sandbox
4 * and sandbox64 builds.
5 */
6
Eddie James1a55a7a2023-10-24 10:43:51 -05007#include <config.h>
Dzmitry Sankouski55003db2023-01-22 18:21:22 +03008#include <dt-bindings/input/input.h>
9
Simon Glass28db4692019-05-18 11:59:41 -060010#define USB_CLASS_HUB 9
11
12/ {
Eddie James1a55a7a2023-10-24 10:43:51 -050013 reserved-memory {
14 #address-cells = <1>;
15 #size-cells = <1>;
16 ranges;
17
18 event_log: tcg_event_log {
19 no-map;
20 reg = <(CFG_SYS_SDRAM_SIZE - 0x2000) 0x2000>;
21 };
22 };
23
Philippe Reynes462d1632022-03-28 22:56:53 +020024 binman {
25 };
26
Simon Glass28db4692019-05-18 11:59:41 -060027 chosen {
28 stdout-path = "/serial";
29 };
30
Rasmus Villemoesf99e8802022-09-27 11:54:05 +020031 alarm_wdt: alarm-wdt {
32 compatible = "sandbox,alarm-wdt";
33 timeout-sec = <5>;
34 u-boot,autostart;
35 };
36
Simon Glass28db4692019-05-18 11:59:41 -060037 audio: audio-codec {
38 compatible = "sandbox,audio-codec";
39 #sound-dai-cells = <1>;
40 };
41
Simon Glass1b4bc152022-04-24 23:31:21 -060042 bootstd {
43 compatible = "u-boot,boot-std";
44 filename-prefixes = "./";
Simon Glass82adc292023-08-14 16:40:30 -060045
46 cedit-theme {
47 font-size = <30>;
48 menu-inset = <3>;
49 menuitem-gap-y = <1>;
50 };
Simon Glass1b4bc152022-04-24 23:31:21 -060051 };
52
Philippe Reynesf56bf0a2020-07-24 18:19:48 +020053 buttons {
54 compatible = "gpio-keys";
55
Heinrich Schuchardt57c2fc62020-09-14 12:50:54 +020056 btn1 {
Philippe Reynesf56bf0a2020-07-24 18:19:48 +020057 gpios = <&gpio_a 3 0>;
Heinrich Schuchardt57c2fc62020-09-14 12:50:54 +020058 label = "button1";
Dzmitry Sankouski55003db2023-01-22 18:21:22 +030059 linux,code = <BTN_1>;
Philippe Reynesf56bf0a2020-07-24 18:19:48 +020060 };
61
Heinrich Schuchardt57c2fc62020-09-14 12:50:54 +020062 btn2 {
Philippe Reynesf56bf0a2020-07-24 18:19:48 +020063 gpios = <&gpio_a 4 0>;
Heinrich Schuchardt57c2fc62020-09-14 12:50:54 +020064 label = "button2";
Dzmitry Sankouski55003db2023-01-22 18:21:22 +030065 linux,code = <BTN_2>;
Philippe Reynesf56bf0a2020-07-24 18:19:48 +020066 };
67 };
68
Simon Glass6b927b12020-10-03 11:31:32 -060069 clk_fixed: clk-fixed {
Simon Glassd3a98cb2023-02-13 08:56:33 -070070 bootph-all;
Simon Glass9bb88fb2021-03-15 17:25:24 +130071 compatible = "sandbox,fixed-clock";
Simon Glass6b927b12020-10-03 11:31:32 -060072 #clock-cells = <0>;
73 clock-frequency = <1234>;
74 };
75
76 clk_sandbox: clk-sbox {
Simon Glassd3a98cb2023-02-13 08:56:33 -070077 bootph-all;
Simon Glass6b927b12020-10-03 11:31:32 -060078 compatible = "sandbox,clk";
79 #clock-cells = <1>;
80 assigned-clocks = <&clk_sandbox 3>;
81 assigned-clock-rates = <321>;
82 };
83
84 clk-test {
Simon Glassd3a98cb2023-02-13 08:56:33 -070085 bootph-all;
Simon Glass6b927b12020-10-03 11:31:32 -060086 compatible = "sandbox,clk-test";
87 clocks = <&clk_fixed>,
88 <&clk_sandbox 1>,
89 <&clk_sandbox 0>,
90 <&clk_sandbox 3>,
91 <&clk_sandbox 2>;
92 clock-names = "fixed", "i2c", "spi", "uart2", "uart1";
93 };
94
Simon Glass28db4692019-05-18 11:59:41 -060095 gpio_a: gpios@0 {
Simon Glassd3a98cb2023-02-13 08:56:33 -070096 bootph-some-ram;
Simon Glass28db4692019-05-18 11:59:41 -060097 gpio-controller;
98 compatible = "sandbox,gpio";
99 #gpio-cells = <1>;
100 gpio-bank-name = "a";
101 sandbox,gpio-count = <20>;
102 };
103
104 gpio_b: gpios@1 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700105 bootph-pre-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600106 gpio-controller;
107 compatible = "sandbox,gpio";
108 #gpio-cells = <2>;
109 gpio-bank-name = "b";
110 sandbox,gpio-count = <10>;
111 };
112
Simon Glass2149e112021-08-07 07:24:12 -0600113 gpio-test {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700114 bootph-pre-ram;
Simon Glass2149e112021-08-07 07:24:12 -0600115 compatible = "sandbox,gpio-test";
116 test-gpios = <&gpio_b 3 0>;
117 };
118
Simon Glass28db4692019-05-18 11:59:41 -0600119 hexagon {
120 compatible = "demo-simple";
121 colour = "white";
122 sides = <6>;
123 };
124
125 i2c_0: i2c@0 {
126 eeprom@2c {
127 reg = <0x2c>;
128 compatible = "i2c-eeprom";
129 sandbox,emul = <&emul_eeprom>;
130 };
131
132 rtc_0: rtc@43 {
133 reg = <0x43>;
134 compatible = "sandbox-rtc";
135 sandbox,emul = <&emul0>;
Simon Glasscce3e3e2023-02-22 09:34:04 -0700136 bootph-pre-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600137 };
138 sandbox_pmic: sandbox_pmic {
139 reg = <0x40>;
140 };
141
142 mc34708: pmic@41 {
143 reg = <0x41>;
144 };
145
146 i2c_emul: emul {
Simon Glasscce3e3e2023-02-22 09:34:04 -0700147 bootph-pre-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600148 reg = <0xff>;
149 compatible = "sandbox,i2c-emul-parent";
150 emul_eeprom: emul-eeprom {
151 compatible = "sandbox,i2c-eeprom";
152 sandbox,filename = "i2c.bin";
153 sandbox,size = <256>;
Simon Glass9db623b2021-02-03 06:01:16 -0700154 #emul-cells = <0>;
Simon Glass28db4692019-05-18 11:59:41 -0600155 };
156 emul0: emul0 {
Simon Glasscce3e3e2023-02-22 09:34:04 -0700157 bootph-pre-ram;
Simon Glass9db623b2021-02-03 06:01:16 -0700158 compatible = "sandbox,i2c-rtc-emul";
159 #emul-cells = <0>;
Simon Glass28db4692019-05-18 11:59:41 -0600160 };
161 };
162 };
163
164 i2s: i2s {
165 compatible = "sandbox,i2s";
166 #sound-dai-cells = <1>;
167 };
168
Simon Glasse7995f72021-08-07 07:24:11 -0600169 irq_sandbox: irq-sbox {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700170 bootph-pre-ram;
Simon Glasse7995f72021-08-07 07:24:11 -0600171 compatible = "sandbox,irq";
172 interrupt-controller;
173 #interrupt-cells = <2>;
174 };
175
176 irq-test {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700177 bootph-pre-ram;
Simon Glasse7995f72021-08-07 07:24:11 -0600178 compatible = "sandbox,irq-test";
179 interrupts-extended = <&irq_sandbox 3 0>;
180 };
181
Simon Glass28db4692019-05-18 11:59:41 -0600182 lcd {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700183 bootph-some-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600184 compatible = "sandbox,lcd-sdl";
185 xres = <1366>;
186 yres = <768>;
Simon Glassd2caf7b2020-02-03 07:36:14 -0700187 log2-depth = <5>;
Simon Glass28db4692019-05-18 11:59:41 -0600188 };
189
190 leds {
191 compatible = "gpio-leds";
192
193 iracibble {
194 gpios = <&gpio_a 1 0>;
195 label = "sandbox:red";
196 };
197
198 martinet {
199 gpios = <&gpio_a 2 0>;
200 label = "sandbox:green";
201 };
202 };
203
Tom Rini4a3ca482020-02-11 12:41:23 -0500204 pci@0 {
Simon Glass8c501022019-12-06 21:41:54 -0700205 pci@1e,0 {
206 compatible = "sandbox,pmc";
207 reg = <0xf000 0 0 0 0>;
208 sandbox,emul = <&pmc_emul>;
209 gpe0-dwx-mask = <0xf>;
210 gpe0-dwx-shift-base = <4>;
211 gpe0-dw = <6 7 9>;
212 gpe0-sts = <0x20>;
213 gpe0-en = <0x30>;
214 };
215
Simon Glass28db4692019-05-18 11:59:41 -0600216 pci@1f,0 {
217 compatible = "pci-generic";
218 reg = <0xf800 0 0 0 0>;
Simon Glassb98ba4c2019-09-25 08:56:10 -0600219 sandbox,emul = <&swap_case_emul>;
220 };
221 };
222
223 emul {
224 compatible = "sandbox,pci-emul-parent";
Simon Glass8c501022019-12-06 21:41:54 -0700225 pmc_emul: emul@1e,0 {
226 compatible = "sandbox,pmc-emul";
227 };
Simon Glassb98ba4c2019-09-25 08:56:10 -0600228 swap_case_emul: emul@1f,0 {
229 compatible = "sandbox,swap-case";
Simon Glass28db4692019-05-18 11:59:41 -0600230 };
231 };
232
233 pinctrl {
234 compatible = "sandbox,pinctrl";
235 status = "okay";
236
237 pinctrl_i2c0: i2c0 {
238 groups = "i2c";
239 function = "i2c";
240 bias-pull-up;
241 };
242
243 pinctrl_serial0: uart0 {
244 groups = "serial_a";
245 function = "serial";
246 };
247
248 pinctrl_onewire0: onewire0 {
249 groups = "w1";
250 function = "w1";
251 bias-pull-up;
252 };
253 };
254
255 reset@1 {
256 compatible = "sandbox,reset";
Simon Glassd3a98cb2023-02-13 08:56:33 -0700257 bootph-some-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600258 };
259
Vincent Stehlé53f6dc02021-03-10 15:33:30 +0100260 rng {
261 compatible = "sandbox,sandbox-rng";
262 };
263
Simon Glass509f32e2022-09-21 16:21:47 +0200264 scsi {
265 compatible = "sandbox,scsi";
266 };
267
Simon Glass28db4692019-05-18 11:59:41 -0600268 sound {
269 compatible = "sandbox,sound";
270 cpu {
271 sound-dai = <&i2s 0>;
272 };
273
274 codec {
275 sound-dai = <&audio 0>;
276 };
277 };
278
279 spi@0 {
280 firmware_storage_spi: flash@0 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700281 bootph-some-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600282 reg = <0>;
Simon Glass7e368682019-05-18 11:59:49 -0600283 compatible = "spansion,m25p16", "jedec,spi-nor";
Simon Glass28db4692019-05-18 11:59:41 -0600284 spi-max-frequency = <40000000>;
285 sandbox,filename = "spi.bin";
286 };
287 };
288
289 spl-test {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700290 bootph-pre-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600291 compatible = "sandbox,spl-test";
292 boolval;
293 intval = <1>;
294 intarray = <2 3 4>;
Simon Glass43118322021-07-28 19:23:11 -0600295 maybe-empty-int = <>;
Simon Glass28db4692019-05-18 11:59:41 -0600296 byteval = [05];
297 bytearray = [06];
298 longbytearray = [09 0a 0b 0c 0d 0e 0f 10 11];
299 stringval = "message";
300 stringarray = "multi-word", "message";
301 };
302
303 spl-test2 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700304 bootph-pre-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600305 compatible = "sandbox,spl-test";
306 intval = <3>;
307 intarray = <5>;
308 byteval = [08];
309 bytearray = [01 23 34];
310 longbytearray = [09 0a 0b 0c];
311 stringval = "message2";
312 stringarray = "another", "multi-word", "message";
313 };
314
315 spl-test3 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700316 bootph-pre-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600317 compatible = "sandbox,spl-test";
318 stringarray = "one";
Simon Glass43118322021-07-28 19:23:11 -0600319 maybe-empty-int = <1>;
Simon Glass28db4692019-05-18 11:59:41 -0600320 };
321
Patrick Delaunayae84ff12019-05-21 19:19:11 +0200322 spl-test5 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700323 bootph-verify;
Patrick Delaunayae84ff12019-05-21 19:19:11 +0200324 compatible = "sandbox,spl-test";
325 stringarray = "tpl";
326 };
327
328 spl-test6 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700329 bootph-some-ram;
Patrick Delaunayae84ff12019-05-21 19:19:11 +0200330 compatible = "sandbox,spl-test";
331 stringarray = "pre-proper";
332 };
333
Simon Glass77faa972021-03-15 17:25:31 +1300334 spl-test7 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700335 bootph-pre-ram;
Simon Glass77faa972021-03-15 17:25:31 +1300336 compatible = "sandbox,spl-test";
337 stringarray = "spl";
Patrick Delaunayae84ff12019-05-21 19:19:11 +0200338 };
339
Simon Glass28db4692019-05-18 11:59:41 -0600340 square {
341 compatible = "demo-shape";
342 colour = "blue";
343 sides = <4>;
344 };
345
346 timer {
347 compatible = "sandbox,timer";
348 clock-frequency = <1000000>;
349 };
350
351 tpm {
Simon Glass28db4692019-05-18 11:59:41 -0600352 compatible = "google,sandbox-tpm";
353 };
354
355 tpm2 {
356 compatible = "sandbox,tpm2";
Eddie James1a55a7a2023-10-24 10:43:51 -0500357 memory-region = <&event_log>;
Simon Glass28db4692019-05-18 11:59:41 -0600358 };
359
360 triangle {
361 compatible = "demo-shape";
362 colour = "cyan";
363 sides = <3>;
364 character = <83>;
365 light-gpios = <&gpio_a 2>, <&gpio_b 6 0>;
366 };
367
368 /* Needs to be available prior to relocation */
369 uart0: serial {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700370 bootph-pre-ram;
371 bootph-pre-sram;
372 bootph-verify;
Simon Glass28db4692019-05-18 11:59:41 -0600373 compatible = "sandbox,serial";
374 sandbox,text-colour = "cyan";
375 pinctrl-names = "default";
376 pinctrl-0 = <&pinctrl_serial0>;
377 };
378
379 usb@0 {
380 compatible = "sandbox,usb";
381 status = "disabled";
382 hub {
383 compatible = "sandbox,usb-hub";
384 #address-cells = <1>;
385 #size-cells = <0>;
386 flash-stick {
387 reg = <0>;
388 compatible = "sandbox,usb-flash";
389 };
390 };
391 };
392
393 usb@1 {
394 compatible = "sandbox,usb";
395 hub {
396 compatible = "usb-hub";
397 usb,device-class = <USB_CLASS_HUB>;
398 hub-emul {
399 compatible = "sandbox,usb-hub";
400 #address-cells = <1>;
401 #size-cells = <0>;
402 flash-stick {
403 reg = <0>;
404 compatible = "sandbox,usb-flash";
405 sandbox,filepath = "flash.bin";
406 };
407 };
408 };
409 };
410
411 usb@2 {
412 compatible = "sandbox,usb";
413 status = "disabled";
414 };
415
416 spmi: spmi@0 {
417 compatible = "sandbox,spmi";
418 #address-cells = <0x1>;
419 #size-cells = <0x1>;
420 pm8916@0 {
421 compatible = "qcom,spmi-pmic";
Caleb Connolly27cdaab2024-02-26 17:26:16 +0000422 reg = <0x0 0x0>;
Simon Glass28db4692019-05-18 11:59:41 -0600423 #address-cells = <0x1>;
Caleb Connolly27cdaab2024-02-26 17:26:16 +0000424 #size-cells = <0x0>;
Simon Glass28db4692019-05-18 11:59:41 -0600425
426 spmi_gpios: gpios@c000 {
427 compatible = "qcom,pm8916-gpio";
Caleb Connolly27cdaab2024-02-26 17:26:16 +0000428 reg = <0xc000>;
Simon Glass28db4692019-05-18 11:59:41 -0600429 gpio-controller;
Caleb Connolly27cdaab2024-02-26 17:26:16 +0000430 gpio-ranges = <&spmi_gpios 0 0 4>;
Simon Glass28db4692019-05-18 11:59:41 -0600431 #gpio-cells = <2>;
Simon Glass28db4692019-05-18 11:59:41 -0600432 };
433 };
434 };
435
436 axi: axi@0 {
437 compatible = "sandbox,axi";
438 #address-cells = <0x1>;
439 #size-cells = <0x1>;
440 store@0 {
441 compatible = "sandbox,sandbox_store";
442 reg = <0x0 0x400>;
443 };
444 };
445
446 onewire0: onewire {
447 compatible = "w1-gpio";
448 gpios = <&gpio_a 8>;
449 pinctrl-names = "default";
450 pinctrl-0 = <&pinctrl_onewire0>;
451 status = "okay";
452
453 sandbox_eeprom0: sandbox_eeprom@0 {
454 compatible = "sandbox,w1-eeprom";
455 status = "okay";
456 };
457 };
458
459 sandbox_tee {
460 compatible = "sandbox,tee";
461 };
Robert Marko9cf87122022-09-06 13:30:35 +0200462
463 thermal {
464 compatible = "sandbox,thermal";
465 };
Abdellatif El Khlifi4970d5b2023-08-04 14:33:41 +0100466
467 arm-ffa-emul {
468 compatible = "sandbox,arm-ffa-emul";
469
470 sandbox-arm-ffa {
471 compatible = "sandbox,arm-ffa";
472 };
473 };
474
Simon Glass28db4692019-05-18 11:59:41 -0600475};
476
477&cros_ec {
478 /*
479 * This describes the flash memory within the EC. Note
480 * that the STM32L flash erases to 0, not 0xff.
481 */
482 flash {
483 image-pos = <0x08000000>;
484 size = <0x20000>;
485 erase-value = <0>;
486
487 /* Information for sandbox */
488 ro {
489 image-pos = <0>;
490 size = <0xf000>;
491 };
492 wp-ro {
493 image-pos = <0xf000>;
494 size = <0x1000>;
495 };
496 rw {
497 image-pos = <0x10000>;
498 size = <0x10000>;
499 };
500 };
501
502 keyboard-controller {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700503 bootph-some-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600504 };
505};