]> asedeno.scripts.mit.edu Git - linux.git/blob - arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
db6159aca8c3eeacfac88b24d9e8df6b1656237e
[linux.git] / arch / arm64 / boot / dts / qcom / sdm845-cheza.dtsi
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3  * Google Cheza device tree source (common between revisions)
4  *
5  * Copyright 2018 Google LLC.
6  */
7
8 #include <dt-bindings/gpio/gpio.h>
9 #include <dt-bindings/input/input.h>
10 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
11 #include "sdm845.dtsi"
12
13 /* PMICs depend on spmi_bus label and so must come after SoC */
14 #include "pm8005.dtsi"
15 #include "pm8998.dtsi"
16
17 / {
18         aliases {
19                 bluetooth0 = &bluetooth;
20                 hsuart0 = &uart6;
21                 serial0 = &uart9;
22                 wifi0 = &wifi;
23         };
24
25         chosen {
26                 stdout-path = "serial0:115200n8";
27         };
28
29         backlight: backlight {
30                 compatible = "pwm-backlight";
31                 pwms = <&cros_ec_pwm 0>;
32                 enable-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
33                 power-supply = <&ppvar_sys>;
34                 pinctrl-names = "default";
35                 pinctrl-0 = <&ap_edp_bklten>;
36         };
37
38         /* FIXED REGULATORS - parents above children */
39
40         /* This is the top level supply and variable voltage */
41         ppvar_sys: ppvar-sys-regulator {
42                 compatible = "regulator-fixed";
43                 regulator-name = "ppvar_sys";
44                 regulator-always-on;
45                 regulator-boot-on;
46         };
47
48         /* This divides ppvar_sys by 2, so voltage is variable */
49         src_vph_pwr: src-vph-pwr-regulator {
50                 compatible = "regulator-fixed";
51                 regulator-name = "src_vph_pwr";
52
53                 /* EC turns on with switchcap_on_l; always on for AP */
54                 regulator-always-on;
55                 regulator-boot-on;
56
57                 vin-supply = <&ppvar_sys>;
58         };
59
60         pp5000_a: pp5000-a-regulator {
61                 compatible = "regulator-fixed";
62                 regulator-name = "pp5000_a";
63
64                 /* EC turns on with en_pp5000_a; always on for AP */
65                 regulator-always-on;
66                 regulator-boot-on;
67                 regulator-min-microvolt = <5000000>;
68                 regulator-max-microvolt = <5000000>;
69
70                 vin-supply = <&ppvar_sys>;
71         };
72
73         src_vreg_bob: src-vreg-bob-regulator {
74                 compatible = "regulator-fixed";
75                 regulator-name = "src_vreg_bob";
76
77                 /* EC turns on with vbob_en; always on for AP */
78                 regulator-always-on;
79                 regulator-boot-on;
80                 regulator-min-microvolt = <3600000>;
81                 regulator-max-microvolt = <3600000>;
82
83                 vin-supply = <&ppvar_sys>;
84         };
85
86         pp3300_dx_edp: pp3300-dx-edp-regulator {
87                 compatible = "regulator-fixed";
88                 regulator-name = "pp3300_dx_edp";
89
90                 regulator-min-microvolt = <3300000>;
91                 regulator-max-microvolt = <3300000>;
92
93                 gpio = <&tlmm 43 GPIO_ACTIVE_HIGH>;
94                 enable-active-high;
95                 pinctrl-names = "default";
96                 pinctrl-0 = <&en_pp3300_dx_edp>;
97         };
98
99         /*
100          * Apparently RPMh does not provide support for PM8998 S4 because it
101          * is always-on; model it as a fixed regulator.
102          */
103         src_pp1800_s4a: pm8998-smps4 {
104                 compatible = "regulator-fixed";
105                 regulator-name = "src_pp1800_s4a";
106
107                 regulator-min-microvolt = <1800000>;
108                 regulator-max-microvolt = <1800000>;
109
110                 regulator-always-on;
111                 regulator-boot-on;
112
113                 vin-supply = <&src_vph_pwr>;
114         };
115
116         /* BOARD-SPECIFIC TOP LEVEL NODES */
117
118         gpio-keys {
119                 compatible = "gpio-keys";
120                 pinctrl-names = "default";
121                 pinctrl-0 = <&pen_eject_odl>;
122
123                 pen-insert {
124                         label = "Pen Insert";
125                         /* Insert = low, eject = high */
126                         gpios = <&tlmm 119 GPIO_ACTIVE_LOW>;
127                         linux,code = <SW_PEN_INSERTED>;
128                         linux,input-type = <EV_SW>;
129                         wakeup-source;
130                 };
131         };
132
133         panel: panel {
134                 compatible ="innolux,p120zdg-bf1";
135                 power-supply = <&pp3300_dx_edp>;
136                 backlight = <&backlight>;
137                 no-hpd;
138
139                 ports {
140                         panel_in: port {
141                                 panel_in_edp: endpoint {
142                                         remote-endpoint = <&sn65dsi86_out>;
143                                 };
144                         };
145                 };
146         };
147 };
148
149 /*
150  * Reserved memory changes
151  *
152  * Putting this all together (out of order with the rest of the file) to keep
153  * all modifications to the memory map (from sdm845.dtsi) in one place.
154  */
155
156 /*
157  * Our mpss_region is 8MB bigger than the default one and that conflicts
158  * with venus_mem and cdsp_mem.
159  *
160  * For venus_mem we'll delete and re-create at a different address.
161  *
162  * cdsp_mem isn't used on cheza right now so we won't bother re-creating it; but
163  * that also means we need to delete cdsp_pas.
164  */
165 /delete-node/ &venus_mem;
166 /delete-node/ &cdsp_mem;
167 /delete-node/ &cdsp_pas;
168
169 /* Increase the size from 120 MB to 128 MB */
170 &mpss_region {
171         reg = <0 0x8e000000 0 0x8000000>;
172 };
173
174 /* Increase the size from 2MB to 8MB */
175 &rmtfs_mem {
176         reg = <0 0x88f00000 0 0x800000>;
177 };
178
179 / {
180         reserved-memory {
181                 venus_mem: memory@96000000 {
182                         reg = <0 0x96000000 0 0x500000>;
183                         no-map;
184                 };
185         };
186 };
187
188 &qspi {
189         status = "okay";
190         pinctrl-names = "default";
191         pinctrl-0 = <&qspi_clk &qspi_cs0 &qspi_data01>;
192
193         flash@0 {
194                 compatible = "jedec,spi-nor";
195                 reg = <0>;
196
197                 /*
198                  * In theory chip supports up to 104 MHz and controller up
199                  * to 80 MHz, but above 25 MHz wasn't reliable so we'll use
200                  * that for now.  b:117440651
201                  */
202                 spi-max-frequency = <25000000>;
203                 spi-tx-bus-width = <2>;
204                 spi-rx-bus-width = <2>;
205         };
206 };
207
208
209 &apps_rsc {
210         pm8998-rpmh-regulators {
211                 compatible = "qcom,pm8998-rpmh-regulators";
212                 qcom,pmic-id = "a";
213
214                 vdd-s1-supply = <&src_vph_pwr>;
215                 vdd-s2-supply = <&src_vph_pwr>;
216                 vdd-s3-supply = <&src_vph_pwr>;
217                 vdd-s4-supply = <&src_vph_pwr>;
218                 vdd-s5-supply = <&src_vph_pwr>;
219                 vdd-s6-supply = <&src_vph_pwr>;
220                 vdd-s7-supply = <&src_vph_pwr>;
221                 vdd-s8-supply = <&src_vph_pwr>;
222                 vdd-s9-supply = <&src_vph_pwr>;
223                 vdd-s10-supply = <&src_vph_pwr>;
224                 vdd-s11-supply = <&src_vph_pwr>;
225                 vdd-s12-supply = <&src_vph_pwr>;
226                 vdd-s13-supply = <&src_vph_pwr>;
227                 vdd-l1-l27-supply = <&src_pp1025_s7a>;
228                 vdd-l2-l8-l17-supply = <&src_pp1350_s3a>;
229                 vdd-l3-l11-supply = <&src_pp1025_s7a>;
230                 vdd-l4-l5-supply = <&src_pp1025_s7a>;
231                 vdd-l6-supply = <&src_vph_pwr>;
232                 vdd-l7-l12-l14-l15-supply = <&src_pp2040_s5a>;
233                 vdd-l9-supply = <&src_pp2040_s5a>;
234                 vdd-l10-l23-l25-supply = <&src_vreg_bob>;
235                 vdd-l13-l19-l21-supply = <&src_vreg_bob>;
236                 vdd-l16-l28-supply = <&src_vreg_bob>;
237                 vdd-l18-l22-supply = <&src_vreg_bob>;
238                 vdd-l20-l24-supply = <&src_vreg_bob>;
239                 vdd-l26-supply = <&src_pp1350_s3a>;
240                 vin-lvs-1-2-supply = <&src_pp1800_s4a>;
241
242                 src_pp1125_s2a: smps2 {
243                         regulator-min-microvolt = <1100000>;
244                         regulator-max-microvolt = <1100000>;
245                 };
246
247                 src_pp1350_s3a: smps3 {
248                         regulator-min-microvolt = <1352000>;
249                         regulator-max-microvolt = <1352000>;
250                 };
251
252                 src_pp2040_s5a: smps5 {
253                         regulator-min-microvolt = <1904000>;
254                         regulator-max-microvolt = <2040000>;
255                 };
256
257                 src_pp1025_s7a: smps7 {
258                         regulator-min-microvolt = <900000>;
259                         regulator-max-microvolt = <1028000>;
260                 };
261
262                 vdd_qusb_hs0:
263                 vdda_hp_pcie_core:
264                 vdda_mipi_csi0_0p9:
265                 vdda_mipi_csi1_0p9:
266                 vdda_mipi_csi2_0p9:
267                 vdda_mipi_dsi0_pll:
268                 vdda_mipi_dsi1_pll:
269                 vdda_qlink_lv:
270                 vdda_qlink_lv_ck:
271                 vdda_qrefs_0p875:
272                 vdda_pcie_core:
273                 vdda_pll_cc_ebi01:
274                 vdda_pll_cc_ebi23:
275                 vdda_sp_sensor:
276                 vdda_ufs1_core:
277                 vdda_ufs2_core:
278                 vdda_usb1_ss_core:
279                 vdda_usb2_ss_core:
280                 src_pp875_l1a: ldo1 {
281                         regulator-min-microvolt = <880000>;
282                         regulator-max-microvolt = <880000>;
283                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
284                 };
285
286                 vddpx_10:
287                 src_pp1200_l2a: ldo2 {
288                         regulator-min-microvolt = <1200000>;
289                         regulator-max-microvolt = <1200000>;
290                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
291
292                         /* TODO: why??? */
293                         regulator-always-on;
294                 };
295
296                 pp1000_l3a_sdr845: ldo3 {
297                         regulator-min-microvolt = <1000000>;
298                         regulator-max-microvolt = <1000000>;
299                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
300                 };
301
302                 vdd_wcss_cx:
303                 vdd_wcss_mx:
304                 vdda_wcss_pll:
305                 src_pp800_l5a: ldo5 {
306                         regulator-min-microvolt = <800000>;
307                         regulator-max-microvolt = <800000>;
308                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
309                 };
310
311                 vddpx_13:
312                 src_pp1800_l6a: ldo6 {
313                         regulator-min-microvolt = <1856000>;
314                         regulator-max-microvolt = <1856000>;
315                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
316                 };
317
318                 pp1800_l7a_wcn3990: ldo7 {
319                         regulator-min-microvolt = <1800000>;
320                         regulator-max-microvolt = <1800000>;
321                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
322                 };
323
324                 src_pp1200_l8a: ldo8 {
325                         regulator-min-microvolt = <1200000>;
326                         regulator-max-microvolt = <1248000>;
327                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
328                 };
329
330                 pp1800_dx_pen:
331                 src_pp1800_l9a: ldo9 {
332                         regulator-min-microvolt = <1800000>;
333                         regulator-max-microvolt = <1800000>;
334                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
335                 };
336
337                 src_pp1800_l10a: ldo10 {
338                         regulator-min-microvolt = <1800000>;
339                         regulator-max-microvolt = <1800000>;
340                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
341                 };
342
343                 pp1000_l11a_sdr845: ldo11 {
344                         regulator-min-microvolt = <1000000>;
345                         regulator-max-microvolt = <1048000>;
346                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
347                 };
348
349                 vdd_qfprom:
350                 vdd_qfprom_sp:
351                 vdda_apc1_cs_1p8:
352                 vdda_gfx_cs_1p8:
353                 vdda_qrefs_1p8:
354                 vdda_qusb_hs0_1p8:
355                 vddpx_11:
356                 src_pp1800_l12a: ldo12 {
357                         regulator-min-microvolt = <1800000>;
358                         regulator-max-microvolt = <1800000>;
359                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
360                 };
361
362                 vddpx_2:
363                 src_pp2950_l13a: ldo13 {
364                         regulator-min-microvolt = <1800000>;
365                         regulator-max-microvolt = <2960000>;
366                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
367                 };
368
369                 src_pp1800_l14a: ldo14 {
370                         regulator-min-microvolt = <1800000>;
371                         regulator-max-microvolt = <1800000>;
372                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
373                 };
374
375                 src_pp1800_l15a: ldo15 {
376                         regulator-min-microvolt = <1800000>;
377                         regulator-max-microvolt = <1800000>;
378                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
379                 };
380
381                 pp2700_l16a: ldo16 {
382                         regulator-min-microvolt = <2704000>;
383                         regulator-max-microvolt = <2704000>;
384                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
385                 };
386
387                 src_pp1300_l17a: ldo17 {
388                         regulator-min-microvolt = <1304000>;
389                         regulator-max-microvolt = <1304000>;
390                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
391                 };
392
393                 pp2700_l18a: ldo18 {
394                         regulator-min-microvolt = <2704000>;
395                         regulator-max-microvolt = <2960000>;
396                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
397                 };
398
399                 /*
400                  * NOTE: this rail should have been called
401                  * src_pp3300_l19a in the schematic
402                  */
403                 src_pp3000_l19a: ldo19 {
404                         regulator-min-microvolt = <3304000>;
405                         regulator-max-microvolt = <3304000>;
406
407                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
408                 };
409
410                 src_pp2950_l20a: ldo20 {
411                         regulator-min-microvolt = <2704000>;
412                         regulator-max-microvolt = <2960000>;
413                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
414                 };
415
416                 src_pp2950_l21a: ldo21 {
417                         regulator-min-microvolt = <2704000>;
418                         regulator-max-microvolt = <2960000>;
419                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
420                 };
421
422                 pp3300_hub:
423                 src_pp3300_l22a: ldo22 {
424                         regulator-min-microvolt = <3304000>;
425                         regulator-max-microvolt = <3304000>;
426                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
427                         /*
428                          * HACK: Should add a usb hub node and driver
429                          * to turn this on and off at suspend/resume time
430                          */
431                         regulator-boot-on;
432                         regulator-always-on;
433                 };
434
435                 pp3300_l23a_ch1_wcn3990: ldo23 {
436                         regulator-min-microvolt = <3000000>;
437                         regulator-max-microvolt = <3312000>;
438                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
439                 };
440
441                 vdda_qusb_hs0_3p1:
442                 src_pp3075_l24a: ldo24 {
443                         regulator-min-microvolt = <3088000>;
444                         regulator-max-microvolt = <3088000>;
445                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
446                 };
447
448                 pp3300_l25a_ch0_wcn3990: ldo25 {
449                         regulator-min-microvolt = <3304000>;
450                         regulator-max-microvolt = <3304000>;
451                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
452                 };
453
454                 pp1200_hub:
455                 vdda_hp_pcie_1p2:
456                 vdda_hv_ebi0:
457                 vdda_hv_ebi1:
458                 vdda_hv_ebi2:
459                 vdda_hv_ebi3:
460                 vdda_mipi_csi_1p25:
461                 vdda_mipi_dsi0_1p2:
462                 vdda_mipi_dsi1_1p2:
463                 vdda_pcie_1p2:
464                 vdda_ufs1_1p2:
465                 vdda_ufs2_1p2:
466                 vdda_usb1_ss_1p2:
467                 vdda_usb2_ss_1p2:
468                 src_pp1200_l26a: ldo26 {
469                         regulator-min-microvolt = <1200000>;
470                         regulator-max-microvolt = <1200000>;
471                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
472                 };
473
474                 pp3300_dx_pen:
475                 src_pp3300_l28a: ldo28 {
476                         regulator-min-microvolt = <3304000>;
477                         regulator-max-microvolt = <3304000>;
478                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
479                 };
480
481                 src_pp1800_lvs1: lvs1 {
482                         regulator-min-microvolt = <1800000>;
483                         regulator-max-microvolt = <1800000>;
484                 };
485
486                 src_pp1800_lvs2: lvs2 {
487                         regulator-min-microvolt = <1800000>;
488                         regulator-max-microvolt = <1800000>;
489                 };
490         };
491
492         pm8005-rpmh-regulators {
493                 compatible = "qcom,pm8005-rpmh-regulators";
494                 qcom,pmic-id = "c";
495
496                 vdd-s1-supply = <&src_vph_pwr>;
497                 vdd-s2-supply = <&src_vph_pwr>;
498                 vdd-s3-supply = <&src_vph_pwr>;
499                 vdd-s4-supply = <&src_vph_pwr>;
500
501                 src_pp600_s3c: smps3 {
502                         regulator-min-microvolt = <600000>;
503                         regulator-max-microvolt = <600000>;
504                 };
505         };
506 };
507
508 &dsi0 {
509         status = "okay";
510         vdda-supply = <&vdda_mipi_dsi0_1p2>;
511
512         ports {
513                 port@1 {
514                         endpoint {
515                                 remote-endpoint = <&sn65dsi86_in>;
516                                 data-lanes = <0 1 2 3>;
517                         };
518                 };
519         };
520 };
521
522 &dsi0_phy {
523         status = "okay";
524         vdds-supply = <&vdda_mipi_dsi0_pll>;
525 };
526
527 edp_brij_i2c: &i2c3 {
528         status = "okay";
529         clock-frequency = <400000>;
530
531         sn65dsi86_bridge: bridge@2d {
532                 compatible = "ti,sn65dsi86";
533                 reg = <0x2d>;
534                 pinctrl-names = "default";
535                 pinctrl-0 = <&edp_brij_en &edp_brij_irq>;
536
537                 interrupt-parent = <&tlmm>;
538                 interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
539
540                 enable-gpios = <&tlmm 102 GPIO_ACTIVE_HIGH>;
541
542                 vpll-supply = <&src_pp1800_s4a>;
543                 vccio-supply = <&src_pp1800_s4a>;
544                 vcca-supply = <&src_pp1200_l2a>;
545                 vcc-supply = <&src_pp1200_l2a>;
546
547                 clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
548                 clock-names = "refclk";
549
550                 ports {
551                         #address-cells = <1>;
552                         #size-cells = <0>;
553
554                         port@0 {
555                                 reg = <0>;
556                                 sn65dsi86_in: endpoint {
557                                         remote-endpoint = <&dsi0_out>;
558                                 };
559                         };
560
561                         port@1 {
562                                 reg = <1>;
563                                 sn65dsi86_out: endpoint {
564                                         remote-endpoint = <&panel_in_edp>;
565                                 };
566                         };
567                 };
568         };
569 };
570
571 ap_pen_1v8: &i2c11 {
572         status = "okay";
573         clock-frequency = <400000>;
574
575         digitizer@9 {
576                 compatible = "wacom,w9013", "hid-over-i2c";
577                 reg = <0x9>;
578                 pinctrl-names = "default";
579                 pinctrl-0 = <&pen_irq_l>, <&pen_pdct_l>, <&pen_rst_l>;
580
581                 vdd-supply = <&pp3300_dx_pen>;
582                 vddl-supply = <&pp1800_dx_pen>;
583                 post-power-on-delay-ms = <100>;
584
585                 interrupt-parent = <&tlmm>;
586                 interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
587
588                 hid-descr-addr = <0x1>;
589         };
590 };
591
592 amp_i2c: &i2c12 {
593         status = "okay";
594         clock-frequency = <400000>;
595 };
596
597 ap_ts_i2c: &i2c14 {
598         status = "okay";
599         clock-frequency = <400000>;
600
601         touchscreen@10 {
602                 compatible = "elan,ekth3500";
603                 reg = <0x10>;
604                 pinctrl-names = "default";
605                 pinctrl-0 = <&ts_int_l &ts_reset_l>;
606
607                 interrupt-parent = <&tlmm>;
608                 interrupts = <125 IRQ_TYPE_LEVEL_LOW>;
609
610                 vcc33-supply = <&src_pp3300_l28a>;
611
612                 reset-gpios = <&tlmm 118 GPIO_ACTIVE_LOW>;
613         };
614 };
615
616 &lpasscc {
617         status = "okay";
618 };
619
620 &mdss {
621         status = "okay";
622 };
623
624 &mdss_mdp {
625         status = "okay";
626 };
627
628 &qupv3_id_0 {
629         status = "okay";
630 };
631
632 &qupv3_id_1 {
633         status = "okay";
634 };
635
636 &sdhc_2 {
637         status = "okay";
638
639         pinctrl-names = "default";
640         pinctrl-0 = <&sdc2_clk &sdc2_cmd &sdc2_data &sd_cd_odl>;
641
642         vmmc-supply = <&src_pp2950_l21a>;
643         vqmmc-supply = <&vddpx_2>;
644
645         cd-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
646 };
647
648 &spi0 {
649         status = "okay";
650 };
651
652 &spi10 {
653         status = "okay";
654
655         cros_ec: ec@0 {
656                 compatible = "google,cros-ec-spi";
657                 reg = <0>;
658                 interrupt-parent = <&tlmm>;
659                 interrupts = <122 IRQ_TYPE_LEVEL_LOW>;
660                 pinctrl-names = "default";
661                 pinctrl-0 = <&ec_ap_int_l>;
662                 spi-max-frequency = <3000000>;
663
664                 cros_ec_pwm: ec-pwm {
665                         compatible = "google,cros-ec-pwm";
666                         #pwm-cells = <1>;
667                 };
668
669                 i2c_tunnel: i2c-tunnel {
670                         compatible = "google,cros-ec-i2c-tunnel";
671                         google,remote-bus = <0>;
672                         #address-cells = <1>;
673                         #size-cells = <0>;
674                 };
675
676                 pdupdate {
677                         compatible = "google,cros-ec-pd-update";
678                 };
679         };
680 };
681
682 #include <arm/cros-ec-keyboard.dtsi>
683 #include <arm/cros-ec-sbs.dtsi>
684
685 &uart6 {
686         status = "okay";
687
688         bluetooth: wcn3990-bt {
689                 compatible = "qcom,wcn3990-bt";
690                 vddio-supply = <&src_pp1800_s4a>;
691                 vddxo-supply = <&pp1800_l7a_wcn3990>;
692                 vddrf-supply = <&src_pp1300_l17a>;
693                 vddch0-supply = <&pp3300_l25a_ch0_wcn3990>;
694                 max-speed = <3200000>;
695         };
696 };
697
698 &uart9 {
699         status = "okay";
700 };
701
702 &ufs_mem_hc {
703         status = "okay";
704
705         reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
706
707         vcc-supply = <&src_pp2950_l20a>;
708         vcc-max-microamp = <600000>;
709 };
710
711 &ufs_mem_phy {
712         status = "okay";
713
714         vdda-phy-supply = <&vdda_ufs1_core>;
715         vdda-pll-supply = <&vdda_ufs1_1p2>;
716 };
717
718 &usb_1 {
719         status = "okay";
720
721         /* We'll use this as USB 2.0 only */
722         qcom,select-utmi-as-pipe-clk;
723 };
724
725 &usb_1_dwc3 {
726         /*
727          * The hardware design intends this port to be hooked up in peripheral
728          * mode, so we'll hardcode it here.  Some details:
729          * - SDM845 expects only a single Type C connector so it has only one
730          *   native Type C port but cheza has two Type C connectors.
731          * - The only source of DP is the single native Type C port.
732          * - On cheza we want to be able to hook DP up to _either_ of the
733          *   two Type C connectors and want to be able to achieve 4 lanes of DP.
734          * - When you configure a Type C port for 4 lanes of DP you lose USB3.
735          * - In order to make everything work, the native Type C port is always
736          *   configured as 4-lanes DP so it's always available.
737          * - The extra USB3 port on SDM845 goes to a USB 3 hub which is then
738          *   sent to the two Type C connectors.
739          * - The extra USB2 lines from the native Type C port are always
740          *   setup as "peripheral" so that we can mux them over to one connector
741          *   or the other if someone needs the connector configured as a gadget
742          *   (but they only get USB2 speeds).
743          *
744          * All the hardware muxes would allow us to hook things up in different
745          * ways to some potential benefit for static configurations (you could
746          * achieve extra USB2 bandwidth by using two different ports for the
747          * two connectors or possibly even get USB3 peripheral mode), but in
748          * each case you end up forcing to disconnect/reconnect an in-use
749          * USB session in some cases depending on what you hotplug into the
750          * other connector.  Thus hardcoding this as peripheral makes sense.
751          */
752         dr_mode = "peripheral";
753
754         /*
755          * We always need the high speed pins as 4-lanes DP in case someone
756          * hotplugs a DP peripheral.  Thus limit this port to a max of high
757          * speed.
758          */
759         maximum-speed = "high-speed";
760
761         /*
762          * We don't need the usb3-phy since we run in highspeed mode always, so
763          * re-define these properties removing the superspeed USB PHY reference.
764          */
765         phys = <&usb_1_hsphy>;
766         phy-names = "usb2-phy";
767 };
768
769 &usb_1_hsphy {
770         status = "okay";
771
772         vdd-supply = <&vdda_usb1_ss_core>;
773         vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
774         vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
775
776         qcom,imp-res-offset-value = <8>;
777         qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
778         qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
779         qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
780 };
781
782 &usb_2 {
783         status = "okay";
784 };
785
786 &usb_2_dwc3 {
787         /* We have this hooked up to a hub and we always use in host mode */
788         dr_mode = "host";
789 };
790
791 &usb_2_hsphy {
792         status = "okay";
793
794         vdd-supply = <&vdda_usb2_ss_core>;
795         vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
796         vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
797
798         qcom,imp-res-offset-value = <8>;
799         qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_22_8_MA>;
800 };
801
802 &usb_2_qmpphy {
803         status = "okay";
804
805         vdda-phy-supply = <&vdda_usb2_ss_1p2>;
806         vdda-pll-supply = <&vdda_usb2_ss_core>;
807 };
808
809 &wifi {
810         status = "okay";
811
812         vdd-0.8-cx-mx-supply = <&src_pp800_l5a >;
813         vdd-1.8-xo-supply = <&pp1800_l7a_wcn3990>;
814         vdd-1.3-rfa-supply = <&src_pp1300_l17a>;
815         vdd-3.3-ch0-supply = <&pp3300_l25a_ch0_wcn3990>;
816 };
817
818 /* PINCTRL - additions to nodes defined in sdm845.dtsi */
819
820 &qspi_cs0 {
821         pinconf {
822                 pins = "gpio90";
823                 bias-disable;
824         };
825 };
826
827 &qspi_clk {
828         pinconf {
829                 pins = "gpio95";
830                 bias-disable;
831         };
832 };
833
834 &qspi_data01 {
835         pinconf {
836                 pins = "gpio91", "gpio92";
837
838                 /* High-Z when no transfers; nice to park the lines */
839                 bias-pull-up;
840         };
841 };
842
843 &qup_i2c3_default {
844         pinconf {
845                 pins = "gpio41", "gpio42";
846                 drive-strength = <2>;
847
848                 /* Has external pullup */
849                 bias-disable;
850         };
851 };
852
853 &qup_i2c11_default {
854         pinconf {
855                 pins = "gpio31", "gpio32";
856                 drive-strength = <2>;
857
858                 /* Has external pullup */
859                 bias-disable;
860         };
861 };
862
863 &qup_i2c12_default {
864         pinconf {
865                 pins = "gpio49", "gpio50";
866                 drive-strength = <2>;
867
868                 /* Has external pullup */
869                 bias-disable;
870         };
871 };
872
873 &qup_i2c14_default {
874         pinconf {
875                 pins = "gpio33", "gpio34";
876                 drive-strength = <2>;
877
878                 /* Has external pullup */
879                 bias-disable;
880         };
881 };
882
883 &qup_spi0_default {
884         pinconf {
885                 pins = "gpio0", "gpio1", "gpio2", "gpio3";
886                 drive-strength = <2>;
887                 bias-disable;
888         };
889 };
890
891 &qup_spi5_default {
892         pinconf {
893                 pins = "gpio85", "gpio86", "gpio87", "gpio88";
894                 drive-strength = <2>;
895                 bias-disable;
896         };
897 };
898
899 &qup_spi10_default {
900         pinconf {
901                 pins = "gpio53", "gpio54", "gpio55", "gpio56";
902                 drive-strength = <2>;
903                 bias-disable;
904         };
905 };
906
907 &qup_uart6_default {
908         /* Change pinmux to all 4 pins since CTS and RTS are connected */
909         pinmux {
910                 pins = "gpio45", "gpio46",
911                        "gpio47", "gpio48";
912         };
913
914         pinconf-cts {
915                 /*
916                  * Configure a pull-down on 45 (CTS) to match the pull of
917                  * the Bluetooth module.
918                  */
919                 pins = "gpio45";
920                 bias-pull-down;
921         };
922
923         pinconf-rts-tx {
924                 /* We'll drive 46 (RTS) and 47 (TX), so no pull */
925                 pins = "gpio46", "gpio47";
926                 drive-strength = <2>;
927                 bias-disable;
928         };
929
930         pinconf-rx {
931                 /*
932                  * Configure a pull-up on 48 (RX). This is needed to avoid
933                  * garbage data when the TX pin of the Bluetooth module is
934                  * in tri-state (module powered off or not driving the
935                  * signal yet).
936                  */
937                 pins = "gpio48";
938                 bias-pull-up;
939         };
940 };
941
942 &qup_uart9_default {
943         pinconf-tx {
944                 pins = "gpio4";
945                 drive-strength = <2>;
946                 bias-disable;
947         };
948
949         pinconf-rx {
950                 pins = "gpio5";
951                 drive-strength = <2>;
952                 bias-pull-up;
953         };
954 };
955
956 /* PINCTRL - board-specific pinctrl */
957 &pm8005_gpio {
958         gpio-line-names = "",
959                           "",
960                           "SLB",
961                           "";
962 };
963
964 &pm8998_adc {
965         adc-chan@4d {
966                 reg = <ADC5_AMUX_THM1_100K_PU>;
967                 label = "sdm_temp";
968         };
969
970         adc-chan@4e {
971                 reg = <ADC5_AMUX_THM2_100K_PU>;
972                 label = "quiet_temp";
973         };
974
975         adc-chan@4f {
976                 reg = <ADC5_AMUX_THM3_100K_PU>;
977                 label = "lte_temp_1";
978         };
979
980         adc-chan@50 {
981                 reg = <ADC5_AMUX_THM4_100K_PU>;
982                 label = "lte_temp_2";
983         };
984
985         adc-chan@51 {
986                 reg = <ADC5_AMUX_THM5_100K_PU>;
987                 label = "charger_temp";
988         };
989 };
990
991 &pm8998_gpio {
992         gpio-line-names = "",
993                           "",
994                           "SW_CTRL",
995                           "",
996                           "",
997                           "",
998                           "",
999                           "",
1000                           "",
1001                           "",
1002                           "",
1003                           "",
1004                           "",
1005                           "",
1006                           "",
1007                           "",
1008                           "",
1009                           "",
1010                           "",
1011                           "",
1012                           "",
1013                           "CFG_OPT1",
1014                           "WCSS_PWR_REQ",
1015                           "",
1016                           "CFG_OPT2",
1017                           "SLB";
1018 };
1019
1020 &tlmm {
1021         /*
1022          * pinctrl settings for pins that have no real owners.
1023          */
1024         pinctrl-names = "default", "sleep";
1025         pinctrl-0 = <&bios_flash_wp_r_l>,
1026                     <&ap_suspend_l_deassert>;
1027
1028         pinctrl-1 = <&bios_flash_wp_r_l>,
1029                     <&ap_suspend_l_assert>;
1030
1031         /*
1032          * Hogs prevent usermode from changing the value. A GPIO can be both
1033          * here and in the pinctrl section.
1034          */
1035         ap-suspend-l-hog {
1036                 gpio-hog;
1037                 gpios = <126 GPIO_ACTIVE_LOW>;
1038                 output-low;
1039         };
1040
1041         ap_edp_bklten: ap-edp-bklten {
1042                 pinmux {
1043                         pins = "gpio37";
1044                         function = "gpio";
1045                 };
1046
1047                 pinconf {
1048                         pins = "gpio37";
1049                         drive-strength = <2>;
1050                         bias-disable;
1051                 };
1052         };
1053
1054         bios_flash_wp_r_l: bios-flash-wp-r-l {
1055                 pinmux {
1056                         pins = "gpio128";
1057                         function = "gpio";
1058                         input-enable;
1059                 };
1060
1061                 pinconf {
1062                         pins = "gpio128";
1063                         bias-disable;
1064                 };
1065         };
1066
1067         ec_ap_int_l: ec-ap-int-l {
1068                 pinmux {
1069                        pins = "gpio122";
1070                        function = "gpio";
1071                        input-enable;
1072                 };
1073
1074                 pinconf {
1075                        pins = "gpio122";
1076                        bias-pull-up;
1077                 };
1078         };
1079
1080         edp_brij_en: edp-brij-en {
1081                 pinmux {
1082                         pins = "gpio102";
1083                         function = "gpio";
1084                 };
1085
1086                 pinconf {
1087                         pins = "gpio102";
1088                         drive-strength = <2>;
1089                         bias-disable;
1090                 };
1091         };
1092
1093         edp_brij_irq: edp-brij-irq {
1094                 pinmux {
1095                         pins = "gpio10";
1096                         function = "gpio";
1097                 };
1098
1099                 pinconf {
1100                         pins = "gpio10";
1101                         drive-strength = <2>;
1102                         bias-pull-down;
1103                 };
1104         };
1105
1106         en_pp3300_dx_edp: en-pp3300-dx-edp {
1107                 pinmux {
1108                         pins = "gpio43";
1109                         function = "gpio";
1110                 };
1111
1112                 pinconf {
1113                         pins = "gpio43";
1114                         drive-strength = <2>;
1115                         bias-disable;
1116                 };
1117         };
1118
1119         h1_ap_int_odl: h1-ap-int-odl {
1120                 pinmux {
1121                         pins = "gpio129";
1122                         function = "gpio";
1123                         input-enable;
1124                 };
1125
1126                 pinconf {
1127                         pins = "gpio129";
1128                         bias-pull-up;
1129                 };
1130         };
1131
1132         pen_eject_odl: pen-eject-odl {
1133                 pinmux {
1134                         pins = "gpio119";
1135                         function = "gpio";
1136                         bias-pull-up;
1137                 };
1138         };
1139
1140         pen_irq_l: pen-irq-l {
1141                 pinmux {
1142                         pins = "gpio24";
1143                         function = "gpio";
1144                 };
1145
1146                 pinconf {
1147                         pins = "gpio24";
1148
1149                         /* Has external pullup */
1150                         bias-disable;
1151                 };
1152         };
1153
1154         pen_pdct_l: pen-pdct-l {
1155                 pinmux {
1156                         pins = "gpio63";
1157                         function = "gpio";
1158                 };
1159
1160                 pinconf {
1161                         pins = "gpio63";
1162
1163                         /* Has external pullup */
1164                         bias-disable;
1165                 };
1166         };
1167
1168         pen_rst_l: pen-rst-l {
1169                 pinmux  {
1170                         pins = "gpio23";
1171                         function = "gpio";
1172                 };
1173
1174                 pinconf {
1175                         pins = "gpio23";
1176                         bias-disable;
1177                         drive-strength = <2>;
1178
1179                         /*
1180                          * The pen driver doesn't currently support
1181                          * driving this reset line.  By specifying
1182                          * output-high here we're relying on the fact
1183                          * that this pin has a default pulldown at boot
1184                          * (which makes sure the pen was in reset if it
1185                          * was powered) and then we set it high here to
1186                          * take it out of reset.  Better would be if the
1187                          * pen driver could control this and we could
1188                          * remove "output-high" here.
1189                          */
1190                         output-high;
1191                 };
1192         };
1193
1194         sdc2_clk: sdc2-clk {
1195                 pinconf {
1196                         pins = "sdc2_clk";
1197                         bias-disable;
1198
1199                         /*
1200                          * It seems that mmc_test reports errors if drive
1201                          * strength is not 16.
1202                          */
1203                         drive-strength = <16>;
1204                 };
1205         };
1206
1207         sdc2_cmd: sdc2-cmd {
1208                 pinconf {
1209                         pins = "sdc2_cmd";
1210                         bias-pull-up;
1211                         drive-strength = <16>;
1212                 };
1213         };
1214
1215         sdc2_data: sdc2-data {
1216                 pinconf {
1217                         pins = "sdc2_data";
1218                         bias-pull-up;
1219                         drive-strength = <16>;
1220                 };
1221         };
1222
1223         sd_cd_odl: sd-cd-odl {
1224                 pinmux {
1225                         pins = "gpio44";
1226                         function = "gpio";
1227                 };
1228
1229                 pinconf {
1230                         pins = "gpio44";
1231                         bias-pull-up;
1232                 };
1233         };
1234
1235         ts_int_l: ts-int-l {
1236                 pinmux  {
1237                         pins = "gpio125";
1238                         function = "gpio";
1239                 };
1240
1241                 pinconf {
1242                         pins = "gpio125";
1243                         bias-pull-up;
1244                 };
1245         };
1246
1247         ts_reset_l: ts-reset-l {
1248                 pinmux  {
1249                         pins = "gpio118";
1250                         function = "gpio";
1251                 };
1252
1253                 pinconf {
1254                         pins = "gpio118";
1255                         bias-disable;
1256                         drive-strength = <2>;
1257                 };
1258         };
1259
1260         ap_suspend_l_assert: ap_suspend_l_assert {
1261                 config {
1262                         pins = "gpio126";
1263                         function = "gpio";
1264                         bias-no-pull;
1265                         drive-strength = <2>;
1266                         output-low;
1267                 };
1268         };
1269
1270         ap_suspend_l_deassert: ap_suspend_l_deassert {
1271                 config {
1272                         pins = "gpio126";
1273                         function = "gpio";
1274                         bias-no-pull;
1275                         drive-strength = <2>;
1276                         output-high;
1277                 };
1278         };
1279 };