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