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