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