xref: /linux/arch/arm64/boot/dts/qcom/sa8295p-adp.dts (revision db4a3f0fbedb0398f77b9047e8b8bb2b49f355bb)
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#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
13
14#include "sa8540p.dtsi"
15#include "sa8540p-pmics.dtsi"
16
17/ {
18	model = "Qualcomm SA8295P ADP";
19	compatible = "qcom,sa8295p-adp", "qcom,sa8540p";
20
21	aliases {
22		serial0 = &uart17;
23	};
24
25	chosen {
26		stdout-path = "serial0:115200n8";
27	};
28
29	dp2-connector {
30		compatible = "dp-connector";
31		label = "DP2";
32		type = "mini";
33
34		hpd-gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>;
35
36		port {
37			dp2_connector_in: endpoint {
38				remote-endpoint = <&mdss1_dp0_out>;
39			};
40		};
41	};
42
43	dp3-connector {
44		compatible = "dp-connector";
45		label = "DP3";
46		type = "mini";
47
48		hpd-gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
49
50		port {
51			dp3_connector_in: endpoint {
52				remote-endpoint = <&mdss1_dp1_out>;
53			};
54		};
55	};
56
57	edp0-connector {
58		compatible = "dp-connector";
59		label = "EDP0";
60		type = "mini";
61
62		hpd-gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>;
63
64		port {
65			edp0_connector_in: endpoint {
66				remote-endpoint = <&mdss0_dp2_out>;
67			};
68		};
69	};
70
71	edp1-connector {
72		compatible = "dp-connector";
73		label = "EDP1";
74		type = "mini";
75
76		hpd-gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
77
78		port {
79			edp1_connector_in: endpoint {
80				remote-endpoint = <&mdss0_dp3_out>;
81			};
82		};
83	};
84
85	edp2-connector {
86		compatible = "dp-connector";
87		label = "EDP2";
88		type = "mini";
89
90		hpd-gpios = <&tlmm 7 GPIO_ACTIVE_HIGH>;
91
92		port {
93			edp2_connector_in: endpoint {
94				remote-endpoint = <&mdss1_dp2_out>;
95			};
96		};
97	};
98
99	edp3-connector {
100		compatible = "dp-connector";
101		label = "EDP3";
102		type = "mini";
103
104		hpd-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>;
105
106		port {
107			edp3_connector_in: endpoint {
108				remote-endpoint = <&mdss1_dp3_out>;
109			};
110		};
111	};
112
113	regulator-usb2-vbus {
114		compatible = "regulator-fixed";
115		regulator-name = "USB2_VBUS";
116		gpio = <&pmm8540c_gpios 9 GPIO_ACTIVE_HIGH>;
117		pinctrl-0 = <&usb2_en>;
118		pinctrl-names = "default";
119		enable-active-high;
120		regulator-always-on;
121	};
122
123	regulator-usb3-vbus {
124		compatible = "regulator-fixed";
125		regulator-name = "USB3_VBUS";
126		gpio = <&pmm8540e_gpios 5 GPIO_ACTIVE_HIGH>;
127		pinctrl-0 = <&usb3_en>;
128		pinctrl-names = "default";
129		enable-active-high;
130		regulator-always-on;
131	};
132
133	regulator-usb4-vbus {
134		compatible = "regulator-fixed";
135		regulator-name = "USB4_VBUS";
136		gpio = <&pmm8540g_gpios 5 GPIO_ACTIVE_HIGH>;
137		pinctrl-0 = <&usb4_en>;
138		pinctrl-names = "default";
139		enable-active-high;
140		regulator-always-on;
141	};
142
143	regulator-usb5-vbus {
144		compatible = "regulator-fixed";
145		regulator-name = "USB5_VBUS";
146		gpio = <&pmm8540g_gpios 9 GPIO_ACTIVE_HIGH>;
147		pinctrl-0 = <&usb5_en>;
148		pinctrl-names = "default";
149		enable-active-high;
150		regulator-always-on;
151	};
152
153	reserved-memory {
154		gpu_mem: gpu-mem@8bf00000 {
155			reg = <0 0x8bf00000 0 0x2000>;
156			no-map;
157		};
158	};
159};
160
161&apps_rsc {
162	regulators-0 {
163		compatible = "qcom,pm8150-rpmh-regulators";
164		qcom,pmic-id = "a";
165
166		vreg_l3a: ldo3 {
167			regulator-name = "vreg_l3a";
168			regulator-min-microvolt = <1200000>;
169			regulator-max-microvolt = <1208000>;
170			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
171		};
172
173		vreg_l5a: ldo5 {
174			regulator-name = "vreg_l5a";
175			regulator-min-microvolt = <912000>;
176			regulator-max-microvolt = <912000>;
177			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
178		};
179
180		vreg_l7a: ldo7 {
181			regulator-name = "vreg_l7a";
182			regulator-min-microvolt = <1800000>;
183			regulator-max-microvolt = <1800000>;
184			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
185		};
186
187		vreg_l13a: ldo13 {
188			regulator-name = "vreg_l13a";
189			regulator-min-microvolt = <3072000>;
190			regulator-max-microvolt = <3072000>;
191			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
192		};
193
194		vreg_l11a: ldo11 {
195			regulator-name = "vreg_l11a";
196			regulator-min-microvolt = <880000>;
197			regulator-max-microvolt = <880000>;
198			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
199		};
200	};
201
202	regulators-1 {
203		compatible = "qcom,pm8150-rpmh-regulators";
204		qcom,pmic-id = "c";
205
206		vreg_l1c: ldo1 {
207			regulator-name = "vreg_l1c";
208			regulator-min-microvolt = <912000>;
209			regulator-max-microvolt = <912000>;
210			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
211		};
212
213		vreg_l2c: ldo2 {
214			regulator-name = "vreg_l2c";
215			regulator-min-microvolt = <3072000>;
216			regulator-max-microvolt = <3072000>;
217			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
218		};
219
220		vreg_l3c: ldo3 {
221			regulator-name = "vreg_l3c";
222			regulator-min-microvolt = <1200000>;
223			regulator-max-microvolt = <1200000>;
224			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
225			regulator-allow-set-load;
226			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
227						   RPMH_REGULATOR_MODE_HPM>;
228		};
229
230		vreg_l4c: ldo4 {
231			regulator-name = "vreg_l4c";
232			regulator-min-microvolt = <1200000>;
233			regulator-max-microvolt = <1208000>;
234			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
235		};
236
237		vreg_l6c: ldo6 {
238			regulator-name = "vreg_l6c";
239			regulator-min-microvolt = <1200000>;
240			regulator-max-microvolt = <1200000>;
241			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
242			regulator-allow-set-load;
243			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
244						   RPMH_REGULATOR_MODE_HPM>;
245		};
246
247		vreg_l7c: ldo7 {
248			regulator-name = "vreg_l7c";
249			regulator-min-microvolt = <1800000>;
250			regulator-max-microvolt = <1800000>;
251			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
252		};
253
254		vreg_l10c: ldo10 {
255			regulator-name = "vreg_l10c";
256			regulator-min-microvolt = <2504000>;
257			regulator-max-microvolt = <2504000>;
258			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
259			regulator-allow-set-load;
260			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
261						   RPMH_REGULATOR_MODE_HPM>;
262		};
263
264		vreg_l17c: ldo17 {
265			regulator-name = "vreg_l17c";
266			regulator-min-microvolt = <2504000>;
267			regulator-max-microvolt = <2504000>;
268			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
269			regulator-allow-set-load;
270			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
271						   RPMH_REGULATOR_MODE_HPM>;
272		};
273	};
274
275	regulators-2 {
276		compatible = "qcom,pm8150-rpmh-regulators";
277		qcom,pmic-id = "g";
278
279		vreg_l3g: ldo3 {
280			regulator-name = "vreg_l3g";
281			regulator-min-microvolt = <1200000>;
282			regulator-max-microvolt = <1200000>;
283			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
284		};
285
286		vreg_l7g: ldo7 {
287			regulator-name = "vreg_l7g";
288			regulator-min-microvolt = <1800000>;
289			regulator-max-microvolt = <1800000>;
290			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
291		};
292
293		vreg_l8g: ldo8 {
294			regulator-name = "vreg_l8g";
295			regulator-min-microvolt = <912000>;
296			regulator-max-microvolt = <912000>;
297			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
298		};
299
300		vreg_l11g: ldo11 {
301			regulator-name = "vreg_l11g";
302			regulator-min-microvolt = <912000>;
303			regulator-max-microvolt = <912000>;
304			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
305		};
306	};
307};
308
309&dispcc0 {
310	status = "okay";
311};
312
313&dispcc1 {
314	status = "okay";
315};
316
317&i2c12 {
318	pinctrl-0 = <&qup1_i2c4_state>;
319	pinctrl-names = "default";
320
321	status = "okay";
322
323	vdd_gfx: regulator@39 {
324		compatible = "maxim,max20411";
325		reg = <0x39>;
326
327		regulator-min-microvolt = <800000>;
328		regulator-max-microvolt = <800000>;
329
330		enable-gpios = <&pmm8540a_gpios 2 GPIO_ACTIVE_HIGH>;
331
332		pinctrl-0 = <&max20411_en>;
333		pinctrl-names = "default";
334	};
335};
336
337&gpucc {
338	vdd-gfx-supply = <&vdd_gfx>;
339	status = "okay";
340};
341
342&gmu {
343	status = "okay";
344};
345
346&gpu {
347	status = "okay";
348
349	zap-shader {
350		memory-region = <&gpu_mem>;
351		firmware-name = "qcom/sa8295p/a690_zap.mbn";
352	};
353};
354
355&gpu_smmu {
356	status = "okay";
357};
358
359&mdss0 {
360	status = "okay";
361};
362
363&mdss0_dp2 {
364	status = "okay";
365};
366
367&mdss0_dp2_out {
368	data-lanes = <0 1 2 3>;
369	remote-endpoint = <&edp0_connector_in>;
370};
371
372&mdss0_dp2_phy {
373	vdda-phy-supply = <&vreg_l8g>;
374	vdda-pll-supply = <&vreg_l3g>;
375
376	status = "okay";
377};
378
379&mdss0_dp3 {
380	status = "okay";
381};
382
383&mdss0_dp3_out {
384	data-lanes = <0 1 2 3>;
385	remote-endpoint = <&edp1_connector_in>;
386};
387
388&mdss0_dp3_phy {
389	vdda-phy-supply = <&vreg_l8g>;
390	vdda-pll-supply = <&vreg_l3g>;
391
392	status = "okay";
393};
394
395&mdss1 {
396	status = "okay";
397};
398
399&mdss1_dp0 {
400	status = "okay";
401};
402
403&mdss1_dp0_out {
404	data-lanes = <0 1 2 3>;
405	remote-endpoint = <&dp2_connector_in>;
406};
407
408&mdss1_dp0_phy {
409	vdda-phy-supply = <&vreg_l11g>;
410	vdda-pll-supply = <&vreg_l3g>;
411
412	status = "okay";
413};
414
415&mdss1_dp1 {
416	status = "okay";
417};
418
419&mdss1_dp1_out {
420	data-lanes = <0 1 2 3>;
421	remote-endpoint = <&dp3_connector_in>;
422};
423
424&mdss1_dp1_phy {
425	vdda-phy-supply = <&vreg_l11g>;
426	vdda-pll-supply = <&vreg_l3g>;
427
428	status = "okay";
429};
430
431&mdss1_dp2 {
432	status = "okay";
433};
434
435&mdss1_dp2_out {
436	data-lanes = <0 1 2 3>;
437	remote-endpoint = <&edp2_connector_in>;
438};
439
440&mdss1_dp2_phy {
441	vdda-phy-supply = <&vreg_l11g>;
442	vdda-pll-supply = <&vreg_l3g>;
443
444	status = "okay";
445};
446
447&mdss1_dp3 {
448	status = "okay";
449};
450
451&mdss1_dp3_out {
452	data-lanes = <0 1 2 3>;
453	remote-endpoint = <&edp3_connector_in>;
454};
455
456&mdss1_dp3_phy {
457	vdda-phy-supply = <&vreg_l11g>;
458	vdda-pll-supply = <&vreg_l3g>;
459
460	status = "okay";
461};
462
463&pcie2a {
464	perst-gpios = <&tlmm 143 GPIO_ACTIVE_LOW>;
465	wake-gpios = <&tlmm 145 GPIO_ACTIVE_LOW>;
466
467	pinctrl-names = "default";
468	pinctrl-0 = <&pcie2a_default>;
469
470	status = "okay";
471};
472
473&pcie2a_phy {
474	vdda-phy-supply = <&vreg_l11a>;
475	vdda-pll-supply = <&vreg_l3a>;
476
477	status = "okay";
478};
479
480&pcie3a {
481	num-lanes = <2>;
482
483	perst-gpios = <&tlmm 151 GPIO_ACTIVE_LOW>;
484	wake-gpios = <&tlmm 56 GPIO_ACTIVE_LOW>;
485
486	pinctrl-names = "default";
487	pinctrl-0 = <&pcie3a_default>;
488
489	status = "okay";
490};
491
492&pcie3a_phy {
493	vdda-phy-supply = <&vreg_l11a>;
494	vdda-pll-supply = <&vreg_l3a>;
495
496	status = "okay";
497};
498
499&pcie3b {
500	perst-gpios = <&tlmm 153 GPIO_ACTIVE_LOW>;
501	wake-gpios = <&tlmm 130 GPIO_ACTIVE_LOW>;
502
503	pinctrl-names = "default";
504	pinctrl-0 = <&pcie3b_default>;
505
506	status = "okay";
507};
508
509&pcie3b_phy {
510	vdda-phy-supply = <&vreg_l11a>;
511	vdda-pll-supply = <&vreg_l3a>;
512
513	status = "okay";
514};
515
516&pcie4 {
517	perst-gpios = <&tlmm 141 GPIO_ACTIVE_LOW>;
518	wake-gpios = <&tlmm 139 GPIO_ACTIVE_LOW>;
519
520	pinctrl-names = "default";
521	pinctrl-0 = <&pcie4_default>;
522
523	status = "okay";
524};
525
526&pcie4_phy {
527	vdda-phy-supply = <&vreg_l11a>;
528	vdda-pll-supply = <&vreg_l3a>;
529
530	status = "okay";
531};
532
533&qup1 {
534	status = "okay";
535};
536
537&qup2 {
538	status = "okay";
539};
540
541&remoteproc_adsp {
542	firmware-name = "qcom/sa8540p/adsp.mbn";
543	status = "okay";
544};
545
546&remoteproc_nsp0 {
547	firmware-name = "qcom/sa8540p/cdsp.mbn";
548	status = "okay";
549};
550
551&remoteproc_nsp1 {
552	firmware-name = "qcom/sa8540p/cdsp1.mbn";
553	status = "okay";
554};
555
556&uart17 {
557	compatible = "qcom,geni-debug-uart";
558	status = "okay";
559};
560
561&ufs_mem_hc {
562	reset-gpios = <&tlmm 228 GPIO_ACTIVE_LOW>;
563
564	vcc-supply = <&vreg_l17c>;
565	vcc-max-microamp = <800000>;
566	vccq-supply = <&vreg_l6c>;
567	vccq-max-microamp = <900000>;
568
569	status = "okay";
570};
571
572&ufs_mem_phy {
573	vdda-phy-supply = <&vreg_l8g>;
574	vdda-pll-supply = <&vreg_l3g>;
575
576	status = "okay";
577};
578
579&ufs_card_hc {
580	reset-gpios = <&tlmm 229 GPIO_ACTIVE_LOW>;
581
582	vcc-supply = <&vreg_l10c>;
583	vcc-max-microamp = <800000>;
584	vccq-supply = <&vreg_l3c>;
585	vccq-max-microamp = <900000>;
586
587	status = "okay";
588};
589
590&ufs_card_phy {
591	vdda-phy-supply = <&vreg_l8g>;
592	vdda-pll-supply = <&vreg_l3g>;
593
594	status = "okay";
595};
596
597&usb_0 {
598	status = "okay";
599};
600
601&usb_0_dwc3 {
602	/* TODO: Define USB-C connector properly */
603	dr_mode = "peripheral";
604};
605
606&usb_0_hsphy {
607	vdda-pll-supply = <&vreg_l5a>;
608	vdda18-supply = <&vreg_l7a>;
609	vdda33-supply = <&vreg_l13a>;
610
611	status = "okay";
612};
613
614&usb_0_qmpphy {
615	vdda-phy-supply = <&vreg_l3a>;
616	vdda-pll-supply = <&vreg_l5a>;
617
618	status = "okay";
619};
620
621&usb_1 {
622	status = "okay";
623};
624
625&usb_1_dwc3 {
626	/* TODO: Define USB-C connector properly */
627	dr_mode = "host";
628};
629
630&usb_1_hsphy {
631	vdda-pll-supply = <&vreg_l1c>;
632	vdda18-supply = <&vreg_l7c>;
633	vdda33-supply = <&vreg_l2c>;
634
635	status = "okay";
636};
637
638&usb_1_qmpphy {
639	vdda-phy-supply = <&vreg_l4c>;
640	vdda-pll-supply = <&vreg_l1c>;
641
642	status = "okay";
643};
644
645&usb_2 {
646	status = "okay";
647};
648
649&usb_2_hsphy0 {
650	vdda-pll-supply = <&vreg_l5a>;
651	vdda18-supply = <&vreg_l7g>;
652	vdda33-supply = <&vreg_l13a>;
653
654	status = "okay";
655};
656
657&usb_2_hsphy1 {
658	vdda-pll-supply = <&vreg_l5a>;
659	vdda18-supply = <&vreg_l7g>;
660	vdda33-supply = <&vreg_l13a>;
661
662	status = "okay";
663};
664
665&usb_2_hsphy2 {
666	vdda-pll-supply = <&vreg_l5a>;
667	vdda18-supply = <&vreg_l7g>;
668	vdda33-supply = <&vreg_l13a>;
669
670	status = "okay";
671};
672
673&usb_2_hsphy3 {
674	vdda-pll-supply = <&vreg_l5a>;
675	vdda18-supply = <&vreg_l7g>;
676	vdda33-supply = <&vreg_l13a>;
677
678	status = "okay";
679};
680
681&usb_2_qmpphy0 {
682	vdda-phy-supply = <&vreg_l3a>;
683	vdda-pll-supply = <&vreg_l5a>;
684
685	status = "okay";
686};
687
688&usb_2_qmpphy1 {
689	vdda-phy-supply = <&vreg_l3a>;
690	vdda-pll-supply = <&vreg_l5a>;
691
692	status = "okay";
693};
694
695&xo_board_clk {
696	clock-frequency = <38400000>;
697};
698
699/* PINCTRL */
700
701&pmm8540a_gpios {
702	max20411_en: max20411-en-state {
703		pins = "gpio2";
704		function = "normal";
705		output-enable;
706	};
707};
708
709&pmm8540c_gpios {
710	usb2_en: usb2-en-state {
711		pins = "gpio9";
712		function = "normal";
713		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
714		output-enable;
715		power-source = <0>;
716	};
717};
718
719&pmm8540e_gpios {
720	usb3_en: usb3-en-state {
721		pins = "gpio5";
722		function = "normal";
723		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
724		output-enable;
725		power-source = <0>;
726	};
727};
728
729&pmm8540g_gpios {
730	usb4_en: usb4-en-state {
731		pins = "gpio5";
732		function = "normal";
733		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
734		output-enable;
735		power-source = <0>;
736	};
737
738	usb5_en: usb5-en-state {
739		pins = "gpio9";
740		function = "normal";
741		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
742		output-enable;
743		power-source = <0>;
744	};
745};
746
747&tlmm {
748	pcie2a_default: pcie2a-default-state {
749		clkreq-n-pins {
750			pins = "gpio142";
751			function = "pcie2a_clkreq";
752			drive-strength = <2>;
753			bias-pull-up;
754		};
755
756		perst-n-pins {
757			pins = "gpio143";
758			function = "gpio";
759			drive-strength = <2>;
760			bias-pull-down;
761		};
762
763		wake-n-pins {
764			pins = "gpio145";
765			function = "gpio";
766			drive-strength = <2>;
767			bias-pull-up;
768		};
769	};
770
771	pcie3a_default: pcie3a-default-state {
772		clkreq-n-pins {
773			pins = "gpio150";
774			function = "pcie3a_clkreq";
775			drive-strength = <2>;
776			bias-pull-up;
777		};
778
779		perst-n-pins {
780			pins = "gpio151";
781			function = "gpio";
782			drive-strength = <2>;
783			bias-pull-down;
784		};
785
786		wake-n-pins {
787			pins = "gpio56";
788			function = "gpio";
789			drive-strength = <2>;
790			bias-pull-up;
791		};
792	};
793
794	pcie3b_default: pcie3b-default-state {
795		clkreq-n-pins {
796			pins = "gpio152";
797			function = "pcie3b_clkreq";
798			drive-strength = <2>;
799			bias-pull-up;
800		};
801
802		perst-n-pins {
803			pins = "gpio153";
804			function = "gpio";
805			drive-strength = <2>;
806			bias-pull-down;
807		};
808
809		wake-n-pins {
810			pins = "gpio130";
811			function = "gpio";
812			drive-strength = <2>;
813			bias-pull-up;
814		};
815	};
816
817	pcie4_default: pcie4-default-state {
818		clkreq-n-pins {
819			pins = "gpio140";
820			function = "pcie4_clkreq";
821			drive-strength = <2>;
822			bias-pull-up;
823		};
824
825		perst-n-pins {
826			pins = "gpio141";
827			function = "gpio";
828			drive-strength = <2>;
829			bias-pull-down;
830		};
831
832		wake-n-pins {
833			pins = "gpio139";
834			function = "gpio";
835			drive-strength = <2>;
836			bias-pull-up;
837		};
838	};
839
840	qup1_i2c4_state: qup1-i2c4-state {
841		pins = "gpio0", "gpio1";
842		function = "qup12";
843		drive-strength = <2>;
844		bias-pull-up;
845	};
846};
847