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_resin {
160	linux,code = <KEY_VOLUMEDOWN>;
161	status = "okay";
162};
163
164&pm8941_wled {
165	qcom,cs-out;
166	qcom,switching-freq = <3200>;
167	qcom,ovp = <32>;
168	qcom,num-strings = <1>;
169
170	status = "okay";
171};
172
173&remoteproc_adsp {
174	cx-supply = <&pm8841_s2>;
175
176	firmware-name = "qcom/apq8074/adsp.mbn";
177
178	status = "okay";
179};
180
181&remoteproc_mss {
182	cx-supply = <&pm8841_s2>;
183	mss-supply = <&pm8841_s3>;
184	mx-supply = <&pm8841_s1>;
185	pll-supply = <&pm8941_l12>;
186
187	firmware-name = "qcom/apq8074/mba.mbn", "qcom/apq8074/modem.mbn";
188
189	status = "okay";
190};
191
192&rpm_requests {
193	regulators-0 {
194		compatible = "qcom,rpm-pm8841-regulators";
195
196		pm8841_s1: s1 {
197			regulator-min-microvolt = <675000>;
198			regulator-max-microvolt = <1050000>;
199		};
200
201		pm8841_s2: s2 {
202			regulator-min-microvolt = <500000>;
203			regulator-max-microvolt = <1050000>;
204		};
205
206		pm8841_s3: s3 {
207			regulator-min-microvolt = <500000>;
208			regulator-max-microvolt = <1050000>;
209		};
210
211		pm8841_s4: s4 {
212			regulator-min-microvolt = <500000>;
213			regulator-max-microvolt = <1050000>;
214		};
215	};
216
217	regulators-1 {
218		compatible = "qcom,rpm-pm8941-regulators";
219
220		vdd_l1_l3-supply = <&pm8941_s1>;
221		vdd_l2_lvs1_2_3-supply = <&pm8941_s3>;
222		vdd_l4_l11-supply = <&pm8941_s1>;
223		vdd_l5_l7-supply = <&pm8941_s2>;
224		vdd_l6_l12_l14_l15-supply = <&pm8941_s2>;
225		vin_5vs-supply = <&pm8941_5v>;
226
227		pm8941_s1: s1 {
228			regulator-min-microvolt = <1300000>;
229			regulator-max-microvolt = <1300000>;
230			regulator-always-on;
231			regulator-boot-on;
232		};
233
234		pm8941_s2: s2 {
235			regulator-min-microvolt = <2150000>;
236			regulator-max-microvolt = <2150000>;
237			regulator-boot-on;
238		};
239
240		pm8941_s3: s3 {
241			regulator-min-microvolt = <1800000>;
242			regulator-max-microvolt = <1800000>;
243			regulator-always-on;
244			regulator-boot-on;
245		};
246
247		pm8941_l1: l1 {
248			regulator-min-microvolt = <1225000>;
249			regulator-max-microvolt = <1225000>;
250			regulator-always-on;
251			regulator-boot-on;
252		};
253
254		pm8941_l2: l2 {
255			regulator-min-microvolt = <1200000>;
256			regulator-max-microvolt = <1200000>;
257		};
258
259		pm8941_l3: l3 {
260			regulator-min-microvolt = <1225000>;
261			regulator-max-microvolt = <1225000>;
262		};
263
264		pm8941_l4: l4 {
265			regulator-min-microvolt = <1225000>;
266			regulator-max-microvolt = <1225000>;
267		};
268
269		pm8941_l5: l5 {
270			regulator-min-microvolt = <1800000>;
271			regulator-max-microvolt = <1800000>;
272		};
273
274		pm8941_l6: l6 {
275			regulator-min-microvolt = <1800000>;
276			regulator-max-microvolt = <1800000>;
277			regulator-boot-on;
278		};
279
280		pm8941_l7: l7 {
281			regulator-min-microvolt = <1800000>;
282			regulator-max-microvolt = <1800000>;
283			regulator-boot-on;
284		};
285
286		pm8941_l8: l8 {
287			regulator-min-microvolt = <1800000>;
288			regulator-max-microvolt = <1800000>;
289		};
290
291		pm8941_l9: l9 {
292			regulator-min-microvolt = <1800000>;
293			regulator-max-microvolt = <2950000>;
294		};
295
296		pm8941_l10: l10 {
297			regulator-min-microvolt = <1800000>;
298			regulator-max-microvolt = <1800000>;
299			regulator-always-on;
300		};
301
302		pm8941_l11: l11 {
303			regulator-min-microvolt = <1300000>;
304			regulator-max-microvolt = <1300000>;
305		};
306
307		pm8941_l12: l12 {
308			regulator-min-microvolt = <1800000>;
309			regulator-max-microvolt = <1800000>;
310			regulator-always-on;
311			regulator-boot-on;
312		};
313
314		pm8941_l13: l13 {
315			regulator-min-microvolt = <1800000>;
316			regulator-max-microvolt = <2950000>;
317			regulator-boot-on;
318		};
319
320		pm8941_l14: l14 {
321			regulator-min-microvolt = <1800000>;
322			regulator-max-microvolt = <1800000>;
323		};
324
325		pm8941_l15: l15 {
326			regulator-min-microvolt = <2050000>;
327			regulator-max-microvolt = <2050000>;
328		};
329
330		pm8941_l16: l16 {
331			regulator-min-microvolt = <2700000>;
332			regulator-max-microvolt = <2700000>;
333		};
334
335		pm8941_l17: l17 {
336			regulator-min-microvolt = <2700000>;
337			regulator-max-microvolt = <2700000>;
338		};
339
340		pm8941_l18: l18 {
341			regulator-min-microvolt = <2850000>;
342			regulator-max-microvolt = <2850000>;
343		};
344
345		pm8941_l19: l19 {
346			regulator-min-microvolt = <3300000>;
347			regulator-max-microvolt = <3300000>;
348			regulator-always-on;
349		};
350
351		pm8941_l20: l20 {
352			regulator-min-microvolt = <2950000>;
353			regulator-max-microvolt = <2950000>;
354			regulator-system-load = <200000>;
355			regulator-allow-set-load;
356			regulator-boot-on;
357		};
358
359		pm8941_l21: l21 {
360			regulator-min-microvolt = <2950000>;
361			regulator-max-microvolt = <2950000>;
362			regulator-boot-on;
363		};
364
365		pm8941_l22: l22 {
366			regulator-min-microvolt = <3000000>;
367			regulator-max-microvolt = <3000000>;
368		};
369
370		pm8941_l23: l23 {
371			regulator-min-microvolt = <3000000>;
372			regulator-max-microvolt = <3000000>;
373		};
374
375		pm8941_l24: l24 {
376			regulator-min-microvolt = <3075000>;
377			regulator-max-microvolt = <3075000>;
378			regulator-boot-on;
379		};
380	};
381};
382
383&sdhc_1 {
384	status = "okay";
385
386	vmmc-supply = <&pm8941_l20>;
387	vqmmc-supply = <&pm8941_s3>;
388
389	pinctrl-names = "default", "sleep";
390	pinctrl-0 = <&sdc1_on>;
391	pinctrl-1 = <&sdc1_off>;
392};
393
394&sdhc_2 {
395	status = "okay";
396
397	cd-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;
398	vmmc-supply = <&pm8941_l21>;
399	vqmmc-supply = <&pm8941_l13>;
400
401	pinctrl-names = "default", "sleep";
402	pinctrl-0 = <&sdc2_on>;
403	pinctrl-1 = <&sdc2_off>;
404};
405
406&tlmm {
407	sdc1_on: sdc1-on-state {
408		clk-pins {
409			pins = "sdc1_clk";
410			drive-strength = <16>;
411			bias-disable;
412		};
413
414		cmd-data-pins {
415			pins = "sdc1_cmd", "sdc1_data";
416			drive-strength = <10>;
417			bias-pull-up;
418		};
419	};
420
421	sdc2_on: sdc2-on-state {
422		clk-pins {
423			pins = "sdc2_clk";
424			drive-strength = <10>;
425			bias-disable;
426		};
427
428		cmd-data-pins {
429			pins = "sdc2_cmd", "sdc2_data";
430			drive-strength = <6>;
431			bias-pull-up;
432		};
433
434		cd-pins {
435			pins = "gpio62";
436			function = "gpio";
437			drive-strength = <2>;
438			bias-disable;
439		};
440	};
441};
442
443&usb {
444	status = "okay";
445
446	phys = <&usb_hs2_phy>;
447	phy-select = <&tcsr 0xb000 1>;
448	extcon = <&smbb>, <&usb_id>;
449	vbus-supply = <&chg_otg>;
450	hnp-disable;
451	srp-disable;
452	adp-disable;
453};
454
455&usb_hs2_phy {
456	status = "okay";
457	v3p3-supply = <&pm8941_l24>;
458	v1p8-supply = <&pm8941_l6>;
459	extcon = <&smbb>;
460	qcom,init-seq = /bits/ 8 <0x1 0x63>;
461};
462