1/* SPDX-License-Identifier: Apache-2.0 */
2
3/dts-v1/;
4
5#include <nxp/nxp_k6x.dtsi>
6#include "frdm_k64f-pinctrl.dtsi"
7#include <zephyr/dt-bindings/input/input-event-codes.h>
8
9/ {
10	model = "NXP Freedom MK64F board";
11	compatible = "nxp,mk64f12", "nxp,k64f", "nxp,k6x";
12
13	aliases {
14		led0 = &green_led;
15		led1 = &blue_led;
16		led2 = &red_led;
17		sw0 = &user_button_3;
18		sw1 = &user_button_2;
19		magn0 = &fxos8700;
20		accel0 = &fxos8700;
21		mcuboot-button0 = &user_button_2;
22	};
23
24	chosen {
25		zephyr,sram = &sram0;
26		zephyr,flash = &flash0;
27		zephyr,code-partition = &slot0_partition;
28		zephyr,console = &uart0;
29		zephyr,shell-uart = &uart0;
30		zephyr,uart-pipe = &uart0;
31		zephyr,canbus = &flexcan0;
32		zephyr,uart-mcumgr = &uart0;
33	};
34
35	leds {
36		compatible = "gpio-leds";
37		red_led: led_0 {
38			gpios = <&gpiob 22 GPIO_ACTIVE_LOW>;
39			label = "User LD1";
40		};
41		green_led: led_1 {
42			gpios = <&gpioe 26 GPIO_ACTIVE_LOW>;
43			label = "User LD2";
44		};
45		blue_led: led_2 {
46			gpios = <&gpiob 21 GPIO_ACTIVE_LOW>;
47			label = "User LD3";
48		};
49	};
50
51	gpio_keys {
52		compatible = "gpio-keys";
53		user_button_2: button_0 {
54			label = "User SW2";
55			gpios = <&gpioc 6 GPIO_ACTIVE_LOW>;
56			zephyr,code = <INPUT_KEY_0>;
57		};
58		user_button_3: button_1 {
59			label = "User SW3";
60			gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
61			zephyr,code = <INPUT_KEY_1>;
62		};
63	};
64
65	arduino_header: connector {
66		compatible = "arduino-header-r3";
67		#gpio-cells = <2>;
68		gpio-map-mask = <0xffffffff 0xffffffc0>;
69		gpio-map-pass-thru = <0 0x3f>;
70		gpio-map = <0 0 &gpiob 2 0>,	/* A0 */
71			   <1 0 &gpiob 3 0>,	/* A1 */
72			   <2 0 &gpiob 10 0>,	/* A2 */
73			   <3 0 &gpiob 11 0>,	/* A3 */
74			   <4 0 &gpioc 11 0>,	/* A4 */
75			   <5 0 &gpioc 10 0>,	/* A5 */
76			   <6 0 &gpioc 16 0>,	/* D0 */
77			   <7 0 &gpioc 17 0>,	/* D1 */
78			   <8 0 &gpiob 9 0>,	/* D2 */
79			   <9 0 &gpioa 1 0>,	/* D3 */
80			   <10 0 &gpiob 23 0>,	/* D4 */
81			   <11 0 &gpioa 2 0>,	/* D5 */
82			   <12 0 &gpioc 2 0>,	/* D6 */
83			   <13 0 &gpioc 3 0>,	/* D7 */
84			   /* NOTE: HW Rev D and below use: */
85			   /* <14 0 &gpioa 0 0>, */
86			   /* NOTE: HW Rev E and on use: */
87			   <14 0 &gpioc 12 0>,	/* D8 */
88			   <15 0 &gpioc 4 0>,	/* D9 */
89			   <16 0 &gpiod 0 0>,	/* D10 */
90			   <17 0 &gpiod 2 0>,	/* D11 */
91			   <18 0 &gpiod 3 0>,	/* D12 */
92			   <19 0 &gpiod 1 0>,	/* D13 */
93			   <20 0 &gpioe 25 0>,	/* D14 */
94			   <21 0 &gpioe 24 0>;	/* D15 */
95	};
96};
97
98&sim {
99	pllfll-select = <KINETIS_SIM_PLLFLLSEL_MCGPLLCLK>;
100	er32k-select = <KINETIS_SIM_ER32KSEL_RTC>;
101};
102
103arduino_serial: &uart3 {
104	status = "okay";
105	current-speed = <115200>;
106	pinctrl-0 = <&uart3_default>;
107	pinctrl-names = "default";
108};
109
110&cpu0 {
111	clock-frequency = <120000000>;
112};
113
114&adc0 {
115	status = "okay";
116	pinctrl-0 = <&adc0_default>;
117	pinctrl-names = "default";
118};
119
120&adc1 {
121	status = "okay";
122	pinctrl-0 = <&adc1_default>;
123	pinctrl-names = "default";
124};
125
126&temp1 {
127	status = "okay";
128};
129
130&dac0 {
131	status = "okay";
132	voltage-reference = <2>;
133};
134
135arduino_i2c: &i2c0 {
136	status = "okay";
137	pinctrl-0 = <&i2c0_default>;
138	pinctrl-names = "default";
139
140	fxos8700: fxos8700@1d {
141		compatible = "nxp,fxos8700";
142		reg = <0x1d>;
143		int1-gpios = <&gpioc 6 GPIO_ACTIVE_LOW>;
144		int2-gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
145	};
146};
147
148arduino_spi: &spi0 {
149	status = "okay";
150	pinctrl-0 = <&spi0_default>;
151	pinctrl-names = "default";
152};
153
154&spi1 {
155	status = "okay";
156	pinctrl-0 = <&spi1_default>;
157	pinctrl-names = "default";
158	cs-gpios = <&gpioe 4 GPIO_ACTIVE_LOW>;
159
160	sdhc0: sdhc@0 {
161		compatible = "zephyr,sdhc-spi-slot";
162		reg = <0>;
163		status = "okay";
164		sdmmc {
165			compatible = "zephyr,sdmmc-disk";
166			disk-name = "SD";
167			status = "okay";
168		};
169		spi-max-frequency = <24000000>;
170	};
171};
172
173&ftm0 {
174	status = "okay";
175	compatible = "nxp,ftm-pwm";
176	#pwm-cells = <3>;
177	pinctrl-0 = <&ftm0_default>;
178	pinctrl-names = "default";
179	clock-source = "fixed";
180};
181
182&ftm3 {
183	status = "okay";
184	compatible = "nxp,ftm-pwm";
185	#pwm-cells = <3>;
186	pinctrl-0 = <&ftm3_default>;
187	pinctrl-names = "default";
188	clock-source = "fixed";
189};
190
191&uart0 {
192	status = "okay";
193	current-speed = <115200>;
194	pinctrl-0 = <&uart0_default>;
195	pinctrl-names = "default";
196};
197
198&uart2 {
199	pinctrl-0 = <&uart2_default>;
200	pinctrl-names = "default";
201};
202
203zephyr_udc0: &usbotg {
204	compatible = "nxp,kinetis-usbd";
205	status = "okay";
206	num-bidir-endpoints = <8>;
207};
208
209&gpioa {
210	status = "okay";
211};
212
213&gpiob {
214	status = "okay";
215};
216
217&gpioc {
218	status = "okay";
219};
220
221&gpiod {
222	status = "okay";
223};
224
225&gpioe {
226	status = "okay";
227};
228
229&flash0 {
230
231	partitions {
232		compatible = "fixed-partitions";
233		#address-cells = <1>;
234		#size-cells = <1>;
235
236		boot_partition: partition@0 {
237			label = "mcuboot";
238			reg = <0x00000000 DT_SIZE_K(64)>;
239			read-only;
240		};
241		/* The MCUBoot swap-move algorithm uses the last 2 sectors
242		 * of the primary slot0 for swap status and move.
243		 */
244		slot0_partition: partition@10000 {
245			label = "image-0";
246			reg = <0x00010000 (DT_SIZE_K(416) + DT_SIZE_K(8))>;
247		};
248		slot1_partition: partition@7a000 {
249			label = "image-1";
250			reg = <0x0007a000 DT_SIZE_K(416)>;
251		};
252		storage_partition: partition@e2000 {
253			label = "storage";
254			reg = <0x000e2000 DT_SIZE_K(120)>;
255		};
256	};
257};
258
259&enet_mac {
260	status = "okay";
261	pinctrl-0 = <&pinmux_enet>;
262	pinctrl-names = "default";
263	phy-handle = <&phy>;
264	zephyr,random-mac-address;
265	phy-connection-type = "rmii";
266};
267
268
269&enet_mdio {
270	status = "okay";
271	pinctrl-0 = <&pinmux_enet_mdio>;
272	pinctrl-names = "default";
273	phy: phy@0 {
274		compatible = "microchip,ksz8081";
275		reg = <0>;
276		status = "okay";
277		microchip,interface-type = "rmii-25MHz";
278	};
279};
280
281&enet_ptp_clock {
282	status = "okay";
283	pinctrl-0 = <&pinmux_ptp>;
284	pinctrl-names = "default";
285};
286
287&flexcan0 {
288	status = "okay";
289	pinctrl-0 = <&flexcan0_default>;
290	pinctrl-names = "default";
291};
292
293&edma0 {
294	status = "okay";
295};
296
297&pit0 {
298	status = "okay";
299};
300