1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * SC7180 IDP board device tree source
4 *
5 * Copyright (c) 2019, The Linux Foundation. All rights reserved.
6 */
7
8/dts-v1/;
9
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
12#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
13#include "sc7180.dtsi"
14#include "pm6150.dtsi"
15#include "pm6150l.dtsi"
16
17/ {
18	model = "Qualcomm Technologies, Inc. SC7180 IDP";
19	compatible = "qcom,sc7180-idp", "qcom,sc7180";
20
21	aliases {
22		bluetooth0 = &bluetooth;
23		hsuart0 = &uart3;
24		serial0 = &uart8;
25		wifi0 = &wifi;
26	};
27
28	chosen {
29		stdout-path = "serial0:115200n8";
30	};
31};
32
33/*
34 * Reserved memory changes
35 *
36 * Delete all unused memory nodes and define the peripheral memory regions
37 * required by the board dts.
38 *
39 */
40
41/delete-node/ &hyp_mem;
42/delete-node/ &xbl_mem;
43/delete-node/ &aop_mem;
44/delete-node/ &sec_apps_mem;
45/delete-node/ &tz_mem;
46
47/* Increase the size from 2MB to 8MB */
48&rmtfs_mem {
49	reg = <0x0 0x94600000 0x0 0x800000>;
50};
51
52/ {
53	reserved-memory {
54		atf_mem: memory@80b00000 {
55			reg = <0x0 0x80b00000 0x0 0x100000>;
56			no-map;
57		};
58
59		mpss_mem: memory@86000000 {
60			reg = <0x0 0x86000000 0x0 0x8c00000>;
61			no-map;
62		};
63
64		camera_mem: memory@8ec00000 {
65			reg = <0x0 0x8ec00000 0x0 0x500000>;
66			no-map;
67		};
68
69		venus_mem: memory@8f600000 {
70			reg = <0 0x8f600000 0 0x500000>;
71			no-map;
72		};
73
74		wlan_mem: memory@94100000 {
75			reg = <0x0 0x94100000 0x0 0x200000>;
76			no-map;
77		};
78
79		mba_mem: memory@94400000 {
80			reg = <0x0 0x94400000 0x0 0x200000>;
81			no-map;
82		};
83	};
84};
85
86&apps_rsc {
87	pm6150-rpmh-regulators {
88		compatible = "qcom,pm6150-rpmh-regulators";
89		qcom,pmic-id = "a";
90
91		vreg_s1a_1p1: smps1 {
92			regulator-min-microvolt = <1128000>;
93			regulator-max-microvolt = <1128000>;
94		};
95
96		vreg_s4a_1p0: smps4 {
97			regulator-min-microvolt = <824000>;
98			regulator-max-microvolt = <1120000>;
99		};
100
101		vreg_s5a_2p0: smps5 {
102			regulator-min-microvolt = <1744000>;
103			regulator-max-microvolt = <2040000>;
104		};
105
106		vreg_l1a_1p2: ldo1 {
107			regulator-min-microvolt = <1178000>;
108			regulator-max-microvolt = <1256000>;
109			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
110		};
111
112		vreg_l2a_1p0: ldo2 {
113			regulator-min-microvolt = <944000>;
114			regulator-max-microvolt = <1056000>;
115			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
116		};
117
118		vreg_l3a_1p0: ldo3 {
119			regulator-min-microvolt = <968000>;
120			regulator-max-microvolt = <1064000>;
121			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
122		};
123
124		vreg_l4a_0p8: ldo4 {
125			regulator-min-microvolt = <824000>;
126			regulator-max-microvolt = <928000>;
127			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
128		};
129
130		vreg_l5a_2p7: ldo5 {
131			regulator-min-microvolt = <2496000>;
132			regulator-max-microvolt = <3000000>;
133			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
134		};
135
136		vreg_l6a_0p6: ldo6 {
137			regulator-min-microvolt = <568000>;
138			regulator-max-microvolt = <648000>;
139			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
140		};
141
142		vreg_l9a_0p6: ldo9 {
143			regulator-min-microvolt = <488000>;
144			regulator-max-microvolt = <800000>;
145			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
146		};
147
148		vreg_l10a_1p8: ldo10 {
149			regulator-min-microvolt = <1800000>;
150			regulator-max-microvolt = <1832000>;
151			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
152		};
153
154		vreg_l11a_1p8: ldo11 {
155			regulator-min-microvolt = <1696000>;
156			regulator-max-microvolt = <1904000>;
157			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
158		};
159
160		vreg_l12a_1p8: ldo12 {
161			regulator-min-microvolt = <1800000>;
162			regulator-max-microvolt = <1800000>;
163			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
164		};
165
166		vreg_l13a_1p8: ldo13 {
167			regulator-min-microvolt = <1696000>;
168			regulator-max-microvolt = <1904000>;
169			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
170		};
171
172		vreg_l14a_1p8: ldo14 {
173			regulator-min-microvolt = <1728000>;
174			regulator-max-microvolt = <1832000>;
175			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
176		};
177
178		vreg_l15a_1p8: ldo15 {
179			regulator-min-microvolt = <1696000>;
180			regulator-max-microvolt = <1904000>;
181			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
182		};
183
184		vreg_l16a_2p7: ldo16 {
185			regulator-min-microvolt = <2496000>;
186			regulator-max-microvolt = <3304000>;
187			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
188		};
189
190		vreg_l17a_3p0: ldo17 {
191			regulator-min-microvolt = <2920000>;
192			regulator-max-microvolt = <3232000>;
193			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
194		};
195
196		vreg_l18a_2p8: ldo18 {
197			regulator-min-microvolt = <2496000>;
198			regulator-max-microvolt = <3304000>;
199			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
200		};
201
202		vreg_l19a_2p9: ldo19 {
203			regulator-min-microvolt = <2960000>;
204			regulator-max-microvolt = <2960000>;
205			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
206		};
207	};
208
209	pm6150l-rpmh-regulators {
210		compatible = "qcom,pm6150l-rpmh-regulators";
211		qcom,pmic-id = "c";
212
213		vreg_s8c_1p3: smps8 {
214			regulator-min-microvolt = <1120000>;
215			regulator-max-microvolt = <1408000>;
216		};
217
218		vreg_l1c_1p8: ldo1 {
219			regulator-min-microvolt = <1616000>;
220			regulator-max-microvolt = <1984000>;
221			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
222		};
223
224		vreg_l2c_1p3: ldo2 {
225			regulator-min-microvolt = <1168000>;
226			regulator-max-microvolt = <1304000>;
227			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
228		};
229
230		vreg_l3c_1p2: ldo3 {
231			regulator-min-microvolt = <1144000>;
232			regulator-max-microvolt = <1304000>;
233			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
234		};
235
236		vreg_l4c_1p8: ldo4 {
237			regulator-min-microvolt = <1648000>;
238			regulator-max-microvolt = <3304000>;
239			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
240		};
241
242		vreg_l5c_1p8: ldo5 {
243			regulator-min-microvolt = <1648000>;
244			regulator-max-microvolt = <3304000>;
245			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
246		};
247
248		vreg_l6c_2p9: ldo6 {
249			regulator-min-microvolt = <1800000>;
250			regulator-max-microvolt = <2950000>;
251			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
252		};
253
254		vreg_l7c_3p0: ldo7 {
255			regulator-min-microvolt = <3000000>;
256			regulator-max-microvolt = <3312000>;
257			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
258		};
259
260		vreg_l8c_1p8: ldo8 {
261			regulator-min-microvolt = <1800000>;
262			regulator-max-microvolt = <1904000>;
263			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
264		};
265
266		vreg_l9c_2p9: ldo9 {
267			regulator-min-microvolt = <2960000>;
268			regulator-max-microvolt = <2960000>;
269			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
270		};
271
272		vreg_l10c_3p3: ldo10 {
273			regulator-min-microvolt = <3000000>;
274			regulator-max-microvolt = <3400000>;
275			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
276		};
277
278		vreg_l11c_3p3: ldo11 {
279			regulator-min-microvolt = <3000000>;
280			regulator-max-microvolt = <3400000>;
281			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
282		};
283
284		vreg_bob: bob {
285			regulator-min-microvolt = <3008000>;
286			regulator-max-microvolt = <3960000>;
287			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
288		};
289	};
290};
291
292&dsi0 {
293	status = "okay";
294
295	vdda-supply = <&vreg_l3c_1p2>;
296
297	panel@0 {
298		compatible = "visionox,rm69299-1080p-display";
299		reg = <0>;
300
301		vdda-supply = <&vreg_l8c_1p8>;
302		vdd3p3-supply = <&vreg_l18a_2p8>;
303
304		pinctrl-names = "default";
305		pinctrl-0 = <&disp_pins>;
306
307		reset-gpios = <&pm6150l_gpio 3 GPIO_ACTIVE_HIGH>;
308
309		ports {
310			#address-cells = <1>;
311			#size-cells = <0>;
312			port@0 {
313				reg = <0>;
314				panel0_in: endpoint {
315					remote-endpoint = <&dsi0_out>;
316				};
317			};
318		};
319	};
320
321	ports {
322		port@1 {
323			endpoint {
324				remote-endpoint = <&panel0_in>;
325				data-lanes = <0 1 2 3>;
326			};
327		};
328	};
329};
330
331&dsi_phy {
332	status = "okay";
333	vdds-supply = <&vreg_l4a_0p8>;
334};
335
336&mdp {
337	status = "okay";
338};
339
340&mdss {
341	status = "okay";
342};
343
344&qfprom {
345	vcc-supply = <&vreg_l11a_1p8>;
346};
347
348&qspi {
349	status = "okay";
350	pinctrl-names = "default";
351	pinctrl-0 = <&qspi_clk &qspi_cs0 &qspi_data01>;
352
353	flash@0 {
354		compatible = "jedec,spi-nor";
355		reg = <0>;
356		spi-max-frequency = <25000000>;
357		spi-tx-bus-width = <2>;
358		spi-rx-bus-width = <2>;
359	};
360};
361
362&qupv3_id_0 {
363	status = "okay";
364};
365
366&qupv3_id_1 {
367	status = "okay";
368};
369
370&remoteproc_mpss {
371	status = "okay";
372	compatible = "qcom,sc7180-mss-pil";
373	iommus = <&apps_smmu 0x461 0x0>, <&apps_smmu 0x444 0x3>;
374	memory-region = <&mba_mem &mpss_mem>;
375};
376
377&sdhc_1 {
378	status = "okay";
379
380	pinctrl-names = "default", "sleep";
381	pinctrl-0 = <&sdc1_on>;
382	pinctrl-1 = <&sdc1_off>;
383	vmmc-supply = <&vreg_l19a_2p9>;
384	vqmmc-supply = <&vreg_l12a_1p8>;
385};
386
387&sdhc_2 {
388	status = "okay";
389
390	pinctrl-names = "default","sleep";
391	pinctrl-0 = <&sdc2_on>;
392	pinctrl-1 = <&sdc2_off>;
393	vmmc-supply = <&vreg_l9c_2p9>;
394	vqmmc-supply = <&vreg_l6c_2p9>;
395
396	cd-gpios = <&tlmm 69 GPIO_ACTIVE_LOW>;
397};
398
399&uart3 {
400	status = "okay";
401
402	/delete-property/interrupts;
403	interrupts-extended = <&intc GIC_SPI 604 IRQ_TYPE_LEVEL_HIGH>,
404				<&tlmm 41 IRQ_TYPE_EDGE_FALLING>;
405
406	pinctrl-names = "default", "sleep";
407	pinctrl-1 = <&qup_uart3_sleep>;
408
409	bluetooth: wcn3990-bt {
410		compatible = "qcom,wcn3990-bt";
411		vddio-supply = <&vreg_l10a_1p8>;
412		vddxo-supply = <&vreg_l1c_1p8>;
413		vddrf-supply = <&vreg_l2c_1p3>;
414		vddch0-supply = <&vreg_l10c_3p3>;
415		max-speed = <3200000>;
416	};
417};
418
419&uart8 {
420	status = "okay";
421};
422
423&usb_1 {
424	status = "okay";
425};
426
427&usb_1_dwc3 {
428	dr_mode = "host";
429};
430
431&usb_1_hsphy {
432	status = "okay";
433	vdd-supply = <&vreg_l4a_0p8>;
434	vdda-pll-supply = <&vreg_l11a_1p8>;
435	vdda-phy-dpdm-supply = <&vreg_l17a_3p0>;
436	qcom,imp-res-offset-value = <8>;
437	qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_15_PERCENT>;
438	qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
439	qcom,bias-ctrl-value = <0x22>;
440	qcom,charge-ctrl-value = <3>;
441	qcom,hsdisc-trim-value = <0>;
442};
443
444&usb_1_qmpphy {
445	status = "okay";
446	vdda-phy-supply = <&vreg_l3c_1p2>;
447	vdda-pll-supply = <&vreg_l4a_0p8>;
448};
449
450&venus {
451	video-firmware {
452		iommus = <&apps_smmu 0x0c42 0x0>;
453	};
454};
455
456&wifi {
457	status = "okay";
458	vdd-0.8-cx-mx-supply = <&vreg_l9a_0p6>;
459	vdd-1.8-xo-supply = <&vreg_l1c_1p8>;
460	vdd-1.3-rfa-supply = <&vreg_l2c_1p3>;
461	vdd-3.3-ch0-supply = <&vreg_l10c_3p3>;
462	vdd-3.3-ch1-supply = <&vreg_l11c_3p3>;
463	wifi-firmware {
464		iommus = <&apps_smmu 0xc2 0x1>;
465	};
466};
467
468/* PINCTRL - additions to nodes defined in sc7180.dtsi */
469
470&pm6150l_gpio {
471	disp_pins: disp-state {
472		pinconf {
473			pins = "gpio3";
474			function = PMIC_GPIO_FUNC_FUNC1;
475			qcom,drive-strength = <PMIC_GPIO_STRENGTH_MED>;
476			power-source = <0>;
477			bias-disable;
478			output-low;
479		};
480	};
481};
482
483&qspi_clk {
484	bias-disable;
485};
486
487&qspi_cs0 {
488	bias-disable;
489};
490
491&qspi_data01 {
492	/* High-Z when no transfers; nice to park the lines */
493	bias-pull-up;
494};
495
496&qup_i2c2_default {
497	drive-strength = <2>;
498
499	/* Has external pullup */
500	bias-disable;
501};
502
503&qup_i2c4_default {
504	drive-strength = <2>;
505
506	/* Has external pullup */
507	bias-disable;
508};
509
510&qup_i2c7_default {
511	drive-strength = <2>;
512
513	/* Has external pullup */
514	bias-disable;
515};
516
517&qup_i2c9_default {
518	drive-strength = <2>;
519
520	/* Has external pullup */
521	bias-disable;
522};
523
524&qup_uart3_cts {
525	/*
526	 * Configure a pull-down on CTS to match the pull of
527	 * the Bluetooth module.
528	 */
529	bias-pull-down;
530};
531
532&qup_uart3_rts {
533	/* We'll drive RTS, so no pull */
534	drive-strength = <2>;
535	bias-disable;
536};
537
538&qup_uart3_tx {
539	/* We'll drive TX, so no pull */
540	drive-strength = <2>;
541	bias-disable;
542};
543
544&qup_uart3_rx {
545	/*
546	 * Configure a pull-up on RX. This is needed to avoid
547	 * garbage data when the TX pin of the Bluetooth module is
548	 * in tri-state (module powered off or not driving the
549	 * signal yet).
550	 */
551	bias-pull-up;
552};
553
554&qup_uart8_tx {
555	drive-strength = <2>;
556	bias-disable;
557};
558
559&qup_uart8_rx {
560	drive-strength = <2>;
561	bias-pull-up;
562};
563
564&qup_spi0_spi {
565	drive-strength = <2>;
566	bias-disable;
567};
568
569&qup_spi0_cs {
570	drive-strength = <2>;
571	bias-disable;
572};
573
574&qup_spi6_spi {
575	drive-strength = <2>;
576	bias-disable;
577};
578
579&qup_spi6_cs {
580	drive-strength = <2>;
581	bias-disable;
582};
583
584&qup_spi10_spi {
585	drive-strength = <2>;
586	bias-disable;
587};
588
589&qup_spi10_cs {
590	drive-strength = <2>;
591	bias-disable;
592};
593
594&tlmm {
595	qup_uart3_sleep: qup-uart3-sleep-state {
596		cts-pins {
597			/*
598			 * Configure a pull-down on CTS to match the pull of
599			 * the Bluetooth module.
600			 */
601			pins = "gpio38";
602			function = "gpio";
603			bias-pull-down;
604		};
605
606		rts-pins {
607			/*
608			 * Configure pull-down on RTS. As RTS is active low
609			 * signal, pull it low to indicate the BT SoC that it
610			 * can wakeup the system anytime from suspend state by
611			 * pulling RX low (by sending wakeup bytes).
612			 */
613			pins = "gpio39";
614			function = "gpio";
615			bias-pull-down;
616		};
617
618		tx-pins {
619			/*
620			 * Configure pull-up on TX when it isn't actively driven
621			 * to prevent BT SoC from receiving garbage during sleep.
622			 */
623			pins = "gpio40";
624			function = "gpio";
625			bias-pull-up;
626		};
627
628		rx-pins {
629			/*
630			 * Configure a pull-up on RX. This is needed to avoid
631			 * garbage data when the TX pin of the Bluetooth module
632			 * is floating which may cause spurious wakeups.
633			 */
634			pins = "gpio41";
635			function = "gpio";
636			bias-pull-up;
637		};
638	};
639
640	sdc1_on: sdc1-on-state {
641		clk-pins {
642			pins = "sdc1_clk";
643			bias-disable;
644			drive-strength = <16>;
645		};
646
647		cmd-pins {
648			pins = "sdc1_cmd";
649			bias-pull-up;
650			drive-strength = <10>;
651		};
652
653		data-pins {
654			pins = "sdc1_data";
655			bias-pull-up;
656			drive-strength = <10>;
657		};
658
659		rclk-pins {
660			pins = "sdc1_rclk";
661			bias-pull-down;
662		};
663	};
664
665	sdc1_off: sdc1-off-state {
666		clk-pins {
667			pins = "sdc1_clk";
668			bias-disable;
669			drive-strength = <2>;
670		};
671
672		cmd-pins {
673			pins = "sdc1_cmd";
674			bias-pull-up;
675			drive-strength = <2>;
676		};
677
678		data-pins {
679			pins = "sdc1_data";
680			bias-pull-up;
681			drive-strength = <2>;
682		};
683
684		rclk-pins {
685			pins = "sdc1_rclk";
686			bias-pull-down;
687		};
688	};
689
690	sdc2_on: sdc2-on-state {
691		clk-pins {
692			pins = "sdc2_clk";
693			bias-disable;
694			drive-strength = <16>;
695		};
696
697		cmd-pins {
698			pins = "sdc2_cmd";
699			bias-pull-up;
700			drive-strength = <10>;
701		};
702
703		data-pins {
704			pins = "sdc2_data";
705			bias-pull-up;
706			drive-strength = <10>;
707		};
708
709		sd-cd-pins {
710			pins = "gpio69";
711			function = "gpio";
712			bias-pull-up;
713			drive-strength = <2>;
714		};
715	};
716
717	sdc2_off: sdc2-off-state {
718		clk-pins {
719			pins = "sdc2_clk";
720			bias-disable;
721			drive-strength = <2>;
722		};
723
724		cmd-pins {
725			pins = "sdc2_cmd";
726			bias-pull-up;
727			drive-strength = <2>;
728		};
729
730		data-pins {
731			pins = "sdc2_data";
732			bias-pull-up;
733			drive-strength = <2>;
734		};
735
736		sd-cd-pins {
737			pins = "gpio69";
738			function = "gpio";
739			bias-pull-up;
740			drive-strength = <2>;
741		};
742	};
743};
744