|
| 1 | +/* |
| 2 | + * Copyright 2024 NXP |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + */ |
| 6 | + |
| 7 | +#include <mem.h> |
| 8 | +#include <arm/armv6-m.dtsi> |
| 9 | +#include <zephyr/dt-bindings/adc/adc.h> |
| 10 | +#include <zephyr/dt-bindings/clock/kinetis_sim.h> |
| 11 | +#include <zephyr/dt-bindings/clock/kinetis_mcg.h> |
| 12 | +#include <zephyr/dt-bindings/gpio/gpio.h> |
| 13 | +#include <zephyr/dt-bindings/i2c/i2c.h> |
| 14 | + |
| 15 | +/ { |
| 16 | + chosen { |
| 17 | + zephyr,flash-controller = &ftfa; |
| 18 | + }; |
| 19 | + |
| 20 | + cpus { |
| 21 | + #address-cells = <1>; |
| 22 | + #size-cells = <0>; |
| 23 | + |
| 24 | + cpu0: cpu@0 { |
| 25 | + device_type = "cpu"; |
| 26 | + compatible = "arm,cortex-m0+"; |
| 27 | + reg = <0>; |
| 28 | + }; |
| 29 | + }; |
| 30 | + |
| 31 | + sram0: memory@1FFFF000 { |
| 32 | + compatible = "mmio-sram"; |
| 33 | + }; |
| 34 | + |
| 35 | + /* Dummy pinctrl node, filled with pin mux options at board level */ |
| 36 | + pinctrl: pinctrl { |
| 37 | + compatible = "nxp,kinetis-pinctrl"; |
| 38 | + status = "okay"; |
| 39 | + }; |
| 40 | + |
| 41 | + clocks { |
| 42 | + osc: osc { |
| 43 | + compatible = "nxp,mcxc-osc"; |
| 44 | + #clock-cells = <0>; |
| 45 | + load-capacitance-picofarads = <0>; |
| 46 | + mode = "external"; |
| 47 | + }; |
| 48 | + }; |
| 49 | + |
| 50 | + soc { |
| 51 | + ftfa: flash-controller@40020000 { |
| 52 | + compatible = "nxp,kinetis-ftfa"; |
| 53 | + reg = <0x40020000 0x14>; |
| 54 | + interrupts = <5 0>; |
| 55 | + status = "disabled"; |
| 56 | + #address-cells = <1>; |
| 57 | + #size-cells = <1>; |
| 58 | + fsec = <0xff>; |
| 59 | + fopt = <0xff>; |
| 60 | + config-field-offset = <0x400>; |
| 61 | + |
| 62 | + flash0: flash@0 { |
| 63 | + compatible = "soc-nv-flash"; |
| 64 | + erase-block-size = <1024>; |
| 65 | + write-block-size = <4>; |
| 66 | + }; |
| 67 | + }; |
| 68 | + |
| 69 | + mcg: clock-controller@40064000 { |
| 70 | + compatible = "nxp,kinetis-mcg"; |
| 71 | + reg = <0x40064000 0xd>; |
| 72 | + fcrdiv = <0>; |
| 73 | + lircdiv2 = <0>; |
| 74 | + #clock-cells = <1>; |
| 75 | + }; |
| 76 | + |
| 77 | + sim: sim@40047000 { |
| 78 | + compatible = "nxp,kinetis-sim"; |
| 79 | + reg = <0x40047000 0x1060>; |
| 80 | + #clock-cells = <3>; |
| 81 | + |
| 82 | + core_clk { |
| 83 | + compatible = "fixed-factor-clock"; |
| 84 | + clocks = <&mcg KINETIS_MCG_OUT_CLK>; |
| 85 | + clock-div = <1>; |
| 86 | + #clock-cells = <0>; |
| 87 | + }; |
| 88 | + |
| 89 | + flash_clk { |
| 90 | + compatible = "fixed-factor-clock"; |
| 91 | + clocks = <&mcg KINETIS_MCG_OUT_CLK>; |
| 92 | + clock-div = <2>; |
| 93 | + #clock-cells = <0>; |
| 94 | + }; |
| 95 | + }; |
| 96 | + |
| 97 | + porta: pinmux@40049000 { |
| 98 | + compatible = "nxp,kinetis-pinmux"; |
| 99 | + reg = <0x40049000 0xd0>; |
| 100 | + clocks = <&sim KINETIS_SIM_BUS_CLK 0x1038 9>; |
| 101 | + }; |
| 102 | + |
| 103 | + portb: pinmux@4004a000 { |
| 104 | + compatible = "nxp,kinetis-pinmux"; |
| 105 | + reg = <0x4004a000 0xd0>; |
| 106 | + clocks = <&sim KINETIS_SIM_BUS_CLK 0x1038 10>; |
| 107 | + }; |
| 108 | + |
| 109 | + portc: pinmux@4004b000 { |
| 110 | + compatible = "nxp,kinetis-pinmux"; |
| 111 | + reg = <0x4004b000 0xd0>; |
| 112 | + clocks = <&sim KINETIS_SIM_BUS_CLK 0x1038 11>; |
| 113 | + }; |
| 114 | + |
| 115 | + portd: pinmux@4004c000 { |
| 116 | + compatible = "nxp,kinetis-pinmux"; |
| 117 | + reg = <0x4004c000 0xd0>; |
| 118 | + clocks = <&sim KINETIS_SIM_BUS_CLK 0x1038 12>; |
| 119 | + }; |
| 120 | + |
| 121 | + porte: pinmux@4004d000 { |
| 122 | + compatible = "nxp,kinetis-pinmux"; |
| 123 | + reg = <0x4004d000 0xd0>; |
| 124 | + clocks = <&sim KINETIS_SIM_BUS_CLK 0x1038 13>; |
| 125 | + }; |
| 126 | + |
| 127 | + gpioa: gpio@400ff000 { |
| 128 | + compatible = "nxp,kinetis-gpio"; |
| 129 | + status = "disabled"; |
| 130 | + reg = <0x400ff000 0x40>; |
| 131 | + interrupts = <30 2>; |
| 132 | + gpio-controller; |
| 133 | + #gpio-cells = <2>; |
| 134 | + nxp,kinetis-port = <&porta>; |
| 135 | + }; |
| 136 | + |
| 137 | + gpiob: gpio@400ff040 { |
| 138 | + compatible = "nxp,kinetis-gpio"; |
| 139 | + status = "disabled"; |
| 140 | + reg = <0x400ff040 0x40>; |
| 141 | + gpio-controller; |
| 142 | + #gpio-cells = <2>; |
| 143 | + nxp,kinetis-port = <&portb>; |
| 144 | + }; |
| 145 | + |
| 146 | + gpioc: gpio@400ff080 { |
| 147 | + compatible = "nxp,kinetis-gpio"; |
| 148 | + status = "disabled"; |
| 149 | + reg = <0x400ff080 0x40>; |
| 150 | + interrupts = <31 2>; |
| 151 | + gpio-controller; |
| 152 | + #gpio-cells = <2>; |
| 153 | + nxp,kinetis-port = <&portc>; |
| 154 | + }; |
| 155 | + |
| 156 | + gpiod: gpio@400ff0c0 { |
| 157 | + compatible = "nxp,kinetis-gpio"; |
| 158 | + status = "disabled"; |
| 159 | + reg = <0x400ff0c0 0x40>; |
| 160 | + gpio-controller; |
| 161 | + #gpio-cells = <2>; |
| 162 | + nxp,kinetis-port = <&portd>; |
| 163 | + }; |
| 164 | + |
| 165 | + gpioe: gpio@400ff100 { |
| 166 | + compatible = "nxp,kinetis-gpio"; |
| 167 | + status = "disabled"; |
| 168 | + reg = <0x400ff100 0x40>; |
| 169 | + gpio-controller; |
| 170 | + #gpio-cells = <2>; |
| 171 | + nxp,kinetis-port = <&porte>; |
| 172 | + }; |
| 173 | + |
| 174 | + adc0: adc@4003b000{ |
| 175 | + compatible = "nxp,kinetis-adc16"; |
| 176 | + reg = <0x4003b000 0x70>; |
| 177 | + interrupts = <15 0>; |
| 178 | + status = "disabled"; |
| 179 | + #io-channel-cells = <1>; |
| 180 | + }; |
| 181 | + |
| 182 | + i2c0: i2c@40066000 { |
| 183 | + compatible = "nxp,kinetis-i2c"; |
| 184 | + clock-frequency = <I2C_BITRATE_STANDARD>; |
| 185 | + #address-cells = <1>; |
| 186 | + #size-cells = <0>; |
| 187 | + reg = <0x40066000 0x1000>; |
| 188 | + interrupts = <8 0>; |
| 189 | + clocks = <&sim KINETIS_SIM_BUS_CLK 0x1034 6>; |
| 190 | + status = "disabled"; |
| 191 | + }; |
| 192 | + |
| 193 | + i2c1: i2c@40067000 { |
| 194 | + compatible = "nxp,kinetis-i2c"; |
| 195 | + clock-frequency = <I2C_BITRATE_STANDARD>; |
| 196 | + #address-cells = <1>; |
| 197 | + #size-cells = <0>; |
| 198 | + reg = <0x40067000 0x1000>; |
| 199 | + interrupts = <9 0>; |
| 200 | + clocks = <&sim KINETIS_SIM_BUS_CLK 0x1034 7>; |
| 201 | + status = "disabled"; |
| 202 | + }; |
| 203 | + |
| 204 | + lpuart0: uart@40054000 { |
| 205 | + compatible = "nxp,kinetis-lpuart"; |
| 206 | + reg = <0x40054000 0x1000>; |
| 207 | + interrupts = <12 0>; |
| 208 | + clocks = <&sim KINETIS_SIM_MCGPCLK 0x1038 20>; |
| 209 | + status = "disabled"; |
| 210 | + }; |
| 211 | + |
| 212 | + lpuart1: uart@40055000 { |
| 213 | + compatible = "nxp,kinetis-lpuart"; |
| 214 | + reg = <0x40055000 0x1000>; |
| 215 | + interrupts = <13 0>; |
| 216 | + clocks = <&sim KINETIS_SIM_MCGPCLK 0x1038 21>; |
| 217 | + status = "disabled"; |
| 218 | + }; |
| 219 | + |
| 220 | + uart2: uart@4006c000 { |
| 221 | + compatible = "nxp,kinetis-uart"; |
| 222 | + reg = <0x4006c000 0x1000>; |
| 223 | + interrupts = <14 0>; |
| 224 | + interrupt-names = "status"; |
| 225 | + clocks = <&sim KINETIS_SIM_BUS_CLK 0x1034 12>; |
| 226 | + status = "disabled"; |
| 227 | + }; |
| 228 | + |
| 229 | + tpm0: pwm@40038000 { |
| 230 | + compatible = "nxp,kinetis-tpm"; |
| 231 | + reg = <0x40038000 0x88>; |
| 232 | + interrupts = <17 0>; |
| 233 | + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 24>; |
| 234 | + status = "disabled"; |
| 235 | + #pwm-cells = <3>; |
| 236 | + }; |
| 237 | + |
| 238 | + tpm1: pwm@40039000 { |
| 239 | + compatible = "nxp,kinetis-tpm"; |
| 240 | + reg = <0x40039000 0x88>; |
| 241 | + interrupts = <18 0>; |
| 242 | + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 25>; |
| 243 | + status = "disabled"; |
| 244 | + #pwm-cells = <3>; |
| 245 | + }; |
| 246 | + |
| 247 | + tpm2: pwm@4003a000 { |
| 248 | + compatible = "nxp,kinetis-tpm"; |
| 249 | + reg = <0x4003a000 0x88>; |
| 250 | + interrupts = <19 0>; |
| 251 | + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 26>; |
| 252 | + status = "disabled"; |
| 253 | + #pwm-cells = <3>; |
| 254 | + }; |
| 255 | + }; |
| 256 | +}; |
| 257 | + |
| 258 | +&nvic { |
| 259 | + arm,num-irq-priority-bits = <2>; |
| 260 | +}; |
0 commit comments