1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2023, Linaro Limited
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/leds/common.h>
9#include <dt-bindings/sound/qcom,q6afe.h>
10#include <dt-bindings/sound/qcom,q6asm.h>
11#include <dt-bindings/usb/pd.h>
12#include "sm4250.dtsi"
13#include "pm6125.dtsi"
14#include "pmi632.dtsi"
15
16/ {
17	model = "Qualcomm Technologies, Inc. QRB4210 RB2";
18	compatible = "qcom,qrb4210-rb2", "qcom,qrb4210", "qcom,sm4250";
19
20	aliases {
21		serial0 = &uart4;
22		serial1 = &uart3;
23	};
24
25	chosen {
26		stdout-path = "serial0:115200n8";
27	};
28
29	clocks {
30		clk40m: can-clk {
31			compatible = "fixed-clock";
32			clock-frequency = <40000000>;
33			#clock-cells = <0>;
34		};
35	};
36
37	gpio-keys {
38		compatible = "gpio-keys";
39		label = "gpio-keys";
40
41		pinctrl-0 = <&kypd_vol_up_n>;
42		pinctrl-names = "default";
43
44		key-volume-up {
45			label = "Volume Up";
46			linux,code = <KEY_VOLUMEUP>;
47			gpios = <&pm6125_gpios 5 GPIO_ACTIVE_LOW>;
48			debounce-interval = <15>;
49			linux,can-disable;
50			wakeup-source;
51		};
52	};
53
54	hdmi-connector {
55		compatible = "hdmi-connector";
56		type = "a";
57
58		port {
59			hdmi_con: endpoint {
60				remote-endpoint = <&lt9611_out>;
61			};
62		};
63	};
64
65	i2c2_gpio: i2c {
66		compatible = "i2c-gpio";
67
68		sda-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>;
69		scl-gpios = <&tlmm 7 GPIO_ACTIVE_HIGH>;
70		#address-cells = <1>;
71		#size-cells = <0>;
72
73		status = "disabled";
74	};
75
76	leds {
77		compatible = "gpio-leds";
78
79		led-bt {
80			label = "blue:bt";
81			function = LED_FUNCTION_BLUETOOTH;
82			color = <LED_COLOR_ID_BLUE>;
83			gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
84			linux,default-trigger = "bluetooth-power";
85			default-state = "off";
86		};
87
88		led-user0 {
89			label = "green:user0";
90			function = LED_FUNCTION_INDICATOR;
91			color = <LED_COLOR_ID_GREEN>;
92			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
93			linux,default-trigger = "none";
94			default-state = "off";
95			panic-indicator;
96		};
97
98		led-wlan {
99			label = "yellow:wlan";
100			function = LED_FUNCTION_WLAN;
101			color = <LED_COLOR_ID_YELLOW>;
102			gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>;
103			linux,default-trigger = "phy0tx";
104			default-state = "off";
105		};
106	};
107
108	sound {
109		compatible = "qcom,qrb4210-rb2-sndcard";
110		pinctrl-0 = <&lpi_i2s2_active>;
111		pinctrl-names = "default";
112		model = "Qualcomm-RB2-WSA8815-Speakers-DMIC0";
113		audio-routing = "MM_DL1", "MultiMedia1 Playback",
114				"MM_DL2", "MultiMedia2 Playback";
115
116		mm1-dai-link {
117			link-name = "MultiMedia1";
118
119			cpu {
120				sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
121			};
122		};
123
124		mm2-dai-link {
125			link-name = "MultiMedia2";
126
127			cpu {
128				sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>;
129			};
130		};
131
132		mm3-dai-link {
133			link-name = "MultiMedia3";
134
135			cpu {
136				sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>;
137			};
138		};
139
140		hdmi-dai-link {
141			link-name = "HDMI Playback";
142
143			cpu {
144				sound-dai = <&q6afedai SECONDARY_MI2S_RX>;
145			};
146
147			platform {
148				sound-dai = <&q6routing>;
149			};
150
151			codec {
152				sound-dai = <&lt9611_codec 0>;
153			};
154		};
155	};
156
157	vreg_hdmi_out_1p2: regulator-hdmi-out-1p2 {
158		compatible = "regulator-fixed";
159		regulator-name = "VREG_HDMI_OUT_1P2";
160		regulator-min-microvolt = <1200000>;
161		regulator-max-microvolt = <1200000>;
162		vin-supply = <&vdc_1v2>;
163		regulator-always-on;
164		regulator-boot-on;
165	};
166
167	lt9611_3v3: regulator-lt9611-3v3 {
168		compatible = "regulator-fixed";
169		regulator-name = "LT9611_3V3";
170		regulator-min-microvolt = <3300000>;
171		regulator-max-microvolt = <3300000>;
172		vin-supply = <&vdc_3v3>;
173		regulator-always-on;
174		regulator-boot-on;
175	};
176
177	/* Main barrel jack input */
178	vdc_12v: regulator-vdc-12v {
179		compatible = "regulator-fixed";
180		regulator-name = "DC_12V";
181		regulator-min-microvolt = <12000000>;
182		regulator-max-microvolt = <12000000>;
183		regulator-always-on;
184		regulator-boot-on;
185	};
186
187	/* 1.2V supply stepped down from the barrel jack input */
188	vdc_1v2: regulator-vdc-1v2 {
189		compatible = "regulator-fixed";
190		regulator-name = "VDC_1V2";
191		regulator-min-microvolt = <1200000>;
192		regulator-max-microvolt = <1200000>;
193		vin-supply = <&vdc_12v>;
194		regulator-always-on;
195		regulator-boot-on;
196	};
197
198	/* 3.3V supply stepped down from the barrel jack input */
199	vdc_3v3: regulator-vdc-3v3 {
200		compatible = "regulator-fixed";
201		regulator-name = "VDC_3V3";
202		regulator-min-microvolt = <3300000>;
203		regulator-max-microvolt = <3300000>;
204		vin-supply = <&vdc_12v>;
205		regulator-always-on;
206		regulator-boot-on;
207	};
208
209	/* 5V supply stepped down from the barrel jack input */
210	vdc_5v: regulator-vdc-5v {
211		compatible = "regulator-fixed";
212		regulator-name = "VDC_5V";
213
214		regulator-min-microvolt = <5000000>;
215		regulator-max-microvolt = <5000000>;
216		regulator-always-on;
217		regulator-boot-on;
218	};
219
220	/* "Battery" voltage for the SoM, stepped down from the barrel jack input */
221	vdc_vbat_som: regulator-vdc-vbat {
222		compatible = "regulator-fixed";
223		regulator-name = "VBAT_SOM";
224		regulator-min-microvolt = <4200000>;
225		regulator-max-microvolt = <4200000>;
226		regulator-always-on;
227		regulator-boot-on;
228	};
229
230	/* PMI632 charger out, supplied by VBAT */
231	vph_pwr: regulator-vph-pwr {
232		compatible = "regulator-fixed";
233		regulator-name = "vph_pwr";
234		regulator-min-microvolt = <3700000>;
235		regulator-max-microvolt = <3700000>;
236		vin-supply = <&vdc_vbat_som>;
237
238		regulator-always-on;
239		regulator-boot-on;
240	};
241};
242
243&gpi_dma0 {
244	status = "okay";
245};
246
247&gpu {
248	status = "okay";
249
250	zap-shader {
251		firmware-name = "qcom/qrb4210/a610_zap.mbn";
252	};
253};
254
255&i2c2_gpio {
256	clock-frequency = <400000>;
257	status = "okay";
258
259	lt9611_codec: hdmi-bridge@2b {
260		compatible = "lontium,lt9611uxc";
261		reg = <0x2b>;
262		interrupts-extended = <&tlmm 46 IRQ_TYPE_EDGE_FALLING>;
263		reset-gpios = <&tlmm 41 GPIO_ACTIVE_HIGH>;
264
265		vdd-supply = <&vreg_hdmi_out_1p2>;
266		vcc-supply = <&lt9611_3v3>;
267
268		pinctrl-0 = <&lt9611_irq_pin &lt9611_rst_pin>;
269		pinctrl-names = "default";
270		#sound-dai-cells = <1>;
271
272		ports {
273			#address-cells = <1>;
274			#size-cells = <0>;
275
276			port@0 {
277				reg = <0>;
278
279				lt9611_a: endpoint {
280					remote-endpoint = <&mdss_dsi0_out>;
281				};
282			};
283
284			port@2 {
285				reg = <2>;
286
287				lt9611_out: endpoint {
288					remote-endpoint = <&hdmi_con>;
289				};
290			};
291		};
292	};
293};
294
295&mdss {
296	status = "okay";
297};
298
299&mdss_dsi0 {
300	vdda-supply = <&vreg_l18a_1p232>;
301	status = "okay";
302};
303
304&mdss_dsi0_out {
305	remote-endpoint = <&lt9611_a>;
306	data-lanes = <0 1 2 3>;
307};
308
309&mdss_dsi0_phy {
310	status = "okay";
311};
312
313&pm6125_gpios {
314	kypd_vol_up_n: kypd-vol-up-n-state {
315		pins = "gpio5";
316		function = "normal";
317		power-source = <0>;
318		bias-pull-up;
319		input-enable;
320	};
321};
322
323&pmi632_typec {
324	status = "okay";
325
326	connector {
327		compatible = "usb-c-connector";
328
329		power-role = "dual";
330		data-role = "dual";
331		self-powered;
332
333		typec-power-opmode = "default";
334		pd-disable;
335
336		ports {
337			#address-cells = <1>;
338			#size-cells = <0>;
339
340			port@0 {
341				reg = <0>;
342				pmi632_hs_in: endpoint {
343					remote-endpoint = <&usb_dwc3_hs>;
344				};
345			};
346
347			port@1 {
348				reg = <1>;
349				pmi632_ss_in: endpoint {
350					remote-endpoint = <&usb_qmpphy_out>;
351				};
352			};
353		};
354	};
355};
356
357&pmi632_vbus {
358	regulator-min-microamp = <500000>;
359	regulator-max-microamp = <1000000>;
360	status = "okay";
361};
362
363&pon_pwrkey {
364	status = "okay";
365};
366
367&pon_resin {
368	linux,code = <KEY_VOLUMEDOWN>;
369	status = "okay";
370};
371
372/* SECONDARY I2S uses 1 I2S SD Line for audio on LT9611UXC HDMI Bridge */
373&q6afedai {
374	dai@20 {
375		reg = <SECONDARY_MI2S_RX>;
376		qcom,sd-lines = <0>;
377	};
378};
379
380&qupv3_id_0 {
381	status = "okay";
382};
383
384&remoteproc_adsp {
385	firmware-name = "qcom/qrb4210/adsp.mbn";
386
387	status = "okay";
388};
389
390&remoteproc_cdsp {
391	firmware-name = "qcom/qrb4210/cdsp.mbn";
392
393	status = "okay";
394};
395
396&remoteproc_mpss {
397	firmware-name = "qcom/qrb4210/modem.mbn";
398
399	status = "okay";
400};
401
402&rpm_requests {
403	regulators {
404		compatible = "qcom,rpm-pm6125-regulators";
405
406		vdd-s1-supply = <&vph_pwr>;
407		vdd-s2-supply = <&vph_pwr>;
408		vdd-s3-supply = <&vph_pwr>;
409		vdd-s4-supply = <&vph_pwr>;
410		vdd-s5-supply = <&vph_pwr>;
411		vdd-s6-supply = <&vph_pwr>;
412		vdd-s7-supply = <&vph_pwr>;
413		vdd-s8-supply = <&vph_pwr>;
414		vdd-s9-supply = <&vph_pwr>;
415		vdd-s10-supply = <&vph_pwr>;
416
417		vdd-l1-l7-l17-l18-supply = <&vreg_s6a_1p352>;
418		vdd-l2-l3-l4-supply = <&vreg_s6a_1p352>;
419		vdd-l5-l15-l19-l20-l21-l22-supply = <&vph_pwr>;
420		vdd-l6-l8-supply = <&vreg_s5a_0p848>;
421		vdd-l9-l11-supply = <&vreg_s7a_2p04>;
422		vdd-l10-l13-l14-supply = <&vreg_s7a_2p04>;
423		vdd-l12-l16-supply = <&vreg_s7a_2p04>;
424		vdd-l23-l24-supply = <&vph_pwr>;
425
426		vreg_s5a_0p848: s5 {
427			regulator-min-microvolt = <920000>;
428			regulator-max-microvolt = <1128000>;
429		};
430
431		vreg_s6a_1p352: s6 {
432			regulator-min-microvolt = <304000>;
433			regulator-max-microvolt = <1456000>;
434		};
435
436		vreg_s7a_2p04: s7 {
437			regulator-min-microvolt = <1280000>;
438			regulator-max-microvolt = <2080000>;
439		};
440
441		vreg_l1a_1p0: l1 {
442			regulator-min-microvolt = <952000>;
443			regulator-max-microvolt = <1152000>;
444		};
445
446		vreg_l4a_0p9: l4 {
447			regulator-min-microvolt = <488000>;
448			regulator-max-microvolt = <1000000>;
449		};
450
451		vreg_l5a_2p96: l5 {
452			regulator-min-microvolt = <1648000>;
453			regulator-max-microvolt = <3056000>;
454			regulator-allow-set-load;
455		};
456
457		vreg_l6a_0p6: l6 {
458			regulator-min-microvolt = <576000>;
459			regulator-max-microvolt = <656000>;
460		};
461
462		vreg_l7a_1p256: l7 {
463			regulator-min-microvolt = <1200000>;
464			regulator-max-microvolt = <1304000>;
465		};
466
467		vreg_l8a_0p664: l8 {
468			regulator-min-microvolt = <640000>;
469			regulator-max-microvolt = <640000>;
470		};
471
472		vreg_l9a_1p8: l9 {
473			regulator-min-microvolt = <1800000>;
474			regulator-max-microvolt = <1800000>;
475			regulator-allow-set-load;
476			regulator-always-on;
477			regulator-boot-on;
478		};
479
480		vreg_l10a_1p8: l10 {
481			regulator-min-microvolt = <1704000>;
482			regulator-max-microvolt = <1904000>;
483		};
484
485		vreg_l11a_1p8: l11 {
486			regulator-min-microvolt = <1704000>;
487			regulator-max-microvolt = <1952000>;
488			regulator-allow-set-load;
489		};
490
491		vreg_l12a_1p8: l12 {
492			regulator-min-microvolt = <1624000>;
493			regulator-max-microvolt = <1984000>;
494		};
495
496		vreg_l13a_1p8: l13 {
497			regulator-min-microvolt = <1504000>;
498			regulator-max-microvolt = <1952000>;
499		};
500
501		vreg_l14a_1p8: l14 {
502			regulator-min-microvolt = <1704000>;
503			regulator-max-microvolt = <1904000>;
504		};
505
506		vreg_l15a_3p128: l15 {
507			regulator-min-microvolt = <2920000>;
508			regulator-max-microvolt = <3232000>;
509		};
510
511		vreg_l16a_1p3: l16 {
512			regulator-min-microvolt = <1704000>;
513			regulator-max-microvolt = <1904000>;
514			regulator-allow-set-load;
515		};
516
517		vreg_l17a_1p3: l17 {
518			regulator-min-microvolt = <1152000>;
519			regulator-max-microvolt = <1384000>;
520			regulator-allow-set-load;
521		};
522
523		vreg_l18a_1p232: l18 {
524			regulator-min-microvolt = <1104000>;
525			regulator-max-microvolt = <1312000>;
526		};
527
528		vreg_l19a_1p8: l19 {
529			regulator-min-microvolt = <1624000>;
530			regulator-max-microvolt = <3304000>;
531		};
532
533		vreg_l20a_1p8: l20 {
534			regulator-min-microvolt = <1624000>;
535			regulator-max-microvolt = <3304000>;
536		};
537
538		vreg_l21a_2p704: l21 {
539			regulator-min-microvolt = <2400000>;
540			regulator-max-microvolt = <3600000>;
541		};
542
543		vreg_l22a_2p96: l22 {
544			regulator-min-microvolt = <2952000>;
545			regulator-max-microvolt = <3304000>;
546			regulator-system-load = <100000>;
547			regulator-allow-set-load;
548		};
549
550		vreg_l23a_3p3: l23 {
551			regulator-min-microvolt = <3312000>;
552			regulator-max-microvolt = <3312000>;
553			regulator-allow-set-load;
554		};
555
556		vreg_l24a_2p96: l24 {
557			regulator-min-microvolt = <2704000>;
558			regulator-max-microvolt = <3600000>;
559			regulator-system-load = <100000>;
560			regulator-allow-set-load;
561		};
562	};
563};
564
565&sdhc_1 {
566	pinctrl-0 = <&sdc1_state_on>;
567	pinctrl-1 = <&sdc1_state_off>;
568	pinctrl-names = "default", "sleep";
569
570	vmmc-supply = <&vreg_l24a_2p96>;
571	vqmmc-supply = <&vreg_l11a_1p8>;
572	no-sdio;
573	non-removable;
574
575	status = "okay";
576};
577
578&sdhc_2 {
579	cd-gpios = <&tlmm 88 GPIO_ACTIVE_LOW>; /* card detect gpio */
580
581	pinctrl-0 = <&sdc2_state_on &sdc2_card_det_n>;
582	pinctrl-1 = <&sdc2_state_off &sdc2_card_det_n>;
583	pinctrl-names = "default", "sleep";
584
585	vmmc-supply = <&vreg_l22a_2p96>;
586	vqmmc-supply = <&vreg_l5a_2p96>;
587	no-sdio;
588
589	status = "okay";
590};
591
592&spi5 {
593	status = "okay";
594
595	can@0 {
596		compatible = "microchip,mcp2518fd";
597		reg = <0>;
598		interrupts-extended = <&tlmm 39 IRQ_TYPE_LEVEL_LOW>;
599		clocks = <&clk40m>;
600		spi-max-frequency = <10000000>;
601		vdd-supply = <&vdc_5v>;
602		xceiver-supply = <&vdc_5v>;
603	};
604};
605
606&sleep_clk {
607	clock-frequency = <32764>;
608};
609
610&tlmm {
611	gpio-reserved-ranges = <43 2>, <49 1>, <54 1>,
612			       <56 3>, <61 2>, <64 1>,
613			       <68 1>, <72 8>, <96 1>;
614
615	uart3_default: uart3-default-state {
616		cts-pins {
617			pins = "gpio8";
618			function = "qup3";
619			drive-strength = <2>;
620			bias-bus-hold;
621		};
622
623		rts-pins {
624			pins = "gpio9";
625			function = "qup3";
626			drive-strength = <2>;
627			bias-disable;
628		};
629
630		tx-pins {
631			pins = "gpio10";
632			function = "qup3";
633			drive-strength = <2>;
634			bias-disable;
635		};
636
637		rx-pins {
638			pins = "gpio11";
639			function = "qup3";
640			drive-strength = <2>;
641			bias-pull-up;
642		};
643	};
644
645	uart3_sleep: uart3-sleep-state {
646		cts-pins {
647			pins = "gpio8";
648			function = "gpio";
649			drive-strength = <2>;
650			bias-bus-hold;
651		};
652
653		rts-pins {
654			pins = "gpio9";
655			function = "gpio";
656			drive-strength = <2>;
657			bias-pull-down;
658		};
659
660		tx-pins {
661			pins = "gpio10";
662			function = "gpio";
663			drive-strength = <2>;
664			bias-pull-up;
665		};
666
667		rx-pins {
668			pins = "gpio11";
669			function = "gpio";
670			drive-strength = <2>;
671			bias-pull-up;
672		};
673	};
674
675	lt9611_rst_pin: lt9611-rst-state {
676		pins = "gpio41";
677		function = "gpio";
678		input-disable;
679		output-high;
680	};
681
682	lt9611_irq_pin: lt9611-irq-state {
683		pins = "gpio46";
684		function = "gpio";
685		bias-disable;
686	};
687
688	sdc2_card_det_n: sd-card-det-n-state {
689		pins = "gpio88";
690		function = "gpio";
691		drive-strength = <2>;
692		bias-pull-up;
693	};
694};
695
696&uart3 {
697	interrupts-extended = <&intc GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>,
698			      <&tlmm 11 IRQ_TYPE_LEVEL_HIGH>;
699	pinctrl-0 = <&uart3_default>;
700	pinctrl-1 = <&uart3_sleep>;
701	pinctrl-names = "default", "sleep";
702	status = "okay";
703
704	bluetooth {
705		compatible = "qcom,wcn3988-bt";
706
707		vddio-supply = <&vreg_l9a_1p8>;
708		vddxo-supply = <&vreg_l16a_1p3>;
709		vddrf-supply = <&vreg_l17a_1p3>;
710		vddch0-supply = <&vreg_l23a_3p3>;
711		enable-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>;
712		max-speed = <3200000>;
713	};
714};
715
716&uart4 {
717	status = "okay";
718};
719
720&usb {
721	status = "okay";
722};
723
724&usb_dwc3_hs {
725	remote-endpoint = <&pmi632_hs_in>;
726};
727
728&usb_hsphy {
729	vdd-supply = <&vreg_l4a_0p9>;
730	vdda-pll-supply = <&vreg_l12a_1p8>;
731	vdda-phy-dpdm-supply = <&vreg_l15a_3p128>;
732
733	status = "okay";
734};
735
736&usb_qmpphy {
737	vdda-phy-supply = <&vreg_l4a_0p9>;
738	vdda-pll-supply = <&vreg_l12a_1p8>;
739
740	status = "okay";
741};
742
743&usb_qmpphy_out {
744	remote-endpoint = <&pmi632_ss_in>;
745};
746
747&wifi {
748	vdd-0.8-cx-mx-supply = <&vreg_l8a_0p664>;
749	vdd-1.8-xo-supply = <&vreg_l16a_1p3>;
750	vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
751	vdd-3.3-ch0-supply = <&vreg_l23a_3p3>;
752	qcom,ath10k-calibration-variant = "Thundercomm_RB2";
753	firmware-name = "qrb4210";
754
755	status = "okay";
756};
757
758&xo_board {
759	clock-frequency = <19200000>;
760};
761