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
47		vin-supply = <&vreg_3p3>;
48	};
49
50	mtl_rx_setup: rx-queues-config {
51		snps,rx-queues-to-use = <1>;
52		snps,rx-sched-sp;
53
54		queue0 {
55			snps,dcb-algorithm;
56			snps,map-to-dma-channel = <0x0>;
57			snps,route-up;
58			snps,priority = <0x1>;
59		};
60	};
61
62	mtl_tx_setup: tx-queues-config {
63		snps,tx-queues-to-use = <1>;
64		snps,tx-sched-wrr;
65
66		queue0 {
67			snps,weight = <0x10>;
68			snps,dcb-algorithm;
69			snps,priority = <0x0>;
70		};
71	};
72};
73
74&apps_rsc {
75	pmm8155au-1-rpmh-regulators {
76		compatible = "qcom,pmm8155au-rpmh-regulators";
77		qcom,pmic-id = "a";
78
79		vdd-s1-supply = <&vreg_3p3>;
80		vdd-s2-supply = <&vreg_3p3>;
81		vdd-s3-supply = <&vreg_3p3>;
82		vdd-s4-supply = <&vreg_3p3>;
83		vdd-s5-supply = <&vreg_3p3>;
84		vdd-s6-supply = <&vreg_3p3>;
85		vdd-s7-supply = <&vreg_3p3>;
86		vdd-s8-supply = <&vreg_3p3>;
87		vdd-s9-supply = <&vreg_3p3>;
88		vdd-s10-supply = <&vreg_3p3>;
89
90		vdd-l1-l8-l11-supply = <&vreg_s6a_0p92>;
91		vdd-l2-l10-supply = <&vreg_3p3>;
92		vdd-l3-l4-l5-l18-supply = <&vreg_s6a_0p92>;
93		vdd-l6-l9-supply = <&vreg_s6a_0p92>;
94		vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>;
95		vdd-l13-l16-l17-supply = <&vreg_3p3>;
96
97		vreg_s5a_2p04: smps5 {
98			regulator-name = "vreg_s5a_2p04";
99			regulator-min-microvolt = <1904000>;
100			regulator-max-microvolt = <2000000>;
101		};
102
103		vreg_s6a_0p92: smps6 {
104			regulator-name = "vreg_s6a_0p92";
105			regulator-min-microvolt = <920000>;
106			regulator-max-microvolt = <1128000>;
107		};
108
109		vreg_l1a_0p752: ldo1 {
110			regulator-name = "vreg_l1a_0p752";
111			regulator-min-microvolt = <752000>;
112			regulator-max-microvolt = <752000>;
113			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
114		};
115
116		vdda_usb_hs_3p1:
117		vreg_l2a_3p072: ldo2 {
118			regulator-name = "vreg_l2a_3p072";
119			regulator-min-microvolt = <3072000>;
120			regulator-max-microvolt = <3072000>;
121			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
122		};
123
124		vreg_l3a_0p8: ldo3 {
125			regulator-name = "vreg_l3a_0p8";
126			regulator-min-microvolt = <800000>;
127			regulator-max-microvolt = <800000>;
128			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
129		};
130
131		vdd_usb_hs_core:
132		vdda_usb_ss_dp_core_1:
133		vreg_l5a_0p88: ldo5 {
134			regulator-name = "vreg_l5a_0p88";
135			regulator-min-microvolt = <880000>;
136			regulator-max-microvolt = <880000>;
137			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
138			regulator-allow-set-load;
139			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
140						   RPMH_REGULATOR_MODE_HPM>;
141		};
142
143		vreg_l7a_1p8: ldo7 {
144			regulator-name = "vreg_l7a_1p8";
145			regulator-min-microvolt = <1800000>;
146			regulator-max-microvolt = <1800000>;
147			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
148		};
149
150		vreg_l10a_2p96: ldo10 {
151			regulator-name = "vreg_l10a_2p96";
152			regulator-min-microvolt = <2504000>;
153			regulator-max-microvolt = <2960000>;
154			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
155			regulator-allow-set-load;
156			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
157						   RPMH_REGULATOR_MODE_HPM>;
158		};
159
160		vreg_l11a_0p8: ldo11 {
161			regulator-name = "vreg_l11a_0p8";
162			regulator-min-microvolt = <800000>;
163			regulator-max-microvolt = <800000>;
164			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
165		};
166
167		vdda_usb_hs_1p8:
168		vreg_l12a_1p8: ldo12 {
169			regulator-name = "vreg_l12a_1p8";
170			regulator-min-microvolt = <1800000>;
171			regulator-max-microvolt = <1800000>;
172			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
173		};
174
175		vreg_l13a_2p7: ldo13 {
176			regulator-name = "vreg_l13a_2p7";
177			regulator-min-microvolt = <2704000>;
178			regulator-max-microvolt = <2704000>;
179			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
180		};
181
182		vreg_l15a_1p7: ldo15 {
183			regulator-name = "vreg_l15a_1p7";
184			regulator-min-microvolt = <1704000>;
185			regulator-max-microvolt = <1704000>;
186			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
187		};
188
189		vreg_l16a_2p7: ldo16 {
190			regulator-name = "vreg_l16a_2p7";
191			regulator-min-microvolt = <2704000>;
192			regulator-max-microvolt = <2960000>;
193			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
194		};
195
196		vreg_l17a_2p96: ldo17 {
197			regulator-name = "vreg_l17a_2p96";
198			regulator-min-microvolt = <2504000>;
199			regulator-max-microvolt = <2960000>;
200			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
201		};
202	};
203
204	pmm8155au-2-rpmh-regulators {
205		compatible = "qcom,pmm8155au-rpmh-regulators";
206		qcom,pmic-id = "c";
207
208		vdd-s1-supply = <&vreg_3p3>;
209		vdd-s2-supply = <&vreg_3p3>;
210		vdd-s3-supply = <&vreg_3p3>;
211		vdd-s4-supply = <&vreg_3p3>;
212		vdd-s5-supply = <&vreg_3p3>;
213		vdd-s6-supply = <&vreg_3p3>;
214		vdd-s7-supply = <&vreg_3p3>;
215		vdd-s8-supply = <&vreg_3p3>;
216		vdd-s9-supply = <&vreg_3p3>;
217		vdd-s10-supply = <&vreg_3p3>;
218
219		vdd-l1-l8-l11-supply = <&vreg_s4c_1p352>;
220		vdd-l2-l10-supply = <&vreg_3p3>;
221		vdd-l3-l4-l5-l18-supply = <&vreg_s4c_1p352>;
222		vdd-l6-l9-supply = <&vreg_s6c_1p128>;
223		vdd-l7-l12-l14-l15-supply = <&vreg_s5c_2p04>;
224		vdd-l13-l16-l17-supply = <&vreg_3p3>;
225
226		vreg_s4c_1p352: smps4 {
227			regulator-name = "vreg_s4c_1p352";
228			regulator-min-microvolt = <1352000>;
229			regulator-max-microvolt = <1352000>;
230		};
231
232		vreg_s5c_2p04: smps5 {
233			regulator-name = "vreg_s5c_2p04";
234			regulator-min-microvolt = <1904000>;
235			regulator-max-microvolt = <2000000>;
236		};
237
238		vreg_s6c_1p128: smps6 {
239			regulator-name = "vreg_s6c_1p128";
240			regulator-min-microvolt = <1128000>;
241			regulator-max-microvolt = <1128000>;
242		};
243
244		vreg_l1c_1p304: ldo1 {
245			regulator-name = "vreg_l1c_1p304";
246			regulator-min-microvolt = <1304000>;
247			regulator-max-microvolt = <1304000>;
248			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
249		};
250
251		vreg_l2c_1p808: ldo2 {
252			regulator-name = "vreg_l2c_1p808";
253			regulator-min-microvolt = <1704000>;
254			regulator-max-microvolt = <2928000>;
255			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
256		};
257
258		vreg_l5c_1p2: ldo5 {
259			regulator-name = "vreg_l5c_1p2";
260			regulator-min-microvolt = <1200000>;
261			regulator-max-microvolt = <1200000>;
262			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
263			regulator-allow-set-load;
264			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
265						   RPMH_REGULATOR_MODE_HPM>;
266		};
267
268		vreg_l7c_1p8: ldo7 {
269			regulator-name = "vreg_l7c_1p8";
270			regulator-min-microvolt = <1800000>;
271			regulator-max-microvolt = <1800000>;
272			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
273		};
274
275		vreg_l8c_1p2: ldo8 {
276			regulator-name = "vreg_l8c_1p2";
277			regulator-min-microvolt = <1200000>;
278			regulator-max-microvolt = <1200000>;
279			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
280			regulator-allow-set-load;
281			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
282						   RPMH_REGULATOR_MODE_HPM>;
283		};
284
285		vreg_l10c_3p3: ldo10 {
286			regulator-name = "vreg_l10c_3p3";
287			regulator-min-microvolt = <3000000>;
288			regulator-max-microvolt = <3312000>;
289			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
290		};
291
292		vreg_l11c_0p8: ldo11 {
293			regulator-name = "vreg_l11c_0p8";
294			regulator-min-microvolt = <800000>;
295			regulator-max-microvolt = <800000>;
296			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
297		};
298
299		vreg_l12c_1p808: ldo12 {
300			regulator-name = "vreg_l12c_1p808";
301			regulator-min-microvolt = <1704000>;
302			regulator-max-microvolt = <2928000>;
303			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
304		};
305
306		vreg_l13c_2p96: ldo13 {
307			regulator-name = "vreg_l13c_2p96";
308			regulator-min-microvolt = <2504000>;
309			regulator-max-microvolt = <2960000>;
310			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
311		};
312
313		vreg_l15c_1p9: ldo15 {
314			regulator-name = "vreg_l15c_1p9";
315			regulator-min-microvolt = <1704000>;
316			regulator-max-microvolt = <2928000>;
317			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
318		};
319
320		vreg_l16c_3p008: ldo16 {
321			regulator-name = "vreg_l16c_3p008";
322			regulator-min-microvolt = <3008000>;
323			regulator-max-microvolt = <3008000>;
324			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
325		};
326
327		vreg_l18c_0p88: ldo18 {
328			regulator-name = "vreg_l18c_0p88";
329			regulator-min-microvolt = <880000>;
330			regulator-max-microvolt = <880000>;
331			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
332		};
333	};
334};
335
336&ethernet {
337	status = "okay";
338
339	snps,reset-gpio = <&tlmm 79 GPIO_ACTIVE_LOW>;
340	snps,reset-active-low;
341	snps,reset-delays-us = <0 11000 70000>;
342
343	snps,mtl-rx-config = <&mtl_rx_setup>;
344	snps,mtl-tx-config = <&mtl_tx_setup>;
345
346	pinctrl-names = "default";
347	pinctrl-0 = <&ethernet_defaults>;
348
349	phy-handle = <&rgmii_phy>;
350	phy-mode = "rgmii";
351	max-speed = <1000>;
352
353	mdio {
354		#address-cells = <0x1>;
355		#size-cells = <0x0>;
356
357		compatible = "snps,dwmac-mdio";
358
359		/* Micrel KSZ9031RNZ PHY */
360		rgmii_phy: phy@7 {
361			reg = <0x7>;
362
363			interrupt-parent = <&tlmm>;
364			interrupts-extended = <&tlmm 124 IRQ_TYPE_EDGE_FALLING>; /* phy intr */
365			device_type = "ethernet-phy";
366			compatible = "ethernet-phy-ieee802.3-c22";
367		};
368	};
369};
370
371&qupv3_id_1 {
372	status = "okay";
373};
374
375&remoteproc_adsp {
376	status = "okay";
377	firmware-name = "qcom/sa8155p/adsp.mdt";
378};
379
380&remoteproc_cdsp {
381	status = "okay";
382	firmware-name = "qcom/sa8155p/cdsp.mdt";
383};
384
385&sdhc_2 {
386	status = "okay";
387
388	cd-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
389	pinctrl-names = "default", "sleep";
390	pinctrl-0 = <&sdc2_on>;
391	pinctrl-1 = <&sdc2_off>;
392	vqmmc-supply = <&vreg_l13c_2p96>; /* IO line power */
393	vmmc-supply = <&vreg_l17a_2p96>;  /* Card power line */
394	bus-width = <4>;
395	no-sdio;
396	no-mmc;
397};
398
399&uart2 {
400	status = "okay";
401};
402
403&ufs_mem_hc {
404	status = "okay";
405
406	reset-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>;
407
408	vcc-supply = <&vreg_l10a_2p96>;
409	vcc-max-microamp = <750000>;
410	vccq-supply = <&vreg_l5c_1p2>;
411	vccq-max-microamp = <700000>;
412	vccq2-supply = <&vreg_s4a_1p8>;
413	vccq2-max-microamp = <750000>;
414};
415
416&ufs_mem_phy {
417	status = "okay";
418
419	vdda-phy-supply = <&vreg_l8c_1p2>;
420	vdda-pll-supply = <&vreg_l5a_0p88>;
421};
422
423&usb_1 {
424	status = "okay";
425};
426
427&usb_1_dwc3 {
428	dr_mode = "host";
429
430	pinctrl-names = "default";
431	pinctrl-0 = <&usb2phy_ac_en1_default>;
432};
433
434&usb_1_hsphy {
435	status = "okay";
436	vdda-pll-supply = <&vdd_usb_hs_core>;
437	vdda33-supply = <&vdda_usb_hs_3p1>;
438	vdda18-supply = <&vdda_usb_hs_1p8>;
439};
440
441&usb_1_qmpphy {
442	status = "disabled";
443};
444
445&usb_2 {
446	status = "okay";
447};
448
449&usb_2_dwc3 {
450	dr_mode = "host";
451
452	pinctrl-names = "default";
453	pinctrl-0 = <&usb2phy_ac_en2_default>;
454};
455
456&usb_2_hsphy {
457	status = "okay";
458	vdda-pll-supply = <&vdd_usb_hs_core>;
459	vdda33-supply = <&vdda_usb_hs_3p1>;
460	vdda18-supply = <&vdda_usb_hs_1p8>;
461};
462
463&usb_2_qmpphy {
464	status = "okay";
465	vdda-phy-supply = <&vreg_l8c_1p2>;
466	vdda-pll-supply = <&vdda_usb_ss_dp_core_1>;
467};
468
469&pcie0 {
470	status = "okay";
471};
472
473&pcie0_phy {
474	status = "okay";
475	vdda-phy-supply = <&vreg_l18c_0p88>;
476	vdda-pll-supply = <&vreg_l8c_1p2>;
477};
478
479&pcie1_phy {
480	vdda-phy-supply = <&vreg_l18c_0p88>;
481	vdda-pll-supply = <&vreg_l8c_1p2>;
482};
483
484&tlmm {
485	gpio-reserved-ranges = <0 4>;
486
487	sdc2_on: sdc2-on-state {
488		clk-pins {
489			pins = "sdc2_clk";
490			bias-disable;		/* No pull */
491			drive-strength = <16>;	/* 16 MA */
492		};
493
494		cmd-pins {
495			pins = "sdc2_cmd";
496			bias-pull-up;		/* pull up */
497			drive-strength = <16>;	/* 16 MA */
498		};
499
500		data-pins {
501			pins = "sdc2_data";
502			bias-pull-up;		/* pull up */
503			drive-strength = <16>;	/* 16 MA */
504		};
505
506		sd-cd-pins {
507			pins = "gpio96";
508			function = "gpio";
509			bias-pull-up;		/* pull up */
510			drive-strength = <2>;	/* 2 MA */
511		};
512	};
513
514	sdc2_off: sdc2-off-state {
515		clk-pins {
516			pins = "sdc2_clk";
517			bias-disable;		/* No pull */
518			drive-strength = <2>;	/* 2 MA */
519		};
520
521		cmd-pins {
522			pins = "sdc2_cmd";
523			bias-pull-up;		/* pull up */
524			drive-strength = <2>;	/* 2 MA */
525		};
526
527		data-pins {
528			pins = "sdc2_data";
529			bias-pull-up;		/* pull up */
530			drive-strength = <2>;	/* 2 MA */
531		};
532
533		sd-cd-pins {
534			pins = "gpio96";
535			function = "gpio";
536			bias-pull-up;		/* pull up */
537			drive-strength = <2>;	/* 2 MA */
538		};
539	};
540
541	usb2phy_ac_en1_default: usb2phy-ac-en1-default-state {
542		pins = "gpio113";
543		function = "usb2phy_ac";
544		bias-disable;
545		drive-strength = <2>;
546	};
547
548	usb2phy_ac_en2_default: usb2phy-ac-en2-default-state {
549		pins = "gpio123";
550		function = "usb2phy_ac";
551		bias-disable;
552		drive-strength = <2>;
553	};
554
555	ethernet_defaults: ethernet-defaults-state {
556		mdc-pins {
557			pins = "gpio7";
558			function = "rgmii";
559			bias-pull-up;
560		};
561
562		mdio-pins {
563			pins = "gpio59";
564			function = "rgmii";
565			bias-pull-up;
566		};
567
568		rgmii-rx-pins {
569			pins = "gpio117", "gpio118", "gpio119", "gpio120", "gpio115", "gpio116";
570			function = "rgmii";
571			bias-disable;
572			drive-strength = <2>;
573		};
574
575		rgmii-tx-pins {
576			pins = "gpio122", "gpio4", "gpio5", "gpio6", "gpio114", "gpio121";
577			function = "rgmii";
578			bias-pull-up;
579			drive-strength = <16>;
580		};
581
582		phy-intr-pins {
583			pins = "gpio124";
584			function = "emac_phy";
585			bias-disable;
586			drive-strength = <8>;
587		};
588
589		pps-pins {
590			pins = "gpio81";
591			function = "emac_pps";
592			bias-disable;
593			drive-strength = <8>;
594		};
595
596		phy-reset-pins {
597			pins = "gpio79";
598			function = "gpio";
599			bias-pull-up;
600			drive-strength = <16>;
601		};
602	};
603};
604