Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * Copyright (c) 2018 Collabora Ltd.
0004  * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd.
0005  * Copyright (c) 2018 Linaro Ltd.
0006  */
0007 
0008 #include "rk3399.dtsi"
0009 #include "rk3399-opp.dtsi"
0010 #include <dt-bindings/interrupt-controller/irq.h>
0011 
0012 / {
0013         aliases {
0014                 mmc0 = &sdio0;
0015                 mmc1 = &sdmmc;
0016                 mmc2 = &sdhci;
0017         };
0018 
0019         sdio_pwrseq: sdio-pwrseq {
0020                 compatible = "mmc-pwrseq-simple";
0021                 clocks = <&rk808 1>;
0022                 clock-names = "ext_clock";
0023                 pinctrl-names = "default";
0024                 pinctrl-0 = <&wifi_enable_h>;
0025                 reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
0026         };
0027 
0028         vcc12v_dcin: vcc12v-dcin {
0029                 compatible = "regulator-fixed";
0030                 regulator-name = "vcc12v_dcin";
0031                 regulator-min-microvolt = <12000000>;
0032                 regulator-max-microvolt = <12000000>;
0033                 regulator-always-on;
0034                 regulator-boot-on;
0035         };
0036 
0037         vcc1v8_s0: vcc1v8-s0 {
0038                 compatible = "regulator-fixed";
0039                 regulator-name = "vcc1v8_s0";
0040                 regulator-min-microvolt = <1800000>;
0041                 regulator-max-microvolt = <1800000>;
0042                 regulator-always-on;
0043         };
0044 
0045         vcc5v0_sys: vcc5v0-sys {
0046                 compatible = "regulator-fixed";
0047                 regulator-name = "vcc5v0_sys";
0048                 regulator-min-microvolt = <5000000>;
0049                 regulator-max-microvolt = <5000000>;
0050                 regulator-always-on;
0051                 vin-supply = <&vcc12v_dcin>;
0052         };
0053 
0054         vcc3v3_sys: vcc3v3-sys {
0055                 compatible = "regulator-fixed";
0056                 regulator-name = "vcc3v3_sys";
0057                 regulator-min-microvolt = <3300000>;
0058                 regulator-max-microvolt = <3300000>;
0059                 regulator-always-on;
0060                 vin-supply = <&vcc5v0_sys>;
0061         };
0062 
0063         vcc3v3_pcie: vcc3v3-pcie-regulator {
0064                 compatible = "regulator-fixed";
0065                 enable-active-high;
0066                 pinctrl-names = "default";
0067                 pinctrl-0 = <&pcie_drv>;
0068                 regulator-boot-on;
0069                 regulator-name = "vcc3v3_pcie";
0070                 regulator-min-microvolt = <3300000>;
0071                 regulator-max-microvolt = <3300000>;
0072                 vin-supply = <&vcc3v3_sys>;
0073         };
0074 
0075         vcc5v0_host: vcc5v0-host-regulator {
0076                 compatible = "regulator-fixed";
0077                 enable-active-high;
0078                 pinctrl-names = "default";
0079                 pinctrl-0 = <&host_vbus_drv>;
0080                 regulator-name = "vcc5v0_host";
0081                 regulator-min-microvolt = <5000000>;
0082                 regulator-max-microvolt = <5000000>;
0083                 regulator-always-on;
0084                 vin-supply = <&vcc5v0_sys>;
0085         };
0086 
0087         vcc_0v9: vcc-0v9 {
0088                 compatible = "regulator-fixed";
0089                 regulator-name = "vcc_0v9";
0090                 regulator-always-on;
0091                 regulator-min-microvolt = <900000>;
0092                 regulator-max-microvolt = <900000>;
0093                 vin-supply = <&vcc3v3_sys>;
0094         };
0095 };
0096 
0097 &cpu_l0 {
0098         cpu-supply = <&vdd_cpu_l>;
0099 };
0100 
0101 &cpu_l1 {
0102         cpu-supply = <&vdd_cpu_l>;
0103 };
0104 
0105 &cpu_l2 {
0106         cpu-supply = <&vdd_cpu_l>;
0107 };
0108 
0109 &cpu_l3 {
0110         cpu-supply = <&vdd_cpu_l>;
0111 };
0112 
0113 &cpu_b0 {
0114         cpu-supply = <&vdd_cpu_b>;
0115 };
0116 
0117 &cpu_b1 {
0118         cpu-supply = <&vdd_cpu_b>;
0119 };
0120 
0121 &emmc_phy {
0122         status = "okay";
0123 };
0124 
0125 &gpu {
0126         mali-supply = <&vdd_gpu>;
0127         status = "okay";
0128 };
0129 
0130 &hdmi {
0131         ddc-i2c-bus = <&i2c3>;
0132         pinctrl-names = "default";
0133         pinctrl-0 = <&hdmi_cec>;
0134         status = "okay";
0135 };
0136 
0137 &hdmi_sound {
0138         status = "okay";
0139 };
0140 
0141 &i2c0 {
0142         clock-frequency = <400000>;
0143         i2c-scl-rising-time-ns = <168>;
0144         i2c-scl-falling-time-ns = <4>;
0145         status = "okay";
0146 
0147         vdd_cpu_b: regulator@40 {
0148                 compatible = "silergy,syr827";
0149                 reg = <0x40>;
0150                 fcs,suspend-voltage-selector = <1>;
0151                 regulator-name = "vdd_cpu_b";
0152                 regulator-min-microvolt = <712500>;
0153                 regulator-max-microvolt = <1500000>;
0154                 regulator-ramp-delay = <1000>;
0155                 regulator-always-on;
0156                 regulator-boot-on;
0157                 vin-supply = <&vcc5v0_sys>;
0158                 status = "okay";
0159 
0160                 regulator-state-mem {
0161                         regulator-off-in-suspend;
0162                 };
0163         };
0164 
0165         vdd_gpu: regulator@41 {
0166                 compatible = "silergy,syr828";
0167                 reg = <0x41>;
0168                 fcs,suspend-voltage-selector = <1>;
0169                 regulator-name = "vdd_gpu";
0170                 regulator-min-microvolt = <712500>;
0171                 regulator-max-microvolt = <1500000>;
0172                 regulator-ramp-delay = <1000>;
0173                 regulator-always-on;
0174                 regulator-boot-on;
0175                 vin-supply = <&vcc5v0_sys>;
0176                 regulator-state-mem {
0177                         regulator-off-in-suspend;
0178                 };
0179         };
0180 
0181         rk808: pmic@1b {
0182                 compatible = "rockchip,rk808";
0183                 reg = <0x1b>;
0184                 interrupt-parent = <&gpio1>;
0185                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
0186                 pinctrl-names = "default";
0187                 pinctrl-0 = <&pmic_int_l>;
0188                 rockchip,system-power-controller;
0189                 wakeup-source;
0190                 #clock-cells = <1>;
0191                 clock-output-names = "xin32k", "rk808-clkout2";
0192 
0193                 vcc1-supply = <&vcc5v0_sys>;
0194                 vcc2-supply = <&vcc5v0_sys>;
0195                 vcc3-supply = <&vcc5v0_sys>;
0196                 vcc4-supply = <&vcc5v0_sys>;
0197                 vcc6-supply = <&vcc5v0_sys>;
0198                 vcc7-supply = <&vcc5v0_sys>;
0199                 vcc8-supply = <&vcc3v3_sys>;
0200                 vcc9-supply = <&vcc5v0_sys>;
0201                 vcc10-supply = <&vcc5v0_sys>;
0202                 vcc11-supply = <&vcc5v0_sys>;
0203                 vcc12-supply = <&vcc3v3_sys>;
0204                 vddio-supply = <&vcc_1v8>;
0205 
0206                 regulators {
0207                         vdd_center: DCDC_REG1 {
0208                                 regulator-name = "vdd_center";
0209                                 regulator-min-microvolt = <750000>;
0210                                 regulator-max-microvolt = <1350000>;
0211                                 regulator-always-on;
0212                                 regulator-boot-on;
0213                                 regulator-state-mem {
0214                                         regulator-off-in-suspend;
0215                                 };
0216                         };
0217 
0218                         vdd_cpu_l: DCDC_REG2 {
0219                                 regulator-name = "vdd_cpu_l";
0220                                 regulator-min-microvolt = <750000>;
0221                                 regulator-max-microvolt = <1350000>;
0222                                 regulator-always-on;
0223                                 regulator-boot-on;
0224                                 regulator-state-mem {
0225                                         regulator-off-in-suspend;
0226                                 };
0227                         };
0228 
0229                         vcc_ddr: DCDC_REG3 {
0230                                 regulator-name = "vcc_ddr";
0231                                 regulator-always-on;
0232                                 regulator-boot-on;
0233                                 regulator-state-mem {
0234                                         regulator-on-in-suspend;
0235                                 };
0236                         };
0237 
0238                         vcc_1v8: DCDC_REG4 {
0239                                 regulator-name = "vcc_1v8";
0240                                 regulator-min-microvolt = <1800000>;
0241                                 regulator-max-microvolt = <1800000>;
0242                                 regulator-always-on;
0243                                 regulator-boot-on;
0244                                 regulator-state-mem {
0245                                         regulator-on-in-suspend;
0246                                         regulator-suspend-microvolt = <1800000>;
0247                                 };
0248                         };
0249 
0250                         vcc1v8_dvp: LDO_REG1 {
0251                                 regulator-name = "vcc1v8_dvp";
0252                                 regulator-min-microvolt = <1800000>;
0253                                 regulator-max-microvolt = <1800000>;
0254                                 regulator-always-on;
0255                                 regulator-boot-on;
0256                                 regulator-state-mem {
0257                                         regulator-on-in-suspend;
0258                                         regulator-suspend-microvolt = <1800000>;
0259                                 };
0260                         };
0261 
0262                         vcca1v8_hdmi: LDO_REG2 {
0263                                 regulator-name = "vcca1v8_hdmi";
0264                                 regulator-min-microvolt = <1800000>;
0265                                 regulator-max-microvolt = <1800000>;
0266                                 regulator-always-on;
0267                                 regulator-boot-on;
0268                                 regulator-state-mem {
0269                                         regulator-on-in-suspend;
0270                                         regulator-suspend-microvolt = <1800000>;
0271                                 };
0272                         };
0273 
0274                         vcca_1v8: LDO_REG3 {
0275                                 regulator-name = "vcca_1v8";
0276                                 regulator-min-microvolt = <1800000>;
0277                                 regulator-max-microvolt = <1800000>;
0278                                 regulator-always-on;
0279                                 regulator-boot-on;
0280                                 regulator-state-mem {
0281                                         regulator-on-in-suspend;
0282                                         regulator-suspend-microvolt = <1800000>;
0283                                 };
0284                         };
0285 
0286                         vcc_sd: LDO_REG4 {
0287                                 regulator-name = "vcc_sd";
0288                                 regulator-min-microvolt = <1800000>;
0289                                 regulator-max-microvolt = <3300000>;
0290                                 regulator-always-on;
0291                                 regulator-boot-on;
0292                                 regulator-state-mem {
0293                                         regulator-on-in-suspend;
0294                                         regulator-suspend-microvolt = <3300000>;
0295                                 };
0296                         };
0297 
0298                         vcc3v0_sd: LDO_REG5 {
0299                                 regulator-name = "vcc3v0_sd";
0300                                 regulator-min-microvolt = <3000000>;
0301                                 regulator-max-microvolt = <3000000>;
0302                                 regulator-always-on;
0303                                 regulator-boot-on;
0304                                 regulator-state-mem {
0305                                         regulator-on-in-suspend;
0306                                         regulator-suspend-microvolt = <3000000>;
0307                                 };
0308                         };
0309 
0310                         vcc_1v5: LDO_REG6 {
0311                                 regulator-name = "vcc_1v5";
0312                                 regulator-min-microvolt = <1500000>;
0313                                 regulator-max-microvolt = <1500000>;
0314                                 regulator-always-on;
0315                                 regulator-boot-on;
0316                                 regulator-state-mem {
0317                                         regulator-on-in-suspend;
0318                                         regulator-suspend-microvolt = <1500000>;
0319                                 };
0320                         };
0321 
0322                         vcca0v9_hdmi: LDO_REG7 {
0323                                 regulator-name = "vcca0v9_hdmi";
0324                                 regulator-min-microvolt = <900000>;
0325                                 regulator-max-microvolt = <900000>;
0326                                 regulator-always-on;
0327                                 regulator-boot-on;
0328                                 regulator-state-mem {
0329                                         regulator-on-in-suspend;
0330                                         regulator-suspend-microvolt = <900000>;
0331                                 };
0332                         };
0333 
0334                         vcc_3v0: LDO_REG8 {
0335                                 regulator-name = "vcc_3v0";
0336                                 regulator-min-microvolt = <3000000>;
0337                                 regulator-max-microvolt = <3000000>;
0338                                 regulator-always-on;
0339                                 regulator-boot-on;
0340                                 regulator-state-mem {
0341                                         regulator-on-in-suspend;
0342                                         regulator-suspend-microvolt = <3000000>;
0343                                 };
0344                         };
0345 
0346                         vcc3v3_s3: SWITCH_REG1 {
0347                                 regulator-name = "vcc3v3_s3";
0348                                 regulator-always-on;
0349                                 regulator-boot-on;
0350                                 regulator-state-mem {
0351                                         regulator-on-in-suspend;
0352                                 };
0353                         };
0354 
0355                         vcc3v3_s0: SWITCH_REG2 {
0356                                 regulator-name = "vcc3v3_s0";
0357                                 regulator-always-on;
0358                                 regulator-boot-on;
0359                                 regulator-state-mem {
0360                                         regulator-on-in-suspend;
0361                                 };
0362                         };
0363                 };
0364         };
0365 };
0366 
0367 &i2c1 {
0368         status = "okay";
0369 };
0370 
0371 &i2c2 {
0372         status = "okay";
0373 };
0374 
0375 &i2c3 {
0376         status = "okay";
0377 };
0378 
0379 &i2c4 {
0380         status = "okay";
0381 };
0382 
0383 &i2s2 {
0384         status = "okay";
0385 };
0386 
0387 &io_domains {
0388         bt656-supply = <&vcc1v8_s0>; /* bt656_gpio2ab_ms */
0389         audio-supply = <&vcc1v8_s0>; /* audio_gpio3d4a_ms */
0390         sdmmc-supply = <&vcc_sd>; /* sdmmc_gpio4b_ms */
0391         gpio1830-supply = <&vcc_3v0>; /* gpio1833_gpio4cd_ms */
0392         status = "okay";
0393 };
0394 
0395 &pcie_phy {
0396         status = "okay";
0397 };
0398 
0399 &pcie0 {
0400         num-lanes = <4>;
0401         pinctrl-names = "default";
0402         pinctrl-0 = <&pcie_clkreqn_cpm>;
0403         vpcie0v9-supply = <&vcc_0v9>;
0404         vpcie1v8-supply = <&vcca_1v8>;
0405         vpcie3v3-supply = <&vcc3v3_pcie>;
0406         status = "okay";
0407 };
0408 
0409 &pmu_io_domains {
0410         pmu1830-supply = <&vcc_1v8>;
0411         status = "okay";
0412 };
0413 
0414 &pinctrl {
0415         bt {
0416                 bt_enable_h: bt-enable-h {
0417                         rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
0418                 };
0419 
0420                 bt_host_wake_l: bt-host-wake-l {
0421                         rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
0422                 };
0423 
0424                 bt_wake_l: bt-wake-l {
0425                         rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
0426                 };
0427         };
0428 
0429         sdmmc {
0430                 sdmmc_bus1: sdmmc-bus1 {
0431                         rockchip,pins =
0432                                 <4 RK_PB0 1 &pcfg_pull_up_8ma>;
0433                 };
0434 
0435                 sdmmc_bus4: sdmmc-bus4 {
0436                         rockchip,pins =
0437                                 <4 RK_PB0 1 &pcfg_pull_up_8ma>,
0438                                 <4 RK_PB1 1 &pcfg_pull_up_8ma>,
0439                                 <4 RK_PB2 1 &pcfg_pull_up_8ma>,
0440                                 <4 RK_PB3 1 &pcfg_pull_up_8ma>;
0441                 };
0442 
0443                 sdmmc_clk: sdmmc-clk {
0444                         rockchip,pins =
0445                                 <4 RK_PB4 1 &pcfg_pull_none_18ma>;
0446                 };
0447 
0448                 sdmmc_cmd: sdmmc-cmd {
0449                         rockchip,pins =
0450                                 <4 RK_PB5 1 &pcfg_pull_up_8ma>;
0451                 };
0452         };
0453 
0454         sdio0 {
0455                 sdio0_bus4: sdio0-bus4 {
0456                         rockchip,pins =
0457                                 <2 RK_PC4 1 &pcfg_pull_up_20ma>,
0458                                 <2 RK_PC5 1 &pcfg_pull_up_20ma>,
0459                                 <2 RK_PC6 1 &pcfg_pull_up_20ma>,
0460                                 <2 RK_PC7 1 &pcfg_pull_up_20ma>;
0461                 };
0462 
0463                 sdio0_cmd: sdio0-cmd {
0464                         rockchip,pins =
0465                                 <2 RK_PD0 1 &pcfg_pull_up_20ma>;
0466                 };
0467 
0468                 sdio0_clk: sdio0-clk {
0469                         rockchip,pins =
0470                                 <2 RK_PD1 1 &pcfg_pull_none_20ma>;
0471                 };
0472         };
0473 
0474         pmic {
0475                 pmic_int_l: pmic-int-l {
0476                         rockchip,pins =
0477                                 <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
0478                 };
0479 
0480                 vsel1_pin: vsel1-pin {
0481                         rockchip,pins =
0482                                 <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
0483                 };
0484 
0485                 vsel2_pin: vsel2-pin {
0486                         rockchip,pins =
0487                                 <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
0488                 };
0489         };
0490 
0491         sdio-pwrseq {
0492                 wifi_enable_h: wifi-enable-h {
0493                         rockchip,pins =
0494                                 <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
0495                 };
0496         };
0497 
0498         wifi {
0499                 wifi_host_wake_l: wifi-host-wake-l {
0500                         rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
0501                 };
0502         };
0503 };
0504 
0505 &pwm2 {
0506         status = "okay";
0507 };
0508 
0509 &pwm3 {
0510         status = "okay";
0511 };
0512 
0513 &sdio0 {
0514         bus-width = <4>;
0515         clock-frequency = <50000000>;
0516         cap-sdio-irq;
0517         cap-sd-highspeed;
0518         keep-power-in-suspend;
0519         mmc-pwrseq = <&sdio_pwrseq>;
0520         non-removable;
0521         pinctrl-names = "default";
0522         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
0523         sd-uhs-sdr104;
0524         #address-cells = <1>;
0525         #size-cells = <0>;
0526         status = "okay";
0527 
0528         brcmf: wifi@1 {
0529                 compatible = "brcm,bcm4329-fmac";
0530                 reg = <1>;
0531                 interrupt-parent = <&gpio0>;
0532                 interrupts = <RK_PA3 IRQ_TYPE_LEVEL_HIGH>;
0533                 interrupt-names = "host-wake";
0534                 pinctrl-names = "default";
0535                 pinctrl-0 = <&wifi_host_wake_l>;
0536         };
0537 };
0538 
0539 &sdhci {
0540         bus-width = <8>;
0541         mmc-hs400-1_8v;
0542         mmc-hs400-enhanced-strobe;
0543         non-removable;
0544         status = "okay";
0545 };
0546 
0547 &sdmmc {
0548         bus-width = <4>;
0549         cap-mmc-highspeed;
0550         cap-sd-highspeed;
0551         clock-frequency = <100000000>;
0552         max-frequency = <100000000>;
0553         cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
0554         disable-wp;
0555         sd-uhs-sdr104;
0556         vqmmc-supply = <&vcc_sd>;
0557         card-detect-delay = <800>;
0558         pinctrl-names = "default";
0559         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
0560         status = "okay";
0561 };
0562 
0563 &tsadc {
0564         rockchip,hw-tshut-mode = <1>;
0565         rockchip,hw-tshut-polarity = <1>;
0566         rockchip,hw-tshut-temp = <110000>;
0567         status = "okay";
0568 };
0569 
0570 &uart0 {
0571         pinctrl-names = "default";
0572         pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
0573         status = "okay";
0574 
0575         bluetooth {
0576                 compatible = "brcm,bcm43438-bt";
0577                 clocks = <&rk808 1>;
0578                 clock-names = "ext_clock";
0579                 device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
0580                 host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
0581                 shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
0582                 pinctrl-names = "default";
0583                 pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
0584         };
0585 };
0586 
0587 &uart2 {
0588         status = "okay";
0589 };
0590 
0591 &tcphy0 {
0592         status = "okay";
0593 };
0594 
0595 &tcphy1 {
0596         status = "okay";
0597 };
0598 
0599 &u2phy0 {
0600         status = "okay";
0601 };
0602 
0603 &u2phy1 {
0604         status = "okay";
0605 };
0606 
0607 &u2phy0_host {
0608         phy-supply = <&vcc5v0_host>;
0609         status = "okay";
0610 };
0611 
0612 &u2phy1_host {
0613         phy-supply = <&vcc5v0_host>;
0614         status = "okay";
0615 };
0616 
0617 &u2phy0_otg {
0618         status = "okay";
0619 };
0620 
0621 &u2phy1_otg {
0622         status = "okay";
0623 };
0624 
0625 &usb_host0_ehci {
0626         status = "okay";
0627 };
0628 
0629 &usb_host0_ohci {
0630         status = "okay";
0631 };
0632 
0633 &usb_host1_ehci {
0634         status = "okay";
0635 };
0636 
0637 &usb_host1_ohci {
0638         status = "okay";
0639 };
0640 
0641 &usbdrd3_0 {
0642         status = "okay";
0643 };
0644 
0645 &usbdrd_dwc3_0 {
0646         status = "okay";
0647 };
0648 
0649 &usbdrd3_1 {
0650         status = "okay";
0651 };
0652 
0653 &usbdrd_dwc3_1 {
0654         status = "okay";
0655 };
0656 
0657 &vopb {
0658         status = "okay";
0659 };
0660 
0661 &vopb_mmu {
0662         status = "okay";
0663 };
0664 
0665 &vopl {
0666         status = "okay";
0667 };
0668 
0669 &vopl_mmu {
0670         status = "okay";
0671 };