1/*
2 * Copyright (c) ITE, All Rights Reserved
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6/dts-v1/;
7
8#include <zephyr/dt-bindings/gpio/gpio.h>
9#include <ite/it81xx2.dtsi>
10#include <ite/it8xxx2-pinctrl-map.dtsi>
11
12/ {
13	model = "IT8XXX2 EV-Board";
14	compatible = "ite,it8xxx2-evb";
15
16	aliases {
17		i2c-0 = &i2c0;
18		peci-0 = &peci0;
19		led0 = &led0;
20		kscan0 = &kscan_input;
21		watchdog0 = &twd0;
22		pwm-0 = &pwm0;
23	};
24
25	chosen {
26		zephyr,console = &uart1;
27		zephyr,shell-uart = &uart1;
28		zephyr,bt-hci = &bt_hci_uart;
29		zephyr,sram = &sram0;
30		zephyr,flash = &flash0;
31		zephyr,flash-controller = &flashctrl;
32		zephyr,code-partition = &slot0_partition;
33		zephyr,keyboard-scan = &kscan_input;
34	};
35
36	leds {
37		compatible = "gpio-leds";
38		led0: led_0 {
39			gpios = <&gpioc 0 GPIO_ACTIVE_HIGH>;
40			label = "Green LED";
41		};
42	};
43};
44&adc0 {
45	status = "okay";
46	pinctrl-0 = <&adc0_ch3_gpi3_default>;
47	pinctrl-names = "default";
48};
49/* voltage comparator for test */
50&vcmp0 {
51	status = "okay";
52	scan-period = <IT8XXX2_VCMP_SCAN_PERIOD_600US>;
53	comparison = <IT8XXX2_VCMP_GREATER>;
54	threshold-mv = <2000>;
55	io-channels = <&adc0 3>;
56};
57&i2c0 {
58	status = "okay";
59	clock-frequency = <I2C_BITRATE_STANDARD>;
60	pinctrl-0 = <&i2c0_clk_gpb3_default
61		     &i2c0_data_gpb4_default>;
62	pinctrl-names = "default";
63};
64&i2c1 {
65	status = "okay";
66	clock-frequency = <I2C_BITRATE_STANDARD>;
67	pinctrl-0 = <&i2c1_clk_gpc1_default
68		     &i2c1_data_gpc2_default>;
69	pinctrl-names = "default";
70};
71&i2c2 {
72	status = "okay";
73	clock-frequency = <I2C_BITRATE_STANDARD>;
74	pinctrl-0 = <&i2c2_clk_gpf6_default
75		     &i2c2_data_gpf7_default>;
76	pinctrl-names = "default";
77};
78&i2c3 {
79	status = "okay";
80	clock-frequency = <I2C_BITRATE_STANDARD>;
81	pinctrl-0 = <&i2c3_clk_gph1_default
82		     &i2c3_data_gph2_default>;
83	pinctrl-names = "default";
84};
85&i2c4 {
86	status = "okay";
87	clock-frequency = <I2C_BITRATE_STANDARD>;
88	pinctrl-0 = <&i2c4_clk_gpe0_default
89		     &i2c4_data_gpe7_default>;
90	pinctrl-names = "default";
91};
92&i2c5 {
93	status = "okay";
94	clock-frequency = <I2C_BITRATE_STANDARD>;
95	pinctrl-0 = <&i2c5_clk_gpa4_default
96		     &i2c5_data_gpa5_default>;
97	pinctrl-names = "default";
98};
99&uart1 {
100	status = "okay";
101	current-speed = <115200>;
102	clock-frequency = <1843200>;
103};
104&uart2 {
105	status = "okay";
106	current-speed = <460800>;
107	clock-frequency = <1843200>;
108
109	bt_hci_uart: bt_hci_uart {
110		compatible = "zephyr,bt-hci-uart";
111		status = "okay";
112	};
113};
114&ite_uart1_wrapper {
115	status = "okay";
116	pinctrl-0 = <&uart1_rx_gpb0_default
117		     &uart1_tx_gpb1_default>;
118	pinctrl-names = "default";
119};
120&ite_uart2_wrapper {
121	status = "okay";
122	pinctrl-0 = <&uart2_rx_gph1_default
123		     &uart2_tx_gph2_default>;
124	pinctrl-names = "default";
125};
126/* pwm for test */
127&pwm0 {
128	status = "okay";
129	prescaler-cx = <PWM_PRESCALER_C6>;
130	/*
131	 * If we need pwm output in ITE chip power saving mode,
132	 * then we should set frequency <=324Hz.
133	 */
134	pwm-output-frequency = <324>;
135	pinctrl-0 = <&pwm0_gpa0_default>;
136	pinctrl-names = "default";
137};
138/* pwm for fan */
139&pwm7 {
140	status = "okay";
141	prescaler-cx = <PWM_PRESCALER_C4>;
142	pwm-output-frequency = <30000>;
143	pinctrl-0 = <&pwm7_gpa7_default>;
144	pinctrl-names = "default";
145};
146/* fan tachometer sensor */
147&tach0 {
148	status = "okay";
149	channel = <IT8XXX2_TACH_CHANNEL_A>;
150	pulses-per-round = <2>;
151	pinctrl-0 = <&tach0a_gpd6_default>;
152	pinctrl-names = "default";
153};
154&kbd {
155	status = "okay";
156	pinctrl-0 = <&ksi0_default
157		     &ksi1_default
158		     &ksi2_default
159		     &ksi3_default
160		     &ksi4_default
161		     &ksi5_default
162		     &ksi6_default
163		     &ksi7_default
164		     &kso0_default
165		     &kso1_default
166		     &kso2_default
167		     &kso3_default
168		     &kso4_default
169		     &kso5_default
170		     &kso6_default
171		     &kso7_default
172		     &kso8_default
173		     &kso9_default
174		     &kso10_default
175		     &kso11_default
176		     &kso12_default
177		     &kso13_default
178		     &kso14_default
179		     &kso15_default>;
180	pinctrl-names = "default";
181	row-size = <8>;
182	col-size = <16>;
183
184	kscan_input: kscan-input {
185		compatible = "zephyr,kscan-input";
186	};
187};
188&peci0 {
189	status = "okay";
190	pinctrl-0 = <&peci_gpf6_default>;
191	pinctrl-names = "default";
192};
193&sha0 {
194	status = "okay";
195};
196&flash0 {
197	partitions {
198		compatible = "fixed-partitions";
199		#address-cells = <1>;
200		#size-cells = <1>;
201		boot_partition: partition@0 {
202			label = "mcuboot";
203			reg = <0x00000000 0x20000>;
204		};
205		slot0_partition: partition@20000 {
206			label = "image-0";
207			reg = <0x00020000 0x20000>;
208		};
209		slot1_partition: partition@40000 {
210			label = "image-1";
211			reg = <0x00040000 0x10000>;
212		};
213		scratch_partition: partition@50000 {
214			label = "image-scratch";
215			reg = <0x00050000 0x10000>;
216		};
217		storage_partition: partition@60000 {
218			label = "storage";
219			reg = <0x00060000 0x20000>;
220		};
221	};
222};
223