xref: /freebsd/sys/contrib/device-tree/src/arm64/qcom/sa8155p-adp.dts (revision e32fecd0c2c3ee37c47ee100f169e7eb0282a873)
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,ptp-ref-clk-rate = <250000000>;
337	snps,ptp-req-clk-rate = <96000000>;
338
339	snps,mtl-rx-config = <&mtl_rx_setup>;
340	snps,mtl-tx-config = <&mtl_tx_setup>;
341
342	pinctrl-names = "default";
343	pinctrl-0 = <&ethernet_defaults>;
344
345	phy-handle = <&rgmii_phy>;
346	phy-mode = "rgmii";
347	max-speed = <1000>;
348
349	mdio {
350		#address-cells = <0x1>;
351		#size-cells = <0x0>;
352
353		compatible = "snps,dwmac-mdio";
354
355		/* Micrel KSZ9031RNZ PHY */
356		rgmii_phy: phy@7 {
357			reg = <0x7>;
358
359			interrupt-parent = <&tlmm>;
360			interrupts-extended = <&tlmm 124 IRQ_TYPE_EDGE_FALLING>; /* phy intr */
361			device_type = "ethernet-phy";
362			compatible = "ethernet-phy-ieee802.3-c22";
363		};
364	};
365};
366
367&qupv3_id_1 {
368	status = "okay";
369};
370
371&remoteproc_adsp {
372	status = "okay";
373	firmware-name = "qcom/sa8155p/adsp.mdt";
374};
375
376&remoteproc_cdsp {
377	status = "okay";
378	firmware-name = "qcom/sa8155p/cdsp.mdt";
379};
380
381&sdhc_2 {
382	status = "okay";
383
384	cd-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
385	pinctrl-names = "default", "sleep";
386	pinctrl-0 = <&sdc2_on>;
387	pinctrl-1 = <&sdc2_off>;
388	vqmmc-supply = <&vreg_l13c_2p96>; /* IO line power */
389	vmmc-supply = <&vreg_l17a_2p96>;  /* Card power line */
390	bus-width = <4>;
391	no-sdio;
392	no-emmc;
393};
394
395&uart2 {
396	status = "okay";
397};
398
399&ufs_mem_hc {
400	status = "okay";
401
402	reset-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>;
403
404	vcc-supply = <&vreg_l10a_2p96>;
405	vcc-max-microamp = <750000>;
406	vccq-supply = <&vreg_l5c_1p2>;
407	vccq-max-microamp = <700000>;
408	vccq2-supply = <&vreg_s4a_1p8>;
409	vccq2-max-microamp = <750000>;
410};
411
412&ufs_mem_phy {
413	status = "okay";
414
415	vdda-phy-supply = <&vreg_l8c_1p2>;
416	vdda-pll-supply = <&vreg_l5a_0p88>;
417};
418
419&usb_1 {
420	status = "okay";
421};
422
423&usb_1_dwc3 {
424	dr_mode = "host";
425
426	pinctrl-names = "default";
427	pinctrl-0 = <&usb2phy_ac_en1_default>;
428};
429
430&usb_1_hsphy {
431	status = "okay";
432	vdda-pll-supply = <&vdd_usb_hs_core>;
433	vdda33-supply = <&vdda_usb_hs_3p1>;
434	vdda18-supply = <&vdda_usb_hs_1p8>;
435};
436
437&usb_1_qmpphy {
438	status = "disabled";
439};
440
441&usb_2 {
442	status = "okay";
443};
444
445&usb_2_dwc3 {
446	dr_mode = "host";
447
448	pinctrl-names = "default";
449	pinctrl-0 = <&usb2phy_ac_en2_default>;
450};
451
452&usb_2_hsphy {
453	status = "okay";
454	vdda-pll-supply = <&vdd_usb_hs_core>;
455	vdda33-supply = <&vdda_usb_hs_3p1>;
456	vdda18-supply = <&vdda_usb_hs_1p8>;
457};
458
459&usb_2_qmpphy {
460	status = "okay";
461	vdda-phy-supply = <&vreg_l8c_1p2>;
462	vdda-pll-supply = <&vdda_usb_ss_dp_core_1>;
463};
464
465&pcie0 {
466	status = "okay";
467};
468
469&pcie0_phy {
470	status = "okay";
471	vdda-phy-supply = <&vreg_l18c_0p88>;
472	vdda-pll-supply = <&vreg_l8c_1p2>;
473};
474
475&pcie1_phy {
476	vdda-phy-supply = <&vreg_l18c_0p88>;
477	vdda-pll-supply = <&vreg_l8c_1p2>;
478};
479
480&tlmm {
481	gpio-reserved-ranges = <0 4>;
482
483	sdc2_on: sdc2_on {
484		clk {
485			pins = "sdc2_clk";
486			bias-disable;		/* No pull */
487			drive-strength = <16>;	/* 16 MA */
488		};
489
490		cmd {
491			pins = "sdc2_cmd";
492			bias-pull-up;		/* pull up */
493			drive-strength = <16>;	/* 16 MA */
494		};
495
496		data {
497			pins = "sdc2_data";
498			bias-pull-up;		/* pull up */
499			drive-strength = <16>;	/* 16 MA */
500		};
501
502		sd-cd {
503			pins = "gpio96";
504			function = "gpio";
505			bias-pull-up;		/* pull up */
506			drive-strength = <2>;	/* 2 MA */
507		};
508	};
509
510	sdc2_off: sdc2_off {
511		clk {
512			pins = "sdc2_clk";
513			bias-disable;		/* No pull */
514			drive-strength = <2>;	/* 2 MA */
515		};
516
517		cmd {
518			pins = "sdc2_cmd";
519			bias-pull-up;		/* pull up */
520			drive-strength = <2>;	/* 2 MA */
521		};
522
523		data {
524			pins = "sdc2_data";
525			bias-pull-up;		/* pull up */
526			drive-strength = <2>;	/* 2 MA */
527		};
528
529		sd-cd {
530			pins = "gpio96";
531			function = "gpio";
532			bias-pull-up;		/* pull up */
533			drive-strength = <2>;	/* 2 MA */
534		};
535	};
536
537	usb2phy_ac_en1_default: usb2phy_ac_en1_default {
538		mux {
539			pins = "gpio113";
540			function = "usb2phy_ac";
541			bias-disable;
542			drive-strength = <2>;
543		};
544	};
545
546	usb2phy_ac_en2_default: usb2phy_ac_en2_default {
547		mux {
548			pins = "gpio123";
549			function = "usb2phy_ac";
550			bias-disable;
551			drive-strength = <2>;
552		};
553	};
554
555	ethernet_defaults: ethernet-defaults {
556		mdc {
557			pins = "gpio7";
558			function = "rgmii";
559			bias-pull-up;
560		};
561
562		mdio {
563			pins = "gpio59";
564			function = "rgmii";
565			bias-pull-up;
566		};
567
568		rgmii-rx {
569			pins = "gpio117", "gpio118", "gpio119", "gpio120", "gpio115", "gpio116";
570			function = "rgmii";
571			bias-disable;
572			drive-strength = <2>;
573		};
574
575		rgmii-tx {
576			pins = "gpio122", "gpio4", "gpio5", "gpio6", "gpio114", "gpio121";
577			function = "rgmii";
578			bias-pull-up;
579			drive-strength = <16>;
580		};
581
582		phy-intr {
583			pins = "gpio124";
584			function = "emac_phy";
585			bias-disable;
586			drive-strength = <8>;
587		};
588
589		pps {
590			pins = "gpio81";
591			function = "emac_pps";
592			bias-disable;
593			drive-strength = <8>;
594		};
595
596		phy-reset {
597			pins = "gpio79";
598			function = "gpio";
599			bias-pull-up;
600			drive-strength = <16>;
601		};
602	};
603};
604