1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) 2/* 3 * Copyright (C) 2024 Marek Vasut <marex@denx.de> 4 * 5 * DHCOR STM32MP13 variant: 6 * DHCR-STM32MP135F-C100-R051-EE-F0409-SPI4-RTC-WBT-I-01LG 7 * DHCOR PCB number: 718-100 or newer 8 * DHSBC PCB number: 719-100 or newer 9 */ 10 11/dts-v1/; 12 13#include <dt-bindings/regulator/st,stm32mp13-regulator.h> 14#include "stm32mp135.dtsi" 15#include "stm32mp13xf.dtsi" 16#include "stm32mp13xx-dhcor-som.dtsi" 17 18/ { 19 model = "DH electronics STM32MP135F DHCOR DHSBC"; 20 compatible = "dh,stm32mp135f-dhcor-dhsbc", 21 "dh,stm32mp135f-dhcor-som", 22 "st,stm32mp135"; 23 24 aliases { 25 ethernet0 = ðernet1; 26 ethernet1 = ðernet2; 27 serial2 = &usart1; 28 serial3 = &usart2; 29 }; 30 31 chosen { 32 stdout-path = "serial0:115200n8"; 33 }; 34}; 35 36&adc_1 { 37 pinctrl-names = "default"; 38 pinctrl-0 = <&adc1_pins_a &adc1_usb_cc_pins_b>; 39 vdda-supply = <&vdd_adc>; 40 vref-supply = <&vdd_adc>; 41 status = "okay"; 42 43 adc1: adc@0 { 44 status = "okay"; 45 46 /* 47 * Type-C USB_PWR_CC1 & USB_PWR_CC2 on in2 & in11. 48 * Use at least 5 * RC time, e.g. 5 * (Rp + Rd) * C: 49 * 5 * (5.1 + 47kOhms) * 5pF => 1.3us. 50 * Use arbitrary margin here (e.g. 5us). 51 * 52 * The pinmux pins must be set as ANALOG, use datasheet 53 * DS13483 Table 7. STM32MP135C/F ball definitions to 54 * find out which 'pin name' maps to which 'additional 55 * functions', which lists the mapping between pin and 56 * ADC channel. In this case, PA5 maps to ADC1_INP2 and 57 * PF13 maps to ADC1_INP11 . 58 */ 59 channel@2 { 60 reg = <2>; 61 st,min-sample-time-ns = <5000>; 62 }; 63 64 channel@11 { 65 reg = <11>; 66 st,min-sample-time-ns = <5000>; 67 }; 68 69 /* Expansion connector: INP12:pin29 */ 70 channel@12 { 71 reg = <12>; 72 st,min-sample-time-ns = <5000>; 73 }; 74 }; 75}; 76 77ðernet1 { 78 phy-handle = <ðphy1>; 79 phy-mode = "rgmii-id"; 80 pinctrl-0 = <ð1_rgmii_pins_a>; 81 pinctrl-1 = <ð1_rgmii_sleep_pins_a>; 82 pinctrl-names = "default", "sleep"; 83 st,ext-phyclk; 84 status = "okay"; 85 86 mdio { 87 #address-cells = <1>; 88 #size-cells = <0>; 89 compatible = "snps,dwmac-mdio"; 90 91 ethphy1: ethernet-phy@1 { 92 /* RTL8211F */ 93 compatible = "ethernet-phy-id001c.c916"; 94 interrupt-parent = <&gpiog>; 95 interrupts = <12 IRQ_TYPE_LEVEL_LOW>; 96 reg = <1>; 97 reset-assert-us = <15000>; 98 reset-deassert-us = <55000>; 99 reset-gpios = <&gpioa 11 GPIO_ACTIVE_LOW>; 100 }; 101 }; 102}; 103 104ðernet2 { 105 phy-handle = <ðphy2>; 106 phy-mode = "rgmii-id"; 107 pinctrl-0 = <ð2_rgmii_pins_a>; 108 pinctrl-1 = <ð2_rgmii_sleep_pins_a>; 109 pinctrl-names = "default", "sleep"; 110 st,ext-phyclk; 111 status = "okay"; 112 113 mdio { 114 #address-cells = <1>; 115 #size-cells = <0>; 116 compatible = "snps,dwmac-mdio"; 117 118 ethphy2: ethernet-phy@1 { 119 /* RTL8211F */ 120 compatible = "ethernet-phy-id001c.c916"; 121 interrupt-parent = <&gpiog>; 122 interrupts = <15 IRQ_TYPE_LEVEL_LOW>; 123 reg = <1>; 124 reset-assert-us = <15000>; 125 reset-deassert-us = <55000>; 126 reset-gpios = <&gpiog 8 GPIO_ACTIVE_LOW>; 127 }; 128 }; 129}; 130 131&gpioa { 132 gpio-line-names = "", "", "", "", 133 "", "DHSBC_USB_PWR_CC1", "", "", 134 "", "", "", "DHSBC_nETH1_RST", 135 "", "DHCOR_HW-CODING_0", "", ""; 136}; 137 138&gpiob { 139 gpio-line-names = "", "", "", "", 140 "", "", "", "DHCOR_BT_HOST_WAKE", 141 "", "", "", "", 142 "", "DHSBC_nTPM_CS", "", ""; 143}; 144 145&gpioc { 146 gpio-line-names = "", "", "", "DHSBC_USB_5V_MEAS", 147 "", "", "", "", 148 "", "", "", "", 149 "", "", "", ""; 150}; 151 152&gpiod { 153 gpio-line-names = "", "", "", "", 154 "", "DHCOR_RAM-CODING_0", "", "", 155 "", "DHCOR_RAM-CODING_1", "", "", 156 "", "", "", ""; 157}; 158 159&gpioe { 160 gpio-line-names = "", "", "", "", 161 "", "", "", "", 162 "", "DHSBC_nTPM_RST", "", "", 163 "DHSBC_nTPM_PIRQ", "", "DHCOR_WL_HOST_WAKE", ""; 164}; 165 166&gpiof { 167 gpio-line-names = "", "", "DHSBC_USB_PWR_nFLT", "", 168 "", "", "", "", 169 "", "", "", "", 170 "DHCOR_WL_REG_ON", "DHSBC_USB_PWR_CC2", "", ""; 171}; 172 173&gpiog { 174 gpio-line-names = "", "", "", "", 175 "", "", "", "", 176 "DHSBC_nETH2_RST", "DHCOR_BT_DEV_WAKE", "", "", 177 "DHSBC_ETH1_INTB", "", "", "DHSBC_ETH2_INTB"; 178}; 179 180&gpioi { 181 gpio-line-names = "DHCOR_RTC_nINT", "DHCOR_HW-CODING_1", 182 "DHCOR_BT_REG_ON", "DHCOR_PMIC_nINT", 183 "DHSBC_BOOT0", "DHSBC_BOOT1", 184 "DHSBC_BOOT2", "DHSBC_USB-C_DATA_VBUS"; 185}; 186 187&i2c1 { /* Expansion connector: SDA:pin27 SCL:pin28 */ 188 pinctrl-names = "default", "sleep"; 189 pinctrl-0 = <&i2c1_pins_a>; 190 pinctrl-1 = <&i2c1_sleep_pins_a>; 191 i2c-scl-rising-time-ns = <96>; 192 i2c-scl-falling-time-ns = <3>; 193 clock-frequency = <400000>; 194 status = "okay"; 195 /* spare dmas for other usage */ 196 /delete-property/dmas; 197 /delete-property/dma-names; 198}; 199 200&i2c5 { /* Expansion connector: SDA:pin3 SCL:pin5 */ 201 pinctrl-names = "default", "sleep"; 202 pinctrl-0 = <&i2c5_pins_b>; 203 pinctrl-1 = <&i2c5_sleep_pins_b>; 204 i2c-scl-rising-time-ns = <96>; 205 i2c-scl-falling-time-ns = <3>; 206 clock-frequency = <400000>; 207 status = "okay"; 208 /* spare dmas for other usage */ 209 /delete-property/dmas; 210 /delete-property/dma-names; 211}; 212 213&m_can1 { /* Expansion connector: TX:pin16 RX:pin18 */ 214 pinctrl-names = "default", "sleep"; 215 pinctrl-0 = <&m_can1_pins_a>; 216 pinctrl-1 = <&m_can1_sleep_pins_a>; 217 status = "okay"; 218}; 219 220&m_can2 { /* Expansion connector: TX:pin22 RX:pin26 */ 221 pinctrl-names = "default", "sleep"; 222 pinctrl-0 = <&m_can2_pins_a>; 223 pinctrl-1 = <&m_can2_sleep_pins_a>; 224 status = "okay"; 225}; 226 227&pwr_regulators { 228 vdd-supply = <&vdd>; 229 vdd_3v3_usbfs-supply = <&vdd_usb>; 230 status = "okay"; 231}; 232 233&sai1 { /* Expansion connector: SCK-A:pin12 FS-A:pin35 SD-A:pin38 SD-B:pin40 */ 234 clocks = <&rcc SAI1>, <&rcc PLL3_Q>, <&rcc PLL3_R>; 235 clock-names = "pclk", "x8k", "x11k"; 236 pinctrl-names = "default", "sleep"; 237 pinctrl-0 = <&sai1a_pins_a &sai1b_pins_a>; 238 pinctrl-1 = <&sai1a_sleep_pins_a &sai1b_sleep_pins_a>; 239}; 240 241&scmi_voltd { 242 status = "disabled"; 243}; 244 245&spi2 { 246 pinctrl-names = "default", "sleep"; 247 pinctrl-0 = <&spi2_pins_a>; 248 pinctrl-1 = <&spi2_sleep_pins_a>; 249 cs-gpios = <&gpiob 13 0>; 250 status = "okay"; 251 252 st33htph: tpm@0 { 253 compatible = "st,st33htpm-spi", "tcg,tpm_tis-spi"; 254 reg = <0>; 255 spi-max-frequency = <24000000>; 256 }; 257}; 258 259&spi3 { /* Expansion connector: MOSI:pin19 MISO:pin21 SCK:pin22 nCS:pin24 */ 260 pinctrl-names = "default", "sleep"; 261 pinctrl-0 = <&spi3_pins_a>; 262 pinctrl-1 = <&spi3_sleep_pins_a>; 263 cs-gpios = <&gpiof 3 0>; 264 status = "disabled"; 265}; 266 267&timers5 { /* Expansion connector: CH3:pin31 */ 268 /delete-property/dmas; 269 /delete-property/dma-names; 270 status = "okay"; 271 272 pwm { 273 pinctrl-0 = <&pwm5_pins_a>; 274 pinctrl-1 = <&pwm5_sleep_pins_a>; 275 pinctrl-names = "default", "sleep"; 276 status = "okay"; 277 }; 278 timer@4 { 279 status = "okay"; 280 }; 281}; 282 283&timers13 { /* Expansion connector: CH1:pin32 */ 284 /delete-property/dmas; 285 /delete-property/dma-names; 286 status = "okay"; 287 288 pwm { 289 pinctrl-0 = <&pwm13_pins_a>; 290 pinctrl-1 = <&pwm13_sleep_pins_a>; 291 pinctrl-names = "default", "sleep"; 292 status = "okay"; 293 }; 294 timer@12 { 295 status = "okay"; 296 }; 297}; 298 299&usart1 { /* Expansion connector: RX:pin33 TX:pin37 */ 300 pinctrl-names = "default", "sleep", "idle"; 301 pinctrl-0 = <&usart1_pins_b>; 302 pinctrl-1 = <&usart1_sleep_pins_b>; 303 pinctrl-2 = <&usart1_idle_pins_b>; 304 status = "okay"; 305}; 306 307&usart2 { /* Expansion connector: RX:pin10 TX:pin8 RTS:pin11 CTS:pin36 */ 308 pinctrl-names = "default", "sleep", "idle"; 309 pinctrl-0 = <&usart2_pins_b>; 310 pinctrl-1 = <&usart2_sleep_pins_b>; 311 pinctrl-2 = <&usart2_idle_pins_b>; 312 uart-has-rtscts; 313 status = "okay"; 314}; 315 316&usbh_ehci { 317 phys = <&usbphyc_port0>; 318 status = "okay"; 319}; 320 321&usbh_ohci { 322 phys = <&usbphyc_port0>; 323 status = "okay"; 324}; 325 326&usbotg_hs { 327 dr_mode = "peripheral"; 328 phys = <&usbphyc_port1 0>; 329 phy-names = "usb2-phy"; 330 usb33d-supply = <&usb33>; 331 status = "okay"; 332}; 333 334&usbphyc { 335 status = "okay"; 336 vdda1v1-supply = <®11>; 337 vdda1v8-supply = <®18>; 338}; 339 340&usbphyc_port0 { 341 phy-supply = <&vdd_usb>; 342 st,current-boost-microamp = <1000>; 343 st,decrease-hs-slew-rate; 344 st,tune-hs-dc-level = <2>; 345 st,enable-hs-rftime-reduction; 346 st,trim-hs-current = <11>; 347 st,trim-hs-impedance = <2>; 348 st,tune-squelch-level = <1>; 349 st,enable-hs-rx-gain-eq; 350 st,no-hs-ftime-ctrl; 351 st,no-lsfs-sc; 352 connector { 353 compatible = "usb-a-connector"; 354 vbus-supply = <&vbus_sw>; 355 }; 356}; 357 358&usbphyc_port1 { 359 phy-supply = <&vdd_usb>; 360 st,current-boost-microamp = <1000>; 361 st,decrease-hs-slew-rate; 362 st,tune-hs-dc-level = <2>; 363 st,enable-hs-rftime-reduction; 364 st,trim-hs-current = <11>; 365 st,trim-hs-impedance = <2>; 366 st,tune-squelch-level = <1>; 367 st,enable-hs-rx-gain-eq; 368 st,no-hs-ftime-ctrl; 369 st,no-lsfs-sc; 370 connector { 371 compatible = "gpio-usb-b-connector", "usb-b-connector"; 372 vbus-gpios = <&gpioi 7 GPIO_ACTIVE_HIGH>; 373 label = "Type-C"; 374 self-powered; 375 type = "micro"; 376 }; 377}; 378