1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2021, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2022, Linaro Limited
5 */
6
7/dts-v1/;
8
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
11#include <dt-bindings/spmi/spmi.h>
12
13#include "sa8540p.dtsi"
14
15/ {
16	model = "Qualcomm SA8295P ADP";
17	compatible = "qcom,sa8295p-adp", "qcom,sa8540p";
18
19	aliases {
20		serial0 = &qup2_uart17;
21	};
22
23	chosen {
24		stdout-path = "serial0:115200n8";
25	};
26};
27
28&apps_rsc {
29	pmm8540-a-regulators {
30		compatible = "qcom,pm8150-rpmh-regulators";
31		qcom,pmic-id = "a";
32
33		vreg_l3a: ldo3 {
34			regulator-name = "vreg_l3a";
35			regulator-min-microvolt = <1200000>;
36			regulator-max-microvolt = <1208000>;
37			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
38		};
39
40		vreg_l5a: ldo5 {
41			regulator-name = "vreg_l5a";
42			regulator-min-microvolt = <912000>;
43			regulator-max-microvolt = <912000>;
44			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
45		};
46
47		vreg_l7a: ldo7 {
48			regulator-name = "vreg_l7a";
49			regulator-min-microvolt = <1800000>;
50			regulator-max-microvolt = <1800000>;
51			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
52		};
53
54		vreg_l13a: ldo13 {
55			regulator-name = "vreg_l13a";
56			regulator-min-microvolt = <3072000>;
57			regulator-max-microvolt = <3072000>;
58			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
59		};
60	};
61
62	pmm8540-c-regulators {
63		compatible = "qcom,pm8150-rpmh-regulators";
64		qcom,pmic-id = "c";
65
66		vreg_l1c: ldo1 {
67			regulator-name = "vreg_l1c";
68			regulator-min-microvolt = <912000>;
69			regulator-max-microvolt = <912000>;
70			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
71		};
72
73		vreg_l2c: ldo2 {
74			regulator-name = "vreg_l2c";
75			regulator-min-microvolt = <3072000>;
76			regulator-max-microvolt = <3072000>;
77			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
78		};
79
80		vreg_l3c: ldo3 {
81			regulator-name = "vreg_l3c";
82			regulator-min-microvolt = <1200000>;
83			regulator-max-microvolt = <1200000>;
84			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
85			regulator-allow-set-load;
86			regulator-allowed-modes =
87			    <RPMH_REGULATOR_MODE_LPM
88			     RPMH_REGULATOR_MODE_HPM>;
89		};
90
91		vreg_l4c: ldo4 {
92			regulator-name = "vreg_l4c";
93			regulator-min-microvolt = <1200000>;
94			regulator-max-microvolt = <1208000>;
95			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
96		};
97
98		vreg_l6c: ldo6 {
99			regulator-name = "vreg_l6c";
100			regulator-min-microvolt = <1200000>;
101			regulator-max-microvolt = <1200000>;
102			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
103			regulator-allow-set-load;
104			regulator-allowed-modes =
105			    <RPMH_REGULATOR_MODE_LPM
106			     RPMH_REGULATOR_MODE_HPM>;
107		};
108
109		vreg_l7c: ldo7 {
110			regulator-name = "vreg_l7c";
111			regulator-min-microvolt = <1800000>;
112			regulator-max-microvolt = <1800000>;
113			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
114		};
115
116		vreg_l10c: ldo10 {
117			regulator-name = "vreg_l10c";
118			regulator-min-microvolt = <2504000>;
119			regulator-max-microvolt = <2504000>;
120			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
121			regulator-allow-set-load;
122			regulator-allowed-modes =
123			    <RPMH_REGULATOR_MODE_LPM
124			     RPMH_REGULATOR_MODE_HPM>;
125		};
126
127		vreg_l17c: ldo17 {
128			regulator-name = "vreg_l17c";
129			regulator-min-microvolt = <2504000>;
130			regulator-max-microvolt = <2504000>;
131			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
132			regulator-allow-set-load;
133			regulator-allowed-modes =
134			    <RPMH_REGULATOR_MODE_LPM
135			     RPMH_REGULATOR_MODE_HPM>;
136		};
137	};
138
139	pmm8540-g-regulators {
140		compatible = "qcom,pm8150-rpmh-regulators";
141		qcom,pmic-id = "g";
142
143		vreg_l3g: ldo3 {
144			regulator-name = "vreg_l3g";
145			regulator-min-microvolt = <1200000>;
146			regulator-max-microvolt = <1200000>;
147			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
148		};
149
150		vreg_l7g: ldo7 {
151			regulator-name = "vreg_l7g";
152			regulator-min-microvolt = <1800000>;
153			regulator-max-microvolt = <1800000>;
154			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
155		};
156
157		vreg_l8g: ldo8 {
158			regulator-name = "vreg_l8g";
159			regulator-min-microvolt = <880000>;
160			regulator-max-microvolt = <880000>;
161			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
162		};
163	};
164};
165
166&qup2 {
167	status = "okay";
168};
169
170&qup2_uart17 {
171	compatible = "qcom,geni-debug-uart";
172	status = "okay";
173};
174
175&remoteproc_adsp {
176	firmware-name = "qcom/sa8540p/adsp.mbn";
177	status = "okay";
178};
179
180&remoteproc_nsp0 {
181	firmware-name = "qcom/sa8540p/cdsp.mbn";
182	status = "okay";
183};
184
185&remoteproc_nsp1 {
186	firmware-name = "qcom/sa8540p/cdsp1.mbn";
187	status = "okay";
188};
189
190&spmi_bus {
191	pm8450a: pmic@0 {
192		compatible = "qcom,pm8150", "qcom,spmi-pmic";
193		reg = <0x0 SPMI_USID>;
194		#address-cells = <1>;
195		#size-cells = <0>;
196
197		pm8450a_gpios: gpio@c000 {
198			compatible = "qcom,pm8150-gpio", "qcom,spmi-gpio";
199			reg = <0xc000>;
200			gpio-controller;
201			gpio-ranges = <&pm8450a_gpios 0 0 10>;
202			#gpio-cells = <2>;
203			interrupt-controller;
204			#interrupt-cells = <2>;
205		};
206	};
207
208	pm8450c: pmic@4 {
209		compatible = "qcom,pm8150", "qcom,spmi-pmic";
210		reg = <0x4 SPMI_USID>;
211		#address-cells = <1>;
212		#size-cells = <0>;
213
214		pm8450c_gpios: gpio@c000 {
215			compatible = "qcom,pm8150-gpio", "qcom,spmi-gpio";
216			reg = <0xc000>;
217			gpio-controller;
218			gpio-ranges = <&pm8450c_gpios 0 0 10>;
219			#gpio-cells = <2>;
220			interrupt-controller;
221			#interrupt-cells = <2>;
222		};
223	};
224
225	pm8450e: pmic@8 {
226		compatible = "qcom,pm8150", "qcom,spmi-pmic";
227		reg = <0x8 SPMI_USID>;
228		#address-cells = <1>;
229		#size-cells = <0>;
230
231		pm8450e_gpios: gpio@c000 {
232			compatible = "qcom,pm8150-gpio", "qcom,spmi-gpio";
233			reg = <0xc000>;
234			gpio-controller;
235			gpio-ranges = <&pm8450e_gpios 0 0 10>;
236			#gpio-cells = <2>;
237			interrupt-controller;
238			#interrupt-cells = <2>;
239		};
240	};
241
242	pm8450g: pmic@c {
243		compatible = "qcom,pm8150", "qcom,spmi-pmic";
244		reg = <0xc SPMI_USID>;
245		#address-cells = <1>;
246		#size-cells = <0>;
247
248		pm8450g_gpios: gpio@c000 {
249			compatible = "qcom,pm8150-gpio", "qcom,spmi-gpio";
250			reg = <0xc000>;
251			gpio-controller;
252			gpio-ranges = <&pm8450g_gpios 0 0 10>;
253			#gpio-cells = <2>;
254			interrupt-controller;
255			#interrupt-cells = <2>;
256		};
257	};
258};
259
260&ufs_mem_hc {
261	reset-gpios = <&tlmm 228 GPIO_ACTIVE_LOW>;
262
263	vcc-supply = <&vreg_l17c>;
264	vcc-max-microamp = <800000>;
265	vccq-supply = <&vreg_l6c>;
266	vccq-max-microamp = <900000>;
267
268	status = "okay";
269};
270
271&ufs_mem_phy {
272	vdda-phy-supply = <&vreg_l8g>;
273	vdda-pll-supply = <&vreg_l3g>;
274
275	status = "okay";
276};
277
278&ufs_card_hc {
279	reset-gpios = <&tlmm 229 GPIO_ACTIVE_LOW>;
280
281	vcc-supply = <&vreg_l10c>;
282	vcc-max-microamp = <800000>;
283	vccq-supply = <&vreg_l3c>;
284	vccq-max-microamp = <900000>;
285
286	status = "okay";
287};
288
289&ufs_card_phy {
290	vdda-phy-supply = <&vreg_l8g>;
291	vdda-pll-supply = <&vreg_l3g>;
292
293	status = "okay";
294};
295
296&usb_0 {
297	status = "okay";
298};
299
300&usb_0_dwc3 {
301	/* TODO: Define USB-C connector properly */
302	dr_mode = "peripheral";
303};
304
305&usb_0_hsphy {
306	vdda-pll-supply = <&vreg_l5a>;
307	vdda18-supply = <&vreg_l7a>;
308	vdda33-supply = <&vreg_l13a>;
309
310	status = "okay";
311};
312
313&usb_0_qmpphy {
314	vdda-phy-supply = <&vreg_l3a>;
315	vdda-pll-supply = <&vreg_l5a>;
316
317	status = "okay";
318};
319
320&usb_1 {
321	status = "okay";
322};
323
324&usb_1_dwc3 {
325	/* TODO: Define USB-C connector properly */
326	dr_mode = "host";
327};
328
329&usb_1_hsphy {
330	vdda-pll-supply = <&vreg_l1c>;
331	vdda18-supply = <&vreg_l7c>;
332	vdda33-supply = <&vreg_l2c>;
333
334	status = "okay";
335};
336
337&usb_1_qmpphy {
338	vdda-phy-supply = <&vreg_l4c>;
339	vdda-pll-supply = <&vreg_l1c>;
340
341	status = "okay";
342};
343
344&usb_2_hsphy0 {
345	vdda-pll-supply = <&vreg_l5a>;
346	vdda18-supply = <&vreg_l7g>;
347	vdda33-supply = <&vreg_l13a>;
348
349	status = "okay";
350};
351
352&usb_2_hsphy1 {
353	vdda-pll-supply = <&vreg_l5a>;
354	vdda18-supply = <&vreg_l7g>;
355	vdda33-supply = <&vreg_l13a>;
356
357	status = "okay";
358};
359
360&usb_2_hsphy2 {
361	vdda-pll-supply = <&vreg_l5a>;
362	vdda18-supply = <&vreg_l7g>;
363	vdda33-supply = <&vreg_l13a>;
364
365	status = "okay";
366};
367
368&usb_2_hsphy3 {
369	vdda-pll-supply = <&vreg_l5a>;
370	vdda18-supply = <&vreg_l7g>;
371	vdda33-supply = <&vreg_l13a>;
372
373	status = "okay";
374};
375
376&usb_2_qmpphy0 {
377	vdda-phy-supply = <&vreg_l3a>;
378	vdda-pll-supply = <&vreg_l5a>;
379
380	status = "okay";
381};
382
383&usb_2_qmpphy1 {
384	vdda-phy-supply = <&vreg_l3a>;
385	vdda-pll-supply = <&vreg_l5a>;
386
387	status = "okay";
388};
389
390&xo_board_clk {
391	clock-frequency = <38400000>;
392};
393
394/* PINCTRL */
395