1// SPDX-License-Identifier: GPL-2.0
2
3/dts-v1/;
4
5#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
6#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
7#include <dt-bindings/sound/qcom,q6afe.h>
8#include <dt-bindings/sound/qcom,q6asm.h>
9#include "sdm845.dtsi"
10#include "sdm845-wcd9340.dtsi"
11#include "pm8998.dtsi"
12#include "pmi8998.dtsi"
13
14/*
15 * Delete following upstream (sdm845.dtsi) reserved
16 * memory mappings which are different in this device.
17 */
18/delete-node/ &tz_mem;
19/delete-node/ &adsp_mem;
20/delete-node/ &wlan_msa_mem;
21/delete-node/ &mpss_region;
22/delete-node/ &venus_mem;
23/delete-node/ &cdsp_mem;
24/delete-node/ &mba_region;
25/delete-node/ &slpi_mem;
26/delete-node/ &spss_mem;
27/delete-node/ &rmtfs_mem;
28
29/ {
30	chassis-type = "handset";
31
32	/* required for bootloader to select correct board */
33	qcom,board-id = <69 0>;
34	qcom,msm-id = <321 0x20001>;
35
36	aliases {
37		serial1 = &uart6;
38	};
39
40	gpio-keys {
41		compatible = "gpio-keys";
42		autorepeat;
43
44		pinctrl-names = "default";
45		pinctrl-0 = <&vol_up_pin_a>;
46
47		key-vol-up {
48			label = "Volume Up";
49			linux,code = <KEY_VOLUMEUP>;
50			gpios = <&pm8998_gpios 6 GPIO_ACTIVE_LOW>;
51		};
52	};
53
54	/* Reserved memory changes from downstream */
55	reserved-memory {
56		tz_mem: memory@86200000 {
57			reg = <0 0x86200000 0 0x4900000>;
58			no-map;
59		};
60
61		adsp_mem: memory@8c500000 {
62			reg = <0 0x8c500000 0 0x1e00000>;
63			no-map;
64		};
65
66		wlan_msa_mem: memory@8e300000 {
67			reg = <0 0x8e300000 0 0x100000>;
68			no-map;
69		};
70
71		mpss_region: memory@8e400000 {
72			reg = <0 0x8e400000 0 0x7800000>;
73			no-map;
74		};
75
76		venus_mem: memory@95c00000 {
77			reg = <0 0x95c00000 0 0x500000>;
78			no-map;
79		};
80
81		cdsp_mem: memory@96100000 {
82			reg = <0 0x96100000 0 0x800000>;
83			no-map;
84		};
85
86		mba_region: memory@96900000 {
87			reg = <0 0x96900000 0 0x200000>;
88			no-map;
89		};
90
91		slpi_mem: memory@96b00000 {
92			reg = <0 0x96b00000 0 0x1400000>;
93			no-map;
94		};
95
96		spss_mem: memory@97f00000 {
97			reg = <0 0x97f00000 0 0x100000>;
98			no-map;
99		};
100
101		/* Cont splash region set up by the bootloader */
102		cont_splash_mem: framebuffer@9d400000 {
103			reg = <0 0x9d400000 0 0x2400000>;
104			no-map;
105		};
106
107		rmtfs_mem: memory@f6301000 {
108			compatible = "qcom,rmtfs-mem";
109			reg = <0 0xf6301000 0 0x200000>;
110			no-map;
111
112			qcom,client-id = <1>;
113			qcom,vmid = <15>;
114		};
115	};
116
117	vreg_s4a_1p8: vreg-s4a-1p8 {
118		compatible = "regulator-fixed";
119		regulator-name = "vreg_s4a_1p8";
120
121		regulator-min-microvolt = <1800000>;
122		regulator-max-microvolt = <1800000>;
123		regulator-always-on;
124	};
125};
126
127&adsp_pas {
128	status = "okay";
129	firmware-name = "qcom/sdm845/beryllium/adsp.mbn";
130};
131
132&apps_rsc {
133	regulators-0 {
134		compatible = "qcom,pm8998-rpmh-regulators";
135		qcom,pmic-id = "a";
136
137		vreg_l1a_0p875: ldo1 {
138			regulator-min-microvolt = <880000>;
139			regulator-max-microvolt = <880000>;
140			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
141		};
142
143		vreg_l5a_0p8: ldo5 {
144			regulator-min-microvolt = <800000>;
145			regulator-max-microvolt = <800000>;
146			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
147		};
148
149		vreg_l7a_1p8: ldo7 {
150			regulator-min-microvolt = <1800000>;
151			regulator-max-microvolt = <1800000>;
152			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
153		};
154
155		vreg_l12a_1p8: ldo12 {
156			regulator-min-microvolt = <1800000>;
157			regulator-max-microvolt = <1800000>;
158			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
159		};
160
161		vreg_l13a_2p95: ldo13 {
162			regulator-min-microvolt = <1800000>;
163			regulator-max-microvolt = <2960000>;
164			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
165		};
166
167		vreg_l14a_1p8: ldo14 {
168			regulator-min-microvolt = <1800000>;
169			regulator-max-microvolt = <1800000>;
170			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
171			regulator-boot-on;
172			regulator-always-on;
173		};
174
175		vreg_l17a_1p3: ldo17 {
176			regulator-min-microvolt = <1304000>;
177			regulator-max-microvolt = <1304000>;
178			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
179		};
180
181		vreg_l20a_2p95: ldo20 {
182			regulator-min-microvolt = <2960000>;
183			regulator-max-microvolt = <2968000>;
184			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
185		};
186
187		vreg_l21a_2p95: ldo21 {
188			regulator-min-microvolt = <2960000>;
189			regulator-max-microvolt = <2968000>;
190			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
191		};
192
193		vreg_l23a_3p3: ldo23 {
194			regulator-min-microvolt = <3300000>;
195			regulator-max-microvolt = <3312000>;
196			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
197		};
198
199		vreg_l24a_3p075: ldo24 {
200			regulator-min-microvolt = <3088000>;
201			regulator-max-microvolt = <3088000>;
202			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
203		};
204
205		vreg_l25a_3p3: ldo25 {
206			regulator-min-microvolt = <3300000>;
207			regulator-max-microvolt = <3312000>;
208			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
209		};
210
211		vreg_l26a_1p2: ldo26 {
212			regulator-min-microvolt = <1200000>;
213			regulator-max-microvolt = <1200000>;
214			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
215			regulator-boot-on;
216		};
217	};
218};
219
220&cdsp_pas {
221	status = "okay";
222	firmware-name = "qcom/sdm845/beryllium/cdsp.mbn";
223};
224
225&dsi0 {
226	status = "okay";
227	vdda-supply = <&vreg_l26a_1p2>;
228
229	display_panel: panel@0 {
230		reg = <0>;
231		vddio-supply = <&vreg_l14a_1p8>;
232		vddpos-supply = <&lab>;
233		vddneg-supply = <&ibb>;
234
235		#address-cells = <1>;
236		#size-cells = <0>;
237
238		backlight = <&pmi8998_wled>;
239		reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
240
241		status = "disabled";
242
243		port {
244			panel_in_0: endpoint {
245				remote-endpoint = <&dsi0_out>;
246			};
247		};
248	};
249};
250
251&dsi0_out {
252	remote-endpoint = <&panel_in_0>;
253	data-lanes = <0 1 2 3>;
254};
255
256&dsi0_phy {
257	status = "okay";
258	vdds-supply = <&vreg_l1a_0p875>;
259};
260
261&gcc {
262	protected-clocks = <GCC_QSPI_CORE_CLK>,
263			   <GCC_QSPI_CORE_CLK_SRC>,
264			   <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
265			   <GCC_LPASS_Q6_AXI_CLK>,
266			   <GCC_LPASS_SWAY_CLK>;
267};
268
269&gmu {
270	status = "okay";
271};
272
273&gpu {
274	status = "okay";
275
276	zap-shader {
277		memory-region = <&gpu_mem>;
278		firmware-name = "qcom/sdm845/beryllium/a630_zap.mbn";
279	};
280};
281
282&ibb {
283	regulator-min-microvolt = <4600000>;
284	regulator-max-microvolt = <6000000>;
285	regulator-over-current-protection;
286	regulator-pull-down;
287	regulator-soft-start;
288	qcom,discharge-resistor-kohms = <300>;
289};
290
291&lab {
292	regulator-min-microvolt = <4600000>;
293	regulator-max-microvolt = <6000000>;
294	regulator-over-current-protection;
295	regulator-pull-down;
296	regulator-soft-start;
297};
298
299&mdss {
300	status = "okay";
301};
302
303&mss_pil {
304	status = "okay";
305	firmware-name = "qcom/sdm845/beryllium/mba.mbn", "qcom/sdm845/beryllium/modem.mbn";
306};
307
308&ipa {
309	qcom,gsi-loader = "self";
310	memory-region = <&ipa_fw_mem>;
311	firmware-name = "qcom/sdm845/beryllium/ipa_fws.mbn";
312	status = "okay";
313};
314
315&pm8998_gpios {
316	vol_up_pin_a: vol-up-active-state {
317		pins = "gpio6";
318		function = "normal";
319		input-enable;
320		bias-pull-up;
321		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
322	};
323};
324
325&pmi8998_wled {
326	status = "okay";
327	qcom,current-boost-limit = <970>;
328	qcom,ovp-millivolt = <29600>;
329	qcom,current-limit-microamp = <20000>;
330	qcom,num-strings = <2>;
331	qcom,switching-freq = <600>;
332	qcom,external-pfet;
333	qcom,cabc;
334};
335
336&pm8998_resin {
337	linux,code = <KEY_VOLUMEDOWN>;
338	status = "okay";
339};
340
341&pmi8998_rradc {
342	status = "okay";
343};
344
345/* QUAT I2S Uses 1 I2S SD Line for audio on TAS2559/60 amplifiers */
346&q6afedai {
347	dai@22 {
348		reg = <QUATERNARY_MI2S_RX>;
349		qcom,sd-lines = <0>;
350	};
351};
352
353&q6asmdai {
354	dai@0 {
355		reg = <0>;
356	};
357
358	dai@1 {
359		reg = <1>;
360	};
361
362	dai@2 {
363		reg = <2>;
364	};
365};
366
367&qupv3_id_0 {
368	status = "okay";
369};
370
371&sdhc_2 {
372	status = "okay";
373
374	pinctrl-names = "default";
375	pinctrl-0 = <&sdc2_default_state &sdc2_card_det_n>;
376
377	vmmc-supply = <&vreg_l21a_2p95>;
378	vqmmc-supply = <&vreg_l13a_2p95>;
379
380	bus-width = <4>;
381	cd-gpios = <&tlmm 126 GPIO_ACTIVE_HIGH>;
382};
383
384&sound {
385	compatible = "qcom,db845c-sndcard", "qcom,sdm845-sndcard";
386	pinctrl-0 = <&quat_mi2s_active
387			&quat_mi2s_sd0_active>;
388	pinctrl-names = "default";
389	model = "Xiaomi Poco F1";
390	audio-routing =
391		"RX_BIAS", "MCLK",
392		"AMIC1", "MIC BIAS1",
393		"AMIC2", "MIC BIAS2",
394		"AMIC3", "MIC BIAS3";
395
396	mm1-dai-link {
397		link-name = "MultiMedia1";
398		cpu {
399			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA1>;
400		};
401	};
402
403	mm2-dai-link {
404		link-name = "MultiMedia2";
405		cpu {
406			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA2>;
407		};
408	};
409
410	mm3-dai-link {
411		link-name = "MultiMedia3";
412		cpu {
413			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
414		};
415	};
416
417	slim-dai-link {
418		link-name = "SLIM Playback";
419		cpu {
420			sound-dai = <&q6afedai SLIMBUS_0_RX>;
421		};
422
423		platform {
424			sound-dai = <&q6routing>;
425		};
426
427		codec {
428			sound-dai = <&wcd9340 0>;
429		};
430	};
431
432	slimcap-dai-link {
433		link-name = "SLIM Capture";
434		cpu {
435			sound-dai = <&q6afedai SLIMBUS_0_TX>;
436		};
437
438		platform {
439			sound-dai = <&q6routing>;
440		};
441
442		codec {
443			sound-dai = <&wcd9340 1>;
444		};
445	};
446};
447
448&tlmm {
449	gpio-reserved-ranges = <0 4>, <81 4>;
450
451	sdc2_default_state: sdc2-default-state {
452		clk-pins {
453			pins = "sdc2_clk";
454			bias-disable;
455			drive-strength = <16>;
456		};
457
458		cmd-pins {
459			pins = "sdc2_cmd";
460			bias-pull-up;
461			drive-strength = <10>;
462		};
463
464		data-pins {
465			pins = "sdc2_data";
466			bias-pull-up;
467			drive-strength = <10>;
468		};
469	};
470
471	sdc2_card_det_n: sd-card-det-n-state {
472		pins = "gpio126";
473		function = "gpio";
474		bias-pull-up;
475	};
476};
477
478&uart6 {
479	status = "okay";
480
481	pinctrl-0 = <&qup_uart6_4pin>;
482
483	bluetooth {
484		compatible = "qcom,wcn3990-bt";
485
486		vddio-supply = <&vreg_s4a_1p8>;
487		vddxo-supply = <&vreg_l7a_1p8>;
488		vddrf-supply = <&vreg_l17a_1p3>;
489		vddch0-supply = <&vreg_l25a_3p3>;
490		max-speed = <3200000>;
491	};
492};
493
494&ufs_mem_hc {
495	status = "okay";
496
497	reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
498
499	vcc-supply = <&vreg_l20a_2p95>;
500	vcc-max-microamp = <800000>;
501};
502
503&ufs_mem_phy {
504	status = "okay";
505
506	vdda-phy-supply = <&vreg_l1a_0p875>;
507	vdda-pll-supply = <&vreg_l26a_1p2>;
508};
509
510&usb_1 {
511	status = "okay";
512};
513
514&usb_1_dwc3 {
515	dr_mode = "peripheral";
516};
517
518&usb_1_hsphy {
519	status = "okay";
520
521	vdd-supply = <&vreg_l1a_0p875>;
522	vdda-pll-supply = <&vreg_l12a_1p8>;
523	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
524
525	qcom,imp-res-offset-value = <8>;
526	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
527	qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
528	qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
529};
530
531&usb_1_qmpphy {
532	status = "okay";
533
534	vdda-phy-supply = <&vreg_l26a_1p2>;
535	vdda-pll-supply = <&vreg_l1a_0p875>;
536};
537
538&venus {
539	status = "okay";
540	firmware-name = "qcom/sdm845/beryllium/venus.mbn";
541};
542
543&wcd9340 {
544	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
545	vdd-buck-supply = <&vreg_s4a_1p8>;
546	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
547	vdd-tx-supply = <&vreg_s4a_1p8>;
548	vdd-rx-supply = <&vreg_s4a_1p8>;
549	vdd-io-supply = <&vreg_s4a_1p8>;
550	qcom,micbias1-microvolt = <2700000>;
551	qcom,micbias2-microvolt = <1800000>;
552	qcom,micbias3-microvolt = <2700000>;
553	qcom,micbias4-microvolt = <2700000>;
554};
555
556&wifi {
557	status = "okay";
558
559	vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
560	vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
561	vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
562	vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
563	vdd-3.3-ch1-supply = <&vreg_l23a_3p3>;
564};
565