0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003 * Author: Frank Wunderlich <frank-w@public-files.de>
0004 *
0005 */
0006
0007 /dts-v1/;
0008 #include <dt-bindings/gpio/gpio.h>
0009 #include <dt-bindings/leds/common.h>
0010 #include <dt-bindings/pinctrl/rockchip.h>
0011 #include <dt-bindings/soc/rockchip,vop2.h>
0012 #include "rk3568.dtsi"
0013
0014 / {
0015 model = "Bananapi-R2 Pro (RK3568) DDR4 Board";
0016 compatible = "rockchip,rk3568-bpi-r2pro", "rockchip,rk3568";
0017
0018 aliases {
0019 ethernet0 = &gmac0;
0020 ethernet1 = &gmac1;
0021 mmc0 = &sdmmc0;
0022 mmc1 = &sdhci;
0023 };
0024
0025 chosen: chosen {
0026 stdout-path = "serial2:1500000n8";
0027 };
0028
0029 leds {
0030 compatible = "gpio-leds";
0031 pinctrl-names = "default";
0032 pinctrl-0 = <&blue_led_pin &green_led_pin>;
0033
0034 blue_led: led-0 {
0035 color = <LED_COLOR_ID_BLUE>;
0036 default-state = "off";
0037 function = LED_FUNCTION_STATUS;
0038 gpios = <&gpio0 RK_PD6 GPIO_ACTIVE_HIGH>;
0039 };
0040
0041 green_led: led-1 {
0042 color = <LED_COLOR_ID_GREEN>;
0043 default-state = "on";
0044 function = LED_FUNCTION_POWER;
0045 gpios = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>;
0046 };
0047 };
0048
0049 dc_12v: dc-12v {
0050 compatible = "regulator-fixed";
0051 regulator-name = "dc_12v";
0052 regulator-always-on;
0053 regulator-boot-on;
0054 regulator-min-microvolt = <12000000>;
0055 regulator-max-microvolt = <12000000>;
0056 };
0057
0058 hdmi-con {
0059 compatible = "hdmi-connector";
0060 type = "a";
0061
0062 port {
0063 hdmi_con_in: endpoint {
0064 remote-endpoint = <&hdmi_out_con>;
0065 };
0066 };
0067 };
0068
0069 vcc3v3_sys: vcc3v3-sys {
0070 compatible = "regulator-fixed";
0071 regulator-name = "vcc3v3_sys";
0072 regulator-always-on;
0073 regulator-boot-on;
0074 regulator-min-microvolt = <3300000>;
0075 regulator-max-microvolt = <3300000>;
0076 vin-supply = <&dc_12v>;
0077 };
0078
0079 vcc5v0_sys: vcc5v0-sys {
0080 compatible = "regulator-fixed";
0081 regulator-name = "vcc5v0_sys";
0082 regulator-always-on;
0083 regulator-boot-on;
0084 regulator-min-microvolt = <5000000>;
0085 regulator-max-microvolt = <5000000>;
0086 vin-supply = <&dc_12v>;
0087 };
0088
0089 vcc5v0_usb: vcc5v0_usb {
0090 compatible = "regulator-fixed";
0091 regulator-name = "vcc5v0_usb";
0092 regulator-always-on;
0093 regulator-boot-on;
0094 regulator-min-microvolt = <5000000>;
0095 regulator-max-microvolt = <5000000>;
0096 vin-supply = <&dc_12v>;
0097 };
0098
0099 vcc5v0_usb_host: vcc5v0-usb-host {
0100 compatible = "regulator-fixed";
0101 enable-active-high;
0102 gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
0103 pinctrl-names = "default";
0104 pinctrl-0 = <&vcc5v0_usb_host_en>;
0105 regulator-name = "vcc5v0_usb_host";
0106 regulator-min-microvolt = <5000000>;
0107 regulator-max-microvolt = <5000000>;
0108 vin-supply = <&vcc5v0_usb>;
0109 };
0110
0111 vcc5v0_usb_otg: vcc5v0-usb-otg {
0112 compatible = "regulator-fixed";
0113 enable-active-high;
0114 gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
0115 pinctrl-names = "default";
0116 pinctrl-0 = <&vcc5v0_usb_otg_en>;
0117 regulator-name = "vcc5v0_usb_otg";
0118 regulator-min-microvolt = <5000000>;
0119 regulator-max-microvolt = <5000000>;
0120 vin-supply = <&vcc5v0_usb>;
0121 };
0122 };
0123
0124 &combphy0 {
0125 /* used for USB3 */
0126 status = "okay";
0127 };
0128
0129 &combphy1 {
0130 /* used for USB3 */
0131 status = "okay";
0132 };
0133
0134 &combphy2 {
0135 /* used for SATA */
0136 status = "okay";
0137 };
0138
0139 &gmac0 {
0140 assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
0141 assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>;
0142 clock_in_out = "input";
0143 phy-mode = "rgmii";
0144 pinctrl-names = "default";
0145 pinctrl-0 = <&gmac0_miim
0146 &gmac0_tx_bus2
0147 &gmac0_rx_bus2
0148 &gmac0_rgmii_clk
0149 &gmac0_rgmii_bus>;
0150 snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
0151 snps,reset-active-low;
0152 /* Reset time is 20ms, 100ms for rtl8211f */
0153 snps,reset-delays-us = <0 20000 100000>;
0154 tx_delay = <0x4f>;
0155 rx_delay = <0x0f>;
0156 status = "okay";
0157
0158 fixed-link {
0159 speed = <1000>;
0160 full-duplex;
0161 pause;
0162 };
0163 };
0164
0165 &gmac1 {
0166 assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
0167 assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru CLK_MAC1_2TOP>;
0168 clock_in_out = "output";
0169 phy-handle = <&rgmii_phy1>;
0170 phy-mode = "rgmii";
0171 pinctrl-names = "default";
0172 pinctrl-0 = <&gmac1m1_miim
0173 &gmac1m1_tx_bus2
0174 &gmac1m1_rx_bus2
0175 &gmac1m1_rgmii_clk
0176 &gmac1m1_rgmii_bus>;
0177
0178 snps,reset-gpio = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
0179 snps,reset-active-low;
0180 /* Reset time is 20ms, 100ms for rtl8211f */
0181 snps,reset-delays-us = <0 20000 100000>;
0182
0183 tx_delay = <0x3c>;
0184 rx_delay = <0x2f>;
0185
0186 status = "okay";
0187 };
0188
0189 &gpu {
0190 mali-supply = <&vdd_gpu>;
0191 status = "okay";
0192 };
0193
0194 &hdmi {
0195 avdd-0v9-supply = <&vdda0v9_image>;
0196 avdd-1v8-supply = <&vcca1v8_image>;
0197 status = "okay";
0198 };
0199
0200 &hdmi_in {
0201 hdmi_in_vp0: endpoint {
0202 remote-endpoint = <&vp0_out_hdmi>;
0203 };
0204 };
0205
0206 &hdmi_out {
0207 hdmi_out_con: endpoint {
0208 remote-endpoint = <&hdmi_con_in>;
0209 };
0210 };
0211
0212 &hdmi_sound {
0213 status = "okay";
0214 };
0215
0216 &i2c0 {
0217 status = "okay";
0218
0219 rk809: pmic@20 {
0220 compatible = "rockchip,rk809";
0221 reg = <0x20>;
0222 interrupt-parent = <&gpio0>;
0223 interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
0224 #clock-cells = <1>;
0225 pinctrl-names = "default";
0226 pinctrl-0 = <&pmic_int>;
0227 rockchip,system-power-controller;
0228 vcc1-supply = <&vcc3v3_sys>;
0229 vcc2-supply = <&vcc3v3_sys>;
0230 vcc3-supply = <&vcc3v3_sys>;
0231 vcc4-supply = <&vcc3v3_sys>;
0232 vcc5-supply = <&vcc3v3_sys>;
0233 vcc6-supply = <&vcc3v3_sys>;
0234 vcc7-supply = <&vcc3v3_sys>;
0235 vcc8-supply = <&vcc3v3_sys>;
0236 vcc9-supply = <&vcc3v3_sys>;
0237 wakeup-source;
0238
0239 regulators {
0240 vdd_logic: DCDC_REG1 {
0241 regulator-name = "vdd_logic";
0242 regulator-always-on;
0243 regulator-boot-on;
0244 regulator-init-microvolt = <900000>;
0245 regulator-initial-mode = <0x2>;
0246 regulator-min-microvolt = <500000>;
0247 regulator-max-microvolt = <1350000>;
0248 regulator-ramp-delay = <6001>;
0249
0250 regulator-state-mem {
0251 regulator-off-in-suspend;
0252 };
0253 };
0254
0255 vdd_gpu: DCDC_REG2 {
0256 regulator-name = "vdd_gpu";
0257 regulator-always-on;
0258 regulator-init-microvolt = <900000>;
0259 regulator-initial-mode = <0x2>;
0260 regulator-min-microvolt = <500000>;
0261 regulator-max-microvolt = <1350000>;
0262 regulator-ramp-delay = <6001>;
0263
0264 regulator-state-mem {
0265 regulator-off-in-suspend;
0266 };
0267 };
0268
0269 vcc_ddr: DCDC_REG3 {
0270 regulator-name = "vcc_ddr";
0271 regulator-always-on;
0272 regulator-boot-on;
0273 regulator-initial-mode = <0x2>;
0274
0275 regulator-state-mem {
0276 regulator-on-in-suspend;
0277 };
0278 };
0279
0280 vdd_npu: DCDC_REG4 {
0281 regulator-name = "vdd_npu";
0282 regulator-init-microvolt = <900000>;
0283 regulator-initial-mode = <0x2>;
0284 regulator-min-microvolt = <500000>;
0285 regulator-max-microvolt = <1350000>;
0286 regulator-ramp-delay = <6001>;
0287
0288 regulator-state-mem {
0289 regulator-off-in-suspend;
0290 };
0291 };
0292
0293 vcc_1v8: DCDC_REG5 {
0294 regulator-name = "vcc_1v8";
0295 regulator-always-on;
0296 regulator-boot-on;
0297 regulator-min-microvolt = <1800000>;
0298 regulator-max-microvolt = <1800000>;
0299
0300 regulator-state-mem {
0301 regulator-off-in-suspend;
0302 };
0303 };
0304
0305 vdda0v9_image: LDO_REG1 {
0306 regulator-name = "vdda0v9_image";
0307 regulator-always-on;
0308 regulator-min-microvolt = <900000>;
0309 regulator-max-microvolt = <900000>;
0310
0311 regulator-state-mem {
0312 regulator-off-in-suspend;
0313 };
0314 };
0315
0316 vdda_0v9: LDO_REG2 {
0317 regulator-name = "vdda_0v9";
0318 regulator-always-on;
0319 regulator-boot-on;
0320 regulator-min-microvolt = <900000>;
0321 regulator-max-microvolt = <900000>;
0322
0323 regulator-state-mem {
0324 regulator-off-in-suspend;
0325 };
0326 };
0327
0328 vdda0v9_pmu: LDO_REG3 {
0329 regulator-name = "vdda0v9_pmu";
0330 regulator-always-on;
0331 regulator-boot-on;
0332 regulator-min-microvolt = <900000>;
0333 regulator-max-microvolt = <900000>;
0334
0335 regulator-state-mem {
0336 regulator-on-in-suspend;
0337 regulator-suspend-microvolt = <900000>;
0338 };
0339 };
0340
0341 vccio_acodec: LDO_REG4 {
0342 regulator-name = "vccio_acodec";
0343 regulator-always-on;
0344 regulator-boot-on;
0345 regulator-min-microvolt = <3300000>;
0346 regulator-max-microvolt = <3300000>;
0347
0348 regulator-state-mem {
0349 regulator-off-in-suspend;
0350 };
0351 };
0352
0353 vccio_sd: LDO_REG5 {
0354 regulator-name = "vccio_sd";
0355 regulator-min-microvolt = <1800000>;
0356 regulator-max-microvolt = <3300000>;
0357
0358 regulator-state-mem {
0359 regulator-off-in-suspend;
0360 };
0361 };
0362
0363 vcc3v3_pmu: LDO_REG6 {
0364 regulator-name = "vcc3v3_pmu";
0365 regulator-always-on;
0366 regulator-boot-on;
0367 regulator-min-microvolt = <3300000>;
0368 regulator-max-microvolt = <3300000>;
0369
0370 regulator-state-mem {
0371 regulator-on-in-suspend;
0372 regulator-suspend-microvolt = <3300000>;
0373 };
0374 };
0375
0376 vcca_1v8: LDO_REG7 {
0377 regulator-name = "vcca_1v8";
0378 regulator-always-on;
0379 regulator-boot-on;
0380 regulator-min-microvolt = <1800000>;
0381 regulator-max-microvolt = <1800000>;
0382
0383 regulator-state-mem {
0384 regulator-off-in-suspend;
0385 };
0386 };
0387
0388 vcca1v8_pmu: LDO_REG8 {
0389 regulator-name = "vcca1v8_pmu";
0390 regulator-always-on;
0391 regulator-boot-on;
0392 regulator-min-microvolt = <1800000>;
0393 regulator-max-microvolt = <1800000>;
0394
0395 regulator-state-mem {
0396 regulator-on-in-suspend;
0397 regulator-suspend-microvolt = <1800000>;
0398 };
0399 };
0400
0401 vcca1v8_image: LDO_REG9 {
0402 regulator-name = "vcca1v8_image";
0403 regulator-always-on;
0404 regulator-min-microvolt = <1800000>;
0405 regulator-max-microvolt = <1800000>;
0406
0407 regulator-state-mem {
0408 regulator-off-in-suspend;
0409 };
0410 };
0411
0412 vcc_3v3: SWITCH_REG1 {
0413 regulator-name = "vcc_3v3";
0414 regulator-always-on;
0415 regulator-boot-on;
0416
0417 regulator-state-mem {
0418 regulator-off-in-suspend;
0419 };
0420 };
0421
0422 vcc3v3_sd: SWITCH_REG2 {
0423 regulator-name = "vcc3v3_sd";
0424 regulator-always-on;
0425
0426 regulator-state-mem {
0427 regulator-off-in-suspend;
0428 };
0429 };
0430 };
0431 };
0432 };
0433
0434 &i2c3 {
0435 status = "okay";
0436
0437 hym8563: rtc@51 {
0438 compatible = "haoyu,hym8563";
0439 reg = <0x51>;
0440 interrupt-parent = <&gpio0>;
0441 interrupts = <RK_PD3 IRQ_TYPE_EDGE_FALLING>;
0442 #clock-cells = <0>;
0443 clock-frequency = <32768>;
0444 clock-output-names = "rtcic_32kout";
0445 pinctrl-names = "default";
0446 pinctrl-0 = <&hym8563_int>;
0447 wakeup-source;
0448 };
0449 };
0450
0451 &i2c5 {
0452 /* pin 3 (SDA) + 4 (SCL) of header con2 */
0453 status = "disabled";
0454 };
0455
0456 &i2s0_8ch {
0457 /* hdmi sound */
0458 status = "okay";
0459 };
0460
0461 &mdio0 {
0462 #address-cells = <1>;
0463 #size-cells = <0>;
0464
0465 switch@0 {
0466 compatible = "mediatek,mt7531";
0467 reg = <0>;
0468
0469 ports {
0470 #address-cells = <1>;
0471 #size-cells = <0>;
0472
0473 port@1 {
0474 reg = <1>;
0475 label = "lan0";
0476 };
0477
0478 port@2 {
0479 reg = <2>;
0480 label = "lan1";
0481 };
0482
0483 port@3 {
0484 reg = <3>;
0485 label = "lan2";
0486 };
0487
0488 port@4 {
0489 reg = <4>;
0490 label = "lan3";
0491 };
0492
0493 port@5 {
0494 reg = <5>;
0495 label = "cpu";
0496 ethernet = <&gmac0>;
0497 phy-mode = "rgmii";
0498
0499 fixed-link {
0500 speed = <1000>;
0501 full-duplex;
0502 pause;
0503 };
0504 };
0505 };
0506 };
0507 };
0508
0509 &mdio1 {
0510 rgmii_phy1: ethernet-phy@0 {
0511 compatible = "ethernet-phy-ieee802.3-c22";
0512 reg = <0x0>;
0513 };
0514 };
0515
0516 &pinctrl {
0517 leds {
0518 blue_led_pin: blue-led-pin {
0519 rockchip,pins = <0 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
0520 };
0521 green_led_pin: green-led-pin {
0522 rockchip,pins = <0 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
0523 };
0524 };
0525
0526 hym8563 {
0527 hym8563_int: hym8563-int {
0528 rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
0529 };
0530 };
0531
0532 pmic {
0533 pmic_int: pmic_int {
0534 rockchip,pins =
0535 <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
0536 };
0537 };
0538
0539 usb {
0540 vcc5v0_usb_host_en: vcc5v0_usb_host_en {
0541 rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
0542 };
0543
0544 vcc5v0_usb_otg_en: vcc5v0_usb_otg_en {
0545 rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
0546 };
0547 };
0548 };
0549
0550 &pmu_io_domains {
0551 pmuio1-supply = <&vcc3v3_pmu>;
0552 pmuio2-supply = <&vcc3v3_pmu>;
0553 vccio1-supply = <&vccio_acodec>;
0554 vccio3-supply = <&vccio_sd>;
0555 vccio4-supply = <&vcc_3v3>;
0556 vccio5-supply = <&vcc_3v3>;
0557 vccio6-supply = <&vcc_1v8>;
0558 vccio7-supply = <&vcc_3v3>;
0559 status = "okay";
0560 };
0561
0562 &pwm8 {
0563 /* fan 5v - gnd - pwm */
0564 status = "okay";
0565 };
0566
0567 &pwm10 {
0568 /* pin 7 of header con2 */
0569 status = "disabled";
0570 };
0571
0572 &pwm11 {
0573 /* pin 15 of header con2 */
0574 status = "disabled";
0575 };
0576
0577 &pwm12 {
0578 /* pin 21 of header con2 */
0579 /* shared with uart9 + spi3 */
0580 pinctrl-0 = <&pwm12m1_pins>;
0581 status = "disabled";
0582 };
0583
0584 &pwm13 {
0585 /* pin 24 of header con2 */
0586 /* shared with uart9 */
0587 pinctrl-0 = <&pwm13m1_pins>;
0588 status = "disabled";
0589 };
0590
0591 &pwm14 {
0592 /* pin 23 of header con2 */
0593 /* shared with spi3 */
0594 pinctrl-0 = <&pwm14m1_pins>;
0595 status = "disabled";
0596 };
0597
0598 &pwm15 {
0599 /* pin 19 of header con2 */
0600 /* shared with spi3 */
0601 pinctrl-0 = <&pwm15m1_pins>;
0602 status = "disabled";
0603 };
0604
0605 &saradc {
0606 vref-supply = <&vcca_1v8>;
0607 status = "okay";
0608 };
0609
0610 &sata2 {
0611 status = "okay";
0612 };
0613
0614 &sdhci {
0615 bus-width = <8>;
0616 max-frequency = <200000000>;
0617 non-removable;
0618 pinctrl-names = "default";
0619 pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
0620 status = "okay";
0621 };
0622
0623 &sdmmc0 {
0624 bus-width = <4>;
0625 cap-sd-highspeed;
0626 cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
0627 disable-wp;
0628 pinctrl-names = "default";
0629 pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
0630 sd-uhs-sdr104;
0631 vmmc-supply = <&vcc3v3_sd>;
0632 vqmmc-supply = <&vccio_sd>;
0633 status = "okay";
0634 };
0635
0636 &spi3 {
0637 /* pin 19 (MO) + 21 (MI) + 23 (CK) of header con2 */
0638 /* shared with pwm12/14/15 and uart9 */
0639 pinctrl-0 = <&spi3m1_pins>;
0640 status = "disabled";
0641 };
0642
0643 &tsadc {
0644 rockchip,hw-tshut-mode = <1>;
0645 rockchip,hw-tshut-polarity = <0>;
0646 status = "okay";
0647 };
0648
0649 &uart0 {
0650 /* pin 8 (TX) + 10 (RX) (RTS:16, CTS:18) of header con2 */
0651 status = "disabled";
0652 };
0653
0654 &uart2 {
0655 /* debug-uart */
0656 status = "okay";
0657 };
0658
0659 &uart7 {
0660 /* pin 11 (TX) + 13 (RX) of header con2 */
0661 pinctrl-0 = <&uart7m1_xfer>;
0662 status = "disabled";
0663 };
0664
0665 &uart9 {
0666 /* pin 21 (TX) + 24 (RX) of header con2 */
0667 /* shared with pwm13 and pwm12/spi3 */
0668 pinctrl-0 = <&uart9m1_xfer>;
0669 status = "disabled";
0670 };
0671
0672 &usb_host0_ehci {
0673 status = "okay";
0674 };
0675
0676 &usb_host0_ohci {
0677 status = "okay";
0678 };
0679
0680 &usb_host0_xhci {
0681 dr_mode = "host";
0682 status = "okay";
0683 };
0684
0685 &usb_host1_ehci {
0686 status = "okay";
0687 };
0688
0689 &usb_host1_ohci {
0690 status = "okay";
0691 };
0692
0693 &usb_host1_xhci {
0694 status = "okay";
0695 };
0696
0697 &usb2phy0 {
0698 status = "okay";
0699 };
0700
0701 &usb2phy0_host {
0702 phy-supply = <&vcc5v0_usb_host>;
0703 status = "okay";
0704 };
0705
0706 &usb2phy0_otg {
0707 phy-supply = <&vcc5v0_usb_otg>;
0708 status = "okay";
0709 };
0710
0711 &vop {
0712 assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
0713 assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
0714 status = "okay";
0715 };
0716
0717 &vop_mmu {
0718 status = "okay";
0719 };
0720
0721 &vp0 {
0722 vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
0723 reg = <ROCKCHIP_VOP2_EP_HDMI0>;
0724 remote-endpoint = <&hdmi_in_vp0>;
0725 };
0726 };