1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2023, Linaro Limited
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
9
10#include "sa8775p.dtsi"
11#include "sa8775p-pmics.dtsi"
12
13/ {
14	model = "Qualcomm SA8775P Ride";
15	compatible = "qcom,sa8775p-ride", "qcom,sa8775p";
16
17	aliases {
18		serial0 = &uart10;
19		serial1 = &uart12;
20		serial2 = &uart17;
21		i2c18 = &i2c18;
22		spi16 = &spi16;
23	};
24
25	chosen {
26		stdout-path = "serial0:115200n8";
27	};
28};
29
30&apps_rsc {
31	regulators-0 {
32		compatible = "qcom,pmm8654au-rpmh-regulators";
33		qcom,pmic-id = "a";
34
35		vreg_s4a: smps4 {
36			regulator-name = "vreg_s4a";
37			regulator-min-microvolt = <1800000>;
38			regulator-max-microvolt = <1816000>;
39			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
40		};
41
42		vreg_s5a: smps5 {
43			regulator-name = "vreg_s5a";
44			regulator-min-microvolt = <1850000>;
45			regulator-max-microvolt = <1996000>;
46			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
47		};
48
49		vreg_s9a: smps9 {
50			regulator-name = "vreg_s9a";
51			regulator-min-microvolt = <535000>;
52			regulator-max-microvolt = <1120000>;
53			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
54		};
55
56		vreg_l4a: ldo4 {
57			regulator-name = "vreg_l4a";
58			regulator-min-microvolt = <788000>;
59			regulator-max-microvolt = <1050000>;
60			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
61			regulator-allow-set-load;
62			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
63						   RPMH_REGULATOR_MODE_HPM>;
64		};
65
66		vreg_l5a: ldo5 {
67			regulator-name = "vreg_l5a";
68			regulator-min-microvolt = <870000>;
69			regulator-max-microvolt = <950000>;
70			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
71			regulator-allow-set-load;
72			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
73						   RPMH_REGULATOR_MODE_HPM>;
74		};
75
76		vreg_l6a: ldo6 {
77			regulator-name = "vreg_l6a";
78			regulator-min-microvolt = <870000>;
79			regulator-max-microvolt = <970000>;
80			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
81			regulator-allow-set-load;
82			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
83						   RPMH_REGULATOR_MODE_HPM>;
84		};
85
86		vreg_l7a: ldo7 {
87			regulator-name = "vreg_l7a";
88			regulator-min-microvolt = <720000>;
89			regulator-max-microvolt = <950000>;
90			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
91			regulator-allow-set-load;
92			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
93						   RPMH_REGULATOR_MODE_HPM>;
94		};
95
96		vreg_l8a: ldo8 {
97			regulator-name = "vreg_l8a";
98			regulator-min-microvolt = <2504000>;
99			regulator-max-microvolt = <3300000>;
100			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
101			regulator-allow-set-load;
102			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
103						   RPMH_REGULATOR_MODE_HPM>;
104		};
105
106		vreg_l9a: ldo9 {
107			regulator-name = "vreg_l9a";
108			regulator-min-microvolt = <2970000>;
109			regulator-max-microvolt = <3544000>;
110			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
111			regulator-allow-set-load;
112			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
113						   RPMH_REGULATOR_MODE_HPM>;
114		};
115	};
116
117	regulators-1 {
118		compatible = "qcom,pmm8654au-rpmh-regulators";
119		qcom,pmic-id = "c";
120
121		vreg_l1c: ldo1 {
122			regulator-name = "vreg_l1c";
123			regulator-min-microvolt = <1140000>;
124			regulator-max-microvolt = <1260000>;
125			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
126			regulator-allow-set-load;
127			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
128						   RPMH_REGULATOR_MODE_HPM>;
129		};
130
131		vreg_l2c: ldo2 {
132			regulator-name = "vreg_l2c";
133			regulator-min-microvolt = <900000>;
134			regulator-max-microvolt = <1100000>;
135			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
136			regulator-allow-set-load;
137			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
138						   RPMH_REGULATOR_MODE_HPM>;
139		};
140
141		vreg_l3c: ldo3 {
142			regulator-name = "vreg_l3c";
143			regulator-min-microvolt = <1100000>;
144			regulator-max-microvolt = <1300000>;
145			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
146			regulator-allow-set-load;
147			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
148						   RPMH_REGULATOR_MODE_HPM>;
149		};
150
151		vreg_l4c: ldo4 {
152			regulator-name = "vreg_l4c";
153			regulator-min-microvolt = <1100000>;
154			regulator-max-microvolt = <1300000>;
155			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
156			/*
157			 * FIXME: This should have regulator-allow-set-load but
158			 * we're getting an over-current fault from the PMIC
159			 * when switching to LPM.
160			 */
161		};
162
163		vreg_l5c: ldo5 {
164			regulator-name = "vreg_l5c";
165			regulator-min-microvolt = <1100000>;
166			regulator-max-microvolt = <1300000>;
167			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
168			regulator-allow-set-load;
169			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
170						   RPMH_REGULATOR_MODE_HPM>;
171		};
172
173		vreg_l6c: ldo6 {
174			regulator-name = "vreg_l6c";
175			regulator-min-microvolt = <1620000>;
176			regulator-max-microvolt = <1980000>;
177			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
178			regulator-allow-set-load;
179			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
180						   RPMH_REGULATOR_MODE_HPM>;
181		};
182
183		vreg_l7c: ldo7 {
184			regulator-name = "vreg_l7c";
185			regulator-min-microvolt = <1620000>;
186			regulator-max-microvolt = <2000000>;
187			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
188			regulator-allow-set-load;
189			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
190						   RPMH_REGULATOR_MODE_HPM>;
191		};
192
193		vreg_l8c: ldo8 {
194			regulator-name = "vreg_l8c";
195			regulator-min-microvolt = <2400000>;
196			regulator-max-microvolt = <3300000>;
197			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
198			regulator-allow-set-load;
199			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
200						   RPMH_REGULATOR_MODE_HPM>;
201		};
202
203		vreg_l9c: ldo9 {
204			regulator-name = "vreg_l9c";
205			regulator-min-microvolt = <1650000>;
206			regulator-max-microvolt = <2700000>;
207			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
208			regulator-allow-set-load;
209			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
210						   RPMH_REGULATOR_MODE_HPM>;
211		};
212	};
213
214	regulators-2 {
215		compatible = "qcom,pmm8654au-rpmh-regulators";
216		qcom,pmic-id = "e";
217
218		vreg_s4e: smps4 {
219			regulator-name = "vreg_s4e";
220			regulator-min-microvolt = <970000>;
221			regulator-max-microvolt = <1520000>;
222			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
223		};
224
225		vreg_s7e: smps7 {
226			regulator-name = "vreg_s7e";
227			regulator-min-microvolt = <1010000>;
228			regulator-max-microvolt = <1170000>;
229			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
230		};
231
232		vreg_s9e: smps9 {
233			regulator-name = "vreg_s9e";
234			regulator-min-microvolt = <300000>;
235			regulator-max-microvolt = <570000>;
236			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
237		};
238
239		vreg_l6e: ldo6 {
240			regulator-name = "vreg_l6e";
241			regulator-min-microvolt = <1280000>;
242			regulator-max-microvolt = <1450000>;
243			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
244			regulator-allow-set-load;
245			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
246						   RPMH_REGULATOR_MODE_HPM>;
247		};
248
249		vreg_l8e: ldo8 {
250			regulator-name = "vreg_l8e";
251			regulator-min-microvolt = <1800000>;
252			regulator-max-microvolt = <1950000>;
253			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
254			regulator-allow-set-load;
255			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
256						   RPMH_REGULATOR_MODE_HPM>;
257		};
258	};
259};
260
261&i2c18 {
262	clock-frequency = <400000>;
263	pinctrl-0 = <&qup_i2c18_default>;
264	pinctrl-names = "default";
265	status = "okay";
266};
267
268&pmm8654au_0_gpios {
269	gpio-line-names = "DS_EN",
270			  "POFF_COMPLETE",
271			  "UFS0_VER_ID",
272			  "FAST_POFF",
273			  "DBU1_PON_DONE",
274			  "AOSS_SLEEP",
275			  "CAM_DES0_EN",
276			  "CAM_DES1_EN",
277			  "CAM_DES2_EN",
278			  "CAM_DES3_EN",
279			  "UEFI",
280			  "ANALOG_PON_OPT";
281};
282
283&pmm8654au_1_gpios {
284	gpio-line-names = "PMIC_C_ID0",
285			  "PMIC_C_ID1",
286			  "UFS1_VER_ID",
287			  "IPA_PWR",
288			  "",
289			  "WLAN_DBU4_EN",
290			  "WLAN_EN",
291			  "BT_EN",
292			  "USB2_PWR_EN",
293			  "USB2_FAULT";
294};
295
296&pmm8654au_2_gpios {
297	gpio-line-names = "PMIC_E_ID0",
298			  "PMIC_E_ID1",
299			  "USB0_PWR_EN",
300			  "USB0_FAULT",
301			  "SENSOR_IRQ_1",
302			  "SENSOR_IRQ_2",
303			  "SENSOR_RST",
304			  "SGMIIO0_RST",
305			  "SGMIIO1_RST",
306			  "USB1_PWR_ENABLE",
307			  "USB1_FAULT",
308			  "VMON_SPX8";
309};
310
311&pmm8654au_3_gpios {
312	gpio-line-names = "PMIC_G_ID0",
313			  "PMIC_G_ID1",
314			  "GNSS_RST",
315			  "GNSS_EN",
316			  "GNSS_BOOT_MODE";
317};
318
319&qupv3_id_1 {
320	status = "okay";
321};
322
323&qupv3_id_2 {
324	status = "okay";
325};
326
327&sleep_clk {
328	clock-frequency = <32764>;
329};
330
331&spi16 {
332	pinctrl-0 = <&qup_spi16_default>;
333	pinctrl-names = "default";
334	status = "okay";
335};
336
337&tlmm {
338	qup_uart10_default: qup-uart10-state {
339		pins = "gpio46", "gpio47";
340		function = "qup1_se3";
341	};
342
343	qup_spi16_default: qup-spi16-state {
344		pins = "gpio86", "gpio87", "gpio88", "gpio89";
345		function = "qup2_se2";
346		drive-strength = <6>;
347		bias-disable;
348	};
349
350	qup_i2c18_default: qup-i2c18-state {
351		pins = "gpio95", "gpio96";
352		function = "qup2_se4";
353		drive-strength = <2>;
354		bias-pull-up;
355	};
356
357	qup_uart12_default: qup-uart12-state {
358		qup_uart12_cts: qup-uart12-cts-pins {
359			pins = "gpio52";
360			function = "qup1_se5";
361			bias-disable;
362		};
363
364		qup_uart12_rts: qup-uart12-rts-pins {
365			pins = "gpio53";
366			function = "qup1_se5";
367			bias-pull-down;
368		};
369
370		qup_uart12_tx: qup-uart12-tx-pins {
371			pins = "gpio54";
372			function = "qup1_se5";
373			bias-pull-up;
374		};
375
376		qup_uart12_rx: qup-uart12-rx-pins {
377			pins = "gpio55";
378			function = "qup1_se5";
379			bias-pull-down;
380		};
381	};
382
383	qup_uart17_default: qup-uart17-state {
384		qup_uart17_cts: qup-uart17-cts-pins {
385			pins = "gpio91";
386			function = "qup2_se3";
387			bias-disable;
388		};
389
390		qup_uart17_rts: qup0-uart17-rts-pins {
391			pins = "gpio92";
392			function = "qup2_se3";
393			bias-pull-down;
394		};
395
396		qup_uart17_tx: qup0-uart17-tx-pins {
397			pins = "gpio93";
398			function = "qup2_se3";
399			bias-pull-up;
400		};
401
402		qup_uart17_rx: qup0-uart17-rx-pins {
403			pins = "gpio94";
404			function = "qup2_se3";
405			bias-pull-down;
406		};
407	};
408};
409
410&uart10 {
411	compatible = "qcom,geni-debug-uart";
412	pinctrl-0 = <&qup_uart10_default>;
413	pinctrl-names = "default";
414	status = "okay";
415};
416
417&uart12 {
418	pinctrl-0 = <&qup_uart12_default>;
419	pinctrl-names = "default";
420	status = "okay";
421};
422
423&uart17 {
424	pinctrl-0 = <&qup_uart17_default>;
425	pinctrl-names = "default";
426	status = "okay";
427};
428
429&xo_board_clk {
430	clock-frequency = <38400000>;
431};
432