1/*
2 * Copyright (c) 2022 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include "robokit1-pinctrl.dtsi"
8
9/ {
10	aliases {
11		led0 = &led_0;
12		magn0 = &akm09918c;
13		accel0 = &icm42688;
14		die-temp0 = &icm42688;
15		ambient-temp0 = &temp_sensor;
16	};
17
18	chosen {
19		zephyr,console = &uart2;
20		zephyr,shell-uart = &uart2;
21		zephyr,sram = &sram0;
22		zephyr,flash = &flash0;
23		zephyr,code-partition = &slot0_partition;
24	};
25
26	leds {
27		compatible = "gpio-leds";
28		led_0: led_0 {
29			gpios = <&pioa 11 GPIO_ACTIVE_HIGH>;
30			label = "User LED";
31		};
32		led_1: led_1 {
33			gpios = <&pioa 12 GPIO_ACTIVE_HIGH>;
34			label = "User LED";
35		};
36		led_2: led_2 {
37			gpios = <&pioa 13 GPIO_ACTIVE_HIGH>;
38			label = "User LED";
39		};
40		led_3: led_3 {
41			gpios = <&pioa 14 GPIO_ACTIVE_HIGH>;
42			label = "User LED";
43		};
44	};
45
46	temp_sensor: ambient_temp_sensor {
47		compatible = "epcos,b57861s0103a039";
48		io-channels = <&spi_adc 0>;
49		pullup-uv = <3300000>;
50		pullup-ohm = <0>;
51		pulldown-ohm = <10000>;
52		connected-positive;
53	};
54};
55
56&cpu0 {
57	clock-frequency = <300000000>;
58};
59
60&afec0 {
61	pinctrl-0 = <&afec0_default>;
62	pinctrl-names = "default";
63	status = "okay";
64};
65
66&dacc {
67	status = "okay";
68};
69
70&twihs0 {
71	pinctrl-0 = <&twihs0_default>;
72	pinctrl-names = "default";
73	status = "okay";
74};
75
76&twihs1 {
77	pinctrl-0 = <&twihs1_default>;
78	pinctrl-names = "default";
79	status = "okay";
80};
81
82&twihs2 {
83	pinctrl-0 = <&twihs2_default>;
84	pinctrl-names = "default";
85	status = "okay";
86	akm09918c: akm09918c@c {
87		compatible = "asahi-kasei,akm09918c";
88		reg = <0xc>;
89	};
90};
91
92#include <zephyr/dt-bindings/sensor/icm42688.h>
93
94&spi0 {
95	pinctrl-0 = <&spi0_default>;
96	pinctrl-names = "default";
97	dmas = <&xdmac 0 DMA_PERID_SPI0_TX>, <&xdmac 1 DMA_PERID_SPI0_RX>;
98	dma-names = "tx", "rx";
99	cs-gpios =<&pioa 31 GPIO_ACTIVE_LOW>,
100				<&pioc 31 GPIO_ACTIVE_LOW>;
101	status = "okay";
102
103	icm42688: icm42688p@0 {
104		compatible = "invensense,icm42688";
105		reg = <0>;
106		int-gpios = <&pioc 5 GPIO_ACTIVE_HIGH>;
107		spi-max-frequency = <24000000>;
108		accel-pwr-mode = <ICM42688_DT_ACCEL_LN>;
109		accel-odr = <ICM42688_DT_ACCEL_ODR_2000>;
110		accel-fs = <ICM42688_DT_ACCEL_FS_16>;
111		gyro-pwr-mode = <ICM42688_DT_GYRO_LN>;
112		gyro-odr = <ICM42688_DT_GYRO_ODR_2000>;
113		gyro-fs = <ICM42688_DT_GYRO_FS_2000>;
114	};
115	spi_adc: adc@1 {
116		compatible = "ti,ads7052";
117		reg = <1>;
118		#io-channel-cells = <1>;
119		#address-cells = <1>;
120		#size-cells = <0>;
121		spi-max-frequency = <24000000>;
122		channel@0 {
123			reg = <0>;
124			zephyr,gain = "ADC_GAIN_1";
125			zephyr,reference = "ADC_REF_VDD_1";
126			zephyr,vref-mv = <3300>;
127			zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
128			zephyr,resolution = <14>;
129		};
130	};
131};
132
133&spi1 {
134	pinctrl-0 = <&spi1_default>;
135	pinctrl-names = "default";
136	cs-gpios = <&pioc 25 GPIO_ACTIVE_LOW>;
137	status = "okay";
138};
139
140&uart0 {
141	current-speed = <115200>;
142	pinctrl-0 = <&uart0_default>;
143	pinctrl-names = "default";
144	status = "okay";
145};
146
147&uart1 {
148	current-speed = <115200>;
149	pinctrl-0 = <&uart1_default>;
150	pinctrl-names = "default";
151	status = "okay";
152};
153
154&uart2 {
155	current-speed = <115200>;
156	pinctrl-0 = <&uart2_default>;
157	pinctrl-names = "default";
158	status = "okay";
159};
160
161&usart2 {
162	current-speed = <115200>;
163	pinctrl-0 = <&usart2_default>;
164	pinctrl-names = "default";
165	status = "okay";
166};
167
168&wdt {
169	status = "okay";
170};
171
172zephyr_udc0: &usbhs {
173	status = "okay";
174};
175
176&mdio {
177	pinctrl-0 = <&mdio_default>;
178	pinctrl-names = "default";
179	status = "okay";
180};
181
182&pwm0 {
183	pinctrl-0 = <&pwm_default>;
184	pinctrl-names = "default";
185	status = "okay";
186};
187
188
189&xdmac {
190	status = "okay";
191};
192
193&flash0 {
194	partitions {
195		compatible = "fixed-partitions";
196		#address-cells = <1>;
197		#size-cells = <1>;
198
199		/*
200		 * The first half of sector 0 (64 kbytes)
201		 * is reserved for the bootloader
202		 */
203		boot_partition: partition@0 {
204			label = "mcuboot";
205			reg = <0x0 0x00010000>;
206			read-only;
207		};
208
209		/* From sector 1 to sector 7 (included): slot0 (896 kbytes) */
210		slot0_partition: partition@20000 {
211			label = "image-0";
212			reg = <0x00020000 0x000e0000>;
213		};
214
215		/* From sector 8 to sector 14 (included): slot1 (896 kbytes) */
216		slot1_partition: partition@100000 {
217			label = "image-1";
218			reg = <0x00100000 0x000e0000>;
219		};
220
221		/* Sector 15: scratch (128 kbytes) */
222		scratch_partition: partition@1e0000 {
223			label = "image-scratch";
224			reg = <0x001e0000 0x00020000>;
225		};
226	};
227};
228