blob: 6cf5f14cd11d2108a05b7320177f62e2f00202af [file] [log] [blame]
Simon Glass7dcc2f72021-08-18 21:40:25 -06001// SPDX-License-Identifier: GPL-2.0+
Simon Glassdc8c91a2019-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 Reynesbd3e4882020-07-24 18:19:48 +020019 buttons {
20 compatible = "gpio-keys";
21
Heinrich Schuchardt39916bb2020-09-14 12:50:54 +020022 btn1 {
Philippe Reynesbd3e4882020-07-24 18:19:48 +020023 gpios = <&gpio_a 3 0>;
Heinrich Schuchardt39916bb2020-09-14 12:50:54 +020024 label = "button1";
Philippe Reynesbd3e4882020-07-24 18:19:48 +020025 };
26
Heinrich Schuchardt39916bb2020-09-14 12:50:54 +020027 btn2 {
Philippe Reynesbd3e4882020-07-24 18:19:48 +020028 gpios = <&gpio_a 4 0>;
Heinrich Schuchardt39916bb2020-09-14 12:50:54 +020029 label = "button2";
Philippe Reynesbd3e4882020-07-24 18:19:48 +020030 };
31 };
32
Simon Glass88280522020-10-03 11:31:32 -060033 clk_fixed: clk-fixed {
34 u-boot,dm-pre-reloc;
Simon Glass88139862021-03-15 17:25:24 +130035 compatible = "sandbox,fixed-clock";
Simon Glass88280522020-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 Glassdc8c91a2019-05-18 11:59:41 -060059 gpio_a: gpios@0 {
Simon Glass370746a2020-12-19 10:39:56 -070060 u-boot,dm-pre-proper;
Simon Glassdc8c91a2019-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 Glass370746a2020-12-19 10:39:56 -070069 u-boot,dm-pre-proper;
Simon Glassdc8c91a2019-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 Glassfbe27a52020-10-03 11:31:36 -060094 u-boot,dm-pre-reloc;
Simon Glassdc8c91a2019-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 Glass23f40a32021-02-03 06:01:16 -0700105 u-boot,dm-pre-reloc;
Simon Glassdc8c91a2019-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 Glass23f40a32021-02-03 06:01:16 -0700112 #emul-cells = <0>;
Simon Glassdc8c91a2019-05-18 11:59:41 -0600113 };
114 emul0: emul0 {
Simon Glass23f40a32021-02-03 06:01:16 -0700115 u-boot,dm-pre-reloc;
116 compatible = "sandbox,i2c-rtc-emul";
117 #emul-cells = <0>;
Simon Glassdc8c91a2019-05-18 11:59:41 -0600118 };
119 };
120 };
121
122 i2s: i2s {
123 compatible = "sandbox,i2s";
124 #sound-dai-cells = <1>;
125 };
126
127 lcd {
Simon Glass370746a2020-12-19 10:39:56 -0700128 u-boot,dm-pre-proper;
Simon Glassdc8c91a2019-05-18 11:59:41 -0600129 compatible = "sandbox,lcd-sdl";
130 xres = <1366>;
131 yres = <768>;
Simon Glassa466db52020-02-03 07:36:14 -0700132 log2-depth = <5>;
Simon Glassdc8c91a2019-05-18 11:59:41 -0600133 };
134
135 leds {
136 compatible = "gpio-leds";
137
138 iracibble {
139 gpios = <&gpio_a 1 0>;
140 label = "sandbox:red";
141 };
142
143 martinet {
144 gpios = <&gpio_a 2 0>;
145 label = "sandbox:green";
146 };
147 };
148
Tom Rini42c64d12020-02-11 12:41:23 -0500149 pci@0 {
Simon Glass3b65ee32019-12-06 21:41:54 -0700150 pci@1e,0 {
151 compatible = "sandbox,pmc";
152 reg = <0xf000 0 0 0 0>;
153 sandbox,emul = <&pmc_emul>;
154 gpe0-dwx-mask = <0xf>;
155 gpe0-dwx-shift-base = <4>;
156 gpe0-dw = <6 7 9>;
157 gpe0-sts = <0x20>;
158 gpe0-en = <0x30>;
159 };
160
Simon Glassdc8c91a2019-05-18 11:59:41 -0600161 pci@1f,0 {
162 compatible = "pci-generic";
163 reg = <0xf800 0 0 0 0>;
Simon Glass9b69ba42019-09-25 08:56:10 -0600164 sandbox,emul = <&swap_case_emul>;
165 };
166 };
167
168 emul {
169 compatible = "sandbox,pci-emul-parent";
Simon Glass3b65ee32019-12-06 21:41:54 -0700170 pmc_emul: emul@1e,0 {
171 compatible = "sandbox,pmc-emul";
172 };
Simon Glass9b69ba42019-09-25 08:56:10 -0600173 swap_case_emul: emul@1f,0 {
174 compatible = "sandbox,swap-case";
Simon Glassdc8c91a2019-05-18 11:59:41 -0600175 };
176 };
177
178 pinctrl {
179 compatible = "sandbox,pinctrl";
180 status = "okay";
181
182 pinctrl_i2c0: i2c0 {
183 groups = "i2c";
184 function = "i2c";
185 bias-pull-up;
186 };
187
188 pinctrl_serial0: uart0 {
189 groups = "serial_a";
190 function = "serial";
191 };
192
193 pinctrl_onewire0: onewire0 {
194 groups = "w1";
195 function = "w1";
196 bias-pull-up;
197 };
198 };
199
200 reset@1 {
201 compatible = "sandbox,reset";
202 };
203
Vincent Stehlé619a8152021-03-10 15:33:30 +0100204 rng {
205 compatible = "sandbox,sandbox-rng";
206 };
207
Simon Glassdc8c91a2019-05-18 11:59:41 -0600208 sound {
209 compatible = "sandbox,sound";
210 cpu {
211 sound-dai = <&i2s 0>;
212 };
213
214 codec {
215 sound-dai = <&audio 0>;
216 };
217 };
218
219 spi@0 {
220 firmware_storage_spi: flash@0 {
Simon Glass370746a2020-12-19 10:39:56 -0700221 u-boot,dm-pre-proper;
Simon Glassdc8c91a2019-05-18 11:59:41 -0600222 reg = <0>;
Simon Glass24c27762019-05-18 11:59:49 -0600223 compatible = "spansion,m25p16", "jedec,spi-nor";
Simon Glassdc8c91a2019-05-18 11:59:41 -0600224 spi-max-frequency = <40000000>;
225 sandbox,filename = "spi.bin";
226 };
227 };
228
229 spl-test {
230 u-boot,dm-pre-reloc;
231 compatible = "sandbox,spl-test";
232 boolval;
233 intval = <1>;
234 intarray = <2 3 4>;
Simon Glasseec44c72021-07-28 19:23:11 -0600235 maybe-empty-int = <>;
Simon Glassdc8c91a2019-05-18 11:59:41 -0600236 byteval = [05];
237 bytearray = [06];
238 longbytearray = [09 0a 0b 0c 0d 0e 0f 10 11];
239 stringval = "message";
240 stringarray = "multi-word", "message";
241 };
242
243 spl-test2 {
244 u-boot,dm-pre-reloc;
245 compatible = "sandbox,spl-test";
246 intval = <3>;
247 intarray = <5>;
248 byteval = [08];
249 bytearray = [01 23 34];
250 longbytearray = [09 0a 0b 0c];
251 stringval = "message2";
252 stringarray = "another", "multi-word", "message";
253 };
254
255 spl-test3 {
256 u-boot,dm-pre-reloc;
257 compatible = "sandbox,spl-test";
258 stringarray = "one";
Simon Glasseec44c72021-07-28 19:23:11 -0600259 maybe-empty-int = <1>;
Simon Glassdc8c91a2019-05-18 11:59:41 -0600260 };
261
Patrick Delaunay099ed452019-05-21 19:19:11 +0200262 spl-test5 {
263 u-boot,dm-tpl;
264 compatible = "sandbox,spl-test";
265 stringarray = "tpl";
266 };
267
268 spl-test6 {
269 u-boot,dm-pre-proper;
270 compatible = "sandbox,spl-test";
271 stringarray = "pre-proper";
272 };
273
Simon Glass3a825d32021-03-15 17:25:31 +1300274 spl-test7 {
Patrick Delaunay099ed452019-05-21 19:19:11 +0200275 u-boot,dm-spl;
Simon Glass3a825d32021-03-15 17:25:31 +1300276 compatible = "sandbox,spl-test";
277 stringarray = "spl";
Patrick Delaunay099ed452019-05-21 19:19:11 +0200278 };
279
Simon Glassdc8c91a2019-05-18 11:59:41 -0600280 square {
281 compatible = "demo-shape";
282 colour = "blue";
283 sides = <4>;
284 };
285
286 timer {
287 compatible = "sandbox,timer";
288 clock-frequency = <1000000>;
289 };
290
291 tpm {
Simon Glassdc8c91a2019-05-18 11:59:41 -0600292 compatible = "google,sandbox-tpm";
293 };
294
295 tpm2 {
296 compatible = "sandbox,tpm2";
297 };
298
299 triangle {
300 compatible = "demo-shape";
301 colour = "cyan";
302 sides = <3>;
303 character = <83>;
304 light-gpios = <&gpio_a 2>, <&gpio_b 6 0>;
305 };
306
307 /* Needs to be available prior to relocation */
308 uart0: serial {
309 u-boot,dm-spl;
310 compatible = "sandbox,serial";
311 sandbox,text-colour = "cyan";
312 pinctrl-names = "default";
313 pinctrl-0 = <&pinctrl_serial0>;
314 };
315
316 usb@0 {
317 compatible = "sandbox,usb";
318 status = "disabled";
319 hub {
320 compatible = "sandbox,usb-hub";
321 #address-cells = <1>;
322 #size-cells = <0>;
323 flash-stick {
324 reg = <0>;
325 compatible = "sandbox,usb-flash";
326 };
327 };
328 };
329
330 usb@1 {
331 compatible = "sandbox,usb";
332 hub {
333 compatible = "usb-hub";
334 usb,device-class = <USB_CLASS_HUB>;
335 hub-emul {
336 compatible = "sandbox,usb-hub";
337 #address-cells = <1>;
338 #size-cells = <0>;
339 flash-stick {
340 reg = <0>;
341 compatible = "sandbox,usb-flash";
342 sandbox,filepath = "flash.bin";
343 };
344 };
345 };
346 };
347
348 usb@2 {
349 compatible = "sandbox,usb";
350 status = "disabled";
351 };
352
353 spmi: spmi@0 {
354 compatible = "sandbox,spmi";
355 #address-cells = <0x1>;
356 #size-cells = <0x1>;
357 pm8916@0 {
358 compatible = "qcom,spmi-pmic";
359 reg = <0x0 0x1>;
360 #address-cells = <0x1>;
361 #size-cells = <0x1>;
362
363 spmi_gpios: gpios@c000 {
364 compatible = "qcom,pm8916-gpio";
365 reg = <0xc000 0x400>;
366 gpio-controller;
367 gpio-count = <4>;
368 #gpio-cells = <2>;
369 gpio-bank-name="spmi";
370 };
371 };
372 };
373
374 axi: axi@0 {
375 compatible = "sandbox,axi";
376 #address-cells = <0x1>;
377 #size-cells = <0x1>;
378 store@0 {
379 compatible = "sandbox,sandbox_store";
380 reg = <0x0 0x400>;
381 };
382 };
383
384 onewire0: onewire {
385 compatible = "w1-gpio";
386 gpios = <&gpio_a 8>;
387 pinctrl-names = "default";
388 pinctrl-0 = <&pinctrl_onewire0>;
389 status = "okay";
390
391 sandbox_eeprom0: sandbox_eeprom@0 {
392 compatible = "sandbox,w1-eeprom";
393 status = "okay";
394 };
395 };
396
397 sandbox_tee {
398 compatible = "sandbox,tee";
399 };
400};
401
402&cros_ec {
403 /*
404 * This describes the flash memory within the EC. Note
405 * that the STM32L flash erases to 0, not 0xff.
406 */
407 flash {
408 image-pos = <0x08000000>;
409 size = <0x20000>;
410 erase-value = <0>;
411
412 /* Information for sandbox */
413 ro {
414 image-pos = <0>;
415 size = <0xf000>;
416 };
417 wp-ro {
418 image-pos = <0xf000>;
419 size = <0x1000>;
420 };
421 rw {
422 image-pos = <0x10000>;
423 size = <0x10000>;
424 };
425 };
426
427 keyboard-controller {
Simon Glass370746a2020-12-19 10:39:56 -0700428 u-boot,dm-pre-proper;
Simon Glassdc8c91a2019-05-18 11:59:41 -0600429 };
430};