1// SPDX-License-Identifier: GPL-2.0
2#include <dt-bindings/gpio/gpio.h>
3#include <dt-bindings/input/input.h>
4#include <dt-bindings/leds/common.h>
5#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
6#include "qcom-msm8974.dtsi"
7#include "qcom-pm8841.dtsi"
8#include "qcom-pm8941.dtsi"
9
10/delete-node/ &mpss_region;
11
12/ {
13	model = "Qualcomm APQ8074 Dragonboard";
14	compatible = "qcom,apq8074-dragonboard", "qcom,apq8074";
15
16	aliases {
17		serial0 = &blsp1_uart2;
18		usid0 = &pm8941_0;
19		usid4 = &pm8841_0;
20	};
21
22	chosen {
23		stdout-path = "serial0:115200n8";
24	};
25
26	gpio-keys {
27		compatible = "gpio-keys";
28		autorepeat;
29
30		pinctrl-0 = <&msm_keys_default>;
31		pinctrl-names = "default";
32
33		button-volup {
34			label = "Volume Up";
35			linux,code = <KEY_VOLUMEUP>;
36			gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
37		};
38
39		button-general {
40			label = "General";
41			linux,code = <KEY_PROG1>;
42			gpios = <&pm8941_gpios 23 GPIO_ACTIVE_LOW>;
43		};
44	};
45
46	reserved-memory {
47		mpss_region: mpss@ac00000 {
48			reg = <0x0ac00000 0x2500000>;
49			no-map;
50		};
51	};
52};
53
54&blsp1_uart2 {
55	status = "okay";
56};
57
58&blsp2_dma {
59	qcom,controlled-remotely;
60};
61
62&blsp2_i2c5 {
63	status = "okay";
64	clock-frequency = <200000>;
65
66	eeprom: eeprom@52 {
67		compatible = "atmel,24c128";
68		reg = <0x52>;
69		pagesize = <32>;
70		read-only;
71	};
72};
73
74&gpu {
75	status = "okay";
76};
77
78&mdss {
79	status = "okay";
80};
81
82&mdss_dsi0 {
83	vdda-supply = <&pm8941_l2>;
84	vdd-supply = <&pm8941_l22>;
85	vddio-supply = <&pm8941_l12>;
86
87	status = "okay";
88
89	panel: panel@0 {
90		compatible = "sharp,ls043t1le01-qhd";
91		reg = <0>;
92
93		avdd-supply = <&pm8941_l22>;
94		backlight = <&pm8941_wled>;
95		reset-gpios = <&pm8941_gpios 19 GPIO_ACTIVE_HIGH>;
96
97		port {
98			panel_in: endpoint {
99				remote-endpoint = <&mdss_dsi0_out>;
100			};
101		};
102	};
103};
104
105&mdss_dsi0_out {
106	remote-endpoint = <&panel_in>;
107	data-lanes = <0 1 2 3>;
108};
109
110&mdss_dsi0_phy {
111	status = "okay";
112
113	vddio-supply = <&pm8941_l12>;
114};
115
116&gpu {
117	status = "okay";
118};
119
120&mdss {
121	status = "okay";
122};
123
124&pm8941_gpios {
125        msm_keys_default: pm8941-gpio-keys-state {
126		pins = "gpio5", "gpio23";
127		function = "normal";
128		input-enable;
129		drive-push-pull;
130		bias-pull-up;
131		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
132		power-source = <PM8941_GPIO_S3>; /* 1.8V */
133        };
134};
135
136&pm8941_lpg {
137	qcom,power-source = <1>;
138	status = "okay";
139
140	led@5 {
141		reg = <5>;
142		color = <LED_COLOR_ID_BLUE>;
143		function = LED_FUNCTION_INDICATOR;
144	};
145
146	led@6 {
147		reg = <6>;
148		color = <LED_COLOR_ID_GREEN>;
149		function = LED_FUNCTION_INDICATOR;
150	};
151
152	led@7 {
153		reg = <7>;
154		color = <LED_COLOR_ID_RED>;
155		function = LED_FUNCTION_INDICATOR;
156	};
157};
158
159&pm8941_wled {
160	qcom,cs-out;
161	qcom,switching-freq = <3200>;
162	qcom,ovp = <32>;
163	qcom,num-strings = <1>;
164
165	status = "okay";
166};
167
168&remoteproc_adsp {
169	cx-supply = <&pm8841_s2>;
170
171	firmware-name = "qcom/apq8074/adsp.mbn";
172
173	status = "okay";
174};
175
176&remoteproc_mss {
177	cx-supply = <&pm8841_s2>;
178	mss-supply = <&pm8841_s3>;
179	mx-supply = <&pm8841_s1>;
180	pll-supply = <&pm8941_l12>;
181
182	firmware-name = "qcom/apq8074/mba.mbn", "qcom/apq8074/modem.mbn";
183
184	status = "okay";
185};
186
187&rpm_requests {
188	regulators-0 {
189		compatible = "qcom,rpm-pm8841-regulators";
190
191		pm8841_s1: s1 {
192			regulator-min-microvolt = <675000>;
193			regulator-max-microvolt = <1050000>;
194		};
195
196		pm8841_s2: s2 {
197			regulator-min-microvolt = <500000>;
198			regulator-max-microvolt = <1050000>;
199		};
200
201		pm8841_s3: s3 {
202			regulator-min-microvolt = <500000>;
203			regulator-max-microvolt = <1050000>;
204		};
205
206		pm8841_s4: s4 {
207			regulator-min-microvolt = <500000>;
208			regulator-max-microvolt = <1050000>;
209		};
210	};
211
212	regulators-1 {
213		compatible = "qcom,rpm-pm8941-regulators";
214
215		vdd_l1_l3-supply = <&pm8941_s1>;
216		vdd_l2_lvs1_2_3-supply = <&pm8941_s3>;
217		vdd_l4_l11-supply = <&pm8941_s1>;
218		vdd_l5_l7-supply = <&pm8941_s2>;
219		vdd_l6_l12_l14_l15-supply = <&pm8941_s2>;
220		vin_5vs-supply = <&pm8941_5v>;
221
222		pm8941_s1: s1 {
223			regulator-min-microvolt = <1300000>;
224			regulator-max-microvolt = <1300000>;
225			regulator-always-on;
226			regulator-boot-on;
227		};
228
229		pm8941_s2: s2 {
230			regulator-min-microvolt = <2150000>;
231			regulator-max-microvolt = <2150000>;
232			regulator-boot-on;
233		};
234
235		pm8941_s3: s3 {
236			regulator-min-microvolt = <1800000>;
237			regulator-max-microvolt = <1800000>;
238			regulator-always-on;
239			regulator-boot-on;
240		};
241
242		pm8941_l1: l1 {
243			regulator-min-microvolt = <1225000>;
244			regulator-max-microvolt = <1225000>;
245			regulator-always-on;
246			regulator-boot-on;
247		};
248
249		pm8941_l2: l2 {
250			regulator-min-microvolt = <1200000>;
251			regulator-max-microvolt = <1200000>;
252		};
253
254		pm8941_l3: l3 {
255			regulator-min-microvolt = <1225000>;
256			regulator-max-microvolt = <1225000>;
257		};
258
259		pm8941_l4: l4 {
260			regulator-min-microvolt = <1225000>;
261			regulator-max-microvolt = <1225000>;
262		};
263
264		pm8941_l5: l5 {
265			regulator-min-microvolt = <1800000>;
266			regulator-max-microvolt = <1800000>;
267		};
268
269		pm8941_l6: l6 {
270			regulator-min-microvolt = <1800000>;
271			regulator-max-microvolt = <1800000>;
272			regulator-boot-on;
273		};
274
275		pm8941_l7: l7 {
276			regulator-min-microvolt = <1800000>;
277			regulator-max-microvolt = <1800000>;
278			regulator-boot-on;
279		};
280
281		pm8941_l8: l8 {
282			regulator-min-microvolt = <1800000>;
283			regulator-max-microvolt = <1800000>;
284		};
285
286		pm8941_l9: l9 {
287			regulator-min-microvolt = <1800000>;
288			regulator-max-microvolt = <2950000>;
289		};
290
291		pm8941_l10: l10 {
292			regulator-min-microvolt = <1800000>;
293			regulator-max-microvolt = <1800000>;
294			regulator-always-on;
295		};
296
297		pm8941_l11: l11 {
298			regulator-min-microvolt = <1300000>;
299			regulator-max-microvolt = <1300000>;
300		};
301
302		pm8941_l12: l12 {
303			regulator-min-microvolt = <1800000>;
304			regulator-max-microvolt = <1800000>;
305			regulator-always-on;
306			regulator-boot-on;
307		};
308
309		pm8941_l13: l13 {
310			regulator-min-microvolt = <1800000>;
311			regulator-max-microvolt = <2950000>;
312			regulator-boot-on;
313		};
314
315		pm8941_l14: l14 {
316			regulator-min-microvolt = <1800000>;
317			regulator-max-microvolt = <1800000>;
318		};
319
320		pm8941_l15: l15 {
321			regulator-min-microvolt = <2050000>;
322			regulator-max-microvolt = <2050000>;
323		};
324
325		pm8941_l16: l16 {
326			regulator-min-microvolt = <2700000>;
327			regulator-max-microvolt = <2700000>;
328		};
329
330		pm8941_l17: l17 {
331			regulator-min-microvolt = <2700000>;
332			regulator-max-microvolt = <2700000>;
333		};
334
335		pm8941_l18: l18 {
336			regulator-min-microvolt = <2850000>;
337			regulator-max-microvolt = <2850000>;
338		};
339
340		pm8941_l19: l19 {
341			regulator-min-microvolt = <3300000>;
342			regulator-max-microvolt = <3300000>;
343			regulator-always-on;
344		};
345
346		pm8941_l20: l20 {
347			regulator-min-microvolt = <2950000>;
348			regulator-max-microvolt = <2950000>;
349			regulator-system-load = <200000>;
350			regulator-allow-set-load;
351			regulator-boot-on;
352		};
353
354		pm8941_l21: l21 {
355			regulator-min-microvolt = <2950000>;
356			regulator-max-microvolt = <2950000>;
357			regulator-boot-on;
358		};
359
360		pm8941_l22: l22 {
361			regulator-min-microvolt = <3000000>;
362			regulator-max-microvolt = <3000000>;
363		};
364
365		pm8941_l23: l23 {
366			regulator-min-microvolt = <3000000>;
367			regulator-max-microvolt = <3000000>;
368		};
369
370		pm8941_l24: l24 {
371			regulator-min-microvolt = <3075000>;
372			regulator-max-microvolt = <3075000>;
373			regulator-boot-on;
374		};
375	};
376};
377
378&sdhc_1 {
379	status = "okay";
380
381	vmmc-supply = <&pm8941_l20>;
382	vqmmc-supply = <&pm8941_s3>;
383
384	pinctrl-names = "default", "sleep";
385	pinctrl-0 = <&sdc1_on>;
386	pinctrl-1 = <&sdc1_off>;
387};
388
389&sdhc_2 {
390	status = "okay";
391
392	cd-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;
393	vmmc-supply = <&pm8941_l21>;
394	vqmmc-supply = <&pm8941_l13>;
395
396	pinctrl-names = "default", "sleep";
397	pinctrl-0 = <&sdc2_on>;
398	pinctrl-1 = <&sdc2_off>;
399};
400
401&tlmm {
402	sdc1_on: sdc1-on-state {
403		clk-pins {
404			pins = "sdc1_clk";
405			drive-strength = <16>;
406			bias-disable;
407		};
408
409		cmd-data-pins {
410			pins = "sdc1_cmd", "sdc1_data";
411			drive-strength = <10>;
412			bias-pull-up;
413		};
414	};
415
416	sdc2_on: sdc2-on-state {
417		clk-pins {
418			pins = "sdc2_clk";
419			drive-strength = <10>;
420			bias-disable;
421		};
422
423		cmd-data-pins {
424			pins = "sdc2_cmd", "sdc2_data";
425			drive-strength = <6>;
426			bias-pull-up;
427		};
428
429		cd-pins {
430			pins = "gpio62";
431			function = "gpio";
432			drive-strength = <2>;
433			bias-disable;
434		};
435	};
436};
437
438&usb {
439	status = "okay";
440
441	phys = <&usb_hs2_phy>;
442	phy-select = <&tcsr 0xb000 1>;
443	extcon = <&smbb>, <&usb_id>;
444	vbus-supply = <&chg_otg>;
445	hnp-disable;
446	srp-disable;
447	adp-disable;
448};
449
450&usb_hs2_phy {
451	status = "okay";
452	v3p3-supply = <&pm8941_l24>;
453	v1p8-supply = <&pm8941_l6>;
454	extcon = <&smbb>;
455	qcom,init-seq = /bits/ 8 <0x1 0x63>;
456};
457