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 "sm4250.dtsi"
10#include "pm6125.dtsi"
11
12/ {
13	model = "Qualcomm Technologies, Inc. QRB4210 RB2";
14	compatible = "qcom,qrb4210-rb2", "qcom,qrb4210", "qcom,sm4250";
15
16	aliases {
17		serial0 = &uart4;
18	};
19
20	chosen {
21		stdout-path = "serial0:115200n8";
22	};
23
24	clocks {
25		clk40M: can-clk {
26			compatible = "fixed-clock";
27			clock-frequency = <40000000>;
28			#clock-cells = <0>;
29		};
30	};
31
32	gpio-keys {
33		compatible = "gpio-keys";
34		label = "gpio-keys";
35
36		pinctrl-0 = <&kypd_vol_up_n>;
37		pinctrl-names = "default";
38
39		key-volume-up {
40			label = "Volume Up";
41			linux,code = <KEY_VOLUMEUP>;
42			gpios = <&pm6125_gpios 5 GPIO_ACTIVE_LOW>;
43			debounce-interval = <15>;
44			linux,can-disable;
45			wakeup-source;
46		};
47	};
48
49	hdmi-connector {
50		compatible = "hdmi-connector";
51		type = "a";
52
53		port {
54			hdmi_con: endpoint {
55				remote-endpoint = <&lt9611_out>;
56			};
57		};
58	};
59
60	i2c2_gpio: i2c {
61		compatible = "i2c-gpio";
62
63		sda-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>;
64		scl-gpios = <&tlmm 7 GPIO_ACTIVE_HIGH>;
65		#address-cells = <1>;
66		#size-cells = <0>;
67
68		status = "disabled";
69	};
70
71	leds {
72		compatible = "gpio-leds";
73
74		led-bt {
75			label = "blue:bt";
76			function = LED_FUNCTION_BLUETOOTH;
77			color = <LED_COLOR_ID_BLUE>;
78			gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
79			linux,default-trigger = "bluetooth-power";
80			default-state = "off";
81		};
82
83		led-user0 {
84			label = "green:user0";
85			function = LED_FUNCTION_INDICATOR;
86			color = <LED_COLOR_ID_GREEN>;
87			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
88			linux,default-trigger = "none";
89			default-state = "off";
90			panic-indicator;
91		};
92
93		led-wlan {
94			label = "yellow:wlan";
95			function = LED_FUNCTION_WLAN;
96			color = <LED_COLOR_ID_YELLOW>;
97			gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>;
98			linux,default-trigger = "phy0tx";
99			default-state = "off";
100		};
101	};
102
103	vreg_hdmi_out_1p2: regulator-hdmi-out-1p2 {
104		compatible = "regulator-fixed";
105		regulator-name = "VREG_HDMI_OUT_1P2";
106		regulator-min-microvolt = <1200000>;
107		regulator-max-microvolt = <1200000>;
108		vin-supply = <&vdc_1v2>;
109		regulator-always-on;
110		regulator-boot-on;
111	};
112
113	lt9611_3v3: regulator-lt9611-3v3 {
114		compatible = "regulator-fixed";
115		regulator-name = "LT9611_3V3";
116		regulator-min-microvolt = <3300000>;
117		regulator-max-microvolt = <3300000>;
118		vin-supply = <&vdc_3v3>;
119		regulator-always-on;
120		regulator-boot-on;
121	};
122
123	/* Main barrel jack input */
124	vdc_12v: regulator-vdc-12v {
125		compatible = "regulator-fixed";
126		regulator-name = "DC_12V";
127		regulator-min-microvolt = <12000000>;
128		regulator-max-microvolt = <12000000>;
129		regulator-always-on;
130		regulator-boot-on;
131	};
132
133	/* 1.2V supply stepped down from the barrel jack input */
134	vdc_1v2: regulator-vdc-1v2 {
135		compatible = "regulator-fixed";
136		regulator-name = "VDC_1V2";
137		regulator-min-microvolt = <1200000>;
138		regulator-max-microvolt = <1200000>;
139		vin-supply = <&vdc_12v>;
140		regulator-always-on;
141		regulator-boot-on;
142	};
143
144	/* 3.3V supply stepped down from the barrel jack input */
145	vdc_3v3: regulator-vdc-3v3 {
146		compatible = "regulator-fixed";
147		regulator-name = "VDC_3V3";
148		regulator-min-microvolt = <3300000>;
149		regulator-max-microvolt = <3300000>;
150		vin-supply = <&vdc_12v>;
151		regulator-always-on;
152		regulator-boot-on;
153	};
154
155	/* 5V supply stepped down from the barrel jack input */
156	vdc_5v: regulator-vdc-5v {
157		compatible = "regulator-fixed";
158		regulator-name = "VDC_5V";
159
160		regulator-min-microvolt = <5000000>;
161		regulator-max-microvolt = <5000000>;
162		regulator-always-on;
163		regulator-boot-on;
164	};
165
166	/* "Battery" voltage for the SoM, stepped down from the barrel jack input */
167	vdc_vbat_som: regulator-vdc-vbat {
168		compatible = "regulator-fixed";
169		regulator-name = "VBAT_SOM";
170		regulator-min-microvolt = <4200000>;
171		regulator-max-microvolt = <4200000>;
172		regulator-always-on;
173		regulator-boot-on;
174	};
175
176	/* PMI632 charger out, supplied by VBAT */
177	vph_pwr: regulator-vph-pwr {
178		compatible = "regulator-fixed";
179		regulator-name = "vph_pwr";
180		regulator-min-microvolt = <3700000>;
181		regulator-max-microvolt = <3700000>;
182		vin-supply = <&vdc_vbat_som>;
183
184		regulator-always-on;
185		regulator-boot-on;
186	};
187};
188
189&gpi_dma0 {
190	status = "okay";
191};
192
193&gpu {
194	status = "okay";
195
196	zap-shader {
197		firmware-name = "qcom/qrb4210/a610_zap.mbn";
198	};
199};
200
201&i2c2_gpio {
202	clock-frequency = <400000>;
203	status = "okay";
204
205	lt9611_codec: hdmi-bridge@2b {
206		compatible = "lontium,lt9611uxc";
207		reg = <0x2b>;
208		interrupts-extended = <&tlmm 46 IRQ_TYPE_EDGE_FALLING>;
209		reset-gpios = <&tlmm 41 GPIO_ACTIVE_HIGH>;
210
211		vdd-supply = <&vreg_hdmi_out_1p2>;
212		vcc-supply = <&lt9611_3v3>;
213
214		pinctrl-0 = <&lt9611_irq_pin &lt9611_rst_pin>;
215		pinctrl-names = "default";
216		#sound-dai-cells = <1>;
217
218		ports {
219			#address-cells = <1>;
220			#size-cells = <0>;
221
222			port@0 {
223				reg = <0>;
224
225				lt9611_a: endpoint {
226					remote-endpoint = <&mdss_dsi0_out>;
227				};
228			};
229
230			port@2 {
231				reg = <2>;
232
233				lt9611_out: endpoint {
234					remote-endpoint = <&hdmi_con>;
235				};
236			};
237		};
238	};
239};
240
241&mdss {
242	status = "okay";
243};
244
245&mdss_dsi0 {
246	vdda-supply = <&vreg_l18a_1p232>;
247	status = "okay";
248};
249
250&mdss_dsi0_out {
251	remote-endpoint = <&lt9611_a>;
252	data-lanes = <0 1 2 3>;
253};
254
255&mdss_dsi0_phy {
256	status = "okay";
257};
258
259&pm6125_gpios {
260	kypd_vol_up_n: kypd-vol-up-n-state {
261		pins = "gpio5";
262		function = "normal";
263		power-source = <0>;
264		bias-pull-up;
265		input-enable;
266	};
267};
268
269&pon_pwrkey {
270	status = "okay";
271};
272
273&pon_resin {
274	linux,code = <KEY_VOLUMEDOWN>;
275	status = "okay";
276};
277
278&qupv3_id_0 {
279	status = "okay";
280};
281
282&remoteproc_adsp {
283	firmware-name = "qcom/qrb4210/adsp.mbn";
284
285	status = "okay";
286};
287
288&remoteproc_cdsp {
289	firmware-name = "qcom/qrb4210/cdsp.mbn";
290
291	status = "okay";
292};
293
294&rpm_requests {
295	regulators {
296		compatible = "qcom,rpm-pm6125-regulators";
297
298		vdd-s1-supply = <&vph_pwr>;
299		vdd-s2-supply = <&vph_pwr>;
300		vdd-s3-supply = <&vph_pwr>;
301		vdd-s4-supply = <&vph_pwr>;
302		vdd-s5-supply = <&vph_pwr>;
303		vdd-s6-supply = <&vph_pwr>;
304		vdd-s7-supply = <&vph_pwr>;
305		vdd-s8-supply = <&vph_pwr>;
306		vdd-s9-supply = <&vph_pwr>;
307		vdd-s10-supply = <&vph_pwr>;
308
309		vdd-l1-l7-l17-l18-supply = <&vreg_s6a_1p352>;
310		vdd-l2-l3-l4-supply = <&vreg_s6a_1p352>;
311		vdd-l5-l15-l19-l20-l21-l22-supply = <&vph_pwr>;
312		vdd-l6-l8-supply = <&vreg_s5a_0p848>;
313		vdd-l9-l11-supply = <&vreg_s7a_2p04>;
314		vdd-l10-l13-l14-supply = <&vreg_s7a_2p04>;
315		vdd-l12-l16-supply = <&vreg_s7a_2p04>;
316		vdd-l23-l24-supply = <&vph_pwr>;
317
318		vreg_s5a_0p848: s5 {
319			regulator-min-microvolt = <920000>;
320			regulator-max-microvolt = <1128000>;
321		};
322
323		vreg_s6a_1p352: s6 {
324			regulator-min-microvolt = <304000>;
325			regulator-max-microvolt = <1456000>;
326		};
327
328		vreg_s7a_2p04: s7 {
329			regulator-min-microvolt = <1280000>;
330			regulator-max-microvolt = <2080000>;
331		};
332
333		vreg_l1a_1p0: l1 {
334			regulator-min-microvolt = <952000>;
335			regulator-max-microvolt = <1152000>;
336		};
337
338		vreg_l4a_0p9: l4 {
339			regulator-min-microvolt = <488000>;
340			regulator-max-microvolt = <1000000>;
341		};
342
343		vreg_l5a_2p96: l5 {
344			regulator-min-microvolt = <1648000>;
345			regulator-max-microvolt = <3056000>;
346			regulator-allow-set-load;
347		};
348
349		vreg_l6a_0p6: l6 {
350			regulator-min-microvolt = <576000>;
351			regulator-max-microvolt = <656000>;
352		};
353
354		vreg_l7a_1p256: l7 {
355			regulator-min-microvolt = <1200000>;
356			regulator-max-microvolt = <1304000>;
357		};
358
359		vreg_l8a_0p664: l8 {
360			regulator-min-microvolt = <400000>;
361			regulator-max-microvolt = <728000>;
362		};
363
364		vreg_l9a_1p8: l9 {
365			regulator-min-microvolt = <1800000>;
366			regulator-max-microvolt = <2000000>;
367			regulator-always-on;
368			regulator-boot-on;
369		};
370
371		vreg_l10a_1p8: l10 {
372			regulator-min-microvolt = <1704000>;
373			regulator-max-microvolt = <1904000>;
374		};
375
376		vreg_l11a_1p8: l11 {
377			regulator-min-microvolt = <1704000>;
378			regulator-max-microvolt = <1952000>;
379			regulator-allow-set-load;
380		};
381
382		vreg_l12a_1p8: l12 {
383			regulator-min-microvolt = <1624000>;
384			regulator-max-microvolt = <1984000>;
385		};
386
387		vreg_l13a_1p8: l13 {
388			regulator-min-microvolt = <1504000>;
389			regulator-max-microvolt = <1952000>;
390		};
391
392		vreg_l14a_1p8: l14 {
393			regulator-min-microvolt = <1704000>;
394			regulator-max-microvolt = <1904000>;
395		};
396
397		vreg_l15a_3p128: l15 {
398			regulator-min-microvolt = <2920000>;
399			regulator-max-microvolt = <3232000>;
400		};
401
402		vreg_l16a_1p3: l16 {
403			regulator-min-microvolt = <1704000>;
404			regulator-max-microvolt = <1904000>;
405		};
406
407		vreg_l17a_1p3: l17 {
408			regulator-min-microvolt = <1152000>;
409			regulator-max-microvolt = <1384000>;
410		};
411
412		vreg_l18a_1p232: l18 {
413			regulator-min-microvolt = <1104000>;
414			regulator-max-microvolt = <1312000>;
415		};
416
417		vreg_l19a_1p8: l19 {
418			regulator-min-microvolt = <1624000>;
419			regulator-max-microvolt = <3304000>;
420		};
421
422		vreg_l20a_1p8: l20 {
423			regulator-min-microvolt = <1624000>;
424			regulator-max-microvolt = <3304000>;
425		};
426
427		vreg_l21a_2p704: l21 {
428			regulator-min-microvolt = <2400000>;
429			regulator-max-microvolt = <3600000>;
430		};
431
432		vreg_l22a_2p96: l22 {
433			regulator-min-microvolt = <2952000>;
434			regulator-max-microvolt = <3304000>;
435			regulator-system-load = <100000>;
436			regulator-allow-set-load;
437		};
438
439		vreg_l23a_3p3: l23 {
440			regulator-min-microvolt = <3200000>;
441			regulator-max-microvolt = <3400000>;
442		};
443
444		vreg_l24a_2p96: l24 {
445			regulator-min-microvolt = <2704000>;
446			regulator-max-microvolt = <3600000>;
447			regulator-system-load = <100000>;
448			regulator-allow-set-load;
449		};
450	};
451};
452
453&sdhc_1 {
454	pinctrl-0 = <&sdc1_state_on>;
455	pinctrl-1 = <&sdc1_state_off>;
456	pinctrl-names = "default", "sleep";
457
458	vmmc-supply = <&vreg_l24a_2p96>;
459	vqmmc-supply = <&vreg_l11a_1p8>;
460	no-sdio;
461	non-removable;
462
463	status = "okay";
464};
465
466&sdhc_2 {
467	cd-gpios = <&tlmm 88 GPIO_ACTIVE_LOW>; /* card detect gpio */
468
469	pinctrl-0 = <&sdc2_state_on &sdc2_card_det_n>;
470	pinctrl-1 = <&sdc2_state_off &sdc2_card_det_n>;
471	pinctrl-names = "default", "sleep";
472
473	vmmc-supply = <&vreg_l22a_2p96>;
474	vqmmc-supply = <&vreg_l5a_2p96>;
475	no-sdio;
476
477	status = "okay";
478};
479
480&spi5 {
481	status = "okay";
482
483	can@0 {
484		compatible = "microchip,mcp2518fd";
485		reg = <0>;
486		interrupts-extended = <&tlmm 39 IRQ_TYPE_LEVEL_LOW>;
487		clocks = <&clk40M>;
488		spi-max-frequency = <10000000>;
489		vdd-supply = <&vdc_5v>;
490		xceiver-supply = <&vdc_5v>;
491	};
492};
493
494&sleep_clk {
495	clock-frequency = <32000>;
496};
497
498&tlmm {
499	gpio-reserved-ranges = <43 2>, <49 1>, <54 1>,
500			       <56 3>, <61 2>, <64 1>,
501			       <68 1>, <72 8>, <96 1>;
502
503	lt9611_rst_pin: lt9611-rst-state {
504		pins = "gpio41";
505		function = "gpio";
506		input-disable;
507		output-high;
508	};
509
510	lt9611_irq_pin: lt9611-irq-state {
511		pins = "gpio46";
512		function = "gpio";
513		bias-disable;
514	};
515
516	sdc2_card_det_n: sd-card-det-n-state {
517		pins = "gpio88";
518		function = "gpio";
519		drive-strength = <2>;
520		bias-pull-up;
521	};
522};
523
524&uart4 {
525	status = "okay";
526};
527
528&usb {
529	status = "okay";
530};
531
532&usb_dwc3 {
533	maximum-speed = "super-speed";
534};
535
536&usb_hsphy {
537	vdd-supply = <&vreg_l4a_0p9>;
538	vdda-pll-supply = <&vreg_l12a_1p8>;
539	vdda-phy-dpdm-supply = <&vreg_l15a_3p128>;
540
541	status = "okay";
542};
543
544&usb_qmpphy {
545	vdda-phy-supply = <&vreg_l4a_0p9>;
546	vdda-pll-supply = <&vreg_l12a_1p8>;
547
548	status = "okay";
549};
550
551&xo_board {
552	clock-frequency = <19200000>;
553};
554