1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2019, Linaro Limited
5 */
6
7/dts-v1/;
8
9#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
10#include <dt-bindings/gpio/gpio.h>
11#include "sm8150.dtsi"
12#include "pm8150.dtsi"
13#include "pm8150b.dtsi"
14#include "pm8150l.dtsi"
15
16/ {
17	model = "Qualcomm Technologies, Inc. SM8150 MTP";
18	compatible = "qcom,sm8150-mtp", "qcom,sm8150";
19
20	aliases {
21		serial0 = &uart2;
22	};
23
24	chosen {
25		stdout-path = "serial0:115200n8";
26	};
27
28	vph_pwr: vph-pwr-regulator {
29		compatible = "regulator-fixed";
30		regulator-name = "vph_pwr";
31		regulator-min-microvolt = <3700000>;
32		regulator-max-microvolt = <3700000>;
33	};
34
35	/*
36	 * Apparently RPMh does not provide support for PM8150 S4 because it
37	 * is always-on; model it as a fixed regulator.
38	 */
39	vreg_s4a_1p8: pm8150-s4 {
40		compatible = "regulator-fixed";
41		regulator-name = "vreg_s4a_1p8";
42
43		regulator-min-microvolt = <1800000>;
44		regulator-max-microvolt = <1800000>;
45
46		regulator-always-on;
47		regulator-boot-on;
48
49		vin-supply = <&vph_pwr>;
50	};
51};
52
53&apps_rsc {
54	pm8150-rpmh-regulators {
55		compatible = "qcom,pm8150-rpmh-regulators";
56		qcom,pmic-id = "a";
57
58		vdd-s1-supply = <&vph_pwr>;
59		vdd-s2-supply = <&vph_pwr>;
60		vdd-s3-supply = <&vph_pwr>;
61		vdd-s4-supply = <&vph_pwr>;
62		vdd-s5-supply = <&vph_pwr>;
63		vdd-s6-supply = <&vph_pwr>;
64		vdd-s7-supply = <&vph_pwr>;
65		vdd-s8-supply = <&vph_pwr>;
66		vdd-s9-supply = <&vph_pwr>;
67		vdd-s10-supply = <&vph_pwr>;
68
69		vdd-l1-l8-l11-supply = <&vreg_s6a_0p9>;
70		vdd-l2-l10-supply = <&vreg_bob>;
71		vdd-l3-l4-l5-l18-supply = <&vreg_s6a_0p9>;
72		vdd-l6-l9-supply = <&vreg_s8c_1p3>;
73		vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p0>;
74		vdd-l13-l16-l17-supply = <&vreg_bob>;
75
76		vreg_s5a_2p0: smps5 {
77			regulator-min-microvolt = <1904000>;
78			regulator-max-microvolt = <2000000>;
79		};
80
81		vreg_s6a_0p9: smps6 {
82			regulator-min-microvolt = <920000>;
83			regulator-max-microvolt = <1128000>;
84		};
85
86		vdda_wcss_pll:
87		vreg_l1a_0p75: ldo1 {
88			regulator-min-microvolt = <752000>;
89			regulator-max-microvolt = <752000>;
90			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
91		};
92
93		vdd_pdphy:
94		vdda_usb_hs_3p1:
95		vreg_l2a_3p1: ldo2 {
96			regulator-min-microvolt = <3072000>;
97			regulator-max-microvolt = <3072000>;
98			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
99		};
100
101		vreg_l3a_0p8: ldo3 {
102			regulator-min-microvolt = <480000>;
103			regulator-max-microvolt = <932000>;
104			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
105		};
106
107		vdd_usb_hs_core:
108		vdda_csi_0_0p9:
109		vdda_csi_1_0p9:
110		vdda_csi_2_0p9:
111		vdda_csi_3_0p9:
112		vdda_dsi_0_0p9:
113		vdda_dsi_1_0p9:
114		vdda_dsi_0_pll_0p9:
115		vdda_dsi_1_pll_0p9:
116		vdda_pcie_1ln_core:
117		vdda_pcie_2ln_core:
118		vdda_pll_hv_cc_ebi01:
119		vdda_pll_hv_cc_ebi23:
120		vdda_qrefs_0p875_5:
121		vdda_sp_sensor:
122		vdda_ufs_2ln_core_1:
123		vdda_ufs_2ln_core_2:
124		vdda_usb_ss_dp_core_1:
125		vdda_usb_ss_dp_core_2:
126		vdda_qlink_lv:
127		vdda_qlink_lv_ck:
128		vreg_l5a_0p875: ldo5 {
129			regulator-min-microvolt = <880000>;
130			regulator-max-microvolt = <880000>;
131			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
132		};
133
134		vreg_l6a_1p2: ldo6 {
135			regulator-min-microvolt = <1200000>;
136			regulator-max-microvolt = <1200000>;
137			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
138		};
139
140		vreg_l7a_1p8: ldo7 {
141			regulator-min-microvolt = <1800000>;
142			regulator-max-microvolt = <1800000>;
143			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
144		};
145
146		vddpx_10:
147		vreg_l9a_1p2: ldo9 {
148			regulator-min-microvolt = <1200000>;
149			regulator-max-microvolt = <1200000>;
150			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
151		};
152
153		vreg_l10a_2p5: ldo10 {
154			regulator-min-microvolt = <2504000>;
155			regulator-max-microvolt = <2960000>;
156			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
157		};
158
159		vreg_l11a_0p8: ldo11 {
160			regulator-min-microvolt = <800000>;
161			regulator-max-microvolt = <800000>;
162			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
163		};
164
165		vdd_qfprom:
166		vdd_qfprom_sp:
167		vdda_apc_cs_1p8:
168		vdda_gfx_cs_1p8:
169		vdda_usb_hs_1p8:
170		vdda_qrefs_vref_1p8:
171		vddpx_10_a:
172		vreg_l12a_1p8: ldo12 {
173			regulator-min-microvolt = <1800000>;
174			regulator-max-microvolt = <1800000>;
175			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
176		};
177
178		vreg_l13a_2p7: ldo13 {
179			regulator-min-microvolt = <2704000>;
180			regulator-max-microvolt = <2704000>;
181			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
182		};
183
184		vreg_l14a_1p8: ldo14 {
185			regulator-min-microvolt = <1800000>;
186			regulator-max-microvolt = <1880000>;
187			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
188		};
189
190		vreg_l15a_1p7: ldo15 {
191			regulator-min-microvolt = <1704000>;
192			regulator-max-microvolt = <1704000>;
193			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
194		};
195
196		vreg_l16a_2p7: ldo16 {
197			regulator-min-microvolt = <2704000>;
198			regulator-max-microvolt = <2960000>;
199			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
200		};
201
202		vreg_l17a_3p0: ldo17 {
203			regulator-min-microvolt = <2856000>;
204			regulator-max-microvolt = <3008000>;
205			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
206		};
207	};
208
209	pm8150l-rpmh-regulators {
210		compatible = "qcom,pm8150l-rpmh-regulators";
211		qcom,pmic-id = "c";
212
213		vdd-s1-supply = <&vph_pwr>;
214		vdd-s2-supply = <&vph_pwr>;
215		vdd-s3-supply = <&vph_pwr>;
216		vdd-s4-supply = <&vph_pwr>;
217		vdd-s5-supply = <&vph_pwr>;
218		vdd-s6-supply = <&vph_pwr>;
219		vdd-s7-supply = <&vph_pwr>;
220		vdd-s8-supply = <&vph_pwr>;
221
222		vdd-l1-l8-supply = <&vreg_s4a_1p8>;
223		vdd-l2-l3-supply = <&vreg_s8c_1p3>;
224		vdd-l4-l5-l6-supply = <&vreg_bob>;
225		vdd-l7-l11-supply = <&vreg_bob>;
226		vdd-l9-l10-supply = <&vreg_bob>;
227
228		vdd-bob-supply = <&vph_pwr>;
229		vdd-flash-supply = <&vreg_bob>;
230		vdd-rgb-supply = <&vreg_bob>;
231
232		vreg_bob: bob {
233			regulator-min-microvolt = <3008000>;
234			regulator-max-microvolt = <4000000>;
235			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
236			regulator-allow-bypass;
237		};
238
239		vreg_s8c_1p3: smps8 {
240			regulator-min-microvolt = <1352000>;
241			regulator-max-microvolt = <1352000>;
242		};
243
244		vreg_l1c_1p8: ldo1 {
245			regulator-min-microvolt = <1800000>;
246			regulator-max-microvolt = <1800000>;
247			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
248		};
249
250		vdda_wcss_adcdac_1:
251		vdda_wcss_adcdac_22:
252		vreg_l2c_1p3: ldo2 {
253			regulator-min-microvolt = <1304000>;
254			regulator-max-microvolt = <1304000>;
255			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
256		};
257
258		vdda_hv_ebi0:
259		vdda_hv_ebi1:
260		vdda_hv_ebi2:
261		vdda_hv_ebi3:
262		vdda_hv_refgen0:
263		vdda_qlink_hv_ck:
264		vreg_l3c_1p2: ldo3 {
265			regulator-min-microvolt = <1200000>;
266			regulator-max-microvolt = <1200000>;
267			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
268		};
269
270		vddpx_5:
271		vreg_l4c_1p8: ldo4 {
272			regulator-min-microvolt = <1704000>;
273			regulator-max-microvolt = <2928000>;
274			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
275		};
276
277		vddpx_6:
278		vreg_l5c_1p8: ldo5 {
279			regulator-min-microvolt = <1704000>;
280			regulator-max-microvolt = <2928000>;
281			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
282		};
283
284		vddpx_2:
285		vreg_l6c_2p9: ldo6 {
286			regulator-min-microvolt = <1800000>;
287			regulator-max-microvolt = <2960000>;
288			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
289		};
290
291		vreg_l7c_3p0: ldo7 {
292			regulator-min-microvolt = <2856000>;
293			regulator-max-microvolt = <3104000>;
294			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
295		};
296
297		vreg_l8c_1p8: ldo8 {
298			regulator-min-microvolt = <1800000>;
299			regulator-max-microvolt = <1800000>;
300			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
301		};
302
303		vreg_l9c_2p9: ldo9 {
304			regulator-min-microvolt = <2704000>;
305			regulator-max-microvolt = <2960000>;
306			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
307		};
308
309		vreg_l10c_3p3: ldo10 {
310			regulator-min-microvolt = <3000000>;
311			regulator-max-microvolt = <3312000>;
312			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
313		};
314
315		vreg_l11c_3p3: ldo11 {
316			regulator-min-microvolt = <3000000>;
317			regulator-max-microvolt = <3312000>;
318			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
319		};
320	};
321
322	pm8009-rpmh-regulators {
323		compatible = "qcom,pm8009-rpmh-regulators";
324		qcom,pmic-id = "f";
325
326		vdd-s1-supply = <&vph_pwr>;
327		vdd-s2-supply = <&vreg_bob>;
328
329		vdd-l2-supply = <&vreg_s8c_1p3>;
330		vdd-l5-l6-supply = <&vreg_bob>;
331
332		vreg_l2f_1p2: ldo2 {
333			regulator-min-microvolt = <1200000>;
334			regulator-max-microvolt = <1200000>;
335			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
336		};
337
338		vreg_l5f_2p85: ldo5 {
339			regulator-min-microvolt = <2800000>;
340			regulator-max-microvolt = <2800000>;
341			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
342		};
343
344		vreg_l6f_2p85: ldo6 {
345			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
346			regulator-min-microvolt = <2856000>;
347			regulator-max-microvolt = <2856000>;
348		};
349	};
350};
351
352&gmu {
353	status = "okay";
354};
355
356&gpu {
357	status = "okay";
358};
359
360&pon_pwrkey {
361	status = "okay";
362};
363
364&pon_resin {
365	status = "okay";
366
367	linux,code = <KEY_VOLUMEDOWN>;
368};
369
370&qupv3_id_1 {
371	status = "okay";
372};
373
374&remoteproc_adsp {
375	status = "okay";
376	firmware-name = "qcom/sm8150/adsp.mdt";
377};
378
379&remoteproc_cdsp {
380	status = "okay";
381	firmware-name = "qcom/sm8150/cdsp.mdt";
382};
383
384&remoteproc_mpss {
385	status = "okay";
386	firmware-name = "qcom/sm8150/modem.mdt";
387};
388
389&remoteproc_slpi {
390	status = "okay";
391	firmware-name = "qcom/sm8150/slpi.mdt";
392};
393
394&tlmm {
395	gpio-reserved-ranges = <0 4>, <126 4>;
396};
397
398&uart2 {
399	status = "okay";
400};
401
402&ufs_mem_hc {
403	status = "okay";
404
405	reset-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>;
406
407	vcc-supply = <&vreg_l10a_2p5>;
408	vcc-max-microamp = <750000>;
409	vccq-supply = <&vreg_l9a_1p2>;
410	vccq-max-microamp = <700000>;
411	vccq2-supply = <&vreg_s4a_1p8>;
412	vccq2-max-microamp = <750000>;
413};
414
415&ufs_mem_phy {
416	status = "okay";
417
418	vdda-phy-supply = <&vdda_ufs_2ln_core_1>;
419	vdda-pll-supply = <&vreg_l3c_1p2>;
420};
421
422&usb_1_hsphy {
423	status = "okay";
424	vdda-pll-supply = <&vdd_usb_hs_core>;
425	vdda33-supply = <&vdda_usb_hs_3p1>;
426	vdda18-supply = <&vdda_usb_hs_1p8>;
427};
428
429&usb_1_qmpphy {
430	status = "okay";
431	vdda-phy-supply = <&vreg_l3c_1p2>;
432	vdda-pll-supply = <&vdda_usb_ss_dp_core_1>;
433};
434
435&usb_1 {
436	status = "okay";
437};
438
439&usb_1_dwc3 {
440	dr_mode = "peripheral";
441};
442
443&wifi {
444	status = "okay";
445
446	vdd-0.8-cx-mx-supply = <&vdda_wcss_pll>;
447	vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
448	vdd-1.3-rfa-supply = <&vdda_wcss_adcdac_1>;
449	vdd-3.3-ch0-supply = <&vreg_l11c_3p3>;
450};
451