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