xref: /OK3568_Linux_fs/kernel/arch/arm/boot/dts/rk3126-bnd-d708.dtsi (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd
4 */
5
6/dts-v1/;
7#include <dt-bindings/gpio/gpio.h>
8#include <dt-bindings/input/input.h>
9#include <dt-bindings/pinctrl/rockchip.h>
10#include <dt-bindings/pwm/pwm.h>
11#include <dt-bindings/sensor-dev.h>
12#include "rk3126.dtsi"
13#include "rk312x-android.dtsi"
14
15/ {
16	adc-keys {
17		compatible = "adc-keys";
18		io-channels = <&saradc 2>;
19		io-channel-names = "buttons";
20		poll-interval = <100>;
21		keyup-threshold-microvolt = <3300000>;
22
23		button-up {
24			label = "Volume Up";
25			linux,code = <KEY_VOLUMEUP>;
26			press-threshold-microvolt = <0>;
27		};
28
29		button-down {
30			label = "Volume Down";
31			linux,code = <KEY_VOLUMEDOWN>;
32			press-threshold-microvolt = <1650000>;
33		};
34	};
35
36	backlight: backlight {
37		compatible = "pwm-backlight";
38		pwms = <&pwm0 0 25000 0>;
39		brightness-levels = <
40				255 169 168 168 167 166 166 165
41				164 164 163 162 162 161 160 160
42				159 158 158 157 156 156 155 154
43				154 153 152 152 151 150 150 149
44				148 148 147 146 146 145 144 144
45				143 142 142 141 140 140 139 138
46				138 137 136 136 135 134 134 133
47				132 132 131 130 130 129 128 128
48				127 126 126 125 124 124 123 122
49				122 121 120 120 119 118 118 117
50				116 116 115 114 114 113 112 112
51				111 110 110 109 108 108 107 106
52				106 105 104 104 103 102 102 101
53				100 100  99  98  98  97  96  96
54				 95  94  94  93  92  92  91  90
55				 90  89  88  88  87  86  86  85
56				 84  84  83  82  82  81  80  80
57				 79  78  78  77  76  76  75  74
58				 74  73  72  72  71  70  70  69
59				 68  68  67  66  66  65  64  64
60				 63  62  62  61  60  60  59  58
61				 58  57  56  56  55  54  54  53
62				 52  52  51  50  50  49  48  48
63				 47  46  46  45  44  44  43  42
64				 42  41  40  40  39  38  38  37
65				 36  36  35  34  34  33  32  32
66				 31  30  30  29  28  28  27  26
67				 26  25  24  24  23  22  22  21
68				 20  20  19  18  18  17  16  16
69				 15  14  14  13  12  12  11  10
70				 10   9   8   8   7   6   6   5
71				  4   4   3   2   1   1   1   0>;
72		default-brightness-level = <128>;
73		enable-gpios = <&gpio2 RK_PB6 GPIO_ACTIVE_HIGH>;
74	};
75
76	charge-animation {
77		compatible = "rockchip,uboot-charge";
78		rockchip,uboot-charge-on = <1>;
79		rockchip,android-charge-on = <0>;
80		rockchip,uboot-low-power-voltage = <3500>;
81		rockchip,screen-on-voltage = <3600>;
82		status = "okay";
83	};
84
85	rockchip_headset {
86		compatible = "rockchip_headset";
87		headset_gpio = <&gpio2 18 GPIO_ACTIVE_LOW>;
88	};
89
90	sound {
91		compatible = "simple-audio-card";
92		simple-audio-card,format = "i2s";
93		simple-audio-card,mclk-fs = <256>;
94		simple-audio-card,name = "rockchip,rk312x";
95		simple-audio-card,cpu {
96			sound-dai = <&i2s_2ch>;
97		};
98		simple-audio-card,codec {
99			sound-dai = <&codec>;
100		};
101	};
102
103	vccadc_ref: vccadc-ref {
104		compatible = "regulator-fixed";
105		regulator-name = "SARADC_AVDD33";
106		regulator-always-on;
107		regulator-boot-on;
108		regulator-min-microvolt = <3300000>;
109		regulator-max-microvolt = <3300000>;
110	};
111
112	vcc_sys: vcc-sys {
113		compatible = "regulator-fixed";
114		regulator-name = "vcc_sys";
115		regulator-min-microvolt = <4000000>;
116		regulator-max-microvolt = <4000000>;
117		regulator-always-on;
118	};
119
120	xin32k: xin32k {
121		compatible = "fixed-clock";
122		clock-frequency = <32768>;
123		clock-output-names = "xin32k";
124		#clock-cells = <0>;
125	};
126
127	wireless-bluetooth {
128		compatible = "bluetooth-platdata";
129		/* wifi-bt-power-toggle; */
130
131		keep_wifi_power_on = <1>;
132		uart_rts_gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; /* GPIO1_B3 */
133		pinctrl-names = "default","rts_gpio";
134		pinctrl-0 = <&uart1_rts>;
135		pinctrl-1 = <&uart1_rts_gpio>;
136		BT,reset_gpio = <&gpio2 9 GPIO_ACTIVE_HIGH>; /* GPIO2_B1 */
137		BT,wake_gpio = <&gpio0 27 GPIO_ACTIVE_HIGH>; /* GPIO0_D3 */
138		BT,wake_host_irq = <&gpio2 21 GPIO_ACTIVE_LOW>; /* GPIO2_C5 */
139		status = "okay";
140	};
141
142	wireless-wlan {
143		compatible = "wlan-platdata";
144
145		wifi_chip_type = "rtl8723cs";
146		WIFI,host_wake_irq = <&gpio2 13 GPIO_ACTIVE_HIGH>;
147		status = "okay";
148	};
149};
150
151&codec {
152	#sound-dai-cells = <0>;
153	hp-ctl-gpios = <&gpio2 17 GPIO_ACTIVE_HIGH>;
154	spk-ctl-gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>;
155	spk-mute-delay = <200>;
156	hp-mute-delay = <100>;
157	is_rk3128 = <0>;
158	spk_volume = <25>;
159	hp_volume = <25>;
160	capture_volume = <26>;
161	gpio_debug = <1>;
162	codec_hp_det = <0>;
163	status = "okay";
164};
165
166&cif_new {
167	status = "okay";
168
169	ports {
170		port@0 {
171			cif_in_fcam: endpoint@0 {
172				remote-endpoint =  <&gc0329_out>;
173				vsync-active = <1>;
174				hsync-active = <1>;
175			};
176
177			cif_in_bcam: endpoint@1 {
178				remote-endpoint = <&gc2145_out>;
179				vsync-active = <0>;
180				hsync-active = <1>;
181			};
182		};
183	};
184};
185
186&cpu0 {
187	cpu-supply = <&vdd_arm>;
188};
189
190&dsi {
191	status = "okay";
192
193	panel@0 {
194		compatible = "fc,fy07018dh26d372-d", "simple-panel-dsi";
195		reg = <0>;
196		backlight = <&backlight>;
197		power-supply = <&ldo6>;
198		power-invert;
199		enable-gpios = <&gpio2 RK_PC3 GPIO_ACTIVE_HIGH>;
200		reset-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_LOW>;
201		prepare-delay-ms = <20>;
202		reset-delay-ms = <20>;
203		init-delay-ms = <20>;
204		enable-delay-ms = <120>;
205		disable-delay-ms = <20>;
206		unprepare-delay-ms = <20>;
207
208		width-mm = <153>;
209		height-mm = <85>;
210
211		dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
212			      MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
213		dsi,format = <MIPI_DSI_FMT_RGB888>;
214		dsi,lanes = <4>;
215
216		panel-init-sequence = [
217			05 1e 01 01
218			15 00 02 80 47
219			15 00 02 81 40
220			15 00 02 82 04
221			15 00 02 83 77
222			15 00 02 84 0f
223			15 00 02 85 70
224			15 78 02 86 70
225		];
226
227		display-timings {
228			native-mode = <&timing0>;
229
230			timing0: timing0 {
231				clock-frequency = <49500000>;
232				hactive = <1024>;
233				hfront-porch = <120>;
234				hsync-len = <40>;
235				hback-porch = <120>;
236				vactive = <600>;
237				vfront-porch = <14>;
238				vsync-len = <4>;
239				vback-porch = <14>;
240				hsync-active = <0>;
241				vsync-active = <0>;
242				de-active = <0>;
243				pixelclk-active = <0>;
244			};
245		};
246
247		ports {
248			#address-cells = <1>;
249			#size-cells = <0>;
250
251			port@0 {
252				reg = <0>;
253				panel_in_dsi: endpoint {
254					remote-endpoint = <&dsi_out_panel>;
255				};
256			};
257		};
258	};
259
260	ports {
261		#address-cells = <1>;
262		#size-cells = <0>;
263
264		port@1 {
265			reg = <1>;
266			dsi_out_panel: endpoint {
267				remote-endpoint = <&panel_in_dsi>;
268			};
269		};
270	};
271};
272
273&route_dsi {
274	status = "okay";
275};
276
277&dmc {
278	center-supply = <&vdd_log>;
279};
280
281&emmc {
282	bus-width = <8>;
283	cap-mmc-highspeed;
284	no-sdio;
285	no-sd;
286	disable-wp;
287	non-removable;
288	num-slots = <1>;
289	status = "okay";
290};
291
292&gpu {
293	status = "okay";
294	mali-supply = <&vdd_log>;
295};
296
297&i2c0 {
298	status = "okay";
299	clock-frequency = <400000>;
300
301	gc0329@31 {
302		compatible = "galaxycore,gc0329";
303		reg = <0x31>;
304		pinctrl-names = "default";
305		pinctrl-0 = <&fcam_pd>;
306
307		clocks = <&cru SCLK_CIF_OUT>;
308		clock-names = "xvclk";
309
310		avdd-supply = <&vcc28_cif>;
311		dovdd-supply = <&vcc18_cif>;
312		dvdd-supply = <&vcc18_cif>;
313
314		pwdn-gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_HIGH>;
315		rockchip,camera-module-index = <1>;
316		rockchip,camera-module-facing = "front";
317		rockchip,camera-module-name = "default";
318		rockchip,camera-module-lens-name = "default";
319		port {
320			gc0329_out: endpoint {
321				remote-endpoint = <&cif_in_fcam>;
322			};
323		};
324	};
325
326	gc2145@3c {
327		compatible = "galaxycore,gc2145";
328		reg = <0x3c>;
329		pinctrl-names = "default";
330		pinctrl-0 = <&bcam_pd>;
331
332		clocks = <&cru SCLK_CIF_OUT>;
333		clock-names = "xvclk";
334
335		avdd-supply = <&vcc28_cif>;
336		dovdd-supply = <&vcc18_cif>;
337		dvdd-supply = <&vcc18_cif>;
338
339		pwdn-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
340		rockchip,camera-module-index = <0>;
341		rockchip,camera-module-facing = "back";
342		rockchip,camera-module-name = "default";
343		rockchip,camera-module-lens-name = "default";
344		port {
345			gc2145_out: endpoint {
346				remote-endpoint = <&cif_in_bcam>;
347			};
348		};
349	};
350
351	ts@40 {
352		compatible = "gslX680-d708";
353		reg = <0x40>;
354		touch-gpio = <&gpio2 20 IRQ_TYPE_LEVEL_LOW>;
355		wake-gpio = <&gpio2 12 IRQ_TYPE_LEVEL_LOW>;
356		screen_max_x = <800>;
357		screen_max_y = <480>;
358		status = "okay";
359	};
360
361	rk816: pmic@1a {
362		compatible = "rockchip,rk816";
363		reg = <0x1a>;
364		interrupt-parent = <&gpio0>;
365		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
366		pinctrl-names = "default";
367		pinctrl-0 = <&pmic_int_l>;
368		rockchip,system-power-controller;
369		wakeup-source;
370		gpio-controller;
371		#gpio-cells = <2>;
372		#clock-cells = <1>;
373		clock-output-names = "rk816-clkout1", "rk816-clkout2";
374		extcon = <&u2phy>;
375
376		vcc1-supply = <&vcc_sys>;
377		vcc2-supply = <&vcc_sys>;
378		vcc3-supply = <&vcc_sys>;
379		vcc4-supply = <&vcc_sys>;
380		vcc5-supply = <&vcc_io>;
381		vcc6-supply = <&vcc_sys>;
382
383		gpio {
384			status = "okay";
385		};
386
387		pwrkey {
388			status = "okay";
389		};
390
391		rtc {
392			status = "okay";
393		};
394
395		battery {
396			compatible = "rk816-battery";
397			ocv_table = < 3500 3625 3685 3697 3718 3735 3748
398					3760 3774 3788 3802 3816 3834 3853
399					3877 3908 3946 3975 4018 4071 4106>;
400			design_capacity = <2500>;
401			design_qmax = <2750>;
402			bat_res = <100>;
403			max_input_current = <1500>;
404			max_chrg_current = <1300>;
405			max_chrg_voltage = <4200>;
406			sleep_enter_current = <300>;
407			sleep_exit_current = <300>;
408			sleep_filter_current = <100>;
409			power_off_thresd = <3500>;
410			zero_algorithm_vol = <3850>;
411			max_soc_offset = <60>;
412			monitor_sec = <5>;
413			virtual_power = <0>;
414			power_dc2otg = <0>;
415			dc_det_adc = <0>;
416		};
417
418		regulators {
419
420			vdd_arm: DCDC_REG1{
421				regulator-name= "vdd_arm";
422				regulator-min-microvolt = <750000>;
423				regulator-max-microvolt = <1500000>;
424				regulator-ramp-delay = <6001>;
425				regulator-initial-mode = <1>;
426				regulator-always-on;
427				regulator-boot-on;
428				regulator-state-mem {
429					regulator-off-in-suspend;
430					regulator-suspend-microvolt = <900000>;
431				};
432			};
433
434			vdd_log: DCDC_REG2 {
435				regulator-name= "vdd_logic";
436				regulator-min-microvolt = <750000>;
437				regulator-max-microvolt = <1500000>;
438				regulator-ramp-delay = <6001>;
439				regulator-initial-mode = <1>;
440				regulator-always-on;
441				regulator-boot-on;
442				regulator-state-mem {
443					regulator-on-in-suspend;
444					regulator-suspend-microvolt = <1000000>;
445				};
446			};
447
448			vcc_ddr: DCDC_REG3 {
449				regulator-name = "vcc_ddr";
450				regulator-always-on;
451				regulator-boot-on;
452			};
453
454			vcc_io: DCDC_REG4 {
455				regulator-name = "vcc_io";
456				regulator-min-microvolt = <3300000>;
457				regulator-max-microvolt = <3300000>;
458				regulator-initial-mode = <1>;
459				regulator-always-on;
460				regulator-boot-on;
461				regulator-state-mem {
462					regulator-on-in-suspend;
463					regulator-suspend-microvolt = <3000000>;
464				};
465			};
466
467			vcc28_cif: LDO_REG1 {
468				regulator-name = "vcc28_cif";
469				regulator-min-microvolt = <2800000>;
470				regulator-max-microvolt = <2800000>;
471				regulator-always-on;
472				regulator-boot-on;
473				regulator-state-mem {
474					regulator-off-in-suspend;
475				};
476			};
477
478			vcc18_cif: LDO_REG2 {
479				regulator-name = "vcc18_cif";
480				regulator-min-microvolt = <1800000>;
481				regulator-max-microvolt = <1800000>;
482				regulator-always-on;
483				regulator-boot-on;
484				regulator-state-mem {
485					regulator-off-in-suspend;
486				};
487			};
488
489			vdd_11: LDO_REG3 {
490				regulator-name = "vdd_11";
491				regulator-min-microvolt = <1100000>;
492				regulator-max-microvolt = <1100000>;
493				regulator-always-on;
494				regulator-boot-on;
495				regulator-state-mem {
496					regulator-on-in-suspend;
497					regulator-suspend-microvolt = <1100000>;
498				};
499			};
500
501			ldo4: LDO_REG4 {
502				regulator-name= "ldo4";
503				regulator-min-microvolt = <3300000>;
504				regulator-max-microvolt = <3300000>;
505				regulator-always-on;
506				regulator-boot-on;
507				regulator-state-mem {
508					regulator-off-in-suspend;
509				};
510			};
511
512			ldo5: LDO_REG5 {
513				regulator-name= "ldo5";
514				regulator-min-microvolt = <3000000>;
515				regulator-max-microvolt = <3000000>;
516				regulator-always-on;
517				regulator-boot-on;
518				regulator-state-mem {
519					regulator-on-in-suspend;
520				};
521			};
522
523			ldo6: LDO_REG6 {
524				regulator-name= "ldo6";
525				regulator-min-microvolt = <3300000>;
526				regulator-max-microvolt = <3300000>;
527				regulator-state-mem {
528					regulator-on-in-suspend;
529					regulator-suspend-microvolt = <3300000>;
530				};
531			};
532		};
533	};
534
535	sensor@4c {
536		compatible = "gs_mc3230";
537		reg = <0x4c>;
538		type = <SENSOR_TYPE_ACCEL>;
539		irq_enable = <0>;
540		poll_delay_ms = <30>;
541		layout = <3>;
542		reprobe_en = <1>;
543	};
544};
545
546&i2s_2ch {
547	#sound-dai-cells = <0>;
548	status = "okay";
549};
550
551&iep {
552	status = "okay";
553};
554
555&iep_mmu {
556	status = "okay";
557};
558
559&mpp_srv {
560	status = "okay";
561};
562
563&nandc {
564	status = "okay";
565};
566
567&pinctrl {
568	camera {
569		fcam_pd: fcam-pd {
570			rockchip,pins = <3 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
571		};
572
573		bcam_pd: bcam-pd {
574			rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
575		};
576	};
577
578	lcdc {
579		lcdc_lcdc: lcdc-lcdc {
580			rockchip,pins =
581				/* depend on the hardware */
582				<2 RK_PB0 1 &pcfg_pull_none>, /* DCLK */
583				/* <2 RK_PB1 1 &pcfg_pull_none>, *//* HSYNC */
584				/* <2 RK_PB2 1 &pcfg_pull_none>, *//* VSYNC */
585				<2 RK_PB3 1 &pcfg_pull_none>, /* DEN */
586				<2 RK_PB4 1 &pcfg_pull_none>, /* DATA10 */
587				<2 RK_PB5 1 &pcfg_pull_none>, /* DATA11 */
588				<2 RK_PB6 1 &pcfg_pull_none>, /* DATA12 */
589				<2 RK_PB7 1 &pcfg_pull_none>, /* DATA13 */
590				<2 RK_PC0 1 &pcfg_pull_none>, /* DATA14 */
591				<2 RK_PC1 1 &pcfg_pull_none>, /* DATA15 */
592				<2 RK_PC2 1 &pcfg_pull_none>, /* DATA16 */
593				<2 RK_PC3 1 &pcfg_pull_none>; /* DATA17 */
594				/* <2 RK_PC4 1 &pcfg_pull_none>, *//* DATA18 */
595				/* <2 RK_PC5 1 &pcfg_pull_none>, *//* DATA19 */
596				/* <2 RK_PC6 1 &pcfg_pull_none>, *//* DATA20 */
597				/* <2 RK_PC7 1 &pcfg_pull_none>, *//* DATA21 */
598				/* <2 RK_PD0 1 &pcfg_pull_none>, *//* DATA22 */
599				/* <2 RK_PD1 1 &pcfg_pull_none>; *//* DATA23 */
600		};
601	};
602
603	pmic {
604		pmic_int_l: pmic-int-l {
605			rockchip,pins =
606				<0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_default>;
607		};
608	};
609
610	uart1 {
611		uart1_xfer: uart1-xfer {
612			rockchip,pins = <1 RK_PB1 2 &pcfg_pull_default>,
613					<1 RK_PB2 2 &pcfg_pull_default>;
614		};
615	};
616
617	wireless-bluetooth {
618		uart1_rts_gpio: uart1-rts-gpio {
619			rockchip,pins = <1 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
620		};
621	};
622};
623
624&pwm0 {
625	status = "okay";
626};
627
628&rga {
629	status = "okay";
630};
631
632&saradc {
633	status = "okay";
634	vref-supply = <&vccadc_ref>;
635};
636
637&sdmmc {
638	cap-mmc-highspeed;
639	no-sdio;
640	no-mmc;
641	card-detect-delay = <800>;
642	ignore-pm-notify;
643	keep-power-in-suspend;
644	cd-gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; /* CD GPIO */
645	status = "disabled";
646};
647
648&sdio {
649	max-frequency = <50000000>;
650	cap-sd-highspeed;
651	no-sd;
652	no-mmc;
653	ignore-pm-notify;
654	keep-power-in-suspend;
655	non-removable;
656	vmmc-supply = <&ldo5>;
657	status = "okay";
658};
659
660&tsadc {
661	status = "okay";
662};
663
664&u2phy {
665	status = "okay";
666
667	u2phy_otg: otg-port {
668		status = "okay";
669	};
670
671	u2phy_host: host-port {
672		status = "okay";
673	};
674};
675
676&uart1 {
677	pinctrl-names = "default";
678	pinctrl-0 = <&uart1_xfer &uart1_cts>;
679	status = "okay";
680};
681
682&usb_otg {
683	status = "okay";
684};
685
686&vop {
687	status = "okay";
688};
689
690&vop_mmu {
691	status = "okay";
692};
693
694&vdpu {
695	status = "okay";
696};
697
698&vepu {
699	status = "okay";
700};
701
702&vpu_mmu {
703	status = "okay";
704};
705