1/*
2 * Copyright (c) 2019 Jan Van Winkel (jan.van_winkel@dxplore.eu)
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <posix/posix.dtsi>
9#include <zephyr/dt-bindings/adc/adc.h>
10#include <zephyr/dt-bindings/i2c/i2c.h>
11#include <zephyr/dt-bindings/gpio/gpio.h>
12
13/ {
14	model = "Native Sim Board";
15	compatible = "zephyr,posix";
16
17	chosen {
18		zephyr,console = &uart0;
19		zephyr,shell-uart = &uart0;
20		zephyr,uart-mcumgr = &uart0;
21		zephyr,flash = &flash0;
22		zephyr,entropy = &rng;
23		zephyr,flash-controller = &flashcontroller0;
24		zephyr,display = &sdl_dc;
25		zephyr,canbus = &can_loopback0;
26		zephyr,code-partition = &slot0_partition;
27		zephyr,bt-hci = &bt_hci_userchan;
28		zephyr,touch = &input_sdl_touch;
29	};
30
31	aliases {
32		eeprom-0 = &eeprom0;
33		i2c-0 = &i2c0;
34		spi-0 = &spi0;
35		led0 = &led0;
36		rtc = &rtc;
37	};
38
39	leds {
40		compatible = "gpio-leds";
41		led0: led_0 {
42			gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
43			label = "Green LED";
44		};
45	};
46
47	lvgl_pointer {
48		compatible = "zephyr,lvgl-pointer-input";
49		input = <&input_sdl_touch>;
50	};
51
52	cpus {
53		#address-cells = <1>;
54		#size-cells = <0>;
55
56		cpu0: cpu@0 {
57			compatible = "zephyr,native-posix-cpu";
58			reg = <0>;
59		};
60	};
61
62	flashcontroller0: flash-controller@0 {
63		compatible = "zephyr,sim-flash";
64		reg = <0x00000000 DT_SIZE_K(2048)>;
65
66		#address-cells = <1>;
67		#size-cells = <1>;
68		erase-value = <0xff>;
69
70		flash0: flash@0 {
71			status = "okay";
72			compatible = "soc-nv-flash";
73			erase-block-size = <4096>;
74			write-block-size = <1>;
75			reg = <0x00000000 DT_SIZE_K(2048)>;
76
77			partitions {
78				compatible = "fixed-partitions";
79				#address-cells = <1>;
80				#size-cells = <1>;
81
82				boot_partition: partition@0 {
83					label = "mcuboot";
84					reg = <0x00000000 0x0000C000>;
85				};
86				slot0_partition: partition@c000 {
87					label = "image-0";
88					reg = <0x0000C000 0x00069000>;
89				};
90				slot1_partition: partition@75000 {
91					label = "image-1";
92					reg = <0x00075000 0x00069000>;
93				};
94				scratch_partition: partition@de000 {
95					label = "image-scratch";
96					reg = <0x000de000 0x0001e000>;
97				};
98				storage_partition: partition@fc000 {
99					label = "storage";
100					reg = <0x000fc000 0x00004000>;
101				};
102			};
103		};
104	};
105
106	eeprom0: eeprom {
107		status = "okay";
108		compatible = "zephyr,sim-eeprom";
109		size = <DT_SIZE_K(32)>;
110	};
111
112	i2c0: i2c@100 {
113		status = "okay";
114		compatible = "zephyr,i2c-emul-controller";
115		clock-frequency = <I2C_BITRATE_STANDARD>;
116		#address-cells = <1>;
117		#size-cells = <0>;
118		#forward-cells = <1>;
119		reg = <0x100 4>;
120	};
121
122	spi0: spi@200 {
123		status = "okay";
124		compatible = "zephyr,spi-emul-controller";
125		clock-frequency = <50000000>;
126		#address-cells = <1>;
127		#size-cells = <0>;
128		reg = <0x200 4>;
129	};
130
131	espi0: espi@300 {
132		status = "okay";
133		compatible = "zephyr,espi-emul-controller";
134		reg = <0x300 4>;
135		#address-cells = <1>;
136		#size-cells = <0>;
137	};
138
139	mspi0: mspi@400 {
140		status = "okay";
141		compatible = "zephyr,mspi-emul-controller";
142		clock-frequency = <250000000>;
143		reg = <0x400 4>;
144		#address-cells = <1>;
145		#size-cells = <0>;
146	};
147
148	uart0: uart {
149		status = "okay";
150		compatible = "zephyr,native-posix-uart";
151		/* Dummy current-speed entry to comply with serial
152		 * DTS binding
153		 */
154		current-speed = <0>;
155	};
156
157	uart1: uart_1 {
158		status = "okay";
159		compatible = "zephyr,native-posix-uart";
160		/* Dummy current-speed entry to comply with serial
161		 * DTS binding
162		 */
163		current-speed = <0>;
164	};
165
166	rng: rng {
167		status = "okay";
168		compatible = "zephyr,native-posix-rng";
169	};
170
171	counter0: counter {
172		status = "okay";
173		compatible = "zephyr,native-posix-counter";
174	};
175
176	gpio0: gpio_emul {
177		status = "okay";
178		compatible = "zephyr,gpio-emul";
179		rising-edge;
180		falling-edge;
181		high-level;
182		low-level;
183		gpio-controller;
184		#gpio-cells = <2>;
185	};
186
187	zephyr_udc0: udc0 {
188		compatible = "zephyr,native-posix-udc";
189	};
190
191	sdl_dc: sdl_dc {
192		compatible = "zephyr,sdl-dc";
193		height = <240>;
194		width = <320>;
195	};
196
197	input_sdl_touch: input-sdl-touch {
198		compatible = "zephyr,input-sdl-touch";
199	};
200
201	can_loopback0: can_loopback0 {
202		status = "okay";
203		compatible = "zephyr,can-loopback";
204	};
205
206	can0: can {
207		status = "disabled";
208		compatible = "zephyr,native-linux-can";
209		/* adjust zcan0 to desired host interface or create an alternative
210		 * name, e.g.: sudo ip link property add dev vcan0 altname zcan0
211		 */
212		host-interface = "zcan0";
213	};
214
215	rtc: rtc {
216		status = "okay";
217		compatible = "zephyr,rtc-emul";
218		alarms-count = <2>;
219	};
220
221	adc0: adc {
222		compatible = "zephyr,adc-emul";
223		nchannels = <2>;
224		#io-channel-cells = <1>;
225		status = "okay";
226	};
227
228	dma: dma {
229		compatible = "zephyr,dma-emul";
230		#dma-cells = <1>;
231		stack-size = <4096>;
232	};
233
234	bt_hci_userchan: bt_hci_userchan {
235		compatible = "zephyr,bt-hci-userchan";
236		status = "okay";
237	};
238};
239