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