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&gpu {
183	status = "okay";
184
185	zap-shader {
186		firmware-name = "qcom/qrb4210/a610_zap.mbn";
187	};
188};
189
190&i2c2 {
191	clock-frequency = <400000>;
192	status = "okay";
193
194	lt9611_codec: hdmi-bridge@2b {
195		compatible = "lontium,lt9611uxc";
196		reg = <0x2b>;
197		interrupts-extended = <&tlmm 46 IRQ_TYPE_EDGE_FALLING>;
198		reset-gpios = <&tlmm 41 GPIO_ACTIVE_HIGH>;
199
200		vdd-supply = <&vreg_hdmi_out_1p2>;
201		vcc-supply = <&lt9611_3v3>;
202
203		pinctrl-0 = <&lt9611_irq_pin &lt9611_rst_pin>;
204		pinctrl-names = "default";
205		#sound-dai-cells = <1>;
206
207		ports {
208			#address-cells = <1>;
209			#size-cells = <0>;
210
211			port@0 {
212				reg = <0>;
213
214				lt9611_a: endpoint {
215					remote-endpoint = <&mdss_dsi0_out>;
216				};
217			};
218
219			port@2 {
220				reg = <2>;
221
222				lt9611_out: endpoint {
223					remote-endpoint = <&hdmi_con>;
224				};
225			};
226		};
227	};
228};
229
230&mdss {
231	status = "okay";
232};
233
234&mdss_dsi0 {
235	vdda-supply = <&vreg_l18a_1p232>;
236	status = "okay";
237};
238
239&mdss_dsi0_out {
240	remote-endpoint = <&lt9611_a>;
241	data-lanes = <0 1 2 3>;
242};
243
244&mdss_dsi0_phy {
245	status = "okay";
246};
247
248&pm6125_gpios {
249	kypd_vol_up_n: kypd-vol-up-n-state {
250		pins = "gpio5";
251		function = "normal";
252		power-source = <0>;
253		bias-pull-up;
254		input-enable;
255	};
256};
257
258&pon_pwrkey {
259	status = "okay";
260};
261
262&pon_resin {
263	linux,code = <KEY_VOLUMEDOWN>;
264	status = "okay";
265};
266
267&qupv3_id_0 {
268	status = "okay";
269};
270
271&remoteproc_adsp {
272	firmware-name = "qcom/qrb4210/adsp.mbn";
273
274	status = "okay";
275};
276
277&remoteproc_cdsp {
278	firmware-name = "qcom/qrb4210/cdsp.mbn";
279
280	status = "okay";
281};
282
283&rpm_requests {
284	regulators {
285		compatible = "qcom,rpm-pm6125-regulators";
286
287		vdd-s1-supply = <&vph_pwr>;
288		vdd-s2-supply = <&vph_pwr>;
289		vdd-s3-supply = <&vph_pwr>;
290		vdd-s4-supply = <&vph_pwr>;
291		vdd-s5-supply = <&vph_pwr>;
292		vdd-s6-supply = <&vph_pwr>;
293		vdd-s7-supply = <&vph_pwr>;
294		vdd-s8-supply = <&vph_pwr>;
295		vdd-s9-supply = <&vph_pwr>;
296		vdd-s10-supply = <&vph_pwr>;
297
298		vdd-l1-l7-l17-l18-supply = <&vreg_s6a_1p352>;
299		vdd-l2-l3-l4-supply = <&vreg_s6a_1p352>;
300		vdd-l5-l15-l19-l20-l21-l22-supply = <&vph_pwr>;
301		vdd-l6-l8-supply = <&vreg_s5a_0p848>;
302		vdd-l9-l11-supply = <&vreg_s7a_2p04>;
303		vdd-l10-l13-l14-supply = <&vreg_s7a_2p04>;
304		vdd-l12-l16-supply = <&vreg_s7a_2p04>;
305		vdd-l23-l24-supply = <&vph_pwr>;
306
307		vreg_s5a_0p848: s5 {
308			regulator-min-microvolt = <920000>;
309			regulator-max-microvolt = <1128000>;
310		};
311
312		vreg_s6a_1p352: s6 {
313			regulator-min-microvolt = <304000>;
314			regulator-max-microvolt = <1456000>;
315		};
316
317		vreg_s7a_2p04: s7 {
318			regulator-min-microvolt = <1280000>;
319			regulator-max-microvolt = <2080000>;
320		};
321
322		vreg_l1a_1p0: l1 {
323			regulator-min-microvolt = <952000>;
324			regulator-max-microvolt = <1152000>;
325		};
326
327		vreg_l4a_0p9: l4 {
328			regulator-min-microvolt = <488000>;
329			regulator-max-microvolt = <1000000>;
330		};
331
332		vreg_l5a_2p96: l5 {
333			regulator-min-microvolt = <1648000>;
334			regulator-max-microvolt = <3056000>;
335			regulator-allow-set-load;
336		};
337
338		vreg_l6a_0p6: l6 {
339			regulator-min-microvolt = <576000>;
340			regulator-max-microvolt = <656000>;
341		};
342
343		vreg_l7a_1p256: l7 {
344			regulator-min-microvolt = <1200000>;
345			regulator-max-microvolt = <1304000>;
346		};
347
348		vreg_l8a_0p664: l8 {
349			regulator-min-microvolt = <400000>;
350			regulator-max-microvolt = <728000>;
351		};
352
353		vreg_l9a_1p8: l9 {
354			regulator-min-microvolt = <1800000>;
355			regulator-max-microvolt = <2000000>;
356		};
357
358		vreg_l10a_1p8: l10 {
359			regulator-min-microvolt = <1704000>;
360			regulator-max-microvolt = <1904000>;
361		};
362
363		vreg_l11a_1p8: l11 {
364			regulator-min-microvolt = <1704000>;
365			regulator-max-microvolt = <1952000>;
366			regulator-allow-set-load;
367		};
368
369		vreg_l12a_1p8: l12 {
370			regulator-min-microvolt = <1624000>;
371			regulator-max-microvolt = <1984000>;
372		};
373
374		vreg_l13a_1p8: l13 {
375			regulator-min-microvolt = <1504000>;
376			regulator-max-microvolt = <1952000>;
377		};
378
379		vreg_l14a_1p8: l14 {
380			regulator-min-microvolt = <1704000>;
381			regulator-max-microvolt = <1904000>;
382		};
383
384		vreg_l15a_3p128: l15 {
385			regulator-min-microvolt = <2920000>;
386			regulator-max-microvolt = <3232000>;
387		};
388
389		vreg_l16a_1p3: l16 {
390			regulator-min-microvolt = <1704000>;
391			regulator-max-microvolt = <1904000>;
392		};
393
394		vreg_l17a_1p3: l17 {
395			regulator-min-microvolt = <1152000>;
396			regulator-max-microvolt = <1384000>;
397		};
398
399		vreg_l18a_1p232: l18 {
400			regulator-min-microvolt = <1104000>;
401			regulator-max-microvolt = <1312000>;
402		};
403
404		vreg_l19a_1p8: l19 {
405			regulator-min-microvolt = <1624000>;
406			regulator-max-microvolt = <3304000>;
407		};
408
409		vreg_l20a_1p8: l20 {
410			regulator-min-microvolt = <1624000>;
411			regulator-max-microvolt = <3304000>;
412		};
413
414		vreg_l21a_2p704: l21 {
415			regulator-min-microvolt = <2400000>;
416			regulator-max-microvolt = <3600000>;
417		};
418
419		vreg_l22a_2p96: l22 {
420			regulator-min-microvolt = <2952000>;
421			regulator-max-microvolt = <3304000>;
422			regulator-system-load = <100000>;
423			regulator-allow-set-load;
424		};
425
426		vreg_l23a_3p3: l23 {
427			regulator-min-microvolt = <3200000>;
428			regulator-max-microvolt = <3400000>;
429		};
430
431		vreg_l24a_2p96: l24 {
432			regulator-min-microvolt = <2704000>;
433			regulator-max-microvolt = <3600000>;
434			regulator-system-load = <100000>;
435			regulator-allow-set-load;
436		};
437	};
438};
439
440&sdhc_1 {
441	pinctrl-0 = <&sdc1_state_on>;
442	pinctrl-1 = <&sdc1_state_off>;
443	pinctrl-names = "default", "sleep";
444
445	vmmc-supply = <&vreg_l24a_2p96>;
446	vqmmc-supply = <&vreg_l11a_1p8>;
447	no-sdio;
448	non-removable;
449
450	status = "okay";
451};
452
453&sdhc_2 {
454	cd-gpios = <&tlmm 88 GPIO_ACTIVE_LOW>; /* card detect gpio */
455
456	pinctrl-0 = <&sdc2_state_on &sdc2_card_det_n>;
457	pinctrl-1 = <&sdc2_state_off &sdc2_card_det_n>;
458	pinctrl-names = "default", "sleep";
459
460	vmmc-supply = <&vreg_l22a_2p96>;
461	vqmmc-supply = <&vreg_l5a_2p96>;
462	no-sdio;
463
464	status = "okay";
465};
466
467&spi5 {
468	status = "okay";
469
470	can@0 {
471		compatible = "microchip,mcp2518fd";
472		reg = <0>;
473		interrupts-extended = <&tlmm 39 IRQ_TYPE_LEVEL_LOW>;
474		clocks = <&clk40M>;
475		spi-max-frequency = <10000000>;
476		vdd-supply = <&vdc_5v>;
477		xceiver-supply = <&vdc_5v>;
478	};
479};
480
481&sleep_clk {
482	clock-frequency = <32000>;
483};
484
485&tlmm {
486	gpio-reserved-ranges = <43 2>, <49 1>, <54 1>,
487			       <56 3>, <61 2>, <64 1>,
488			       <68 1>, <72 8>, <96 1>;
489
490	lt9611_rst_pin: lt9611-rst-state {
491		pins = "gpio41";
492		function = "gpio";
493		input-disable;
494		output-high;
495	};
496
497	lt9611_irq_pin: lt9611-irq-state {
498		pins = "gpio46";
499		function = "gpio";
500		bias-disable;
501	};
502
503	sdc2_card_det_n: sd-card-det-n-state {
504		pins = "gpio88";
505		function = "gpio";
506		drive-strength = <2>;
507		bias-pull-up;
508	};
509};
510
511&uart4 {
512	status = "okay";
513};
514
515&usb {
516	status = "okay";
517};
518
519&usb_dwc3 {
520	maximum-speed = "super-speed";
521	dr_mode = "peripheral";
522};
523
524&usb_hsphy {
525	vdd-supply = <&vreg_l4a_0p9>;
526	vdda-pll-supply = <&vreg_l12a_1p8>;
527	vdda-phy-dpdm-supply = <&vreg_l15a_3p128>;
528
529	status = "okay";
530};
531
532&usb_qmpphy {
533	vdda-phy-supply = <&vreg_l4a_0p9>;
534	vdda-pll-supply = <&vreg_l12a_1p8>;
535
536	status = "okay";
537};
538
539&xo_board {
540	clock-frequency = <19200000>;
541};
542