1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH 4 */ 5 6#include <dt-bindings/pwm/pwm.h> 7#include "rk3399.dtsi" 8 9/ { 10 aliases { 11 ethernet0 = &gmac; 12 mmc0 = &sdhci; 13 }; 14 15 leds { 16 compatible = "gpio-leds"; 17 pinctrl-names = "default"; 18 pinctrl-0 = <&module_led_pin>; 19 20 module_led: led-0 { 21 label = "module_led"; 22 gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_HIGH>; 23 linux,default-trigger = "heartbeat"; 24 panic-indicator; 25 }; 26 }; 27 28 extcon_usb3: extcon-usb3 { 29 compatible = "linux,extcon-usb-gpio"; 30 id-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_HIGH>; 31 pinctrl-names = "default"; 32 pinctrl-0 = <&usb3_id>; 33 }; 34 35 clkin_gmac: external-gmac-clock { 36 compatible = "fixed-clock"; 37 clock-frequency = <125000000>; 38 clock-output-names = "clkin_gmac"; 39 #clock-cells = <0>; 40 }; 41 42 vcc1v2_phy: vcc1v2-phy { 43 compatible = "regulator-fixed"; 44 regulator-name = "vcc1v2_phy"; 45 regulator-always-on; 46 regulator-boot-on; 47 regulator-min-microvolt = <1200000>; 48 regulator-max-microvolt = <1200000>; 49 vin-supply = <&vcc5v0_sys>; 50 }; 51 52 vcc3v3_sys: vcc3v3-sys { 53 compatible = "regulator-fixed"; 54 regulator-name = "vcc3v3_sys"; 55 regulator-always-on; 56 regulator-boot-on; 57 regulator-min-microvolt = <3300000>; 58 regulator-max-microvolt = <3300000>; 59 vin-supply = <&vcc5v0_sys>; 60 }; 61 62 vcc5v0_sys: regulator-vcc5v0-sys { 63 compatible = "regulator-fixed"; 64 regulator-name = "vcc5v0_sys"; 65 regulator-always-on; 66 regulator-boot-on; 67 regulator-min-microvolt = <5000000>; 68 regulator-max-microvolt = <5000000>; 69 }; 70 71 vcca_0v9: vcca-0v9-regulator { 72 compatible = "regulator-fixed"; 73 regulator-name = "vcca_0v9"; 74 regulator-always-on; 75 regulator-boot-on; 76 regulator-min-microvolt = <900000>; 77 regulator-max-microvolt = <900000>; 78 vin-supply = <&vcc_1v8>; 79 }; 80 81 vcca_1v8: vcca-1v8-regulator { 82 compatible = "regulator-fixed"; 83 regulator-name = "vcca_1v8"; 84 regulator-always-on; 85 regulator-boot-on; 86 regulator-min-microvolt = <1800000>; 87 regulator-max-microvolt = <1800000>; 88 vin-supply = <&vcc3v3_sys>; 89 }; 90 91 vdd_log: vdd-log { 92 compatible = "pwm-regulator"; 93 pwms = <&pwm2 0 25000 1>; 94 pwm-supply = <&vcc5v0_sys>; 95 regulator-name = "vdd_log"; 96 regulator-min-microvolt = <800000>; 97 regulator-max-microvolt = <1400000>; 98 regulator-always-on; 99 regulator-boot-on; 100 }; 101}; 102 103&cpu_b0 { 104 cpu-supply = <&vdd_cpu_b>; 105}; 106 107&cpu_b1 { 108 cpu-supply = <&vdd_cpu_b>; 109}; 110 111&cpu_l0 { 112 cpu-supply = <&vdd_cpu_l>; 113}; 114 115&cpu_l1 { 116 cpu-supply = <&vdd_cpu_l>; 117}; 118 119&cpu_l2 { 120 cpu-supply = <&vdd_cpu_l>; 121}; 122 123&cpu_l3 { 124 cpu-supply = <&vdd_cpu_l>; 125}; 126 127&emmc_phy { 128 status = "okay"; 129 drive-impedance-ohm = <33>; 130}; 131 132&gpio0 { 133 /* 134 * The BIOS_DISABLE hog is a feedback pin for the actual status of the 135 * signal. This usually represents the state of a switch on the baseboard. 136 * The pin has a 10k pull-up resistor connected, so no pull-up setting is needed. 137 */ 138 bios-disable-hog { 139 gpios = <RK_PB0 GPIO_ACTIVE_HIGH>; 140 gpio-hog; 141 input; 142 line-name = "bios_disable"; 143 }; 144}; 145 146&gpio3 { 147 /* 148 * The Qseven BIOS_DISABLE signal on the RK3399-Q7 keeps the on-module 149 * eMMC and SPI flash powered-down initially (in fact it keeps the 150 * reset signal asserted). BIOS_DISABLE_OVERRIDE pin allows to override 151 * that signal so that eMMC and SPI can be used regardless of the state 152 * of the signal. 153 */ 154 bios-disable-override-hog { 155 gpios = <RK_PD5 GPIO_ACTIVE_LOW>; 156 gpio-hog; 157 line-name = "bios_disable_override"; 158 output-high; 159 }; 160}; 161 162&gmac { 163 assigned-clocks = <&cru SCLK_RMII_SRC>; 164 assigned-clock-parents = <&clkin_gmac>; 165 clock_in_out = "input"; 166 phy-supply = <&vcc1v2_phy>; 167 phy-mode = "rgmii"; 168 pinctrl-names = "default"; 169 pinctrl-0 = <&rgmii_pins>; 170 snps,reset-gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>; 171 snps,reset-active-low; 172 snps,reset-delays-us = <0 10000 50000>; 173 tx_delay = <0x10>; 174 rx_delay = <0x23>; 175 status = "okay"; 176}; 177 178&gpu { 179 mali-supply = <&vdd_gpu>; 180 status = "okay"; 181}; 182 183&i2c0 { 184 status = "okay"; 185 i2c-scl-rising-time-ns = <168>; 186 i2c-scl-falling-time-ns = <4>; 187 clock-frequency = <400000>; 188 189 rk808: pmic@1b { 190 compatible = "rockchip,rk808"; 191 reg = <0x1b>; 192 interrupt-parent = <&gpio1>; 193 interrupts = <22 IRQ_TYPE_LEVEL_LOW>; 194 #clock-cells = <1>; 195 clock-output-names = "xin32k", "rk808-clkout2"; 196 pinctrl-names = "default"; 197 pinctrl-0 = <&pmic_int_l>; 198 rockchip,system-power-controller; 199 wakeup-source; 200 201 vcc1-supply = <&vcc5v0_sys>; 202 vcc2-supply = <&vcc5v0_sys>; 203 vcc3-supply = <&vcc5v0_sys>; 204 vcc4-supply = <&vcc5v0_sys>; 205 vcc6-supply = <&vcc5v0_sys>; 206 vcc7-supply = <&vcc5v0_sys>; 207 vcc8-supply = <&vcc3v3_sys>; 208 vcc9-supply = <&vcc5v0_sys>; 209 vcc10-supply = <&vcc5v0_sys>; 210 vcc11-supply = <&vcc5v0_sys>; 211 vcc12-supply = <&vcc3v3_sys>; 212 vddio-supply = <&vcc1v8_pmu>; 213 214 regulators { 215 vdd_center: DCDC_REG1 { 216 regulator-name = "vdd_center"; 217 regulator-min-microvolt = <750000>; 218 regulator-max-microvolt = <1350000>; 219 regulator-ramp-delay = <6001>; 220 regulator-always-on; 221 regulator-boot-on; 222 regulator-state-mem { 223 regulator-off-in-suspend; 224 }; 225 }; 226 227 vdd_cpu_l: DCDC_REG2 { 228 regulator-name = "vdd_cpu_l"; 229 regulator-min-microvolt = <750000>; 230 regulator-max-microvolt = <1350000>; 231 regulator-ramp-delay = <6001>; 232 regulator-always-on; 233 regulator-boot-on; 234 regulator-state-mem { 235 regulator-off-in-suspend; 236 }; 237 }; 238 239 vcc_ddr: DCDC_REG3 { 240 regulator-name = "vcc_ddr"; 241 regulator-always-on; 242 regulator-boot-on; 243 regulator-state-mem { 244 regulator-on-in-suspend; 245 }; 246 }; 247 248 vcc_1v8: DCDC_REG4 { 249 regulator-name = "vcc_1v8"; 250 regulator-min-microvolt = <1800000>; 251 regulator-max-microvolt = <1800000>; 252 regulator-always-on; 253 regulator-boot-on; 254 regulator-state-mem { 255 regulator-on-in-suspend; 256 regulator-suspend-microvolt = <1800000>; 257 }; 258 }; 259 260 vcc_ldo1: LDO_REG1 { 261 regulator-name = "vcc_ldo1"; 262 regulator-min-microvolt = <1800000>; 263 regulator-max-microvolt = <1800000>; 264 regulator-boot-on; 265 regulator-state-mem { 266 regulator-off-in-suspend; 267 }; 268 }; 269 270 vcc1v8_hdmi: LDO_REG2 { 271 regulator-name = "vcc1v8_hdmi"; 272 regulator-min-microvolt = <1800000>; 273 regulator-max-microvolt = <1800000>; 274 regulator-always-on; 275 regulator-boot-on; 276 regulator-state-mem { 277 regulator-off-in-suspend; 278 }; 279 }; 280 281 vcc1v8_pmu: LDO_REG3 { 282 regulator-name = "vcc1v8_pmu"; 283 regulator-min-microvolt = <1800000>; 284 regulator-max-microvolt = <1800000>; 285 regulator-always-on; 286 regulator-boot-on; 287 regulator-state-mem { 288 regulator-on-in-suspend; 289 regulator-suspend-microvolt = <1800000>; 290 }; 291 }; 292 293 vcc_sd: LDO_REG4 { 294 regulator-name = "vcc_sd"; 295 regulator-min-microvolt = <1800000>; 296 regulator-max-microvolt = <3000000>; 297 regulator-always-on; 298 regulator-boot-on; 299 regulator-state-mem { 300 regulator-on-in-suspend; 301 regulator-suspend-microvolt = <3000000>; 302 }; 303 }; 304 305 vcc_ldo5: LDO_REG5 { 306 regulator-name = "vcc_ldo5"; 307 regulator-min-microvolt = <3000000>; 308 regulator-max-microvolt = <3000000>; 309 regulator-boot-on; 310 regulator-state-mem { 311 regulator-off-in-suspend; 312 }; 313 }; 314 315 vcc_ldo6: LDO_REG6 { 316 regulator-name = "vcc_ldo6"; 317 regulator-min-microvolt = <1500000>; 318 regulator-max-microvolt = <1500000>; 319 regulator-boot-on; 320 regulator-state-mem { 321 regulator-off-in-suspend; 322 }; 323 }; 324 325 vcc0v9_hdmi: LDO_REG7 { 326 regulator-name = "vcc0v9_hdmi"; 327 regulator-min-microvolt = <900000>; 328 regulator-max-microvolt = <900000>; 329 regulator-always-on; 330 regulator-boot-on; 331 regulator-state-mem { 332 regulator-off-in-suspend; 333 }; 334 }; 335 336 vcc_efuse: LDO_REG8 { 337 regulator-name = "vcc_efuse"; 338 regulator-min-microvolt = <1800000>; 339 regulator-max-microvolt = <1800000>; 340 regulator-always-on; 341 regulator-boot-on; 342 regulator-state-mem { 343 regulator-off-in-suspend; 344 }; 345 }; 346 347 vcc3v3_s3: SWITCH_REG1 { 348 regulator-name = "vcc3v3_s3"; 349 regulator-always-on; 350 regulator-boot-on; 351 regulator-state-mem { 352 regulator-off-in-suspend; 353 }; 354 }; 355 356 vcc3v3_s0: SWITCH_REG2 { 357 regulator-name = "vcc3v3_s0"; 358 regulator-always-on; 359 regulator-boot-on; 360 regulator-state-mem { 361 regulator-off-in-suspend; 362 }; 363 }; 364 }; 365 }; 366 367 vdd_gpu: regulator@60 { 368 compatible = "fcs,fan53555"; 369 reg = <0x60>; 370 fcs,suspend-voltage-selector = <1>; 371 regulator-name = "vdd_gpu"; 372 regulator-min-microvolt = <600000>; 373 regulator-max-microvolt = <1230000>; 374 regulator-ramp-delay = <1000>; 375 regulator-always-on; 376 regulator-boot-on; 377 vin-supply = <&vcc5v0_sys>; 378 }; 379}; 380 381&i2c7 { 382 status = "okay"; 383 clock-frequency = <400000>; 384 385 fan: fan@18 { 386 compatible = "ti,amc6821"; 387 reg = <0x18>; 388 #cooling-cells = <2>; 389 }; 390 391 rtc_twi: rtc@6f { 392 compatible = "isil,isl1208"; 393 reg = <0x6f>; 394 }; 395}; 396 397&i2c8 { 398 status = "okay"; 399 clock-frequency = <400000>; 400 401 vdd_cpu_b: regulator@60 { 402 compatible = "fcs,fan53555"; 403 reg = <0x60>; 404 vin-supply = <&vcc5v0_sys>; 405 regulator-name = "vdd_cpu_b"; 406 regulator-min-microvolt = <600000>; 407 regulator-max-microvolt = <1230000>; 408 regulator-ramp-delay = <1000>; 409 fcs,suspend-voltage-selector = <1>; 410 regulator-always-on; 411 regulator-boot-on; 412 }; 413}; 414 415&i2s0 { 416 pinctrl-0 = <&i2s0_2ch_bus>; 417 pinctrl-1 = <&i2s0_2ch_bus_bclk_off>; 418 rockchip,playback-channels = <2>; 419 rockchip,capture-channels = <2>; 420 status = "okay"; 421}; 422 423/* 424 * As Q7 does not specify neither a global nor a RX clock for I2S these 425 * signals are not used. Furthermore I2S0_LRCK_RX is used as GPIO. 426 * Therefore we have to redefine the i2s0_2ch_bus and i2s0_2ch_bus_bclk_off 427 * definitions to prevent conflicts. 428 */ 429&i2s0_2ch_bus { 430 rockchip,pins = 431 <3 RK_PD0 1 &pcfg_pull_none>, 432 <3 RK_PD2 1 &pcfg_pull_none>, 433 <3 RK_PD3 1 &pcfg_pull_none>, 434 <3 RK_PD7 1 &pcfg_pull_none>; 435}; 436 437&i2s0_2ch_bus_bclk_off { 438 rockchip,pins = 439 <3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>, 440 <3 RK_PD2 1 &pcfg_pull_none>, 441 <3 RK_PD3 1 &pcfg_pull_none>, 442 <3 RK_PD7 1 &pcfg_pull_none>; 443}; 444 445&io_domains { 446 status = "okay"; 447 bt656-supply = <&vcc_1v8>; 448 audio-supply = <&vcc_1v8>; 449 sdmmc-supply = <&vcc_sd>; 450 gpio1830-supply = <&vcc_1v8>; 451}; 452 453&pcie0 { 454 /* PCIe PHY supplies */ 455 vpcie0v9-supply = <&vcca_0v9>; 456 vpcie1v8-supply = <&vcca_1v8>; 457}; 458 459&pcie_clkreqn_cpm { 460 rockchip,pins = 461 <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>; 462}; 463 464&pinctrl { 465 pinctrl-names = "default"; 466 pinctrl-0 = <&q7_thermal_pin &bios_disable_override_hog_pin>; 467 468 gpios { 469 bios_disable_override_hog_pin: bios-disable-override-hog-pin { 470 rockchip,pins = 471 <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_down>; 472 }; 473 474 q7_thermal_pin: q7-thermal-pin { 475 rockchip,pins = 476 <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; 477 }; 478 }; 479 480 i2c8 { 481 i2c8_xfer_a: i2c8-xfer { 482 rockchip,pins = 483 <1 RK_PC4 1 &pcfg_pull_up>, 484 <1 RK_PC5 1 &pcfg_pull_up>; 485 }; 486 }; 487 488 leds { 489 module_led_pin: module-led-pin { 490 rockchip,pins = 491 <2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>; 492 }; 493 }; 494 495 pmic { 496 pmic_int_l: pmic-int-l { 497 rockchip,pins = 498 <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>; 499 }; 500 }; 501 502 usb { 503 cy3304_reset: cy3304-reset { 504 rockchip,pins = 505 <4 RK_PA3 RK_FUNC_GPIO &pcfg_output_high>; 506 }; 507 }; 508 509 usb3 { 510 usb3_id: usb3-id { 511 rockchip,pins = 512 <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>; 513 }; 514 }; 515}; 516 517&pmu_io_domains { 518 status = "okay"; 519 pmu1830-supply = <&vcc_1v8>; 520}; 521 522&pwm2 { 523 status = "okay"; 524}; 525 526&sdhci { 527 /* 528 * Signal integrity isn't great at 200MHz but 100MHz has proven stable 529 * enough. 530 */ 531 max-frequency = <100000000>; 532 533 bus-width = <8>; 534 mmc-hs400-1_8v; 535 mmc-hs400-enhanced-strobe; 536 non-removable; 537 status = "okay"; 538}; 539 540&sdmmc { 541 vqmmc-supply = <&vcc_sd>; 542}; 543 544&spi1 { 545 status = "okay"; 546 547 norflash: flash@0 { 548 compatible = "jedec,spi-nor"; 549 reg = <0>; 550 spi-max-frequency = <50000000>; 551 }; 552}; 553 554&tcphy1 { 555 status = "okay"; 556}; 557 558&tsadc { 559 rockchip,hw-tshut-mode = <1>; 560 rockchip,hw-tshut-polarity = <1>; 561 status = "okay"; 562}; 563 564&u2phy1 { 565 status = "okay"; 566 567 u2phy1_otg: otg-port { 568 status = "okay"; 569 }; 570 571 u2phy1_host: host-port { 572 status = "okay"; 573 }; 574}; 575 576&usbdrd3_1 { 577 status = "okay"; 578}; 579 580&usbdrd_dwc3_1 { 581 status = "okay"; 582 dr_mode = "host"; 583 pinctrl-names = "default"; 584 pinctrl-0 = <&cy3304_reset>; 585 #address-cells = <1>; 586 #size-cells = <0>; 587 588 hub_2_0: hub@1 { 589 compatible = "usb4b4,6502", "usb4b4,6506"; 590 reg = <1>; 591 peer-hub = <&hub_3_0>; 592 reset-gpios = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>; 593 vdd-supply = <&vcc1v2_phy>; 594 vdd2-supply = <&vcc3v3_sys>; 595 596 }; 597 598 hub_3_0: hub@2 { 599 compatible = "usb4b4,6500", "usb4b4,6504"; 600 reg = <2>; 601 peer-hub = <&hub_2_0>; 602 reset-gpios = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>; 603 vdd-supply = <&vcc1v2_phy>; 604 vdd2-supply = <&vcc3v3_sys>; 605 }; 606}; 607 608&usb_host1_ehci { 609 status = "okay"; 610}; 611 612&usb_host1_ohci { 613 status = "okay"; 614}; 615