1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2020, Yassine Oudjana <y.oudjana@protonmail.com>
4 */
5
6/dts-v1/;
7
8#include "msm8996.dtsi"
9#include "pm8994.dtsi"
10#include "pmi8994.dtsi"
11#include <dt-bindings/input/input.h>
12#include <dt-bindings/gpio/gpio.h>
13#include <dt-bindings/leds/common.h>
14#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
15
16/ {
17	clocks {
18		compatible = "simple-bus";
19
20		divclk1_cdc: divclk1 {
21			compatible = "gpio-gate-clock";
22			clocks = <&rpmcc RPM_SMD_DIV_CLK1>;
23			#clock-cells = <0>;
24			enable-gpios = <&pm8994_gpios 15 GPIO_ACTIVE_HIGH>;
25
26			pinctrl-names = "default";
27			pinctrl-0 = <&divclk1_default>;
28		};
29
30		divclk4: divclk4 {
31			compatible = "fixed-clock";
32			#clock-cells = <0>;
33			clock-frequency = <32768>;
34			clock-output-names = "divclk4";
35
36			pinctrl-names = "default";
37			pinctrl-0 = <&divclk4_pin_a>;
38		};
39	};
40
41	gpio-keys {
42		compatible = "gpio-keys";
43
44		key-vol-up {
45			label = "Volume Up";
46			gpios = <&pm8994_gpios 2 GPIO_ACTIVE_LOW>;
47			linux,code = <KEY_VOLUMEUP>;
48			wakeup-source;
49			debounce-interval = <15>;
50		};
51
52		key-dome {
53			label = "Home";
54			gpios = <&tlmm 34 GPIO_ACTIVE_LOW>;
55			linux,code = <KEY_HOME>;
56			wakeup-source;
57			debounce-interval = <15>;
58		};
59	};
60
61	irled {
62		compatible = "pwm-ir-tx";
63		pwms = <&pm8994_lpg 1 1000000>;
64
65		pinctrl-names = "default";
66		pinctrl-0 = <&irled_default>;
67	};
68
69	reserved-memory {
70		memory@88800000 {
71			reg = <0x0 0x88800000 0x0 0x1400000>;
72			no-map;
73		};
74
75		/* This platform has all PIL regions offset by 0x1400000 */
76		/delete-node/ mpss@88800000;
77		mpss_mem: mpss@89c00000 {
78			reg = <0x0 0x89c00000 0x0 0x6200000>;
79			no-map;
80		};
81
82		/delete-node/ adsp@8ea00000;
83		adsp_mem: adsp@8fe00000 {
84			reg = <0x0 0x8fe00000 0x0 0x1b00000>;
85			no-map;
86		};
87
88		/delete-node/ slpi@90500000;
89		slpi_mem: slpi@91900000 {
90			reg = <0x0 0x91900000 0x0 0xa00000>;
91			no-map;
92		};
93
94		/delete-node/ gpu@90f00000;
95		gpu_mem: gpu@92300000 {
96			compatible = "shared-dma-pool";
97			reg = <0x0 0x92300000 0x0 0x2000>;
98			no-map;
99		};
100
101		/delete-node/ venus@91000000;
102		venus_mem: venus@92400000 {
103			reg = <0x0 0x92400000 0x0 0x500000>;
104			no-map;
105		};
106
107		ramoops@92900000 {
108			compatible = "ramoops";
109			reg = <0x0 0x92900000 0x0 0x100000>;
110			no-map;
111
112			record-size = <0x8000>;
113			console-size = <0x80000>;
114			ftrace-size = <0x20000>;
115			pmsg-size = <0x40000>;
116		};
117
118		/delete-node/ rmtfs;
119		rmtfs@f6c00000 {
120			compatible = "qcom,rmtfs-mem";
121			reg = <0 0xf6c00000 0 0x200000>;
122			no-map;
123
124			qcom,client-id = <1>;
125			qcom,vmid = <15>;
126		};
127
128		/delete-node/ mba@91500000;
129		mba_mem: mba@f6f00000 {
130			reg = <0x0 0xf6f00000 0x0 0x100000>;
131			no-map;
132		};
133	};
134
135	vph_pwr: vph-pwr-regulator {
136		compatible = "regulator-fixed";
137		regulator-name = "vph_pwr";
138		regulator-min-microvolt = <3800000>;
139		regulator-max-microvolt = <3800000>;
140		regulator-always-on;
141		regulator-boot-on;
142	};
143
144	vdd_3v2_tp: vdd-3v2-tp {
145		compatible = "regulator-fixed";
146		regulator-name = "vdd_3v2_tp";
147		regulator-min-microvolt = <3200000>;
148		regulator-max-microvolt = <3200000>;
149		startup-delay-us = <4000>;
150		vin-supply = <&vph_pwr>;
151
152		gpio = <&tlmm 73 0>;
153		enable-active-high;
154	};
155
156	vdd_3v3: rome-vreg {
157		compatible = "regulator-fixed";
158		regulator-name = "vdd_3v3";
159		regulator-min-microvolt = <3300000>;
160		regulator-max-microvolt = <3300000>;
161		startup-delay-us = <4000>;
162		vin-supply = <&vph_pwr_bbyp>;
163
164		gpio = <&pm8994_gpios 9 0>;
165		enable-active-high;
166		pinctrl-names = "default";
167		pinctrl-0 = <&rome_enable_default>;
168
169		/* Required by QCA6174a - vddpe-3v3 */
170		regulator-always-on;
171	};
172
173	/* WL_EN pin defined as a fixed regulator */
174	wlan_en: wlan-en-1-8v {
175		compatible = "regulator-fixed";
176		regulator-name = "wlan-en-regulator";
177		regulator-min-microvolt = <1800000>;
178		regulator-max-microvolt = <1800000>;
179
180		gpio = <&pm8994_gpios 8 0>;
181		/* WLAN card specific delay */
182		startup-delay-us = <70000>;
183		enable-active-high;
184		pinctrl-names = "default";
185		pinctrl-0 = <&wlan_en_default>;
186	};
187};
188
189&adsp_pil {
190	status = "okay";
191};
192
193&blsp2_i2c2 {
194	status = "okay";
195	label = "NFC_I2C";
196	clock-frequency = <400000>;
197
198	nfc: pn548@28 {
199		compatible = "nxp,nxp-nci-i2c";
200
201		reg = <0x28>;
202
203		interrupt-parent = <&tlmm>;
204		interrupts = <9 IRQ_TYPE_LEVEL_HIGH>;
205
206		enable-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
207		firmware-gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
208
209		pinctrl-names = "default";
210		pinctrl-0 = <&nfc_default>;
211	};
212};
213
214&blsp2_i2c3 {
215	status = "okay";
216	label = "TYPEC_I2C";
217
218	typec: tusb320l@47 {
219		compatible = "ti,tusb320l";
220		reg = <0x47>;
221		interrupt-parent = <&tlmm>;
222		interrupts = <63 IRQ_TYPE_EDGE_RISING>;
223	};
224};
225
226&blsp2_i2c6 {
227	status = "okay";
228	label = "MSM_TS_I2C";
229};
230
231&blsp1_uart2 {
232	status = "okay";
233	label = "QCA_UART";
234
235	bluetooth: qca6174a {
236		compatible = "qcom,qca6174-bt";
237
238		enable-gpios = <&pm8994_gpios 19 GPIO_ACTIVE_HIGH>;
239		clocks = <&divclk4>;
240	};
241};
242
243&dsi0 {
244	status = "okay";
245
246	vdd-supply = <&vreg_l2a_1p25>;
247	vddio-supply = <&vreg_l14a_1p8>;
248
249	pinctrl-names = "default", "sleep";
250	pinctrl-0 = <&mdss_dsi_default &mdss_te_default>;
251	pinctrl-1 = <&mdss_dsi_sleep &mdss_te_sleep>;
252};
253
254&dsi0_out {
255	status = "okay";
256
257	data-lanes = <0 1 2 3>;
258};
259
260&dsi0_phy {
261	status = "okay";
262
263	vcca-supply = <&vreg_l28a_0p925>;
264};
265
266&gpu {
267	status = "okay";
268};
269
270&mdss {
271	status = "okay";
272};
273
274&mmcc {
275	vdd-gfx-supply = <&vdd_gfx>;
276};
277
278&mss_pil {
279	status = "okay";
280
281	pll-supply = <&vreg_l12a_1p8>;
282};
283
284&pcie0 {
285	status = "okay";
286
287	/* Supplied by vdd_3v3, but choose wlan_en to drive enable pin high */
288	vddpe-3v3-supply = <&wlan_en>;
289	vdda-supply = <&vreg_l28a_0p925>;
290
291	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
292	wake-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
293};
294
295&pcie_phy {
296	status = "okay";
297
298	vdda-phy-supply = <&vreg_l28a_0p925>;
299	vdda-pll-supply = <&vreg_l12a_1p8>;
300};
301
302&pm8994_resin {
303	status = "okay";
304
305	linux,code = <KEY_VOLUMEDOWN>;
306};
307
308&pm8994_lpg {
309	status = "okay";
310
311	qcom,power-source = <1>;
312};
313
314&pmi8994_lpg {
315	status = "okay";
316
317	qcom,power-source = <1>;
318
319	multi-led {
320		color = <LED_COLOR_ID_RGB>;
321		function = LED_FUNCTION_STATUS;
322
323		#address-cells = <1>;
324		#size-cells = <0>;
325
326		led@1 {
327			reg = <1>;
328			color = <LED_COLOR_ID_BLUE>;
329		};
330
331		led@2 {
332			reg = <2>;
333			color = <LED_COLOR_ID_GREEN>;
334		};
335
336		led@3 {
337			reg = <3>;
338			color = <LED_COLOR_ID_RED>;
339		};
340	};
341};
342
343&slpi_pil {
344	status = "okay";
345
346	px-supply = <&vreg_lvs2a_1p8>;
347};
348
349&usb3 {
350	status = "okay";
351	extcon = <&typec>;
352
353	qcom,select-utmi-as-pipe-clk;
354};
355
356&usb3_dwc3 {
357	extcon = <&typec>;
358
359	/* usb3-phy is not used on this device */
360	phys = <&hsusb_phy1>;
361	phy-names = "usb2-phy";
362
363	maximum-speed = "high-speed";
364	snps,is-utmi-l1-suspend;
365	snps,usb2-gadget-lpm-disable;
366	snps,hird-threshold = /bits/ 8 <0>;
367};
368
369&hsusb_phy1 {
370	status = "okay";
371	extcon = <&typec>;
372
373	vdda-pll-supply = <&vreg_l12a_1p8>;
374	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
375};
376
377&ufshc {
378	status = "okay";
379
380	vcc-supply = <&vreg_l20a_2p95>;
381	vccq-supply = <&vreg_l25a_1p2>;
382	vccq2-supply = <&vreg_s4a_1p8>;
383
384	vcc-max-microamp = <600000>;
385	vccq-max-microamp = <450000>;
386	vccq2-max-microamp = <450000>;
387};
388
389&ufsphy {
390	status = "okay";
391
392	vdda-phy-supply = <&vreg_l28a_0p925>;
393	vdda-pll-supply = <&vreg_l12a_1p8>;
394	vddp-ref-clk-supply = <&vreg_l25a_1p2>;
395};
396
397&venus {
398	status = "okay";
399};
400
401&wcd9335 {
402	clock-names = "mclk", "slimbus";
403	clocks = <&divclk1_cdc>,
404		 <&rpmcc RPM_SMD_BB_CLK1>;
405
406	vdd-buck-supply = <&vreg_s4a_1p8>;
407	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
408	vdd-rx-supply = <&vreg_s4a_1p8>;
409	vdd-tx-supply = <&vreg_s4a_1p8>;
410	vdd-vbat-supply = <&vph_pwr>;
411	vdd-micbias-supply = <&vph_pwr_bbyp>;
412	vdd-io-supply = <&vreg_s4a_1p8>;
413};
414
415&rpm_requests {
416	pm8994-regulators {
417		compatible = "qcom,rpm-pm8994-regulators";
418
419		vdd_s1-supply = <&vph_pwr>;
420		vdd_s2-supply = <&vph_pwr>;
421		vdd_s3-supply = <&vph_pwr>;
422		vdd_s4-supply = <&vph_pwr>;
423		vdd_s5-supply = <&vph_pwr>;
424		vdd_s6-supply = <&vph_pwr>;
425		vdd_s7-supply = <&vph_pwr>;
426		vdd_s8-supply = <&vph_pwr>;
427		vdd_s9-supply = <&vph_pwr>;
428		vdd_s10-supply = <&vph_pwr>;
429		vdd_s11-supply = <&vph_pwr>;
430		vdd_s12-supply = <&vph_pwr>;
431		vdd_l1-supply = <&vreg_s1b_1p025>;
432		vdd_l2_l26_l28-supply = <&vreg_s3a_1p3>;
433		vdd_l3_l11-supply = <&vreg_s3a_1p3>;
434		vdd_l4_l27_l31-supply = <&vreg_s3a_1p3>;
435		vdd_l5_l7-supply = <&vreg_s5a_2p15>;
436		vdd_l6_l12_l32-supply = <&vreg_s5a_2p15>;
437		vdd_l8_l16_l30-supply = <&vph_pwr>;
438		vdd_l9_l10_l18_l22-supply = <&vph_pwr_bbyp>;
439		vdd_l13_l19_l23_l24-supply = <&vph_pwr_bbyp>;
440		vdd_l14_l15-supply = <&vreg_s5a_2p15>;
441		vdd_l17_l29-supply = <&vph_pwr_bbyp>;
442		vdd_l20_l21-supply = <&vph_pwr_bbyp>;
443		vdd_l25-supply = <&vreg_s3a_1p3>;
444		vdd_lvs1_2-supply = <&vreg_s4a_1p8>;
445
446		vreg_s3a_1p3: s3 {
447			regulator-name = "vreg_s3a_1p3";
448			regulator-min-microvolt = <1300000>;
449			regulator-max-microvolt = <1300000>;
450
451			/* Required by QCA6174a - vdd-core */
452			regulator-always-on;
453		};
454		vreg_s4a_1p8: s4 {
455			regulator-name = "vreg_s4a_1p8";
456			regulator-min-microvolt = <1800000>;
457			regulator-max-microvolt = <1800000>;
458			regulator-allow-set-load;
459
460			/* Required by QCA6174a - vddio */
461			regulator-always-on;
462		};
463		vreg_s5a_2p15: s5 {
464			regulator-name = "vreg_s5a_2p15";
465			regulator-min-microvolt = <2150000>;
466			regulator-max-microvolt = <2150000>;
467		};
468		vreg_s7a_0p8: s7 {
469			regulator-name = "vreg_s7a_0p8";
470			regulator-min-microvolt = <800000>;
471			regulator-max-microvolt = <800000>;
472		};
473		vreg_l1a_1p0: l1 {
474			regulator-name = "vreg_l1a_1p0";
475			regulator-min-microvolt = <1000000>;
476			regulator-max-microvolt = <1000000>;
477		};
478		vreg_l2a_1p25: l2 {
479			regulator-name = "vreg_l2a_1p25";
480			regulator-min-microvolt = <1250000>;
481			regulator-max-microvolt = <1250000>;
482		};
483		vreg_l4a_1p225: l4 {
484			regulator-name = "vreg_l4a_1p225";
485			regulator-min-microvolt = <1225000>;
486			regulator-max-microvolt = <1225000>;
487		};
488		vreg_l6a_1p8: l6 {
489			regulator-name = "vreg_l6a_1p8";
490			regulator-min-microvolt = <1800000>;
491			regulator-max-microvolt = <1800000>;
492		};
493		vreg_l8a_1p8: l8 {
494			regulator-name = "vreg_l8a_1p8";
495			regulator-min-microvolt = <1800000>;
496			regulator-max-microvolt = <1800000>;
497		};
498		vreg_l9a_1p8: l9 {
499			regulator-name = "vreg_l9a_1p8";
500			regulator-min-microvolt = <1800000>;
501			regulator-max-microvolt = <1800000>;
502		};
503		vreg_l10a_1p8: l10 {
504			regulator-name = "vreg_l10a_1p8";
505			regulator-min-microvolt = <1800000>;
506			regulator-max-microvolt = <1800000>;
507		};
508		vreg_l12a_1p8: l12 {
509			regulator-name = "vreg_l12a_1p8";
510			regulator-min-microvolt = <1800000>;
511			regulator-max-microvolt = <1800000>;
512			regulator-allow-set-load;
513		};
514		vreg_l13a_2p95: l13 {
515			regulator-name = "vreg_l13a_2p95";
516			regulator-min-microvolt = <1800000>;
517			regulator-max-microvolt = <2950000>;
518		};
519		vreg_l14a_1p8: l14 {
520			regulator-name = "vreg_l14a_1p8";
521			regulator-min-microvolt = <1800000>;
522			regulator-max-microvolt = <1800000>;
523		};
524		vreg_l15a_1p8: l15 {
525			regulator-name = "vreg_l15a_1p8";
526			regulator-min-microvolt = <1800000>;
527			regulator-max-microvolt = <1800000>;
528		};
529		vreg_l16a_2p7: l16 {
530			regulator-name = "vreg_l16a_2p7";
531			regulator-min-microvolt = <2700000>;
532			regulator-max-microvolt = <2700000>;
533		};
534		vreg_l19a_3p3: l19 {
535			regulator-name = "vreg_l19a_3p3";
536			regulator-min-microvolt = <3000000>;
537			regulator-max-microvolt = <3000000>;
538		};
539		vreg_l20a_2p95: l20 {
540			regulator-name = "vreg_l20a_2p95";
541			regulator-min-microvolt = <2950000>;
542			regulator-max-microvolt = <2950000>;
543			regulator-allow-set-load;
544		};
545		vreg_l21a_2p95: l21 {
546			regulator-name = "vreg_l21a_2p95";
547			regulator-min-microvolt = <3300000>;
548			regulator-max-microvolt = <3300000>;
549			regulator-always-on;
550		};
551		vreg_l23a_2p8: l23 {
552			regulator-name = "vreg_l23a_2p8";
553			regulator-min-microvolt = <2800000>;
554			regulator-max-microvolt = <2800000>;
555		};
556		vreg_l24a_3p075: l24 {
557			regulator-name = "vreg_l24a_3p075";
558			regulator-min-microvolt = <3075000>;
559			regulator-max-microvolt = <3075000>;
560		};
561		vreg_l25a_1p2: l25 {
562			regulator-name = "vreg_l25a_1p2";
563			regulator-min-microvolt = <1200000>;
564			regulator-max-microvolt = <1200000>;
565			regulator-allow-set-load;
566		};
567		vreg_l27a_1p2: l27 {
568			regulator-name = "vreg_l27a_1p2";
569			regulator-min-microvolt = <1200000>;
570			regulator-max-microvolt = <1200000>;
571		};
572		vreg_l28a_0p925: l28 {
573			regulator-name = "vreg_l28a_0p925";
574			regulator-min-microvolt = <925000>;
575			regulator-max-microvolt = <925000>;
576			regulator-allow-set-load;
577		};
578		vreg_l30a_1p8: l30 {
579			regulator-name = "vreg_l30a_1p8";
580			regulator-min-microvolt = <1800000>;
581			regulator-max-microvolt = <1800000>;
582
583			/* Required by QCA6174a - vddio-xtal */
584			regulator-always-on;
585		};
586		vreg_l32a_1p8: l32 {
587			regulator-name = "vreg_l32a_1p8";
588			regulator-min-microvolt = <1800000>;
589			regulator-max-microvolt = <1800000>;
590		};
591		vreg_lvs1a_1p8: lvs1 {
592			regulator-min-microvolt = <1800000>;
593			regulator-max-microvolt = <1800000>;
594		};
595		vreg_lvs2a_1p8: lvs2 {
596			regulator-min-microvolt = <1800000>;
597			regulator-max-microvolt = <1800000>;
598		};
599	};
600
601	pmi8994-regulators {
602		compatible = "qcom,rpm-pmi8994-regulators";
603
604		vdd_s1-supply = <&vph_pwr>;
605		vdd_s2-supply = <&vph_pwr>;
606		vdd_s3-supply = <&vph_pwr>;
607		vdd_bst_byp-supply = <&vph_pwr>;
608
609		vreg_s1b_1p025: s1 {
610			regulator-name = "vreg_s1b_1p025";
611			regulator-min-microvolt = <1025000>;
612			regulator-max-microvolt = <1025000>;
613		};
614
615		vph_pwr_bbyp: boost-bypass {
616			regulator-name = "vph_pwr_bbyp";
617			regulator-min-microvolt = <3150000>;
618			regulator-max-microvolt = <3600000>;
619		};
620	};
621};
622
623&pm8994_spmi_regulators {
624	qcom,saw-reg = <&saw3>;
625	s8 {
626		qcom,saw-slave;
627	};
628	s9 {
629		qcom,saw-slave;
630	};
631	s10 {
632		qcom,saw-slave;
633	};
634	vreg_apc_0p8: s11 {
635		qcom,saw-leader;
636		regulator-name = "vreg_apc_0p8";
637		regulator-min-microvolt = <470000>;
638		regulator-max-microvolt = <1140000>;
639		regulator-max-step-microvolt = <150000>;
640		regulator-always-on;
641	};
642};
643
644&pmi8994_spmi_regulators {
645	vdd_gfx: s2 {
646		regulator-name = "vdd_gfx";
647		regulator-min-microvolt = <400000>;
648		regulator-max-microvolt = <1015000>;
649		regulator-enable-ramp-delay = <500>;
650	};
651};
652
653&pm8994_gpios {
654	irled_default: irled-default-state {
655		pins = "gpio5";
656		function = PMIC_GPIO_FUNC_FUNC1;
657		output-low;
658		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
659		power-source = <PM8994_GPIO_S4>;
660		bias-disable;
661	};
662
663	wlan_en_default: wlan-en-state {
664		pins = "gpio8";
665		function = PMIC_GPIO_FUNC_NORMAL;
666		output-low;
667		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
668		power-source = <PM8994_GPIO_S4>;
669		bias-disable;
670	};
671
672	rome_enable_default: rome-enable-state {
673		pins = "gpio9";
674		function = PMIC_GPIO_FUNC_NORMAL;
675		output-high;
676		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
677		power-source = <PM8994_GPIO_VPH>;
678	};
679
680	divclk1_default: divclk1-state {
681		pins = "gpio15";
682		function = PMIC_GPIO_FUNC_FUNC1;
683		bias-disable;
684		power-source = <PM8994_GPIO_S4>;
685		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
686	};
687
688	divclk4_pin_a: divclk4-state {
689		pins = "gpio18";
690		function = PMIC_GPIO_FUNC_FUNC2;
691		bias-disable;
692		power-source = <PM8994_GPIO_S4>;
693	};
694};
695
696&tlmm {
697	mdss_dsi_default: mdss_dsi_default {
698		pins = "gpio8";
699		function = "gpio";
700		drive-strength = <8>;
701		bias-disable;
702	};
703
704	mdss_dsi_sleep: mdss_dsi_sleep {
705		pins = "gpio8";
706		function = "gpio";
707		drive-strength = <2>;
708		bias-pull-down;
709	};
710
711	mdss_te_default: mdss_te_default {
712		pins = "gpio10";
713		function = "mdp_vsync";
714		drive-strength = <2>;
715		bias-pull-down;
716	};
717
718	mdss_te_sleep: mdss_te_sleep {
719		pins = "gpio10";
720		function = "mdp_vsync";
721		drive-strength = <2>;
722		bias-pull-down;
723	};
724
725	nfc_default: nfc_default {
726		pins = "gpio12", "gpio21";
727		function = "gpio";
728		drive-strength = <16>;
729		bias-pull-up;
730	};
731};
732