xref: /linux/arch/arm64/boot/dts/qcom/apq8016-sbc.dts (revision ec71f661a572a770d7c861cd52a50cbbb0e1a8d1)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
4 */
5
6/dts-v1/;
7
8#include "msm8916-pm8916.dtsi"
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/input/input.h>
11#include <dt-bindings/leds/common.h>
12#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
13#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
14#include <dt-bindings/sound/apq8016-lpass.h>
15
16/ {
17	model = "Qualcomm Technologies, Inc. APQ 8016 SBC";
18	compatible = "qcom,apq8016-sbc", "qcom,apq8016";
19
20	aliases {
21		mmc0 = &sdhc_1; /* eMMC */
22		mmc1 = &sdhc_2; /* SD card */
23		serial0 = &blsp_uart2;
24		serial1 = &blsp_uart1;
25		usid0 = &pm8916_0;
26		i2c0 = &blsp_i2c2;
27		i2c1 = &blsp_i2c6;
28		i2c3 = &blsp_i2c4;
29		spi0 = &blsp_spi5;
30		spi1 = &blsp_spi3;
31	};
32
33	chosen {
34		stdout-path = "serial0";
35	};
36
37	reserved-memory {
38		ramoops@bff00000 {
39			compatible = "ramoops";
40			reg = <0x0 0xbff00000 0x0 0x100000>;
41
42			record-size = <0x20000>;
43			console-size = <0x20000>;
44			ftrace-size = <0x20000>;
45		};
46	};
47
48	usb2513 {
49		compatible = "smsc,usb3503";
50		reset-gpios = <&pm8916_gpios 3 GPIO_ACTIVE_LOW>;
51		initial-mode = <1>;
52	};
53
54	usb_id: usb-id {
55		compatible = "linux,extcon-usb-gpio";
56		id-gpios = <&tlmm 121 GPIO_ACTIVE_HIGH>;
57		pinctrl-names = "default";
58		pinctrl-0 = <&usb_id_default>;
59	};
60
61	hdmi-out {
62		compatible = "hdmi-connector";
63		type = "a";
64
65		port {
66			hdmi_con: endpoint {
67				remote-endpoint = <&adv7533_out>;
68			};
69		};
70	};
71
72	gpio-keys {
73		compatible = "gpio-keys";
74		autorepeat;
75
76		pinctrl-names = "default";
77		pinctrl-0 = <&msm_key_volp_n_default>;
78
79		button {
80			label = "Volume Up";
81			linux,code = <KEY_VOLUMEUP>;
82			gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
83		};
84	};
85
86	leds {
87		pinctrl-names = "default";
88		pinctrl-0 = <&tlmm_leds>,
89			    <&pm8916_gpios_leds>,
90			    <&pm8916_mpps_leds>;
91
92		compatible = "gpio-leds";
93
94		led-1 {
95			label = "apq8016-sbc:green:user1";
96			function = LED_FUNCTION_HEARTBEAT;
97			color = <LED_COLOR_ID_GREEN>;
98			gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
99			linux,default-trigger = "heartbeat";
100			default-state = "off";
101		};
102
103		led-2 {
104			label = "apq8016-sbc:green:user2";
105			function = LED_FUNCTION_DISK_ACTIVITY;
106			color = <LED_COLOR_ID_GREEN>;
107			gpios = <&tlmm 120 GPIO_ACTIVE_HIGH>;
108			linux,default-trigger = "mmc0";
109			default-state = "off";
110		};
111
112		led-3 {
113			label = "apq8016-sbc:green:user3";
114			function = LED_FUNCTION_DISK_ACTIVITY;
115			color = <LED_COLOR_ID_GREEN>;
116			gpios = <&pm8916_gpios 1 GPIO_ACTIVE_HIGH>;
117			linux,default-trigger = "mmc1";
118			default-state = "off";
119		};
120
121		led-4 {
122			label = "apq8016-sbc:green:user4";
123			color = <LED_COLOR_ID_GREEN>;
124			gpios = <&pm8916_gpios 2 GPIO_ACTIVE_HIGH>;
125			linux,default-trigger = "none";
126			panic-indicator;
127			default-state = "off";
128		};
129
130		led-5 {
131			label = "apq8016-sbc:yellow:wlan";
132			function = LED_FUNCTION_WLAN;
133			color = <LED_COLOR_ID_YELLOW>;
134			gpios = <&pm8916_mpps 2 GPIO_ACTIVE_HIGH>;
135			linux,default-trigger = "phy0tx";
136			default-state = "off";
137		};
138
139		led-6 {
140			label = "apq8016-sbc:blue:bt";
141			function = LED_FUNCTION_BLUETOOTH;
142			color = <LED_COLOR_ID_BLUE>;
143			gpios = <&pm8916_mpps 3 GPIO_ACTIVE_HIGH>;
144			linux,default-trigger = "bluetooth-power";
145			default-state = "off";
146		};
147	};
148};
149
150&blsp_i2c2 {
151	/* On Low speed expansion: LS-I2C0 */
152	status = "okay";
153};
154
155&blsp_i2c4 {
156	/* On High speed expansion: HS-I2C2 */
157	status = "okay";
158
159	adv_bridge: bridge@39 {
160		status = "okay";
161
162		compatible = "adi,adv7533";
163		reg = <0x39>;
164
165		interrupt-parent = <&tlmm>;
166		interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
167
168		adi,dsi-lanes = <4>;
169		clocks = <&rpmcc RPM_SMD_BB_CLK2>;
170		clock-names = "cec";
171
172		pd-gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>;
173
174		avdd-supply = <&pm8916_l6>;
175		a2vdd-supply = <&pm8916_l6>;
176		dvdd-supply = <&pm8916_l6>;
177		pvdd-supply = <&pm8916_l6>;
178		v1p2-supply = <&pm8916_l6>;
179		v3p3-supply = <&pm8916_l17>;
180
181		pinctrl-names = "default","sleep";
182		pinctrl-0 = <&adv7533_int_active &adv7533_switch_active>;
183		pinctrl-1 = <&adv7533_int_suspend &adv7533_switch_suspend>;
184		#sound-dai-cells = <1>;
185
186		ports {
187			#address-cells = <1>;
188			#size-cells = <0>;
189
190			port@0 {
191				reg = <0>;
192				adv7533_in: endpoint {
193					remote-endpoint = <&mdss_dsi0_out>;
194				};
195			};
196
197			port@1 {
198				reg = <1>;
199				adv7533_out: endpoint {
200					remote-endpoint = <&hdmi_con>;
201				};
202			};
203		};
204	};
205};
206
207&blsp_i2c6 {
208	/* On Low speed expansion: LS-I2C1 */
209	status = "okay";
210};
211
212&blsp_spi3 {
213	/* On High speed expansion: HS-SPI1 */
214	status = "okay";
215};
216
217&blsp_spi5 {
218	/* On Low speed expansion: LS-SPI0 */
219	status = "okay";
220};
221
222&blsp_uart1 {
223	status = "okay";
224	label = "LS-UART0";
225	pinctrl-0 = <&blsp_uart1_default>;
226	pinctrl-1 = <&blsp_uart1_sleep>;
227	pinctrl-names = "default", "sleep";
228};
229
230&blsp_uart2 {
231	status = "okay";
232	label = "LS-UART1";
233	pinctrl-0 = <&blsp_uart2_console_default>;
234	pinctrl-1 = <&blsp_uart2_console_sleep>;
235	pinctrl-names = "default", "sleep";
236};
237
238&camss {
239	status = "okay";
240};
241
242&gpu {
243	status = "okay";
244};
245
246&lpass {
247	status = "okay";
248};
249
250&lpass_codec {
251	status = "okay";
252};
253
254&mba_mem {
255	status = "okay";
256};
257
258&mdss {
259	status = "okay";
260};
261
262&mdss_dsi0_out {
263	data-lanes = <0 1 2 3>;
264	remote-endpoint = <&adv7533_in>;
265};
266
267&mpss {
268	status = "okay";
269
270	firmware-name = "qcom/apq8016/mba.mbn", "qcom/apq8016/modem.mbn";
271};
272
273&mpss_mem {
274	status = "okay";
275	reg = <0x0 0x86800000 0x0 0x2b00000>;
276};
277
278&pm8916_codec {
279	status = "okay";
280	qcom,mbhc-vthreshold-low = <75 150 237 450 500>;
281	qcom,mbhc-vthreshold-high = <75 150 237 450 500>;
282};
283
284&pm8916_resin {
285	status = "okay";
286	linux,code = <KEY_VOLUMEDOWN>;
287};
288
289&pm8916_rpm_regulators {
290	/*
291	 * The 96Boards specification expects a 1.8V power rail on the low-speed
292	 * expansion connector that is able to provide at least 0.18W / 100 mA.
293	 * L15/L16 are connected in parallel to provide 55 mA each. A minimum load
294	 * must be specified to ensure the regulators are not put in LPM where they
295	 * would only provide 5 mA.
296	 */
297	pm8916_l15: l15 {
298		regulator-min-microvolt = <1800000>;
299		regulator-max-microvolt = <1800000>;
300		regulator-system-load = <50000>;
301		regulator-allow-set-load;
302		regulator-always-on;
303	};
304	pm8916_l16: l16 {
305		regulator-min-microvolt = <1800000>;
306		regulator-max-microvolt = <1800000>;
307		regulator-system-load = <50000>;
308		regulator-allow-set-load;
309		regulator-always-on;
310	};
311
312	pm8916_l17: l17 {
313		regulator-min-microvolt = <3300000>;
314		regulator-max-microvolt = <3300000>;
315	};
316};
317
318&sdhc_1 {
319	status = "okay";
320};
321
322&sdhc_2 {
323	status = "okay";
324
325	pinctrl-names = "default", "sleep";
326	pinctrl-0 = <&sdc2_default &sdc2_cd_default>;
327	pinctrl-1 = <&sdc2_sleep &sdc2_cd_default>;
328
329	cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
330};
331
332&sound {
333	status = "okay";
334
335	pinctrl-0 = <&cdc_pdm_default &sec_mi2s_default>;
336	pinctrl-1 = <&cdc_pdm_sleep &sec_mi2s_sleep>;
337	pinctrl-names = "default", "sleep";
338	model = "DB410c";
339	audio-routing =
340		"AMIC2", "MIC BIAS Internal2",
341		"AMIC3", "MIC BIAS External1";
342
343	quaternary-dai-link {
344		link-name = "ADV7533";
345		cpu {
346			sound-dai = <&lpass MI2S_QUATERNARY>;
347		};
348		codec {
349			sound-dai = <&adv_bridge 0>;
350		};
351	};
352
353	primary-dai-link {
354		link-name = "WCD";
355		cpu {
356			sound-dai = <&lpass MI2S_PRIMARY>;
357		};
358		codec {
359			sound-dai = <&lpass_codec 0>, <&pm8916_codec 0>;
360		};
361	};
362
363	tertiary-dai-link {
364		link-name = "WCD-Capture";
365		cpu {
366			sound-dai = <&lpass MI2S_TERTIARY>;
367		};
368		codec {
369			sound-dai = <&lpass_codec 1>, <&pm8916_codec 1>;
370		};
371	};
372};
373
374&usb {
375	status = "okay";
376	extcon = <&usb_id>, <&usb_id>;
377
378	pinctrl-names = "default", "device";
379	pinctrl-0 = <&usb_sw_sel_pm &usb_hub_reset_pm>;
380	pinctrl-1 = <&usb_sw_sel_pm_device &usb_hub_reset_pm_device>;
381};
382
383&usb_hs_phy {
384	extcon = <&usb_id>;
385};
386
387&venus {
388	status = "okay";
389};
390
391&venus_mem {
392	status = "okay";
393};
394
395&wcnss {
396	status = "okay";
397	firmware-name = "qcom/apq8016/wcnss.mbn";
398};
399
400&wcnss_ctrl {
401	firmware-name = "qcom/apq8016/WCNSS_qcom_wlan_nv_sbc.bin";
402};
403
404&wcnss_iris {
405	compatible = "qcom,wcn3620";
406};
407
408&wcnss_mem {
409	status = "okay";
410};
411
412/* Enable CoreSight */
413&cti0 { status = "okay"; };
414&cti1 { status = "okay"; };
415&cti12 { status = "okay"; };
416&cti13 { status = "okay"; };
417&cti14 { status = "okay"; };
418&cti15 { status = "okay"; };
419&debug0 { status = "okay"; };
420&debug1 { status = "okay"; };
421&debug2 { status = "okay"; };
422&debug3 { status = "okay"; };
423&etf { status = "okay"; };
424&etm0 { status = "okay"; };
425&etm1 { status = "okay"; };
426&etm2 { status = "okay"; };
427&etm3 { status = "okay"; };
428&etr { status = "okay"; };
429&funnel0 { status = "okay"; };
430&funnel1 { status = "okay"; };
431&replicator { status = "okay"; };
432&stm { status = "okay"; };
433&tpiu { status = "okay"; };
434
435/*
436 * 2mA drive strength is not enough when connecting multiple
437 * I2C devices with different pull up resistors.
438 */
439&blsp_i2c2_default {
440	drive-strength = <16>;
441};
442
443&blsp_i2c4_default {
444	drive-strength = <16>;
445};
446
447&blsp_i2c6_default {
448	drive-strength = <16>;
449};
450
451/*
452 * GPIO name legend: proper name = the GPIO line is used as GPIO
453 *         NC = not connected (pin out but not routed from the chip to
454 *              anything the board)
455 *         "[PER]" = pin is muxed for [peripheral] (not GPIO)
456 *         LSEC = Low Speed External Connector
457 *         HSEC = High Speed External Connector
458 *
459 * Line names are taken from the schematic "DragonBoard410c"
460 * dated monday, august 31, 2015. Page 5 in particular.
461 *
462 * For the lines routed to the external connectors the
463 * lines are named after the 96Boards CE Specification 1.0,
464 * Appendix "Expansion Connector Signal Description".
465 *
466 * When the 96Board naming of a line and the schematic name of
467 * the same line are in conflict, the 96Board specification
468 * takes precedence, which means that the external UART on the
469 * LSEC is named UART0 while the schematic and SoC names this
470 * UART3. This is only for the informational lines i.e. "[FOO]",
471 * the GPIO named lines "GPIO-A" thru "GPIO-L" are the only
472 * ones actually used for GPIO.
473 */
474
475&tlmm {
476	gpio-line-names =
477		"[UART0_TX]", /* GPIO_0, LSEC pin 5 */
478		"[UART0_RX]", /* GPIO_1, LSEC pin 7 */
479		"[UART0_CTS_N]", /* GPIO_2, LSEC pin 3 */
480		"[UART0_RTS_N]", /* GPIO_3, LSEC pin 9 */
481		"[UART1_TX]", /* GPIO_4, LSEC pin 11 */
482		"[UART1_RX]", /* GPIO_5, LSEC pin 13 */
483		"[I2C0_SDA]", /* GPIO_8, LSEC pin 17 */
484		"[I2C0_SCL]", /* GPIO_7, LSEC pin 15 */
485		"[SPI1_DOUT]", /* SPI1_MOSI, HSEC pin 1 */
486		"[SPI1_DIN]", /* SPI1_MISO, HSEC pin 11 */
487		"[SPI1_CS]", /* SPI1_CS_N, HSEC pin 7 */
488		"[SPI1_SCLK]", /* SPI1_CLK, HSEC pin 9 */
489		"GPIO-B", /* LS_EXP_GPIO_B, LSEC pin 24 */
490		"GPIO-C", /* LS_EXP_GPIO_C, LSEC pin 25 */
491		"[I2C3_SDA]", /* HSEC pin 38 */
492		"[I2C3_SCL]", /* HSEC pin 36 */
493		"[SPI0_MOSI]", /* LSEC pin 14 */
494		"[SPI0_MISO]", /* LSEC pin 10 */
495		"[SPI0_CS_N]", /* LSEC pin 12 */
496		"[SPI0_CLK]", /* LSEC pin 8 */
497		"HDMI_HPD_N", /* GPIO 20 */
498		"USR_LED_1_CTRL",
499		"[I2C1_SDA]", /* GPIO_22, LSEC pin 21 */
500		"[I2C1_SCL]", /* GPIO_23, LSEC pin 19 */
501		"GPIO-G", /* LS_EXP_GPIO_G, LSEC pin 29 */
502		"GPIO-H", /* LS_EXP_GPIO_H, LSEC pin 30 */
503		"[CSI0_MCLK]", /* HSEC pin 15 */
504		"[CSI1_MCLK]", /* HSEC pin 17 */
505		"GPIO-K", /* LS_EXP_GPIO_K, LSEC pin 33 */
506		"[I2C2_SDA]", /* HSEC pin 34 */
507		"[I2C2_SCL]", /* HSEC pin 32 */
508		"DSI2HDMI_INT_N",
509		"DSI_SW_SEL_APQ",
510		"GPIO-L", /* LS_EXP_GPIO_L, LSEC pin 34 */
511		"GPIO-J", /* LS_EXP_GPIO_J, LSEC pin 32 */
512		"GPIO-I", /* LS_EXP_GPIO_I, LSEC pin 31 */
513		"GPIO-A", /* LS_EXP_GPIO_A, LSEC pin 23 */
514		"FORCED_USB_BOOT",
515		"SD_CARD_DET_N",
516		"[WCSS_BT_SSBI]",
517		"[WCSS_WLAN_DATA_2]", /* GPIO 40 */
518		"[WCSS_WLAN_DATA_1]",
519		"[WCSS_WLAN_DATA_0]",
520		"[WCSS_WLAN_SET]",
521		"[WCSS_WLAN_CLK]",
522		"[WCSS_FM_SSBI]",
523		"[WCSS_FM_SDI]",
524		"[WCSS_BT_DAT_CTL]",
525		"[WCSS_BT_DAT_STB]",
526		"NC",
527		"NC", /* GPIO 50 */
528		"NC",
529		"NC",
530		"NC",
531		"NC",
532		"NC",
533		"NC",
534		"NC",
535		"NC",
536		"NC",
537		"NC", /* GPIO 60 */
538		"NC",
539		"NC",
540		"[CDC_PDM0_CLK]",
541		"[CDC_PDM0_SYNC]",
542		"[CDC_PDM0_TX0]",
543		"[CDC_PDM0_RX0]",
544		"[CDC_PDM0_RX1]",
545		"[CDC_PDM0_RX2]",
546		"GPIO-D", /* LS_EXP_GPIO_D, LSEC pin 26 */
547		"NC", /* GPIO 70 */
548		"NC",
549		"NC",
550		"NC",
551		"NC", /* GPIO 74 */
552		"NC",
553		"NC",
554		"NC",
555		"NC",
556		"NC",
557		"BOOT_CONFIG_0", /* GPIO 80 */
558		"BOOT_CONFIG_1",
559		"BOOT_CONFIG_2",
560		"BOOT_CONFIG_3",
561		"NC",
562		"NC",
563		"BOOT_CONFIG_5",
564		"NC",
565		"NC",
566		"NC",
567		"NC", /* GPIO 90 */
568		"NC",
569		"NC",
570		"NC",
571		"NC",
572		"NC",
573		"NC",
574		"NC",
575		"NC",
576		"NC",
577		"NC", /* GPIO 100 */
578		"NC",
579		"NC",
580		"NC",
581		"SSBI_GPS",
582		"NC",
583		"NC",
584		"KEY_VOLP_N",
585		"NC",
586		"NC",
587		"[LS_EXP_MI2S_WS]", /* GPIO 110 */
588		"NC",
589		"NC",
590		"[LS_EXP_MI2S_SCK]",
591		"[LS_EXP_MI2S_DATA0]",
592		"GPIO-E", /* LS_EXP_GPIO_E, LSEC pin 27 */
593		"NC",
594		"[DSI2HDMI_MI2S_WS]",
595		"[DSI2HDMI_MI2S_SCK]",
596		"[DSI2HDMI_MI2S_DATA0]",
597		"USR_LED_2_CTRL", /* GPIO 120 */
598		"SB_HS_ID";
599
600	blsp_uart1_default: blsp-uart1-default-state {
601		/* TX, RX, CTS_N, RTS_N */
602		pins = "gpio0", "gpio1", "gpio2", "gpio3";
603		function = "blsp_uart1";
604		drive-strength = <16>;
605		bias-disable;
606	};
607
608	blsp_uart1_sleep: blsp-uart1-sleep-state {
609		pins = "gpio0", "gpio1", "gpio2", "gpio3";
610		function = "gpio";
611		drive-strength = <2>;
612		bias-pull-down;
613	};
614
615	sdc2_cd_default: sdc2-cd-default-state {
616		pins = "gpio38";
617		function = "gpio";
618		drive-strength = <2>;
619		bias-disable;
620	};
621
622	tlmm_leds: tlmm-leds-state {
623		pins = "gpio21", "gpio120";
624		function = "gpio";
625
626		output-low;
627	};
628
629	usb_id_default: usb-id-default-state {
630		pins = "gpio121";
631		function = "gpio";
632
633		drive-strength = <8>;
634		bias-pull-up;
635	};
636
637	adv7533_int_active: adv533-int-active-state {
638		pins = "gpio31";
639		function = "gpio";
640
641		drive-strength = <16>;
642		bias-disable;
643	};
644
645	adv7533_int_suspend: adv7533-int-suspend-state {
646		pins = "gpio31";
647		function = "gpio";
648
649		drive-strength = <2>;
650		bias-disable;
651	};
652
653	adv7533_switch_active: adv7533-switch-active-state {
654		pins = "gpio32";
655		function = "gpio";
656
657		drive-strength = <16>;
658		bias-disable;
659	};
660
661	adv7533_switch_suspend: adv7533-switch-suspend-state {
662		pins = "gpio32";
663		function = "gpio";
664
665		drive-strength = <2>;
666		bias-disable;
667	};
668
669	msm_key_volp_n_default: msm-key-volp-n-default-state {
670		pins = "gpio107";
671		function = "gpio";
672
673		drive-strength = <8>;
674		bias-pull-up;
675	};
676};
677
678&pm8916_gpios {
679	gpio-line-names =
680		"USR_LED_3_CTRL",
681		"USR_LED_4_CTRL",
682		"USB_HUB_RESET_N_PM",
683		"USB_SW_SEL_PM";
684
685	usb_hub_reset_pm: usb-hub-reset-pm-state {
686		pins = "gpio3";
687		function = PMIC_GPIO_FUNC_NORMAL;
688
689		input-disable;
690		output-high;
691	};
692
693	usb_hub_reset_pm_device: usb-hub-reset-pm-device-state {
694		pins = "gpio3";
695		function = PMIC_GPIO_FUNC_NORMAL;
696
697		output-low;
698	};
699
700	usb_sw_sel_pm: usb-sw-sel-pm-state {
701		pins = "gpio4";
702		function = PMIC_GPIO_FUNC_NORMAL;
703
704		power-source = <PM8916_GPIO_VPH>;
705		input-disable;
706		output-high;
707	};
708
709	usb_sw_sel_pm_device: usb-sw-sel-pm-device-state {
710		pins = "gpio4";
711		function = PMIC_GPIO_FUNC_NORMAL;
712
713		power-source = <PM8916_GPIO_VPH>;
714		input-disable;
715		output-low;
716	};
717
718	pm8916_gpios_leds: pm8916-gpios-leds-state {
719		pins = "gpio1", "gpio2";
720		function = PMIC_GPIO_FUNC_NORMAL;
721
722		output-low;
723	};
724};
725
726&pm8916_mpps {
727	gpio-line-names =
728		"VDD_PX_BIAS",
729		"WLAN_LED_CTRL",
730		"BT_LED_CTRL",
731		"GPIO-F"; /* LS_EXP_GPIO_F, LSEC pin 28 */
732
733	pinctrl-names = "default";
734	pinctrl-0 = <&ls_exp_gpio_f>;
735
736	ls_exp_gpio_f: pm8916-mpp4-state {
737		pins = "mpp4";
738		function = "digital";
739
740		output-low;
741		power-source = <PM8916_MPP_L5>;	/* 1.8V */
742	};
743
744	pm8916_mpps_leds: pm8916-mpps-state {
745		pins = "mpp2", "mpp3";
746		function = "digital";
747
748		output-low;
749	};
750};
751