Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * Google Gru-Chromebook shared properties
0004  *
0005  * Copyright 2018 Google, Inc
0006  */
0007 
0008 #include "rk3399-gru.dtsi"
0009 
0010 / {
0011         pp900_ap: pp900-ap {
0012                 compatible = "regulator-fixed";
0013                 regulator-name = "pp900_ap";
0014 
0015                 /* EC turns on w/ pp900_ap_en; always on for AP */
0016                 regulator-always-on;
0017                 regulator-boot-on;
0018                 regulator-min-microvolt = <900000>;
0019                 regulator-max-microvolt = <900000>;
0020 
0021                 vin-supply = <&ppvar_sys>;
0022         };
0023 
0024         /* EC turns on w/ pp900_usb_en */
0025         pp900_usb: pp900-ap {
0026         };
0027 
0028         /* EC turns on w/ pp900_pcie_en */
0029         pp900_pcie: pp900-ap {
0030         };
0031 
0032         pp3000: pp3000 {
0033                 compatible = "regulator-fixed";
0034                 regulator-name = "pp3000";
0035                 pinctrl-names = "default";
0036                 pinctrl-0 = <&pp3000_en>;
0037 
0038                 enable-active-high;
0039                 gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
0040 
0041                 regulator-always-on;
0042                 regulator-boot-on;
0043                 regulator-min-microvolt = <3000000>;
0044                 regulator-max-microvolt = <3000000>;
0045 
0046                 vin-supply = <&ppvar_sys>;
0047         };
0048 
0049         ppvar_centerlogic_pwm: ppvar-centerlogic-pwm {
0050                 compatible = "pwm-regulator";
0051                 regulator-name = "ppvar_centerlogic_pwm";
0052 
0053                 pwms = <&pwm3 0 3337 0>;
0054                 pwm-supply = <&ppvar_sys>;
0055                 pwm-dutycycle-range = <100 0>;
0056                 pwm-dutycycle-unit = <100>;
0057 
0058                 /* EC turns on w/ ppvar_centerlogic_en; always on for AP */
0059                 regulator-always-on;
0060                 regulator-boot-on;
0061                 regulator-min-microvolt = <799434>;
0062                 regulator-max-microvolt = <1049925>;
0063         };
0064 
0065         ppvar_centerlogic: ppvar-centerlogic {
0066                 compatible = "vctrl-regulator";
0067                 regulator-name = "ppvar_centerlogic";
0068 
0069                 regulator-min-microvolt = <799434>;
0070                 regulator-max-microvolt = <1049925>;
0071 
0072                 ctrl-supply = <&ppvar_centerlogic_pwm>;
0073                 ctrl-voltage-range = <799434 1049925>;
0074 
0075                 regulator-settling-time-up-us = <378>;
0076                 min-slew-down-rate = <225>;
0077                 ovp-threshold-percent = <16>;
0078         };
0079 
0080         /* Schematics call this PPVAR even though it's fixed */
0081         ppvar_logic: ppvar-logic {
0082                 compatible = "regulator-fixed";
0083                 regulator-name = "ppvar_logic";
0084 
0085                 /* EC turns on w/ ppvar_logic_en; always on for AP */
0086                 regulator-always-on;
0087                 regulator-boot-on;
0088                 regulator-min-microvolt = <900000>;
0089                 regulator-max-microvolt = <900000>;
0090 
0091                 vin-supply = <&ppvar_sys>;
0092         };
0093 
0094         pp1800_audio: pp1800-audio {
0095                 compatible = "regulator-fixed";
0096                 regulator-name = "pp1800_audio";
0097                 pinctrl-names = "default";
0098                 pinctrl-0 = <&pp1800_audio_en>;
0099 
0100                 enable-active-high;
0101                 gpio = <&gpio0 2 GPIO_ACTIVE_HIGH>;
0102 
0103                 regulator-always-on;
0104                 regulator-boot-on;
0105 
0106                 vin-supply = <&pp1800>;
0107         };
0108 
0109         /* gpio is shared with pp3300_wifi_bt */
0110         pp1800_pcie: pp1800-pcie {
0111                 compatible = "regulator-fixed";
0112                 regulator-name = "pp1800_pcie";
0113                 pinctrl-names = "default";
0114                 pinctrl-0 = <&wlan_module_pd_l>;
0115 
0116                 enable-active-high;
0117                 gpio = <&gpio0 4 GPIO_ACTIVE_HIGH>;
0118 
0119                 /*
0120                  * Need to wait 1ms + ramp-up time before we can power on WiFi.
0121                  * This has been approximated as 8ms total.
0122                  */
0123                 regulator-enable-ramp-delay = <8000>;
0124 
0125                 vin-supply = <&pp1800>;
0126         };
0127 
0128         /* Always on; plain and simple */
0129         pp3000_ap: pp3000_emmc: pp3000 {
0130         };
0131 
0132         pp1500_ap_io: pp1500-ap-io {
0133                 compatible = "regulator-fixed";
0134                 regulator-name = "pp1500_ap_io";
0135                 pinctrl-names = "default";
0136                 pinctrl-0 = <&pp1500_en>;
0137 
0138                 enable-active-high;
0139                 gpio = <&gpio0 10 GPIO_ACTIVE_HIGH>;
0140 
0141                 regulator-always-on;
0142                 regulator-boot-on;
0143                 regulator-min-microvolt = <1500000>;
0144                 regulator-max-microvolt = <1500000>;
0145 
0146                 vin-supply = <&pp1800>;
0147         };
0148 
0149         pp3300_disp: pp3300-disp {
0150                 compatible = "regulator-fixed";
0151                 regulator-name = "pp3300_disp";
0152                 pinctrl-names = "default";
0153                 pinctrl-0 = <&pp3300_disp_en>;
0154 
0155                 enable-active-high;
0156                 gpio = <&gpio4 27 GPIO_ACTIVE_HIGH>;
0157 
0158                 startup-delay-us = <2000>;
0159                 vin-supply = <&pp3300>;
0160         };
0161 
0162         /* EC turns on w/ pp3300_usb_en_l */
0163         pp3300_usb: pp3300 {
0164         };
0165 
0166         /* gpio is shared with pp1800_pcie and pinctrl is set there */
0167         pp3300_wifi_bt: pp3300-wifi-bt {
0168                 compatible = "regulator-fixed";
0169                 regulator-name = "pp3300_wifi_bt";
0170 
0171                 enable-active-high;
0172                 gpio = <&gpio0 4 GPIO_ACTIVE_HIGH>;
0173 
0174                 vin-supply = <&pp3300>;
0175         };
0176 
0177         /*
0178          * This is a bit of a hack. The WiFi module should be reset at least
0179          * 1ms after its regulators have ramped up (max rampup time is ~7ms).
0180          * With some stretching of the imagination, we can call the 1.8V
0181          * regulator a supply.
0182          */
0183         wlan_pd_n: wlan-pd-n {
0184                 compatible = "regulator-fixed";
0185                 regulator-name = "wlan_pd_n";
0186                 pinctrl-names = "default";
0187                 pinctrl-0 = <&wlan_module_reset_l>;
0188 
0189                 enable-active-high;
0190                 gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
0191 
0192                 vin-supply = <&pp1800_pcie>;
0193         };
0194 
0195         backlight: backlight {
0196                 compatible = "pwm-backlight";
0197                 enable-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
0198                 power-supply = <&pp3300_disp>;
0199                 pinctrl-names = "default";
0200                 pinctrl-0 = <&bl_en>;
0201                 pwm-delay-us = <10000>;
0202         };
0203 
0204         gpio_keys: gpio-keys {
0205                 compatible = "gpio-keys";
0206                 pinctrl-names = "default";
0207                 pinctrl-0 = <&bt_host_wake_l>;
0208 
0209                 wake_on_bt: key-wake-on-bt {
0210                         label = "Wake-on-Bluetooth";
0211                         gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
0212                         linux,code = <KEY_WAKEUP>;
0213                         wakeup-source;
0214                 };
0215         };
0216 };
0217 
0218 &ppvar_bigcpu {
0219         min-slew-down-rate = <225>;
0220         ovp-threshold-percent = <16>;
0221 };
0222 
0223 &ppvar_litcpu {
0224         min-slew-down-rate = <225>;
0225         ovp-threshold-percent = <16>;
0226 };
0227 
0228 &ppvar_gpu {
0229         min-slew-down-rate = <225>;
0230         ovp-threshold-percent = <16>;
0231 };
0232 
0233 &cdn_dp {
0234         extcon = <&usbc_extcon0>, <&usbc_extcon1>;
0235 };
0236 
0237 &dmc {
0238         center-supply = <&ppvar_centerlogic>;
0239         rockchip,pd-idle-dis-freq-hz = <800000000>;
0240         rockchip,sr-idle-dis-freq-hz = <800000000>;
0241         rockchip,sr-mc-gate-idle-dis-freq-hz = <800000000>;
0242 };
0243 
0244 &edp {
0245         status = "okay";
0246 
0247         /*
0248          * eDP PHY/clk don't sync reliably at anything other than 24 MHz. Only
0249          * set this here, because rk3399-gru.dtsi ensures we can generate this
0250          * off GPLL=600MHz, whereas some other RK3399 boards may not.
0251          */
0252         assigned-clocks = <&cru PCLK_EDP>;
0253         assigned-clock-rates = <24000000>;
0254 
0255         ports {
0256                 edp_out: port@1 {
0257                         reg = <1>;
0258                         #address-cells = <1>;
0259                         #size-cells = <0>;
0260 
0261                         edp_out_panel: endpoint@0 {
0262                                 reg = <0>;
0263                                 remote-endpoint = <&panel_in_edp>;
0264                         };
0265                 };
0266         };
0267 };
0268 
0269 &gpio0 {
0270         gpio-line-names = /* GPIO0 A 0-7 */
0271                           "AP_RTC_CLK_IN",
0272                           "EC_AP_INT_L",
0273                           "PP1800_AUDIO_EN",
0274                           "BT_HOST_WAKE_L",
0275                           "WLAN_MODULE_PD_L",
0276                           "H1_INT_OD_L",
0277                           "CENTERLOGIC_DVS_PWM",
0278                           "",
0279 
0280                           /* GPIO0 B 0-4 */
0281                           "WIFI_HOST_WAKE_L",
0282                           "PMUIO2_33_18_L",
0283                           "PP1500_EN",
0284                           "AP_EC_WARM_RESET_REQ",
0285                           "PP3000_EN";
0286 };
0287 
0288 &gpio1 {
0289         gpio-line-names = /* GPIO1 A 0-7 */
0290                           "",
0291                           "",
0292                           "SPK_PA_EN",
0293                           "",
0294                           "TRACKPAD_INT_L",
0295                           "AP_EC_S3_S0_L",
0296                           "AP_EC_OVERTEMP",
0297                           "AP_SPI_FLASH_MISO",
0298 
0299                           /* GPIO1 B 0-7 */
0300                           "AP_SPI_FLASH_MOSI_R",
0301                           "AP_SPI_FLASH_CLK_R",
0302                           "AP_SPI_FLASH_CS_L_R",
0303                           "WLAN_MODULE_RESET_L",
0304                           "WIFI_DISABLE_L",
0305                           "MIC_INT",
0306                           "",
0307                           "AP_I2C_DVS_SDA",
0308 
0309                           /* GPIO1 C 0-7 */
0310                           "AP_I2C_DVS_SCL",
0311                           "AP_BL_EN",
0312                           /*
0313                            * AP_FLASH_WP is crossystem ABI. Schematics call it
0314                            * AP_FW_WP or CPU1_FW_WP, depending on the variant.
0315                            */
0316                           "AP_FLASH_WP",
0317                           "LITCPU_DVS_PWM",
0318                           "AP_I2C_AUDIO_SDA",
0319                           "AP_I2C_AUDIO_SCL",
0320                           "",
0321                           "HEADSET_INT_L";
0322 };
0323 
0324 &gpio2 {
0325         gpio-line-names = /* GPIO2 A 0-7 */
0326                           "",
0327                           "",
0328                           "SD_IO_PWR_EN",
0329                           "",
0330                           "",
0331                           "",
0332                           "",
0333                           "",
0334 
0335                           /* GPIO2 B 0-7 */
0336                           "",
0337                           "",
0338                           "",
0339                           "",
0340                           "",
0341                           "",
0342                           "",
0343                           "",
0344 
0345                           /* GPIO2 C 0-7 */
0346                           "",
0347                           "",
0348                           "",
0349                           "",
0350                           "AP_SPI_EC_MISO",
0351                           "AP_SPI_EC_MOSI",
0352                           "AP_SPI_EC_CLK",
0353                           "AP_SPI_EC_CS_L",
0354 
0355                           /* GPIO2 D 0-4 */
0356                           "BT_DEV_WAKE_L",
0357                           "",
0358                           "WIFI_PCIE_CLKREQ_L",
0359                           "WIFI_PERST_L",
0360                           "SD_PWR_3000_1800_L";
0361 };
0362 
0363 &gpio3 {
0364         gpio-line-names = /* GPIO3 A 0-7 */
0365                           "",
0366                           "",
0367                           "",
0368                           "",
0369                           "AP_SPI_TPM_MISO",
0370                           "AP_SPI_TPM_MOSI_R",
0371                           "AP_SPI_TPM_CLK_R",
0372                           "AP_SPI_TPM_CS_L_R",
0373 
0374                           /* GPIO3 B 0-7 */
0375                           "EC_IN_RW",
0376                           "",
0377                           "AP_I2C_TP_SDA",
0378                           "AP_I2C_TP_SCL",
0379                           "AP_I2C_TP_PU_EN",
0380                           "TOUCH_INT_L",
0381                           "",
0382                           "",
0383 
0384                           /* GPIO3 C 0-7 */
0385                           "",
0386                           "",
0387                           "",
0388                           "",
0389                           "",
0390                           "",
0391                           "",
0392                           "",
0393 
0394                           /* GPIO3 D 0-7 */
0395                           "I2S0_SCLK",
0396                           "I2S0_LRCK_RX",
0397                           "I2S0_LRCK_TX",
0398                           "I2S0_SDI_0",
0399                           "I2S0_SDI_1",
0400                           "",
0401                           "I2S0_SDO_1",
0402                           "I2S0_SDO_0";
0403 };
0404 
0405 &gpio4 {
0406         gpio-line-names = /* GPIO4 A 0-7 */
0407                           "I2S_MCLK",
0408                           "AP_I2C_MIC_SDA",
0409                           "AP_I2C_MIC_SCL",
0410                           "",
0411                           "",
0412                           "",
0413                           "",
0414                           "",
0415 
0416                           /* GPIO4 B 0-7 */
0417                           "",
0418                           "",
0419                           "",
0420                           "",
0421                           "",
0422                           "",
0423                           "",
0424                           "",
0425 
0426                           /* GPIO4 C 0-7 */
0427                           "AP_I2C_TS_SDA",
0428                           "AP_I2C_TS_SCL",
0429                           "GPU_DVS_PWM",
0430                           "UART_DBG_TX_AP_RX",
0431                           "UART_AP_TX_DBG_RX",
0432                           "",
0433                           "BIGCPU_DVS_PWM",
0434                           "EDP_HPD_3V0",
0435 
0436                           /* GPIO4 D 0-5 */
0437                           "SD_CARD_DET_L",
0438                           "USB_DP_HPD",
0439                           "TOUCH_RESET_L",
0440                           "PP3300_DISP_EN",
0441                           "",
0442                           "SD_SLOT_PWR_EN";
0443 };
0444 
0445 ap_i2c_mic: &i2c1 {
0446         status = "okay";
0447 
0448         clock-frequency = <400000>;
0449 
0450         /* These are relatively safe rise/fall times */
0451         i2c-scl-falling-time-ns = <50>;
0452         i2c-scl-rising-time-ns = <300>;
0453 
0454         headsetcodec: rt5514@57 {
0455                 compatible = "realtek,rt5514";
0456                 reg = <0x57>;
0457                 realtek,dmic-init-delay-ms = <20>;
0458         };
0459 };
0460 
0461 ap_i2c_tp: &i2c5 {
0462         status = "okay";
0463 
0464         clock-frequency = <400000>;
0465 
0466         /* These are relatively safe rise/fall times */
0467         i2c-scl-falling-time-ns = <50>;
0468         i2c-scl-rising-time-ns = <300>;
0469 
0470         /*
0471          * Note strange pullup enable.  Apparently this avoids leakage but
0472          * still allows us to get nice 4.7K pullups for high speed i2c
0473          * transfers.  Basically we want the pullup on whenever the ap is
0474          * alive, so the "en" pin just gets set to output high.
0475          */
0476         pinctrl-0 = <&i2c5_xfer &ap_i2c_tp_pu_en>;
0477 };
0478 
0479 &cros_ec {
0480         cros_ec_pwm: pwm {
0481                 compatible = "google,cros-ec-pwm";
0482                 #pwm-cells = <1>;
0483         };
0484 
0485         usbc_extcon1: extcon1 {
0486                 compatible = "google,extcon-usbc-cros-ec";
0487                 google,usb-port-id = <1>;
0488         };
0489 };
0490 
0491 &sound {
0492         rockchip,codec = <&max98357a &headsetcodec
0493                           &codec &wacky_spi_audio &cdn_dp>;
0494 };
0495 
0496 &spi2 {
0497         wacky_spi_audio: spi2@0 {
0498                 compatible = "realtek,rt5514";
0499                 reg = <0>;
0500                 interrupt-parent = <&gpio1>;
0501                 interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
0502                 pinctrl-names = "default";
0503                 pinctrl-0 = <&mic_int>;
0504                 /* May run faster once verified. */
0505                 spi-max-frequency = <10000000>;
0506                 wakeup-source;
0507         };
0508 };
0509 
0510 &pci_rootport {
0511         mvl_wifi: wifi@0,0 {
0512                 compatible = "pci1b4b,2b42";
0513                 reg = <0x83010000 0x0 0x00000000 0x0 0x00100000
0514                        0x83010000 0x0 0x00100000 0x0 0x00100000>;
0515                 interrupt-parent = <&gpio0>;
0516                 interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
0517                 pinctrl-names = "default";
0518                 pinctrl-0 = <&wlan_host_wake_l>;
0519                 wakeup-source;
0520         };
0521 };
0522 
0523 &tcphy1 {
0524         status = "okay";
0525         extcon = <&usbc_extcon1>;
0526 };
0527 
0528 &u2phy1 {
0529         status = "okay";
0530 };
0531 
0532 &usb_host0_ehci {
0533         status = "okay";
0534 };
0535 
0536 &usb_host1_ehci {
0537         status = "okay";
0538 };
0539 
0540 &usb_host1_ohci {
0541         status = "okay";
0542 };
0543 
0544 &usbdrd3_1 {
0545         status = "okay";
0546         extcon = <&usbc_extcon1>;
0547 };
0548 
0549 &usbdrd_dwc3_1 {
0550         status = "okay";
0551         dr_mode = "host";
0552 };
0553 
0554 &pinctrl {
0555         discrete-regulators {
0556                 pp1500_en: pp1500-en {
0557                         rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO
0558                                          &pcfg_pull_none>;
0559                 };
0560 
0561                 pp1800_audio_en: pp1800-audio-en {
0562                         rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO
0563                                          &pcfg_pull_down>;
0564                 };
0565 
0566                 pp3000_en: pp3000-en {
0567                         rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO
0568                                          &pcfg_pull_none>;
0569                 };
0570 
0571                 pp3300_disp_en: pp3300-disp-en {
0572                         rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO
0573                                          &pcfg_pull_none>;
0574                 };
0575 
0576                 wlan_module_pd_l: wlan-module-pd-l {
0577                         rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO
0578                                          &pcfg_pull_down>;
0579                 };
0580         };
0581 };
0582 
0583 &wifi {
0584         wifi_perst_l: wifi-perst-l {
0585                 rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
0586         };
0587 
0588         wlan_host_wake_l: wlan-host-wake-l {
0589                 /* Kevin has an external pull up, but Bob does not */
0590                 rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
0591         };
0592 };