xref: /OK3568_Linux_fs/kernel/scripts/dtc/include-prefixes/arm64/rockchip/rk3328-box-liantong.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
7#include "rk3328.dtsi"
8#include "rk3328-android.dtsi"
9#include "rk3328-box-plus-dram-timing.dtsi"
10#include <dt-bindings/input/input.h>
11
12/ {
13	gmac_clkin: external-gmac-clock {
14		compatible = "fixed-clock";
15		clock-frequency = <125000000>;
16		clock-output-names = "gmac_clkin";
17		#clock-cells = <0>;
18	};
19
20	sdio_pwrseq: sdio-pwrseq {
21		compatible = "mmc-pwrseq-simple";
22		pinctrl-names = "default";
23		pinctrl-0 = <&wifi_enable_h>;
24
25		/*
26		 * On the module itself this is one of these (depending
27		 * on the actual card populated):
28		 * - SDIO_RESET_L_WL_REG_ON
29		 * - PDN (power down when low)
30		 */
31		reset-gpios = <&gpio1 18 GPIO_ACTIVE_LOW>;
32	};
33
34	sound {
35		compatible = "simple-audio-card";
36		simple-audio-card,format = "i2s";
37		simple-audio-card,mclk-fs = <256>;
38		simple-audio-card,name = "rockchip-rk3328";
39		simple-audio-card,cpu {
40			sound-dai = <&i2s1>;
41		};
42		simple-audio-card,codec {
43			sound-dai = <&codec>;
44		};
45	};
46
47	hdmi-sound {
48		compatible = "simple-audio-card";
49		simple-audio-card,format = "i2s";
50		simple-audio-card,mclk-fs = <128>;
51		simple-audio-card,name = "rockchip-hdmi";
52		simple-audio-card,cpu {
53			sound-dai = <&i2s0>;
54		};
55		simple-audio-card,codec {
56			sound-dai = <&hdmi>;
57		};
58	};
59
60	regulators {
61		compatible = "simple-bus";
62		#address-cells = <1>;
63		#size-cells = <0>;
64
65		vccio_1v8_reg: regulator@0 {
66			compatible = "regulator-fixed";
67			regulator-name = "vccio_1v8";
68			regulator-min-microvolt = <1800000>;
69			regulator-max-microvolt = <1800000>;
70			regulator-always-on;
71		};
72
73		vccio_3v3_reg: regulator@1 {
74			compatible = "regulator-fixed";
75			regulator-name = "vccio_3v3";
76			regulator-min-microvolt = <3300000>;
77			regulator-max-microvolt = <3300000>;
78			regulator-always-on;
79		};
80	};
81
82	rtc-fake {
83		compatible = "rtc-fake";
84		status = "okay";
85	};
86
87	spdif-sound {
88		compatible = "simple-audio-card";
89		simple-audio-card,name = "rockchip-spdif";
90		simple-audio-card,mclk-fs = <128>;
91		simple-audio-card,cpu {
92			sound-dai = <&spdif>;
93		};
94		simple-audio-card,codec {
95			sound-dai = <&spdif_out>;
96		};
97	};
98
99	spdif_out: spdif-out {
100		compatible = "linux,spdif-dit";
101		#sound-dai-cells = <0>;
102	};
103
104	vcc_host_vbus: host-vbus-regulator {
105		compatible = "regulator-fixed";
106		gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
107		pinctrl-names = "default";
108		pinctrl-0 = <&host_vbus_drv>;
109		regulator-name = "vcc_host_vbus";
110		regulator-min-microvolt = <5000000>;
111		regulator-max-microvolt = <5000000>;
112		enable-active-high;
113	};
114
115	vcc_otg_vbus: otg-vbus-regulator {
116		compatible = "regulator-fixed";
117		gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
118		pinctrl-names = "default";
119		pinctrl-0 = <&otg_vbus_drv>;
120		regulator-name = "vcc_otg_vbus";
121		regulator-min-microvolt = <5000000>;
122		regulator-max-microvolt = <5000000>;
123		enable-active-high;
124	};
125
126	vcc_phy: vcc-phy-regulator {
127		compatible = "regulator-fixed";
128		regulator-name = "vcc_phy";
129		regulator-always-on;
130		regulator-boot-on;
131	};
132
133	vcc_sd: sdmmc-regulator {
134		compatible = "regulator-fixed";
135		gpio = <&gpio0 30 GPIO_ACTIVE_LOW>;
136		pinctrl-names = "default";
137		pinctrl-0 = <&sdmmc0m1_gpio>;
138		regulator-name = "vcc_sd";
139		regulator-min-microvolt = <3300000>;
140		regulator-max-microvolt = <3300000>;
141		vin-supply = <&vccio_3v3_reg>;
142	};
143
144	vdd_arm: vdd-center {
145		compatible = "pwm-regulator";
146		rockchip,pwm_id = <0>;
147		rockchip,pwm_voltage = <1250000>;
148		pwms = <&pwm0 0 5000 1>;
149		regulator-name = "vcc_arm";
150		regulator-min-microvolt = <950000>;
151		regulator-max-microvolt = <1400000>;
152		regulator-settling-time-up-us = <250>;
153		regulator-always-on;
154		regulator-boot-on;
155	};
156
157	vdd_logic: vdd-log {
158		compatible = "pwm-regulator";
159		rockchip,pwm_id = <1>;
160		rockchip,pwm_voltage = <1100000>;
161		pwms = <&pwm1 0 5000 1>;
162		regulator-name = "vcc_log";
163		regulator-min-microvolt = <900000>;
164		regulator-max-microvolt = <1300000>;
165		regulator-settling-time-up-us = <250>;
166		regulator-always-on;
167		regulator-boot-on;
168	};
169
170	wireless-bluetooth {
171		compatible = "bluetooth-platdata";
172		uart_rts_gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
173		pinctrl-names = "default", "rts_gpio";
174		pinctrl-0 = <&uart0_rts>;
175		pinctrl-1 = <&uart0_gpios>;
176		BT,power_gpio = <&gpio1 24 GPIO_ACTIVE_HIGH>;
177		BT,wake_host_irq = <&gpio1 26 GPIO_ACTIVE_HIGH>;
178		status = "okay";
179	};
180
181	wireless-wlan {
182		compatible = "wlan-platdata";
183		rockchip,grf = <&grf>;
184		wifi_chip_type = "rtl8822bs";
185		sdio_vref = <1800>;
186		WIFI,host_wake_irq = <&gpio1 19 GPIO_ACTIVE_HIGH>;
187		status = "okay";
188	};
189};
190
191&avsd {
192	status = "okay";
193};
194
195&codec {
196	#sound-dai-cells = <0>;
197	status = "okay";
198};
199
200&cpu0 {
201	cpu-supply = <&vdd_arm>;
202};
203
204&dfi {
205	status = "okay";
206};
207
208&dmc {
209	center-supply = <&vdd_logic>;
210	status = "okay";
211	system-status-freq = <
212		/*system status         freq(KHz)*/
213		SYS_STATUS_NORMAL       786000
214		SYS_STATUS_REBOOT       786000
215		SYS_STATUS_SUSPEND      786000
216		SYS_STATUS_VIDEO_1080P  786000
217		SYS_STATUS_VIDEO_4K     786000
218		SYS_STATUS_VIDEO_4K_10B 786000
219		SYS_STATUS_PERFORMANCE  786000
220		SYS_STATUS_BOOST        786000
221	>;
222};
223
224&dmc_opp_table {
225	opp-800000000 {
226		status = "disabled";
227	};
228
229	opp-850000000 {
230		status = "disabled";
231	};
232
233	opp-933000000 {
234		status = "disabled";
235	};
236
237	opp-1066000000 {
238		status = "disabled";
239	};
240};
241
242&emmc {
243	bus-width = <8>;
244	cap-mmc-highspeed;
245	no-sdio;
246	no-sd;
247	disable-wp;
248	non-removable;
249	num-slots = <1>;
250	pinctrl-names = "default";
251	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
252	status = "okay";
253};
254
255&gmac2io {
256	phy-supply = <&vcc_phy>;
257	phy-mode = "rgmii";
258	clock_in_out = "input";
259	snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
260	snps,reset-active-low;
261	snps,reset-delays-us = <0 10000 50000>;
262	assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
263	assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
264	pinctrl-names = "default";
265	pinctrl-0 = <&rgmiim1_pins>;
266	tx_delay = <0x26>;
267	rx_delay = <0x11>;
268	status = "disabled";
269};
270
271&gmac2phy {
272	phy-supply = <&vcc_phy>;
273	clock_in_out = "output";
274	assigned-clocks = <&cru SCLK_MAC2PHY_SRC>;
275	assigned-clock-rate = <50000000>;
276	assigned-clocks = <&cru SCLK_MAC2PHY>;
277	assigned-clock-parents = <&cru SCLK_MAC2PHY_SRC>;
278	status = "okay";
279};
280
281&gpu {
282	status = "okay";
283	mali-supply = <&vdd_logic>;
284};
285
286&hdmi {
287	#sound-dai-cells = <0>;
288	ddc-i2c-scl-high-time-ns = <9625>;
289	ddc-i2c-scl-low-time-ns = <10000>;
290	status = "okay";
291};
292
293&hdmiphy {
294	rockchip,phy-table =
295		<165000000 0x07 0x0a 0x0a 0x0a 0x00 0x00 0x08
296			   0x08 0x08 0x00 0xac 0xcc 0xcc 0xcc>,
297		<340000000 0x0b 0x0d 0x0d 0x0d 0x07 0x15 0x08
298			   0x08 0x08 0x3f 0xac 0xcc 0xcd 0xdd>,
299		<594000000 0x10 0x1a 0x1a 0x1a 0x07 0x15 0x08
300			   0x08 0x08 0x00 0xac 0xcc 0xcc 0xcc>;
301	status = "okay";
302};
303
304&secure_memory {
305	/*
306	 * enable like this:
307	 * reg = <0x0 0x20000000 0x0 0x10000000>;
308	 */
309	reg = <0x0 0x20000000 0x0 0x0>;
310};
311
312&i2s0 {
313	#sound-dai-cells = <0>;
314	rockchip,bclk-fs = <128>;
315	status = "okay";
316};
317
318&i2s1 {
319	#sound-dai-cells = <0>;
320	status = "okay";
321};
322
323&iep {
324	status = "okay";
325};
326
327&iep_mmu {
328	status = "okay";
329};
330
331&io_domains {
332	status = "okay";
333
334	vccio1-supply = <&vccio_3v3_reg>;
335	vccio2-supply = <&vccio_1v8_reg>;
336	vccio3-supply = <&vccio_3v3_reg>;
337	vccio4-supply = <&vccio_1v8_reg>;
338	vccio5-supply = <&vccio_3v3_reg>;
339	vccio6-supply = <&vccio_3v3_reg>;
340	pmuio-supply = <&vccio_3v3_reg>;
341};
342
343&mpp_srv {
344	status = "okay";
345};
346
347&pinctrl {
348	sdio-pwrseq {
349		wifi_enable_h: wifi-enable-h {
350		rockchip,pins =
351			<1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
352		};
353	};
354
355	usb {
356		host_vbus_drv: host-vbus-drv {
357			rockchip,pins =
358				<0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
359		};
360
361		otg_vbus_drv: otg-vbus-drv {
362			rockchip,pins =
363				<0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
364		};
365	};
366
367	wireless-bluetooth {
368		uart0_gpios: uart0-gpios {
369		rockchip,pins =
370			<1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
371		};
372	};
373};
374
375&pwm0 {
376	status = "okay";
377	pinctrl-names = "active";
378	pinctrl-0 = <&pwm0_pin_pull_up>;
379};
380
381&pwm1 {
382	status = "okay";
383	pinctrl-names = "active";
384	pinctrl-0 = <&pwm1_pin_pull_up>;
385};
386
387&pwm3 {
388	status = "okay";
389	pinctrl-names = "default";
390	pinctrl-0 = <&pwmir_pin>;
391	compatible = "rockchip,remotectl-pwm";
392	remote_pwm_id = <3>;
393	handle_cpu_id = <1>;
394	remote_support_psci = <1>;
395
396	ir_key1 {
397		rockchip,usercode = <0x4040>;
398		rockchip,key_table =
399			<0xf2	KEY_REPLY>,
400			<0xba	KEY_BACK>,
401			<0xf4	KEY_UP>,
402			<0xf1	KEY_DOWN>,
403			<0xef	KEY_LEFT>,
404			<0xee	KEY_RIGHT>,
405			<0xbd	KEY_HOME>,
406			<0xea	KEY_VOLUMEUP>,
407			<0xe3	KEY_VOLUMEDOWN>,
408			<0xe2	KEY_SEARCH>,
409			<0xb2	KEY_POWER>,
410			<0xbc	KEY_MUTE>,
411			<0xec	KEY_MENU>,
412			<0xbf	0x190>,
413			<0xe0	0x191>,
414			<0xe1	0x192>,
415			<0xe9	183>,
416			<0xe6	248>,
417			<0xe8	185>,
418			<0xe7	186>,
419			<0xf0	388>,
420			<0xbe	0x175>;
421	};
422
423	ir_key2 {
424		rockchip,usercode = <0xff00>;
425		rockchip,key_table =
426			<0xf9	KEY_HOME>,
427			<0xbf	KEY_BACK>,
428			<0xfb	KEY_MENU>,
429			<0xaa	KEY_REPLY>,
430			<0xb9	KEY_UP>,
431			<0xe9	KEY_DOWN>,
432			<0xb8	KEY_LEFT>,
433			<0xea	KEY_RIGHT>,
434			<0xeb	KEY_VOLUMEDOWN>,
435			<0xef	KEY_VOLUMEUP>,
436			<0xf7	KEY_MUTE>,
437			<0xe7	KEY_POWER>,
438			<0xfc	KEY_POWER>,
439			<0xa9	KEY_VOLUMEDOWN>,
440			<0xa8	KEY_PLAYPAUSE>,
441			<0xe0	KEY_VOLUMEDOWN>,
442			<0xa5	KEY_VOLUMEDOWN>,
443			<0xab	183>,
444			<0xb7	388>,
445			<0xe8	388>,
446			<0xf8	184>,
447			<0xaf	185>,
448			<0xed	KEY_VOLUMEDOWN>,
449			<0xee	186>,
450			<0xb3	KEY_VOLUMEDOWN>,
451			<0xf1	KEY_VOLUMEDOWN>,
452			<0xf2	KEY_VOLUMEDOWN>,
453			<0xf3	KEY_SEARCH>,
454			<0xb4	KEY_VOLUMEDOWN>,
455			<0xa4	KEY_SETUP>,
456			<0xbe	KEY_SEARCH>;
457	};
458
459	ir_key3 {
460		rockchip,usercode = <0x1dcc>;
461		rockchip,key_table =
462			<0xee	KEY_REPLY>,
463			<0xf0	KEY_BACK>,
464			<0xf8	KEY_UP>,
465			<0xbb	KEY_DOWN>,
466			<0xef	KEY_LEFT>,
467			<0xed	KEY_RIGHT>,
468			<0xfc	KEY_HOME>,
469			<0xf1	KEY_VOLUMEUP>,
470			<0xfd	KEY_VOLUMEDOWN>,
471			<0xb7	KEY_SEARCH>,
472			<0xff	KEY_POWER>,
473			<0xf3	KEY_MUTE>,
474			<0xbf	KEY_MENU>,
475			<0xf9	0x191>,
476			<0xf5	0x192>,
477			<0xb3	388>,
478			<0xbe	KEY_1>,
479			<0xba	KEY_2>,
480			<0xb2	KEY_3>,
481			<0xbd	KEY_4>,
482			<0xf9	KEY_5>,
483			<0xb1	KEY_6>,
484			<0xfc	KEY_7>,
485			<0xf8	KEY_8>,
486			<0xb0	KEY_9>,
487			<0xb6	KEY_0>,
488			<0xb5	KEY_BACKSPACE>;
489	};
490};
491
492&rga {
493	status = "okay";
494};
495
496&rkvdec {
497	status = "okay";
498	vcodec-supply = <&vdd_logic>;
499};
500
501&rkvdec_mmu {
502	status = "okay";
503};
504
505&rockchip_suspend {
506	status = "okay";
507	rockchip,virtual-poweroff = <1>;
508	rockchip,sleep-mode-config = <
509		(0
510		|RKPM_SLP_CTR_VOL_PWM0
511		|RKPM_SLP_CTR_VOL_PWM1
512		)
513	>;
514};
515
516&uart0 {
517	pinctrl-names = "default";
518	pinctrl-0 = <&uart0_xfer &uart0_cts>;
519	status = "okay";
520};
521
522&sdio {
523	bus-width = <4>;
524	cap-sd-highspeed;
525	cap-sdio-irq;
526	disable-wp;
527	keep-power-in-suspend;
528	max-frequency = <125000000>;
529	mmc-pwrseq = <&sdio_pwrseq>;
530	non-removable;
531	num-slots = <1>;
532	pinctrl-names = "default";
533	pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>;
534	no-sd;
535	no-mmc;
536	sd-uhs-sdr104;
537	status = "okay";
538};
539
540&sdmmc_ext {
541	bus-width = <4>;
542	cap-mmc-highspeed;
543	cap-sd-highspeed;
544	disable-wp;
545	keep-power-in-suspend;
546	max-frequency = <150000000>;
547	num-slots = <1>;
548	pinctrl-names = "default";
549	pinctrl-0 = <&sdmmc0ext_clk &sdmmc0ext_cmd &sdmmc0ext_dectn &sdmmc0ext_bus4>;
550	no-sdio;
551	no-mmc;
552	status = "okay";
553};
554
555&sdmmc {
556	bus-width = <4>;
557	cap-mmc-highspeed;
558	cap-sd-highspeed;
559	disable-wp;
560	max-frequency = <150000000>;
561	num-slots = <1>;
562	pinctrl-names = "default";
563	pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
564	no-sdio;
565	no-mmc;
566	status = "okay";
567	vmmc-supply = <&vcc_sd>;
568};
569
570&spdif {
571	#sound-dai-cells = <0>;
572	pinctrl-names = "default";
573	pinctrl-0 = <&spdifm0_tx>;
574	status = "okay";
575};
576
577&threshold {
578	temperature = <90000>; /* millicelsius */
579};
580
581&target {
582	temperature = <105000>; /* millicelsius */
583};
584
585&soc_crit {
586	temperature = <115000>; /* millicelsius */
587};
588
589&tsadc {
590	rockchip,hw-tshut-temp = <120000>;
591	status = "okay";
592};
593
594&tve {
595	status = "okay";
596};
597
598&u2phy {
599	status = "okay";
600
601	u2phy_host: host-port {
602		status = "okay";
603	};
604
605	u2phy_otg: otg-port {
606		vbus-supply = <&vcc_otg_vbus>;
607		status = "okay";
608	};
609};
610
611&u3phy {
612	vbus-supply = <&vcc_host_vbus>;
613	status = "okay";
614};
615
616&u3phy_utmi {
617	status = "okay";
618};
619
620&u3phy_pipe {
621	status = "okay";
622};
623
624&usb20_otg {
625	status = "okay";
626};
627
628&usb_host0_ehci {
629	status = "okay";
630};
631
632&usb_host0_ohci {
633	status = "okay";
634};
635
636&usbdrd3 {
637	status = "okay";
638};
639
640&usbdrd_dwc3 {
641	status = "okay";
642};
643
644&vdpu {
645	status = "okay";
646};
647
648&vpu_mmu {
649	status = "okay";
650};
651
652&vepu {
653	status = "okay";
654};
655
656&vepu_mmu {
657	status = "okay";
658};
659
660&vepu22 {
661	status = "okay";
662};
663
664&vepu22_mmu {
665	status = "okay";
666};
667
668&vop {
669	status = "okay";
670};
671
672&vop_mmu {
673	status = "okay";
674};
675