1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * sc7280 IDP board device tree source (common between SKU1 and SKU2)
4 *
5 * Copyright (c) 2021, The Linux Foundation. All rights reserved.
6 */
7
8#include <dt-bindings/gpio/gpio.h>
9#include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
10#include <dt-bindings/input/linux-event-codes.h>
11#include "sc7280.dtsi"
12#include "pm7325.dtsi"
13#include "pm8350c.dtsi"
14#include "pmk8350.dtsi"
15
16/ {
17	gpio-keys {
18		compatible = "gpio-keys";
19		label = "gpio-keys";
20
21		pinctrl-names = "default";
22		pinctrl-0 = <&key_vol_up_default>;
23
24		volume-up {
25			label = "volume_up";
26			gpios = <&pm7325_gpios 6 GPIO_ACTIVE_LOW>;
27			linux,input-type = <1>;
28			linux,code = <KEY_VOLUMEUP>;
29			gpio-key,wakeup;
30			debounce-interval = <15>;
31			linux,can-disable;
32		};
33	};
34
35	nvme_3v3_regulator: nvme-3v3-regulator {
36		compatible = "regulator-fixed";
37		regulator-name = "VLDO_3V3";
38
39		regulator-min-microvolt = <3300000>;
40		regulator-max-microvolt = <3300000>;
41
42		enable-active-high;
43		pinctrl-names = "default";
44		pinctrl-0 = <&nvme_pwren>;
45	};
46};
47
48/*
49 * Reserved memory changes
50 *
51 * Delete all unused memory nodes and define the peripheral memory regions
52 * required by the board dts.
53 *
54 */
55
56/delete-node/ &hyp_mem;
57/delete-node/ &xbl_mem;
58/delete-node/ &reserved_xbl_uefi_log;
59/delete-node/ &sec_apps_mem;
60
61/* Increase the size from 2.5MB to 8MB */
62&rmtfs_mem {
63	reg = <0x0 0x9c900000 0x0 0x800000>;
64};
65
66/ {
67	reserved-memory {
68		adsp_mem: memory@86700000 {
69			reg = <0x0 0x86700000 0x0 0x2800000>;
70			no-map;
71		};
72
73		camera_mem: memory@8ad00000 {
74			reg = <0x0 0x8ad00000 0x0 0x500000>;
75			no-map;
76		};
77
78		venus_mem: memory@8b200000 {
79			reg = <0x0 0x8b200000 0x0 0x500000>;
80			no-map;
81		};
82
83		mpss_mem: memory@8b800000 {
84			reg = <0x0 0x8b800000 0x0 0xf600000>;
85			no-map;
86		};
87
88		wpss_mem: memory@9ae00000 {
89			reg = <0x0 0x9ae00000 0x0 0x1900000>;
90			no-map;
91		};
92
93		mba_mem: memory@9c700000 {
94			reg = <0x0 0x9c700000 0x0 0x200000>;
95			no-map;
96		};
97	};
98};
99
100&apps_rsc {
101	pm7325-regulators {
102		compatible = "qcom,pm7325-rpmh-regulators";
103		qcom,pmic-id = "b";
104
105		vreg_s1b_1p8: smps1 {
106			regulator-min-microvolt = <1856000>;
107			regulator-max-microvolt = <2040000>;
108		};
109
110		vreg_s7b_0p9: smps7 {
111			regulator-min-microvolt = <535000>;
112			regulator-max-microvolt = <1120000>;
113		};
114
115		vreg_s8b_1p2: smps8 {
116			regulator-min-microvolt = <1256000>;
117			regulator-max-microvolt = <1500000>;
118		};
119
120		vreg_l1b_0p8: ldo1 {
121			regulator-min-microvolt = <825000>;
122			regulator-max-microvolt = <925000>;
123		};
124
125		vreg_l2b_3p0: ldo2 {
126			regulator-min-microvolt = <2700000>;
127			regulator-max-microvolt = <3544000>;
128		};
129
130		vreg_l6b_1p2: ldo6 {
131			regulator-min-microvolt = <1140000>;
132			regulator-max-microvolt = <1260000>;
133		};
134
135		vreg_l7b_2p9: ldo7 {
136			regulator-min-microvolt = <2960000>;
137			regulator-max-microvolt = <2960000>;
138		};
139
140		vreg_l8b_0p9: ldo8 {
141			regulator-min-microvolt = <870000>;
142			regulator-max-microvolt = <970000>;
143		};
144
145		vreg_l9b_1p2: ldo9 {
146			regulator-min-microvolt = <1080000>;
147			regulator-max-microvolt = <1304000>;
148		};
149
150		vreg_l11b_1p7: ldo11 {
151			regulator-min-microvolt = <1504000>;
152			regulator-max-microvolt = <2000000>;
153		};
154
155		vreg_l12b_0p8: ldo12 {
156			regulator-min-microvolt = <751000>;
157			regulator-max-microvolt = <824000>;
158		};
159
160		vreg_l13b_0p8: ldo13 {
161			regulator-min-microvolt = <530000>;
162			regulator-max-microvolt = <824000>;
163		};
164
165		vreg_l14b_1p2: ldo14 {
166			regulator-min-microvolt = <1080000>;
167			regulator-max-microvolt = <1304000>;
168		};
169
170		vreg_l15b_0p8: ldo15 {
171			regulator-min-microvolt = <765000>;
172			regulator-max-microvolt = <1020000>;
173		};
174
175		vreg_l16b_1p2: ldo16 {
176			regulator-min-microvolt = <1100000>;
177			regulator-max-microvolt = <1300000>;
178		};
179
180		vreg_l17b_1p8: ldo17 {
181			regulator-min-microvolt = <1700000>;
182			regulator-max-microvolt = <1900000>;
183		};
184
185		vreg_l18b_1p8: ldo18 {
186			regulator-min-microvolt = <1800000>;
187			regulator-max-microvolt = <2000000>;
188		};
189
190		vreg_l19b_1p8: ldo19 {
191			regulator-min-microvolt = <1800000>;
192			regulator-max-microvolt = <1800000>;
193		};
194	};
195
196	pm8350c-regulators {
197		compatible = "qcom,pm8350c-rpmh-regulators";
198		qcom,pmic-id = "c";
199
200		vreg_s1c_2p2: smps1 {
201			regulator-min-microvolt = <2190000>;
202			regulator-max-microvolt = <2210000>;
203		};
204
205		vreg_s9c_1p0: smps9 {
206			regulator-min-microvolt = <1010000>;
207			regulator-max-microvolt = <1170000>;
208		};
209
210		vreg_l1c_1p8: ldo1 {
211			regulator-min-microvolt = <1800000>;
212			regulator-max-microvolt = <1980000>;
213		};
214
215		vreg_l2c_1p8: ldo2 {
216			regulator-min-microvolt = <1620000>;
217			regulator-max-microvolt = <1980000>;
218		};
219
220		vreg_l3c_3p0: ldo3 {
221			regulator-min-microvolt = <2800000>;
222			regulator-max-microvolt = <3540000>;
223		};
224
225		vreg_l4c_1p8: ldo4 {
226			regulator-min-microvolt = <1620000>;
227			regulator-max-microvolt = <3300000>;
228		};
229
230		vreg_l5c_1p8: ldo5 {
231			regulator-min-microvolt = <1620000>;
232			regulator-max-microvolt = <3300000>;
233		};
234
235		vreg_l6c_2p9: ldo6 {
236			regulator-min-microvolt = <1800000>;
237			regulator-max-microvolt = <2950000>;
238		};
239
240		vreg_l7c_3p0: ldo7 {
241			regulator-min-microvolt = <3000000>;
242			regulator-max-microvolt = <3544000>;
243		};
244
245		vreg_l8c_1p8: ldo8 {
246			regulator-min-microvolt = <1620000>;
247			regulator-max-microvolt = <2000000>;
248		};
249
250		vreg_l9c_2p9: ldo9 {
251			regulator-min-microvolt = <2960000>;
252			regulator-max-microvolt = <2960000>;
253		};
254
255		vreg_l10c_0p8: ldo10 {
256			regulator-min-microvolt = <720000>;
257			regulator-max-microvolt = <1050000>;
258		};
259
260		vreg_l11c_2p8: ldo11 {
261			regulator-min-microvolt = <2800000>;
262			regulator-max-microvolt = <3544000>;
263		};
264
265		vreg_l12c_1p8: ldo12 {
266			regulator-min-microvolt = <1650000>;
267			regulator-max-microvolt = <2000000>;
268		};
269
270		vreg_l13c_3p0: ldo13 {
271			regulator-min-microvolt = <2700000>;
272			regulator-max-microvolt = <3544000>;
273		};
274
275		vreg_bob: bob {
276			regulator-min-microvolt = <3008000>;
277			regulator-max-microvolt = <3960000>;
278		};
279	};
280};
281
282&ipa {
283	status = "okay";
284	modem-init;
285};
286
287&pcie1 {
288	status = "okay";
289	perst-gpio = <&tlmm 2 GPIO_ACTIVE_LOW>;
290
291	vddpe-3v3-supply = <&nvme_3v3_regulator>;
292
293	pinctrl-names = "default";
294	pinctrl-0 = <&pcie1_reset_n>, <&pcie1_wake_n>;
295};
296
297&pcie1_phy {
298	status = "okay";
299
300	vdda-phy-supply = <&vreg_l10c_0p8>;
301	vdda-pll-supply = <&vreg_l6b_1p2>;
302};
303
304&pmk8350_vadc {
305	pmk8350_die_temp {
306		reg = <PMK8350_ADC7_DIE_TEMP>;
307		label = "pmk8350_die_temp";
308		qcom,pre-scaling = <1 1>;
309	};
310};
311
312&qfprom {
313	vcc-supply = <&vreg_l1c_1p8>;
314};
315
316&qspi {
317	status = "okay";
318	pinctrl-names = "default";
319	pinctrl-0 = <&qspi_clk>, <&qspi_cs0>, <&qspi_data01>;
320
321	flash@0 {
322		compatible = "jedec,spi-nor";
323		reg = <0>;
324		spi-max-frequency = <37500000>;
325		spi-tx-bus-width = <2>;
326		spi-rx-bus-width = <2>;
327	};
328};
329
330&qupv3_id_0 {
331	status = "okay";
332};
333
334&qupv3_id_1 {
335	status = "okay";
336};
337
338&remoteproc_mpss {
339	status = "okay";
340	compatible = "qcom,sc7280-mss-pil";
341	iommus = <&apps_smmu 0x124 0x0>, <&apps_smmu 0x488 0x7>;
342	memory-region = <&mba_mem &mpss_mem>;
343};
344
345&sdhc_1 {
346	status = "okay";
347
348	pinctrl-names = "default", "sleep";
349	pinctrl-0 = <&sdc1_on>;
350	pinctrl-1 = <&sdc1_off>;
351
352	non-removable;
353	no-sd;
354	no-sdio;
355
356	vmmc-supply = <&vreg_l7b_2p9>;
357	vqmmc-supply = <&vreg_l19b_1p8>;
358};
359
360&sdhc_2 {
361	status = "okay";
362
363	pinctrl-names = "default", "sleep";
364	pinctrl-0 = <&sdc2_on>;
365	pinctrl-1 = <&sdc2_off>;
366
367	vmmc-supply = <&vreg_l9c_2p9>;
368	vqmmc-supply = <&vreg_l6c_2p9>;
369
370	cd-gpios = <&tlmm 91 GPIO_ACTIVE_LOW>;
371};
372
373&uart5 {
374	compatible = "qcom,geni-debug-uart";
375	status = "okay";
376};
377
378&usb_1 {
379	status = "okay";
380};
381
382&usb_1_dwc3 {
383	dr_mode = "host";
384};
385
386&usb_1_hsphy {
387	status = "okay";
388
389	vdda-pll-supply = <&vreg_l10c_0p8>;
390	vdda33-supply = <&vreg_l2b_3p0>;
391	vdda18-supply = <&vreg_l1c_1p8>;
392};
393
394&usb_1_qmpphy {
395	status = "okay";
396
397	vdda-phy-supply = <&vreg_l6b_1p2>;
398	vdda-pll-supply = <&vreg_l1b_0p8>;
399};
400
401&usb_2 {
402	status = "okay";
403};
404
405&usb_2_dwc3 {
406	dr_mode = "peripheral";
407};
408
409&usb_2_hsphy {
410	status = "okay";
411
412	vdda-pll-supply = <&vreg_l10c_0p8>;
413	vdda33-supply = <&vreg_l2b_3p0>;
414	vdda18-supply = <&vreg_l1c_1p8>;
415};
416
417&uart7 {
418	status = "okay";
419
420	/delete-property/interrupts;
421	interrupts-extended = <&intc GIC_SPI 608 IRQ_TYPE_LEVEL_HIGH>,
422				<&tlmm 31 IRQ_TYPE_EDGE_FALLING>;
423	pinctrl-names = "default", "sleep";
424	pinctrl-1 = <&qup_uart7_sleep_cts>, <&qup_uart7_sleep_rts>, <&qup_uart7_sleep_tx>, <&qup_uart7_sleep_rx>;
425};
426
427/* PINCTRL - additions to nodes defined in sc7280.dtsi */
428
429&pm7325_gpios {
430	key_vol_up_default: key-vol-up-default {
431		pins = "gpio6";
432		function = "normal";
433		input-enable;
434		bias-pull-up;
435		power-source = <0>;
436		qcom,drive-strength = <3>;
437	};
438};
439
440&qspi_cs0 {
441	bias-disable;
442};
443
444&qspi_clk {
445	bias-disable;
446};
447
448&qspi_data01 {
449	/* High-Z when no transfers; nice to park the lines */
450	bias-pull-up;
451};
452
453&qup_uart5_tx {
454	drive-strength = <2>;
455	bias-disable;
456};
457
458&qup_uart5_rx {
459	drive-strength = <2>;
460	bias-pull-up;
461};
462
463&qup_uart7_cts {
464	/*
465	 * Configure a pull-down on CTS to match the pull of
466	 * the Bluetooth module.
467	 */
468	bias-pull-down;
469};
470
471&qup_uart7_rts {
472	/* We'll drive RTS, so no pull */
473	drive-strength = <2>;
474	bias-disable;
475};
476
477&qup_uart7_tx {
478	/* We'll drive TX, so no pull */
479	drive-strength = <2>;
480	bias-disable;
481};
482
483&qup_uart7_rx {
484	/*
485	 * Configure a pull-up on RX. This is needed to avoid
486	 * garbage data when the TX pin of the Bluetooth module is
487	 * in tri-state (module powered off or not driving the
488	 * signal yet).
489	 */
490	bias-pull-up;
491};
492
493&tlmm {
494	nvme_pwren: nvme-pwren {
495		function = "gpio";
496	};
497
498	pcie1_reset_n: pcie1-reset-n {
499		pins = "gpio2";
500		function = "gpio";
501
502		drive-strength = <16>;
503		output-low;
504		bias-disable;
505	};
506
507	pcie1_wake_n: pcie1-wake-n {
508		pins = "gpio3";
509		function = "gpio";
510
511		drive-strength = <2>;
512		bias-pull-up;
513	};
514
515	qup_uart7_sleep_cts: qup-uart7-sleep-cts {
516		pins = "gpio28";
517		function = "gpio";
518		/*
519		 * Configure a pull-down on CTS to match the pull of
520		 * the Bluetooth module.
521		 */
522		bias-pull-down;
523	};
524
525	qup_uart7_sleep_rts: qup-uart7-sleep-rts {
526		pins = "gpio29";
527		function = "gpio";
528		/*
529		 * Configure pull-down on RTS. As RTS is active low
530		 * signal, pull it low to indicate the BT SoC that it
531		 * can wakeup the system anytime from suspend state by
532		 * pulling RX low (by sending wakeup bytes).
533		 */
534		bias-pull-down;
535	};
536
537	qup_uart7_sleep_tx: qup-uart7-sleep-tx {
538		pins = "gpio30";
539		function = "gpio";
540		/*
541		 * Configure pull-up on TX when it isn't actively driven
542		 * to prevent BT SoC from receiving garbage during sleep.
543		 */
544		bias-pull-up;
545	};
546
547	qup_uart7_sleep_rx: qup-uart7-sleep-rx {
548		pins = "gpio31";
549		function = "gpio";
550		/*
551		 * Configure a pull-up on RX. This is needed to avoid
552		 * garbage data when the TX pin of the Bluetooth module
553		 * is floating which may cause spurious wakeups.
554		 */
555		bias-pull-up;
556	};
557};
558
559&sdc1_on {
560	clk {
561		bias-disable;
562		drive-strength = <16>;
563	};
564
565	cmd {
566		bias-pull-up;
567		drive-strength = <10>;
568	};
569
570	data {
571		bias-pull-up;
572		drive-strength = <10>;
573	};
574
575	rclk {
576		bias-pull-down;
577	};
578};
579
580&sdc2_on {
581	clk {
582		bias-disable;
583		drive-strength = <16>;
584	};
585
586	cmd {
587		bias-pull-up;
588		drive-strength = <10>;
589	};
590
591	data {
592		bias-pull-up;
593		drive-strength = <10>;
594	};
595
596	sd-cd {
597		pins = "gpio91";
598		bias-pull-up;
599	};
600};
601