1/*
2 * Copyright 2023 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <zephyr/dt-bindings/gpio/gpio.h>
9#include <zephyr/dt-bindings/input/input-event-codes.h>
10#include <zephyr/dt-bindings/pwm/pwm.h>
11#include <arm/nxp/nxp_s32k146.dtsi>
12#include "ucans32k1sic-pinctrl.dtsi"
13
14/ {
15	model = "NXP UCANS32K1SIC";
16	compatible = "nxp,ucans32k1sic";
17
18	chosen {
19		zephyr,sram = &sram_l;
20		zephyr,flash = &flash0;
21		zephyr,console = &lpuart1;
22		zephyr,shell-uart = &lpuart1;
23		zephyr,uart-pipe = &lpuart1;
24		zephyr,canbus = &flexcan0;
25	};
26
27	aliases {
28		led0 = &led1_red;
29		led1 = &led1_green;
30		led2 = &led1_blue;
31		pwm-led0 = &led1_red_pwm;
32		pwm-led1 = &led1_green_pwm;
33		pwm-led2 = &led1_blue_pwm;
34		red-pwm-led = &led1_red_pwm;
35		green-pwm-led = &led1_green_pwm;
36		blue-pwm-led = &led1_blue_pwm;
37		pwm-0 = &ftm0;
38		sw0 = &button_3;
39		i2c-0 = &lpi2c0;
40	};
41
42	leds {
43		compatible = "gpio-leds";
44
45		led1_red: led_0 {
46			gpios = <&gpiod 15 GPIO_ACTIVE_LOW>;
47			label = "LED1_RGB_RED";
48		};
49		led1_green: led_1 {
50			gpios = <&gpiod 16 GPIO_ACTIVE_LOW>;
51			label = "LED1_RGB_GREEN";
52		};
53		led1_blue: led_2 {
54			gpios = <&gpiod 0 GPIO_ACTIVE_LOW>;
55			label = "LED1_RGB_BLUE";
56		};
57	};
58
59	pwmleds {
60		compatible = "pwm-leds";
61
62		led1_red_pwm: led_pwm_0 {
63			pwms = <&ftm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
64			label = "LED1_RGB_RED_PWM";
65		};
66		led1_green_pwm: led_pwm_1 {
67			pwms = <&ftm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
68			label = "LED1_RGB_GREEN_PWM";
69		};
70		led1_blue_pwm: led_pwm_2 {
71			pwms = <&ftm0 2 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
72			label = "LED1_RGB_BLUE_PWM";
73		};
74	};
75
76	gpio_keys {
77		compatible = "gpio-keys";
78
79		button_3: button_0 {
80			label = "SW3";
81			gpios = <&gpioc 14 GPIO_ACTIVE_LOW>;
82			zephyr,code = <INPUT_KEY_0>;
83		};
84	};
85
86	can_phy0: can-phy0 {
87		compatible = "nxp,tja1463", "nxp,tja1443", "nxp,tja1153", "can-transceiver-gpio";
88		enable-gpios = <&gpioa 10 GPIO_ACTIVE_HIGH>;
89		max-bitrate = <8000000>;
90		#phy-cells = <0>;
91	};
92
93	can_phy1: can-phy1 {
94		compatible = "nxp,tja1463", "nxp,tja1443", "nxp,tja1153", "can-transceiver-gpio";
95		enable-gpios = <&gpioe 2 GPIO_ACTIVE_HIGH>;
96		max-bitrate = <8000000>;
97		#phy-cells = <0>;
98	};
99};
100
101&cpu0 {
102	clock-frequency = <80000000>;
103};
104
105&gpioa {
106	status = "okay";
107};
108
109&gpiob {
110	status = "okay";
111};
112
113&gpioc {
114	status = "okay";
115};
116
117&gpiod {
118	status = "okay";
119};
120
121&gpioe {
122	status = "okay";
123};
124
125&lpuart0 {
126	pinctrl-0 = <&lpuart0_default>;
127	pinctrl-names = "default";
128	current-speed = <115200>;
129};
130
131&lpuart1 {
132	pinctrl-0 = <&lpuart1_default>;
133	pinctrl-names = "default";
134	current-speed = <115200>;
135	status = "okay";
136};
137
138&lpi2c0 {
139	pinctrl-0 = <&lpi2c0_default>;
140	pinctrl-names = "default";
141	scl-gpios = <&gpioa 3 GPIO_ACTIVE_HIGH>;
142	sda-gpios = <&gpioa 2 GPIO_ACTIVE_HIGH>;
143	status = "okay";
144};
145
146&lpspi0 {
147	pinctrl-0 = <&lpspi0_default>;
148	pinctrl-names = "default";
149	status = "okay";
150};
151
152&ftm0 {
153	compatible = "nxp,ftm-pwm";
154	pinctrl-0 = <&ftm0_default>;
155	pinctrl-names = "default";
156	clock-source = "system";
157	prescaler = <4>;
158	#pwm-cells = <3>;
159	status = "okay";
160};
161
162&ftm1 {
163	compatible = "nxp,ftm-pwm";
164	pinctrl-0 = <&ftm1_default>;
165	pinctrl-names = "default";
166	clock-source = "system";
167	prescaler = <4>;
168	#pwm-cells = <3>;
169	status = "okay";
170};
171
172&ftm2 {
173	compatible = "nxp,ftm-pwm";
174	pinctrl-0 = <&ftm2_default>;
175	pinctrl-names = "default";
176	clock-source = "system";
177	prescaler = <4>;
178	#pwm-cells = <3>;
179	status = "okay";
180};
181
182&flexcan0 {
183	pinctrl-0 = <&flexcan0_default>;
184	pinctrl-names = "default";
185	phys = <&can_phy0>;
186	status = "okay";
187};
188
189&flexcan1 {
190	pinctrl-0 = <&flexcan1_default>;
191	pinctrl-names = "default";
192	phys = <&can_phy1>;
193	status = "okay";
194};
195
196&adc0 {
197	sample-time = <65>;
198	vref-mv = <3300>;
199	status = "okay";
200};
201
202&adc1 {
203	sample-time = <65>;
204	vref-mv = <3300>;
205	status = "okay";
206};
207