1/*
2 * Copyright (c) 2021, NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include "mimxrt1160_evk-pinctrl.dtsi"
8#include <nxp/nxp_rt1160.dtsi>
9#include <zephyr/dt-bindings/input/input-event-codes.h>
10
11/ {
12	aliases {
13		led0 = &green_led;
14		sw0 = &user_button;
15		magn0 = &fxos8700;
16		accel0 = &fxos8700;
17		sdhc0 = &usdhc1;
18		mcuboot-button0 = &user_button;
19	};
20
21	leds {
22		compatible = "gpio-leds";
23		green_led: led-1 {
24			gpios = <&gpio9 3 GPIO_ACTIVE_LOW>;
25			label = "User LED D6";
26		};
27	};
28
29	gpio_keys {
30		compatible = "gpio-keys";
31		user_button: button-1 {
32			label = "User SW7";
33			gpios = <&gpio13 0 GPIO_ACTIVE_HIGH>;
34			zephyr,code = <INPUT_KEY_0>;
35		};
36	};
37
38	pwmleds {
39		compatible = "pwm-leds";
40
41		green_pwm_led: green_pwm_led {
42			pwms = <&flexpwm1_pwm2 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
43		};
44	};
45};
46
47&lpuart1 {
48	status = "okay";
49	current-speed = <115200>;
50	pinctrl-0 = <&pinmux_lpuart1>;
51	pinctrl-1 = <&pinmux_lpuart1_sleep>;
52	pinctrl-names = "default", "sleep";
53};
54
55&lpuart2 {
56	pinctrl-0 = <&pinmux_lpuart2>;
57	pinctrl-1 = <&pinmux_lpuart2_sleep>;
58	pinctrl-names = "default", "sleep";
59};
60
61&user_button {
62	status = "okay";
63};
64
65&green_led {
66	status = "okay";
67};
68
69&lpi2c5 {
70	status = "okay";
71	pinctrl-0 = <&pinmux_lpi2c5>;
72	pinctrl-names = "default";
73
74	fxos8700: fxos8700@1f {
75		compatible = "nxp,fxos8700";
76		reg = <0x1f>;
77
78		/* Two zero ohm resistors (R256 and R270) isolate sensor
79		 * interrupt gpios from the soc and are unpopulated by default.
80		 * Note that if you populate them, they conflict with camera and
81		 * ethernet PHY reset signals.
82		 */
83		int1-gpios = <&gpio11 14 GPIO_ACTIVE_LOW>;
84		int2-gpios = <&gpio11 15 GPIO_ACTIVE_LOW>;
85	};
86};
87
88&flexspi {
89	status = "okay";
90	ahb-prefetch;
91	ahb-read-addr-opt;
92	rx-clock-source = <1>;
93	reg = <0x400cc000 0x4000>, <0x30000000 DT_SIZE_M(16)>;
94	is25wp128: is25wp128@0 {
95		compatible = "nxp,imx-flexspi-nor";
96		size = <DT_SIZE_M(16*8)>;
97		reg = <0>;
98		spi-max-frequency = <104000000>;
99		status = "okay";
100		jedec-id = [9d 70 17];
101		erase-block-size = <4096>;
102		write-block-size = <1>;
103
104		partitions {
105			compatible = "fixed-partitions";
106			#address-cells = <1>;
107			#size-cells = <1>;
108			boot_partition: partition@0 {
109				label = "mcuboot";
110				reg = <0x00000000 DT_SIZE_K(128)>;
111			};
112			/* The MCUBoot swap-move algorithm uses the last 3 sectors
113			 * of the primary slot0 for swap status and move.
114			 */
115			slot0_partition: partition@20000 {
116				label = "image-0";
117				reg = <0x00020000 (DT_SIZE_M(7) + DT_SIZE_K(12))>;
118			};
119			slot1_partition: partition@723000 {
120				label = "image-1";
121				reg = <0x00723000 DT_SIZE_M(7)>;
122			};
123			storage_partition: partition@E23000 {
124				label = "storage";
125				reg = <0x00E23000 (DT_SIZE_M(2) - DT_SIZE_K(140))>;
126			};
127		};
128	};
129};
130
131&flexpwm1_pwm2 {
132	status = "okay";
133	pinctrl-0 = <&pinmux_flexpwm1>;
134	pinctrl-names = "default";
135};
136
137&enet_mac {
138	status = "okay";
139	pinctrl-0 = <&pinmux_enet>;
140	pinctrl-names = "default";
141	phy-handle = <&phy>;
142	phy-connection-type = "rmii";
143	zephyr,random-mac-address;
144};
145
146&enet_mdio {
147	status = "okay";
148	pinctrl-0 = <&pinmux_enet_mdio>;
149	pinctrl-names = "default";
150	phy: phy@0 {
151		compatible = "microchip,ksz8081";
152		reg = <0>;
153		status = "okay";
154		reset-gpios = <&gpio12 12 GPIO_ACTIVE_HIGH>;
155		int-gpios = <&gpio9 11 GPIO_ACTIVE_HIGH>;
156		microchip,interface-type = "rmii";
157	};
158};
159
160&enet_ptp_clock {
161	status = "okay";
162	pinctrl-0 = <&pinmux_ptp>;
163	pinctrl-names = "default";
164};
165
166&csi {
167	pinctrl-0 = <&pinmux_csi>;
168	pinctrl-names = "default";
169};
170
171&flexcan3 {
172	pinctrl-0 = <&pinmux_flexcan3>;
173	pinctrl-names = "default";
174};
175
176&lcdif {
177	pinctrl-0 = <&pinmux_lcdif>;
178	pinctrl-names = "default";
179};
180
181&lpi2c1 {
182	pinctrl-0 =<&pinmux_lpi2c1>;
183	pinctrl-names = "default";
184};
185
186&lpspi1 {
187	pinctrl-0 = <&pinmux_lpspi1>;
188	pinctrl-names = "default";
189};
190
191&lpuart2 {
192	pinctrl-0 = <&pinmux_lpuart2>;
193	pinctrl-1 = <&pinmux_lpuart2_sleep>;
194	pinctrl-names = "default", "sleep";
195};
196
197&sai1 {
198	pinctrl-0 = <&pinmux_sai1>;
199	pinctrl-names = "default";
200};
201
202&lpadc0 {
203	pinctrl-0 = <&pinmux_lpadc0>;
204	pinctrl-names = "default";
205};
206
207&flexspi {
208	pinctrl-0 = <&pinmux_flexspi1>;
209	pinctrl-names = "default";
210};
211
212&usdhc1 {
213	pinctrl-0 = <&pinmux_usdhc1>;
214	pinctrl-1 = <&pinmux_usdhc1_dat3_nopull>;
215	pinctrl-names = "default", "nopull";
216};
217