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