1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
3 * Google Gru (and derivatives) board device tree source
5 * Copyright 2016-2017 Google, Inc
8 #include <dt-bindings/input/input.h>
10 #include "rk3399-op1-opp.dtsi"
15 stdout-path = "serial2:115200n8";
16 u-boot,spl-boot-order = &spi_flash;
20 u-boot,spl-payload-offset = <0x40000>;
26 * In general an attempt is made to include all rails called out by
27 * the schematic as long as those rails interact in some way with
29 * - Rails that only connect to the EC (or devices that the EC talks to)
31 * - Rails _are_ included if the rails go to the AP even if the AP
32 * doesn't currently care about them / they are always on. The idea
33 * here is that it makes it easier to map to the schematic or extend
36 * If two rails are substantially the same from the AP's point of
37 * view, though, we won't create a full fixed regulator. We'll just
38 * put the child rail as an alias of the parent rail. Sometimes rails
39 * look the same to the AP because one of these is true:
40 * - The EC controls the enable and the EC always enables a rail as
41 * long as the AP is running.
42 * - The rails are actually connected to each other by a jumper and
43 * the distinction is just there to add clarity/flexibility to the
47 ppvar_sys: ppvar-sys {
48 compatible = "regulator-fixed";
49 regulator-name = "ppvar_sys";
54 pp1200_lpddr: pp1200-lpddr {
55 compatible = "regulator-fixed";
56 regulator-name = "pp1200_lpddr";
58 /* EC turns on w/ lpddr_pwr_en; always on for AP */
61 regulator-min-microvolt = <1200000>;
62 regulator-max-microvolt = <1200000>;
64 vin-supply = <&ppvar_sys>;
68 compatible = "regulator-fixed";
69 regulator-name = "pp1800";
71 /* Always on when ppvar_sys shows power good */
74 regulator-min-microvolt = <1800000>;
75 regulator-max-microvolt = <1800000>;
77 vin-supply = <&ppvar_sys>;
81 compatible = "regulator-fixed";
82 regulator-name = "pp3300";
84 /* Always on; plain and simple */
87 regulator-min-microvolt = <3300000>;
88 regulator-max-microvolt = <3300000>;
90 vin-supply = <&ppvar_sys>;
94 compatible = "regulator-fixed";
95 regulator-name = "pp5000";
97 /* EC turns on w/ pp5000_en; always on for AP */
100 regulator-min-microvolt = <5000000>;
101 regulator-max-microvolt = <5000000>;
103 vin-supply = <&ppvar_sys>;
106 ppvar_bigcpu_pwm: ppvar-bigcpu-pwm {
107 compatible = "pwm-regulator";
108 regulator-name = "ppvar_bigcpu_pwm";
110 pwms = <&pwm1 0 3337 0>;
111 pwm-supply = <&ppvar_sys>;
112 pwm-dutycycle-range = <100 0>;
113 pwm-dutycycle-unit = <100>;
115 /* EC turns on w/ ap_core_en; always on for AP */
118 regulator-min-microvolt = <800107>;
119 regulator-max-microvolt = <1302232>;
122 ppvar_bigcpu: ppvar-bigcpu {
123 compatible = "vctrl-regulator";
124 regulator-name = "ppvar_bigcpu";
126 regulator-min-microvolt = <800107>;
127 regulator-max-microvolt = <1302232>;
129 ctrl-supply = <&ppvar_bigcpu_pwm>;
130 ctrl-voltage-range = <800107 1302232>;
132 regulator-settling-time-up-us = <322>;
135 ppvar_litcpu_pwm: ppvar-litcpu-pwm {
136 compatible = "pwm-regulator";
137 regulator-name = "ppvar_litcpu_pwm";
139 pwms = <&pwm2 0 3337 0>;
140 pwm-supply = <&ppvar_sys>;
141 pwm-dutycycle-range = <100 0>;
142 pwm-dutycycle-unit = <100>;
144 /* EC turns on w/ ap_core_en; always on for AP */
147 regulator-min-microvolt = <797743>;
148 regulator-max-microvolt = <1307837>;
151 ppvar_litcpu: ppvar-litcpu {
152 compatible = "vctrl-regulator";
153 regulator-name = "ppvar_litcpu";
155 regulator-min-microvolt = <797743>;
156 regulator-max-microvolt = <1307837>;
158 ctrl-supply = <&ppvar_litcpu_pwm>;
159 ctrl-voltage-range = <797743 1307837>;
161 regulator-settling-time-up-us = <384>;
164 ppvar_gpu_pwm: ppvar-gpu-pwm {
165 compatible = "pwm-regulator";
166 regulator-name = "ppvar_gpu_pwm";
168 pwms = <&pwm0 0 3337 0>;
169 pwm-supply = <&ppvar_sys>;
170 pwm-dutycycle-range = <100 0>;
171 pwm-dutycycle-unit = <100>;
173 /* EC turns on w/ ap_core_en; always on for AP */
176 regulator-min-microvolt = <786384>;
177 regulator-max-microvolt = <1217747>;
180 ppvar_gpu: ppvar-gpu {
181 compatible = "vctrl-regulator";
182 regulator-name = "ppvar_gpu";
184 regulator-min-microvolt = <786384>;
185 regulator-max-microvolt = <1217747>;
187 ctrl-supply = <&ppvar_gpu_pwm>;
188 ctrl-voltage-range = <786384 1217747>;
190 regulator-settling-time-up-us = <390>;
193 /* EC turns on w/ pp900_ddrpll_en */
194 pp900_ddrpll: pp900-ap {
197 /* EC turns on w/ pp900_pll_en */
198 pp900_pll: pp900-ap {
201 /* EC turns on w/ pp900_pmu_en */
202 pp900_pmu: pp900-ap {
205 /* EC turns on w/ pp1800_s0_en_l */
206 pp1800_ap_io: pp1800_emmc: pp1800_nfc: pp1800_s0: pp1800 {
209 /* EC turns on w/ pp1800_avdd_en_l */
210 pp1800_avdd: pp1800 {
213 /* EC turns on w/ pp1800_lid_en_l */
214 pp1800_lid: pp1800_mic: pp1800 {
217 /* EC turns on w/ lpddr_pwr_en */
218 pp1800_lpddr: pp1800 {
221 /* EC turns on w/ pp1800_pmu_en_l */
225 /* EC turns on w/ pp1800_usb_en_l */
229 pp3000_sd_slot: pp3000-sd-slot {
230 compatible = "regulator-fixed";
231 regulator-name = "pp3000_sd_slot";
232 pinctrl-names = "default";
233 pinctrl-0 = <&sd_slot_pwr_en>;
236 gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>;
238 vin-supply = <&pp3000>;
242 * Technically, this is a small abuse of 'regulator-gpio'; this
243 * regulator is a mux between pp1800 and pp3300. pp1800 and pp3300 are
244 * always on though, so it is sufficient to simply control the mux
247 ppvar_sd_card_io: ppvar-sd-card-io {
248 compatible = "regulator-gpio";
249 regulator-name = "ppvar_sd_card_io";
250 pinctrl-names = "default";
251 pinctrl-0 = <&sd_io_pwr_en &sd_pwr_1800_sel>;
254 enable-gpio = <&gpio2 2 GPIO_ACTIVE_HIGH>;
255 gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>;
256 states = <1800000 0x1
259 regulator-min-microvolt = <1800000>;
260 regulator-max-microvolt = <3000000>;
263 /* EC turns on w/ pp3300_trackpad_en_l */
264 pp3300_trackpad: pp3300-trackpad {
267 /* EC turns on w/ usb_a_en */
268 pp5000_usb_a_vbus: pp5000 {
271 gpio_keys: gpio-keys {
272 compatible = "gpio-keys";
273 pinctrl-names = "default";
274 pinctrl-0 = <&bt_host_wake_l>;
276 wake_on_bt: wake-on-bt {
277 label = "Wake-on-Bluetooth";
278 gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
279 linux,code = <KEY_WAKEUP>;
284 max98357a: max98357a {
285 compatible = "maxim,max98357a";
286 pinctrl-names = "default";
287 pinctrl-0 = <&sdmode_en>;
288 sdmode-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
290 #sound-dai-cells = <0>;
295 compatible = "rockchip,rk3399-gru-sound";
296 rockchip,cpu = <&i2s0 &i2s2>;
305 * Set some suspend operating points to avoid OVP in suspend
307 * When we go into S3 ARM Trusted Firmware will transition our PWM regulators
308 * from wherever they're at back to the "default" operating point (whatever
309 * voltage we get when we set the PWM pins to "input").
311 * This quick transition under light load has the possibility to trigger the
312 * regulator "over voltage protection" (OVP).
314 * To make extra certain that we don't hit this OVP at suspend time, we'll
315 * transition to a voltage that's much closer to the default (~1.0 V) so that
316 * there will not be a big jump. Technically we only need to get within 200 mV
317 * of the default voltage, but the speed here should be fast enough and we need
318 * suspend/resume to be rock solid.
334 cpu-supply = <&ppvar_litcpu>;
338 cpu-supply = <&ppvar_litcpu>;
342 cpu-supply = <&ppvar_litcpu>;
346 cpu-supply = <&ppvar_litcpu>;
350 cpu-supply = <&ppvar_bigcpu>;
354 cpu-supply = <&ppvar_bigcpu>;
359 <&cru PLL_GPLL>, <&cru PLL_CPLL>,
361 <&cru ACLK_PERIHP>, <&cru HCLK_PERIHP>,
363 <&cru ACLK_PERILP0>, <&cru HCLK_PERILP0>,
364 <&cru PCLK_PERILP0>, <&cru ACLK_CCI>,
365 <&cru HCLK_PERILP1>, <&cru PCLK_PERILP1>,
366 <&cru ACLK_VIO>, <&cru ACLK_HDCP>,
369 assigned-clock-rates =
370 <600000000>, <800000000>,
372 <150000000>, <75000000>,
374 <100000000>, <100000000>,
375 <50000000>, <800000000>,
376 <100000000>, <50000000>,
377 <400000000>, <400000000>,
387 mali-supply = <&ppvar_gpu>;
394 clock-frequency = <400000>;
396 /* These are relatively safe rise/fall times */
397 i2c-scl-falling-time-ns = <50>;
398 i2c-scl-rising-time-ns = <300>;
401 ap_i2c_audio: &i2c8 {
404 clock-frequency = <400000>;
406 /* These are relatively safe rise/fall times */
407 i2c-scl-falling-time-ns = <50>;
408 i2c-scl-rising-time-ns = <300>;
411 compatible = "dlg,da7219";
413 interrupt-parent = <&gpio1>;
414 interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
415 clocks = <&cru SCLK_I2S_8CH_OUT>;
416 clock-names = "mclk";
417 dlg,micbias-lvl = <2600>;
418 dlg,mic-amp-in-sel = "diff";
419 pinctrl-names = "default";
420 pinctrl-0 = <&headset_int_l>;
421 VDD-supply = <&pp1800>;
422 VDDMIC-supply = <&pp3300>;
423 VDDIO-supply = <&pp1800>;
426 dlg,adc-1bit-rpt = <1>;
429 dlg,mic-det-thr = <500>;
430 dlg,jack-ins-deb = <20>;
431 dlg,jack-det-rate = "32ms_64ms";
432 dlg,jack-rem-deb = <1>;
434 dlg,a-d-btn-thr = <0xa>;
435 dlg,d-b-btn-thr = <0x16>;
436 dlg,b-c-btn-thr = <0x21>;
437 dlg,c-mic-btn-thr = <0x3E>;
453 audio-supply = <&pp1800_audio>; /* APIO5_VDD; 3d 4a */
454 bt656-supply = <&pp1800_ap_io>; /* APIO2_VDD; 2a 2b */
455 gpio1830-supply = <&pp3000_ap>; /* APIO4_VDD; 4c 4d */
456 sdmmc-supply = <&ppvar_sd_card_io>; /* SDMMC0_VDD; 4b */
462 ep-gpios = <&gpio2 27 GPIO_ACTIVE_HIGH>;
463 pinctrl-names = "default";
464 pinctrl-0 = <&pcie_clkreqn_cpm>, <&wifi_perst_l>;
465 vpcie3v3-supply = <&pp3300_wifi_bt>;
466 vpcie1v8-supply = <&wlan_pd_n>; /* HACK: see &wlan_pd_n */
467 vpcie0v9-supply = <&pp900_pcie>;
469 pci_rootport: pcie@0,0 {
470 reg = <0x83000000 0x0 0x00000000 0x0 0x00000000>;
471 #address-cells = <3>;
484 pmu1830-supply = <&pp1800_pmu>; /* PMUIO2_VDD */
505 * Signal integrity isn't great at 200 MHz and 150 MHz (DDR) gives the
506 * same (or nearly the same) performance for all eMMC that are intended
509 assigned-clock-rates = <150000000>;
513 mmc-hs400-enhanced-strobe;
522 * Note: configure "sdmmc_cd" as card detect even though it's actually
523 * hooked to ground. Because we specified "cd-gpios" below dw_mmc
524 * should be ignoring card detect anyway. Specifying the pin as
525 * sdmmc_cd means that even if you've got GRF_SOC_CON7[12] (force_jtag)
526 * turned on that the system will still make sure the port is
527 * configured as SDMMC and not JTAG.
529 pinctrl-names = "default";
530 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_cd_gpio
536 cd-gpios = <&gpio4 24 GPIO_ACTIVE_LOW>;
542 vmmc-supply = <&pp3000_sd_slot>;
543 vqmmc-supply = <&ppvar_sd_card_io>;
549 pinctrl-names = "default", "sleep";
550 pinctrl-1 = <&spi1_sleep>;
552 spi_flash: spiflash@0 {
554 compatible = "jedec,spi-nor";
557 /* May run faster once verified. */
558 spi-max-frequency = <10000000>;
568 spi-activate-delay = <100>;
569 spi-max-frequency = <3000000>;
570 spi-deactivate-delay = <200>;
573 compatible = "google,cros-ec-spi";
575 interrupt-parent = <&gpio0>;
576 interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
577 ec-interrupt = <&gpio0 1 GPIO_ACTIVE_LOW>;
578 pinctrl-names = "default";
579 pinctrl-0 = <&ec_ap_int_l>;
580 spi-max-frequency = <3000000>;
582 i2c_tunnel: i2c-tunnel {
583 compatible = "google,cros-ec-i2c-tunnel";
584 google,remote-bus = <4>;
585 #address-cells = <1>;
589 usbc_extcon0: extcon@0 {
590 compatible = "google,extcon-usbc-cros-ec";
591 google,usb-port-id = <0>;
601 rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
602 rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
607 extcon = <&usbc_extcon0>;
640 extcon = <&usbc_extcon0>;
664 #include <cros-ec-keyboard.dtsi>
665 #include <cros-ec-sbs.dtsi>
669 * pinctrl settings for pins that have no real owners.
671 * At the moment settings are identical for S0 and S3, but if we later
672 * need to configure things differently for S3 we'll adjust here.
674 pinctrl-names = "default";
676 &ap_pwroff /* AP will auto-assert this when in S3 */
677 &clk_32k /* This pin is always 32k on gru boards */
680 pcfg_output_low: pcfg-output-low {
684 pcfg_output_high: pcfg-output-high {
688 pcfg_pull_none_8ma: pcfg-pull-none-8ma {
690 drive-strength = <8>;
695 rockchip,pins = <1 17 RK_FUNC_GPIO &pcfg_pull_none>;
700 ec_ap_int_l: ec-ap-int-l {
701 rockchip,pins = <RK_GPIO0 1 RK_FUNC_GPIO &pcfg_pull_up>;
705 discrete-regulators {
706 sd_io_pwr_en: sd-io-pwr-en {
707 rockchip,pins = <RK_GPIO2 2 RK_FUNC_GPIO
711 sd_pwr_1800_sel: sd-pwr-1800-sel {
712 rockchip,pins = <RK_GPIO2 28 RK_FUNC_GPIO
716 sd_slot_pwr_en: sd-slot-pwr-en {
717 rockchip,pins = <RK_GPIO4 29 RK_FUNC_GPIO
723 /* Has external pullup */
724 headset_int_l: headset-int-l {
725 rockchip,pins = <1 23 RK_FUNC_GPIO &pcfg_pull_none>;
729 rockchip,pins = <1 13 RK_FUNC_GPIO &pcfg_pull_down>;
734 sdmode_en: sdmode-en {
735 rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_down>;
740 pcie_clkreqn_cpm: pci-clkreqn-cpm {
742 * Since our pcie doesn't support ClockPM(CPM), we want
743 * to hack this as gpio, so the EP could be able to
744 * de-assert it along and make ClockPM(CPM) work.
746 rockchip,pins = <2 26 RK_FUNC_GPIO &pcfg_pull_none>;
752 * We run sdmmc at max speed; bump up drive strength.
753 * We also have external pulls, so disable the internal ones.
755 sdmmc_bus4: sdmmc-bus4 {
757 <4 8 RK_FUNC_1 &pcfg_pull_none_8ma>,
758 <4 9 RK_FUNC_1 &pcfg_pull_none_8ma>,
759 <4 10 RK_FUNC_1 &pcfg_pull_none_8ma>,
760 <4 11 RK_FUNC_1 &pcfg_pull_none_8ma>;
763 sdmmc_clk: sdmmc-clk {
765 <4 12 RK_FUNC_1 &pcfg_pull_none_8ma>;
768 sdmmc_cmd: sdmmc-cmd {
770 <4 13 RK_FUNC_1 &pcfg_pull_none_8ma>;
774 * In our case the official card detect is hooked to ground
775 * to avoid getting access to JTAG just by sticking something
776 * in the SD card slot (see the force_jtag bit in the TRM).
778 * We still configure it as card detect because it doesn't
779 * hurt and dw_mmc will ignore it. We make sure to disable
780 * the pull though so we don't burn needless power.
784 <0 7 RK_FUNC_1 &pcfg_pull_none>;
787 /* This is where we actually hook up CD; has external pull */
788 sdmmc_cd_gpio: sdmmc-cd-gpio {
789 rockchip,pins = <4 24 RK_FUNC_GPIO &pcfg_pull_none>;
794 spi1_sleep: spi1-sleep {
796 * Pull down SPI1 CLK/CS/RX/TX during suspend, to
799 rockchip,pins = <1 9 RK_FUNC_GPIO &pcfg_pull_down>,
800 <1 10 RK_FUNC_GPIO &pcfg_pull_down>,
801 <1 7 RK_FUNC_GPIO &pcfg_pull_down>,
802 <1 8 RK_FUNC_GPIO &pcfg_pull_down>;
807 touch_int_l: touch-int-l {
808 rockchip,pins = <3 13 RK_FUNC_GPIO &pcfg_pull_up>;
811 touch_reset_l: touch-reset-l {
812 rockchip,pins = <4 26 RK_FUNC_GPIO &pcfg_pull_none>;
817 ap_i2c_tp_pu_en: ap-i2c-tp-pu-en {
818 rockchip,pins = <3 12 RK_FUNC_GPIO &pcfg_output_high>;
821 trackpad_int_l: trackpad-int-l {
822 rockchip,pins = <1 4 RK_FUNC_GPIO &pcfg_pull_up>;
827 wlan_module_reset_l: wlan-module-reset-l {
828 rockchip,pins = <1 11 RK_FUNC_GPIO &pcfg_pull_none>;
831 bt_host_wake_l: bt-host-wake-l {
832 /* Kevin has an external pull up, but Gru does not */
833 rockchip,pins = <0 3 RK_FUNC_GPIO &pcfg_pull_up>;
839 rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_up>;