1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2021, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2022, Linaro Limited
5 */
6
7/dts-v1/;
8
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
11
12#include "sc8280xp.dtsi"
13#include "sc8280xp-pmics.dtsi"
14
15/ {
16	model = "Qualcomm SC8280XP CRD";
17	compatible = "qcom,sc8280xp-crd", "qcom,sc8280xp";
18
19	aliases {
20		serial0 = &qup2_uart17;
21	};
22
23	backlight {
24		compatible = "pwm-backlight";
25		pwms = <&pmc8280c_lpg 3 1000000>;
26		enable-gpios = <&pmc8280_1_gpios 8 GPIO_ACTIVE_HIGH>;
27		power-supply = <&vreg_edp_bl>;
28
29		pinctrl-names = "default";
30		pinctrl-0 = <&edp_bl_en>, <&edp_bl_pwm>;
31	};
32
33	chosen {
34		stdout-path = "serial0:115200n8";
35	};
36
37	vreg_edp_bl: regulator-edp-bl {
38		compatible = "regulator-fixed";
39
40		regulator-name = "VREG_EDP_BL";
41		regulator-min-microvolt = <3600000>;
42		regulator-max-microvolt = <3600000>;
43
44		gpio = <&pmc8280_1_gpios 9 GPIO_ACTIVE_HIGH>;
45		enable-active-high;
46
47		pinctrl-names = "default";
48		pinctrl-0 = <&edp_bl_reg_en>;
49
50		regulator-boot-on;
51	};
52
53	vreg_misc_3p3: regulator-misc-3p3 {
54		compatible = "regulator-fixed";
55
56		regulator-name = "VREG_MISC_3P3";
57		regulator-min-microvolt = <3300000>;
58		regulator-max-microvolt = <3300000>;
59
60		gpio = <&pmc8280_1_gpios 1 GPIO_ACTIVE_HIGH>;
61		enable-active-high;
62
63		pinctrl-names = "default";
64		pinctrl-0 = <&misc_3p3_reg_en>;
65
66		regulator-boot-on;
67		regulator-always-on;
68	};
69};
70
71&apps_rsc {
72	pmc8280-1-rpmh-regulators {
73		compatible = "qcom,pm8350-rpmh-regulators";
74		qcom,pmic-id = "b";
75
76		vdd-l3-l5-supply = <&vreg_s11b>;
77
78		vreg_s11b: smps11 {
79			regulator-name = "vreg_s11b";
80			regulator-min-microvolt = <1272000>;
81			regulator-max-microvolt = <1272000>;
82			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
83		};
84
85		vreg_l3b: ldo3 {
86			regulator-name = "vreg_l3b";
87			regulator-min-microvolt = <1200000>;
88			regulator-max-microvolt = <1200000>;
89			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
90			regulator-boot-on;
91			regulator-always-on;
92		};
93
94		vreg_l4b: ldo4 {
95			regulator-name = "vreg_l4b";
96			regulator-min-microvolt = <912000>;
97			regulator-max-microvolt = <912000>;
98			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
99		};
100
101		vreg_l6b: ldo6 {
102			regulator-name = "vreg_l6b";
103			regulator-min-microvolt = <880000>;
104			regulator-max-microvolt = <880000>;
105			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
106			regulator-boot-on;
107		};
108	};
109
110	pmc8280c-rpmh-regulators {
111		compatible = "qcom,pm8350c-rpmh-regulators";
112		qcom,pmic-id = "c";
113
114		vreg_l1c: ldo1 {
115			regulator-name = "vreg_l1c";
116			regulator-min-microvolt = <1800000>;
117			regulator-max-microvolt = <1800000>;
118			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
119		};
120
121		vreg_l7c: ldo7 {
122			regulator-name = "vreg_l7c";
123			regulator-min-microvolt = <2504000>;
124			regulator-max-microvolt = <2504000>;
125			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
126			regulator-allow-set-load;
127		};
128
129		vreg_l13c: ldo13 {
130			regulator-name = "vreg_l13c";
131			regulator-min-microvolt = <3072000>;
132			regulator-max-microvolt = <3072000>;
133			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
134		};
135	};
136
137	pmc8280-2-rpmh-regulators {
138		compatible = "qcom,pm8350-rpmh-regulators";
139		qcom,pmic-id = "d";
140
141		vdd-l1-l4-supply = <&vreg_s11b>;
142
143		vreg_l3d: ldo3 {
144			regulator-name = "vreg_l3d";
145			regulator-min-microvolt = <1200000>;
146			regulator-max-microvolt = <1200000>;
147			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
148			regulator-allow-set-load;
149		};
150
151		vreg_l4d: ldo4 {
152			regulator-name = "vreg_l4d";
153			regulator-min-microvolt = <1200000>;
154			regulator-max-microvolt = <1200000>;
155			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
156		};
157
158		vreg_l6d: ldo6 {
159			regulator-name = "vreg_l6d";
160			regulator-min-microvolt = <880000>;
161			regulator-max-microvolt = <880000>;
162			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
163		};
164
165		vreg_l7d: ldo7 {
166			regulator-name = "vreg_l7d";
167			regulator-min-microvolt = <3072000>;
168			regulator-max-microvolt = <3072000>;
169			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
170		};
171
172		vreg_l9d: ldo9 {
173			regulator-name = "vreg_l9d";
174			regulator-min-microvolt = <912000>;
175			regulator-max-microvolt = <912000>;
176			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
177		};
178	};
179};
180
181&pmc8280c_lpg {
182	status = "okay";
183};
184
185&pmk8280_pon_pwrkey {
186	status = "okay";
187};
188
189&qup0 {
190	status = "okay";
191};
192
193&qup0_i2c4 {
194	clock-frequency = <400000>;
195
196	pinctrl-names = "default";
197	pinctrl-0 = <&qup0_i2c4_default>;
198
199	status = "okay";
200
201	touchscreen@10 {
202		compatible = "hid-over-i2c";
203		reg = <0x10>;
204
205		hid-descr-addr = <0x1>;
206		interrupts-extended = <&tlmm 175 IRQ_TYPE_LEVEL_LOW>;
207		vdd-supply = <&vreg_misc_3p3>;
208
209		pinctrl-names = "default";
210		pinctrl-0 = <&ts0_default>;
211	};
212};
213
214&qup1 {
215	status = "okay";
216};
217
218&qup2 {
219	status = "okay";
220};
221
222&qup2_i2c5 {
223	clock-frequency = <400000>;
224
225	pinctrl-names = "default";
226	pinctrl-0 = <&qup2_i2c5_default>;
227
228	status = "okay";
229
230	touchpad@15 {
231		compatible = "hid-over-i2c";
232		reg = <0x15>;
233
234		hid-descr-addr = <0x1>;
235		interrupts-extended = <&tlmm 182 IRQ_TYPE_LEVEL_LOW>;
236		vdd-supply = <&vreg_misc_3p3>;
237
238		pinctrl-names = "default";
239		pinctrl-0 = <&tpad_default>;
240
241		wakeup-source;
242	};
243
244	keyboard@68 {
245		compatible = "hid-over-i2c";
246		reg = <0x68>;
247
248		hid-descr-addr = <0x1>;
249		interrupts-extended = <&tlmm 104 IRQ_TYPE_LEVEL_LOW>;
250		vdd-supply = <&vreg_misc_3p3>;
251
252		pinctrl-names = "default";
253		pinctrl-0 = <&kybd_default>;
254
255		wakeup-source;
256	};
257};
258
259&qup2_uart17 {
260	compatible = "qcom,geni-debug-uart";
261
262	status = "okay";
263};
264
265&remoteproc_adsp {
266	firmware-name = "qcom/sc8280xp/qcadsp8280.mbn";
267
268	status = "okay";
269};
270
271&remoteproc_nsp0 {
272	firmware-name = "qcom/sc8280xp/qccdsp8280.mbn";
273
274	status = "okay";
275};
276
277&ufs_mem_hc {
278	reset-gpios = <&tlmm 228 GPIO_ACTIVE_LOW>;
279
280	vcc-supply = <&vreg_l7c>;
281	vcc-max-microamp = <800000>;
282	vccq-supply = <&vreg_l3d>;
283	vccq-max-microamp = <900000>;
284
285	status = "okay";
286};
287
288&ufs_mem_phy {
289	vdda-phy-supply = <&vreg_l6b>;
290	vdda-pll-supply = <&vreg_l3b>;
291
292	status = "okay";
293};
294
295&usb_0 {
296	status = "okay";
297};
298
299&usb_0_dwc3 {
300	/* TODO: Define USB-C connector properly */
301	dr_mode = "host";
302};
303
304&usb_0_hsphy {
305	vdda-pll-supply = <&vreg_l9d>;
306	vdda18-supply = <&vreg_l1c>;
307	vdda33-supply = <&vreg_l7d>;
308
309	status = "okay";
310};
311
312&usb_0_qmpphy {
313	vdda-phy-supply = <&vreg_l9d>;
314	vdda-pll-supply = <&vreg_l4d>;
315
316	status = "okay";
317};
318
319&usb_1 {
320	status = "okay";
321};
322
323&usb_1_dwc3 {
324	/* TODO: Define USB-C connector properly */
325	dr_mode = "host";
326};
327
328&usb_1_hsphy {
329	vdda-pll-supply = <&vreg_l4b>;
330	vdda18-supply = <&vreg_l1c>;
331	vdda33-supply = <&vreg_l13c>;
332
333	status = "okay";
334};
335
336&usb_1_qmpphy {
337	vdda-phy-supply = <&vreg_l4b>;
338	vdda-pll-supply = <&vreg_l3b>;
339
340	status = "okay";
341};
342
343&xo_board_clk {
344	clock-frequency = <38400000>;
345};
346
347/* PINCTRL - additions to nodes defined in sc8280xp.dtsi */
348
349&pmc8280_1_gpios {
350	edp_bl_en: edp-bl-en-state {
351		pins = "gpio8";
352		function = "normal";
353	};
354
355	edp_bl_reg_en: edp-bl-reg-en-state {
356		pins = "gpio9";
357		function = "normal";
358	};
359
360	misc_3p3_reg_en: misc-3p3-reg-en-state {
361		pins = "gpio1";
362		function = "normal";
363	};
364};
365
366&pmc8280c_gpios {
367	edp_bl_pwm: edp-bl-pwm-state {
368		pins = "gpio8";
369		function = "func1";
370	};
371};
372
373&tlmm {
374	gpio-reserved-ranges = <74 6>, <83 4>, <125 2>, <128 2>, <154 7>;
375
376	kybd_default: kybd-default-state {
377		disable {
378			pins = "gpio102";
379			function = "gpio";
380			output-low;
381		};
382
383		int-n {
384			pins = "gpio104";
385			function = "gpio";
386			bias-disable;
387		};
388
389		reset {
390			pins = "gpio105";
391			function = "gpio";
392			bias-disable;
393		};
394	};
395
396	qup0_i2c4_default: qup0-i2c4-default-state {
397		pins = "gpio171", "gpio172";
398		function = "qup4";
399
400		bias-disable;
401		drive-strength = <16>;
402	};
403
404	qup2_i2c5_default: qup2-i2c5-default-state {
405		pins = "gpio81", "gpio82";
406		function = "qup21";
407
408		bias-disable;
409		drive-strength = <16>;
410	};
411
412	tpad_default: tpad-default-state {
413		int-n {
414			pins = "gpio182";
415			function = "gpio";
416			bias-disable;
417		};
418	};
419
420	ts0_default: ts0-default-state {
421		int-n {
422			pins = "gpio175";
423			function = "gpio";
424			bias-disable;
425		};
426
427		reset-n {
428			pins = "gpio99";
429			function = "gpio";
430			output-high;
431			drive-strength = <16>;
432		};
433	};
434};
435