Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
0004  */
0005 
0006 #include "dt-bindings/pwm/pwm.h"
0007 #include "dt-bindings/input/input.h"
0008 #include "rk3399.dtsi"
0009 #include "rk3399-opp.dtsi"
0010 
0011 / {
0012         compatible = "rockchip,rk3399-sapphire", "rockchip,rk3399";
0013 
0014         aliases {
0015                 mmc0 = &sdmmc;
0016                 mmc1 = &sdhci;
0017         };
0018 
0019         chosen {
0020                 stdout-path = "serial2:1500000n8";
0021         };
0022 
0023         clkin_gmac: external-gmac-clock {
0024                 compatible = "fixed-clock";
0025                 clock-frequency = <125000000>;
0026                 clock-output-names = "clkin_gmac";
0027                 #clock-cells = <0>;
0028         };
0029 
0030         dc_12v: dc-12v {
0031                 compatible = "regulator-fixed";
0032                 regulator-name = "dc_12v";
0033                 regulator-always-on;
0034                 regulator-boot-on;
0035                 regulator-min-microvolt = <12000000>;
0036                 regulator-max-microvolt = <12000000>;
0037         };
0038 
0039         /*
0040          * The fan power supply comes from the baseboard.
0041          * For the standalone Sapphire one option is to connect a wire
0042          * from  R90030 DNP R0805 pin2  to  C90002 10uF C0805 pin1 (vcc_sys).
0043          */
0044         fan0: gpio-fan {
0045                 #cooling-cells = <2>;
0046                 compatible = "gpio-fan";
0047                 gpio-fan,speed-map = <0 0 3000 1>;
0048                 gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_HIGH>;
0049                 status = "okay";
0050         };
0051 
0052         keys: gpio-keys {
0053                 compatible = "gpio-keys";
0054                 autorepeat;
0055 
0056                 key-power {
0057                         debounce-interval = <100>;
0058                         gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
0059                         label = "GPIO Power";
0060                         linux,code = <KEY_POWER>;
0061                         linux,input-type = <1>;
0062                         pinctrl-names = "default";
0063                         pinctrl-0 = <&pwr_btn>;
0064                         wakeup-source;
0065                 };
0066         };
0067 
0068         /* switched by pmic_sleep */
0069         vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
0070                 compatible = "regulator-fixed";
0071                 regulator-name = "vcc1v8_s3";
0072                 regulator-always-on;
0073                 regulator-boot-on;
0074                 regulator-min-microvolt = <1800000>;
0075                 regulator-max-microvolt = <1800000>;
0076                 vin-supply = <&vcc_1v8>;
0077         };
0078 
0079         vcc3v0_sd: vcc3v0-sd {
0080                 compatible = "regulator-fixed";
0081                 enable-active-high;
0082                 gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
0083                 pinctrl-names = "default";
0084                 pinctrl-0 = <&sdmmc0_pwr_h>;
0085                 regulator-always-on;
0086                 regulator-max-microvolt = <3000000>;
0087                 regulator-min-microvolt = <3000000>;
0088                 regulator-name = "vcc3v0_sd";
0089                 vin-supply = <&vcc3v3_sys>;
0090         };
0091 
0092         vcc3v3_sys: vcc3v3-sys {
0093                 compatible = "regulator-fixed";
0094                 regulator-name = "vcc3v3_sys";
0095                 regulator-always-on;
0096                 regulator-boot-on;
0097                 regulator-min-microvolt = <3300000>;
0098                 regulator-max-microvolt = <3300000>;
0099                 vin-supply = <&vcc_sys>;
0100         };
0101 
0102         vcc5v0_host: vcc5v0-host-regulator {
0103                 compatible = "regulator-fixed";
0104                 enable-active-high;
0105                 gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
0106                 pinctrl-names = "default";
0107                 pinctrl-0 = <&vcc5v0_host_en>;
0108                 regulator-name = "vcc5v0_host";
0109                 regulator-always-on;
0110                 vin-supply = <&vcc_sys>;
0111         };
0112 
0113         vcc5v0_typec0: vcc5v0-typec0-regulator {
0114                 compatible = "regulator-fixed";
0115                 enable-active-high;
0116                 gpio = <&gpio2 RK_PA0 GPIO_ACTIVE_HIGH>;
0117                 pinctrl-names = "default";
0118                 pinctrl-0 = <&vcc5v0_typec0_en>;
0119                 regulator-name = "vcc5v0_typec0";
0120                 vin-supply = <&vcc_sys>;
0121         };
0122 
0123         vcc_sys: vcc-sys {
0124                 compatible = "regulator-fixed";
0125                 regulator-name = "vcc_sys";
0126                 regulator-always-on;
0127                 regulator-boot-on;
0128                 regulator-min-microvolt = <5000000>;
0129                 regulator-max-microvolt = <5000000>;
0130                 vin-supply = <&dc_12v>;
0131         };
0132 
0133         vdd_log: vdd-log {
0134                 compatible = "pwm-regulator";
0135                 pwms = <&pwm2 0 25000 1>;
0136                 pwm-supply = <&vcc_sys>;
0137                 regulator-name = "vdd_log";
0138                 regulator-always-on;
0139                 regulator-boot-on;
0140                 regulator-min-microvolt = <800000>;
0141                 regulator-max-microvolt = <1400000>;
0142         };
0143 };
0144 
0145 &cpu_l0 {
0146         cpu-supply = <&vdd_cpu_l>;
0147 };
0148 
0149 &cpu_l1 {
0150         cpu-supply = <&vdd_cpu_l>;
0151 };
0152 
0153 &cpu_l2 {
0154         cpu-supply = <&vdd_cpu_l>;
0155 };
0156 
0157 &cpu_l3 {
0158         cpu-supply = <&vdd_cpu_l>;
0159 };
0160 
0161 &cpu_b0 {
0162         cpu-supply = <&vdd_cpu_b>;
0163 };
0164 
0165 &cpu_b1 {
0166         cpu-supply = <&vdd_cpu_b>;
0167 };
0168 
0169 &cpu_thermal {
0170         trips {
0171                 cpu_hot: cpu_hot {
0172                         hysteresis = <10000>;
0173                         temperature = <55000>;
0174                         type = "active";
0175                 };
0176         };
0177 
0178         cooling-maps {
0179                 map2 {
0180                         cooling-device =
0181                                 <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
0182                         trip = <&cpu_hot>;
0183                 };
0184         };
0185 };
0186 
0187 &emmc_phy {
0188         status = "okay";
0189 };
0190 
0191 &gmac {
0192         assigned-clocks = <&cru SCLK_RMII_SRC>;
0193         assigned-clock-parents = <&clkin_gmac>;
0194         clock_in_out = "input";
0195         phy-supply = <&vcc_lan>;
0196         phy-mode = "rgmii";
0197         pinctrl-names = "default";
0198         pinctrl-0 = <&rgmii_pins>;
0199         snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
0200         snps,reset-active-low;
0201         snps,reset-delays-us = <0 10000 50000>;
0202         tx_delay = <0x28>;
0203         rx_delay = <0x11>;
0204         status = "okay";
0205 };
0206 
0207 &gpu {
0208         mali-supply = <&vdd_gpu>;
0209         status = "okay";
0210 };
0211 
0212 &hdmi {
0213         ddc-i2c-bus = <&i2c3>;
0214         status = "okay";
0215 };
0216 
0217 &hdmi_sound {
0218         status = "okay";
0219 };
0220 
0221 &i2c0 {
0222         clock-frequency = <400000>;
0223         i2c-scl-rising-time-ns = <168>;
0224         i2c-scl-falling-time-ns = <4>;
0225         status = "okay";
0226 
0227         rk808: pmic@1b {
0228                 compatible = "rockchip,rk808";
0229                 reg = <0x1b>;
0230                 interrupt-parent = <&gpio1>;
0231                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
0232                 #clock-cells = <1>;
0233                 clock-output-names = "xin32k", "rk808-clkout2";
0234                 pinctrl-names = "default";
0235                 pinctrl-0 = <&pmic_int_l>;
0236                 rockchip,system-power-controller;
0237                 wakeup-source;
0238 
0239                 vcc1-supply = <&vcc_sys>;
0240                 vcc2-supply = <&vcc_sys>;
0241                 vcc3-supply = <&vcc_sys>;
0242                 vcc4-supply = <&vcc_sys>;
0243                 vcc6-supply = <&vcc_sys>;
0244                 vcc7-supply = <&vcc_sys>;
0245                 vcc8-supply = <&vcc3v3_sys>;
0246                 vcc9-supply = <&vcc_sys>;
0247                 vcc10-supply = <&vcc_sys>;
0248                 vcc11-supply = <&vcc_sys>;
0249                 vcc12-supply = <&vcc3v3_sys>;
0250                 vddio-supply = <&vcc1v8_pmu>;
0251 
0252                 regulators {
0253                         vdd_center: DCDC_REG1 {
0254                                 regulator-name = "vdd_center";
0255                                 regulator-always-on;
0256                                 regulator-boot-on;
0257                                 regulator-min-microvolt = <750000>;
0258                                 regulator-max-microvolt = <1350000>;
0259                                 regulator-ramp-delay = <6001>;
0260                                 regulator-state-mem {
0261                                         regulator-off-in-suspend;
0262                                 };
0263                         };
0264 
0265                         vdd_cpu_l: DCDC_REG2 {
0266                                 regulator-name = "vdd_cpu_l";
0267                                 regulator-always-on;
0268                                 regulator-boot-on;
0269                                 regulator-min-microvolt = <750000>;
0270                                 regulator-max-microvolt = <1350000>;
0271                                 regulator-ramp-delay = <6001>;
0272                                 regulator-state-mem {
0273                                         regulator-off-in-suspend;
0274                                 };
0275                         };
0276 
0277                         vcc_ddr: DCDC_REG3 {
0278                                 regulator-name = "vcc_ddr";
0279                                 regulator-always-on;
0280                                 regulator-boot-on;
0281                                 regulator-state-mem {
0282                                         regulator-on-in-suspend;
0283                                 };
0284                         };
0285 
0286                         vcc_1v8: DCDC_REG4 {
0287                                 regulator-name = "vcc_1v8";
0288                                 regulator-always-on;
0289                                 regulator-boot-on;
0290                                 regulator-min-microvolt = <1800000>;
0291                                 regulator-max-microvolt = <1800000>;
0292                                 regulator-state-mem {
0293                                         regulator-on-in-suspend;
0294                                         regulator-suspend-microvolt = <1800000>;
0295                                 };
0296                         };
0297 
0298                         vcc1v8_dvp: LDO_REG1 {
0299                                 regulator-name = "vcc1v8_dvp";
0300                                 regulator-always-on;
0301                                 regulator-boot-on;
0302                                 regulator-min-microvolt = <1800000>;
0303                                 regulator-max-microvolt = <1800000>;
0304                                 regulator-state-mem {
0305                                         regulator-off-in-suspend;
0306                                 };
0307                         };
0308 
0309                         vcc3v0_tp: LDO_REG2 {
0310                                 regulator-name = "vcc3v0_tp";
0311                                 regulator-always-on;
0312                                 regulator-boot-on;
0313                                 regulator-min-microvolt = <3000000>;
0314                                 regulator-max-microvolt = <3000000>;
0315                                 regulator-state-mem {
0316                                         regulator-off-in-suspend;
0317                                 };
0318                         };
0319 
0320                         vcc1v8_pmu: LDO_REG3 {
0321                                 regulator-name = "vcc1v8_pmu";
0322                                 regulator-always-on;
0323                                 regulator-boot-on;
0324                                 regulator-min-microvolt = <1800000>;
0325                                 regulator-max-microvolt = <1800000>;
0326                                 regulator-state-mem {
0327                                         regulator-on-in-suspend;
0328                                         regulator-suspend-microvolt = <1800000>;
0329                                 };
0330                         };
0331 
0332                         vcc_sdio: LDO_REG4 {
0333                                 regulator-name = "vcc_sdio";
0334                                 regulator-always-on;
0335                                 regulator-boot-on;
0336                                 regulator-min-microvolt = <1800000>;
0337                                 regulator-max-microvolt = <3300000>;
0338                                 regulator-state-mem {
0339                                         regulator-on-in-suspend;
0340                                         regulator-suspend-microvolt = <3000000>;
0341                                 };
0342                         };
0343 
0344                         vcca3v0_codec: LDO_REG5 {
0345                                 regulator-name = "vcca3v0_codec";
0346                                 regulator-always-on;
0347                                 regulator-boot-on;
0348                                 regulator-min-microvolt = <3000000>;
0349                                 regulator-max-microvolt = <3000000>;
0350                                 regulator-state-mem {
0351                                         regulator-off-in-suspend;
0352                                 };
0353                         };
0354 
0355                         vcc_1v5: LDO_REG6 {
0356                                 regulator-name = "vcc_1v5";
0357                                 regulator-always-on;
0358                                 regulator-boot-on;
0359                                 regulator-min-microvolt = <1500000>;
0360                                 regulator-max-microvolt = <1500000>;
0361                                 regulator-state-mem {
0362                                         regulator-on-in-suspend;
0363                                         regulator-suspend-microvolt = <1500000>;
0364                                 };
0365                         };
0366 
0367                         vcca1v8_codec: LDO_REG7 {
0368                                 regulator-name = "vcca1v8_codec";
0369                                 regulator-always-on;
0370                                 regulator-boot-on;
0371                                 regulator-min-microvolt = <1800000>;
0372                                 regulator-max-microvolt = <1800000>;
0373                                 regulator-state-mem {
0374                                         regulator-off-in-suspend;
0375                                 };
0376                         };
0377 
0378                         vcc_3v0: LDO_REG8 {
0379                                 regulator-name = "vcc_3v0";
0380                                 regulator-always-on;
0381                                 regulator-boot-on;
0382                                 regulator-min-microvolt = <3000000>;
0383                                 regulator-max-microvolt = <3000000>;
0384                                 regulator-state-mem {
0385                                         regulator-on-in-suspend;
0386                                         regulator-suspend-microvolt = <3000000>;
0387                                 };
0388                         };
0389 
0390                         vcc3v3_s3: vcc_lan: SWITCH_REG1 {
0391                                 regulator-name = "vcc3v3_s3";
0392                                 regulator-always-on;
0393                                 regulator-boot-on;
0394                                 regulator-state-mem {
0395                                         regulator-off-in-suspend;
0396                                 };
0397                         };
0398 
0399                         vcc3v3_s0: SWITCH_REG2 {
0400                                 regulator-name = "vcc3v3_s0";
0401                                 regulator-always-on;
0402                                 regulator-boot-on;
0403                                 regulator-state-mem {
0404                                         regulator-off-in-suspend;
0405                                 };
0406                         };
0407                 };
0408         };
0409 
0410         vdd_cpu_b: regulator@40 {
0411                 compatible = "silergy,syr827";
0412                 reg = <0x40>;
0413                 fcs,suspend-voltage-selector = <1>;
0414                 regulator-name = "vdd_cpu_b";
0415                 regulator-min-microvolt = <712500>;
0416                 regulator-max-microvolt = <1500000>;
0417                 regulator-ramp-delay = <1000>;
0418                 regulator-always-on;
0419                 regulator-boot-on;
0420                 vin-supply = <&vcc_sys>;
0421 
0422                 regulator-state-mem {
0423                         regulator-off-in-suspend;
0424                 };
0425         };
0426 
0427         vdd_gpu: regulator@41 {
0428                 compatible = "silergy,syr828";
0429                 reg = <0x41>;
0430                 fcs,suspend-voltage-selector = <1>;
0431                 regulator-name = "vdd_gpu";
0432                 regulator-min-microvolt = <712500>;
0433                 regulator-max-microvolt = <1500000>;
0434                 regulator-ramp-delay = <1000>;
0435                 regulator-always-on;
0436                 regulator-boot-on;
0437                 vin-supply = <&vcc_sys>;
0438 
0439                 regulator-state-mem {
0440                         regulator-off-in-suspend;
0441                 };
0442         };
0443 };
0444 
0445 &i2c3 {
0446         i2c-scl-rising-time-ns = <450>;
0447         i2c-scl-falling-time-ns = <15>;
0448         status = "okay";
0449 };
0450 
0451 &i2s2 {
0452         status = "okay";
0453 };
0454 
0455 &io_domains {
0456         status = "okay";
0457 
0458         bt656-supply = <&vcc_3v0>;
0459         audio-supply = <&vcca1v8_codec>;
0460         sdmmc-supply = <&vcc_sdio>;
0461         gpio1830-supply = <&vcc_3v0>;
0462 };
0463 
0464 &pmu_io_domains {
0465         pmu1830-supply = <&vcc_3v0>;
0466         status = "okay";
0467 };
0468 
0469 &pinctrl {
0470         buttons {
0471                 pwr_btn: pwr-btn {
0472                         rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
0473                 };
0474         };
0475 
0476         fan {
0477                 motor_pwr: motor-pwr {
0478                         rockchip,pins =
0479                                 <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
0480                 };
0481         };
0482 
0483         pmic {
0484                 pmic_int_l: pmic-int-l {
0485                         rockchip,pins =
0486                                 <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
0487                 };
0488 
0489                 vsel1_pin: vsel1-pin {
0490                         rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
0491                 };
0492 
0493                 vsel2_pin: vsel2-pin {
0494                         rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
0495                 };
0496         };
0497 
0498         sd {
0499                 sdmmc0_pwr_h: sdmmc0-pwr-h {
0500                         rockchip,pins =
0501                                 <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
0502                 };
0503         };
0504 
0505         usb2 {
0506                 vcc5v0_host_en: vcc5v0-host-en {
0507                         rockchip,pins =
0508                                 <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
0509                 };
0510                 vcc5v0_typec0_en: vcc5v0-typec0-en {
0511                         rockchip,pins =
0512                                 <2 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
0513                 };
0514         };
0515 };
0516 
0517 &pwm0 {
0518         status = "okay";
0519 };
0520 
0521 &pwm2 {
0522         status = "okay";
0523 };
0524 
0525 &saradc {
0526         vref-supply = <&vcca1v8_s3>;
0527         status = "okay";
0528 };
0529 
0530 &sdhci {
0531         bus-width = <8>;
0532         mmc-hs400-1_8v;
0533         mmc-hs400-enhanced-strobe;
0534         non-removable;
0535         status = "okay";
0536 };
0537 
0538 &sdmmc {
0539         broken-cd;
0540         bus-width = <4>;
0541         cap-mmc-highspeed;
0542         cap-sd-highspeed;
0543         clock-frequency = <150000000>;
0544         disable-wp;
0545         max-frequency = <150000000>;
0546         pinctrl-names = "default";
0547         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
0548         vmmc-supply = <&vcc3v0_sd>;
0549         vqmmc-supply = <&vcc_sdio>;
0550         status = "okay";
0551 };
0552 
0553 &tcphy0 {
0554         status = "okay";
0555 };
0556 
0557 &tcphy1 {
0558         status = "okay";
0559 };
0560 
0561 &tsadc {
0562         /* tshut mode 0:CRU 1:GPIO */
0563         rockchip,hw-tshut-mode = <1>;
0564         /* tshut polarity 0:LOW 1:HIGH */
0565         rockchip,hw-tshut-polarity = <1>;
0566         status = "okay";
0567 };
0568 
0569 &u2phy0 {
0570         status = "okay";
0571 
0572         u2phy0_otg: otg-port {
0573                 status = "okay";
0574         };
0575 
0576         u2phy0_host: host-port {
0577                 phy-supply = <&vcc5v0_typec0>;
0578                 status = "okay";
0579         };
0580 };
0581 
0582 &u2phy1 {
0583         status = "okay";
0584 
0585         u2phy1_otg: otg-port {
0586                 status = "okay";
0587         };
0588 
0589         u2phy1_host: host-port {
0590                 phy-supply = <&vcc5v0_host>;
0591                 status = "okay";
0592         };
0593 };
0594 
0595 &uart0 {
0596         pinctrl-names = "default";
0597         pinctrl-0 = <&uart0_xfer &uart0_cts>;
0598         status = "okay";
0599 };
0600 
0601 &uart2 {
0602         status = "okay";
0603 };
0604 
0605 &usb_host0_ehci {
0606         status = "okay";
0607 };
0608 
0609 &usb_host0_ohci {
0610         status = "okay";
0611 };
0612 
0613 &usb_host1_ehci {
0614         status = "okay";
0615 };
0616 
0617 &usb_host1_ohci {
0618         status = "okay";
0619 };
0620 
0621 &usbdrd3_0 {
0622         status = "okay";
0623 };
0624 
0625 &usbdrd_dwc3_0 {
0626         status = "okay";
0627         dr_mode = "host";
0628 };
0629 
0630 &usbdrd3_1 {
0631         status = "okay";
0632 };
0633 
0634 &usbdrd_dwc3_1 {
0635         status = "okay";
0636         dr_mode = "host";
0637 };
0638 
0639 &vopb {
0640         status = "okay";
0641 };
0642 
0643 &vopb_mmu {
0644         status = "okay";
0645 };
0646 
0647 &vopl {
0648         status = "okay";
0649 };
0650 
0651 &vopl_mmu {
0652         status = "okay";
0653 };