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/gpio/gpio.h>
11#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
12#include "sdm845.dtsi"
13
14/ {
15	model = "Qualcomm Technologies, Inc. SDM845 MTP";
16	compatible = "qcom,sdm845-mtp";
17
18	aliases {
19		serial0 = &uart9;
20	};
21
22	chosen {
23		stdout-path = "serial0:115200n8";
24	};
25
26	vph_pwr: vph-pwr-regulator {
27		compatible = "regulator-fixed";
28		regulator-name = "vph_pwr";
29		regulator-min-microvolt = <3700000>;
30		regulator-max-microvolt = <3700000>;
31	};
32
33	/*
34	 * Apparently RPMh does not provide support for PM8998 S4 because it
35	 * is always-on; model it as a fixed regulator.
36	 */
37	vreg_s4a_1p8: pm8998-smps4 {
38		compatible = "regulator-fixed";
39		regulator-name = "vreg_s4a_1p8";
40
41		regulator-min-microvolt = <1800000>;
42		regulator-max-microvolt = <1800000>;
43
44		regulator-always-on;
45		regulator-boot-on;
46
47		vin-supply = <&vph_pwr>;
48	};
49};
50
51&adsp_pas {
52	status = "okay";
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};
354
355&gcc {
356	protected-clocks = <GCC_QSPI_CORE_CLK>,
357			   <GCC_QSPI_CORE_CLK_SRC>,
358			   <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
359			   <GCC_LPASS_Q6_AXI_CLK>,
360			   <GCC_LPASS_SWAY_CLK>;
361};
362
363&gpu {
364	zap-shader {
365		memory-region = <&gpu_mem>;
366		firmware-name = "qcom/sdm845/a630_zap.mbn";
367	};
368};
369
370&i2c10 {
371	status = "okay";
372	clock-frequency = <400000>;
373};
374
375&qupv3_id_1 {
376	status = "okay";
377};
378
379&sdhc_2 {
380	status = "okay";
381
382	pinctrl-names = "default";
383	pinctrl-0 = <&sdc2_clk &sdc2_cmd &sdc2_data &sd_card_det_n>;
384
385	vmmc-supply = <&vreg_l21a_2p95>;
386	vqmmc-supply = <&vddpx_2>;
387
388	cd-gpios = <&tlmm 126 GPIO_ACTIVE_LOW>;
389};
390
391&uart9 {
392	status = "okay";
393};
394
395&ufs_mem_hc {
396	status = "okay";
397
398	reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
399
400	vcc-supply = <&vreg_l20a_2p95>;
401	vcc-max-microamp = <600000>;
402};
403
404&ufs_mem_phy {
405	status = "okay";
406
407	vdda-phy-supply = <&vdda_ufs1_core>;
408	vdda-pll-supply = <&vdda_ufs1_1p2>;
409};
410
411&usb_1 {
412	status = "okay";
413};
414
415&usb_1_dwc3 {
416	/* Until we have Type C hooked up we'll force this as peripheral. */
417	dr_mode = "peripheral";
418};
419
420&usb_1_hsphy {
421	status = "okay";
422
423	vdd-supply = <&vdda_usb1_ss_core>;
424	vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
425	vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
426
427	qcom,imp-res-offset-value = <8>;
428	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
429	qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
430	qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
431};
432
433&usb_1_qmpphy {
434	status = "okay";
435
436	vdda-phy-supply = <&vdda_usb1_ss_1p2>;
437	vdda-pll-supply = <&vdda_usb1_ss_core>;
438};
439
440&usb_2 {
441	status = "okay";
442};
443
444&usb_2_dwc3 {
445	/*
446	 * Though the USB block on SDM845 can support host, there's no vbus
447	 * signal for this port on MTP.  Thus (unless you have a non-compliant
448	 * hub that works without vbus) the only sensible thing is to force
449	 * peripheral mode.
450	 */
451	dr_mode = "peripheral";
452};
453
454&usb_2_hsphy {
455	status = "okay";
456
457	vdd-supply = <&vdda_usb2_ss_core>;
458	vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
459	vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
460
461	qcom,imp-res-offset-value = <8>;
462	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_22_8_MA>;
463};
464
465&usb_2_qmpphy {
466	status = "okay";
467
468	vdda-phy-supply = <&vdda_usb2_ss_1p2>;
469	vdda-pll-supply = <&vdda_usb2_ss_core>;
470};
471
472&wifi {
473	status = "okay";
474	vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
475	vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
476	vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
477	vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
478};
479
480/* PINCTRL - additions to nodes defined in sdm845.dtsi */
481
482&qup_i2c10_default {
483	pinconf {
484		pins = "gpio55", "gpio56";
485		drive-strength = <2>;
486		bias-disable;
487	};
488};
489
490&qup_uart9_default {
491	pinconf-tx {
492		pins = "gpio4";
493		drive-strength = <2>;
494		bias-disable;
495	};
496
497	pinconf-rx {
498		pins = "gpio5";
499		drive-strength = <2>;
500		bias-pull-up;
501	};
502};
503
504&tlmm {
505	gpio-reserved-ranges = <0 4>, <81 4>;
506
507	sdc2_clk: sdc2-clk {
508		pinconf {
509			pins = "sdc2_clk";
510			bias-disable;
511
512			/*
513			 * It seems that mmc_test reports errors if drive
514			 * strength is not 16 on clk, cmd, and data pins.
515			 */
516			drive-strength = <16>;
517		};
518	};
519
520	sdc2_cmd: sdc2-cmd {
521		pinconf {
522			pins = "sdc2_cmd";
523			bias-pull-up;
524			drive-strength = <16>;
525		};
526	};
527
528	sdc2_data: sdc2-data {
529		pinconf {
530			pins = "sdc2_data";
531			bias-pull-up;
532			drive-strength = <16>;
533		};
534	};
535
536	sd_card_det_n: sd-card-det-n {
537		pinmux {
538			pins = "gpio126";
539			function = "gpio";
540		};
541
542		pinconf {
543			pins = "gpio126";
544			bias-pull-up;
545		};
546	};
547};
548