1/*
2 * Copyright 2024 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include "frdm_mcxn236-pinctrl.dtsi"
8#include <zephyr/dt-bindings/i2c/i2c.h>
9#include <zephyr/dt-bindings/input/input-event-codes.h>
10
11/ {
12	aliases{
13		led0 = &red_led;
14		led1 = &green_led;
15		led2 = &blue_led;
16		sw0 = &user_button_2;
17		sw1 = &user_button_3;
18	};
19
20	leds {
21		compatible = "gpio-leds";
22		green_led: led_1 {
23			gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
24			label = "Green LED";
25		};
26		blue_led: led_2 {
27			gpios = <&gpio4 17 GPIO_ACTIVE_LOW>;
28			label = "Blue LED";
29		};
30		red_led: led_3 {
31			gpios = <&gpio4 18 GPIO_ACTIVE_LOW>;
32			label = "Red LED";
33		};
34	};
35
36	gpio_keys {
37		compatible = "gpio-keys";
38		user_button_2: button_0 {
39			label = "User SW2";
40			gpios = <&gpio0 20 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
41			zephyr,code = <INPUT_KEY_WAKEUP>;
42		};
43		user_button_3: button_1 {
44			label = "User SW3";
45			gpios = <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
46			zephyr,code = <INPUT_KEY_0>;
47		};
48	};
49
50	/*
51	 * This node describes the GPIO pins of the LCD-PAR-S035 panel 8080 interface.
52	 */
53	nxp_lcd_8080_connector: lcd-8080-connector {
54		compatible = "nxp,lcd-8080";
55		#gpio-cells = <2>;
56		gpio-map-mask = <0xffffffff 0xffffffc0>;
57		gpio-map-pass-thru = <0 0x3f>;
58		gpio-map =	<9  0 &gpio0 23 0>,	/* Pin 9, LCD touch INT */
59				<10  0 &gpio4 6 0>,	/* Pin 10, LCD backlight control */
60				<11  0 &gpio4 7 0>;	/* Pin 11, LCD and touch reset */
61	};
62};
63
64&flexcomm2_lpuart2 {
65	current-speed = <115200>;
66	pinctrl-0 = <&pinmux_flexcomm2_lpuart>;
67	pinctrl-names = "default";
68};
69
70&flexcomm2_lpi2c2 {
71	pinctrl-0 = <&pinmux_flexcomm2_lpi2c>;
72	pinctrl-names = "default";
73	clock-frequency = <I2C_BITRATE_STANDARD>;
74};
75
76nxp_8080_touch_panel_i2c: &flexcomm2_lpi2c2 {
77	pinctrl-0 = <&pinmux_flexcomm2_lpi2c>;
78	pinctrl-names = "default";
79	clock-frequency = <I2C_BITRATE_STANDARD>;
80};
81
82&flexcomm3_lpspi3 {
83	pinctrl-0 = <&pinmux_flexcomm3_lpspi>;
84	pinctrl-names = "default";
85};
86
87&flexcomm4_lpuart4 {
88	current-speed = <115200>;
89	pinctrl-0 = <&pinmux_flexcomm4_lpuart>;
90	pinctrl-names = "default";
91};
92
93&flexcomm5_lpi2c5 {
94	pinctrl-0 = <&pinmux_flexcomm5_lpi2c>;
95	pinctrl-names = "default";
96	clock-frequency = <I2C_BITRATE_STANDARD>;
97};
98
99/*
100 * MCXN236 board uses OS timer as the kernel timer
101 * In case we need to switch to SYSTICK timer, then
102 * replace &os_timer with &systick
103 */
104&os_timer {
105	status = "disabled";
106};
107
108&systick {
109	status = "okay";
110};
111
112&flash {
113	partitions {
114		compatible = "fixed-partitions";
115		#address-cells = <1>;
116		#size-cells = <1>;
117
118		boot_partition: partition@0 {
119			label = "mcuboot";
120			reg = <0x00000000 DT_SIZE_K(64)>;
121		};
122		/* Note slot 0 has one additional sector,
123		 * this is intended for use with the swap move algorithm
124		 */
125		slot0_partition: partition@10000 {
126			label = "image-0";
127			reg = <0x00010000 DT_SIZE_K(480)>;
128		};
129		slot1_partition: partition@88000 {
130			label = "image-1";
131			reg = <0x0088000 DT_SIZE_K(472)>;
132		};
133	};
134};
135
136&flexpwm1_pwm0 {
137	pinctrl-0 = <&pinmux_flexpwm1_pwm0>;
138	pinctrl-names = "default";
139};
140
141&lpadc0 {
142	pinctrl-0 = <&pinmux_lpadc0>;
143	pinctrl-names = "default";
144};
145
146&lpcmp0 {
147	pinctrl-0 = <&pinmux_lpcmp0>;
148	pinctrl-names = "default";
149};
150
151&flexcan1 {
152	pinctrl-0 = <&pinmux_flexcan1>;
153	pinctrl-names = "default";
154};
155
156zephyr_mipi_dbi_parallel: &flexio0_lcd {
157	/* DMA channels 0, muxed to FlexIO TX */
158	dmas = <&edma0 0 61>;
159	dma-names = "tx";
160	shifters-count = <8>;
161	timers-count = <1>;
162	enwr-pin = <28>;
163	rd-pin = <27>;
164	data-pin-start = <4>;
165	reset-gpios = <&gpio4 7 GPIO_ACTIVE_HIGH>;
166	cs-gpios = <&gpio4 14 GPIO_ACTIVE_HIGH>;
167	rs-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
168	pinctrl-0 = <&pinmux_flexio_lcd>;
169	pinctrl-names = "default";
170};
171