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	/* Synaptics touchscreen */
151};
152
153&blsp1_uart2 {
154	status = "okay";
155};
156
157&blsp2_uart2 {
158	status = "okay";
159};
160
161&rpm_requests {
162	pm8994_regulators: pm8994-regulators {
163		compatible = "qcom,rpm-pm8994-regulators";
164		vdd_l1-supply = <&pm8994_s1>;
165		vdd_l2_26_28-supply = <&pm8994_s3>;
166		vdd_l3_11-supply = <&pm8994_s3>;
167		vdd_l4_27_31-supply = <&pm8994_s3>;
168		vdd_l5_7-supply = <&pm8994_s3>;
169		vdd_l6_12_32-supply = <&pm8994_s5>;
170		vdd_l8_16_30-supply = <&vreg_vph_pwr>;
171		vdd_l9_10_18_22-supply = <&vreg_vph_pwr>;
172		vdd_l13_19_23_24-supply = <&vreg_vph_pwr>;
173		vdd_l14_15-supply = <&pm8994_s5>;
174		vdd_l17_29-supply = <&vreg_vph_pwr>;
175		vdd_l20_21-supply = <&vreg_vph_pwr>;
176		vdd_l25-supply = <&pm8994_s5>;
177		vdd_lvs1_2 = <&pm8994_s4>;
178
179		pm8994_s1: s1 {};
180		pm8994_s2: s2 {};
181		pm8994_s3: s3 {};
182		pm8994_s4: s4 {};
183		pm8994_s5: s5 {};
184		pm8994_s6: s6 {};
185		pm8994_s7: s7 {};
186
187		pm8994_l1: l1 {};
188		pm8994_l2: l2 {};
189		pm8994_l3: l3 {};
190		pm8994_l4: l4 {};
191		pm8994_l6: l6 {};
192		pm8994_l8: l8 {};
193		pm8994_l9: l9 {};
194		pm8994_l10: l10 {};
195		pm8994_l11: l11 {};
196		pm8994_l12: l12 {};
197		pm8994_l13: l13 {};
198		pm8994_l14: l14 {};
199		pm8994_l15: l15 {};
200		pm8994_l16: l16 {};
201		pm8994_l17: l17 {};
202		pm8994_l18: l18 {};
203		pm8994_l19: l19 {};
204		pm8994_l20: l20 {};
205		pm8994_l21: l21 {};
206		pm8994_l22: l22 {};
207		pm8994_l23: l23 {};
208		pm8994_l24: l24 {};
209		pm8994_l25: l25 {};
210		pm8994_l26: l26 {};
211		pm8994_l27: l27 {};
212		pm8994_l28: l28 {};
213		pm8994_l29: l29 {};
214		pm8994_l30: l30 {};
215		pm8994_l31: l31 {};
216		pm8994_l32: l32 {};
217
218		pm8994_lvs1: lvs1 {};
219		pm8994_lvs2: lvs2 {};
220	};
221
222	pmi8994_regulators: pmi8994-regulators {
223		compatible = "qcom,rpm-pmi8994-regulators";
224
225		pmi8994_s1: s1 {};
226		pmi8994_s2: s2 {};
227		pmi8994_s3: s3 {};
228		pmi8994_bby: boost-bypass {};
229	};
230};
231
232&sdhc1 {
233	/* There is an issue with the eMMC causing permanent
234	 * damage to the card if a quirk isn't addressed.
235	 * Until it's fixed, disable the MMC so as not to brick
236	 * devices.
237	 */
238	status = "disabled";
239
240	/* Downstream pushes 2.95V to the sdhci device,
241	 * but upstream driver REALLY wants to make vmmc 1.8v
242	 * cause of the hs400-1_8v mode. MMC works fine without
243	 * that regulator, so let's not use it for now.
244	 * vqmmc is also disabled cause driver stll complains.
245	 *
246	 * vmmc-supply = <&pm8994_l20>;
247	 * vqmmc-supply = <&pm8994_s4>;
248	 */
249};
250