1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2022, Linaro Limited
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
9#include <dt-bindings/sound/qcom,q6dsp-lpass-ports.h>
10#include "sm8450.dtsi"
11
12/ {
13	model = "Qualcomm Technologies, Inc. SM8450 HDK";
14	compatible = "qcom,sm8450-hdk", "qcom,sm8450";
15
16	aliases {
17		serial0 = &uart7;
18	};
19
20	chosen {
21		stdout-path = "serial0:115200n8";
22	};
23
24	vph_pwr: vph-pwr-regulator {
25		compatible = "regulator-fixed";
26		regulator-name = "vph_pwr";
27		regulator-min-microvolt = <3700000>;
28		regulator-max-microvolt = <3700000>;
29
30		regulator-always-on;
31		regulator-boot-on;
32	};
33};
34
35&apps_rsc {
36	pm8350-rpmh-regulators {
37		compatible = "qcom,pm8350-rpmh-regulators";
38		qcom,pmic-id = "b";
39
40		vdd-s1-supply = <&vph_pwr>;
41		vdd-s2-supply = <&vph_pwr>;
42		vdd-s3-supply = <&vph_pwr>;
43		vdd-s4-supply = <&vph_pwr>;
44		vdd-s5-supply = <&vph_pwr>;
45		vdd-s6-supply = <&vph_pwr>;
46		vdd-s7-supply = <&vph_pwr>;
47		vdd-s8-supply = <&vph_pwr>;
48		vdd-s9-supply = <&vph_pwr>;
49		vdd-s10-supply = <&vph_pwr>;
50		vdd-s11-supply = <&vph_pwr>;
51		vdd-s12-supply = <&vph_pwr>;
52
53		vdd-l1-l4-supply = <&vreg_s11b_0p95>;
54		vdd-l2-l7-supply = <&vreg_bob>;
55		vdd-l3-l5-supply = <&vreg_bob>;
56		vdd-l6-l9-l10-supply = <&vreg_s12b_1p25>;
57		vdd-l8-supply = <&vreg_s2h_0p95>;
58
59		vreg_s10b_1p8: smps10 {
60			regulator-name = "vreg_s10b_1p8";
61			regulator-min-microvolt = <1800000>;
62			regulator-max-microvolt = <1800000>;
63		};
64
65		vreg_s11b_0p95: smps11 {
66			regulator-name = "vreg_s11b_0p95";
67			regulator-min-microvolt = <966000>;
68			regulator-max-microvolt = <1104000>;
69		};
70
71		vreg_s12b_1p25: smps12 {
72			regulator-name = "vreg_s12b_1p25";
73			regulator-min-microvolt = <1350000>;
74			regulator-max-microvolt = <1400000>;
75		};
76
77		vreg_l1b_0p91: ldo1 {
78			regulator-name = "vreg_l1b_0p91";
79			regulator-min-microvolt = <912000>;
80			regulator-max-microvolt = <920000>;
81			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
82		};
83
84		vreg_l2b_3p07: ldo2 {
85			regulator-name = "vreg_l2b_3p07";
86			regulator-min-microvolt = <3072000>;
87			regulator-max-microvolt = <3072000>;
88			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
89		};
90
91		vreg_l3b_0p9: ldo3 {
92			regulator-name = "vreg_l3b_0p9";
93			regulator-min-microvolt = <904000>;
94			regulator-max-microvolt = <904000>;
95			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
96		};
97
98		vreg_l5b_0p88: ldo5 {
99			regulator-name = "vreg_l5b_0p88";
100			regulator-min-microvolt = <880000>;
101			regulator-max-microvolt = <888000>;
102			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
103		};
104
105		vreg_l6b_1p2: ldo6 {
106			regulator-name = "vreg_l6b_1p2";
107			regulator-min-microvolt = <1200000>;
108			regulator-max-microvolt = <1200000>;
109			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
110		};
111
112		vreg_l7b_2p5: ldo7 {
113			regulator-name = "vreg_l7b_2p5";
114			regulator-min-microvolt = <2504000>;
115			regulator-max-microvolt = <2504000>;
116			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
117		};
118
119		vreg_l9b_1p2: ldo9 {
120			regulator-name = "vreg_l9b_1p2";
121			regulator-min-microvolt = <1200000>;
122			regulator-max-microvolt = <1200000>;
123			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
124		};
125	};
126
127	pm8350c-rpmh-regulators {
128		compatible = "qcom,pm8350c-rpmh-regulators";
129		qcom,pmic-id = "c";
130
131		vdd-s1-supply = <&vph_pwr>;
132		vdd-s2-supply = <&vph_pwr>;
133		vdd-s3-supply = <&vph_pwr>;
134		vdd-s4-supply = <&vph_pwr>;
135		vdd-s5-supply = <&vph_pwr>;
136		vdd-s6-supply = <&vph_pwr>;
137		vdd-s7-supply = <&vph_pwr>;
138		vdd-s8-supply = <&vph_pwr>;
139		vdd-s9-supply = <&vph_pwr>;
140		vdd-s10-supply = <&vph_pwr>;
141
142		vdd-l1-l12-supply = <&vreg_bob>;
143		vdd-l2-l8-supply = <&vreg_bob>;
144		vdd-l3-l4-l5-l7-l13-supply = <&vreg_bob>;
145		vdd-l6-l9-l11-supply = <&vreg_bob>;
146		vdd-l10-supply = <&vreg_s12b_1p25>;
147
148		vdd-bob-supply = <&vph_pwr>;
149
150		vreg_s1c_1p86: smps1 {
151			regulator-name = "vreg_s1c_1p86";
152			regulator-min-microvolt = <1800000>;
153			regulator-max-microvolt = <2024000>;
154		};
155
156		vreg_s10c_1p05: smps10 {
157			regulator-name = "vreg_s10c_1p05";
158			regulator-min-microvolt = <1000000>;
159			regulator-max-microvolt = <1100000>;
160		};
161
162		vreg_bob: bob {
163			regulator-name = "vreg_bob";
164			regulator-min-microvolt = <3008000>;
165			regulator-max-microvolt = <3960000>;
166			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
167		};
168
169		vreg_l1c_1p8: ldo1 {
170			regulator-name = "vreg_l1c_1p8";
171			regulator-min-microvolt = <1800000>;
172			regulator-max-microvolt = <1800000>;
173			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
174		};
175
176		vreg_l3c_3p0: ldo3 {
177			regulator-name = "vreg_l3c_3p0";
178			regulator-min-microvolt = <3296000>;
179			regulator-max-microvolt = <3304000>;
180			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
181		};
182
183		vreg_l4c_1p8: ldo4 {
184			regulator-name = "vreg_l4c_1p8";
185			regulator-min-microvolt = <1704000>;
186			regulator-max-microvolt = <3000000>;
187			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
188		};
189
190		vreg_l5c_1p8: ldo5 {
191			regulator-name = "vreg_l5c_1p8";
192			regulator-min-microvolt = <1704000>;
193			regulator-max-microvolt = <3000000>;
194			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
195		};
196
197		vreg_l6c_1p8: ldo6 {
198			regulator-name = "vreg_l6c_1p8";
199			regulator-min-microvolt = <1800000>;
200			regulator-max-microvolt = <3008000>;
201			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
202		};
203
204		vreg_l7c_3p0: ldo7 {
205			regulator-name = "vreg_l7c_3p0";
206			regulator-min-microvolt = <3008000>;
207			regulator-max-microvolt = <3008000>;
208			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
209		};
210
211		vreg_l8c_1p8: ldo8 {
212			regulator-name = "vreg_l8c_1p8";
213			regulator-min-microvolt = <1800000>;
214			regulator-max-microvolt = <1800000>;
215			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
216		};
217
218		vreg_l9c_2p96: ldo9 {
219			regulator-name = "vreg_l9c_2p96";
220			regulator-min-microvolt = <2960000>;
221			regulator-max-microvolt = <3008000>;
222			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
223		};
224
225		vreg_l12c_1p8: ldo12 {
226			regulator-name = "vreg_l12c_1p8";
227			regulator-min-microvolt = <1800000>;
228			regulator-max-microvolt = <1968000>;
229			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
230		};
231
232		vreg_l13c_3p0: ldo13 {
233			regulator-name = "vreg_l13c_3p0";
234			regulator-min-microvolt = <3000000>;
235			regulator-max-microvolt = <3000000>;
236			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
237		};
238	};
239
240	pm8450-rpmh-regulators {
241		compatible = "qcom,pm8450-rpmh-regulators";
242		qcom,pmic-id = "h";
243
244		vdd-s1-supply = <&vph_pwr>;
245		vdd-s2-supply = <&vph_pwr>;
246		vdd-s3-supply = <&vph_pwr>;
247		vdd-s4-supply = <&vph_pwr>;
248		vdd-s5-supply = <&vph_pwr>;
249		vdd-s6-supply = <&vph_pwr>;
250
251		vdd-l2-supply = <&vreg_bob>;
252		vdd-l3-supply = <&vreg_bob>;
253		vdd-l4-supply = <&vreg_bob>;
254
255		vreg_s2h_0p95: smps2 {
256			regulator-name = "vreg_s2h_0p95";
257			regulator-min-microvolt = <848000>;
258			regulator-max-microvolt = <1104000>;
259		};
260
261		vreg_s3h_0p5: smps3 {
262			regulator-name = "vreg_s3h_0p5";
263			regulator-min-microvolt = <500000>;
264			regulator-max-microvolt = <500000>;
265		};
266
267		vreg_l2h_0p91: ldo2 {
268			regulator-name = "vreg_l2h_0p91";
269			regulator-min-microvolt = <880000>;
270			regulator-max-microvolt = <912000>;
271			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
272		};
273
274		vreg_l3h_0p91: ldo3 {
275			regulator-name = "vreg_l3h_0p91";
276			regulator-min-microvolt = <912000>;
277			regulator-max-microvolt = <912000>;
278			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
279		};
280
281	};
282
283	pmr735a-rpmh-regulators {
284		compatible = "qcom,pmr735a-rpmh-regulators";
285		qcom,pmic-id = "e";
286
287		vdd-s1-supply = <&vph_pwr>;
288		vdd-s2-supply = <&vph_pwr>;
289		vdd-s3-supply = <&vph_pwr>;
290
291		vdd-l1-l2-supply = <&vreg_s2e_0p85>;
292		vdd-l3-supply = <&vreg_s1e_1p25>;
293		vdd-l4-supply = <&vreg_s1c_1p86>;
294		vdd-l5-l6-supply = <&vreg_s1c_1p86>;
295		vdd-l7-bob-supply = <&vreg_bob>;
296
297		vreg_s1e_1p25: smps1 {
298			regulator-name = "vreg_s1e_1p25";
299			regulator-min-microvolt = <1200000>;
300			regulator-max-microvolt = <1296000>;
301		};
302
303		vreg_s2e_0p85: smps2 {
304			regulator-name = "vreg_s2e_0p85";
305			regulator-min-microvolt = <500000>;
306			regulator-max-microvolt = <1040000>;
307		};
308
309		vreg_l1e_0p8: ldo1 {
310			regulator-name = "vreg_l1e_0p8";
311			regulator-min-microvolt = <800000>;
312			regulator-max-microvolt = <800000>;
313		};
314
315		vreg_l2e_0p8: ldo2 {
316			regulator-name = "vreg_l2e_0p8";
317			regulator-min-microvolt = <800000>;
318			regulator-max-microvolt = <800000>;
319		};
320
321		vreg_l3e_1p2: ldo3 {
322			regulator-name = "vreg_l3e_1p2";
323			regulator-min-microvolt = <1200000>;
324			regulator-max-microvolt = <1200000>;
325		};
326
327		vreg_l4e_1p7: ldo4 {
328			regulator-name = "vreg_l4e_1p7";
329			regulator-min-microvolt = <1776000>;
330			regulator-max-microvolt = <1776000>;
331		};
332
333		vreg_l5e_0p88: ldo5 {
334			regulator-name = "vreg_l5e_0p88";
335			regulator-min-microvolt = <880000>;
336			regulator-max-microvolt = <880000>;
337		};
338
339		vreg_l6e_1p2: ldo6 {
340			regulator-name = "vreg_l6e_1p2";
341			regulator-min-microvolt = <1200000>;
342			regulator-max-microvolt = <1200000>;
343		};
344
345		vreg_l7e_2p8: ldo7 {
346			regulator-name = "vreg_l7e_2p8";
347			regulator-min-microvolt = <2800000>;
348			regulator-max-microvolt = <2800000>;
349		};
350	};
351};
352
353&pcie0 {
354	status = "okay";
355	max-link-speed = <2>;
356};
357
358&pcie0_phy {
359	status = "okay";
360	vdda-phy-supply = <&vreg_l5b_0p88>;
361	vdda-pll-supply = <&vreg_l6b_1p2>;
362};
363
364&pcie1 {
365	status = "okay";
366};
367
368&pcie1_phy {
369	status = "okay";
370	vdda-phy-supply = <&vreg_l2h_0p91>;
371	vdda-pll-supply = <&vreg_l6b_1p2>;
372};
373
374&remoteproc_adsp {
375	status = "okay";
376	firmware-name = "qcom/sm8450/adsp.mbn";
377};
378
379&remoteproc_cdsp {
380	status = "okay";
381	firmware-name = "qcom/sm8450/cdsp.mbn";
382};
383
384&remoteproc_mpss {
385	status = "okay";
386	firmware-name = "qcom/sm8450/modem.mbn";
387};
388
389&remoteproc_slpi {
390	status = "okay";
391	firmware-name = "qcom/sm8450/slpi.mbn";
392};
393
394&qupv3_id_0 {
395	status = "okay";
396};
397
398&sdhc_2 {
399	cd-gpios = <&tlmm 92 GPIO_ACTIVE_HIGH>;
400	pinctrl-names = "default", "sleep";
401	pinctrl-0 = <&sdc2_default_state &sdc2_card_det_n>;
402	pinctrl-1 = <&sdc2_sleep_state &sdc2_card_det_n>;
403	vmmc-supply = <&vreg_l9c_2p96>;
404	vqmmc-supply = <&vreg_l6c_1p8>;
405	no-sdio;
406	no-mmc;
407	status = "okay";
408};
409
410&soc {
411	wcd938x: codec {
412		compatible = "qcom,wcd9380-codec";
413
414		pinctrl-names = "default";
415		pinctrl-0 = <&wcd_default>;
416
417		qcom,micbias1-microvolt = <1800000>;
418		qcom,micbias2-microvolt = <1800000>;
419		qcom,micbias3-microvolt = <1800000>;
420		qcom,micbias4-microvolt = <1800000>;
421		qcom,mbhc-buttons-vthreshold-microvolt = <75000 150000 237000 500000 500000 500000 500000 500000>;
422		qcom,mbhc-headset-vthreshold-microvolt = <1700000>;
423		qcom,mbhc-headphone-vthreshold-microvolt = <50000>;
424		qcom,rx-device = <&wcd_rx>;
425		qcom,tx-device = <&wcd_tx>;
426
427		reset-gpios = <&tlmm 43 GPIO_ACTIVE_LOW>;
428		#sound-dai-cells = <1>;
429
430		vdd-buck-supply = <&vreg_s10b_1p8>;
431		vdd-rxtx-supply = <&vreg_s10b_1p8>;
432		vdd-io-supply = <&vreg_s10b_1p8>;
433		vdd-mic-bias-supply = <&vreg_bob>;
434	};
435};
436
437&sound {
438	compatible = "qcom,sm8450-sndcard";
439	model = "SM8450-HDK";
440	audio-routing = "SpkrLeft IN", "WSA_SPK1 OUT",
441			"SpkrRight IN", "WSA_SPK2 OUT",
442			"IN1_HPHL", "HPHL_OUT",
443			"IN2_HPHR", "HPHR_OUT",
444			"AMIC2", "MIC BIAS2",
445			"VA DMIC0", "MIC BIAS1",
446			"VA DMIC1", "MIC BIAS1",
447			"VA DMIC2", "MIC BIAS3",
448			"TX DMIC0", "MIC BIAS1",
449			"TX DMIC1", "MIC BIAS2",
450			"TX DMIC2", "MIC BIAS3",
451			"TX SWR_ADC1", "ADC2_OUTPUT";
452
453	wcd-playback-dai-link {
454		link-name = "WCD Playback";
455
456		cpu {
457			sound-dai = <&q6apmbedai RX_CODEC_DMA_RX_0>;
458		};
459
460		codec {
461			sound-dai = <&wcd938x 0>, <&swr1 0>, <&rxmacro 0>;
462		};
463
464		platform {
465			sound-dai = <&q6apm>;
466		};
467	};
468
469	wcd-capture-dai-link {
470		link-name = "WCD Capture";
471
472		cpu {
473			sound-dai = <&q6apmbedai TX_CODEC_DMA_TX_3>;
474		};
475
476		codec {
477			sound-dai = <&wcd938x 1>, <&swr2 0>, <&txmacro 0>;
478		};
479
480		platform {
481			sound-dai = <&q6apm>;
482		};
483	};
484
485	wsa-dai-link {
486		link-name = "WSA Playback";
487
488		cpu {
489			sound-dai = <&q6apmbedai WSA_CODEC_DMA_RX_0>;
490		};
491
492		codec {
493			sound-dai = <&left_spkr>, <&right_spkr>, <&swr0 0>, <&wsamacro 0>;
494		};
495
496		platform {
497			sound-dai = <&q6apm>;
498		};
499	};
500
501	va-dai-link {
502		link-name = "VA Capture";
503
504		cpu {
505			sound-dai = <&q6apmbedai TX_CODEC_DMA_TX_3>;
506		};
507
508		codec {
509			sound-dai = <&vamacro 0>;
510		};
511
512		platform {
513			sound-dai = <&q6apm>;
514		};
515	};
516};
517
518&swr0 {
519	left_spkr: speaker@0,1 {
520		compatible = "sdw10217020200";
521		reg = <0 1>;
522		pinctrl-names = "default";
523		pinctrl-0 = <&spkr_1_sd_n_active>;
524		powerdown-gpios = <&tlmm 1 GPIO_ACTIVE_LOW>;
525		#sound-dai-cells = <0>;
526		sound-name-prefix = "SpkrLeft";
527		#thermal-sensor-cells = <0>;
528		vdd-supply = <&vreg_s10b_1p8>;
529	};
530
531	right_spkr: speaker@0,2 {
532		compatible = "sdw10217020200";
533		reg = <0 2>;
534		pinctrl-names = "default";
535		pinctrl-0 = <&spkr_2_sd_n_active>;
536		powerdown-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
537		#sound-dai-cells = <0>;
538		sound-name-prefix = "SpkrRight";
539		#thermal-sensor-cells = <0>;
540		vdd-supply = <&vreg_s10b_1p8>;
541	};
542};
543
544&swr1 {
545	status = "okay";
546
547	wcd_rx: codec@0,4 {
548		compatible = "sdw20217010d00";
549		reg = <0 4>;
550		qcom,rx-port-mapping = <1 2 3 4 5>;
551	};
552};
553
554&swr2 {
555	status = "okay";
556
557	wcd_tx: codec@0,3 {
558		compatible = "sdw20217010d00";
559		reg = <0 3>;
560		qcom,tx-port-mapping = <1 1 2 3>;
561	};
562};
563
564&tlmm {
565	gpio-reserved-ranges = <28 4>, <36 4>;
566
567	sdc2_card_det_n: sd-card-det-n-state {
568		pins = "gpio92";
569		function = "gpio";
570		drive-strength = <2>;
571		bias-pull-up;
572	};
573};
574
575&uart7 {
576	status = "okay";
577};
578
579&ufs_mem_hc {
580	status = "okay";
581
582	reset-gpios = <&tlmm 210 GPIO_ACTIVE_LOW>;
583
584	vcc-supply = <&vreg_l7b_2p5>;
585	vcc-max-microamp = <1100000>;
586	vccq-supply = <&vreg_l9b_1p2>;
587	vccq-max-microamp = <1200000>;
588};
589
590&ufs_mem_phy {
591	status = "okay";
592
593	vdda-phy-supply = <&vreg_l5b_0p88>;
594	vdda-pll-supply = <&vreg_l6b_1p2>;
595};
596
597&usb_1 {
598	status = "okay";
599};
600
601&usb_1_dwc3 {
602	dr_mode = "peripheral";
603};
604
605&usb_1_hsphy {
606	status = "okay";
607
608	vdda-pll-supply = <&vreg_l5b_0p88>;
609	vdda18-supply = <&vreg_l1c_1p8>;
610	vdda33-supply = <&vreg_l2b_3p07>;
611};
612
613&usb_1_qmpphy {
614	status = "okay";
615
616	vdda-phy-supply = <&vreg_l6b_1p2>;
617	vdda-pll-supply = <&vreg_l1b_0p91>;
618};
619
620&vamacro {
621	pinctrl-0 = <&dmic01_default>, <&dmic02_default>;
622	pinctrl-names = "default";
623	vdd-micb-supply = <&vreg_s10b_1p8>;
624	qcom,dmic-sample-rate = <600000>;
625};
626
627&tlmm {
628	spkr_1_sd_n_active: spkr-1-sd-n-active-state {
629		pins = "gpio1";
630		function = "gpio";
631		drive-strength = <4>;
632		bias-disable;
633		output-low;
634	};
635
636	spkr_2_sd_n_active: spkr-2-sd-n-active-state {
637		pins = "gpio89";
638		function = "gpio";
639		drive-strength = <4>;
640		bias-disable;
641		output-low;
642	};
643
644	wcd_default: wcd-default-state {
645		pins = "gpio43";
646		function = "gpio";
647		bias-disable;
648	};
649};
650