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		};
87
88		vreg_l4c: ldo4 {
89			regulator-name = "vreg_l4c";
90			regulator-min-microvolt = <1200000>;
91			regulator-max-microvolt = <1208000>;
92			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
93		};
94
95		vreg_l6c: ldo6 {
96			regulator-name = "vreg_l6c";
97			regulator-min-microvolt = <1200000>;
98			regulator-max-microvolt = <1200000>;
99			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
100			regulator-allow-set-load;
101		};
102
103		vreg_l7c: ldo7 {
104			regulator-name = "vreg_l7c";
105			regulator-min-microvolt = <1800000>;
106			regulator-max-microvolt = <1800000>;
107			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
108		};
109
110		vreg_l10c: ldo10 {
111			regulator-name = "vreg_l10c";
112			regulator-min-microvolt = <2504000>;
113			regulator-max-microvolt = <2504000>;
114			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
115			regulator-allow-set-load;
116		};
117
118		vreg_l17c: ldo17 {
119			regulator-name = "vreg_l17c";
120			regulator-min-microvolt = <2504000>;
121			regulator-max-microvolt = <2504000>;
122			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
123			regulator-allow-set-load;
124		};
125	};
126
127	pmm8540-g-regulators {
128		compatible = "qcom,pm8150-rpmh-regulators";
129		qcom,pmic-id = "g";
130
131		vreg_l3g: ldo3 {
132			regulator-name = "vreg_l3g";
133			regulator-min-microvolt = <1200000>;
134			regulator-max-microvolt = <1200000>;
135			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
136		};
137
138		vreg_l7g: ldo7 {
139			regulator-name = "vreg_l7g";
140			regulator-min-microvolt = <1800000>;
141			regulator-max-microvolt = <1800000>;
142			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
143		};
144
145		vreg_l8g: ldo8 {
146			regulator-name = "vreg_l8g";
147			regulator-min-microvolt = <880000>;
148			regulator-max-microvolt = <880000>;
149			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
150		};
151	};
152};
153
154&qup2 {
155	status = "okay";
156};
157
158&qup2_uart17 {
159	compatible = "qcom,geni-debug-uart";
160	status = "okay";
161};
162
163&remoteproc_adsp {
164	firmware-name = "qcom/sa8540p/adsp.mbn";
165	status = "okay";
166};
167
168&remoteproc_nsp0 {
169	firmware-name = "qcom/sa8540p/cdsp.mbn";
170	status = "okay";
171};
172
173&remoteproc_nsp1 {
174	firmware-name = "qcom/sa8540p/cdsp1.mbn";
175	status = "okay";
176};
177
178&spmi_bus {
179	pm8450a: pmic@0 {
180		compatible = "qcom,pm8150", "qcom,spmi-pmic";
181		reg = <0x0 SPMI_USID>;
182		#address-cells = <1>;
183		#size-cells = <0>;
184
185		pm8450a_gpios: gpio@c000 {
186			compatible = "qcom,pm8150-gpio", "qcom,spmi-gpio";
187			reg = <0xc000>;
188			gpio-controller;
189			gpio-ranges = <&pm8450a_gpios 0 0 10>;
190			#gpio-cells = <2>;
191			interrupt-controller;
192			#interrupt-cells = <2>;
193		};
194	};
195
196	pm8450c: pmic@4 {
197		compatible = "qcom,pm8150", "qcom,spmi-pmic";
198		reg = <0x4 SPMI_USID>;
199		#address-cells = <1>;
200		#size-cells = <0>;
201
202		pm8450c_gpios: gpio@c000 {
203			compatible = "qcom,pm8150-gpio", "qcom,spmi-gpio";
204			reg = <0xc000>;
205			gpio-controller;
206			gpio-ranges = <&pm8450c_gpios 0 0 10>;
207			#gpio-cells = <2>;
208			interrupt-controller;
209			#interrupt-cells = <2>;
210		};
211	};
212
213	pm8450e: pmic@8 {
214		compatible = "qcom,pm8150", "qcom,spmi-pmic";
215		reg = <0x8 SPMI_USID>;
216		#address-cells = <1>;
217		#size-cells = <0>;
218
219		pm8450e_gpios: gpio@c000 {
220			compatible = "qcom,pm8150-gpio", "qcom,spmi-gpio";
221			reg = <0xc000>;
222			gpio-controller;
223			gpio-ranges = <&pm8450e_gpios 0 0 10>;
224			#gpio-cells = <2>;
225			interrupt-controller;
226			#interrupt-cells = <2>;
227		};
228	};
229
230	pm8450g: pmic@c {
231		compatible = "qcom,pm8150", "qcom,spmi-pmic";
232		reg = <0xc SPMI_USID>;
233		#address-cells = <1>;
234		#size-cells = <0>;
235
236		pm8450g_gpios: gpio@c000 {
237			compatible = "qcom,pm8150-gpio", "qcom,spmi-gpio";
238			reg = <0xc000>;
239			gpio-controller;
240			gpio-ranges = <&pm8450g_gpios 0 0 10>;
241			#gpio-cells = <2>;
242			interrupt-controller;
243			#interrupt-cells = <2>;
244		};
245	};
246};
247
248&ufs_mem_hc {
249	reset-gpios = <&tlmm 228 GPIO_ACTIVE_LOW>;
250
251	vcc-supply = <&vreg_l17c>;
252	vcc-max-microamp = <800000>;
253	vccq-supply = <&vreg_l6c>;
254	vccq-max-microamp = <900000>;
255
256	status = "okay";
257};
258
259&ufs_mem_phy {
260	vdda-phy-supply = <&vreg_l8g>;
261	vdda-pll-supply = <&vreg_l3g>;
262
263	status = "okay";
264};
265
266&ufs_card_hc {
267	reset-gpios = <&tlmm 229 GPIO_ACTIVE_LOW>;
268
269	vcc-supply = <&vreg_l10c>;
270	vcc-max-microamp = <800000>;
271	vccq-supply = <&vreg_l3c>;
272	vccq-max-microamp = <900000>;
273
274	status = "okay";
275};
276
277&ufs_card_phy {
278	vdda-phy-supply = <&vreg_l8g>;
279	vdda-pll-supply = <&vreg_l3g>;
280
281	status = "okay";
282};
283
284&usb_0 {
285	status = "okay";
286};
287
288&usb_0_dwc3 {
289	/* TODO: Define USB-C connector properly */
290	dr_mode = "peripheral";
291};
292
293&usb_0_hsphy {
294	vdda-pll-supply = <&vreg_l5a>;
295	vdda18-supply = <&vreg_l7a>;
296	vdda33-supply = <&vreg_l13a>;
297
298	status = "okay";
299};
300
301&usb_0_qmpphy {
302	vdda-phy-supply = <&vreg_l3a>;
303	vdda-pll-supply = <&vreg_l5a>;
304
305	status = "okay";
306};
307
308&usb_1 {
309	status = "okay";
310};
311
312&usb_1_dwc3 {
313	/* TODO: Define USB-C connector properly */
314	dr_mode = "host";
315};
316
317&usb_1_hsphy {
318	vdda-pll-supply = <&vreg_l1c>;
319	vdda18-supply = <&vreg_l7c>;
320	vdda33-supply = <&vreg_l2c>;
321
322	status = "okay";
323};
324
325&usb_1_qmpphy {
326	vdda-phy-supply = <&vreg_l4c>;
327	vdda-pll-supply = <&vreg_l1c>;
328
329	status = "okay";
330};
331
332&usb_2_hsphy0 {
333	vdda-pll-supply = <&vreg_l5a>;
334	vdda18-supply = <&vreg_l7g>;
335	vdda33-supply = <&vreg_l13a>;
336
337	status = "okay";
338};
339
340&usb_2_hsphy1 {
341	vdda-pll-supply = <&vreg_l5a>;
342	vdda18-supply = <&vreg_l7g>;
343	vdda33-supply = <&vreg_l13a>;
344
345	status = "okay";
346};
347
348&usb_2_hsphy2 {
349	vdda-pll-supply = <&vreg_l5a>;
350	vdda18-supply = <&vreg_l7g>;
351	vdda33-supply = <&vreg_l13a>;
352
353	status = "okay";
354};
355
356&usb_2_hsphy3 {
357	vdda-pll-supply = <&vreg_l5a>;
358	vdda18-supply = <&vreg_l7g>;
359	vdda33-supply = <&vreg_l13a>;
360
361	status = "okay";
362};
363
364&usb_2_qmpphy0 {
365	vdda-phy-supply = <&vreg_l3a>;
366	vdda-pll-supply = <&vreg_l5a>;
367
368	status = "okay";
369};
370
371&usb_2_qmpphy1 {
372	vdda-phy-supply = <&vreg_l3a>;
373	vdda-pll-supply = <&vreg_l5a>;
374
375	status = "okay";
376};
377
378&xo_board_clk {
379	clock-frequency = <38400000>;
380};
381
382/* PINCTRL */
383