Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 Prevas A/S |
Andrej Butok | 26d56eb | 2024-06-04 15:47:48 +0200 | [diff] [blame] | 3 | * Copyright 2024 NXP |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 4 | * |
| 5 | * SPDX-License-Identifier: Apache-2.0 |
| 6 | */ |
| 7 | |
| 8 | /dts-v1/; |
| 9 | |
Andrej Butok | 26d56eb | 2024-06-04 15:47:48 +0200 | [diff] [blame] | 10 | #include <nxp/nxp_k22fn512.dtsi> |
Gerard Marull-Paretas | db50837 | 2022-05-06 10:56:39 +0200 | [diff] [blame] | 11 | #include <zephyr/dt-bindings/pwm/pwm.h> |
Daniel DeGrasse | 3708936 | 2022-02-28 15:45:28 -0600 | [diff] [blame] | 12 | #include "frdm_k22f-pinctrl.dtsi" |
Fabio Baltieri | 57e0da4 | 2023-08-03 10:52:22 +0000 | [diff] [blame] | 13 | #include <zephyr/dt-bindings/input/input-event-codes.h> |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 14 | |
| 15 | / { |
| 16 | model = "NXP Freedom MK22F board"; |
| 17 | compatible = "nxp,mk22f12", "nxp,k22f", "nxp,k2x"; |
| 18 | |
| 19 | aliases { |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 20 | led0 = &green_led; |
| 21 | led1 = &blue_led; |
| 22 | led2 = &red_led; |
| 23 | sw0 = &user_button_3; |
| 24 | sw1 = &user_button_2; |
Ryan Holleran | b81173f | 2021-01-29 23:37:18 -0600 | [diff] [blame] | 25 | 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 Helm | 64de633 | 2022-06-29 16:15:53 -0500 | [diff] [blame] | 29 | magn0 = &fxos8700; |
TOKITA Hiroshi | 8277efb | 2022-07-22 00:45:23 +0900 | [diff] [blame] | 30 | accel0 = &fxos8700; |
Andrej Butok | 4511662 | 2024-10-03 16:08:54 +0200 | [diff] [blame] | 31 | mcuboot-button0 = &user_button_3; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 32 | }; |
| 33 | |
| 34 | chosen { |
| 35 | zephyr,sram = &sram0; |
| 36 | zephyr,flash = &flash0; |
| 37 | zephyr,code-partition = &slot0_partition; |
Andrej Butok | 7ff43f2 | 2024-08-30 12:43:29 +0200 | [diff] [blame] | 38 | zephyr,uart-mcumgr = &uart1; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 39 | 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 Holleran | b81173f | 2021-01-29 23:37:18 -0600 | [diff] [blame] | 60 | 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 Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 77 | gpio_keys { |
| 78 | compatible = "gpio-keys"; |
| 79 | user_button_2: button_0 { |
| 80 | label = "User SW2"; |
Peter Bigot | 1237a14 | 2020-01-26 09:58:45 -0600 | [diff] [blame] | 81 | gpios = <&gpioc 1 GPIO_ACTIVE_LOW>; |
Fabio Baltieri | 57e0da4 | 2023-08-03 10:52:22 +0000 | [diff] [blame] | 82 | zephyr,code = <INPUT_KEY_0>; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 83 | }; |
| 84 | user_button_3: button_1 { |
| 85 | label = "User SW3"; |
Peter Bigot | 1237a14 | 2020-01-26 09:58:45 -0600 | [diff] [blame] | 86 | gpios = <&gpiob 17 GPIO_ACTIVE_LOW>; |
Fabio Baltieri | 57e0da4 | 2023-08-03 10:52:22 +0000 | [diff] [blame] | 87 | zephyr,code = <INPUT_KEY_1>; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 88 | }; |
| 89 | }; |
| 90 | |
| 91 | arduino_header: connector { |
| 92 | compatible = "arduino-header-r3"; |
| 93 | #gpio-cells = <2>; |
Peter Bigot | f8bfc7e | 2019-10-16 08:56:13 -0500 | [diff] [blame] | 94 | gpio-map-mask = <0xffffffff 0xffffffc0>; |
| 95 | gpio-map-pass-thru = <0 0x3f>; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 96 | 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 Glud | bc72b67 | 2020-07-02 14:14:18 +0200 | [diff] [blame] | 121 | &sim { |
| 122 | pllfll-select = <KINETIS_SIM_PLLFLLSEL_MCGPLLCLK>; |
| 123 | er32k-select = <KINETIS_SIM_ER32KSEL_RTC>; |
| 124 | }; |
| 125 | |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 126 | &adc0 { |
| 127 | status = "okay"; |
| 128 | }; |
| 129 | |
Mikkel Jakobsen | 9f45cb6 | 2021-03-02 11:10:50 +0100 | [diff] [blame] | 130 | &dac0 { |
| 131 | status = "okay"; |
| 132 | voltage-reference = <2>; |
| 133 | }; |
Ryan Holleran | b9fdab4 | 2021-01-31 17:35:38 -0600 | [diff] [blame] | 134 | arduino_i2c: &i2c0 { |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 135 | status = "okay"; |
Daniel DeGrasse | 3708936 | 2022-02-28 15:45:28 -0600 | [diff] [blame] | 136 | pinctrl-0 = <&i2c0_default>; |
Kumar Gala | 80981dc | 2021-09-16 17:15:41 -0500 | [diff] [blame] | 137 | pinctrl-names = "default"; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 138 | |
Maureen Helm | 64de633 | 2022-06-29 16:15:53 -0500 | [diff] [blame] | 139 | fxos8700: fxos8700@1c { |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 140 | compatible = "nxp,fxos8700"; |
Ryan Holleran | 807d8aa | 2020-10-30 18:36:38 -0500 | [diff] [blame] | 141 | reg = <0x1c>; |
Maureen Helm | cadbc96 | 2019-12-11 15:14:11 -0600 | [diff] [blame] | 142 | int1-gpios = <&gpiod 0 GPIO_ACTIVE_LOW>; |
| 143 | int2-gpios = <&gpiod 1 GPIO_ACTIVE_LOW>; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 144 | }; |
| 145 | }; |
| 146 | |
Kumar Gala | dcb2211 | 2021-04-02 12:30:51 -0500 | [diff] [blame] | 147 | |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 148 | arduino_spi: &spi0 { |
| 149 | status = "okay"; |
Daniel DeGrasse | 3708936 | 2022-02-28 15:45:28 -0600 | [diff] [blame] | 150 | pinctrl-0 = <&spi0_default>; |
Kumar Gala | 80981dc | 2021-09-16 17:15:41 -0500 | [diff] [blame] | 151 | pinctrl-names = "default"; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 152 | }; |
| 153 | |
Ryan Holleran | b81173f | 2021-01-29 23:37:18 -0600 | [diff] [blame] | 154 | &ftm0 { |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 155 | status = "okay"; |
Henrik Brix Andersen | 9ceb29a | 2020-04-19 22:36:45 +0200 | [diff] [blame] | 156 | compatible = "nxp,kinetis-ftm-pwm"; |
| 157 | #pwm-cells = <3>; |
Daniel DeGrasse | 3708936 | 2022-02-28 15:45:28 -0600 | [diff] [blame] | 158 | pinctrl-0 = <&ftm0_default>; |
Kumar Gala | 80981dc | 2021-09-16 17:15:41 -0500 | [diff] [blame] | 159 | pinctrl-names = "default"; |
Manuel Argüelles | 5d2670a | 2024-04-16 08:20:47 +0700 | [diff] [blame] | 160 | clock-source = "fixed"; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 161 | }; |
| 162 | |
| 163 | &uart1 { |
| 164 | status = "okay"; |
| 165 | current-speed = <115200>; |
Daniel DeGrasse | 3708936 | 2022-02-28 15:45:28 -0600 | [diff] [blame] | 166 | pinctrl-0 = <&uart1_default>; |
Kumar Gala | 80981dc | 2021-09-16 17:15:41 -0500 | [diff] [blame] | 167 | pinctrl-names = "default"; |
Kumar Gala | dcb2211 | 2021-04-02 12:30:51 -0500 | [diff] [blame] | 168 | }; |
| 169 | |
| 170 | &uart2 { |
Daniel DeGrasse | 3708936 | 2022-02-28 15:45:28 -0600 | [diff] [blame] | 171 | pinctrl-0 = <&uart2_default>; |
Kumar Gala | 80981dc | 2021-09-16 17:15:41 -0500 | [diff] [blame] | 172 | pinctrl-names = "default"; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 173 | }; |
| 174 | |
Johann Fischer | e4f8947 | 2021-08-05 15:46:23 +0200 | [diff] [blame] | 175 | zephyr_udc0: &usbotg { |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 176 | compatible = "nxp,kinetis-usbd"; |
| 177 | status = "okay"; |
| 178 | num-bidir-endpoints = <8>; |
| 179 | }; |
| 180 | |
Kumar Gala | 22e65cb | 2020-02-12 12:34:35 -0600 | [diff] [blame] | 181 | &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 Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 201 | &flash0 { |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 202 | partitions { |
| 203 | compatible = "fixed-partitions"; |
| 204 | #address-cells = <1>; |
| 205 | #size-cells = <1>; |
| 206 | |
| 207 | boot_partition: partition@0 { |
| 208 | label = "mcuboot"; |
Andrej Butok | 0da7123 | 2024-06-06 14:33:56 +0200 | [diff] [blame] | 209 | reg = <0x00000000 DT_SIZE_K(64)>; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 210 | read-only; |
| 211 | }; |
Andrej Butok | 0da7123 | 2024-06-06 14:33:56 +0200 | [diff] [blame] | 212 | /* The MCUBoot swap-move algorithm uses the last 3 sectors |
| 213 | * of the primary slot0 for swap status and move. |
Andrej Butok | a691280 | 2023-12-11 13:15:49 +0100 | [diff] [blame] | 214 | */ |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 215 | slot0_partition: partition@10000 { |
| 216 | label = "image-0"; |
Andrej Butok | 0da7123 | 2024-06-06 14:33:56 +0200 | [diff] [blame] | 217 | reg = <0x00010000 (DT_SIZE_K(180) + DT_SIZE_K(6))>; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 218 | }; |
Andrej Butok | 0da7123 | 2024-06-06 14:33:56 +0200 | [diff] [blame] | 219 | slot1_partition: partition@3E800 { |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 220 | label = "image-1"; |
Andrej Butok | 0da7123 | 2024-06-06 14:33:56 +0200 | [diff] [blame] | 221 | reg = <0x0003E800 DT_SIZE_K(180)>; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 222 | }; |
Andrej Butok | 0da7123 | 2024-06-06 14:33:56 +0200 | [diff] [blame] | 223 | storage_partition: partition@6B800 { |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 224 | label = "storage"; |
Andrej Butok | 0da7123 | 2024-06-06 14:33:56 +0200 | [diff] [blame] | 225 | reg = <0x0006B800 DT_SIZE_K(82)>; |
Tom Burdick | 45c7783 | 2019-09-12 17:48:51 -0500 | [diff] [blame] | 226 | }; |
| 227 | |
| 228 | }; |
| 229 | }; |