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