Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 2 | /* |
| 3 | * Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd |
| 4 | * Copyright (c) 2019 Vamrs Limited |
| 5 | * Copyright (c) 2019 Amarula Solutions(India) |
| 6 | */ |
| 7 | |
| 8 | #include <dt-bindings/gpio/gpio.h> |
| 9 | #include <dt-bindings/pinctrl/rockchip.h> |
| 10 | #include <dt-bindings/pwm/pwm.h> |
| 11 | |
| 12 | / { |
| 13 | compatible = "vamrs,rk3399pro-vmarc-som", "rockchip,rk3399pro"; |
Jagan Teki | 3b1d5cb | 2020-07-21 20:54:40 +0530 | [diff] [blame] | 14 | |
Peter Robinson | 7c79b87 | 2021-07-22 16:20:42 +0100 | [diff] [blame] | 15 | aliases { |
| 16 | mmc0 = &sdmmc; |
| 17 | mmc1 = &sdhci; |
| 18 | }; |
| 19 | |
Jagan Teki | 3b1d5cb | 2020-07-21 20:54:40 +0530 | [diff] [blame] | 20 | vcc3v3_pcie: vcc-pcie-regulator { |
| 21 | compatible = "regulator-fixed"; |
| 22 | enable-active-high; |
| 23 | gpio = <&gpio4 RK_PD4 GPIO_ACTIVE_HIGH>; |
| 24 | pinctrl-names = "default"; |
| 25 | pinctrl-0 = <&pcie_pwr>; |
| 26 | regulator-name = "vcc3v3_pcie"; |
| 27 | regulator-always-on; |
| 28 | regulator-boot-on; |
| 29 | vin-supply = <&vcc5v0_sys>; |
| 30 | }; |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | &cpu_l0 { |
| 34 | cpu-supply = <&vdd_cpu_l>; |
| 35 | }; |
| 36 | |
| 37 | &cpu_l1 { |
| 38 | cpu-supply = <&vdd_cpu_l>; |
| 39 | }; |
| 40 | |
| 41 | &cpu_l2 { |
| 42 | cpu-supply = <&vdd_cpu_l>; |
| 43 | }; |
| 44 | |
| 45 | &cpu_l3 { |
| 46 | cpu-supply = <&vdd_cpu_l>; |
| 47 | }; |
| 48 | |
| 49 | &emmc_phy { |
| 50 | status = "okay"; |
| 51 | }; |
| 52 | |
| 53 | &gmac { |
| 54 | assigned-clocks = <&cru SCLK_RMII_SRC>; |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 55 | phy-supply = <&vcc_lan>; |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 56 | snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 57 | }; |
| 58 | |
Jagan Teki | a901d3d | 2020-07-21 20:54:39 +0530 | [diff] [blame] | 59 | &hdmi { |
| 60 | ddc-i2c-bus = <&i2c3>; |
| 61 | pinctrl-names = "default"; |
| 62 | pinctrl-0 = <&hdmi_cec>; |
| 63 | }; |
| 64 | |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 65 | &i2c0 { |
| 66 | clock-frequency = <400000>; |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 67 | i2c-scl-falling-time-ns = <30>; |
Jagan Teki | d523b3d | 2020-07-21 20:54:35 +0530 | [diff] [blame] | 68 | i2c-scl-rising-time-ns = <180>; |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 69 | status = "okay"; |
| 70 | |
| 71 | rk809: pmic@20 { |
| 72 | compatible = "rockchip,rk809"; |
| 73 | reg = <0x20>; |
| 74 | interrupt-parent = <&gpio1>; |
| 75 | interrupts = <RK_PC2 IRQ_TYPE_LEVEL_LOW>; |
| 76 | #clock-cells = <1>; |
| 77 | clock-output-names = "rk808-clkout1", "rk808-clkout2"; |
| 78 | pinctrl-names = "default"; |
| 79 | pinctrl-0 = <&pmic_int_l>; |
| 80 | rockchip,system-power-controller; |
| 81 | wakeup-source; |
| 82 | |
| 83 | vcc1-supply = <&vcc5v0_sys>; |
| 84 | vcc2-supply = <&vcc5v0_sys>; |
| 85 | vcc3-supply = <&vcc5v0_sys>; |
| 86 | vcc4-supply = <&vcc5v0_sys>; |
| 87 | vcc5-supply = <&vcc_buck5>; |
| 88 | vcc6-supply = <&vcc_buck5>; |
| 89 | vcc7-supply = <&vcc5v0_sys>; |
| 90 | vcc8-supply = <&vcc3v3_sys>; |
| 91 | vcc9-supply = <&vcc5v0_sys>; |
| 92 | |
| 93 | regulators { |
| 94 | vdd_log: DCDC_REG1 { |
| 95 | regulator-name = "vdd_log"; |
| 96 | regulator-always-on; |
| 97 | regulator-boot-on; |
| 98 | regulator-min-microvolt = <750000>; |
| 99 | regulator-max-microvolt = <1350000>; |
| 100 | regulator-initial-mode = <0x2>; |
| 101 | regulator-state-mem { |
| 102 | regulator-off-in-suspend; |
| 103 | regulator-suspend-microvolt = <900000>; |
| 104 | }; |
| 105 | }; |
| 106 | |
| 107 | vdd_cpu_l: DCDC_REG2 { |
| 108 | regulator-name = "vdd_cpu_l"; |
| 109 | regulator-always-on; |
| 110 | regulator-boot-on; |
| 111 | regulator-min-microvolt = <750000>; |
| 112 | regulator-max-microvolt = <1350000>; |
| 113 | regulator-ramp-delay = <6001>; |
| 114 | regulator-initial-mode = <0x2>; |
| 115 | regulator-state-mem { |
| 116 | regulator-off-in-suspend; |
| 117 | }; |
| 118 | }; |
| 119 | |
| 120 | vcc_ddr: DCDC_REG3 { |
| 121 | regulator-name = "vcc_ddr"; |
| 122 | regulator-always-on; |
| 123 | regulator-boot-on; |
| 124 | regulator-initial-mode = <0x2>; |
| 125 | regulator-state-mem { |
| 126 | regulator-on-in-suspend; |
| 127 | }; |
| 128 | }; |
| 129 | |
| 130 | vcc3v3_sys: DCDC_REG4 { |
| 131 | regulator-name = "vcc3v3_sys"; |
| 132 | regulator-always-on; |
| 133 | regulator-boot-on; |
| 134 | regulator-min-microvolt = <3300000>; |
| 135 | regulator-max-microvolt = <3300000>; |
| 136 | regulator-initial-mode = <0x2>; |
| 137 | regulator-state-mem { |
| 138 | regulator-on-in-suspend; |
| 139 | regulator-suspend-microvolt = <3300000>; |
| 140 | }; |
| 141 | }; |
| 142 | |
| 143 | vcc_buck5: DCDC_REG5 { |
| 144 | regulator-name = "vcc_buck5"; |
| 145 | regulator-always-on; |
| 146 | regulator-boot-on; |
| 147 | regulator-min-microvolt = <2200000>; |
| 148 | regulator-max-microvolt = <2200000>; |
| 149 | regulator-state-mem { |
| 150 | regulator-on-in-suspend; |
| 151 | regulator-suspend-microvolt = <2200000>; |
| 152 | }; |
| 153 | }; |
| 154 | |
| 155 | vcca_0v9: LDO_REG1 { |
| 156 | regulator-name = "vcca_0v9"; |
| 157 | regulator-always-on; |
| 158 | regulator-boot-on; |
| 159 | regulator-min-microvolt = <900000>; |
| 160 | regulator-max-microvolt = <900000>; |
| 161 | regulator-state-mem { |
Jagan Teki | 3b1d5cb | 2020-07-21 20:54:40 +0530 | [diff] [blame] | 162 | regulator-on-in-suspend; |
| 163 | regulator-suspend-microvolt = <900000>; |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 164 | }; |
| 165 | }; |
| 166 | |
| 167 | vcc_1v8: LDO_REG2 { |
| 168 | regulator-name = "vcc_1v8"; |
| 169 | regulator-always-on; |
| 170 | regulator-boot-on; |
| 171 | regulator-min-microvolt = <1800000>; |
| 172 | regulator-max-microvolt = <1800000>; |
| 173 | regulator-state-mem { |
| 174 | regulator-on-in-suspend; |
| 175 | regulator-suspend-microvolt = <1800000>; |
| 176 | }; |
| 177 | }; |
| 178 | |
| 179 | vcc_0v9: LDO_REG3 { |
| 180 | regulator-name = "vcc_0v9"; |
| 181 | regulator-always-on; |
| 182 | regulator-boot-on; |
| 183 | regulator-min-microvolt = <900000>; |
| 184 | regulator-max-microvolt = <900000>; |
| 185 | regulator-state-mem { |
| 186 | regulator-on-in-suspend; |
| 187 | regulator-suspend-microvolt = <900000>; |
| 188 | }; |
| 189 | }; |
| 190 | |
| 191 | vcca_1v8: LDO_REG4 { |
| 192 | regulator-name = "vcca_1v8"; |
| 193 | regulator-always-on; |
| 194 | regulator-boot-on; |
| 195 | regulator-min-microvolt = <1850000>; |
| 196 | regulator-max-microvolt = <1850000>; |
| 197 | regulator-state-mem { |
Jagan Teki | 3b1d5cb | 2020-07-21 20:54:40 +0530 | [diff] [blame] | 198 | regulator-on-in-suspend; |
| 199 | regulator-suspend-microvolt = <1850000>; |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 200 | }; |
| 201 | }; |
| 202 | |
| 203 | /* |
| 204 | * As per BSP, but schematic not showing any regulator |
| 205 | * pin for LD05. |
| 206 | */ |
| 207 | vdd1v5_dvp: LDO_REG5 { |
| 208 | regulator-name = "vdd1v5_dvp"; |
| 209 | regulator-always-on; |
| 210 | regulator-boot-on; |
| 211 | regulator-min-microvolt = <1500000>; |
| 212 | regulator-max-microvolt = <1500000>; |
| 213 | regulator-state-mem { |
| 214 | regulator-off-in-suspend; |
| 215 | }; |
| 216 | }; |
| 217 | |
| 218 | vcc_1v5: LDO_REG6 { |
| 219 | regulator-name = "vcc_1v5"; |
| 220 | regulator-always-on; |
| 221 | regulator-boot-on; |
| 222 | regulator-min-microvolt = <1500000>; |
| 223 | regulator-max-microvolt = <1500000>; |
| 224 | regulator-state-mem { |
| 225 | regulator-off-in-suspend; |
| 226 | }; |
| 227 | }; |
| 228 | |
| 229 | vccio_3v0: LDO_REG7 { |
| 230 | regulator-name = "vccio_3v0"; |
| 231 | regulator-always-on; |
| 232 | regulator-boot-on; |
| 233 | regulator-min-microvolt = <3000000>; |
| 234 | regulator-max-microvolt = <3000000>; |
| 235 | regulator-state-mem { |
| 236 | regulator-off-in-suspend; |
| 237 | }; |
| 238 | }; |
| 239 | |
| 240 | vccio_sd: LDO_REG8 { |
| 241 | regulator-name = "vccio_sd"; |
| 242 | regulator-always-on; |
| 243 | regulator-boot-on; |
| 244 | regulator-min-microvolt = <1800000>; |
| 245 | regulator-max-microvolt = <3300000>; |
| 246 | regulator-state-mem { |
| 247 | regulator-off-in-suspend; |
| 248 | }; |
| 249 | }; |
| 250 | |
| 251 | /* |
| 252 | * As per BSP, but schematic not showing any regulator |
| 253 | * pin for LD09. |
| 254 | */ |
| 255 | vcc_sd: LDO_REG9 { |
| 256 | regulator-name = "vcc_sd"; |
| 257 | regulator-always-on; |
| 258 | regulator-boot-on; |
| 259 | regulator-min-microvolt = <3300000>; |
| 260 | regulator-max-microvolt = <3300000>; |
| 261 | regulator-state-mem { |
| 262 | regulator-off-in-suspend; |
| 263 | }; |
| 264 | }; |
| 265 | |
| 266 | vcc5v0_usb2: SWITCH_REG1 { |
| 267 | regulator-name = "vcc5v0_usb2"; |
| 268 | regulator-min-microvolt = <5000000>; |
| 269 | regulator-max-microvolt = <5000000>; |
| 270 | regulator-state-mem { |
| 271 | regulator-on-in-suspend; |
| 272 | regulator-suspend-microvolt = <5000000>; |
| 273 | }; |
| 274 | }; |
| 275 | |
| 276 | vccio_3v3: vcc_lan: SWITCH_REG2 { |
| 277 | regulator-name = "vccio_3v3"; |
| 278 | regulator-always-on; |
| 279 | regulator-boot-on; |
| 280 | regulator-min-microvolt = <3300000>; |
| 281 | regulator-max-microvolt = <3300000>; |
| 282 | regulator-state-mem { |
| 283 | regulator-off-in-suspend; |
| 284 | }; |
| 285 | }; |
| 286 | }; |
| 287 | }; |
| 288 | }; |
| 289 | |
Jagan Teki | d523b3d | 2020-07-21 20:54:35 +0530 | [diff] [blame] | 290 | &i2c1 { |
| 291 | i2c-scl-falling-time-ns = <30>; |
| 292 | i2c-scl-rising-time-ns = <140>; |
| 293 | status = "okay"; |
| 294 | }; |
| 295 | |
| 296 | &i2c2 { |
| 297 | clock-frequency = <400000>; |
| 298 | status = "okay"; |
| 299 | |
| 300 | hym8563: hym8563@51 { |
| 301 | compatible = "haoyu,hym8563"; |
| 302 | reg = <0x51>; |
| 303 | #clock-cells = <0>; |
| 304 | clock-frequency = <32768>; |
| 305 | clock-output-names = "hym8563"; |
| 306 | pinctrl-names = "default"; |
| 307 | pinctrl-0 = <&hym8563_int>; |
| 308 | interrupt-parent = <&gpio4>; |
| 309 | interrupts = <RK_PD6 IRQ_TYPE_LEVEL_LOW>; |
| 310 | }; |
| 311 | }; |
| 312 | |
Jagan Teki | a901d3d | 2020-07-21 20:54:39 +0530 | [diff] [blame] | 313 | &i2c3 { |
| 314 | i2c-scl-rising-time-ns = <450>; |
| 315 | i2c-scl-falling-time-ns = <15>; |
| 316 | status = "okay"; |
| 317 | }; |
| 318 | |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 319 | &io_domains { |
| 320 | status = "okay"; |
| 321 | bt656-supply = <&vcca_1v8>; |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 322 | gpio1830-supply = <&vccio_3v0>; |
Jagan Teki | d523b3d | 2020-07-21 20:54:35 +0530 | [diff] [blame] | 323 | sdmmc-supply = <&vccio_sd>; |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 324 | }; |
| 325 | |
Jagan Teki | 3b1d5cb | 2020-07-21 20:54:40 +0530 | [diff] [blame] | 326 | &pcie_phy { |
| 327 | status = "okay"; |
| 328 | }; |
| 329 | |
| 330 | &pcie0 { |
| 331 | ep-gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>; |
Jagan Teki | 3b1d5cb | 2020-07-21 20:54:40 +0530 | [diff] [blame] | 332 | num-lanes = <4>; |
| 333 | pinctrl-0 = <&pcie_clkreqnb_cpm>; |
| 334 | pinctrl-names = "default"; |
| 335 | vpcie0v9-supply = <&vcca_0v9>; /* VCC_0V9_S0 */ |
| 336 | vpcie1v8-supply = <&vcca_1v8>; /* VCC_1V8_S0 */ |
| 337 | vpcie3v3-supply = <&vcc3v3_pcie>; |
| 338 | status = "okay"; |
| 339 | }; |
| 340 | |
Jagan Teki | d523b3d | 2020-07-21 20:54:35 +0530 | [diff] [blame] | 341 | &pinctrl { |
| 342 | hym8563 { |
| 343 | hym8563_int: hym8563-int { |
| 344 | rockchip,pins = <4 RK_PD6 0 &pcfg_pull_up>; |
| 345 | }; |
| 346 | }; |
| 347 | |
Jagan Teki | 3b1d5cb | 2020-07-21 20:54:40 +0530 | [diff] [blame] | 348 | pcie { |
| 349 | pcie_pwr: pcie-pwr { |
| 350 | rockchip,pins = <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>; |
| 351 | }; |
| 352 | }; |
| 353 | |
Jagan Teki | d523b3d | 2020-07-21 20:54:35 +0530 | [diff] [blame] | 354 | pmic { |
| 355 | pmic_int_l: pmic-int-l { |
| 356 | rockchip,pins = <1 RK_PC2 0 &pcfg_pull_up>; |
| 357 | }; |
| 358 | }; |
Jagan Teki | 513673d | 2020-07-21 20:54:38 +0530 | [diff] [blame] | 359 | |
Peter Robinson | 7c79b87 | 2021-07-22 16:20:42 +0100 | [diff] [blame] | 360 | sdio-pwrseq { |
| 361 | wifi_enable_h: wifi-enable-h { |
| 362 | rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; |
| 363 | }; |
| 364 | }; |
| 365 | |
Jagan Teki | 513673d | 2020-07-21 20:54:38 +0530 | [diff] [blame] | 366 | vbus_host { |
| 367 | usb1_en_oc: usb1-en-oc { |
| 368 | rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>; |
| 369 | }; |
| 370 | }; |
| 371 | |
| 372 | vbus_typec { |
| 373 | usb0_en_oc: usb0-en-oc { |
| 374 | rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>; |
| 375 | }; |
| 376 | }; |
Jagan Teki | d523b3d | 2020-07-21 20:54:35 +0530 | [diff] [blame] | 377 | }; |
| 378 | |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 379 | &pmu_io_domains { |
| 380 | status = "okay"; |
| 381 | pmu1830-supply = <&vcc_1v8>; |
| 382 | }; |
| 383 | |
| 384 | &sdhci { |
| 385 | bus-width = <8>; |
| 386 | mmc-hs400-1_8v; |
| 387 | mmc-hs400-enhanced-strobe; |
| 388 | non-removable; |
| 389 | status = "okay"; |
| 390 | }; |
| 391 | |
Jagan Teki | 91391cd | 2020-06-18 21:42:18 +0530 | [diff] [blame] | 392 | &sdmmc { |
| 393 | cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; |
| 394 | max-frequency = <150000000>; |
| 395 | }; |
| 396 | |
Jagan Teki | 513673d | 2020-07-21 20:54:38 +0530 | [diff] [blame] | 397 | &tcphy0 { |
| 398 | status = "okay"; |
| 399 | }; |
| 400 | |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 401 | &tsadc { |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 402 | rockchip,hw-tshut-mode = <1>; |
| 403 | rockchip,hw-tshut-polarity = <1>; |
Jagan Teki | d523b3d | 2020-07-21 20:54:35 +0530 | [diff] [blame] | 404 | status = "okay"; |
Jagan Teki | 06209de | 2020-06-10 16:06:56 +0530 | [diff] [blame] | 405 | }; |
Jagan Teki | 513673d | 2020-07-21 20:54:38 +0530 | [diff] [blame] | 406 | |
| 407 | &u2phy0 { |
| 408 | status = "okay"; |
| 409 | |
| 410 | u2phy0_otg: otg-port { |
| 411 | phy-supply = <&vbus_typec>; |
| 412 | status = "okay"; |
| 413 | }; |
| 414 | |
| 415 | u2phy0_host: host-port { |
| 416 | phy-supply = <&vbus_host>; |
| 417 | status = "okay"; |
| 418 | }; |
| 419 | }; |
| 420 | |
| 421 | |
| 422 | &u2phy1 { |
| 423 | status = "okay"; |
| 424 | |
| 425 | u2phy1_host: host-port { |
| 426 | phy-supply = <&vbus_host>; |
| 427 | status = "okay"; |
| 428 | }; |
| 429 | }; |
| 430 | |
| 431 | &usb_host0_ehci { |
| 432 | status = "okay"; |
| 433 | }; |
| 434 | |
| 435 | &usb_host0_ohci { |
| 436 | status = "okay"; |
| 437 | }; |
| 438 | |
| 439 | &usb_host1_ehci { |
| 440 | status = "okay"; |
| 441 | }; |
| 442 | |
| 443 | &usb_host1_ohci { |
| 444 | status = "okay"; |
| 445 | }; |
| 446 | |
| 447 | &usbdrd3_0 { |
| 448 | status = "okay"; |
| 449 | }; |
| 450 | |
| 451 | &usbdrd_dwc3_0 { |
| 452 | status = "okay"; |
| 453 | }; |
| 454 | |
| 455 | &vbus_host { |
| 456 | enable-active-high; |
| 457 | gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>; /* USB1_EN_OC# */ |
| 458 | pinctrl-names = "default"; |
| 459 | pinctrl-0 = <&usb1_en_oc>; |
| 460 | }; |
| 461 | |
| 462 | &vbus_typec { |
| 463 | enable-active-high; |
| 464 | gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; /* USB0_EN_OC# */ |
| 465 | pinctrl-names = "default"; |
| 466 | pinctrl-0 = <&usb0_en_oc>; |
| 467 | }; |