1/* SPDX-License-Identifier: Apache-2.0 */
2
3/dts-v1/;
4
5#include <nxp/nxp_kw41z.dtsi>
6#include "frdm_kw41z-pinctrl.dtsi"
7#include <zephyr/dt-bindings/input/input-event-codes.h>
8
9/ {
10	model = "NXP Freedom KW41Z board";
11	compatible = "nxp,kw41z", "nxp,mkw41z4";
12
13	aliases {
14		led0 = &green_led;
15		led1 = &blue_led;
16		led2 = &red_led;
17		sw0 = &user_button_3;
18		sw1 = &user_button_4;
19		pwm-led0 = &blue_pwm_led;
20		pwm-led1 = &green_pwm_led;
21		pwm-led2 = &red_pwm_led;
22		blue-pwm-led = &blue_pwm_led;
23		green-pwm-led = &green_pwm_led;
24		red-pwm-led = &red_pwm_led;
25		magn0 = &fxos8700;
26		accel0 = &fxos8700;
27	};
28
29	chosen {
30		zephyr,sram = &sram0;
31		zephyr,flash = &flash0;
32		zephyr,console = &lpuart0;
33		zephyr,shell-uart = &lpuart0;
34		zephyr,ieee802154 = &ieee802154;
35		zephyr,code-partition = &slot0_partition;
36	};
37
38	leds {
39		compatible = "gpio-leds";
40		red_led: led_0 {
41			gpios = <&gpioc 1 GPIO_ACTIVE_LOW>;
42			label = "User LD1";
43		};
44		green_led: led_1 {
45			gpios = <&gpioa 19 GPIO_ACTIVE_LOW>;
46			label = "User LD2";
47		};
48		blue_led: led_2 {
49			gpios = <&gpioa 18 GPIO_ACTIVE_LOW>;
50			label = "User LD3";
51		};
52	};
53
54	pwmleds {
55		compatible = "pwm-leds";
56		blue_pwm_led: pwm_led_0 {
57			pwms = <&tpm2 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
58			label = "User PWM LD1";
59		};
60		green_pwm_led: pwm_led_1 {
61			pwms = <&tpm2 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
62			label = "User PWM LD2";
63		};
64		red_pwm_led: pwm_led_2 {
65			pwms = <&tpm0 2 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
66			label = "User PWM LD3";
67		};
68	};
69
70	gpio_keys {
71		compatible = "gpio-keys";
72		user_button_3: button_0 {
73			label = "User SW3";
74			gpios = <&gpioc 4 GPIO_ACTIVE_LOW>;
75			zephyr,code = <INPUT_KEY_0>;
76		};
77		user_button_4: button_1 {
78			label = "User SW4";
79			gpios = <&gpioc 5 GPIO_ACTIVE_LOW>;
80			zephyr,code = <INPUT_KEY_1>;
81		};
82	};
83
84	arduino_header: connector {
85		compatible = "arduino-header-r3";
86		#gpio-cells = <2>;
87		gpio-map-mask = <0xffffffff 0xffffffc0>;
88		gpio-map-pass-thru = <0 0x3f>;
89		gpio-map = /* A0 cannot be muxed as gpio */
90			   <1 0 &gpiob 18 0>,	/* A1 */
91			   <2 0 &gpiob 2 0>,	/* A2 */
92			   <3 0 &gpiob 3 0>,	/* A3 */
93			   <4 0 &gpiob 1 0>,	/* A4 */
94			   <6 0 &gpioc 6 0>,	/* D0 */
95			   <7 0 &gpioc 7 0>,	/* D1 */
96			   <8 0 &gpioc 19 0>,	/* D2 */
97			   <9 0 &gpioc 16 0>,	/* D3 */
98			   <10 0 &gpioc 4 0>,	/* D4 */
99			   <11 0 &gpioc 17 0>,	/* D5 */
100			   <12 0 &gpioc 18 0>,	/* D6 */
101			   <13 0 &gpioa 1 0>,	/* D7 */
102			   <14 0 &gpioa 0 0>,	/* D8 */
103			   <15 0 &gpioc 1 0>,	/* D9 */
104			   <16 0 &gpioa 19 0>,	/* D10 */
105			   <17 0 &gpioa 16 0>,	/* D11 */
106			   <18 0 &gpioa 17 0>,	/* D12 */
107			   <19 0 &gpioa 18 0>,	/* D13 */
108			   <20 0 &gpioc 3 0>,	/* D14 */
109			   <21 0 &gpioc 2 0>;	/* D15 */
110	};
111};
112
113&sim {
114	pllfll-select = <KINETIS_SIM_PLLFLLSEL_MCGPLLCLK>;
115	er32k-select = <KINETIS_SIM_ER32KSEL_OSC32KCLK>;
116};
117
118&adc0 {
119	status = "okay";
120	pinctrl-0 = <&adc0_default>;
121	pinctrl-names = "default";
122};
123
124&i2c1 {
125	status = "okay";
126	pinctrl-0 = <&i2c1_default>;
127	pinctrl-names = "default";
128
129	fxos8700: fxos8700@1f {
130		compatible = "nxp,fxos8700";
131		reg = <0x1f>;
132		int1-gpios = <&gpioc 1 GPIO_ACTIVE_LOW>;
133	};
134};
135
136&lpuart0 {
137	status = "okay";
138	pinctrl-0 = <&lpuart0_default>;
139	pinctrl-names = "default";
140	current-speed = <115200>;
141};
142
143&gpioa {
144	status = "okay";
145};
146
147&gpioc {
148	status = "okay";
149};
150
151&spi0 {
152	status = "okay";
153	pinctrl-0 = <&spi0_default>;
154	pinctrl-names = "default";
155};
156
157&tpm0 {
158	status = "okay";
159	pinctrl-0 = <&tpm0_default>;
160	pinctrl-names = "default";
161};
162
163&tpm1 {
164	status = "disabled";
165};
166
167&tpm2 {
168	status = "okay";
169	pinctrl-0 = <&tmp2_default>;
170	pinctrl-names = "default";
171};
172
173&ieee802154 {
174	status = "okay";
175};
176
177&flash0 {
178	partitions {
179		compatible = "fixed-partitions";
180		#address-cells = <1>;
181		#size-cells = <1>;
182		slot0_partition: partition@0 {
183			label = "image-0";
184			reg = <0x00000000 0x00070000>;
185		};
186		storage_partition: partition@700000 {
187			label = "storage";
188			reg = <0x00070000 0x00010000>;
189		};
190	};
191};
192