blob: 3a927b3de6d2d31b69d8fc7fbc1a3ce63932521a [file] [log] [blame]
Tom Burdick45c77832019-09-12 17:48:51 -05001/*
2 * Copyright (c) 2018 Prevas A/S
Andrej Butok26d56eb2024-06-04 15:47:48 +02003 * Copyright 2024 NXP
Tom Burdick45c77832019-09-12 17:48:51 -05004 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8/dts-v1/;
9
Andrej Butok26d56eb2024-06-04 15:47:48 +020010#include <nxp/nxp_k22fn512.dtsi>
Gerard Marull-Paretasdb508372022-05-06 10:56:39 +020011#include <zephyr/dt-bindings/pwm/pwm.h>
Daniel DeGrasse37089362022-02-28 15:45:28 -060012#include "frdm_k22f-pinctrl.dtsi"
Fabio Baltieri57e0da42023-08-03 10:52:22 +000013#include <zephyr/dt-bindings/input/input-event-codes.h>
Tom Burdick45c77832019-09-12 17:48:51 -050014
15/ {
16 model = "NXP Freedom MK22F board";
17 compatible = "nxp,mk22f12", "nxp,k22f", "nxp,k2x";
18
19 aliases {
Tom Burdick45c77832019-09-12 17:48:51 -050020 led0 = &green_led;
21 led1 = &blue_led;
22 led2 = &red_led;
23 sw0 = &user_button_3;
24 sw1 = &user_button_2;
Ryan Holleranb81173f2021-01-29 23:37:18 -060025 pwm-led0 = &green_pwm_led;
26 green-pwm-led = &green_pwm_led;
27 blue-pwm-led = &blue_pwm_led;
28 red-pwm-led = &red_pwm_led;
Maureen Helm64de6332022-06-29 16:15:53 -050029 magn0 = &fxos8700;
TOKITA Hiroshi8277efb2022-07-22 00:45:23 +090030 accel0 = &fxos8700;
Andrej Butok45116622024-10-03 16:08:54 +020031 mcuboot-button0 = &user_button_3;
Tom Burdick45c77832019-09-12 17:48:51 -050032 };
33
34 chosen {
35 zephyr,sram = &sram0;
36 zephyr,flash = &flash0;
37 zephyr,code-partition = &slot0_partition;
Andrej Butok7ff43f22024-08-30 12:43:29 +020038 zephyr,uart-mcumgr = &uart1;
Tom Burdick45c77832019-09-12 17:48:51 -050039 zephyr,console = &uart1;
40 zephyr,shell-uart = &uart1;
41 zephyr,uart-pipe = &uart1;
42 };
43
44 leds {
45 compatible = "gpio-leds";
46 red_led: led_0 {
47 gpios = <&gpioa 1 0>;
48 label = "User LD1";
49 };
50 green_led: led_1 {
51 gpios = <&gpioa 2 0>;
52 label = "User LD2";
53 };
54 blue_led: led_2 {
55 gpios = <&gpiod 5 0>;
56 label = "User LD3";
57 };
58 };
59
Ryan Holleranb81173f2021-01-29 23:37:18 -060060 pwmleds {
61 compatible = "pwm-leds";
62
63 red_pwm_led: red_pwm_led {
64 label = "red_led";
65 pwms = <&ftm0 6 15625000 PWM_POLARITY_INVERTED>;
66 };
67 green_pwm_led: green_pwm_led {
68 label = "green_led";
69 pwms = <&ftm0 7 15625000 PWM_POLARITY_INVERTED>;
70 };
71 blue_pwm_led: blue_pwm_led {
72 label = "blue_led";
73 pwms = <&ftm0 5 15625000 PWM_POLARITY_INVERTED>;
74 };
75 };
76
Tom Burdick45c77832019-09-12 17:48:51 -050077 gpio_keys {
78 compatible = "gpio-keys";
79 user_button_2: button_0 {
80 label = "User SW2";
Peter Bigot1237a142020-01-26 09:58:45 -060081 gpios = <&gpioc 1 GPIO_ACTIVE_LOW>;
Fabio Baltieri57e0da42023-08-03 10:52:22 +000082 zephyr,code = <INPUT_KEY_0>;
Tom Burdick45c77832019-09-12 17:48:51 -050083 };
84 user_button_3: button_1 {
85 label = "User SW3";
Peter Bigot1237a142020-01-26 09:58:45 -060086 gpios = <&gpiob 17 GPIO_ACTIVE_LOW>;
Fabio Baltieri57e0da42023-08-03 10:52:22 +000087 zephyr,code = <INPUT_KEY_1>;
Tom Burdick45c77832019-09-12 17:48:51 -050088 };
89 };
90
91 arduino_header: connector {
92 compatible = "arduino-header-r3";
93 #gpio-cells = <2>;
Peter Bigotf8bfc7e2019-10-16 08:56:13 -050094 gpio-map-mask = <0xffffffff 0xffffffc0>;
95 gpio-map-pass-thru = <0 0x3f>;
Tom Burdick45c77832019-09-12 17:48:51 -050096 gpio-map = <0 0 &gpiob 0 0>, /* A0 */
97 <1 0 &gpiob 1 0>, /* A1 */
98 <2 0 &gpioc 1 0>, /* A2 */
99 <3 0 &gpioc 2 0>, /* A3 */
100 <4 0 &gpiob 3 0>, /* A4 */
101 <5 0 &gpiob 2 0>, /* A5 */
102 <6 0 &gpiod 2 0>, /* D0 */
103 <7 0 &gpiod 3 0>, /* D1 */
104 <8 0 &gpiob 16 0>, /* D2 */
105 <9 0 &gpioa 2 0>, /* D3 */
106 <10 0 &gpioa 4 0>, /* D4 */
107 <11 0 &gpiob 18 0>, /* D5 */
108 <12 0 &gpioc 3 0>, /* D6 */
109 <13 0 &gpioc 6 0>, /* D7 */
110 <14 0 &gpiob 19 0>, /* D8 */
111 <15 0 &gpioa 1 0>, /* D9 */
112 <16 0 &gpiod 4 0>, /* D10 */
113 <17 0 &gpiod 6 0>, /* D11 */
114 <18 0 &gpiod 7 0>, /* D12 */
115 <19 0 &gpiod 5 0>, /* D13 */
116 <20 0 &gpioe 0 0>, /* D14 */
117 <21 0 &gpioe 1 0>; /* D15 */
118 };
119};
120
Nicolai Gludbc72b672020-07-02 14:14:18 +0200121&sim {
122 pllfll-select = <KINETIS_SIM_PLLFLLSEL_MCGPLLCLK>;
123 er32k-select = <KINETIS_SIM_ER32KSEL_RTC>;
124};
125
Tom Burdick45c77832019-09-12 17:48:51 -0500126&adc0 {
127 status = "okay";
128};
129
Mikkel Jakobsen9f45cb62021-03-02 11:10:50 +0100130&dac0 {
131 status = "okay";
132 voltage-reference = <2>;
133};
Ryan Holleranb9fdab42021-01-31 17:35:38 -0600134arduino_i2c: &i2c0 {
Tom Burdick45c77832019-09-12 17:48:51 -0500135 status = "okay";
Daniel DeGrasse37089362022-02-28 15:45:28 -0600136 pinctrl-0 = <&i2c0_default>;
Kumar Gala80981dc2021-09-16 17:15:41 -0500137 pinctrl-names = "default";
Tom Burdick45c77832019-09-12 17:48:51 -0500138
Maureen Helm64de6332022-06-29 16:15:53 -0500139 fxos8700: fxos8700@1c {
Tom Burdick45c77832019-09-12 17:48:51 -0500140 compatible = "nxp,fxos8700";
Ryan Holleran807d8aa2020-10-30 18:36:38 -0500141 reg = <0x1c>;
Maureen Helmcadbc962019-12-11 15:14:11 -0600142 int1-gpios = <&gpiod 0 GPIO_ACTIVE_LOW>;
143 int2-gpios = <&gpiod 1 GPIO_ACTIVE_LOW>;
Tom Burdick45c77832019-09-12 17:48:51 -0500144 };
145};
146
Kumar Galadcb22112021-04-02 12:30:51 -0500147
Tom Burdick45c77832019-09-12 17:48:51 -0500148arduino_spi: &spi0 {
149 status = "okay";
Daniel DeGrasse37089362022-02-28 15:45:28 -0600150 pinctrl-0 = <&spi0_default>;
Kumar Gala80981dc2021-09-16 17:15:41 -0500151 pinctrl-names = "default";
Tom Burdick45c77832019-09-12 17:48:51 -0500152};
153
Ryan Holleranb81173f2021-01-29 23:37:18 -0600154&ftm0 {
Tom Burdick45c77832019-09-12 17:48:51 -0500155 status = "okay";
Henrik Brix Andersen9ceb29a2020-04-19 22:36:45 +0200156 compatible = "nxp,kinetis-ftm-pwm";
157 #pwm-cells = <3>;
Daniel DeGrasse37089362022-02-28 15:45:28 -0600158 pinctrl-0 = <&ftm0_default>;
Kumar Gala80981dc2021-09-16 17:15:41 -0500159 pinctrl-names = "default";
Manuel Argüelles5d2670a2024-04-16 08:20:47 +0700160 clock-source = "fixed";
Tom Burdick45c77832019-09-12 17:48:51 -0500161};
162
163&uart1 {
164 status = "okay";
165 current-speed = <115200>;
Daniel DeGrasse37089362022-02-28 15:45:28 -0600166 pinctrl-0 = <&uart1_default>;
Kumar Gala80981dc2021-09-16 17:15:41 -0500167 pinctrl-names = "default";
Kumar Galadcb22112021-04-02 12:30:51 -0500168};
169
170&uart2 {
Daniel DeGrasse37089362022-02-28 15:45:28 -0600171 pinctrl-0 = <&uart2_default>;
Kumar Gala80981dc2021-09-16 17:15:41 -0500172 pinctrl-names = "default";
Tom Burdick45c77832019-09-12 17:48:51 -0500173};
174
Johann Fischere4f89472021-08-05 15:46:23 +0200175zephyr_udc0: &usbotg {
Tom Burdick45c77832019-09-12 17:48:51 -0500176 compatible = "nxp,kinetis-usbd";
177 status = "okay";
178 num-bidir-endpoints = <8>;
179};
180
Kumar Gala22e65cb2020-02-12 12:34:35 -0600181&gpioa {
182 status = "okay";
183};
184
185&gpiob {
186 status = "okay";
187};
188
189&gpioc {
190 status = "okay";
191};
192
193&gpiod {
194 status = "okay";
195};
196
197&gpioe {
198 status = "okay";
199};
200
Tom Burdick45c77832019-09-12 17:48:51 -0500201&flash0 {
Tom Burdick45c77832019-09-12 17:48:51 -0500202 partitions {
203 compatible = "fixed-partitions";
204 #address-cells = <1>;
205 #size-cells = <1>;
206
207 boot_partition: partition@0 {
208 label = "mcuboot";
Andrej Butok0da71232024-06-06 14:33:56 +0200209 reg = <0x00000000 DT_SIZE_K(64)>;
Tom Burdick45c77832019-09-12 17:48:51 -0500210 read-only;
211 };
Andrej Butok0da71232024-06-06 14:33:56 +0200212 /* The MCUBoot swap-move algorithm uses the last 3 sectors
213 * of the primary slot0 for swap status and move.
Andrej Butoka6912802023-12-11 13:15:49 +0100214 */
Tom Burdick45c77832019-09-12 17:48:51 -0500215 slot0_partition: partition@10000 {
216 label = "image-0";
Andrej Butok0da71232024-06-06 14:33:56 +0200217 reg = <0x00010000 (DT_SIZE_K(180) + DT_SIZE_K(6))>;
Tom Burdick45c77832019-09-12 17:48:51 -0500218 };
Andrej Butok0da71232024-06-06 14:33:56 +0200219 slot1_partition: partition@3E800 {
Tom Burdick45c77832019-09-12 17:48:51 -0500220 label = "image-1";
Andrej Butok0da71232024-06-06 14:33:56 +0200221 reg = <0x0003E800 DT_SIZE_K(180)>;
Tom Burdick45c77832019-09-12 17:48:51 -0500222 };
Andrej Butok0da71232024-06-06 14:33:56 +0200223 storage_partition: partition@6B800 {
Tom Burdick45c77832019-09-12 17:48:51 -0500224 label = "storage";
Andrej Butok0da71232024-06-06 14:33:56 +0200225 reg = <0x0006B800 DT_SIZE_K(82)>;
Tom Burdick45c77832019-09-12 17:48:51 -0500226 };
227
228 };
229};