blob: 1fc9c9bdfc78669b703fc62d1ac9a817377bf06d [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
7#define USB_CLASS_HUB 9
8
9/ {
10 chosen {
11 stdout-path = "/serial";
12 };
13
14 audio: audio-codec {
15 compatible = "sandbox,audio-codec";
16 #sound-dai-cells = <1>;
17 };
18
Philippe Reynesf56bf0a2020-07-24 18:19:48 +020019 buttons {
20 compatible = "gpio-keys";
21
Heinrich Schuchardt57c2fc62020-09-14 12:50:54 +020022 btn1 {
Philippe Reynesf56bf0a2020-07-24 18:19:48 +020023 gpios = <&gpio_a 3 0>;
Heinrich Schuchardt57c2fc62020-09-14 12:50:54 +020024 label = "button1";
Philippe Reynesf56bf0a2020-07-24 18:19:48 +020025 };
26
Heinrich Schuchardt57c2fc62020-09-14 12:50:54 +020027 btn2 {
Philippe Reynesf56bf0a2020-07-24 18:19:48 +020028 gpios = <&gpio_a 4 0>;
Heinrich Schuchardt57c2fc62020-09-14 12:50:54 +020029 label = "button2";
Philippe Reynesf56bf0a2020-07-24 18:19:48 +020030 };
31 };
32
Simon Glass6b927b12020-10-03 11:31:32 -060033 clk_fixed: clk-fixed {
34 u-boot,dm-pre-reloc;
Simon Glass9bb88fb2021-03-15 17:25:24 +130035 compatible = "sandbox,fixed-clock";
Simon Glass6b927b12020-10-03 11:31:32 -060036 #clock-cells = <0>;
37 clock-frequency = <1234>;
38 };
39
40 clk_sandbox: clk-sbox {
41 u-boot,dm-pre-reloc;
42 compatible = "sandbox,clk";
43 #clock-cells = <1>;
44 assigned-clocks = <&clk_sandbox 3>;
45 assigned-clock-rates = <321>;
46 };
47
48 clk-test {
49 u-boot,dm-pre-reloc;
50 compatible = "sandbox,clk-test";
51 clocks = <&clk_fixed>,
52 <&clk_sandbox 1>,
53 <&clk_sandbox 0>,
54 <&clk_sandbox 3>,
55 <&clk_sandbox 2>;
56 clock-names = "fixed", "i2c", "spi", "uart2", "uart1";
57 };
58
Simon Glass28db4692019-05-18 11:59:41 -060059 gpio_a: gpios@0 {
Simon Glasse98524a2020-12-19 10:39:56 -070060 u-boot,dm-pre-proper;
Simon Glass28db4692019-05-18 11:59:41 -060061 gpio-controller;
62 compatible = "sandbox,gpio";
63 #gpio-cells = <1>;
64 gpio-bank-name = "a";
65 sandbox,gpio-count = <20>;
66 };
67
68 gpio_b: gpios@1 {
Simon Glasse98524a2020-12-19 10:39:56 -070069 u-boot,dm-pre-proper;
Simon Glass28db4692019-05-18 11:59:41 -060070 gpio-controller;
71 compatible = "sandbox,gpio";
72 #gpio-cells = <2>;
73 gpio-bank-name = "b";
74 sandbox,gpio-count = <10>;
75 };
76
77 hexagon {
78 compatible = "demo-simple";
79 colour = "white";
80 sides = <6>;
81 };
82
83 i2c_0: i2c@0 {
84 eeprom@2c {
85 reg = <0x2c>;
86 compatible = "i2c-eeprom";
87 sandbox,emul = <&emul_eeprom>;
88 };
89
90 rtc_0: rtc@43 {
91 reg = <0x43>;
92 compatible = "sandbox-rtc";
93 sandbox,emul = <&emul0>;
Simon Glass4d4558e2020-10-03 11:31:36 -060094 u-boot,dm-pre-reloc;
Simon Glass28db4692019-05-18 11:59:41 -060095 };
96 sandbox_pmic: sandbox_pmic {
97 reg = <0x40>;
98 };
99
100 mc34708: pmic@41 {
101 reg = <0x41>;
102 };
103
104 i2c_emul: emul {
Simon Glass9db623b2021-02-03 06:01:16 -0700105 u-boot,dm-pre-reloc;
Simon Glass28db4692019-05-18 11:59:41 -0600106 reg = <0xff>;
107 compatible = "sandbox,i2c-emul-parent";
108 emul_eeprom: emul-eeprom {
109 compatible = "sandbox,i2c-eeprom";
110 sandbox,filename = "i2c.bin";
111 sandbox,size = <256>;
Simon Glass9db623b2021-02-03 06:01:16 -0700112 #emul-cells = <0>;
Simon Glass28db4692019-05-18 11:59:41 -0600113 };
114 emul0: emul0 {
Simon Glass9db623b2021-02-03 06:01:16 -0700115 u-boot,dm-pre-reloc;
116 compatible = "sandbox,i2c-rtc-emul";
117 #emul-cells = <0>;
Simon Glass28db4692019-05-18 11:59:41 -0600118 };
119 };
120 };
121
122 i2s: i2s {
123 compatible = "sandbox,i2s";
124 #sound-dai-cells = <1>;
125 };
126
Simon Glasse7995f72021-08-07 07:24:11 -0600127 irq_sandbox: irq-sbox {
128 u-boot,dm-spl;
129 compatible = "sandbox,irq";
130 interrupt-controller;
131 #interrupt-cells = <2>;
132 };
133
134 irq-test {
135 u-boot,dm-spl;
136 compatible = "sandbox,irq-test";
137 interrupts-extended = <&irq_sandbox 3 0>;
138 };
139
Simon Glass28db4692019-05-18 11:59:41 -0600140 lcd {
Simon Glasse98524a2020-12-19 10:39:56 -0700141 u-boot,dm-pre-proper;
Simon Glass28db4692019-05-18 11:59:41 -0600142 compatible = "sandbox,lcd-sdl";
143 xres = <1366>;
144 yres = <768>;
Simon Glassd2caf7b2020-02-03 07:36:14 -0700145 log2-depth = <5>;
Simon Glass28db4692019-05-18 11:59:41 -0600146 };
147
148 leds {
149 compatible = "gpio-leds";
150
151 iracibble {
152 gpios = <&gpio_a 1 0>;
153 label = "sandbox:red";
154 };
155
156 martinet {
157 gpios = <&gpio_a 2 0>;
158 label = "sandbox:green";
159 };
160 };
161
Tom Rini4a3ca482020-02-11 12:41:23 -0500162 pci@0 {
Simon Glass8c501022019-12-06 21:41:54 -0700163 pci@1e,0 {
164 compatible = "sandbox,pmc";
165 reg = <0xf000 0 0 0 0>;
166 sandbox,emul = <&pmc_emul>;
167 gpe0-dwx-mask = <0xf>;
168 gpe0-dwx-shift-base = <4>;
169 gpe0-dw = <6 7 9>;
170 gpe0-sts = <0x20>;
171 gpe0-en = <0x30>;
172 };
173
Simon Glass28db4692019-05-18 11:59:41 -0600174 pci@1f,0 {
175 compatible = "pci-generic";
176 reg = <0xf800 0 0 0 0>;
Simon Glassb98ba4c2019-09-25 08:56:10 -0600177 sandbox,emul = <&swap_case_emul>;
178 };
179 };
180
181 emul {
182 compatible = "sandbox,pci-emul-parent";
Simon Glass8c501022019-12-06 21:41:54 -0700183 pmc_emul: emul@1e,0 {
184 compatible = "sandbox,pmc-emul";
185 };
Simon Glassb98ba4c2019-09-25 08:56:10 -0600186 swap_case_emul: emul@1f,0 {
187 compatible = "sandbox,swap-case";
Simon Glass28db4692019-05-18 11:59:41 -0600188 };
189 };
190
191 pinctrl {
192 compatible = "sandbox,pinctrl";
193 status = "okay";
194
195 pinctrl_i2c0: i2c0 {
196 groups = "i2c";
197 function = "i2c";
198 bias-pull-up;
199 };
200
201 pinctrl_serial0: uart0 {
202 groups = "serial_a";
203 function = "serial";
204 };
205
206 pinctrl_onewire0: onewire0 {
207 groups = "w1";
208 function = "w1";
209 bias-pull-up;
210 };
211 };
212
213 reset@1 {
214 compatible = "sandbox,reset";
215 };
216
Vincent Stehlé53f6dc02021-03-10 15:33:30 +0100217 rng {
218 compatible = "sandbox,sandbox-rng";
219 };
220
Simon Glass28db4692019-05-18 11:59:41 -0600221 sound {
222 compatible = "sandbox,sound";
223 cpu {
224 sound-dai = <&i2s 0>;
225 };
226
227 codec {
228 sound-dai = <&audio 0>;
229 };
230 };
231
232 spi@0 {
233 firmware_storage_spi: flash@0 {
Simon Glasse98524a2020-12-19 10:39:56 -0700234 u-boot,dm-pre-proper;
Simon Glass28db4692019-05-18 11:59:41 -0600235 reg = <0>;
Simon Glass7e368682019-05-18 11:59:49 -0600236 compatible = "spansion,m25p16", "jedec,spi-nor";
Simon Glass28db4692019-05-18 11:59:41 -0600237 spi-max-frequency = <40000000>;
238 sandbox,filename = "spi.bin";
239 };
240 };
241
242 spl-test {
243 u-boot,dm-pre-reloc;
244 compatible = "sandbox,spl-test";
245 boolval;
246 intval = <1>;
247 intarray = <2 3 4>;
Simon Glass43118322021-07-28 19:23:11 -0600248 maybe-empty-int = <>;
Simon Glass28db4692019-05-18 11:59:41 -0600249 byteval = [05];
250 bytearray = [06];
251 longbytearray = [09 0a 0b 0c 0d 0e 0f 10 11];
252 stringval = "message";
253 stringarray = "multi-word", "message";
254 };
255
256 spl-test2 {
257 u-boot,dm-pre-reloc;
258 compatible = "sandbox,spl-test";
259 intval = <3>;
260 intarray = <5>;
261 byteval = [08];
262 bytearray = [01 23 34];
263 longbytearray = [09 0a 0b 0c];
264 stringval = "message2";
265 stringarray = "another", "multi-word", "message";
266 };
267
268 spl-test3 {
269 u-boot,dm-pre-reloc;
270 compatible = "sandbox,spl-test";
271 stringarray = "one";
Simon Glass43118322021-07-28 19:23:11 -0600272 maybe-empty-int = <1>;
Simon Glass28db4692019-05-18 11:59:41 -0600273 };
274
Patrick Delaunayae84ff12019-05-21 19:19:11 +0200275 spl-test5 {
276 u-boot,dm-tpl;
277 compatible = "sandbox,spl-test";
278 stringarray = "tpl";
279 };
280
281 spl-test6 {
282 u-boot,dm-pre-proper;
283 compatible = "sandbox,spl-test";
284 stringarray = "pre-proper";
285 };
286
Simon Glass77faa972021-03-15 17:25:31 +1300287 spl-test7 {
Patrick Delaunayae84ff12019-05-21 19:19:11 +0200288 u-boot,dm-spl;
Simon Glass77faa972021-03-15 17:25:31 +1300289 compatible = "sandbox,spl-test";
290 stringarray = "spl";
Patrick Delaunayae84ff12019-05-21 19:19:11 +0200291 };
292
Simon Glass28db4692019-05-18 11:59:41 -0600293 square {
294 compatible = "demo-shape";
295 colour = "blue";
296 sides = <4>;
297 };
298
299 timer {
300 compatible = "sandbox,timer";
301 clock-frequency = <1000000>;
302 };
303
304 tpm {
Simon Glass28db4692019-05-18 11:59:41 -0600305 compatible = "google,sandbox-tpm";
306 };
307
308 tpm2 {
309 compatible = "sandbox,tpm2";
310 };
311
312 triangle {
313 compatible = "demo-shape";
314 colour = "cyan";
315 sides = <3>;
316 character = <83>;
317 light-gpios = <&gpio_a 2>, <&gpio_b 6 0>;
318 };
319
320 /* Needs to be available prior to relocation */
321 uart0: serial {
322 u-boot,dm-spl;
323 compatible = "sandbox,serial";
324 sandbox,text-colour = "cyan";
325 pinctrl-names = "default";
326 pinctrl-0 = <&pinctrl_serial0>;
327 };
328
329 usb@0 {
330 compatible = "sandbox,usb";
331 status = "disabled";
332 hub {
333 compatible = "sandbox,usb-hub";
334 #address-cells = <1>;
335 #size-cells = <0>;
336 flash-stick {
337 reg = <0>;
338 compatible = "sandbox,usb-flash";
339 };
340 };
341 };
342
343 usb@1 {
344 compatible = "sandbox,usb";
345 hub {
346 compatible = "usb-hub";
347 usb,device-class = <USB_CLASS_HUB>;
348 hub-emul {
349 compatible = "sandbox,usb-hub";
350 #address-cells = <1>;
351 #size-cells = <0>;
352 flash-stick {
353 reg = <0>;
354 compatible = "sandbox,usb-flash";
355 sandbox,filepath = "flash.bin";
356 };
357 };
358 };
359 };
360
361 usb@2 {
362 compatible = "sandbox,usb";
363 status = "disabled";
364 };
365
366 spmi: spmi@0 {
367 compatible = "sandbox,spmi";
368 #address-cells = <0x1>;
369 #size-cells = <0x1>;
370 pm8916@0 {
371 compatible = "qcom,spmi-pmic";
372 reg = <0x0 0x1>;
373 #address-cells = <0x1>;
374 #size-cells = <0x1>;
375
376 spmi_gpios: gpios@c000 {
377 compatible = "qcom,pm8916-gpio";
378 reg = <0xc000 0x400>;
379 gpio-controller;
380 gpio-count = <4>;
381 #gpio-cells = <2>;
382 gpio-bank-name="spmi";
383 };
384 };
385 };
386
387 axi: axi@0 {
388 compatible = "sandbox,axi";
389 #address-cells = <0x1>;
390 #size-cells = <0x1>;
391 store@0 {
392 compatible = "sandbox,sandbox_store";
393 reg = <0x0 0x400>;
394 };
395 };
396
397 onewire0: onewire {
398 compatible = "w1-gpio";
399 gpios = <&gpio_a 8>;
400 pinctrl-names = "default";
401 pinctrl-0 = <&pinctrl_onewire0>;
402 status = "okay";
403
404 sandbox_eeprom0: sandbox_eeprom@0 {
405 compatible = "sandbox,w1-eeprom";
406 status = "okay";
407 };
408 };
409
410 sandbox_tee {
411 compatible = "sandbox,tee";
412 };
413};
414
415&cros_ec {
416 /*
417 * This describes the flash memory within the EC. Note
418 * that the STM32L flash erases to 0, not 0xff.
419 */
420 flash {
421 image-pos = <0x08000000>;
422 size = <0x20000>;
423 erase-value = <0>;
424
425 /* Information for sandbox */
426 ro {
427 image-pos = <0>;
428 size = <0xf000>;
429 };
430 wp-ro {
431 image-pos = <0xf000>;
432 size = <0x1000>;
433 };
434 rw {
435 image-pos = <0x10000>;
436 size = <0x10000>;
437 };
438 };
439
440 keyboard-controller {
Simon Glasse98524a2020-12-19 10:39:56 -0700441 u-boot,dm-pre-proper;
Simon Glass28db4692019-05-18 11:59:41 -0600442 };
443};