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