1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2021, Linaro Limited
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
9#include <dt-bindings/gpio/gpio.h>
10#include "sm8150.dtsi"
11#include "pmm8155au_1.dtsi"
12#include "pmm8155au_2.dtsi"
13
14/ {
15	model = "Qualcomm Technologies, Inc. SA8155P ADP";
16	compatible = "qcom,sa8155p-adp", "qcom,sa8155p";
17
18	aliases {
19		serial0 = &uart2;
20	};
21
22	chosen {
23		stdout-path = "serial0:115200n8";
24	};
25
26	vreg_3p3: vreg_3p3_regulator {
27		compatible = "regulator-fixed";
28		regulator-name = "vreg_3p3";
29		regulator-min-microvolt = <3300000>;
30		regulator-max-microvolt = <3300000>;
31	};
32
33	/*
34	 * S4A is always on and not controllable through RPMh.
35	 * So model it as a fixed regulator.
36	 */
37	vreg_s4a_1p8: 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		regulator-allow-set-load;
47
48		vin-supply = <&vreg_3p3>;
49	};
50};
51
52&apps_rsc {
53	pmm8155au-1-rpmh-regulators {
54		compatible = "qcom,pmm8155au-rpmh-regulators";
55		qcom,pmic-id = "a";
56
57		vdd-s1-supply = <&vreg_3p3>;
58		vdd-s2-supply = <&vreg_3p3>;
59		vdd-s3-supply = <&vreg_3p3>;
60		vdd-s4-supply = <&vreg_3p3>;
61		vdd-s5-supply = <&vreg_3p3>;
62		vdd-s6-supply = <&vreg_3p3>;
63		vdd-s7-supply = <&vreg_3p3>;
64		vdd-s8-supply = <&vreg_3p3>;
65		vdd-s9-supply = <&vreg_3p3>;
66		vdd-s10-supply = <&vreg_3p3>;
67
68		vdd-l1-l8-l11-supply = <&vreg_s6a_0p92>;
69		vdd-l2-l10-supply = <&vreg_3p3>;
70		vdd-l3-l4-l5-l18-supply = <&vreg_s6a_0p92>;
71		vdd-l6-l9-supply = <&vreg_s6a_0p92>;
72		vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>;
73		vdd-l13-l16-l17-supply = <&vreg_3p3>;
74
75		vreg_s5a_2p04: smps5 {
76			regulator-name = "vreg_s5a_2p04";
77			regulator-min-microvolt = <1904000>;
78			regulator-max-microvolt = <2000000>;
79		};
80
81		vreg_s6a_0p92: smps6 {
82			regulator-name = "vreg_s6a_0p92";
83			regulator-min-microvolt = <920000>;
84			regulator-max-microvolt = <1128000>;
85		};
86
87		vreg_l1a_0p752: ldo1 {
88			regulator-name = "vreg_l1a_0p752";
89			regulator-min-microvolt = <752000>;
90			regulator-max-microvolt = <752000>;
91			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
92		};
93
94		vdda_usb_hs_3p1:
95		vreg_l2a_3p072: ldo2 {
96			regulator-name = "vreg_l2a_3p072";
97			regulator-min-microvolt = <3072000>;
98			regulator-max-microvolt = <3072000>;
99			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
100		};
101
102		vreg_l3a_0p8: ldo3 {
103			regulator-name = "vreg_l3a_0p8";
104			regulator-min-microvolt = <800000>;
105			regulator-max-microvolt = <800000>;
106			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
107		};
108
109		vdd_usb_hs_core:
110		vdda_usb_ss_dp_core_1:
111		vreg_l5a_0p88: ldo5 {
112			regulator-name = "vreg_l5a_0p88";
113			regulator-min-microvolt = <880000>;
114			regulator-max-microvolt = <880000>;
115			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
116			regulator-allow-set-load;
117		};
118
119		vreg_l7a_1p8: ldo7 {
120			regulator-name = "vreg_l7a_1p8";
121			regulator-min-microvolt = <1800000>;
122			regulator-max-microvolt = <1800000>;
123			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
124		};
125
126		vreg_l10a_2p96: ldo10 {
127			regulator-name = "vreg_l10a_2p96";
128			regulator-min-microvolt = <2504000>;
129			regulator-max-microvolt = <2960000>;
130			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
131			regulator-allow-set-load;
132		};
133
134		vreg_l11a_0p8: ldo11 {
135			regulator-name = "vreg_l11a_0p8";
136			regulator-min-microvolt = <800000>;
137			regulator-max-microvolt = <800000>;
138			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
139		};
140
141		vdda_usb_hs_1p8:
142		vreg_l12a_1p8: ldo12 {
143			regulator-name = "vreg_l12a_1p8";
144			regulator-min-microvolt = <1800000>;
145			regulator-max-microvolt = <1800000>;
146			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
147		};
148
149		vreg_l13a_2p7: ldo13 {
150			regulator-name = "vreg_l13a_2p7";
151			regulator-min-microvolt = <2704000>;
152			regulator-max-microvolt = <2704000>;
153			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
154		};
155
156		vreg_l15a_1p7: ldo15 {
157			regulator-name = "vreg_l15a_1p7";
158			regulator-min-microvolt = <1704000>;
159			regulator-max-microvolt = <1704000>;
160			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
161		};
162
163		vreg_l16a_2p7: ldo16 {
164			regulator-name = "vreg_l16a_2p7";
165			regulator-min-microvolt = <2704000>;
166			regulator-max-microvolt = <2960000>;
167			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
168		};
169
170		vreg_l17a_2p96: ldo17 {
171			regulator-name = "vreg_l17a_2p96";
172			regulator-min-microvolt = <2504000>;
173			regulator-max-microvolt = <2960000>;
174			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
175		};
176	};
177
178	pmm8155au-2-rpmh-regulators {
179		compatible = "qcom,pmm8155au-rpmh-regulators";
180		qcom,pmic-id = "c";
181
182		vdd-s1-supply = <&vreg_3p3>;
183		vdd-s2-supply = <&vreg_3p3>;
184		vdd-s3-supply = <&vreg_3p3>;
185		vdd-s4-supply = <&vreg_3p3>;
186		vdd-s5-supply = <&vreg_3p3>;
187		vdd-s6-supply = <&vreg_3p3>;
188		vdd-s7-supply = <&vreg_3p3>;
189		vdd-s8-supply = <&vreg_3p3>;
190		vdd-s9-supply = <&vreg_3p3>;
191		vdd-s10-supply = <&vreg_3p3>;
192
193		vdd-l1-l8-l11-supply = <&vreg_s4c_1p352>;
194		vdd-l2-l10-supply = <&vreg_3p3>;
195		vdd-l3-l4-l5-l18-supply = <&vreg_s4c_1p352>;
196		vdd-l6-l9-supply = <&vreg_s6c_1p128>;
197		vdd-l7-l12-l14-l15-supply = <&vreg_s5c_2p04>;
198		vdd-l13-l16-l17-supply = <&vreg_3p3>;
199
200		vreg_s4c_1p352: smps4 {
201			regulator-name = "vreg_s4c_1p352";
202			regulator-min-microvolt = <1352000>;
203			regulator-max-microvolt = <1352000>;
204		};
205
206		vreg_s5c_2p04: smps5 {
207			regulator-name = "vreg_s5c_2p04";
208			regulator-min-microvolt = <1904000>;
209			regulator-max-microvolt = <2000000>;
210		};
211
212		vreg_s6c_1p128: smps6 {
213			regulator-name = "vreg_s6c_1p128";
214			regulator-min-microvolt = <1128000>;
215			regulator-max-microvolt = <1128000>;
216		};
217
218		vreg_l1c_1p304: ldo1 {
219			regulator-name = "vreg_l1c_1p304";
220			regulator-min-microvolt = <1304000>;
221			regulator-max-microvolt = <1304000>;
222			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
223		};
224
225		vreg_l2c_1p808: ldo2 {
226			regulator-name = "vreg_l2c_1p808";
227			regulator-min-microvolt = <1704000>;
228			regulator-max-microvolt = <2928000>;
229			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
230		};
231
232		vreg_l5c_1p2: ldo5 {
233			regulator-name = "vreg_l5c_1p2";
234			regulator-min-microvolt = <1200000>;
235			regulator-max-microvolt = <1200000>;
236			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
237			regulator-allow-set-load;
238		};
239
240		vreg_l7c_1p8: ldo7 {
241			regulator-name = "vreg_l7c_1p8";
242			regulator-min-microvolt = <1800000>;
243			regulator-max-microvolt = <1800000>;
244			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
245		};
246
247		vreg_l8c_1p2: ldo8 {
248			regulator-name = "vreg_l8c_1p2";
249			regulator-min-microvolt = <1200000>;
250			regulator-max-microvolt = <1200000>;
251			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
252			regulator-allow-set-load;
253		};
254
255		vreg_l10c_3p3: ldo10 {
256			regulator-name = "vreg_l10c_3p3";
257			regulator-min-microvolt = <3000000>;
258			regulator-max-microvolt = <3312000>;
259			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
260		};
261
262		vreg_l11c_0p8: ldo11 {
263			regulator-name = "vreg_l11c_0p8";
264			regulator-min-microvolt = <800000>;
265			regulator-max-microvolt = <800000>;
266			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
267		};
268
269		vreg_l12c_1p808: ldo12 {
270			regulator-name = "vreg_l12c_1p808";
271			regulator-min-microvolt = <1704000>;
272			regulator-max-microvolt = <2928000>;
273			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
274		};
275
276		vreg_l13c_2p96: ldo13 {
277			regulator-name = "vreg_l13c_2p96";
278			regulator-min-microvolt = <2504000>;
279			regulator-max-microvolt = <2960000>;
280			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
281		};
282
283		vreg_l15c_1p9: ldo15 {
284			regulator-name = "vreg_l15c_1p9";
285			regulator-min-microvolt = <1704000>;
286			regulator-max-microvolt = <2928000>;
287			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
288		};
289
290		vreg_l16c_3p008: ldo16 {
291			regulator-name = "vreg_l16c_3p008";
292			regulator-min-microvolt = <3008000>;
293			regulator-max-microvolt = <3008000>;
294			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
295		};
296
297		vreg_l18c_0p88: ldo18 {
298			regulator-name = "vreg_l18c_0p88";
299			regulator-min-microvolt = <880000>;
300			regulator-max-microvolt = <880000>;
301			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
302		};
303	};
304};
305
306&qupv3_id_1 {
307	status = "okay";
308};
309
310&uart2 {
311	status = "okay";
312};
313
314&ufs_mem_hc {
315	status = "okay";
316
317	reset-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>;
318
319	vcc-supply = <&vreg_l10a_2p96>;
320	vcc-max-microamp = <750000>;
321	vccq-supply = <&vreg_l5c_1p2>;
322	vccq-max-microamp = <700000>;
323	vccq2-supply = <&vreg_s4a_1p8>;
324	vccq2-max-microamp = <750000>;
325};
326
327&ufs_mem_phy {
328	status = "okay";
329
330	vdda-phy-supply = <&vreg_l8c_1p2>;
331	vdda-max-microamp = <87100>;
332	vdda-pll-supply = <&vreg_l5a_0p88>;
333	vdda-pll-max-microamp = <18300>;
334};
335
336&usb_1 {
337	status = "okay";
338};
339
340&usb_1_dwc3 {
341	dr_mode = "host";
342
343	pinctrl-names = "default";
344	pinctrl-0 = <&usb2phy_ac_en1_default>;
345};
346
347&usb_1_hsphy {
348	status = "okay";
349	vdda-pll-supply = <&vdd_usb_hs_core>;
350	vdda33-supply = <&vdda_usb_hs_3p1>;
351	vdda18-supply = <&vdda_usb_hs_1p8>;
352};
353
354&usb_1_qmpphy {
355	status = "disabled";
356};
357
358&usb_2 {
359	status = "okay";
360};
361
362&usb_2_dwc3 {
363	dr_mode = "host";
364
365	pinctrl-names = "default";
366	pinctrl-0 = <&usb2phy_ac_en2_default>;
367};
368
369&usb_2_hsphy {
370	status = "okay";
371	vdda-pll-supply = <&vdd_usb_hs_core>;
372	vdda33-supply = <&vdda_usb_hs_3p1>;
373	vdda18-supply = <&vdda_usb_hs_1p8>;
374};
375
376&usb_2_qmpphy {
377	status = "okay";
378	vdda-phy-supply = <&vreg_l8c_1p2>;
379	vdda-pll-supply = <&vdda_usb_ss_dp_core_1>;
380};
381
382&tlmm {
383	gpio-reserved-ranges = <0 4>;
384
385	usb2phy_ac_en1_default: usb2phy_ac_en1_default {
386		mux {
387			pins = "gpio113";
388			function = "usb2phy_ac";
389			bias-disable;
390			drive-strength = <2>;
391		};
392	};
393
394	usb2phy_ac_en2_default: usb2phy_ac_en2_default {
395		mux {
396			pins = "gpio123";
397			function = "usb2phy_ac";
398			bias-disable;
399			drive-strength = <2>;
400		};
401	};
402};
403