blob: 8a115c503dc51ddae9731cb95d5c935f5fa9d26b [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 {
Sean Andersonc50d2a02024-08-15 22:38:22 -0400234 bootph-some-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600235 compatible = "sandbox,pinctrl";
236 status = "okay";
237
238 pinctrl_i2c0: i2c0 {
Sean Andersonc50d2a02024-08-15 22:38:22 -0400239 groups = "I2C_UART";
240 function = "I2C";
Simon Glass28db4692019-05-18 11:59:41 -0600241 bias-pull-up;
242 };
243
244 pinctrl_serial0: uart0 {
Sean Andersonc50d2a02024-08-15 22:38:22 -0400245 bootph-some-ram;
246 groups = "I2C_UART";
247 function = "UART";
Simon Glass28db4692019-05-18 11:59:41 -0600248 };
249
250 pinctrl_onewire0: onewire0 {
Sean Andersonc50d2a02024-08-15 22:38:22 -0400251 pins = "P8";
252 function = "ONEWIRE";
Simon Glass28db4692019-05-18 11:59:41 -0600253 bias-pull-up;
254 };
255 };
256
257 reset@1 {
258 compatible = "sandbox,reset";
Simon Glassd3a98cb2023-02-13 08:56:33 -0700259 bootph-some-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600260 };
261
Vincent Stehlé53f6dc02021-03-10 15:33:30 +0100262 rng {
263 compatible = "sandbox,sandbox-rng";
264 };
265
Simon Glass509f32e2022-09-21 16:21:47 +0200266 scsi {
267 compatible = "sandbox,scsi";
268 };
269
Simon Glass28db4692019-05-18 11:59:41 -0600270 sound {
271 compatible = "sandbox,sound";
272 cpu {
273 sound-dai = <&i2s 0>;
274 };
275
276 codec {
277 sound-dai = <&audio 0>;
278 };
279 };
280
281 spi@0 {
282 firmware_storage_spi: flash@0 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700283 bootph-some-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600284 reg = <0>;
Simon Glass7e368682019-05-18 11:59:49 -0600285 compatible = "spansion,m25p16", "jedec,spi-nor";
Simon Glass28db4692019-05-18 11:59:41 -0600286 spi-max-frequency = <40000000>;
287 sandbox,filename = "spi.bin";
288 };
289 };
290
291 spl-test {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700292 bootph-pre-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600293 compatible = "sandbox,spl-test";
294 boolval;
295 intval = <1>;
296 intarray = <2 3 4>;
Simon Glass43118322021-07-28 19:23:11 -0600297 maybe-empty-int = <>;
Simon Glass28db4692019-05-18 11:59:41 -0600298 byteval = [05];
299 bytearray = [06];
300 longbytearray = [09 0a 0b 0c 0d 0e 0f 10 11];
301 stringval = "message";
302 stringarray = "multi-word", "message";
303 };
304
305 spl-test2 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700306 bootph-pre-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600307 compatible = "sandbox,spl-test";
308 intval = <3>;
309 intarray = <5>;
310 byteval = [08];
311 bytearray = [01 23 34];
312 longbytearray = [09 0a 0b 0c];
313 stringval = "message2";
314 stringarray = "another", "multi-word", "message";
315 };
316
317 spl-test3 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700318 bootph-pre-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600319 compatible = "sandbox,spl-test";
320 stringarray = "one";
Simon Glass43118322021-07-28 19:23:11 -0600321 maybe-empty-int = <1>;
Simon Glass28db4692019-05-18 11:59:41 -0600322 };
323
Patrick Delaunayae84ff12019-05-21 19:19:11 +0200324 spl-test5 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700325 bootph-verify;
Patrick Delaunayae84ff12019-05-21 19:19:11 +0200326 compatible = "sandbox,spl-test";
327 stringarray = "tpl";
328 };
329
330 spl-test6 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700331 bootph-some-ram;
Patrick Delaunayae84ff12019-05-21 19:19:11 +0200332 compatible = "sandbox,spl-test";
333 stringarray = "pre-proper";
334 };
335
Simon Glass77faa972021-03-15 17:25:31 +1300336 spl-test7 {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700337 bootph-pre-ram;
Simon Glass77faa972021-03-15 17:25:31 +1300338 compatible = "sandbox,spl-test";
339 stringarray = "spl";
Patrick Delaunayae84ff12019-05-21 19:19:11 +0200340 };
341
Simon Glass28db4692019-05-18 11:59:41 -0600342 square {
343 compatible = "demo-shape";
344 colour = "blue";
345 sides = <4>;
346 };
347
348 timer {
349 compatible = "sandbox,timer";
350 clock-frequency = <1000000>;
351 };
352
353 tpm {
Simon Glass28db4692019-05-18 11:59:41 -0600354 compatible = "google,sandbox-tpm";
355 };
356
357 tpm2 {
358 compatible = "sandbox,tpm2";
Eddie James1a55a7a2023-10-24 10:43:51 -0500359 memory-region = <&event_log>;
Simon Glass28db4692019-05-18 11:59:41 -0600360 };
361
362 triangle {
363 compatible = "demo-shape";
364 colour = "cyan";
365 sides = <3>;
366 character = <83>;
367 light-gpios = <&gpio_a 2>, <&gpio_b 6 0>;
368 };
369
370 /* Needs to be available prior to relocation */
371 uart0: serial {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700372 bootph-pre-ram;
373 bootph-pre-sram;
374 bootph-verify;
Simon Glass28db4692019-05-18 11:59:41 -0600375 compatible = "sandbox,serial";
376 sandbox,text-colour = "cyan";
377 pinctrl-names = "default";
378 pinctrl-0 = <&pinctrl_serial0>;
379 };
380
381 usb@0 {
382 compatible = "sandbox,usb";
383 status = "disabled";
384 hub {
385 compatible = "sandbox,usb-hub";
386 #address-cells = <1>;
387 #size-cells = <0>;
388 flash-stick {
389 reg = <0>;
390 compatible = "sandbox,usb-flash";
391 };
392 };
393 };
394
395 usb@1 {
396 compatible = "sandbox,usb";
397 hub {
398 compatible = "usb-hub";
399 usb,device-class = <USB_CLASS_HUB>;
400 hub-emul {
401 compatible = "sandbox,usb-hub";
402 #address-cells = <1>;
403 #size-cells = <0>;
404 flash-stick {
405 reg = <0>;
406 compatible = "sandbox,usb-flash";
407 sandbox,filepath = "flash.bin";
408 };
409 };
410 };
411 };
412
413 usb@2 {
414 compatible = "sandbox,usb";
415 status = "disabled";
416 };
417
418 spmi: spmi@0 {
419 compatible = "sandbox,spmi";
420 #address-cells = <0x1>;
421 #size-cells = <0x1>;
422 pm8916@0 {
423 compatible = "qcom,spmi-pmic";
Caleb Connolly27cdaab2024-02-26 17:26:16 +0000424 reg = <0x0 0x0>;
Simon Glass28db4692019-05-18 11:59:41 -0600425 #address-cells = <0x1>;
Caleb Connolly27cdaab2024-02-26 17:26:16 +0000426 #size-cells = <0x0>;
Simon Glass28db4692019-05-18 11:59:41 -0600427
428 spmi_gpios: gpios@c000 {
429 compatible = "qcom,pm8916-gpio";
Caleb Connolly27cdaab2024-02-26 17:26:16 +0000430 reg = <0xc000>;
Simon Glass28db4692019-05-18 11:59:41 -0600431 gpio-controller;
Caleb Connolly27cdaab2024-02-26 17:26:16 +0000432 gpio-ranges = <&spmi_gpios 0 0 4>;
Simon Glass28db4692019-05-18 11:59:41 -0600433 #gpio-cells = <2>;
Simon Glass28db4692019-05-18 11:59:41 -0600434 };
435 };
436 };
437
438 axi: axi@0 {
439 compatible = "sandbox,axi";
440 #address-cells = <0x1>;
441 #size-cells = <0x1>;
442 store@0 {
443 compatible = "sandbox,sandbox_store";
444 reg = <0x0 0x400>;
445 };
446 };
447
448 onewire0: onewire {
449 compatible = "w1-gpio";
450 gpios = <&gpio_a 8>;
451 pinctrl-names = "default";
452 pinctrl-0 = <&pinctrl_onewire0>;
453 status = "okay";
454
455 sandbox_eeprom0: sandbox_eeprom@0 {
456 compatible = "sandbox,w1-eeprom";
457 status = "okay";
458 };
459 };
460
461 sandbox_tee {
462 compatible = "sandbox,tee";
463 };
Robert Marko9cf87122022-09-06 13:30:35 +0200464
465 thermal {
466 compatible = "sandbox,thermal";
467 };
Abdellatif El Khlifi4970d5b2023-08-04 14:33:41 +0100468
469 arm-ffa-emul {
470 compatible = "sandbox,arm-ffa-emul";
471
472 sandbox-arm-ffa {
473 compatible = "sandbox,arm-ffa";
474 };
475 };
476
Simon Glass28db4692019-05-18 11:59:41 -0600477};
478
479&cros_ec {
480 /*
481 * This describes the flash memory within the EC. Note
482 * that the STM32L flash erases to 0, not 0xff.
483 */
484 flash {
485 image-pos = <0x08000000>;
486 size = <0x20000>;
487 erase-value = <0>;
488
489 /* Information for sandbox */
490 ro {
491 image-pos = <0>;
492 size = <0xf000>;
493 };
494 wp-ro {
495 image-pos = <0xf000>;
496 size = <0x1000>;
497 };
498 rw {
499 image-pos = <0x10000>;
500 size = <0x10000>;
501 };
502 };
503
504 keyboard-controller {
Simon Glassd3a98cb2023-02-13 08:56:33 -0700505 bootph-some-ram;
Simon Glass28db4692019-05-18 11:59:41 -0600506 };
507};