xref: /linux/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi (revision 4b660dbd9ee2059850fd30e0df420ca7a38a1856)
1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2020, Konrad Dybcio <konrad.dybcio@somainline.org>
4 * Copyright (c) 2020, AngeloGioacchino Del Regno
5 *                     <angelogioacchino.delregno@somainline.org>
6 */
7
8#include "pm660.dtsi"
9#include "pm660l.dtsi"
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/input/input.h>
12#include <dt-bindings/input/gpio-keys.h>
13#include <dt-bindings/leds/common.h>
14
15/ {
16	/* required for bootloader to select correct board */
17	qcom,msm-id = <318 0>;
18	qcom,board-id = <8 1>;
19	qcom,pmic-id = <0x1001b 0x101011a 0x00 0x00 0x1001b 0x201011a 0x00 0x00>;
20
21	/* This part enables graphical output via bootloader-enabled display */
22	chosen {
23		bootargs = "earlycon=tty0 console=tty0";
24
25		#address-cells = <2>;
26		#size-cells = <2>;
27		ranges;
28
29		stdout-path = "framebuffer0";
30
31		framebuffer0: framebuffer@9d400000 {
32			compatible = "simple-framebuffer";
33			reg = <0 0x9d400000 0 (1920 * 1080 * 4)>;
34			width = <1080>;
35			height = <1920>;
36			stride = <(1080 * 4)>;
37			format = "a8r8g8b8";
38			status = "okay";
39		};
40	};
41
42	board_vbat: vbat-regulator {
43		compatible = "regulator-fixed";
44		regulator-name = "VBAT";
45
46		regulator-min-microvolt = <4000000>;
47		regulator-max-microvolt = <4000000>;
48		regulator-always-on;
49		regulator-boot-on;
50	};
51
52	vph_pwr: vph-pwr-regulator {
53		compatible = "regulator-fixed";
54		regulator-name = "vph_pwr";
55
56		regulator-always-on;
57		regulator-boot-on;
58	};
59
60	cam_vdig_imx300_219_vreg: cam-vdig-imx300-219-regulator {
61		compatible = "regulator-fixed";
62		regulator-name = "cam_vdig_imx300_219_vreg";
63		startup-delay-us = <0>;
64		enable-active-high;
65		gpio = <&tlmm 52 GPIO_ACTIVE_HIGH>;
66		pinctrl-names = "default";
67		pinctrl-0 = <&cam_vdig_default>;
68	};
69
70	cam_vana_front_vreg: cam-vana-front-regulator {
71		compatible = "regulator-fixed";
72		regulator-name = "cam_vana_front_vreg";
73		startup-delay-us = <0>;
74		enable-active-high;
75		gpio = <&tlmm 51 GPIO_ACTIVE_HIGH>;
76		pinctrl-names = "default";
77		pinctrl-0 = <&imx219_vana_default>;
78	};
79
80	cam_vana_rear_vreg: cam-vana-rear-regulator {
81		compatible = "regulator-fixed";
82		regulator-name = "cam_vana_rear_vreg";
83		startup-delay-us = <0>;
84		enable-active-high;
85		gpio = <&tlmm 50 GPIO_ACTIVE_HIGH>;
86		regulator-always-on;
87		pinctrl-names = "default";
88		pinctrl-0 = <&imx300_vana_default>;
89	};
90
91	gpio-keys {
92		compatible = "gpio-keys";
93
94		key-camera-focus {
95			label = "Camera Focus";
96			gpios = <&tlmm 64 GPIO_ACTIVE_LOW>;
97			linux,input-type = <1>;
98			linux,code = <KEY_CAMERA_FOCUS>;
99			debounce-interval = <15>;
100		};
101
102		key-camera-snapshot {
103			label = "Camera Snapshot";
104			gpios = <&tlmm 113 GPIO_ACTIVE_LOW>;
105			linux,input-type = <1>;
106			linux,code = <KEY_CAMERA>;
107			debounce-interval = <15>;
108		};
109
110		key-vol-down {
111			label = "Volume Down";
112			gpios = <&pm660l_gpios 7 GPIO_ACTIVE_LOW>;
113			linux,input-type = <1>;
114			linux,code = <KEY_VOLUMEDOWN>;
115			wakeup-source;
116			debounce-interval = <15>;
117		};
118	};
119
120	reserved-memory {
121		#address-cells = <2>;
122		#size-cells = <2>;
123		ranges;
124
125		ramoops@ffc00000 {
126			compatible = "ramoops";
127			reg = <0x0 0xffc00000 0x0 0x100000>;
128			record-size = <0x10000>;
129			console-size = <0x60000>;
130			ftrace-size = <0x10000>;
131			pmsg-size = <0x20000>;
132			ecc-size = <16>;
133			status = "okay";
134		};
135
136		debug@ffb00000 {
137			reg = <0x00 0xffb00000 0x00 0x100000>;
138			no-map;
139		};
140
141		cont_splash_mem: splash@9d400000 {
142			reg = <0 0x9d400000 0 (1920 * 1080 * 4)>;
143			no-map;
144		};
145	};
146
147	/*
148	 * Until we hook up type-c detection, we
149	 * have to stick with this. But it works.
150	 */
151	extcon_usb: extcon-usb {
152		compatible = "linux,extcon-usb-gpio";
153		id-gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>;
154	};
155};
156
157&adsp_pil {
158	firmware-name = "qcom/sdm630/Sony/nile/adsp.mdt";
159};
160
161&blsp_i2c1 {
162	status = "okay";
163
164	touchscreen: synaptics-rmi4-i2c@70 {
165		compatible = "syna,rmi4-i2c";
166		reg = <0x70>;
167		#address-cells = <1>;
168		#size-cells = <0>;
169		interrupts-extended = <&tlmm 45 0x2008>;
170
171		pinctrl-names = "default";
172		pinctrl-0 = <&ts_int_active &ts_lcd_id_active>;
173
174		syna,reset-delay-ms = <200>;
175		syna,startup-delay-ms = <220>;
176
177		rmi4-f01@1 {
178			reg = <0x01>;
179			syna,nosleep-mode = <1>;
180		};
181
182		rmi4-f11@11 {
183			reg = <0x11>;
184			syna,sensor-type = <1>;
185		};
186	};
187};
188
189&blsp_i2c2 {
190	status = "okay";
191
192	/* SMB1351 charger */
193};
194
195/* I2C3, 4, 5, 7 and 8 are disabled on this board. */
196
197&blsp_i2c6 {
198	status = "okay";
199
200	/* NXP NFC */
201};
202
203&blsp1_uart2 {
204	status = "okay";
205
206	/* MSM serial console */
207};
208
209&blsp2_uart1 {
210	status = "okay";
211
212	/* HCI Bluetooth */
213};
214
215&pm660l_lpg {
216	qcom,power-source = <1>;
217
218	status = "okay";
219
220	multi-led {
221		color = <LED_COLOR_ID_RGB>;
222		function = LED_FUNCTION_STATUS;
223
224		#address-cells = <1>;
225		#size-cells = <0>;
226
227		led@1 {
228			reg = <1>;
229			color = <LED_COLOR_ID_BLUE>;
230		};
231
232		led@2 {
233			reg = <2>;
234			color = <LED_COLOR_ID_GREEN>;
235		};
236
237		led@3 {
238			reg = <3>;
239			color = <LED_COLOR_ID_RED>;
240		};
241	};
242};
243
244&pm660l_wled {
245	status = "okay";
246
247	qcom,switching-freq = <800>;
248	qcom,ovp-millivolt = <29600>;
249	qcom,current-boost-limit = <970>;
250	qcom,current-limit-microamp = <17500>;
251	qcom,num-strings = <2>;
252};
253
254&pon_pwrkey {
255	status = "okay";
256};
257
258&pon_resin {
259	status = "okay";
260
261	linux,code = <KEY_VOLUMEUP>;
262};
263
264&qhee_code {
265	reg = <0x00 0x85800000 0x00 0x3700000>;
266};
267
268&qusb2phy0 {
269	status = "okay";
270
271	vdd-supply = <&vreg_l1b_0p925>;
272	vdda-pll-supply = <&vreg_l10a_1p8>;
273	vdda-phy-dpdm-supply = <&vreg_l7b_3p125>;
274};
275
276&rpm_requests {
277	regulators-0 {
278		compatible = "qcom,rpm-pm660l-regulators";
279
280		vdd_s1-supply = <&vph_pwr>;
281		vdd_s2-supply = <&vph_pwr>;
282		vdd_s3_s4-supply = <&vph_pwr>;
283		vdd_s5-supply = <&vph_pwr>;
284		vdd_s6-supply = <&vph_pwr>;
285
286		vdd_l1_l9_l10-supply = <&vreg_s2b_1p05>;
287		vdd_l2-supply = <&vreg_bob>;
288		vdd_l3_l5_l7_l8-supply = <&vreg_bob>;
289		vdd_l4_l6-supply = <&vreg_bob>;
290		vdd_bob-supply = <&vph_pwr>;
291
292		vreg_s1b_1p125: s1 {
293			regulator-min-microvolt = <1125000>;
294			regulator-max-microvolt = <1125000>;
295			regulator-enable-ramp-delay = <200>;
296			regulator-ramp-delay = <0>;
297		};
298
299		vreg_s2b_1p05: s2 {
300			regulator-min-microvolt = <1050000>;
301			regulator-max-microvolt = <1050000>;
302			regulator-enable-ramp-delay = <200>;
303			regulator-ramp-delay = <0>;
304		};
305
306		/*
307		 * At least on Nile's configuration, S3B/S4B (VDD_CX) and
308		 * S5B (VDD_MX) are managed only through RPM Power Domains.
309		 * Trying to set a voltage on the main supply will create
310		 * havoc and freeze the SoC.
311		 * In any case, reference voltages for these regulators are:
312		 * S3B/S4B: 0.870V
313		 * S5B: 0.915V
314		 */
315
316		/* LDOs */
317		vreg_l1b_0p925: l1 {
318			regulator-min-microvolt = <920000>;
319			regulator-max-microvolt = <928000>;
320			regulator-enable-ramp-delay = <250>;
321			regulator-ramp-delay = <0>;
322			regulator-allow-set-load;
323		};
324
325		vreg_l2b_2p95: l2 {
326			/*
327			 * This regulator supports 1.648 - 3.104V on this board
328			 * but we set a max voltage of anything less than 2.7V
329			 * to satisfy a condition in sdhci.c that will disable
330			 * 3.3V SDHCI signaling, which happens to be not really
331			 * supported on the Xperia Nile/Ganges platform.
332			 */
333			regulator-min-microvolt = <1648000>;
334			regulator-max-microvolt = <2696000>;
335			regulator-enable-ramp-delay = <250>;
336			regulator-ramp-delay = <0>;
337			regulator-allow-set-load;
338		};
339
340		vreg_l3b_3p0: l3 {
341			regulator-min-microvolt = <2800000>;
342			regulator-max-microvolt = <2800000>;
343			regulator-enable-ramp-delay = <250>;
344			regulator-ramp-delay = <0>;
345			regulator-min-microamp = <200>;
346			regulator-max-microamp = <600000>;
347			regulator-system-load = <100000>;
348			regulator-allow-set-load;
349		};
350
351		vreg_l4b_2p95: l4 {
352			regulator-min-microvolt = <2944000>;
353			regulator-max-microvolt = <2952000>;
354			regulator-enable-ramp-delay = <250>;
355			regulator-ramp-delay = <0>;
356
357			regulator-min-microamp = <200>;
358			regulator-max-microamp = <600000>;
359			regulator-system-load = <570000>;
360			regulator-allow-set-load;
361		};
362
363		/*
364		 * Downstream specifies a range of 1721-3600mV,
365		 * but the only assigned consumers are SDHCI2 VMMC
366		 * and Coresight QPDI that both request pinned 2.95V.
367		 * Tighten the range to 1.8-3.328 (closest to 3.3) to
368		 * make the mmc driver happy.
369		 */
370		vreg_l5b_2p95: l5 {
371			regulator-min-microvolt = <1800000>;
372			regulator-max-microvolt = <3328000>;
373			regulator-enable-ramp-delay = <250>;
374			regulator-ramp-delay = <0>;
375			regulator-allow-set-load;
376			regulator-system-load = <800000>;
377		};
378
379		vreg_l6b_3p3: l6 {
380			regulator-min-microvolt = <1704000>;
381			regulator-max-microvolt = <3312000>;
382			regulator-enable-ramp-delay = <250>;
383			regulator-ramp-delay = <0>;
384		};
385
386		vreg_l7b_3p125: l7 {
387			regulator-min-microvolt = <2704000>;
388			regulator-max-microvolt = <3128000>;
389			regulator-enable-ramp-delay = <250>;
390			regulator-ramp-delay = <0>;
391		};
392
393		vreg_l8b_3p3: l8 {
394			regulator-min-microvolt = <2800000>;
395			regulator-max-microvolt = <3400000>;
396			regulator-enable-ramp-delay = <250>;
397			regulator-ramp-delay = <0>;
398		};
399
400		/* L9B (870mV) is currently unused */
401		/* L10B (915mV) is currently unused */
402
403		vreg_bob: bob {
404			regulator-min-microvolt = <3304000>;
405			regulator-max-microvolt = <3624000>;
406			regulator-enable-ramp-delay = <500>;
407			regulator-ramp-delay = <0>;
408		};
409	};
410
411	regulators-1 {
412		compatible = "qcom,rpm-pm660-regulators";
413
414		vdd_s1-supply = <&vph_pwr>;
415		vdd_s2-supply = <&vph_pwr>;
416		vdd_s3-supply = <&vph_pwr>;
417		vdd_s4-supply = <&vph_pwr>;
418		vdd_s5-supply = <&vph_pwr>;
419		vdd_s6-supply = <&vph_pwr>;
420
421		vdd_l1_l6_l7-supply = <&vreg_s5a_1p35>;
422		vdd_l2_l3-supply = <&vreg_s2b_1p05>;
423		vdd_l5-supply = <&vreg_s2b_1p05>;
424		vdd_l8_l9_l10_l11_l12_l13_l14-supply = <&vreg_s4a_2p04>;
425		vdd_l15_l16_l17_l18_l19-supply = <&vreg_bob>;
426
427		/*
428		 * S1A (FTAPC0), S2A (FTAPC1), S3A (HFAPC1) are managed
429		 * by the Core Power Reduction hardened (CPRh) and the
430		 * Operating State Manager (OSM) HW automatically.
431		 */
432
433		vreg_s4a_2p04: s4 {
434			regulator-min-microvolt = <2040000>;
435			regulator-max-microvolt = <2040000>;
436			regulator-enable-ramp-delay = <200>;
437			regulator-ramp-delay = <0>;
438			regulator-always-on;
439		};
440
441		vreg_s5a_1p35: s5 {
442			regulator-min-microvolt = <1224000>;
443			regulator-max-microvolt = <1350000>;
444			regulator-enable-ramp-delay = <200>;
445			regulator-ramp-delay = <0>;
446		};
447
448		vreg_s6a_0p87: s6 {
449			regulator-min-microvolt = <504000>;
450			regulator-max-microvolt = <992000>;
451			regulator-enable-ramp-delay = <150>;
452			regulator-ramp-delay = <0>;
453		};
454
455		/* LDOs */
456		vreg_l1a_1p225: l1 {
457			regulator-min-microvolt = <1226000>;
458			regulator-max-microvolt = <1250000>;
459			regulator-enable-ramp-delay = <250>;
460			regulator-ramp-delay = <0>;
461			regulator-allow-set-load;
462		};
463
464		vreg_l2a_1p0: l2 {
465			regulator-min-microvolt = <944000>;
466			regulator-max-microvolt = <1008000>;
467			regulator-enable-ramp-delay = <250>;
468			regulator-ramp-delay = <0>;
469		};
470
471		vreg_l3a_1p0: l3 {
472			regulator-min-microvolt = <944000>;
473			regulator-max-microvolt = <1008000>;
474			regulator-enable-ramp-delay = <250>;
475			regulator-ramp-delay = <0>;
476		};
477
478		vreg_l5a_0p848: l5 {
479			regulator-min-microvolt = <800000>;
480			regulator-max-microvolt = <952000>;
481			regulator-enable-ramp-delay = <250>;
482			regulator-ramp-delay = <0>;
483		};
484
485		vreg_l6a_1p3: l6 {
486			regulator-min-microvolt = <1304000>;
487			regulator-max-microvolt = <1368000>;
488			regulator-allow-set-load;
489			regulator-enable-ramp-delay = <250>;
490			regulator-ramp-delay = <0>;
491		};
492
493		vreg_l7a_1p2: l7 {
494			regulator-min-microvolt = <1200000>;
495			regulator-max-microvolt = <1200000>;
496			regulator-enable-ramp-delay = <250>;
497			regulator-ramp-delay = <0>;
498		};
499
500		vreg_l8a_1p8: l8 {
501			regulator-min-microvolt = <1800000>;
502			regulator-max-microvolt = <1800000>;
503			regulator-enable-ramp-delay = <250>;
504			regulator-ramp-delay = <0>;
505			regulator-system-load = <325000>;
506			regulator-allow-set-load;
507		};
508
509		vreg_l9a_1p8: l9 {
510			regulator-min-microvolt = <1804000>;
511			regulator-max-microvolt = <1896000>;
512			regulator-enable-ramp-delay = <250>;
513			regulator-ramp-delay = <0>;
514			regulator-allow-set-load;
515		};
516
517		vreg_l10a_1p8: l10 {
518			regulator-min-microvolt = <1800000>;
519			regulator-max-microvolt = <1944000>;
520			regulator-enable-ramp-delay = <250>;
521			regulator-ramp-delay = <0>;
522			regulator-allow-set-load;
523		};
524
525		vreg_l11a_1p8: l11 {
526			regulator-min-microvolt = <1784000>;
527			regulator-max-microvolt = <1944000>;
528			regulator-enable-ramp-delay = <250>;
529			regulator-ramp-delay = <0>;
530		};
531
532		vreg_l12a_1p8: l12 {
533			regulator-min-microvolt = <1800000>;
534			regulator-max-microvolt = <1944000>;
535			regulator-enable-ramp-delay = <250>;
536			regulator-ramp-delay = <0>;
537		};
538
539		/* This gives power to the LPDDR4: never turn it off! */
540		vreg_l13a_1p8: l13 {
541			regulator-min-microvolt = <1800000>;
542			regulator-max-microvolt = <1944000>;
543			regulator-enable-ramp-delay = <250>;
544			regulator-ramp-delay = <0>;
545			regulator-boot-on;
546			regulator-always-on;
547		};
548
549		vreg_l14a_1p8: l14 {
550			regulator-min-microvolt = <1710000>;
551			regulator-max-microvolt = <1904000>;
552			regulator-enable-ramp-delay = <250>;
553			regulator-ramp-delay = <0>;
554		};
555
556		vreg_l15a_1p8: l15 {
557			regulator-min-microvolt = <1648000>;
558			regulator-max-microvolt = <2952000>;
559			regulator-enable-ramp-delay = <250>;
560			regulator-ramp-delay = <0>;
561		};
562
563		/* L16A (2.70V) is unused */
564
565		vreg_l17a_1p8: l17 {
566			regulator-min-microvolt = <1648000>;
567			regulator-max-microvolt = <2952000>;
568			regulator-enable-ramp-delay = <250>;
569			regulator-ramp-delay = <0>;
570		};
571
572		vreg_l18a_1v8: l18 {
573			regulator-min-microvolt = <1800000>;
574			regulator-max-microvolt = <1800000>;
575			regulator-enable-ramp-delay = <250>;
576			regulator-ramp-delay = <10>;
577			regulator-min-microamp = <200>;
578			regulator-max-microamp = <50000>;
579			regulator-system-load = <10000>;
580			regulator-allow-set-load;
581		};
582
583		vreg_l19a_3p3: l19 {
584			regulator-min-microvolt = <3312000>;
585			regulator-max-microvolt = <3400000>;
586			regulator-enable-ramp-delay = <250>;
587			regulator-ramp-delay = <0>;
588			regulator-allow-set-load;
589		};
590	};
591};
592
593&sdc2_state_on {
594	sd-cd-pins {
595		pins = "gpio54";
596		function = "gpio";
597		bias-pull-up;
598		drive-strength = <2>;
599	};
600};
601
602&sdc2_state_off {
603	sd-cd-pins {
604		pins = "gpio54";
605		function = "gpio";
606		bias-disable;
607		drive-strength = <2>;
608	};
609};
610
611&sdhc_1 {
612	status = "okay";
613	supports-cqe;
614
615	/* SoMC Nile platform's eMMC doesn't support HS200 mode */
616	mmc-ddr-1_8v;
617	mmc-hs400-1_8v;
618	mmc-hs400-enhanced-strobe;
619
620	vmmc-supply = <&vreg_l4b_2p95>;
621	vqmmc-supply = <&vreg_l8a_1p8>;
622};
623
624&sdhc_2 {
625	status = "okay";
626
627	vmmc-supply = <&vreg_l5b_2p95>;
628	vqmmc-supply = <&vreg_l2b_2p95>;
629};
630
631&tlmm {
632	gpio-reserved-ranges = <8 4>;
633
634	ts_int_active: ts-int-active-state {
635		pins = "gpio45";
636		function = "gpio";
637		drive-strength = <8>;
638		bias-pull-up;
639	};
640
641	ts_lcd_id_active: ts-lcd-id-active-state {
642		pins = "gpio56";
643		function = "gpio";
644		drive-strength = <8>;
645		bias-disable;
646	};
647
648	imx300_vana_default: imx300-vana-default-state {
649		pins = "gpio50";
650		function = "gpio";
651		bias-disable;
652		drive-strength = <2>;
653	};
654
655	imx219_vana_default: imx219-vana-default-state {
656		pins = "gpio51";
657		function = "gpio";
658		bias-disable;
659		drive-strength = <2>;
660	};
661
662	cam_vdig_default: cam-vdig-default-state {
663		pins = "gpio52";
664		function = "gpio";
665		bias-disable;
666		drive-strength = <2>;
667	};
668};
669
670&usb3 {
671	qcom,select-utmi-as-pipe-clk;
672
673	status = "okay";
674};
675
676&usb3_dwc3 {
677	maximum-speed = "high-speed";
678	phys = <&qusb2phy0>;
679	phy-names = "usb2-phy";
680
681	dr_mode = "peripheral";
682	extcon = <&extcon_usb>;
683};
684