1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2022, Konrad Dybcio <konrad.dybcio@somainline.org>
4 */
5
6#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
7#include "sm8450.dtsi"
8#include "pm8350.dtsi"
9#include "pm8350b.dtsi"
10#include "pm8350c.dtsi"
11#include "pm8450.dtsi"
12#include "pmk8350.dtsi"
13#include "pmr735a.dtsi"
14
15/delete-node/ &adsp_mem;
16/delete-node/ &rmtfs_mem;
17/delete-node/ &video_mem;
18
19/ {
20	chassis-type = "handset";
21
22	aliases {
23		serial0 = &uart7;
24	};
25
26	chosen {
27		stdout-path = "serial0:115200n8";
28	};
29
30	reserved-memory {
31		adsp_mem: memory@85700000 {
32			reg = <0x0 0x85700000 0x0 0x2800000>;
33			no-map;
34		};
35
36		video_mem: memory@9fd00000 {
37			reg = <0x0 0x9fd00000 0x0 0x700000>;
38			no-map;
39		};
40
41		rmtfs_mem: memory@f3300000 {
42			compatible = "qcom,rmtfs-mem";
43			reg = <0x0 0xf3300000 0x0 0x280000>;
44			no-map;
45
46			qcom,client-id = <1>;
47			qcom,vmid = <15>;
48		};
49
50		ramoops@ffc00000 {
51			compatible = "ramoops";
52			reg = <0 0xffc00000 0 0x200000>;
53			console-size = <0x40000>;
54			record-size = <0x1000>;
55			ecc-size = <16>;
56			no-map;
57		};
58	};
59
60	/* Sadly, the voltages for these GPIO regulators are unknown. */
61	imx650_vana_vreg: imx650-vana-regulator {
62		compatible = "regulator-fixed";
63		regulator-name = "imx650_vana_vreg";
64		gpio = <&tlmm 23 GPIO_ACTIVE_HIGH>;
65		enable-active-high;
66	};
67
68	vph_pwr: vph-pwr-regulator {
69		compatible = "regulator-fixed";
70		regulator-name = "vph_pwr";
71		regulator-min-microvolt = <3700000>;
72		regulator-max-microvolt = <3700000>;
73
74		regulator-always-on;
75		regulator-boot-on;
76	};
77};
78
79&apps_rsc {
80	pm8350-rpmh-regulators {
81		compatible = "qcom,pm8350-rpmh-regulators";
82		qcom,pmic-id = "b";
83
84		vdd-s1-supply = <&vph_pwr>;
85		vdd-s2-supply = <&vph_pwr>;
86		vdd-s3-supply = <&vph_pwr>;
87		vdd-s4-supply = <&vph_pwr>;
88		vdd-s5-supply = <&vph_pwr>;
89		vdd-s6-supply = <&vph_pwr>;
90		vdd-s7-supply = <&vph_pwr>;
91		vdd-s8-supply = <&vph_pwr>;
92		vdd-s9-supply = <&vph_pwr>;
93		vdd-s10-supply = <&vph_pwr>;
94		vdd-s11-supply = <&vph_pwr>;
95		vdd-s12-supply = <&vph_pwr>;
96
97		vdd-l1-l4-supply = <&pm8350_s11>;
98		vdd-l2-l7-supply = <&vreg_bob>;
99		vdd-l3-l5-supply = <&vreg_bob>;
100		vdd-l6-l9-l10-supply = <&pm8350_s12>;
101
102		/*
103		 * ARC regulators:
104		 * s5 - gfx.lvl
105		 * l8 - lcx.lvl
106		 */
107
108		pm8350_s10: smps10 {
109			regulator-name = "pm8350_s10";
110			regulator-min-microvolt = <1800000>;
111			regulator-max-microvolt = <1800000>;
112		};
113
114		pm8350_s11: smps11 {
115			regulator-name = "pm8350_s11";
116			regulator-min-microvolt = <848000>;
117			regulator-max-microvolt = <1104000>;
118		};
119
120		pm8350_s12: smps12 {
121			regulator-name = "pm8350_s12";
122			regulator-min-microvolt = <1224000>;
123			regulator-max-microvolt = <1400000>;
124		};
125
126		pm8350_l1: ldo1 {
127			regulator-name = "pm8350_l1";
128			regulator-min-microvolt = <912000>;
129			regulator-max-microvolt = <920000>;
130			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
131		};
132
133		pm8350_l2: ldo2 {
134			regulator-name = "pm8350_l2";
135			regulator-min-microvolt = <3072000>;
136			regulator-max-microvolt = <3072000>;
137			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
138		};
139
140		pm8350_l3: ldo3 {
141			regulator-name = "pm8350_l3";
142			regulator-min-microvolt = <904000>;
143			regulator-max-microvolt = <904000>;
144			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
145		};
146
147		pm8350_l5: ldo5 {
148			regulator-name = "pm8350_l5";
149			regulator-min-microvolt = <880000>;
150			regulator-max-microvolt = <912000>;
151			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
152		};
153
154		pm8350_l6: ldo6 {
155			regulator-name = "pm8350_l6";
156			regulator-min-microvolt = <1200000>;
157			regulator-max-microvolt = <1200000>;
158			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
159		};
160
161		pm8350_l7: ldo7 {
162			regulator-name = "pm8350_l7";
163			regulator-min-microvolt = <2504000>;
164			regulator-max-microvolt = <2504000>;
165			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
166		};
167
168		pm8350_l9: ldo9 {
169			regulator-name = "pm8350_l9";
170			regulator-min-microvolt = <1200000>;
171			regulator-max-microvolt = <1200000>;
172			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
173		};
174	};
175
176	pm8350c-rpmh-regulators {
177		compatible = "qcom,pm8350c-rpmh-regulators";
178		qcom,pmic-id = "c";
179
180		vdd-s1-supply = <&vph_pwr>;
181		vdd-s2-supply = <&vph_pwr>;
182		vdd-s3-supply = <&vph_pwr>;
183		vdd-s4-supply = <&vph_pwr>;
184		vdd-s5-supply = <&vph_pwr>;
185		vdd-s6-supply = <&vph_pwr>;
186		vdd-s7-supply = <&vph_pwr>;
187		vdd-s8-supply = <&vph_pwr>;
188		vdd-s9-supply = <&vph_pwr>;
189		vdd-s10-supply = <&vph_pwr>;
190
191		vdd-l1-l12-supply = <&vreg_bob>;
192		vdd-l2-l8-supply = <&vreg_bob>;
193		vdd-l3-l4-l5-l7-l13-supply = <&vreg_bob>;
194		vdd-l6-l9-l11-supply = <&vreg_bob>;
195		vdd-l10-supply = <&pm8350_s12>;
196
197		vdd-bob-supply = <&vph_pwr>;
198
199		/*
200		 * ARC regulators:
201		 * s2 - mxc.lvl
202		 * s4 - mss.lvl
203		 * s6 - cx.lvl
204		 */
205
206		pm8350c_s1: smps1 {
207			regulator-name = "pm8350c_s1";
208			regulator-min-microvolt = <1800000>;
209			regulator-max-microvolt = <2024000>;
210		};
211
212		pm8350c_s10: smps10 {
213			regulator-name = "pm8350c_s10";
214			regulator-min-microvolt = <1000000>;
215			regulator-max-microvolt = <1100000>;
216		};
217
218		vreg_bob: bob {
219			regulator-name = "vreg_bob";
220			regulator-min-microvolt = <3400000>;
221			regulator-max-microvolt = <3960000>;
222			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
223		};
224
225		pm8350c_l1: ldo1 {
226			regulator-name = "pm8350c_l1";
227			regulator-min-microvolt = <1800000>;
228			regulator-max-microvolt = <1800000>;
229			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
230		};
231
232		pm8350c_l2: ldo2 {
233			regulator-name = "pm8350c_l2";
234			regulator-min-microvolt = <1800000>;
235			regulator-max-microvolt = <1800000>;
236			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
237		};
238
239		pm8350c_l3: ldo3 {
240			regulator-name = "pm8350c_l3";
241			regulator-min-microvolt = <3296000>;
242			regulator-max-microvolt = <3304000>;
243			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
244		};
245
246		pm8350c_l4: ldo4 {
247			regulator-name = "pm8350c_l4";
248			regulator-min-microvolt = <1704000>;
249			regulator-max-microvolt = <3000000>;
250			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
251		};
252
253		pm8350c_l5: ldo5 {
254			regulator-name = "pm8350c_l5";
255			regulator-min-microvolt = <1704000>;
256			regulator-max-microvolt = <3000000>;
257			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
258		};
259
260		pm8350c_l6: ldo6 {
261			regulator-name = "pm8350c_l6";
262			regulator-min-microvolt = <2960000>;
263			/* Originally max = 3008000 but SDHCI expects 2960000 */
264			regulator-max-microvolt = <2960000>;
265			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
266		};
267
268		pm8350c_l7: ldo7 {
269			regulator-name = "pm8350c_l7";
270			regulator-min-microvolt = <3008000>;
271			regulator-max-microvolt = <3008000>;
272			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
273		};
274
275		pm8350c_l8: ldo8 {
276			regulator-name = "pm8350c_l8";
277			regulator-min-microvolt = <1800000>;
278			regulator-max-microvolt = <1800000>;
279			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
280		};
281
282		pm8350c_l9: ldo9 {
283			regulator-name = "pm8350c_l9";
284			regulator-min-microvolt = <2960000>;
285			/* Originally max = 3008000 but SDHCI expects 2960000 */
286			regulator-max-microvolt = <2960000>;
287			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
288		};
289
290		pm8350c_l10: ldo10 {
291			regulator-name = "pm8350c_l10";
292			regulator-min-microvolt = <1200000>;
293			regulator-max-microvolt = <1200000>;
294			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
295		};
296
297		pm8350c_l12: ldo12 {
298			regulator-name = "pm8350c_l12";
299			regulator-min-microvolt = <1800000>;
300			regulator-max-microvolt = <1968000>;
301			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
302		};
303
304		pm8350c_l13: ldo13 {
305			regulator-name = "pm8350c_l13";
306			regulator-min-microvolt = <3000000>;
307			regulator-max-microvolt = <3000000>;
308			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
309		};
310	};
311
312	pm8450-rpmh-regulators {
313		compatible = "qcom,pm8450-rpmh-regulators";
314		qcom,pmic-id = "h";
315
316		vdd-s1-supply = <&vph_pwr>;
317		vdd-s2-supply = <&vph_pwr>;
318		vdd-s3-supply = <&vph_pwr>;
319		vdd-s4-supply = <&vph_pwr>;
320		vdd-s5-supply = <&vph_pwr>;
321		vdd-s6-supply = <&vph_pwr>;
322
323		vdd-l2-supply = <&vreg_bob>;
324		vdd-l3-supply = <&vreg_bob>;
325		vdd-l4-supply = <&vreg_bob>;
326
327		/*
328		 * ARC regulators:
329		 * S2 - ebi.lvl
330		 * S4 - mmcx.lvl
331		 * S6 - mx.lvl
332		 * L1 - lmx.lvl
333		 */
334
335		pm8450_s3: smps3 {
336			regulator-name = "pm8450_s3";
337			regulator-min-microvolt = <500000>;
338			regulator-max-microvolt = <600000>;
339		};
340
341		pm8450_l2: ldo2 {
342			regulator-name = "pm8450_l2";
343			regulator-min-microvolt = <880000>;
344			regulator-max-microvolt = <912000>;
345			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
346		};
347
348		pm8450_l3: ldo3 {
349			regulator-name = "pm8450_l3";
350			regulator-min-microvolt = <912000>;
351			regulator-max-microvolt = <912000>;
352			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
353		};
354	};
355
356	pmr735a-rpmh-regulators {
357		compatible = "qcom,pmr735a-rpmh-regulators";
358		qcom,pmic-id = "e";
359
360		vdd-s1-supply = <&vph_pwr>;
361		vdd-s2-supply = <&vph_pwr>;
362		vdd-s3-supply = <&vph_pwr>;
363
364		vdd-l1-l2-supply = <&pmr735a_s2>;
365		vdd-l3-supply = <&pmr735a_s1>;
366		vdd-l4-supply = <&pm8350c_s1>;
367		vdd-l5-l6-supply = <&pm8350c_s1>;
368		vdd-l7-bob-supply = <&vreg_bob>;
369
370		pmr735a_s1: smps1 {
371			regulator-name = "pmr735a_s1";
372			regulator-min-microvolt = <1200000>;
373			regulator-max-microvolt = <1296000>;
374		};
375
376		pmr735a_s2: smps2 {
377			regulator-name = "pmr735a_s2";
378			regulator-min-microvolt = <500000>;
379			regulator-max-microvolt = <1040000>;
380		};
381
382		pmr735a_s3: smps3 {
383			regulator-name = "pmr735a_s3";
384			regulator-min-microvolt = <435000>;
385			regulator-max-microvolt = <2352000>;
386		};
387
388		pmr735a_l1: ldo1 {
389			regulator-name = "pmr735a_l1";
390			regulator-min-microvolt = <800000>;
391			regulator-max-microvolt = <800000>;
392		};
393
394		pmr735a_l2: ldo2 {
395			regulator-name = "pmr735a_l2";
396			regulator-min-microvolt = <480000>;
397			regulator-max-microvolt = <912000>;
398		};
399
400		pmr735a_l3: ldo3 {
401			regulator-name = "pmr735a_l3";
402			regulator-min-microvolt = <1200000>;
403			regulator-max-microvolt = <1200000>;
404		};
405
406		pmr735a_l4: ldo4 {
407			regulator-name = "pmr735a_l4";
408			regulator-min-microvolt = <1776000>;
409			regulator-max-microvolt = <1776000>;
410		};
411
412		pmr735a_l5: ldo5 {
413			regulator-name = "pmr735a_l5";
414			regulator-min-microvolt = <880000>;
415			regulator-max-microvolt = <880000>;
416		};
417
418		pmr735a_l6: ldo6 {
419			regulator-name = "pmr735a_l6";
420			regulator-min-microvolt = <1200000>;
421			regulator-max-microvolt = <1200000>;
422		};
423
424		pmr735a_l7: ldo7 {
425			regulator-name = "pmr735a_l7";
426			regulator-min-microvolt = <2800000>;
427			regulator-max-microvolt = <2800000>;
428		};
429	};
430};
431
432&gpi_dma0 {
433	status = "okay";
434};
435
436&gpi_dma1 {
437	status = "okay";
438};
439
440&gpi_dma2 {
441	status = "okay";
442};
443
444&i2c4 {
445	clock-frequency = <400000>;
446	status = "okay";
447
448	touchscreen@48 {
449		compatible = "samsung,s6sy761";
450		reg = <0x48>;
451		interrupt-parent = <&tlmm>;
452		interrupts = <21 0x2008>;
453		vdd-supply = <&pm8350c_l2>;
454		avdd-supply = <&pm8350c_l3>;
455
456		pinctrl-names = "default";
457		pinctrl-0 = <&ts_reset_default &ts_int_default>;
458	};
459};
460
461&i2c5 {
462	clock-frequency = <400000>;
463	status = "okay";
464
465	/* Dialog SLG51000 CMIC @ 75 */
466};
467
468&i2c9 {
469	clock-frequency = <400000>;
470	status = "okay";
471
472	/* NXP SN1X0 NFC @ 28 */
473};
474
475&i2c13 {
476	clock-frequency = <400000>;
477	status = "okay";
478
479	/* Richwave RTC6226 FM Radio Receiver @ 64 */
480};
481
482&i2c14 {
483	clock-frequency = <1000000>;
484	status = "okay";
485
486	cs35l41_l: speaker-amp@40 {
487		compatible = "cirrus,cs35l41";
488		reg = <0x40>;
489		interrupt-parent = <&tlmm>;
490		interrupts = <182 IRQ_TYPE_LEVEL_LOW>;
491		reset-gpios = <&tlmm 183 GPIO_ACTIVE_HIGH>;
492		cirrus,boost-peak-milliamp = <4000>;
493		cirrus,boost-ind-nanohenry = <1000>;
494		cirrus,boost-cap-microfarad = <15>;
495		cirrus,gpio2-src-select = <2>;
496		cirrus,gpio2-output-enable;
497		cirrus,asp-sdout-hiz = <3>;
498		#sound-dai-cells = <1>;
499	};
500
501	cs35l41_r: speaker-amp@41 {
502		compatible = "cirrus,cs35l41";
503		reg = <0x41>;
504		interrupt-parent = <&tlmm>;
505		interrupts = <182 IRQ_TYPE_LEVEL_LOW>;
506		reset-gpios = <&tlmm 183 GPIO_ACTIVE_HIGH>;
507		cirrus,boost-peak-milliamp = <4000>;
508		cirrus,boost-ind-nanohenry = <1000>;
509		cirrus,boost-cap-microfarad = <15>;
510		cirrus,gpio2-src-select = <2>;
511		cirrus,gpio2-output-enable;
512		cirrus,asp-sdout-hiz = <3>;
513		#sound-dai-cells = <1>;
514	};
515};
516
517&i2c15 {
518	clock-frequency = <400000>;
519	status = "okay";
520
521	/* AMS TCS3490 RGB+IR color sensor @ 72 */
522};
523
524&i2c19 {
525	clock-frequency = <1000000>;
526	status = "okay";
527
528	/* Cirrus Logic CS40L25A boosted haptics driver @ 40 */
529};
530
531&pcie0 {
532	max-link-speed = <2>;
533	status = "okay";
534};
535
536&pcie0_phy {
537	vdda-phy-supply = <&pm8350_l5>;
538	vdda-pll-supply = <&pm8350_l6>;
539	status = "okay";
540};
541
542&pm8350_gpios {
543	gpio-line-names = "ASSIGN1_THERM", /* GPIO_1 */
544			  "LCD_ID",
545			  "SDR_MMW_THERM",
546			  "RF_ID",
547			  "NC",
548			  "VOL_DOWN_N",
549			  "NC",
550			  "NC",
551			  "NC",
552			  "PM8350_OPTION"; /* GPIO_10 */
553};
554
555&pm8450_gpios {
556	gpio-line-names = "FP_LDO_EN", /* GPIO_1 */
557			  "",
558			  "",
559			  "";
560};
561
562&pmk8350_gpios {
563	gpio-line-names = "NC", /* GPIO_1 */
564			  "NC",
565			  "DISP_THERM",
566			  "PMK8350_OPTION";
567};
568
569&remoteproc_adsp {
570	firmware-name = "qcom/sm8350/Sony/nagara/adsp.mbn";
571	status = "okay";
572};
573
574&remoteproc_cdsp {
575	firmware-name = "qcom/sm8350/Sony/nagara/cdsp.mbn";
576	status = "okay";
577};
578
579&remoteproc_slpi {
580	firmware-name = "qcom/sm8350/Sony/nagara/slpi.mbn";
581	status = "okay";
582};
583
584&qupv3_id_0 {
585	status = "okay";
586};
587
588&qupv3_id_1 {
589	status = "okay";
590};
591
592&qupv3_id_2 {
593	status = "okay";
594};
595
596&sdhc_2 {
597	cd-gpios = <&tlmm 92 GPIO_ACTIVE_HIGH>;
598	pinctrl-names = "default", "sleep";
599	pinctrl-0 = <&sdc2_default_state &sdc2_card_det_n>;
600	pinctrl-1 = <&sdc2_sleep_state &sdc2_card_det_n>;
601	vmmc-supply = <&pm8350c_l9>;
602	vqmmc-supply = <&pm8350c_l6>;
603	no-sdio;
604	no-mmc;
605	status = "okay";
606};
607
608&spi10 {
609	status = "okay";
610
611	/* NXP SN1X0 NFC Secure Element @ 0 */
612};
613
614&tlmm {
615	gpio-reserved-ranges = <28 4>;
616
617	ts_reset_default: ts-reset-default-state {
618		pins = "gpio20";
619		function = "gpio";
620		drive-strength = <2>;
621		bias-disable;
622		output-high;
623	};
624
625	ts_int_default: ts-int-default-state {
626		pins = "gpio21";
627		function = "gpio";
628		drive-strength = <2>;
629		bias-disable;
630		input-enable;
631	};
632
633	sdc2_card_det_n: sd-card-det-n-state {
634		pins = "gpio92";
635		function = "gpio";
636		drive-strength = <2>;
637		bias-pull-up;
638	};
639};
640
641&uart7 {
642	status = "okay";
643};
644
645&usb_1 {
646	status = "okay";
647};
648
649&usb_1_dwc3 {
650	dr_mode = "peripheral";
651};
652
653&usb_1_hsphy {
654	vdda-pll-supply = <&pm8350_l5>;
655	vdda18-supply = <&pm8350c_l1>;
656	vdda33-supply = <&pm8350_l2>;
657	status = "okay";
658};
659
660&usb_1_qmpphy {
661	vdda-phy-supply = <&pm8350_l6>;
662	vdda-pll-supply = <&pm8350_l1>;
663	status = "okay";
664};
665