1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2019, Jeffrey Hugo. All rights reserved. */
3
4/*
5 * Common include for MSM8998 clamshell devices, ie the Lenovo Miix 630,
6 * Asus NovaGo TP370QL, and HP Envy x2.  All three devices are basically the
7 * same, with differences in peripherals.
8 */
9
10#include "msm8998.dtsi"
11#include "pm8005.dtsi"
12#include "pm8998.dtsi"
13
14/ {
15	vph_pwr: vph-pwr-regulator {
16		compatible = "regulator-fixed";
17		regulator-name = "vph_pwr";
18		regulator-always-on;
19		regulator-boot-on;
20	};
21};
22
23&blsp1_uart3 {
24	status = "okay";
25
26	bluetooth {
27		compatible = "qcom,wcn3990-bt";
28
29		vddio-supply = <&vreg_s4a_1p8>;
30		vddxo-supply = <&vreg_l7a_1p8>;
31		vddrf-supply = <&vreg_l17a_1p3>;
32		vddch0-supply = <&vreg_l25a_3p3>;
33		max-speed = <3200000>;
34	};
35};
36
37&blsp1_uart3_on {
38	rx-pins {
39		/delete-property/ bias-disable;
40		/*
41		 * Configure a pull-up on 45 (RX). This is needed to
42		 * avoid garbage data when the TX pin of the Bluetooth
43		 * module is in tri-state (module powered off or not
44		 * driving the signal yet).
45		 */
46		bias-pull-up;
47	};
48
49	cts-pins {
50		/delete-property/ bias-disable;
51		/*
52		 * Configure a pull-down on 47 (CTS) to match the pull
53		 * of the Bluetooth module.
54		 */
55		bias-pull-down;
56	};
57};
58
59/*
60 * The laptop FW does not appear to support the retention state as it is
61 * not advertised as enabled in ACPI, and enabling it in DT can cause boot
62 * hangs.
63 */
64&CPU0 {
65	cpu-idle-states = <&LITTLE_CPU_SLEEP_1>;
66};
67
68&CPU1 {
69	cpu-idle-states = <&LITTLE_CPU_SLEEP_1>;
70};
71
72&CPU2 {
73	cpu-idle-states = <&LITTLE_CPU_SLEEP_1>;
74};
75
76&CPU3 {
77	cpu-idle-states = <&LITTLE_CPU_SLEEP_1>;
78};
79
80&CPU4 {
81	cpu-idle-states = <&BIG_CPU_SLEEP_1>;
82};
83
84&CPU5 {
85	cpu-idle-states = <&BIG_CPU_SLEEP_1>;
86};
87
88&CPU6 {
89	cpu-idle-states = <&BIG_CPU_SLEEP_1>;
90};
91
92&CPU7 {
93	cpu-idle-states = <&BIG_CPU_SLEEP_1>;
94};
95
96/*
97 * If EFIFB is used, enabling MMCC will cause important MMSS clocks to be cleaned
98 * up, because as far as Linux is concerned - they are unused. Disable it by default
99 * on clamshell devices, as it will break them, unless either simplefb is configured to
100 * hold a vote for these clocks, or panels are brought up properly, using drm/msm.
101 */
102&mmcc {
103	status = "disabled";
104};
105
106&mmss_smmu {
107	status = "disabled";
108};
109
110&pcie0 {
111	status = "okay";
112};
113
114&pcie_phy {
115	status = "okay";
116};
117
118&pm8005_regulators {
119	vdd_s1-supply = <&vph_pwr>;
120
121	pm8005_s1: s1 { /* VDD_GFX supply */
122		regulator-min-microvolt = <524000>;
123		regulator-max-microvolt = <1100000>;
124		regulator-enable-ramp-delay = <500>;
125
126		/* hack until we rig up the gpu consumer */
127		regulator-always-on;
128	};
129};
130
131&qusb2phy {
132	status = "okay";
133
134	vdd-supply = <&vreg_l1a_0p875>;
135	vdda-pll-supply = <&vreg_l12a_1p8>;
136	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
137};
138
139&rpm_requests {
140	regulators-0 {
141		compatible = "qcom,rpm-pm8998-regulators";
142
143		vdd_s1-supply = <&vph_pwr>;
144		vdd_s2-supply = <&vph_pwr>;
145		vdd_s3-supply = <&vph_pwr>;
146		vdd_s4-supply = <&vph_pwr>;
147		vdd_s5-supply = <&vph_pwr>;
148		vdd_s6-supply = <&vph_pwr>;
149		vdd_s7-supply = <&vph_pwr>;
150		vdd_s8-supply = <&vph_pwr>;
151		vdd_s9-supply = <&vph_pwr>;
152		vdd_s10-supply = <&vph_pwr>;
153		vdd_s11-supply = <&vph_pwr>;
154		vdd_s12-supply = <&vph_pwr>;
155		vdd_s13-supply = <&vph_pwr>;
156		vdd_l1_l27-supply = <&vreg_s7a_1p025>;
157		vdd_l2_l8_l17-supply = <&vreg_s3a_1p35>;
158		vdd_l3_l11-supply = <&vreg_s7a_1p025>;
159		vdd_l4_l5-supply = <&vreg_s7a_1p025>;
160		vdd_l6-supply = <&vreg_s5a_2p04>;
161		vdd_l7_l12_l14_l15-supply = <&vreg_s5a_2p04>;
162		vdd_l9-supply = <&vph_pwr>;
163		vdd_l10_l23_l25-supply = <&vph_pwr>;
164		vdd_l13_l19_l21-supply = <&vph_pwr>;
165		vdd_l16_l28-supply = <&vph_pwr>;
166		vdd_l18_l22-supply = <&vph_pwr>;
167		vdd_l20_l24-supply = <&vph_pwr>;
168		vdd_l26-supply = <&vreg_s3a_1p35>;
169		vdd_lvs1_lvs2-supply = <&vreg_s4a_1p8>;
170
171		vreg_s3a_1p35: s3 {
172			regulator-min-microvolt = <1352000>;
173			regulator-max-microvolt = <1352000>;
174		};
175
176		vreg_s4a_1p8: s4 {
177			regulator-min-microvolt = <1800000>;
178			regulator-max-microvolt = <1800000>;
179			regulator-allow-set-load;
180		};
181
182		vreg_s5a_2p04: s5 {
183			regulator-min-microvolt = <1904000>;
184			regulator-max-microvolt = <2040000>;
185		};
186
187		vreg_s7a_1p025: s7 {
188			regulator-min-microvolt = <900000>;
189			regulator-max-microvolt = <1028000>;
190		};
191
192		vreg_l1a_0p875: l1 {
193			regulator-min-microvolt = <880000>;
194			regulator-max-microvolt = <880000>;
195			regulator-allow-set-load;
196		};
197
198		vreg_l2a_1p2: l2 {
199			regulator-min-microvolt = <1200000>;
200			regulator-max-microvolt = <1200000>;
201			regulator-allow-set-load;
202		};
203
204		vreg_l3a_1p0: l3 {
205			regulator-min-microvolt = <1000000>;
206			regulator-max-microvolt = <1000000>;
207		};
208
209		vreg_l5a_0p8: l5 {
210			regulator-min-microvolt = <800000>;
211			regulator-max-microvolt = <800000>;
212		};
213
214		vreg_l6a_1p8: l6 {
215			regulator-min-microvolt = <1808000>;
216			regulator-max-microvolt = <1808000>;
217		};
218
219		vreg_l7a_1p8: l7 {
220			regulator-min-microvolt = <1800000>;
221			regulator-max-microvolt = <1800000>;
222			regulator-allow-set-load;
223		};
224
225		vreg_l8a_1p2: l8 {
226			regulator-min-microvolt = <1200000>;
227			regulator-max-microvolt = <1200000>;
228		};
229
230		vreg_l9a_1p8: l9 {
231			regulator-min-microvolt = <1808000>;
232			regulator-max-microvolt = <2960000>;
233		};
234
235		vreg_l10a_1p8: l10 {
236			regulator-min-microvolt = <1808000>;
237			regulator-max-microvolt = <2960000>;
238		};
239
240		vreg_l11a_1p0: l11 {
241			regulator-min-microvolt = <1000000>;
242			regulator-max-microvolt = <1000000>;
243		};
244
245		vreg_l12a_1p8: l12 {
246			regulator-min-microvolt = <1800000>;
247			regulator-max-microvolt = <1800000>;
248		};
249
250		vreg_l13a_2p95: l13 {
251			regulator-min-microvolt = <1808000>;
252			regulator-max-microvolt = <2960000>;
253		};
254
255		vreg_l14a_1p88: l14 {
256			regulator-min-microvolt = <1880000>;
257			regulator-max-microvolt = <1880000>;
258		};
259
260		vreg_l15a_1p8: l15 {
261			regulator-min-microvolt = <1800000>;
262			regulator-max-microvolt = <1800000>;
263		};
264
265		vreg_l16a_2p7: l16 {
266			regulator-min-microvolt = <2704000>;
267			regulator-max-microvolt = <2704000>;
268		};
269
270		vreg_l17a_1p3: l17 {
271			regulator-min-microvolt = <1304000>;
272			regulator-max-microvolt = <1304000>;
273			regulator-allow-set-load;
274		};
275
276		vreg_l18a_2p7: l18 {
277			regulator-min-microvolt = <2704000>;
278			regulator-max-microvolt = <2704000>;
279		};
280
281		vreg_l19a_3p0: l19 {
282			regulator-min-microvolt = <3008000>;
283			regulator-max-microvolt = <3008000>;
284		};
285
286		vreg_l20a_2p95: l20 {
287			regulator-min-microvolt = <2960000>;
288			regulator-max-microvolt = <2960000>;
289			regulator-allow-set-load;
290		};
291
292		vreg_l21a_2p95: l21 {
293			regulator-min-microvolt = <2960000>;
294			regulator-max-microvolt = <2960000>;
295			regulator-allow-set-load;
296			regulator-system-load = <800000>;
297		};
298
299		vreg_l22a_2p85: l22 {
300			regulator-min-microvolt = <2864000>;
301			regulator-max-microvolt = <2864000>;
302		};
303
304		vreg_l23a_3p3: l23 {
305			regulator-min-microvolt = <3312000>;
306			regulator-max-microvolt = <3312000>;
307		};
308
309		vreg_l24a_3p075: l24 {
310			regulator-min-microvolt = <3088000>;
311			regulator-max-microvolt = <3088000>;
312		};
313
314		vreg_l25a_3p3: l25 {
315			regulator-min-microvolt = <3104000>;
316			regulator-max-microvolt = <3312000>;
317			regulator-allow-set-load;
318		};
319
320		vreg_l26a_1p2: l26 {
321			regulator-min-microvolt = <1200000>;
322			regulator-max-microvolt = <1200000>;
323		};
324
325		vreg_l28_3p0: l28 {
326			regulator-min-microvolt = <3008000>;
327			regulator-max-microvolt = <3008000>;
328		};
329
330		vreg_lvs1a_1p8: lvs1 {
331			regulator-min-microvolt = <1800000>;
332			regulator-max-microvolt = <1800000>;
333		};
334
335		vreg_lvs2a_1p8: lvs2 {
336			regulator-min-microvolt = <1800000>;
337			regulator-max-microvolt = <1800000>;
338		};
339	};
340};
341
342&remoteproc_mss {
343	status = "okay";
344};
345
346&sdhc2 {
347	status = "okay";
348
349	vmmc-supply = <&vreg_l21a_2p95>;
350	vqmmc-supply = <&vreg_l13a_2p95>;
351
352	pinctrl-names = "default", "sleep";
353	pinctrl-0 = <&sdc2_on &sdc2_cd>;
354	pinctrl-1 = <&sdc2_off &sdc2_cd>;
355};
356
357&tlmm {
358	gpio-reserved-ranges = <0 4>, <81 4>;
359
360	touchpad: touchpad-pin-state {
361		pins = "gpio123";
362		function = "gpio";
363		bias-pull-up;
364	};
365};
366
367&ufshc {
368	status = "okay";
369};
370
371&ufsphy {
372	status = "okay";
373	vdda-phy-supply = <&vreg_l1a_0p875>;
374	vdda-pll-supply = <&vreg_l2a_1p2>;
375};
376
377&usb3 {
378	status = "okay";
379};
380
381&usb3_dwc3 {
382	dr_mode = "host"; /* Force to host until we have Type-C hooked up */
383};
384
385&usb3phy {
386	status = "okay";
387
388	vdda-phy-supply = <&vreg_l1a_0p875>;
389	vdda-pll-supply = <&vreg_l2a_1p2>;
390};
391
392&wifi {
393	status = "okay";
394
395	vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
396	vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
397	vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
398	vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
399};
400