xref: /openbmc/linux/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi (revision 5ebfa90bdd3d78f4967dc0095daf755989a999e0)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * SDM845 OnePlus 6(T) (enchilada / fajita) common device tree source
4 *
5 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
6 */
7
8/dts-v1/;
9
10#include <dt-bindings/input/linux-event-codes.h>
11#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
12
13#include "sdm845.dtsi"
14#include "pm8998.dtsi"
15#include "pmi8998.dtsi"
16
17/delete-node/ &rmtfs_mem;
18
19/ {
20	aliases {
21		serial0 = &uart9;
22		serial1 = &uart6;
23	};
24
25	chosen {
26		stdout-path = "serial0:115200n8";
27	};
28
29	gpio-keys {
30		compatible = "gpio-keys";
31		label = "Volume keys";
32		autorepeat;
33
34		pinctrl-names = "default";
35		pinctrl-0 = <&volume_down_gpio &volume_up_gpio>;
36
37		key-vol-down {
38			label = "Volume down";
39			linux,code = <KEY_VOLUMEDOWN>;
40			gpios = <&pm8998_gpios 5 GPIO_ACTIVE_LOW>;
41			debounce-interval = <15>;
42		};
43
44		key-vol-up {
45			label = "Volume up";
46			linux,code = <KEY_VOLUMEUP>;
47			gpios = <&pm8998_gpios 6 GPIO_ACTIVE_LOW>;
48			debounce-interval = <15>;
49		};
50	};
51
52	reserved-memory {
53		/*
54		 * The rmtfs_mem needs to be guarded due to "XPU limitations"
55		 * it is otherwise possible for an allocation adjacent to the
56		 * rmtfs_mem region to trigger an XPU violation, causing a crash.
57		 */
58		rmtfs_lower_guard: rmtfs-lower-guard@f5b00000 {
59			no-map;
60			reg = <0 0xf5b00000 0 0x1000>;
61		};
62		/*
63		 * The rmtfs memory region in downstream is 'dynamically allocated'
64		 * but given the same address every time. Hard code it as this address is
65		 * where the modem firmware expects it to be.
66		 */
67		rmtfs_mem: rmtfs-mem@f5b01000 {
68			compatible = "qcom,rmtfs-mem";
69			reg = <0 0xf5b01000 0 0x200000>;
70			no-map;
71
72			qcom,client-id = <1>;
73			qcom,vmid = <15>;
74		};
75		rmtfs_upper_guard: rmtfs-upper-guard@f5d01000 {
76			no-map;
77			reg = <0 0xf5d01000 0 0x1000>;
78		};
79
80		/*
81		 * It seems like reserving the old rmtfs_mem region is also needed to prevent
82		 * random crashes which are most likely modem related, more testing needed.
83		 */
84		removed_region: removed-region@88f00000 {
85			no-map;
86			reg = <0 0x88f00000 0 0x1c00000>;
87		};
88
89		ramoops: ramoops@ac300000 {
90			compatible = "ramoops";
91			reg = <0 0xac300000 0 0x400000>;
92			record-size = <0x40000>;
93			console-size = <0x40000>;
94			ftrace-size = <0x40000>;
95			pmsg-size = <0x200000>;
96			ecc-size = <16>;
97		};
98	};
99
100	vph_pwr: vph-pwr-regulator {
101		compatible = "regulator-fixed";
102		regulator-name = "vph_pwr";
103		regulator-min-microvolt = <3700000>;
104		regulator-max-microvolt = <3700000>;
105	};
106
107	/*
108	 * Apparently RPMh does not provide support for PM8998 S4 because it
109	 * is always-on; model it as a fixed regulator.
110	 */
111	vreg_s4a_1p8: pm8998-smps4 {
112		compatible = "regulator-fixed";
113		regulator-name = "vreg_s4a_1p8";
114
115		regulator-min-microvolt = <1800000>;
116		regulator-max-microvolt = <1800000>;
117
118		regulator-always-on;
119		regulator-boot-on;
120
121		vin-supply = <&vph_pwr>;
122	};
123
124	/*
125	 * The touchscreen regulator seems to be controlled somehow by a gpio.
126	 * Model it as a fixed regulator and keep it on. Without schematics we
127	 * don't know how this is actually wired up...
128	 */
129	ts_1p8_supply: ts-1p8-regulator {
130		compatible = "regulator-fixed";
131		regulator-name = "ts_1p8_supply";
132
133		regulator-min-microvolt = <1800000>;
134		regulator-max-microvolt = <1800000>;
135
136		gpio = <&tlmm 88 0>;
137		enable-active-high;
138		regulator-boot-on;
139	};
140};
141
142&adsp_pas {
143	status = "okay";
144	firmware-name = "qcom/sdm845/oneplus6/adsp.mbn";
145};
146
147&apps_rsc {
148	pm8998-rpmh-regulators {
149		compatible = "qcom,pm8998-rpmh-regulators";
150		qcom,pmic-id = "a";
151
152		vdd-s1-supply = <&vph_pwr>;
153		vdd-s2-supply = <&vph_pwr>;
154		vdd-s3-supply = <&vph_pwr>;
155		vdd-s4-supply = <&vph_pwr>;
156		vdd-s5-supply = <&vph_pwr>;
157		vdd-s6-supply = <&vph_pwr>;
158		vdd-s7-supply = <&vph_pwr>;
159		vdd-s8-supply = <&vph_pwr>;
160		vdd-s9-supply = <&vph_pwr>;
161		vdd-s10-supply = <&vph_pwr>;
162		vdd-s11-supply = <&vph_pwr>;
163		vdd-s12-supply = <&vph_pwr>;
164		vdd-s13-supply = <&vph_pwr>;
165		vdd-l1-l27-supply = <&vreg_s7a_1p025>;
166		vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>;
167		vdd-l3-l11-supply = <&vreg_s7a_1p025>;
168		vdd-l4-l5-supply = <&vreg_s7a_1p025>;
169		vdd-l6-supply = <&vph_pwr>;
170		vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>;
171		vdd-l9-supply = <&vreg_bob>;
172		vdd-l10-l23-l25-supply = <&vreg_bob>;
173		vdd-l13-l19-l21-supply = <&vreg_bob>;
174		vdd-l16-l28-supply = <&vreg_bob>;
175		vdd-l18-l22-supply = <&vreg_bob>;
176		vdd-l20-l24-supply = <&vreg_bob>;
177		vdd-l26-supply = <&vreg_s3a_1p35>;
178		vin-lvs-1-2-supply = <&vreg_s4a_1p8>;
179
180		vreg_s3a_1p35: smps3 {
181			regulator-min-microvolt = <1352000>;
182			regulator-max-microvolt = <1352000>;
183		};
184
185		vreg_s5a_2p04: smps5 {
186			regulator-min-microvolt = <1904000>;
187			regulator-max-microvolt = <2040000>;
188		};
189
190		vreg_s7a_1p025: smps7 {
191			regulator-min-microvolt = <900000>;
192			regulator-max-microvolt = <1028000>;
193		};
194
195		vdda_mipi_dsi0_pll:
196		vdda_qlink_lv:
197		vdda_ufs1_core:
198		vdda_usb1_ss_core:
199		vreg_l1a_0p875: ldo1 {
200			regulator-min-microvolt = <880000>;
201			regulator-max-microvolt = <880000>;
202			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
203		};
204
205		vreg_l2a_1p2: ldo2 {
206			regulator-min-microvolt = <1200000>;
207			regulator-max-microvolt = <1200000>;
208			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
209			regulator-always-on;
210		};
211
212		vreg_l5a_0p8: ldo5 {
213			regulator-min-microvolt = <800000>;
214			regulator-max-microvolt = <800000>;
215			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
216		};
217
218		vreg_l7a_1p8: ldo7 {
219			regulator-min-microvolt = <1800000>;
220			regulator-max-microvolt = <1800000>;
221			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
222		};
223
224		vdda_qusb_hs0_1p8:
225		vreg_l12a_1p8: ldo12 {
226			regulator-min-microvolt = <1800000>;
227			regulator-max-microvolt = <1800000>;
228			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
229		};
230
231		vreg_l14a_1p88: ldo14 {
232			regulator-min-microvolt = <1800000>;
233			regulator-max-microvolt = <1800000>;
234			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
235			regulator-always-on;
236		};
237
238		vreg_l17a_1p3: ldo17 {
239			regulator-min-microvolt = <1304000>;
240			regulator-max-microvolt = <1304000>;
241			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
242		};
243
244		vreg_l20a_2p95: ldo20 {
245			regulator-min-microvolt = <2704000>;
246			regulator-max-microvolt = <2960000>;
247			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
248		};
249
250		vreg_l23a_3p3: ldo23 {
251			regulator-min-microvolt = <3300000>;
252			regulator-max-microvolt = <3312000>;
253			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
254		};
255
256		vdda_qusb_hs0_3p1:
257		vreg_l24a_3p075: ldo24 {
258			regulator-min-microvolt = <3088000>;
259			regulator-max-microvolt = <3088000>;
260			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
261		};
262
263		vreg_l25a_3p3: ldo25 {
264			regulator-min-microvolt = <3300000>;
265			regulator-max-microvolt = <3312000>;
266			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
267		};
268
269		vdda_mipi_dsi0_1p2:
270		vdda_ufs1_1p2:
271		vreg_l26a_1p2: ldo26 {
272			regulator-min-microvolt = <1200000>;
273			regulator-max-microvolt = <1200000>;
274			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
275		};
276
277		vreg_l28a_3p0: ldo28 {
278			regulator-min-microvolt = <2856000>;
279			regulator-max-microvolt = <3008000>;
280			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
281		};
282	};
283
284	pmi8998-rpmh-regulators {
285		compatible = "qcom,pmi8998-rpmh-regulators";
286		qcom,pmic-id = "b";
287
288		vdd-bob-supply = <&vph_pwr>;
289
290		vreg_bob: bob {
291			regulator-min-microvolt = <3312000>;
292			regulator-max-microvolt = <3600000>;
293			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
294			regulator-allow-bypass;
295		};
296	};
297
298	pm8005-rpmh-regulators {
299		compatible = "qcom,pm8005-rpmh-regulators";
300		qcom,pmic-id = "c";
301
302		vdd-s1-supply = <&vph_pwr>;
303		vdd-s2-supply = <&vph_pwr>;
304		vdd-s3-supply = <&vph_pwr>;
305		vdd-s4-supply = <&vph_pwr>;
306
307		vreg_s3c_0p6: smps3 {
308			regulator-min-microvolt = <600000>;
309			regulator-max-microvolt = <600000>;
310		};
311	};
312};
313
314&cdsp_pas {
315	status = "okay";
316	firmware-name = "qcom/sdm845/oneplus6/cdsp.mbn";
317};
318
319&dsi0 {
320	status = "okay";
321	vdda-supply = <&vdda_mipi_dsi0_1p2>;
322
323	/*
324	 * Both devices use different panels but all other properties
325	 * are common. Compatible line is declared in device dts.
326	 */
327	display_panel: panel@0 {
328		status = "disabled";
329
330		#address-cells = <1>;
331		#size-cells = <0>;
332		reg = <0>;
333
334		vddio-supply = <&vreg_l14a_1p88>;
335
336		reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
337
338		pinctrl-names = "default";
339		pinctrl-0 = <&panel_reset_pins &panel_te_pin &panel_esd_pin>;
340
341		port {
342			panel_in: endpoint {
343				remote-endpoint = <&dsi0_out>;
344			};
345		};
346	};
347};
348
349&dsi0_out {
350	remote-endpoint = <&panel_in>;
351	data-lanes = <0 1 2 3>;
352};
353
354&dsi0_phy {
355	status = "okay";
356	vdds-supply = <&vdda_mipi_dsi0_pll>;
357};
358
359&gcc {
360	protected-clocks = <GCC_QSPI_CORE_CLK>,
361				<GCC_QSPI_CORE_CLK_SRC>,
362				<GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
363				<GCC_LPASS_Q6_AXI_CLK>,
364				<GCC_LPASS_SWAY_CLK>;
365};
366
367&gmu {
368	status = "okay";
369};
370
371&gpu {
372	status = "okay";
373
374	zap-shader {
375		memory-region = <&gpu_mem>;
376		firmware-name = "qcom/sdm845/oneplus6/a630_zap.mbn";
377	};
378};
379
380&i2c10 {
381	status = "okay";
382	clock-frequency = <100000>;
383
384	bq27441_fg: bq27441-battery@55 {
385		compatible = "ti,bq27411";
386		status = "okay";
387		reg = <0x55>;
388	};
389};
390
391&i2c12 {
392	status = "okay";
393	clock-frequency = <400000>;
394
395	synaptics-rmi4-i2c@20 {
396		compatible = "syna,rmi4-i2c";
397		reg = <0x20>;
398		#address-cells = <1>;
399		#size-cells = <0>;
400		interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>;
401
402		pinctrl-names = "default";
403		pinctrl-0 = <&ts_default_pins>;
404
405		vdd-supply = <&vreg_l28a_3p0>;
406		vio-supply = <&ts_1p8_supply>;
407
408		syna,reset-delay-ms = <200>;
409		syna,startup-delay-ms = <200>;
410
411		rmi4-f01@1 {
412			reg = <0x01>;
413			syna,nosleep-mode = <1>;
414		};
415
416		rmi4_f12: rmi4-f12@12 {
417			reg = <0x12>;
418			touchscreen-x-mm = <68>;
419			touchscreen-y-mm = <144>;
420			syna,sensor-type = <1>;
421			syna,rezero-wait-ms = <200>;
422		};
423	};
424};
425
426&ipa {
427	qcom,gsi-loader = "self";
428	memory-region = <&ipa_fw_mem>;
429	firmware-name = "qcom/sdm845/oneplus6/ipa_fws.mbn";
430	status = "okay";
431};
432
433&mdss {
434	status = "okay";
435};
436
437/* Modem/wifi */
438&mss_pil {
439	status = "okay";
440	firmware-name = "qcom/sdm845/oneplus6/mba.mbn", "qcom/sdm845/oneplus6/modem.mbn";
441};
442
443&pm8998_gpios {
444	volume_down_gpio: pm8998-gpio5-state {
445		pinconf {
446			pins = "gpio5";
447			function = "normal";
448			input-enable;
449			bias-pull-up;
450			qcom,drive-strength = <0>;
451		};
452	};
453
454	volume_up_gpio: pm8998-gpio6-state {
455		pinconf {
456			pins = "gpio6";
457			function = "normal";
458			input-enable;
459			bias-pull-up;
460			qcom,drive-strength = <0>;
461		};
462	};
463};
464
465&pmi8998_rradc {
466	status = "okay";
467};
468
469&qupv3_id_1 {
470	status = "okay";
471};
472
473&qupv3_id_0 {
474	status = "okay";
475};
476
477&qup_i2c10_default {
478	drive-strength = <2>;
479	bias-disable;
480};
481
482&qup_i2c12_default {
483	drive-strength = <2>;
484	bias-disable;
485};
486
487&qup_uart9_rx {
488	drive-strength = <2>;
489	bias-pull-up;
490};
491
492&qup_uart9_tx {
493	drive-strength = <2>;
494	bias-disable;
495};
496
497&uart6 {
498	status = "okay";
499
500	pinctrl-0 = <&qup_uart6_4pin>;
501
502	bluetooth {
503		compatible = "qcom,wcn3990-bt";
504
505		/*
506		 * This path is relative to the qca/
507		 * subdir under lib/firmware.
508		 */
509		firmware-name = "oneplus6/crnv21.bin";
510
511		vddio-supply = <&vreg_s4a_1p8>;
512		vddxo-supply = <&vreg_l7a_1p8>;
513		vddrf-supply = <&vreg_l17a_1p3>;
514		vddch0-supply = <&vreg_l25a_3p3>;
515		max-speed = <3200000>;
516	};
517};
518
519&uart9 {
520	label = "LS-UART1";
521	status = "okay";
522};
523
524&ufs_mem_hc {
525	status = "okay";
526
527	reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
528
529	vcc-supply = <&vreg_l20a_2p95>;
530	vcc-max-microamp = <600000>;
531};
532
533&ufs_mem_phy {
534	status = "okay";
535
536	vdda-phy-supply = <&vdda_ufs1_core>;
537	vdda-pll-supply = <&vdda_ufs1_1p2>;
538};
539
540&usb_1 {
541	status = "okay";
542
543	/*
544	 * disable USB3 clock requirement as the device only supports
545	 * USB2.
546	 */
547	qcom,select-utmi-as-pipe-clk;
548};
549
550&usb_1_dwc3 {
551	/*
552	 * We don't have the capability to switch modes yet.
553	 */
554	dr_mode = "peripheral";
555
556	/* fastest mode for USB 2 */
557	maximum-speed = "high-speed";
558
559	/* Remove USB3 phy as it's unused on this device. */
560	phys = <&usb_1_hsphy>;
561	phy-names = "usb2-phy";
562};
563
564&usb_1_hsphy {
565	status = "okay";
566
567	vdd-supply = <&vdda_usb1_ss_core>;
568	vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
569	vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
570
571	qcom,imp-res-offset-value = <8>;
572	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
573	qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
574	qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
575};
576
577&tlmm {
578	gpio-reserved-ranges = <0 4>, <81 4>;
579
580	tri_state_key_default: tri-state-key-default-state {
581		pins = "gpio40", "gpio42", "gpio26";
582		function = "gpio";
583		drive-strength = <2>;
584		bias-disable;
585	};
586
587	ts_default_pins: ts-int-state {
588		pins = "gpio99", "gpio125";
589		function = "gpio";
590		drive-strength = <16>;
591		bias-pull-up;
592	};
593
594	panel_reset_pins: panel-reset-state {
595		pins = "gpio6", "gpio25", "gpio26";
596		function = "gpio";
597		drive-strength = <8>;
598		bias-disable;
599	};
600
601	panel_te_pin: panel-te-state {
602		pins = "gpio10";
603		function = "mdp_vsync";
604		drive-strength = <2>;
605		bias-disable;
606		input-enable;
607	};
608
609	panel_esd_pin: panel-esd-state {
610		pins = "gpio30";
611		function = "gpio";
612		drive-strength = <2>;
613		bias-pull-down;
614		input-enable;
615	};
616};
617
618&venus {
619	status = "okay";
620	firmware-name = "qcom/sdm845/oneplus6/venus.mbn";
621};
622
623&wifi {
624	status = "okay";
625	vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
626	vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
627	vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
628	vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
629	vdd-3.3-ch1-supply = <&vreg_l23a_3p3>;
630
631	qcom,snoc-host-cap-8bit-quirk;
632};
633