1// SPDX-License-Identifier: GPL-2.0
2/*
3 * SDM845 MTP board device tree source
4 *
5 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
6 */
7
8/dts-v1/;
9
10#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
11#include "sdm845.dtsi"
12
13/ {
14	model = "Qualcomm Technologies, Inc. SDM845 MTP";
15	compatible = "qcom,sdm845-mtp", "qcom,sdm845";
16
17	aliases {
18		serial0 = &uart9;
19	};
20
21	chosen {
22		stdout-path = "serial0:115200n8";
23	};
24
25	vph_pwr: vph-pwr-regulator {
26		compatible = "regulator-fixed";
27		regulator-name = "vph_pwr";
28		regulator-min-microvolt = <3700000>;
29		regulator-max-microvolt = <3700000>;
30	};
31
32	/*
33	 * Apparently RPMh does not provide support for PM8998 S4 because it
34	 * is always-on; model it as a fixed regulator.
35	 */
36	vreg_s4a_1p8: pm8998-smps4 {
37		compatible = "regulator-fixed";
38		regulator-name = "vreg_s4a_1p8";
39
40		regulator-min-microvolt = <1800000>;
41		regulator-max-microvolt = <1800000>;
42
43		regulator-always-on;
44		regulator-boot-on;
45
46		vin-supply = <&vph_pwr>;
47	};
48};
49
50&adsp_pas {
51	status = "okay";
52	firmware-name = "qcom/sdm845/adsp.mdt";
53};
54
55&apps_rsc {
56	pm8998-rpmh-regulators {
57		compatible = "qcom,pm8998-rpmh-regulators";
58		qcom,pmic-id = "a";
59
60		vdd-s1-supply = <&vph_pwr>;
61		vdd-s2-supply = <&vph_pwr>;
62		vdd-s3-supply = <&vph_pwr>;
63		vdd-s4-supply = <&vph_pwr>;
64		vdd-s5-supply = <&vph_pwr>;
65		vdd-s6-supply = <&vph_pwr>;
66		vdd-s7-supply = <&vph_pwr>;
67		vdd-s8-supply = <&vph_pwr>;
68		vdd-s9-supply = <&vph_pwr>;
69		vdd-s10-supply = <&vph_pwr>;
70		vdd-s11-supply = <&vph_pwr>;
71		vdd-s12-supply = <&vph_pwr>;
72		vdd-s13-supply = <&vph_pwr>;
73		vdd-l1-l27-supply = <&vreg_s7a_1p025>;
74		vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>;
75		vdd-l3-l11-supply = <&vreg_s7a_1p025>;
76		vdd-l4-l5-supply = <&vreg_s7a_1p025>;
77		vdd-l6-supply = <&vph_pwr>;
78		vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>;
79		vdd-l9-supply = <&vreg_bob>;
80		vdd-l10-l23-l25-supply = <&vreg_bob>;
81		vdd-l13-l19-l21-supply = <&vreg_bob>;
82		vdd-l16-l28-supply = <&vreg_bob>;
83		vdd-l18-l22-supply = <&vreg_bob>;
84		vdd-l20-l24-supply = <&vreg_bob>;
85		vdd-l26-supply = <&vreg_s3a_1p35>;
86		vin-lvs-1-2-supply = <&vreg_s4a_1p8>;
87
88		vreg_s2a_1p125: smps2 {
89			regulator-min-microvolt = <1100000>;
90			regulator-max-microvolt = <1100000>;
91		};
92
93		vreg_s3a_1p35: smps3 {
94			regulator-min-microvolt = <1352000>;
95			regulator-max-microvolt = <1352000>;
96		};
97
98		vreg_s5a_2p04: smps5 {
99			regulator-min-microvolt = <1904000>;
100			regulator-max-microvolt = <2040000>;
101		};
102
103		vreg_s7a_1p025: smps7 {
104			regulator-min-microvolt = <900000>;
105			regulator-max-microvolt = <1028000>;
106		};
107
108		vdd_qusb_hs0:
109		vdda_hp_pcie_core:
110		vdda_mipi_csi0_0p9:
111		vdda_mipi_csi1_0p9:
112		vdda_mipi_csi2_0p9:
113		vdda_mipi_dsi0_pll:
114		vdda_mipi_dsi1_pll:
115		vdda_qlink_lv:
116		vdda_qlink_lv_ck:
117		vdda_qrefs_0p875:
118		vdda_pcie_core:
119		vdda_pll_cc_ebi01:
120		vdda_pll_cc_ebi23:
121		vdda_sp_sensor:
122		vdda_ufs1_core:
123		vdda_ufs2_core:
124		vdda_usb1_ss_core:
125		vdda_usb2_ss_core:
126		vreg_l1a_0p875: ldo1 {
127			regulator-min-microvolt = <880000>;
128			regulator-max-microvolt = <880000>;
129			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
130		};
131
132		vddpx_10:
133		vreg_l2a_1p2: ldo2 {
134			regulator-min-microvolt = <1200000>;
135			regulator-max-microvolt = <1200000>;
136			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
137			regulator-always-on;
138		};
139
140		vreg_l3a_1p0: ldo3 {
141			regulator-min-microvolt = <1000000>;
142			regulator-max-microvolt = <1000000>;
143			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
144		};
145
146		vdd_wcss_cx:
147		vdd_wcss_mx:
148		vdda_wcss_pll:
149		vreg_l5a_0p8: ldo5 {
150			regulator-min-microvolt = <800000>;
151			regulator-max-microvolt = <800000>;
152			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
153		};
154
155		vddpx_13:
156		vreg_l6a_1p8: ldo6 {
157			regulator-min-microvolt = <1856000>;
158			regulator-max-microvolt = <1856000>;
159			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
160		};
161
162		vreg_l7a_1p8: ldo7 {
163			regulator-min-microvolt = <1800000>;
164			regulator-max-microvolt = <1800000>;
165			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
166		};
167
168		vreg_l8a_1p2: ldo8 {
169			regulator-min-microvolt = <1200000>;
170			regulator-max-microvolt = <1248000>;
171			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
172		};
173
174		vreg_l9a_1p8: ldo9 {
175			regulator-min-microvolt = <1704000>;
176			regulator-max-microvolt = <2928000>;
177			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
178		};
179
180		vreg_l10a_1p8: ldo10 {
181			regulator-min-microvolt = <1704000>;
182			regulator-max-microvolt = <2928000>;
183			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
184		};
185
186		vreg_l11a_1p0: ldo11 {
187			regulator-min-microvolt = <1000000>;
188			regulator-max-microvolt = <1048000>;
189			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
190		};
191
192		vdd_qfprom:
193		vdd_qfprom_sp:
194		vdda_apc1_cs_1p8:
195		vdda_gfx_cs_1p8:
196		vdda_qrefs_1p8:
197		vdda_qusb_hs0_1p8:
198		vddpx_11:
199		vreg_l12a_1p8: ldo12 {
200			regulator-min-microvolt = <1800000>;
201			regulator-max-microvolt = <1800000>;
202			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
203		};
204
205		vddpx_2:
206		vreg_l13a_2p95: ldo13 {
207			regulator-min-microvolt = <1800000>;
208			regulator-max-microvolt = <2960000>;
209			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
210		};
211
212		vreg_l14a_1p88: ldo14 {
213			regulator-min-microvolt = <1800000>;
214			regulator-max-microvolt = <1800000>;
215			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
216		};
217
218		vreg_l15a_1p8: ldo15 {
219			regulator-min-microvolt = <1800000>;
220			regulator-max-microvolt = <1800000>;
221			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
222		};
223
224		vreg_l16a_2p7: ldo16 {
225			regulator-min-microvolt = <2704000>;
226			regulator-max-microvolt = <2704000>;
227			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
228		};
229
230		vreg_l17a_1p3: ldo17 {
231			regulator-min-microvolt = <1304000>;
232			regulator-max-microvolt = <1304000>;
233			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
234		};
235
236		vreg_l18a_2p7: ldo18 {
237			regulator-min-microvolt = <2704000>;
238			regulator-max-microvolt = <2960000>;
239			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
240		};
241
242		vreg_l19a_3p0: ldo19 {
243			regulator-min-microvolt = <2856000>;
244			regulator-max-microvolt = <3104000>;
245			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
246		};
247
248		vreg_l20a_2p95: ldo20 {
249			regulator-min-microvolt = <2704000>;
250			regulator-max-microvolt = <2960000>;
251			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
252		};
253
254		vreg_l21a_2p95: ldo21 {
255			regulator-min-microvolt = <2704000>;
256			regulator-max-microvolt = <2960000>;
257			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
258		};
259
260		vreg_l22a_2p85: ldo22 {
261			regulator-min-microvolt = <2864000>;
262			regulator-max-microvolt = <3312000>;
263			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
264		};
265
266		vreg_l23a_3p3: ldo23 {
267			regulator-min-microvolt = <3000000>;
268			regulator-max-microvolt = <3312000>;
269			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
270		};
271
272		vdda_qusb_hs0_3p1:
273		vreg_l24a_3p075: ldo24 {
274			regulator-min-microvolt = <3088000>;
275			regulator-max-microvolt = <3088000>;
276			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
277		};
278
279		vreg_l25a_3p3: ldo25 {
280			regulator-min-microvolt = <3300000>;
281			regulator-max-microvolt = <3312000>;
282			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
283		};
284
285		vdda_hp_pcie_1p2:
286		vdda_hv_ebi0:
287		vdda_hv_ebi1:
288		vdda_hv_ebi2:
289		vdda_hv_ebi3:
290		vdda_mipi_csi_1p25:
291		vdda_mipi_dsi0_1p2:
292		vdda_mipi_dsi1_1p2:
293		vdda_pcie_1p2:
294		vdda_ufs1_1p2:
295		vdda_ufs2_1p2:
296		vdda_usb1_ss_1p2:
297		vdda_usb2_ss_1p2:
298		vreg_l26a_1p2: ldo26 {
299			regulator-min-microvolt = <1200000>;
300			regulator-max-microvolt = <1200000>;
301			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
302		};
303
304		vreg_l28a_3p0: ldo28 {
305			regulator-min-microvolt = <2856000>;
306			regulator-max-microvolt = <3008000>;
307			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
308		};
309
310		vreg_lvs1a_1p8: lvs1 {
311			regulator-min-microvolt = <1800000>;
312			regulator-max-microvolt = <1800000>;
313		};
314
315		vreg_lvs2a_1p8: lvs2 {
316			regulator-min-microvolt = <1800000>;
317			regulator-max-microvolt = <1800000>;
318		};
319	};
320
321	pmi8998-rpmh-regulators {
322		compatible = "qcom,pmi8998-rpmh-regulators";
323		qcom,pmic-id = "b";
324
325		vdd-bob-supply = <&vph_pwr>;
326
327		vreg_bob: bob {
328			regulator-min-microvolt = <3312000>;
329			regulator-max-microvolt = <3600000>;
330			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
331			regulator-allow-bypass;
332		};
333	};
334
335	pm8005-rpmh-regulators {
336		compatible = "qcom,pm8005-rpmh-regulators";
337		qcom,pmic-id = "c";
338
339		vdd-s1-supply = <&vph_pwr>;
340		vdd-s2-supply = <&vph_pwr>;
341		vdd-s3-supply = <&vph_pwr>;
342		vdd-s4-supply = <&vph_pwr>;
343
344		vreg_s3c_0p6: smps3 {
345			regulator-min-microvolt = <600000>;
346			regulator-max-microvolt = <600000>;
347		};
348	};
349};
350
351&cdsp_pas {
352	status = "okay";
353	firmware-name = "qcom/sdm845/cdsp.mdt";
354};
355
356&dsi0 {
357	status = "okay";
358	vdda-supply = <&vdda_mipi_dsi0_1p2>;
359
360	qcom,dual-dsi-mode;
361	qcom,master-dsi;
362
363	ports {
364		port@1 {
365			endpoint {
366				remote-endpoint = <&truly_in_0>;
367				data-lanes = <0 1 2 3>;
368			};
369		};
370	};
371
372	panel@0 {
373		compatible = "truly,nt35597-2K-display";
374		reg = <0>;
375		vdda-supply = <&vreg_l14a_1p88>;
376
377		reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
378		mode-gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
379
380		ports {
381			#address-cells = <1>;
382			#size-cells = <0>;
383
384			port@0 {
385				reg = <0>;
386				truly_in_0: endpoint {
387					remote-endpoint = <&dsi0_out>;
388				};
389			};
390
391			port@1 {
392				reg = <1>;
393				truly_in_1: endpoint {
394					remote-endpoint = <&dsi1_out>;
395				};
396			};
397		};
398	};
399};
400
401&dsi0_phy {
402	status = "okay";
403	vdds-supply = <&vdda_mipi_dsi0_pll>;
404};
405
406&dsi1 {
407	status = "okay";
408	vdda-supply = <&vdda_mipi_dsi1_1p2>;
409
410	qcom,dual-dsi-mode;
411
412	/* DSI1 is slave, so use DSI0 clocks */
413	assigned-clock-parents = <&dsi0_phy 0>, <&dsi0_phy 1>;
414
415	ports {
416		port@1 {
417			endpoint {
418				remote-endpoint = <&truly_in_1>;
419				data-lanes = <0 1 2 3>;
420			};
421		};
422	};
423};
424
425&dsi1_phy {
426	status = "okay";
427	vdds-supply = <&vdda_mipi_dsi1_pll>;
428};
429
430&gcc {
431	protected-clocks = <GCC_QSPI_CORE_CLK>,
432			   <GCC_QSPI_CORE_CLK_SRC>,
433			   <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
434			   <GCC_LPASS_Q6_AXI_CLK>,
435			   <GCC_LPASS_SWAY_CLK>;
436};
437
438&gmu {
439	status = "okay";
440};
441
442&gpu {
443	status = "okay";
444
445	zap-shader {
446		memory-region = <&gpu_mem>;
447		firmware-name = "qcom/sdm845/a630_zap.mbn";
448	};
449};
450
451&i2c10 {
452	status = "okay";
453	clock-frequency = <400000>;
454};
455
456&ipa {
457	status = "okay";
458	memory-region = <&ipa_fw_mem>;
459};
460
461&mdss {
462	status = "okay";
463};
464
465&mss_pil {
466	status = "okay";
467	firmware-name = "qcom/sdm845/mba.mbn", "qcom/sdm845/modem.mbn";
468};
469
470&qupv3_id_1 {
471	status = "okay";
472};
473
474&sdhc_2 {
475	status = "okay";
476
477	pinctrl-names = "default";
478	pinctrl-0 = <&sdc2_clk &sdc2_cmd &sdc2_data &sd_card_det_n>;
479
480	vmmc-supply = <&vreg_l21a_2p95>;
481	vqmmc-supply = <&vddpx_2>;
482
483	cd-gpios = <&tlmm 126 GPIO_ACTIVE_LOW>;
484};
485
486&uart9 {
487	status = "okay";
488};
489
490&ufs_mem_hc {
491	status = "okay";
492
493	reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
494
495	vcc-supply = <&vreg_l20a_2p95>;
496	vcc-max-microamp = <600000>;
497};
498
499&ufs_mem_phy {
500	status = "okay";
501
502	vdda-phy-supply = <&vdda_ufs1_core>;
503	vdda-pll-supply = <&vdda_ufs1_1p2>;
504};
505
506&usb_1 {
507	status = "okay";
508};
509
510&usb_1_dwc3 {
511	/* Until we have Type C hooked up we'll force this as peripheral. */
512	dr_mode = "peripheral";
513};
514
515&usb_1_hsphy {
516	status = "okay";
517
518	vdd-supply = <&vdda_usb1_ss_core>;
519	vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
520	vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
521
522	qcom,imp-res-offset-value = <8>;
523	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
524	qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
525	qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
526};
527
528&usb_1_qmpphy {
529	status = "okay";
530
531	vdda-phy-supply = <&vdda_usb1_ss_1p2>;
532	vdda-pll-supply = <&vdda_usb1_ss_core>;
533};
534
535&usb_2 {
536	status = "okay";
537};
538
539&usb_2_dwc3 {
540	/*
541	 * Though the USB block on SDM845 can support host, there's no vbus
542	 * signal for this port on MTP.  Thus (unless you have a non-compliant
543	 * hub that works without vbus) the only sensible thing is to force
544	 * peripheral mode.
545	 */
546	dr_mode = "peripheral";
547};
548
549&usb_2_hsphy {
550	status = "okay";
551
552	vdd-supply = <&vdda_usb2_ss_core>;
553	vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
554	vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
555
556	qcom,imp-res-offset-value = <8>;
557	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_22_8_MA>;
558};
559
560&usb_2_qmpphy {
561	status = "okay";
562
563	vdda-phy-supply = <&vdda_usb2_ss_1p2>;
564	vdda-pll-supply = <&vdda_usb2_ss_core>;
565};
566
567&venus {
568	status = "okay";
569};
570
571&wifi {
572	status = "okay";
573	vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
574	vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
575	vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
576	vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
577};
578
579/* PINCTRL - additions to nodes defined in sdm845.dtsi */
580
581&qup_i2c10_default {
582	pinconf {
583		pins = "gpio55", "gpio56";
584		drive-strength = <2>;
585		bias-disable;
586	};
587};
588
589&qup_uart9_default {
590	pinconf-tx {
591		pins = "gpio4";
592		drive-strength = <2>;
593		bias-disable;
594	};
595
596	pinconf-rx {
597		pins = "gpio5";
598		drive-strength = <2>;
599		bias-pull-up;
600	};
601};
602
603&tlmm {
604	gpio-reserved-ranges = <0 4>, <81 4>;
605
606	sdc2_clk: sdc2-clk {
607		pinconf {
608			pins = "sdc2_clk";
609			bias-disable;
610
611			/*
612			 * It seems that mmc_test reports errors if drive
613			 * strength is not 16 on clk, cmd, and data pins.
614			 */
615			drive-strength = <16>;
616		};
617	};
618
619	sdc2_cmd: sdc2-cmd {
620		pinconf {
621			pins = "sdc2_cmd";
622			bias-pull-up;
623			drive-strength = <16>;
624		};
625	};
626
627	sdc2_data: sdc2-data {
628		pinconf {
629			pins = "sdc2_data";
630			bias-pull-up;
631			drive-strength = <16>;
632		};
633	};
634
635	sd_card_det_n: sd-card-det-n {
636		pinmux {
637			pins = "gpio126";
638			function = "gpio";
639		};
640
641		pinconf {
642			pins = "gpio126";
643			bias-pull-up;
644		};
645	};
646};
647