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 "sc7180.dtsi"
13#include "pm6150.dtsi"
14#include "pm6150l.dtsi"
15
16/ {
17	model = "Qualcomm Technologies, Inc. SC7180 IDP";
18	compatible = "qcom,sc7180-idp", "qcom,sc7180";
19
20	aliases {
21		bluetooth0 = &bluetooth;
22		hsuart0 = &uart3;
23		serial0 = &uart8;
24		wifi0 = &wifi;
25	};
26
27	chosen {
28		stdout-path = "serial0:115200n8";
29	};
30};
31
32/*
33 * Reserved memory changes
34 *
35 * Delete all unused memory nodes and define the peripheral memory regions
36 * required by the board dts.
37 *
38 */
39
40/delete-node/ &hyp_mem;
41/delete-node/ &xbl_mem;
42/delete-node/ &aop_mem;
43/delete-node/ &sec_apps_mem;
44/delete-node/ &tz_mem;
45
46/* Increase the size from 2MB to 8MB */
47&rmtfs_mem {
48	reg = <0x0 0x84400000 0x0 0x800000>;
49};
50
51/ {
52	reserved-memory {
53		atf_mem: memory@80b00000 {
54			reg = <0x0 0x80b00000 0x0 0x100000>;
55			no-map;
56		};
57
58		mpss_mem: memory@86000000 {
59			reg = <0x0 0x86000000 0x0 0x8c00000>;
60			no-map;
61		};
62
63		camera_mem: memory@8ec00000 {
64			reg = <0x0 0x8ec00000 0x0 0x500000>;
65			no-map;
66		};
67
68		venus_mem: memory@8f600000 {
69			reg = <0 0x8f600000 0 0x500000>;
70			no-map;
71		};
72
73		wlan_mem: memory@94100000 {
74			reg = <0x0 0x94100000 0x0 0x200000>;
75			no-map;
76		};
77
78		mba_mem: memory@94400000 {
79			reg = <0x0 0x94400000 0x0 0x200000>;
80			no-map;
81		};
82	};
83};
84
85&apps_rsc {
86	pm6150-rpmh-regulators {
87		compatible = "qcom,pm6150-rpmh-regulators";
88		qcom,pmic-id = "a";
89
90		vreg_s1a_1p1: smps1 {
91			regulator-min-microvolt = <1128000>;
92			regulator-max-microvolt = <1128000>;
93		};
94
95		vreg_s4a_1p0: smps4 {
96			regulator-min-microvolt = <824000>;
97			regulator-max-microvolt = <1120000>;
98		};
99
100		vreg_s5a_2p0: smps5 {
101			regulator-min-microvolt = <1744000>;
102			regulator-max-microvolt = <2040000>;
103		};
104
105		vreg_l1a_1p2: ldo1 {
106			regulator-min-microvolt = <1178000>;
107			regulator-max-microvolt = <1256000>;
108			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
109		};
110
111		vreg_l2a_1p0: ldo2 {
112			regulator-min-microvolt = <944000>;
113			regulator-max-microvolt = <1056000>;
114			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
115		};
116
117		vreg_l3a_1p0: ldo3 {
118			regulator-min-microvolt = <968000>;
119			regulator-max-microvolt = <1064000>;
120			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
121		};
122
123		vreg_l4a_0p8: ldo4 {
124			regulator-min-microvolt = <824000>;
125			regulator-max-microvolt = <928000>;
126			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
127		};
128
129		vreg_l5a_2p7: ldo5 {
130			regulator-min-microvolt = <2496000>;
131			regulator-max-microvolt = <3000000>;
132			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
133		};
134
135		vreg_l6a_0p6: ldo6 {
136			regulator-min-microvolt = <568000>;
137			regulator-max-microvolt = <648000>;
138			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
139		};
140
141		vreg_l9a_0p6: ldo9 {
142			regulator-min-microvolt = <488000>;
143			regulator-max-microvolt = <800000>;
144			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
145		};
146
147		vreg_l10a_1p8: ldo10 {
148			regulator-min-microvolt = <1800000>;
149			regulator-max-microvolt = <1832000>;
150			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
151		};
152
153		vreg_l11a_1p8: ldo11 {
154			regulator-min-microvolt = <1696000>;
155			regulator-max-microvolt = <1904000>;
156			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
157		};
158
159		vreg_l12a_1p8: ldo12 {
160			regulator-min-microvolt = <1800000>;
161			regulator-max-microvolt = <1800000>;
162			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
163		};
164
165		vreg_l13a_1p8: ldo13 {
166			regulator-min-microvolt = <1696000>;
167			regulator-max-microvolt = <1904000>;
168			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
169		};
170
171		vreg_l14a_1p8: ldo14 {
172			regulator-min-microvolt = <1728000>;
173			regulator-max-microvolt = <1832000>;
174			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
175		};
176
177		vreg_l15a_1p8: ldo15 {
178			regulator-min-microvolt = <1696000>;
179			regulator-max-microvolt = <1904000>;
180			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
181		};
182
183		vreg_l16a_2p7: ldo16 {
184			regulator-min-microvolt = <2496000>;
185			regulator-max-microvolt = <3304000>;
186			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
187		};
188
189		vreg_l17a_3p0: ldo17 {
190			regulator-min-microvolt = <2920000>;
191			regulator-max-microvolt = <3232000>;
192			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
193		};
194
195		vreg_l18a_2p8: ldo18 {
196			regulator-min-microvolt = <2496000>;
197			regulator-max-microvolt = <3304000>;
198			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
199		};
200
201		vreg_l19a_2p9: ldo19 {
202			regulator-min-microvolt = <2960000>;
203			regulator-max-microvolt = <2960000>;
204			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
205		};
206	};
207
208	pm6150l-rpmh-regulators {
209		compatible = "qcom,pm6150l-rpmh-regulators";
210		qcom,pmic-id = "c";
211
212		vreg_s8c_1p3: smps8 {
213			regulator-min-microvolt = <1120000>;
214			regulator-max-microvolt = <1408000>;
215		};
216
217		vreg_l1c_1p8: ldo1 {
218			regulator-min-microvolt = <1616000>;
219			regulator-max-microvolt = <1984000>;
220			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
221		};
222
223		vreg_l2c_1p3: ldo2 {
224			regulator-min-microvolt = <1168000>;
225			regulator-max-microvolt = <1304000>;
226			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
227		};
228
229		vreg_l3c_1p2: ldo3 {
230			regulator-min-microvolt = <1144000>;
231			regulator-max-microvolt = <1304000>;
232			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
233		};
234
235		vreg_l4c_1p8: ldo4 {
236			regulator-min-microvolt = <1648000>;
237			regulator-max-microvolt = <3304000>;
238			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
239		};
240
241		vreg_l5c_1p8: ldo5 {
242			regulator-min-microvolt = <1648000>;
243			regulator-max-microvolt = <3304000>;
244			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
245		};
246
247		vreg_l6c_2p9: ldo6 {
248			regulator-min-microvolt = <1800000>;
249			regulator-max-microvolt = <2950000>;
250			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
251		};
252
253		vreg_l7c_3p0: ldo7 {
254			regulator-min-microvolt = <3000000>;
255			regulator-max-microvolt = <3312000>;
256			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
257		};
258
259		vreg_l8c_1p8: ldo8 {
260			regulator-min-microvolt = <1800000>;
261			regulator-max-microvolt = <1904000>;
262			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
263		};
264
265		vreg_l9c_2p9: ldo9 {
266			regulator-min-microvolt = <2960000>;
267			regulator-max-microvolt = <2960000>;
268			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
269		};
270
271		vreg_l10c_3p3: ldo10 {
272			regulator-min-microvolt = <3000000>;
273			regulator-max-microvolt = <3400000>;
274			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
275		};
276
277		vreg_l11c_3p3: ldo11 {
278			regulator-min-microvolt = <3000000>;
279			regulator-max-microvolt = <3400000>;
280			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
281		};
282
283		vreg_bob: bob {
284			regulator-min-microvolt = <3008000>;
285			regulator-max-microvolt = <3960000>;
286			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
287		};
288	};
289};
290
291&qfprom {
292	vcc-supply = <&vreg_l11a_1p8>;
293};
294
295&qspi {
296	status = "okay";
297	pinctrl-names = "default";
298	pinctrl-0 = <&qspi_clk &qspi_cs0 &qspi_data01>;
299
300	flash@0 {
301		compatible = "jedec,spi-nor";
302		reg = <0>;
303		spi-max-frequency = <25000000>;
304		spi-tx-bus-width = <2>;
305		spi-rx-bus-width = <2>;
306	};
307};
308
309&qupv3_id_0 {
310	status = "okay";
311};
312
313&qupv3_id_1 {
314	status = "okay";
315};
316
317&remoteproc_mpss {
318	status = "okay";
319	compatible = "qcom,sc7180-mss-pil";
320	iommus = <&apps_smmu 0x461 0x0>, <&apps_smmu 0x444 0x3>;
321	memory-region = <&mba_mem &mpss_mem>;
322};
323
324&sdhc_1 {
325	status = "okay";
326
327	pinctrl-names = "default", "sleep";
328	pinctrl-0 = <&sdc1_on>;
329	pinctrl-1 = <&sdc1_off>;
330	vmmc-supply = <&vreg_l19a_2p9>;
331	vqmmc-supply = <&vreg_l12a_1p8>;
332};
333
334&sdhc_2 {
335	status = "okay";
336
337	pinctrl-names = "default","sleep";
338	pinctrl-0 = <&sdc2_on>;
339	pinctrl-1 = <&sdc2_off>;
340	vmmc-supply  = <&vreg_l9c_2p9>;
341	vqmmc-supply = <&vreg_l6c_2p9>;
342
343	cd-gpios = <&tlmm 69 GPIO_ACTIVE_LOW>;
344};
345
346&uart3 {
347	status = "okay";
348
349	/delete-property/interrupts;
350	interrupts-extended = <&intc GIC_SPI 604 IRQ_TYPE_LEVEL_HIGH>,
351				<&tlmm 41 IRQ_TYPE_EDGE_FALLING>;
352
353	pinctrl-names = "default", "sleep";
354	pinctrl-1 = <&qup_uart3_sleep>;
355
356	bluetooth: wcn3990-bt {
357		compatible = "qcom,wcn3990-bt";
358		vddio-supply = <&vreg_l10a_1p8>;
359		vddxo-supply = <&vreg_l1c_1p8>;
360		vddrf-supply = <&vreg_l2c_1p3>;
361		vddch0-supply = <&vreg_l10c_3p3>;
362		max-speed = <3200000>;
363	};
364};
365
366&uart8 {
367	status = "okay";
368};
369
370&usb_1 {
371	status = "okay";
372};
373
374&usb_1_dwc3 {
375	dr_mode = "host";
376};
377
378&usb_1_hsphy {
379	status = "okay";
380	vdd-supply = <&vreg_l4a_0p8>;
381	vdda-pll-supply = <&vreg_l11a_1p8>;
382	vdda-phy-dpdm-supply = <&vreg_l17a_3p0>;
383	qcom,imp-res-offset-value = <8>;
384	qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_15_PERCENT>;
385	qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
386	qcom,bias-ctrl-value = <0x22>;
387	qcom,charge-ctrl-value = <3>;
388	qcom,hsdisc-trim-value = <0>;
389};
390
391&usb_1_qmpphy {
392	status = "okay";
393	vdda-phy-supply = <&vreg_l3c_1p2>;
394	vdda-pll-supply = <&vreg_l4a_0p8>;
395};
396
397&venus {
398	video-firmware {
399		iommus = <&apps_smmu 0x0c42 0x0>;
400	};
401};
402
403&wifi {
404	status = "okay";
405	vdd-0.8-cx-mx-supply = <&vreg_l9a_0p6>;
406	vdd-1.8-xo-supply = <&vreg_l1c_1p8>;
407	vdd-1.3-rfa-supply = <&vreg_l2c_1p3>;
408	vdd-3.3-ch0-supply = <&vreg_l10c_3p3>;
409	vdd-3.3-ch1-supply = <&vreg_l11c_3p3>;
410	wifi-firmware {
411		iommus = <&apps_smmu 0xc2 0x1>;
412	};
413};
414
415/* PINCTRL - additions to nodes defined in sc7180.dtsi */
416
417&qspi_clk {
418	pinconf {
419		pins = "gpio63";
420		bias-disable;
421	};
422};
423
424&qspi_cs0 {
425	pinconf {
426		pins = "gpio68";
427		bias-disable;
428	};
429};
430
431&qspi_data01 {
432	pinconf {
433		pins = "gpio64", "gpio65";
434
435		/* High-Z when no transfers; nice to park the lines */
436		bias-pull-up;
437	};
438};
439
440&qup_i2c2_default {
441	pinconf {
442		pins = "gpio15", "gpio16";
443		drive-strength = <2>;
444
445		/* Has external pullup */
446		bias-disable;
447	};
448};
449
450&qup_i2c4_default {
451	pinconf {
452		pins = "gpio115", "gpio116";
453		drive-strength = <2>;
454
455		/* Has external pullup */
456		bias-disable;
457	};
458};
459
460&qup_i2c7_default {
461	pinconf {
462		pins = "gpio6", "gpio7";
463		drive-strength = <2>;
464
465		/* Has external pullup */
466		bias-disable;
467	};
468};
469
470&qup_i2c9_default {
471	pinconf {
472		pins = "gpio46", "gpio47";
473		drive-strength = <2>;
474
475		/* Has external pullup */
476		bias-disable;
477	};
478};
479
480&qup_uart3_default {
481	pinconf-cts {
482		/*
483		 * Configure a pull-down on CTS to match the pull of
484		 * the Bluetooth module.
485		 */
486		pins = "gpio38";
487		bias-pull-down;
488	};
489
490	pinconf-rts {
491		/* We'll drive RTS, so no pull */
492		pins = "gpio39";
493		drive-strength = <2>;
494		bias-disable;
495	};
496
497	pinconf-tx {
498		/* We'll drive TX, so no pull */
499		pins = "gpio40";
500		drive-strength = <2>;
501		bias-disable;
502	};
503
504	pinconf-rx {
505		/*
506		 * Configure a pull-up on RX. This is needed to avoid
507		 * garbage data when the TX pin of the Bluetooth module is
508		 * in tri-state (module powered off or not driving the
509		 * signal yet).
510		 */
511		pins = "gpio41";
512		bias-pull-up;
513	};
514};
515
516&qup_uart8_default {
517	pinconf-tx {
518		pins = "gpio44";
519		drive-strength = <2>;
520		bias-disable;
521	};
522
523	pinconf-rx {
524		pins = "gpio45";
525		drive-strength = <2>;
526		bias-pull-up;
527	};
528};
529
530&qup_spi0_default {
531	pinconf {
532		pins = "gpio34", "gpio35", "gpio36", "gpio37";
533		drive-strength = <2>;
534		bias-disable;
535	};
536};
537
538&qup_spi6_default {
539	pinconf {
540		pins = "gpio59", "gpio60", "gpio61", "gpio62";
541		drive-strength = <2>;
542		bias-disable;
543	};
544};
545
546&qup_spi10_default {
547	pinconf {
548		pins = "gpio86", "gpio87", "gpio88", "gpio89";
549		drive-strength = <2>;
550		bias-disable;
551	};
552};
553
554&tlmm {
555	qup_uart3_sleep: qup-uart3-sleep {
556		pinmux {
557			pins = "gpio38", "gpio39",
558			       "gpio40", "gpio41";
559			function = "gpio";
560		};
561
562		pinconf-cts {
563			/*
564			 * Configure a pull-down on CTS to match the pull of
565			 * the Bluetooth module.
566			 */
567			pins = "gpio38";
568			bias-pull-down;
569		};
570
571		pinconf-rts {
572			/*
573			 * Configure pull-down on RTS. As RTS is active low
574			 * signal, pull it low to indicate the BT SoC that it
575			 * can wakeup the system anytime from suspend state by
576			 * pulling RX low (by sending wakeup bytes).
577			 */
578			 pins = "gpio39";
579			 bias-pull-down;
580		};
581
582		pinconf-tx {
583			/*
584			 * Configure pull-up on TX when it isn't actively driven
585			 * to prevent BT SoC from receiving garbage during sleep.
586			 */
587			pins = "gpio40";
588			bias-pull-up;
589		};
590
591		pinconf-rx {
592			/*
593			 * Configure a pull-up on RX. This is needed to avoid
594			 * garbage data when the TX pin of the Bluetooth module
595			 * is floating which may cause spurious wakeups.
596			 */
597			pins = "gpio41";
598			bias-pull-up;
599		};
600	};
601};
602