1// SPDX-License-Identifier: GPL-2.0
2#include <dt-bindings/gpio/gpio.h>
3#include <dt-bindings/leds/common.h>
4#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
5
6#include "qcom-apq8064-v2.0.dtsi"
7#include "pm8821.dtsi"
8#include "pm8921.dtsi"
9
10/ {
11	model = "Qualcomm APQ8064/IFC6410";
12	compatible = "qcom,apq8064-ifc6410", "qcom,apq8064";
13
14	aliases {
15		serial0 = &gsbi7_serial;
16		serial1 = &gsbi6_serial;
17		i2c0 = &gsbi1_i2c;
18		i2c1 = &gsbi2_i2c;
19		i2c2 = &gsbi3_i2c;
20		i2c3 = &gsbi4_i2c;
21		spi0 = &gsbi5_spi;
22	};
23
24	chosen {
25		stdout-path = "serial0:115200n8";
26	};
27
28	leds {
29		compatible = "gpio-leds";
30		pinctrl-names = "default";
31		pinctrl-0 = <&notify_led>;
32
33		led-user1 {
34			label = "apq8064:green:user1";
35			color = <LED_COLOR_ID_GREEN>;
36			gpios = <&pm8921_gpio 18 GPIO_ACTIVE_HIGH>;
37			default-state = "on";
38		};
39	};
40
41	hdmi-out {
42		compatible = "hdmi-connector";
43		type = "d";
44
45		port {
46			hdmi_con: endpoint {
47				remote-endpoint = <&hdmi_out>;
48			};
49		};
50	};
51
52	sdcc4_pwrseq: pwrseq-sdcc4 {
53		pinctrl-names = "default";
54		pinctrl-0 = <&wlan_default_gpios>;
55		compatible = "mmc-pwrseq-simple";
56		reset-gpios = <&pm8921_gpio 43 GPIO_ACTIVE_LOW>;
57	};
58
59	ext_3p3v: regulator-ext-3p3v {
60		compatible = "regulator-fixed";
61		regulator-min-microvolt = <3300000>;
62		regulator-max-microvolt = <3300000>;
63		regulator-name = "ext_3p3v";
64		startup-delay-us = <0>;
65		gpio = <&tlmm_pinmux 77 GPIO_ACTIVE_HIGH>;
66		enable-active-high;
67		regulator-boot-on;
68	};
69};
70
71&gsbi1 {
72	qcom,mode = <GSBI_PROT_I2C>;
73	status = "okay";
74};
75
76&gsbi1_i2c {
77	clock-frequency = <200000>;
78	status = "okay";
79
80	eeprom@52 {
81		compatible = "atmel,24c128";
82		reg = <0x52>;
83		pagesize = <32>;
84	};
85};
86
87&gsbi3 {
88	qcom,mode = <GSBI_PROT_I2C>;
89	status = "okay";
90};
91
92&gsbi3_i2c {
93	status = "okay";
94};
95
96&gsbi4 {
97	qcom,mode = <GSBI_PROT_I2C>;
98	status = "okay";
99};
100
101/* CAM I2C MIPI-CSI connector */
102&gsbi4_i2c {
103	status = "okay";
104};
105
106&gsbi5 {
107	qcom,mode = <GSBI_PROT_SPI>;
108	status = "okay";
109};
110
111&gsbi5_spi {
112	num-cs = <1>;
113	cs-gpios = <&tlmm_pinmux 53 0>;
114	status = "okay";
115};
116
117&gsbi6 {
118	qcom,mode = <GSBI_PROT_UART_W_FC>;
119	status = "okay";
120};
121
122&gsbi6_serial {
123	pinctrl-names = "default";
124	pinctrl-0 = <&gsbi6_uart_4pins>;
125	status = "okay";
126};
127
128&gsbi7 {
129	qcom,mode = <GSBI_PROT_I2C_UART>;
130	status = "okay";
131};
132
133&gsbi7_serial {
134	pinctrl-names = "default";
135	pinctrl-0 = <&gsbi7_uart_2pins>;
136	status = "okay";
137};
138
139&hdmi {
140	core-vdda-supply = <&pm8921_hdmi_switch>;
141	hpd-gpios = <&tlmm_pinmux 72 GPIO_ACTIVE_HIGH>;
142	status = "okay";
143};
144
145&hdmi_in {
146	remote-endpoint = <&mdp_dtv_out>;
147};
148
149&hdmi_out {
150	remote-endpoint = <&hdmi_con>;
151};
152
153&hdmi_phy {
154	status = "okay";
155	core-vdda-supply = <&pm8921_hdmi_switch>;
156};
157
158&mdp {
159	status = "okay";
160};
161
162&mdp_dtv_out {
163	remote-endpoint = <&hdmi_in>;
164};
165
166&pcie {
167	status = "okay";
168	vdda-supply = <&pm8921_s3>;
169	vdda_phy-supply = <&pm8921_lvs6>;
170	vdda_refclk-supply = <&ext_3p3v>;
171	pinctrl-0 = <&pcie_pins>;
172	pinctrl-names = "default";
173	perst-gpios = <&tlmm_pinmux 27 GPIO_ACTIVE_LOW>;
174};
175
176&pm8821 {
177	interrupts-extended = <&tlmm_pinmux 76 IRQ_TYPE_LEVEL_LOW>;
178};
179
180&pm8921 {
181	interrupts-extended = <&tlmm_pinmux 74 IRQ_TYPE_LEVEL_LOW>;
182};
183
184&pm8921_gpio {
185	wlan_default_gpios: wlan-gpios-state {
186		pinconf {
187			pins = "gpio43";
188			function = "normal";
189			bias-disable;
190			power-source = <PM8921_GPIO_S4>;
191		};
192	};
193
194	notify_led: nled-state {
195		pinconf {
196			pins = "gpio18";
197			function = "normal";
198			bias-disable;
199			power-source = <PM8921_GPIO_S4>;
200		};
201	};
202};
203
204&rpm {
205	regulators {
206		compatible = "qcom,rpm-pm8921-regulators";
207
208		vin_lvs1_3_6-supply = <&pm8921_s4>;
209		vin_lvs2-supply = <&pm8921_s1>;
210		vin_lvs4_5_7-supply = <&pm8921_s4>;
211
212		vdd_l1_l2_l12_l18-supply = <&pm8921_s4>;
213		vdd_l24-supply = <&pm8921_s1>;
214		vdd_l25-supply = <&pm8921_s1>;
215		vdd_l26-supply = <&pm8921_s7>;
216		vdd_l27-supply = <&pm8921_s7>;
217		vdd_l28-supply = <&pm8921_s7>;
218
219		/* Buck SMPS */
220		pm8921_s1: s1 {
221			regulator-always-on;
222			regulator-min-microvolt = <1225000>;
223			regulator-max-microvolt = <1225000>;
224			qcom,switch-mode-frequency = <3200000>;
225			bias-pull-down;
226		};
227
228		pm8921_s3: s3 {
229			regulator-min-microvolt = <1000000>;
230			regulator-max-microvolt = <1400000>;
231			qcom,switch-mode-frequency = <4800000>;
232		};
233
234		pm8921_s4: s4 {
235			regulator-min-microvolt = <1800000>;
236			regulator-max-microvolt = <1800000>;
237			qcom,switch-mode-frequency = <3200000>;
238		};
239
240		pm8921_s7: s7 {
241			regulator-min-microvolt = <1300000>;
242			regulator-max-microvolt = <1300000>;
243			qcom,switch-mode-frequency = <3200000>;
244		};
245
246		pm8921_l3: l3 {
247			regulator-min-microvolt = <3050000>;
248			regulator-max-microvolt = <3300000>;
249			bias-pull-down;
250		};
251
252		pm8921_l4: l4 {
253			regulator-min-microvolt = <1000000>;
254			regulator-max-microvolt = <1800000>;
255			bias-pull-down;
256		};
257
258		pm8921_l5: l5 {
259			regulator-min-microvolt = <2750000>;
260			regulator-max-microvolt = <3000000>;
261			bias-pull-down;
262		};
263
264		pm8921_l6: l6 {
265			regulator-min-microvolt = <2950000>;
266			regulator-max-microvolt = <2950000>;
267			bias-pull-down;
268		};
269
270		pm8921_l23: l23 {
271			regulator-min-microvolt = <1700000>;
272			regulator-max-microvolt = <1900000>;
273			bias-pull-down;
274		};
275
276		pm8921_lvs1: lvs1 {
277			bias-pull-down;
278		};
279
280		pm8921_lvs6: lvs6 {
281			bias-pull-down;
282		};
283
284		pm8921_hdmi_switch: hdmi-switch {
285			bias-pull-down;
286		};
287	};
288};
289
290&sata_phy0 {
291	status = "okay";
292};
293
294&sata0 {
295	target-supply = <&pm8921_s4>;
296	status = "okay";
297};
298
299/* eMMC */
300&sdcc1 {
301	vmmc-supply = <&pm8921_l5>;
302	vqmmc-supply = <&pm8921_s4>;
303	status = "okay";
304};
305
306/* External micro SD card */
307&sdcc3 {
308	vmmc-supply = <&pm8921_l6>;
309	pinctrl-names = "default";
310	pinctrl-0 = <&card_detect>;
311	cd-gpios = <&tlmm_pinmux 26 GPIO_ACTIVE_LOW>;
312	status = "okay";
313};
314
315/* WLAN */
316&sdcc4 {
317	vmmc-supply = <&ext_3p3v>;
318	vqmmc-supply = <&pm8921_lvs1>;
319	mmc-pwrseq = <&sdcc4_pwrseq>;
320	status = "okay";
321};
322
323&tlmm_pinmux {
324	card_detect: card_detect {
325		mux {
326			pins = "gpio26";
327			function = "gpio";
328			bias-disable;
329		};
330	};
331
332	pcie_pins: pcie_pinmux {
333		mux {
334			pins = "gpio27";
335			function = "gpio";
336		};
337		conf {
338			pins = "gpio27";
339			drive-strength = <12>;
340			bias-disable;
341		};
342	};
343};
344
345&usb_hs1_phy {
346	v3p3-supply = <&pm8921_l3>;
347	v1p8-supply = <&pm8921_l4>;
348};
349
350&usb_hs3_phy {
351	v3p3-supply = <&pm8921_l3>;
352	v1p8-supply = <&pm8921_l23>;
353};
354
355&usb_hs4_phy {
356	v3p3-supply = <&pm8921_l3>;
357	v1p8-supply = <&pm8921_l23>;
358};
359
360/* OTG */
361&usb1 {
362	dr_mode = "otg";
363	status = "okay";
364};
365
366&usb3 {
367	dr_mode = "host";
368	status = "okay";
369};
370
371&usb4 {
372	dr_mode = "host";
373	status = "okay";
374};
375