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