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	};
28
29	aliases {
30		eeprom-0 = &eeprom0;
31		i2c-0 = &i2c0;
32		spi-0 = &spi0;
33		led0 = &led0;
34		rtc = &rtc;
35	};
36
37	leds {
38		compatible = "gpio-leds";
39		led0: led_0 {
40			gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
41			label = "Green LED";
42		};
43	};
44
45	lvgl_pointer {
46		compatible = "zephyr,lvgl-pointer-input";
47		input = <&input_sdl_touch>;
48	};
49
50	cpus {
51		#address-cells = <1>;
52		#size-cells = <0>;
53
54		cpu0: cpu@0 {
55			compatible = "zephyr,native-sim-cpu";
56			reg = <0>;
57		};
58	};
59
60	flashcontroller0: flash-controller@0 {
61		compatible = "zephyr,sim-flash";
62		reg = <0x00000000 DT_SIZE_K(2048)>;
63
64		#address-cells = <1>;
65		#size-cells = <1>;
66		erase-value = <0xff>;
67
68		flash0: flash@0 {
69			status = "okay";
70			compatible = "soc-nv-flash";
71			erase-block-size = <4096>;
72			write-block-size = <1>;
73			reg = <0x00000000 DT_SIZE_K(2048)>;
74
75			partitions {
76				compatible = "fixed-partitions";
77				#address-cells = <1>;
78				#size-cells = <1>;
79
80				boot_partition: partition@0 {
81					label = "mcuboot";
82					reg = <0x00000000 0x0000C000>;
83				};
84				slot0_partition: partition@c000 {
85					label = "image-0";
86					reg = <0x0000C000 0x00069000>;
87				};
88				slot1_partition: partition@75000 {
89					label = "image-1";
90					reg = <0x00075000 0x00069000>;
91				};
92				scratch_partition: partition@de000 {
93					label = "image-scratch";
94					reg = <0x000de000 0x0001e000>;
95				};
96				storage_partition: partition@fc000 {
97					label = "storage";
98					reg = <0x000fc000 0x00004000>;
99				};
100			};
101		};
102	};
103
104	eeprom0: eeprom {
105		status = "okay";
106		compatible = "zephyr,sim-eeprom";
107		size = <DT_SIZE_K(32)>;
108	};
109
110	i2c0: i2c@100 {
111		status = "okay";
112		compatible = "zephyr,i2c-emul-controller";
113		clock-frequency = <I2C_BITRATE_STANDARD>;
114		#address-cells = <1>;
115		#size-cells = <0>;
116		reg = <0x100 4>;
117	};
118
119	spi0: spi@200 {
120		status = "okay";
121		compatible = "zephyr,spi-emul-controller";
122		clock-frequency = <50000000>;
123		#address-cells = <1>;
124		#size-cells = <0>;
125		reg = <0x200 4>;
126	};
127
128	espi0: espi@300 {
129		status = "okay";
130		compatible = "zephyr,espi-emul-controller";
131		reg = <0x300 4>;
132		#address-cells = <1>;
133		#size-cells = <0>;
134	};
135
136	uart0: uart {
137		status = "okay";
138		compatible = "zephyr,native-pty-uart";
139		/* Dummy current-speed entry to comply with serial
140		 * DTS binding
141		 */
142		current-speed = <0>;
143	};
144
145	uart1: uart_1 {
146		status = "okay";
147		compatible = "zephyr,native-pty-uart";
148		/* Dummy current-speed entry to comply with serial
149		 * DTS binding
150		 */
151		current-speed = <0>;
152	};
153
154	rng: rng {
155		status = "okay";
156		compatible = "zephyr,native-sim-rng";
157	};
158
159	counter0: counter {
160		status = "okay";
161		compatible = "zephyr,native-sim-counter";
162	};
163
164	gpio0: gpio@800 {
165		status = "okay";
166		compatible = "zephyr,gpio-emul";
167		reg = <0x800 0x4>;
168		rising-edge;
169		falling-edge;
170		high-level;
171		low-level;
172		gpio-controller;
173		#gpio-cells = <2>;
174	};
175
176	zephyr_udc0: udc0 {
177		compatible = "zephyr,native-posix-udc";
178	};
179
180	sdl_dc: sdl_dc {
181		compatible = "zephyr,sdl-dc";
182		height = <240>;
183		width = <320>;
184	};
185
186	input_sdl_touch: input-sdl-touch {
187		compatible = "zephyr,input-sdl-touch";
188	};
189
190	can_loopback0: can_loopback0 {
191		status = "okay";
192		compatible = "zephyr,can-loopback";
193	};
194
195	can0: can {
196		status = "disabled";
197		compatible = "zephyr,native-linux-can";
198		/* adjust zcan0 to desired host interface or create an alternative
199		 * name, e.g.: sudo ip link property add dev vcan0 altname zcan0
200		 */
201		host-interface = "zcan0";
202	};
203
204	rtc: rtc {
205		status = "okay";
206		compatible = "zephyr,rtc-emul";
207		alarms-count = <2>;
208	};
209
210	dma: dma {
211		compatible = "zephyr,dma-emul";
212		#dma-cells = <1>;
213		stack-size = <4096>;
214	};
215
216	added-by-native-one {
217	};
218};
219