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