1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * ArmSoM CM5-IO - official carrier board for the ArmSoM CM5 (RK3576) module. 4 * 5 * Carrier provides: 6 * - Full-size HDMI 2.1 (HDMI TX via HDPTX PHY) 7 * - Gigabit Ethernet RJ45 (GMAC0 + on-module YT8531) 8 * - 2x USB-A behind a USB3 hub (combphy1 + u2phy1) 9 * - USB-C with PD/altmode (FUSB302 on i2c0, combphy0 + USBDP PHY) 10 * - M.2 PCIe 2.0 x1 slot (combphy0 as PCIe lane) 11 * - microSD card slot 12 * - Green/red status LEDs, 40-pin RPi-compatible header 13 * - 12 V DC barrel jack 14 * 15 * Copyright (c) 2024 ArmSoM 16 * Copyright (c) 2026 Jiaxing Hu <gahing@gahingwoo.com> 17 */ 18 19/dts-v1/; 20 21#include <dt-bindings/gpio/gpio.h> 22#include <dt-bindings/leds/common.h> 23#include <dt-bindings/pinctrl/rockchip.h> 24#include <dt-bindings/soc/rockchip,vop2.h> 25#include <dt-bindings/usb/pd.h> 26#include "rk3576-armsom-cm5.dtsi" 27 28/ { 29 model = "ArmSoM CM5-IO"; 30 compatible = "armsom,cm5-io", "armsom,cm5", "rockchip,rk3576"; 31 32 aliases { 33 ethernet0 = &gmac0; 34 mmc0 = &sdhci; 35 mmc1 = &sdmmc; 36 }; 37 38 chosen { 39 stdout-path = "serial0:1500000n8"; 40 }; 41 42 hdmi-con { 43 compatible = "hdmi-connector"; 44 type = "a"; 45 46 port { 47 hdmi_con_in: endpoint { 48 remote-endpoint = <&hdmi_out_con>; 49 }; 50 }; 51 }; 52 53 leds: leds { 54 compatible = "gpio-leds"; 55 56 led_green: led-0 { 57 color = <LED_COLOR_ID_GREEN>; 58 default-state = "on"; 59 function = LED_FUNCTION_STATUS; 60 gpios = <&gpio2 RK_PD0 GPIO_ACTIVE_HIGH>; 61 pinctrl-names = "default"; 62 pinctrl-0 = <&led_green_en>; 63 }; 64 65 led_red: led-1 { 66 color = <LED_COLOR_ID_RED>; 67 default-state = "off"; 68 function = LED_FUNCTION_FAULT; 69 gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_HIGH>; 70 pinctrl-names = "default"; 71 pinctrl-0 = <&led_red_en>; 72 }; 73 }; 74 75 vcc_12v0_dcin: regulator-vcc-12v0-dcin { 76 compatible = "regulator-fixed"; 77 regulator-name = "vcc_12v0_dcin"; 78 regulator-always-on; 79 regulator-boot-on; 80 regulator-min-microvolt = <12000000>; 81 regulator-max-microvolt = <12000000>; 82 }; 83 84 /* PCIe 3.3 V for the M.2 slot */ 85 vcc_3v3_pcie: regulator-vcc-3v3-pcie { 86 compatible = "regulator-fixed"; 87 pinctrl-names = "default"; 88 pinctrl-0 = <&pcie_pwr_en>; 89 regulator-name = "vcc_3v3_pcie"; 90 regulator-min-microvolt = <3300000>; 91 regulator-max-microvolt = <3300000>; 92 enable-active-high; 93 gpios = <&gpio0 RK_PC3 GPIO_ACTIVE_HIGH>; 94 startup-delay-us = <5000>; 95 vin-supply = <&vcc_5v0_sys>; 96 }; 97 98 vcc_5v0_device: regulator-vcc-5v0-device { 99 compatible = "regulator-fixed"; 100 regulator-name = "vcc_5v0_device"; 101 regulator-always-on; 102 regulator-boot-on; 103 regulator-min-microvolt = <5000000>; 104 regulator-max-microvolt = <5000000>; 105 vin-supply = <&vcc_12v0_dcin>; 106 }; 107 108 vcc_5v0_sys: regulator-vcc-5v0-sys { 109 compatible = "regulator-fixed"; 110 regulator-name = "vcc_5v0_sys"; 111 regulator-always-on; 112 regulator-boot-on; 113 regulator-min-microvolt = <5000000>; 114 regulator-max-microvolt = <5000000>; 115 vin-supply = <&vcc_12v0_dcin>; 116 }; 117 118 vcc_5v0_typec0: regulator-vcc-5v0-typec0 { 119 compatible = "regulator-fixed"; 120 enable-active-high; 121 gpios = <&gpio2 RK_PB6 GPIO_ACTIVE_HIGH>; 122 pinctrl-names = "default"; 123 pinctrl-0 = <&usb_otg0_pwren>; 124 regulator-name = "vcc_5v0_typec0"; 125 regulator-min-microvolt = <5000000>; 126 regulator-max-microvolt = <5000000>; 127 vin-supply = <&vcc_5v0_device>; 128 }; 129 130 /* USB-A host 5 V (through the hub) */ 131 vcc_5v0_usbhost: regulator-vcc-5v0-usbhost { 132 compatible = "regulator-fixed"; 133 enable-active-high; 134 gpios = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>; 135 pinctrl-names = "default"; 136 pinctrl-0 = <&usb_host_pwren>; 137 regulator-name = "vcc_5v0_usbhost"; 138 regulator-min-microvolt = <5000000>; 139 regulator-max-microvolt = <5000000>; 140 vin-supply = <&vcc_5v0_device>; 141 }; 142}; 143 144/* ComboPHY0 -> PCIe lane (M.2 slot); ComboPHY1 -> USB3 lane (USB-A hub). */ 145&combphy0_ps { 146 status = "okay"; 147}; 148 149&combphy1_psu { 150 status = "okay"; 151}; 152 153&hdmi { 154 status = "okay"; 155}; 156 157&hdmi_in { 158 hdmi_in_vp0: endpoint { 159 remote-endpoint = <&vp0_out_hdmi>; 160 }; 161}; 162 163&hdmi_out { 164 hdmi_out_con: endpoint { 165 remote-endpoint = <&hdmi_con_in>; 166 }; 167}; 168 169&hdmi_sound { 170 status = "okay"; 171}; 172 173&hdptxphy { 174 status = "okay"; 175}; 176 177&i2c0 { 178 pinctrl-names = "default"; 179 pinctrl-0 = <&i2c0m1_xfer>; 180 status = "okay"; 181 182 usbc0: usb-typec@22 { 183 compatible = "fcs,fusb302"; 184 reg = <0x22>; 185 interrupt-parent = <&gpio0>; 186 interrupts = <RK_PB4 IRQ_TYPE_LEVEL_LOW>; 187 pinctrl-names = "default"; 188 pinctrl-0 = <&usbc0_int>; 189 vbus-supply = <&vcc_5v0_typec0>; 190 191 usb_con: connector { 192 compatible = "usb-c-connector"; 193 data-role = "dual"; 194 label = "USB-C"; 195 op-sink-microwatt = <1000000>; 196 power-role = "dual"; 197 try-power-role = "sink"; 198 sink-pdos = 199 <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM) 200 PDO_FIXED(9000, 3000, PDO_FIXED_USB_COMM) 201 PDO_FIXED(12000, 3000, PDO_FIXED_USB_COMM)>; 202 source-pdos = 203 <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>; 204 205 altmodes { 206 displayport { 207 svid = /bits/ 16 <0xff01>; 208 vdo = <0xffffffff>; 209 }; 210 }; 211 212 ports { 213 #address-cells = <1>; 214 #size-cells = <0>; 215 216 port@0 { 217 reg = <0>; 218 usbc0_orien_sw: endpoint { 219 remote-endpoint = <&usbdp_phy_orientation_switch>; 220 }; 221 }; 222 223 port@1 { 224 reg = <1>; 225 usbc0_role_sw: endpoint { 226 remote-endpoint = <&usb_drd0_role_switch>; 227 }; 228 }; 229 230 port@2 { 231 reg = <2>; 232 dp_altmode_mux: endpoint { 233 remote-endpoint = <&usbdp_phy_dp_altmode_mux>; 234 }; 235 }; 236 }; 237 }; 238 }; 239}; 240 241/* PCIe 2.0 x1 M.2 slot + */ 242&pcie0 { 243 pinctrl-names = "default"; 244 pinctrl-0 = <&pcie_reset>; 245 reset-gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_HIGH>; 246 vpcie3v3-supply = <&vcc_3v3_pcie>; 247 status = "okay"; 248}; 249 250&pinctrl { 251 leds { 252 led_green_en: led-green-en { 253 rockchip,pins = <2 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>; 254 }; 255 256 led_red_en: led-red-en { 257 rockchip,pins = <2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>; 258 }; 259 }; 260 261 pcie { 262 pcie_pwr_en: pcie-pwr-en { 263 rockchip,pins = <0 RK_PC3 RK_FUNC_GPIO &pcfg_pull_down>; 264 }; 265 266 pcie_reset: pcie-reset { 267 rockchip,pins = <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>; 268 }; 269 }; 270 271 usb { 272 usb_host_pwren: usb-host-pwren { 273 rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; 274 }; 275 276 usb_otg0_pwren: usb-otg0-pwren { 277 rockchip,pins = <2 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>; 278 }; 279 280 usbc0_int: usbc0-int { 281 rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>; 282 }; 283 }; 284}; 285 286/* SAI6 is the I2S CPU DAI feeding the HDMI audio path. */ 287&sai6 { 288 status = "okay"; 289}; 290 291&sdmmc { 292 bus-width = <4>; 293 cap-mmc-highspeed; 294 cap-sd-highspeed; 295 disable-wp; 296 max-frequency = <200000000>; 297 no-sdio; 298 no-mmc; 299 sd-uhs-sdr104; 300 vmmc-supply = <&vcc_3v3_s3>; 301 vqmmc-supply = <&vccio_sd_s0>; 302 status = "okay"; 303}; 304 305&u2phy0 { 306 status = "okay"; 307}; 308 309&u2phy0_otg { 310 phy-supply = <&vcc_5v0_typec0>; 311 status = "okay"; 312}; 313 314&u2phy1 { 315 status = "okay"; 316}; 317 318&u2phy1_otg { 319 phy-supply = <&vcc_5v0_usbhost>; 320 status = "okay"; 321}; 322 323/* Debug UART0 on the 40-pin header. */ 324&uart0 { 325 pinctrl-0 = <&uart0m0_xfer>; 326 status = "okay"; 327}; 328 329/* USB DRD0: USB-C (USBDP SuperSpeed + USB2 HS), OTG with FUSB302 */ 330&usb_drd0_dwc3 { 331 dr_mode = "otg"; 332 usb-role-switch; 333 status = "okay"; 334 335 port { 336 usb_drd0_role_switch: endpoint { 337 remote-endpoint = <&usbc0_role_sw>; 338 }; 339 }; 340}; 341 342/* USB DRD1: USB-A ports behind the hub */ 343&usb_drd1_dwc3 { 344 dr_mode = "host"; 345 status = "okay"; 346}; 347 348&usbdp_phy { 349 status = "okay"; 350 mode-switch; 351 orientation-switch; 352 sbu1-dc-gpios = <&gpio4 RK_PC4 GPIO_ACTIVE_HIGH>; 353 sbu2-dc-gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_HIGH>; 354 355 port { 356 #address-cells = <1>; 357 #size-cells = <0>; 358 359 usbdp_phy_orientation_switch: endpoint@0 { 360 reg = <0>; 361 remote-endpoint = <&usbc0_orien_sw>; 362 }; 363 364 usbdp_phy_dp_altmode_mux: endpoint@1 { 365 reg = <1>; 366 remote-endpoint = <&dp_altmode_mux>; 367 }; 368 }; 369}; 370 371&vop { 372 status = "okay"; 373}; 374 375&vop_mmu { 376 status = "okay"; 377}; 378 379&vp0 { 380 vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { 381 reg = <ROCKCHIP_VOP2_EP_HDMI0>; 382 remote-endpoint = <&hdmi_in_vp0>; 383 }; 384}; 385