xref: /OK3568_Linux_fs/kernel/arch/arm64/boot/dts/rockchip/rk1808-evb.dtsi (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2// Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd.
3
4#include <dt-bindings/display/media-bus-format.h>
5#include <dt-bindings/gpio/gpio.h>
6#include <dt-bindings/input/input.h>
7#include <dt-bindings/pinctrl/rockchip.h>
8#include <dt-bindings/sensor-dev.h>
9#include "rk1808.dtsi"
10
11/ {
12	model = "Rockchip RK1808 EVB";
13	compatible = "rockchip,rk1808-evb", "rockchip,rk1808";
14
15	adc_key: adc-keys {
16		compatible = "adc-keys";
17		autorepeat;
18		io-channels = <&saradc 2>;
19		io-channel-names = "buttons";
20		keyup-threshold-microvolt = <1800000>;
21		poll-interval = <100>;
22	};
23
24	backlight: backlight {
25		compatible = "pwm-backlight";
26		pwms = <&pwm1 0 25000 0>;
27		brightness-levels = <
28			  0   1   2   3   4   5   6   7
29			  8   9  10  11  12  13  14  15
30			 16  17  18  19  20  21  22  23
31			 24  25  26  27  28  29  30  31
32			 32  33  34  35  36  37  38  39
33			 40  41  42  43  44  45  46  47
34			 48  49  50  51  52  53  54  55
35			 56  57  58  59  60  61  62  63
36			 64  65  66  67  68  69  70  71
37			 72  73  74  75  76  77  78  79
38			 80  81  82  83  84  85  86  87
39			 88  89  90  91  92  93  94  95
40			 96  97  98  99 100 101 102 103
41			104 105 106 107 108 109 110 111
42			112 113 114 115 116 117 118 119
43			120 121 122 123 124 125 126 127
44			128 129 130 131 132 133 134 135
45			136 137 138 139 140 141 142 143
46			144 145 146 147 148 149 150 151
47			152 153 154 155 156 157 158 159
48			160 161 162 163 164 165 166 167
49			168 169 170 171 172 173 174 175
50			176 177 178 179 180 181 182 183
51			184 185 186 187 188 189 190 191
52			192 193 194 195 196 197 198 199
53			200 201 202 203 204 205 206 207
54			208 209 210 211 212 213 214 215
55			216 217 218 219 220 221 222 223
56			224 225 226 227 228 229 230 231
57			232 233 234 235 236 237 238 239
58			240 241 242 243 244 245 246 247
59			248 249 250 251 252 253 254 255>;
60		default-brightness-level = <200>;
61	};
62
63	display_subsystem: display-subsystem {
64		compatible = "rockchip,display-subsystem";
65		ports = <&vop_lite_out>, <&vop_raw_out>;
66		logo-memory-region = <&drm_logo>;
67		status = "disabled";
68
69		route {
70			route_csi: route-csi {
71				status = "disabled";
72				logo,uboot = "logo.bmp";
73				logo,kernel = "logo_kernel.bmp";
74				logo,mode = "center";
75				charge_logo,mode = "center";
76				connect = <&vop_raw_out_csi>;
77			};
78
79			route_dsi: route-dsi {
80				status = "disabled";
81				logo,uboot = "logo.bmp";
82				logo,kernel = "logo_kernel.bmp";
83				logo,mode = "center";
84				charge_logo,mode = "center";
85				connect = <&vop_lite_out_dsi>;
86			};
87
88			route_rgb: route-rgb {
89				status = "disabled";
90				logo,uboot = "logo.bmp";
91				logo,kernel = "logo_kernel.bmp";
92				logo,mode = "center";
93				charge_logo,mode = "center";
94				connect = <&vop_lite_out_rgb>;
95			};
96		};
97	};
98
99	fiq-debugger {
100		compatible = "rockchip,fiq-debugger";
101		rockchip,serial-id = <2>;
102		rockchip,wake-irq = <0>;
103		/* If enable uart uses irq instead of fiq */
104		rockchip,irq-mode-enable = <0>;
105		rockchip,baudrate = <1500000>;  /* Only 115200 and 1500000 */
106		interrupts = <GIC_SPI 242 IRQ_TYPE_LEVEL_HIGH>;
107		status = "okay";
108	};
109
110	reserved-memory {
111		#address-cells = <2>;
112		#size-cells = <2>;
113		ranges;
114
115		drm_logo: drm-logo@00000000 {
116			compatible = "rockchip,drm-logo";
117			reg = <0x0 0x0 0x0 0x0>;
118		};
119
120		ramoops: ramoops@110000 {
121			compatible = "ramoops";
122			reg = <0x0 0x110000 0x0 0xf0000>;
123			record-size = <0x30000>;
124			console-size = <0xc0000>;
125			ftrace-size = <0x00000>;
126			pmsg-size = <0x00000>;
127		};
128	};
129
130	rk809_sound: rk809-sound {
131		status = "disabled";
132		compatible = "simple-audio-card";
133		simple-audio-card,format = "i2s";
134		simple-audio-card,name = "rockchip,rk809-codec";
135		simple-audio-card,mclk-fs = <256>;
136		simple-audio-card,widgets =
137			"Microphone", "Mic Jack",
138			"Headphone", "Headphone Jack";
139		simple-audio-card,routing =
140			"Mic Jack", "MICBIAS1",
141			"IN1P", "Mic Jack",
142			"Headphone Jack", "HPOL",
143			"Headphone Jack", "HPOR";
144		simple-audio-card,cpu {
145			sound-dai = <&i2s1>;
146		};
147		simple-audio-card,codec {
148			sound-dai = <&rk809_codec>;
149		};
150	};
151
152	sdio_pwrseq: sdio-pwrseq {
153		compatible = "mmc-pwrseq-simple";
154		pinctrl-names = "default";
155		pinctrl-0 = <&wifi_enable_h>;
156
157		/*
158		 * On the module itself this is one of these (depending
159		 * on the actual card populated):
160		 * - SDIO_RESET_L_WL_REG_ON
161		 * - PDN (power down when low)
162		 */
163		reset-gpios = <&gpio4 RK_PC0 GPIO_ACTIVE_LOW>;
164	};
165
166	vcc_otg_vbus: otg-vbus-regulator {
167		compatible = "regulator-fixed";
168		gpio = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
169		pinctrl-names = "default";
170		pinctrl-0 = <&otg_vbus_drv>;
171		regulator-name = "vcc_otg_vbus";
172		regulator-min-microvolt = <5000000>;
173		regulator-max-microvolt = <5000000>;
174		enable-active-high;
175	};
176
177	vcc5v0_sys: vcc5v0-sys {
178		compatible = "regulator-fixed";
179		regulator-name = "vcc5v0_sys";
180		regulator-always-on;
181		regulator-boot-on;
182		regulator-min-microvolt = <5000000>;
183		regulator-max-microvolt = <5000000>;
184	};
185
186	vcc_phy: vcc-phy-regulator {
187		compatible = "regulator-fixed";
188		regulator-name = "vcc_phy";
189		regulator-always-on;
190		regulator-boot-on;
191	};
192
193	wireless_bluetooth: wireless-bluetooth {
194		compatible = "bluetooth-platdata";
195		uart_rts_gpios = <&gpio4 RK_PB7 GPIO_ACTIVE_LOW>;
196		pinctrl-names = "default", "rts_gpio";
197		pinctrl-0 = <&uart4_rts>;
198		pinctrl-1 = <&uart4_rts_gpio>;
199		BT,power_gpio    = <&gpio4 RK_PC3 GPIO_ACTIVE_HIGH>;
200		BT,wake_host_irq = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>;
201		status = "okay";
202	};
203
204	wireless_wlan: wireless-wlan {
205		compatible = "wlan-platdata";
206		rockchip,grf = <&grf>;
207		pinctrl-names = "default";
208		pinctrl-0 = <&wifi_wake_host>;
209		wifi_chip_type = "ap6212";
210		WIFI,host_wake_irq = <&gpio4 RK_PC1 GPIO_ACTIVE_HIGH>;
211		status = "okay";
212	};
213};
214
215&cpu0 {
216	cpu-supply = <&vdd_cpu>;
217};
218
219&cpu1 {
220	cpu-supply = <&vdd_cpu>;
221};
222
223&combphy {
224	status = "okay";
225};
226
227&emmc {
228	bus-width = <8>;
229	cap-mmc-highspeed;
230	max-frequency = <200000000>;
231	mmc-hs200-1_8v;
232	no-sdio;
233	no-sd;
234	non-removable;
235	num-slots = <1>;
236	status = "okay";
237};
238
239&gmac {
240	phy-supply = <&vcc_phy>;
241	phy-mode = "rgmii";
242	clock_in_out = "input";
243	snps,reset-gpio = <&gpio0 10 GPIO_ACTIVE_LOW>;
244	snps,reset-active-low;
245	/* Reset time is 20ms, 100ms for rtl8211f */
246	snps,reset-delays-us = <0 20000 100000>;
247	assigned-clocks = <&cru SCLK_GMAC>;
248	assigned-clock-parents = <&gmac_clkin>;
249	tx_delay = <0x50>;
250	rx_delay = <0x3a>;
251	status = "okay";
252};
253
254&i2c0 {
255	status = "okay";
256	clock-frequency = <400000>;
257
258	vdd_npu: tcs4525@1c {
259		compatible = "tcs,tcs4525";
260		reg = <0x1c>;
261		vin-supply = <&vcc5v0_sys>;
262		regulator-compatible = "fan53555-reg";
263		pinctrl-0 = <&vsel_gpio>;
264		vsel-gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
265		regulator-name = "vdd_npu";
266		regulator-min-microvolt = <750000>;
267		regulator-max-microvolt = <950000>;
268		regulator-ramp-delay = <2300>;
269		fcs,suspend-voltage-selector = <0>;
270		regulator-boot-on;
271		regulator-state-mem {
272			regulator-off-in-suspend;
273		};
274	};
275
276	rk809: pmic@20 {
277		compatible = "rockchip,rk809";
278		reg = <0x20>;
279		interrupt-parent = <&gpio0>;
280		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
281		pinctrl-names = "default", "pmic-sleep",
282				"pmic-power-off", "pmic-reset";
283		pinctrl-0 = <&pmic_int>;
284		pinctrl-1 = <&soc_slppin_slp>, <&rk817_slppin_slp>;
285		pinctrl-2 = <&soc_slppin_gpio>, <&rk817_slppin_pwrdn>;
286		pinctrl-3 = <&soc_slppin_gpio>, <&rk817_slppin_null>;
287		rockchip,system-power-controller;
288		wakeup-source;
289		#clock-cells = <1>;
290		clock-output-names = "rk808-clkout1", "rk808-clkout2";
291		//fb-inner-reg-idxs = <2>;
292		/* 1: rst regs (default in codes), 0: rst the pmic */
293		pmic-reset-func = <0>;
294
295		vcc1-supply = <&vcc5v0_sys>;
296		vcc2-supply = <&vcc5v0_sys>;
297		vcc3-supply = <&vcc5v0_sys>;
298		vcc4-supply = <&vcc5v0_sys>;
299		vcc5-supply = <&vcc_buck5>;
300		vcc6-supply = <&vcc_buck5>;
301		vcc7-supply = <&vcc5v0_sys>;
302		vcc8-supply = <&vcc_3v3>;
303		vcc9-supply = <&vcc5v0_sys>;
304
305		pwrkey {
306			status = "okay";
307		};
308
309		rtc {
310			status = "okay";
311		};
312
313		pinctrl_rk8xx: pinctrl_rk8xx {
314			gpio-controller;
315			#gpio-cells = <2>;
316
317			rk817_slppin_null: rk817_slppin_null {
318				pins = "gpio_slp";
319				function = "pin_fun0";
320			};
321
322			rk817_slppin_slp: rk817_slppin_slp {
323				pins = "gpio_slp";
324				function = "pin_fun1";
325			};
326
327			rk817_slppin_pwrdn: rk817_slppin_pwrdn {
328				pins = "gpio_slp";
329				function = "pin_fun2";
330			};
331
332			rk817_slppin_rst: rk817_slppin_rst {
333				pins = "gpio_slp";
334				function = "pin_fun3";
335			};
336		};
337
338		regulators {
339			vdd_log: DCDC_REG1 {
340				regulator-always-on;
341				regulator-boot-on;
342				regulator-min-microvolt = <750000>;
343				regulator-max-microvolt = <950000>;
344				regulator-ramp-delay = <6001>;
345				regulator-initial-mode = <0x2>;
346				regulator-name = "vdd_log";
347				regulator-state-mem {
348					regulator-on-in-suspend;
349					regulator-suspend-microvolt = <800000>;
350				};
351			};
352
353			vdd_cpu: DCDC_REG2 {
354				regulator-always-on;
355				regulator-boot-on;
356				regulator-min-microvolt = <750000>;
357				regulator-max-microvolt = <950000>;
358				regulator-ramp-delay = <6001>;
359				regulator-initial-mode = <0x2>;
360				regulator-name = "vdd_cpu";
361				regulator-state-mem {
362					regulator-off-in-suspend;
363				};
364			};
365
366			vcc_ddr: DCDC_REG3 {
367				regulator-always-on;
368				regulator-boot-on;
369				regulator-name = "vcc_ddr";
370				regulator-initial-mode = <0x2>;
371				regulator-state-mem {
372					regulator-on-in-suspend;
373				};
374			};
375
376			vcc_3v3: DCDC_REG4 {
377				regulator-always-on;
378				regulator-boot-on;
379				regulator-min-microvolt = <3300000>;
380				regulator-max-microvolt = <3300000>;
381				regulator-initial-mode = <0x2>;
382				regulator-name = "vcc_3v3";
383				regulator-state-mem {
384					regulator-on-in-suspend;
385					regulator-suspend-microvolt = <3300000>;
386				};
387			};
388
389			vdda_0v8: LDO_REG1 {
390				regulator-always-on;
391				regulator-boot-on;
392				regulator-min-microvolt = <800000>;
393				regulator-max-microvolt = <800000>;
394				regulator-name = "vdda_0v8";
395				regulator-state-mem {
396					regulator-on-in-suspend;
397					regulator-suspend-microvolt = <800000>;
398				};
399			};
400
401			vcc_1v8: LDO_REG2 {
402				regulator-always-on;
403				regulator-boot-on;
404				regulator-min-microvolt = <1800000>;
405				regulator-max-microvolt = <1800000>;
406
407				regulator-name = "vcc_1v8";
408				regulator-state-mem {
409					regulator-on-in-suspend;
410					regulator-suspend-microvolt = <1800000>;
411				};
412			};
413
414			vdd_0v8: LDO_REG3 {
415				regulator-always-on;
416				regulator-boot-on;
417				regulator-min-microvolt = <800000>;
418				regulator-max-microvolt = <800000>;
419
420				regulator-name = "vdd_0v8";
421				regulator-state-mem {
422					regulator-on-in-suspend;
423					regulator-suspend-microvolt = <800000>;
424				};
425			};
426
427			vcca_1v8: LDO_REG4 {
428				regulator-always-on;
429				regulator-boot-on;
430				regulator-min-microvolt = <1800000>;
431				regulator-max-microvolt = <1800000>;
432
433				regulator-name = "vcca_1v8";
434				regulator-state-mem {
435					regulator-on-in-suspend;
436					regulator-suspend-microvolt = <1800000>;
437
438				};
439			};
440
441			vcc1v8_dvp: LDO_REG5 {
442				regulator-always-on;
443				regulator-boot-on;
444				regulator-min-microvolt = <1800000>;
445				regulator-max-microvolt = <1800000>;
446
447				regulator-name = "vcc1v8_dvp";
448				regulator-state-mem {
449					regulator-on-in-suspend;
450					regulator-suspend-microvolt = <1800000>;
451				};
452			};
453
454			vdd1v5_dvp: LDO_REG6 {
455				regulator-min-microvolt = <1200000>;
456				regulator-max-microvolt = <1500000>;
457
458				regulator-name = "vdd1v5_dvp";
459				regulator-state-mem {
460					regulator-on-in-suspend;
461					regulator-suspend-microvolt = <1500000>;
462
463				};
464			};
465
466			vcc2v8_dvp: LDO_REG7 {
467				regulator-always-on;
468				regulator-boot-on;
469				regulator-min-microvolt = <2800000>;
470				regulator-max-microvolt = <2800000>;
471
472				regulator-name = "vcc2v8_dvp";
473				regulator-state-mem {
474					regulator-off-in-suspend;
475					regulator-suspend-microvolt = <2800000>;
476				};
477			};
478
479			vccio_sd: LDO_REG8 {
480				regulator-always-on;
481				regulator-boot-on;
482				regulator-min-microvolt = <1800000>;
483				regulator-max-microvolt = <3300000>;
484
485				regulator-name = "vccio_sd";
486				regulator-state-mem {
487					regulator-on-in-suspend;
488					regulator-suspend-microvolt = <3300000>;
489				};
490			};
491
492			vcc3v3_sd: LDO_REG9 {
493				regulator-min-microvolt = <3300000>;
494				regulator-max-microvolt = <3300000>;
495
496				regulator-name = "vcc3v3_sd";
497				regulator-state-mem {
498					regulator-on-in-suspend;
499					regulator-suspend-microvolt = <3300000>;
500				};
501			};
502
503			vcc_buck5: DCDC_REG5 {
504				regulator-always-on;
505				regulator-boot-on;
506				regulator-min-microvolt = <2200000>;
507				regulator-max-microvolt = <2200000>;
508				regulator-name = "vcc_buck5";
509				regulator-state-mem {
510					regulator-on-in-suspend;
511					regulator-suspend-microvolt = <2200000>;
512				};
513			};
514
515			vcc5v0_host: SWITCH_REG1 {
516				regulator-always-on;
517				regulator-boot-on;
518				regulator-name = "vcc5v0_host";
519			};
520
521			vccio_3v3: SWITCH_REG2 {
522				regulator-always-on;
523				regulator-boot-on;
524				regulator-name = "vccio_3v3";
525			};
526
527		};
528
529		rk809_codec: codec {
530			#sound-dai-cells = <0>;
531			compatible = "rockchip,rk809-codec", "rockchip,rk817-codec";
532			clocks = <&cru SCLK_I2S1_2CH_OUT>;
533			clock-names = "mclk";
534			pinctrl-names = "default";
535			pinctrl-0 = <&i2s1_2ch_mclk>;
536			hp-volume = <20>;
537			spk-volume = <3>;
538			status = "okay";
539		};
540	};
541};
542
543&i2c1 {
544	status = "okay";
545
546	gt1x: gt1x@14 {
547		compatible = "goodix,gt1x";
548		reg = <0x14>;
549		goodix,rst-gpio = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;
550		goodix,irq-gpio = <&gpio0 RK_PB5 IRQ_TYPE_LEVEL_LOW>;
551	};
552};
553
554&i2c4 {
555	status = "okay";
556
557	sensor@d {
558		status = "okay";
559		compatible = "ak8963";
560		reg = <0x0d>;
561		type = <SENSOR_TYPE_COMPASS>;
562		irq_enable = <0>;
563		poll_delay_ms = <30>;
564		layout = <1>;
565		reprobe_en = <1>;
566	};
567
568	sensor@4c {
569		status = "okay";
570		compatible = "gs_mma7660";
571		reg = <0x4c>;
572		type = <SENSOR_TYPE_ACCEL>;
573		irq-gpio = <&gpio0 RK_PC6 IRQ_TYPE_LEVEL_LOW>;
574		irq_enable = <0>;
575		poll_delay_ms = <30>;
576		layout = <2>;
577		reprobe_en = <1>;
578	};
579};
580
581&npu {
582	npu-supply = <&vdd_npu>;
583	status = "okay";
584};
585
586&pcie0 {
587	reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
588	/* Disable usbdrd_dwc3 and usbdrd3 if using pcie0 */
589	status = "disabled";
590};
591
592&power {
593	npu-supply = <&vdd_npu>;
594};
595
596&pwm1 {
597	status = "okay";
598};
599
600&saradc {
601	status = "okay";
602	vref-supply = <&vcc_1v8>;
603};
604
605&sdio {
606	bus-width = <4>;
607	cap-mmc-highspeed;
608	cap-sd-highspeed;
609	no-sd;
610	no-mmc;
611	keep-power-in-suspend;
612	non-removable;
613	mmc-pwrseq = <&sdio_pwrseq>;
614	sd-uhs-sdr104;
615	status = "okay";
616};
617
618&sdmmc {
619	bus-width = <4>;
620	cap-mmc-highspeed;
621	cap-sd-highspeed;
622	no-sdio;
623	no-mmc;
624	card-detect-delay = <300>;
625	sd-uhs-sdr25;
626	sd-uhs-sdr50;
627	sd-uhs-sdr104;
628	vmmc-supply = <&vcc3v3_sd>;
629	vqmmc-supply = <&vccio_sd>;
630	status = "okay";
631};
632
633&uart4 {
634	pinctrl-names = "default";
635	pinctrl-0 = <&uart4_xfer &uart4_cts>;
636	status = "okay";
637};
638
639&u2phy {
640	status = "okay";
641};
642
643&u2phy_host {
644	status = "okay";
645};
646
647&u2phy_otg {
648	status = "okay";
649	vbus-supply = <&vcc_otg_vbus>;
650};
651
652&usb_host0_ehci {
653	status = "okay";
654};
655
656&usb_host0_ohci {
657	status = "okay";
658};
659
660&usbdrd3 {
661	status = "okay";
662	extcon = <&u2phy>;
663};
664
665&usbdrd_dwc3 {
666	status = "okay";
667};
668
669&pinctrl {
670	pmic {
671		pmic_int: pmic_int {
672			rockchip,pins =
673				<0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
674		};
675
676		soc_slppin_gpio: soc_slppin_gpio {
677			rockchip,pins =
678				<0 RK_PA4 RK_FUNC_GPIO &pcfg_output_low>;
679		};
680
681		soc_slppin_slp: soc_slppin_slp {
682			rockchip,pins =
683				<0 RK_PA4 1 &pcfg_pull_none>;
684		};
685
686		vsel_gpio: vsel-gpio {
687			rockchip,pins =
688				<0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_down>;
689		};
690	};
691
692	sdio-pwrseq {
693		wifi_enable_h: wifi-enable-h {
694			rockchip,pins =
695				<4 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
696		};
697	};
698
699	usb2 {
700		otg_vbus_drv: otg-vbus-drv {
701			rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
702		};
703	};
704
705	wireless-bluetooth {
706		uart4_rts_gpio: uart4-rts-gpio {
707			rockchip,pins = <4 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
708		};
709	};
710
711	wireless-wlan {
712		wifi_wake_host: wifi-wake-host {
713			rockchip,pins =
714				<4 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up>;
715		};
716	};
717};
718