1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2020, Konrad Dybcio
4 */
5
6#include "msm8994.dtsi"
7#include "pm8994.dtsi"
8#include "pmi8994.dtsi"
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/input/gpio-keys.h>
11
12/ {
13	/* required for bootloader to select correct board */
14
15	/*
16	 * We support MSM8994 v2 (0x20000) and v2.1 (0x20001).
17	 * The V1 chip (0x0 and 0x10000) is significantly different
18	 * and requires driver-side changes (including CPR, be warned!!).
19	 * Besides that, it's very rare.
20	 */
21	qcom,msm-id = <207 0x20000>, <207 0x20001>;
22	/* We only use pm8994+pmi8994. */
23	qcom,pmic-id = <0x10009 0x1000a 0x00 0x00>;
24	/* This property is shared across all kitakami devices. */
25	qcom,board-id = <8 0>;
26
27	/* Kitakami firmware doesn't support PSCI */
28	/delete-node/ psci;
29
30	gpio_keys {
31		compatible = "gpio-keys";
32		input-name = "gpio-keys";
33		#address-cells = <1>;
34		#size-cells = <0>;
35		autorepeat;
36
37		button@0 {
38			label = "Volume Down";
39			gpios = <&pm8994_gpios 2 GPIO_ACTIVE_LOW>;
40			linux,input-type = <1>;
41			linux,code = <KEY_VOLUMEDOWN>;
42			wakeup-source;
43			debounce-interval = <15>;
44		};
45
46		button@1 {
47			label = "Volume Up";
48			gpios = <&pm8994_gpios 3 GPIO_ACTIVE_LOW>;
49			linux,input-type = <1>;
50			linux,code = <KEY_VOLUMEUP>;
51			wakeup-source;
52			debounce-interval = <15>;
53		};
54
55		button@2 {
56			label = "Camera Snapshot";
57			gpios = <&pm8994_gpios 4 GPIO_ACTIVE_LOW>;
58			linux,input-type = <1>;
59			linux,code = <KEY_CAMERA>;
60			wakeup-source;
61			debounce-interval = <15>;
62		};
63
64		button@3 {
65			label = "Camera Focus";
66			gpios = <&pm8994_gpios 5 GPIO_ACTIVE_LOW>;
67			linux,input-type = <1>;
68			linux,code = <KEY_VOLUMEUP>;
69			wakeup-source;
70			debounce-interval = <15>;
71		};
72	};
73
74	reserved-memory {
75		#address-cells = <2>;
76		#size-cells = <2>;
77		ranges;
78
79		/* This is for getting crash logs using Android downstream kernels */
80		ramoops@1fe00000 {
81			compatible = "ramoops";
82			reg = <0x0 0x1fe00000 0x0 0x200000>;
83			console-size = <0x100000>;
84			record-size = <0x10000>;
85			ftrace-size = <0x10000>;
86			pmsg-size = <0x80000>;
87		};
88
89		continuous_splash: framebuffer@3401000{
90			reg = <0x0 0x3401000 0x0 0x2200000>;
91			no-map;
92		};
93
94		dfps_data_mem: dfps_data_mem@3400000 {
95			reg = <0x0 0x3400000 0x0 0x1000>;
96			no-map;
97		};
98
99		peripheral_region: peripheral_region@7400000 {
100			reg = <0x0 0x7400000 0x0 0x1c00000>;
101			no-map;
102		};
103
104		modem_region: modem_region@9000000 {
105			reg = <0x0 0x9000000 0x0 0x5a00000>;
106			no-map;
107		};
108
109		tzapp: modem_region@ea00000 {
110			reg = <0x0 0xea00000 0x0 0x1900000>;
111			no-map;
112		};
113
114		fb_region: fb_region@40000000 {
115			reg = <0x00 0x40000000 0x00 0x1000000>;
116			no-map;
117		};
118	};
119};
120
121&blsp_spi0 {
122	status = "okay";
123
124	/* FPC fingerprint reader */
125};
126
127/* I2C1 is disabled on this board */
128
129&blsp_i2c2 {
130	status = "okay";
131
132	/* NXP PN547 NFC */
133};
134
135&blsp_i2c4 {
136	status = "okay";
137
138	/* Empty but active */
139};
140
141&blsp_i2c5 {
142	status = "okay";
143
144	/* sii8620 HDMI/MHL bridge */
145};
146
147&blsp_i2c6 {
148	status = "okay";
149
150	touchscreen: rmi4-i2c-dev@2c {
151		compatible = "syna,rmi4-i2c";
152		reg = <0x2c>;
153		#address-cells = <1>;
154		#size-cells = <0>;
155
156		interrupt-parent = <&tlmm>;
157		interrupts = <42 IRQ_TYPE_EDGE_FALLING>;
158
159		pinctrl-names = "default";
160		pinctrl-0 = <&ts_int_active &ts_reset_active>;
161
162		vdd-supply = <&pm8994_l22>;
163		vio-supply = <&pm8994_s4>;
164
165		syna,reset-delay-ms = <220>;
166		syna,startup-delay-ms = <220>;
167
168		rmi4-f01@1 {
169			reg = <0x01>;
170			syna,nosleep-mode = <1>;
171		};
172
173		rmi4-f11@11 {
174			reg = <0x11>;
175			syna,sensor-type = <1>;
176		};
177	};
178};
179
180&blsp1_uart2 {
181	status = "okay";
182};
183
184&blsp2_uart2 {
185	status = "okay";
186};
187
188&rpm_requests {
189	pm8994_regulators: pm8994-regulators {
190		compatible = "qcom,rpm-pm8994-regulators";
191
192		vdd_s1-supply = <&vph_pwr>;
193		vdd_s2-supply = <&vph_pwr>;
194		vdd_s3-supply = <&vph_pwr>;
195		vdd_s4-supply = <&vph_pwr>;
196		vdd_s5-supply = <&vph_pwr>;
197		vdd_s6-supply = <&vph_pwr>;
198		vdd_s7-supply = <&vph_pwr>;
199		vdd_s8-supply = <&vph_pwr>;
200		vdd_s9-supply = <&vph_pwr>;
201		vdd_s10-supply = <&vph_pwr>;
202		vdd_s11-supply = <&vph_pwr>;
203		vdd_s12-supply = <&vph_pwr>;
204		vdd_l1-supply = <&pmi8994_s1>;
205		vdd_l2_l26_l28-supply = <&pm8994_s3>;
206		vdd_l3_l11-supply = <&pm8994_s3>;
207		vdd_l4_l27_l31-supply = <&pm8994_s3>;
208		vdd_l5_l7-supply = <&pm8994_s5>;
209		vdd_l6_l12_l32-supply = <&pm8994_s5>;
210		vdd_l8_l16_l30-supply = <&vph_pwr>;
211		vdd_l9_l10_l18_l22-supply = <&pmi8994_bby>;
212		vdd_l13_l19_l23_l24-supply = <&pmi8994_bby>;
213		vdd_l14_l15-supply = <&pm8994_s5>;
214		vdd_l17_l29-supply = <&pmi8994_bby>;
215		vdd_l20_l21-supply = <&pmi8994_bby>;
216		vdd_l25-supply = <&pm8994_s3>;
217		vdd_lvs1_lvs2-supply = <&pm8994_s4>;
218
219		/* S1, S2, S6 and S12 are managed by RPMPD */
220
221		pm8994_s3: s3 {
222			regulator-min-microvolt = <1300000>;
223			regulator-max-microvolt = <1300000>;
224		};
225
226		pm8994_s4: s4 {
227			regulator-min-microvolt = <1800000>;
228			regulator-max-microvolt = <1800000>;
229			regulator-allow-set-load;
230			regulator-always-on;
231			regulator-system-load = <325000>;
232		};
233
234		pm8994_s5: s5 {
235			regulator-min-microvolt = <2150000>;
236			regulator-max-microvolt = <2150000>;
237		};
238
239		pm8994_s7: s7 {
240			regulator-min-microvolt = <1000000>;
241			regulator-max-microvolt = <1000000>;
242		};
243
244		/*
245		 * S8 - SPMI-managed VDD_APC0
246		 * S9, S10 and S11 (the main one) - SPMI-managed VDD_APC1
247		 */
248
249		pm8994_l1: l1 {
250			regulator-min-microvolt = <1000000>;
251			regulator-max-microvolt = <1000000>;
252		};
253
254		pm8994_l2: l2 {
255			regulator-min-microvolt = <1250000>;
256			regulator-max-microvolt = <1250000>;
257			regulator-allow-set-load;
258			regulator-system-load = <10000>;
259		};
260
261		pm8994_l3: l3 {
262			regulator-min-microvolt = <1100000>;
263			regulator-max-microvolt = <1100000>;
264		};
265
266		pm8994_l4: l4 {
267			regulator-min-microvolt = <1225000>;
268			regulator-max-microvolt = <1225000>;
269		};
270
271		/* L5 is inaccessible from RPM */
272
273		pm8994_l6: l6 {
274			regulator-min-microvolt = <1800000>;
275			regulator-max-microvolt = <1800000>;
276		};
277
278		/* L7 is inaccessible from RPM */
279
280		pm8994_l8: l8 {
281			regulator-min-microvolt = <1800000>;
282			regulator-max-microvolt = <1800000>;
283		};
284
285		pm8994_l9: l9 {
286			regulator-min-microvolt = <1800000>;
287			regulator-max-microvolt = <1800000>;
288		};
289
290		pm8994_l10: l10 {
291			regulator-min-microvolt = <1800000>;
292			regulator-max-microvolt = <1800000>;
293		};
294
295		pm8994_l11: l11 {
296			regulator-min-microvolt = <1200000>;
297			regulator-max-microvolt = <1200000>;
298		};
299
300		pm8994_l12: l12 {
301			regulator-min-microvolt = <1800000>;
302			regulator-max-microvolt = <1800000>;
303			regulator-allow-set-load;
304			regulator-system-load = <10000>;
305		};
306
307		pm8994_l13: l13 {
308			regulator-min-microvolt = <1800000>;
309			regulator-max-microvolt = <2950000>;
310		};
311
312		pm8994_l14: l14 {
313			regulator-min-microvolt = <1800000>;
314			regulator-max-microvolt = <1800000>;
315			regulator-allow-set-load;
316			regulator-system-load = <10000>;
317		};
318
319		pm8994_l15: l15 {
320			regulator-min-microvolt = <1800000>;
321			regulator-max-microvolt = <1800000>;
322		};
323
324		pm8994_l16: l16 {
325			regulator-min-microvolt = <2700000>;
326			regulator-max-microvolt = <2700000>;
327		};
328
329		pm8994_l17: l17 {
330			regulator-min-microvolt = <2200000>;
331			regulator-max-microvolt = <2200000>;
332		};
333
334		pm8994_l18: l18 {
335			regulator-min-microvolt = <2850000>;
336			regulator-max-microvolt = <2850000>;
337			regulator-always-on;
338		};
339
340		pm8994_l19: l19 {
341			regulator-min-microvolt = <2850000>;
342			regulator-max-microvolt = <2850000>;
343		};
344
345		pm8994_l20: l20 {
346			regulator-min-microvolt = <2950000>;
347			regulator-max-microvolt = <2950000>;
348			regulator-always-on;
349			regulator-boot-on;
350			regulator-allow-set-load;
351			regulator-system-load = <570000>;
352		};
353
354		pm8994_l21: l21 {
355			regulator-min-microvolt = <2950000>;
356			regulator-max-microvolt = <2950000>;
357			regulator-always-on;
358		};
359
360		pm8994_l22: l22 {
361			regulator-min-microvolt = <3000000>;
362			regulator-max-microvolt = <3000000>;
363		};
364
365		pm8994_l23: l23 {
366			regulator-min-microvolt = <2800000>;
367			regulator-max-microvolt = <2800000>;
368		};
369
370		pm8994_l24: l24 {
371			regulator-min-microvolt = <3075000>;
372			regulator-max-microvolt = <3150000>;
373		};
374
375		pm8994_l25: l25 {
376			regulator-min-microvolt = <1000000>;
377			regulator-max-microvolt = <1000000>;
378		};
379
380		pm8994_l26: l26 {
381			regulator-min-microvolt = <987500>;
382			regulator-max-microvolt = <987500>;
383		};
384
385		pm8994_l27: l27 {
386			regulator-min-microvolt = <1200000>;
387			regulator-max-microvolt = <1200000>;
388		};
389
390		pm8994_l28: l28 {
391			regulator-min-microvolt = <1000000>;
392			regulator-max-microvolt = <1000000>;
393			regulator-allow-set-load;
394			regulator-system-load = <10000>;
395		};
396
397		pm8994_l29: l29 {
398			regulator-min-microvolt = <2700000>;
399			regulator-max-microvolt = <2700000>;
400		};
401
402		pm8994_l30: l30 {
403			regulator-min-microvolt = <1800000>;
404			regulator-max-microvolt = <1800000>;
405		};
406
407		pm8994_l31: l31 {
408			regulator-min-microvolt = <1200000>;
409			regulator-max-microvolt = <1200000>;
410			regulator-allow-set-load;
411			regulator-system-load = <10000>;
412		};
413
414		pm8994_l32: l32 {
415			regulator-min-microvolt = <1800000>;
416			regulator-max-microvolt = <1800000>;
417		};
418
419		pm8994_lvs1: lvs1 {};
420		pm8994_lvs2: lvs2 {};
421	};
422
423	pmi8994_regulators: pmi8994-regulators {
424		compatible = "qcom,rpm-pmi8994-regulators";
425
426		vdd_s1-supply = <&vph_pwr>;
427		vdd_bst_byp-supply = <&vph_pwr>;
428
429		pmi8994_s1: s1 {
430			regulator-min-microvolt = <1025000>;
431			regulator-max-microvolt = <1025000>;
432		};
433
434		/* S2 & S3 - VDD_GFX */
435
436		pmi8994_bby: boost-bypass {
437			regulator-min-microvolt = <3150000>;
438			regulator-max-microvolt = <3600000>;
439		};
440	};
441};
442
443&sdhc1 {
444	/*
445	 * There is an issue with the eMMC causing permanent
446	 * damage to the card if a quirk isn't addressed.
447	 * Until it's fixed, disable the MMC so as not to brick
448	 * devices.
449	 */
450	status = "disabled";
451
452	/*
453	 * Downstream pushes 2.95V to the sdhci device,
454	 * but upstream driver REALLY wants to make vmmc 1.8v
455	 * cause of the hs400-1_8v mode. MMC works fine without
456	 * that regulator, so let's not use it for now.
457	 * vqmmc is also disabled cause driver stll complains.
458	 *
459	 * vmmc-supply = <&pm8994_l20>;
460	 * vqmmc-supply = <&pm8994_s4>;
461	 */
462};
463
464&tlmm {
465	ts_int_active: ts-int-active {
466		pins = "gpio42";
467		drive-strength = <2>;
468		bias-disable;
469		input-enable;
470	};
471
472	ts_reset_active: ts-reset-active {
473		pins = "gpio109";
474		drive-strength = <2>;
475		bias-disable;
476		output-low;
477	};
478};
479