1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
4 * Copyright (c) 2018 Akash Gajjar <[email protected]>
5 */
6
7#include <dt-bindings/input/linux-event-codes.h>
8#include <dt-bindings/pwm/pwm.h>
9#include "rk3399.dtsi"
10
11/ {
12	aliases {
13		ethernet0 = &gmac;
14		mmc0 = &sdio0;
15		mmc1 = &sdmmc;
16		mmc2 = &sdhci;
17	};
18
19	chosen {
20		stdout-path = "serial2:1500000n8";
21	};
22
23	/* enable for panel backlight support */
24	backlight: backlight {
25		compatible = "pwm-backlight";
26		brightness-levels = <0 4 8 16 32 64 128 255>;
27		default-brightness-level = <5>;
28		pwms = <&pwm0 0 1000000 0>;
29		status = "disabled";
30	};
31
32	clkin_gmac: external-gmac-clock {
33		compatible = "fixed-clock";
34		clock-frequency = <125000000>;
35		clock-output-names = "clkin_gmac";
36		#clock-cells = <0>;
37	};
38
39	gpio-keys {
40		compatible = "gpio-keys";
41		autorepeat;
42		pinctrl-names = "default";
43		pinctrl-0 = <&pwrbtn>;
44
45		key-power {
46			debounce-interval = <100>;
47			gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
48			label = "GPIO Key Power";
49			linux,code = <KEY_POWER>;
50			wakeup-source;
51		};
52	};
53
54	ir-receiver {
55		compatible = "gpio-ir-receiver";
56		gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
57		pinctrl-0 = <&ir_int>;
58		pinctrl-names = "default";
59	};
60
61	leds {
62		compatible = "gpio-leds";
63		pinctrl-names = "default";
64		pinctrl-0 = <&work_led_pin>, <&diy_led_pin>;
65
66		work_led: led-0 {
67			label = "work";
68			default-state = "on";
69			gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>;
70		};
71
72		diy_led: led-1 {
73			label = "diy";
74			default-state = "off";
75			gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
76		};
77	};
78
79	fan: pwm-fan {
80		compatible = "pwm-fan";
81		cooling-levels = <0 100 150 200 255>;
82		#cooling-cells = <2>;
83		fan-supply = <&vcc12v_dcin>;
84		pwms = <&pwm1 0 50000 0>;
85	};
86
87	sdio_pwrseq: sdio-pwrseq {
88		compatible = "mmc-pwrseq-simple";
89		clocks = <&rk808 1>;
90		clock-names = "ext_clock";
91		pinctrl-names = "default";
92		pinctrl-0 = <&wifi_enable_h>;
93		reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
94	};
95
96	sound {
97		compatible = "audio-graph-card";
98		label = "Analog";
99		dais = <&i2s1_p0>;
100	};
101
102	sound-dit {
103		compatible = "audio-graph-card";
104		label = "SPDIF";
105		dais = <&spdif_p0>;
106	};
107
108	spdif-dit {
109		compatible = "linux,spdif-dit";
110		#sound-dai-cells = <0>;
111
112		port {
113			dit_p0_0: endpoint {
114				remote-endpoint = <&spdif_p0_0>;
115			};
116		};
117	};
118
119	avdd: regulator-avdd {
120		compatible = "regulator-fixed";
121		regulator-name = "avdd";
122		regulator-min-microvolt = <11000000>;
123		regulator-max-microvolt = <11000000>;
124		vin-supply = <&vcc3v3_s0>;
125	};
126
127	vcc12v_dcin: regulator-vcc12v-dcin {
128		compatible = "regulator-fixed";
129		regulator-name = "vcc12v_dcin";
130		regulator-always-on;
131		regulator-boot-on;
132		regulator-min-microvolt = <12000000>;
133		regulator-max-microvolt = <12000000>;
134	};
135
136	/* switched by pmic_sleep */
137	vcc1v8_s3: vcca1v8_s3: regulator-vcc1v8-s3 {
138		compatible = "regulator-fixed";
139		regulator-name = "vcc1v8_s3";
140		regulator-always-on;
141		regulator-boot-on;
142		regulator-min-microvolt = <1800000>;
143		regulator-max-microvolt = <1800000>;
144		vin-supply = <&vcc_1v8>;
145	};
146
147	/* micro SD card power */
148	vcc3v0_sd: regulator-vcc3v0-sd {
149		compatible = "regulator-fixed";
150		enable-active-high;
151		gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
152		pinctrl-names = "default";
153		pinctrl-0 = <&sdmmc0_pwr_h>;
154		regulator-name = "vcc3v0_sd";
155		regulator-always-on;
156		regulator-min-microvolt = <3000000>;
157		regulator-max-microvolt = <3000000>;
158		vin-supply = <&vcc3v3_sys>;
159
160		regulator-state-mem {
161			regulator-off-in-suspend;
162		};
163	};
164
165	vcc3v3_pcie: regulator-vcc3v3-pcie {
166		compatible = "regulator-fixed";
167		enable-active-high;
168		gpio = <&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>;
169		pinctrl-names = "default";
170		pinctrl-0 = <&pcie_pwr_en>;
171		regulator-name = "vcc3v3_pcie";
172		regulator-always-on;
173		regulator-boot-on;
174		vin-supply = <&vcc12v_dcin>;
175	};
176
177	vcc3v3_sys: regulator-vcc3v3-sys {
178		compatible = "regulator-fixed";
179		regulator-name = "vcc3v3_sys";
180		regulator-always-on;
181		regulator-boot-on;
182		regulator-min-microvolt = <3300000>;
183		regulator-max-microvolt = <3300000>;
184		vin-supply = <&vcc5v0_sys>;
185	};
186
187	/* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
188	vcc5v0_host: regulator-vcc5v0-host {
189		compatible = "regulator-fixed";
190		enable-active-high;
191		gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
192		pinctrl-names = "default";
193		pinctrl-0 = <&vcc5v0_host_en>;
194		regulator-name = "vcc5v0_host";
195		regulator-always-on;
196		vin-supply = <&vcc5v0_usb>;
197	};
198
199	vcc5v0_typec: regulator-vcc5v0-typec {
200		compatible = "regulator-fixed";
201		enable-active-high;
202		gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
203		pinctrl-names = "default";
204		pinctrl-0 = <&vcc5v0_typec_en>;
205		regulator-name = "vcc5v0_typec";
206		regulator-always-on;
207		vin-supply = <&vcc5v0_usb>;
208	};
209
210	vcc5v0_sys: regulator-vcc5v0-sys {
211		compatible = "regulator-fixed";
212		regulator-name = "vcc5v0_sys";
213		regulator-always-on;
214		regulator-boot-on;
215		regulator-min-microvolt = <5000000>;
216		regulator-max-microvolt = <5000000>;
217		vin-supply = <&vcc12v_dcin>;
218	};
219
220	vcc5v0_usb: regulator-vcc5v0-usb {
221		compatible = "regulator-fixed";
222		regulator-name = "vcc5v0_usb";
223		regulator-always-on;
224		regulator-boot-on;
225		regulator-min-microvolt = <5000000>;
226		regulator-max-microvolt = <5000000>;
227		vin-supply = <&vcc12v_dcin>;
228	};
229
230	vcca_0v9: regulator-vcca-0v9 {
231		compatible = "regulator-fixed";
232		regulator-name = "vcca_0v9";
233		regulator-always-on;
234		regulator-boot-on;
235		regulator-min-microvolt = <900000>;
236		regulator-max-microvolt = <900000>;
237		vin-supply = <&vcc3v3_sys>;
238	};
239
240	vdd_log: regulator-vdd-log {
241		compatible = "pwm-regulator";
242		pwms = <&pwm2 0 25000 1>;
243		pwm-supply = <&vcc5v0_sys>;
244		regulator-name = "vdd_log";
245		regulator-always-on;
246		regulator-boot-on;
247		regulator-min-microvolt = <800000>;
248		regulator-max-microvolt = <1700000>;
249	};
250};
251
252&cpu_l0 {
253	cpu-supply = <&vdd_cpu_l>;
254};
255
256&cpu_l1 {
257	cpu-supply = <&vdd_cpu_l>;
258};
259
260&cpu_l2 {
261	cpu-supply = <&vdd_cpu_l>;
262};
263
264&cpu_l3 {
265	cpu-supply = <&vdd_cpu_l>;
266};
267
268&cpu_b0 {
269	cpu-supply = <&vdd_cpu_b>;
270};
271
272&cpu_b1 {
273	cpu-supply = <&vdd_cpu_b>;
274};
275
276&cpu_thermal {
277	trips {
278		cpu_warm: cpu_warm {
279			temperature = <55000>;
280			hysteresis = <2000>;
281			type = "active";
282		};
283
284		cpu_hot: cpu_hot {
285			temperature = <65000>;
286			hysteresis = <2000>;
287			type = "active";
288		};
289	};
290
291	cooling-maps {
292		map2 {
293			trip = <&cpu_warm>;
294			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
295		};
296
297		map3 {
298			trip = <&cpu_hot>;
299			cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
300		};
301	};
302};
303
304&emmc_phy {
305	status = "okay";
306};
307
308&gmac {
309	assigned-clocks = <&cru SCLK_RMII_SRC>;
310	assigned-clock-parents = <&clkin_gmac>;
311	clock_in_out = "input";
312	phy-supply = <&vcc_lan>;
313	phy-mode = "rgmii";
314	pinctrl-names = "default";
315	pinctrl-0 = <&rgmii_pins>;
316	snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
317	snps,reset-active-low;
318	snps,reset-delays-us = <0 10000 50000>;
319	tx_delay = <0x28>;
320	rx_delay = <0x11>;
321	status = "okay";
322};
323
324&hdmi {
325	avdd-0v9-supply = <&vcca_0v9>;
326	avdd-1v8-supply = <&vcc1v8_dvp>;
327	ddc-i2c-bus = <&i2c3>;
328	pinctrl-names = "default";
329	pinctrl-0 = <&hdmi_cec>;
330	status = "okay";
331};
332
333&hdmi_sound {
334	status = "okay";
335};
336
337&gpu {
338	mali-supply = <&vdd_gpu>;
339	status = "okay";
340};
341
342&i2c0 {
343	clock-frequency = <400000>;
344	i2c-scl-rising-time-ns = <168>;
345	i2c-scl-falling-time-ns = <4>;
346	status = "okay";
347
348	rk808: pmic@1b {
349		compatible = "rockchip,rk808";
350		reg = <0x1b>;
351		interrupt-parent = <&gpio3>;
352		interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
353		#clock-cells = <1>;
354		clock-output-names = "xin32k", "rk808-clkout2";
355		pinctrl-names = "default";
356		pinctrl-0 = <&pmic_int_l>;
357		system-power-controller;
358		wakeup-source;
359
360		vcc1-supply = <&vcc5v0_sys>;
361		vcc2-supply = <&vcc5v0_sys>;
362		vcc3-supply = <&vcc5v0_sys>;
363		vcc4-supply = <&vcc5v0_sys>;
364		vcc6-supply = <&vcc5v0_sys>;
365		vcc7-supply = <&vcc5v0_sys>;
366		vcc8-supply = <&vcc3v3_sys>;
367		vcc9-supply = <&vcc5v0_sys>;
368		vcc10-supply = <&vcc5v0_sys>;
369		vcc11-supply = <&vcc5v0_sys>;
370		vcc12-supply = <&vcc3v3_sys>;
371		vddio-supply = <&vcca_1v8>;
372
373		regulators {
374			vdd_center: DCDC_REG1 {
375				regulator-name = "vdd_center";
376				regulator-always-on;
377				regulator-boot-on;
378				regulator-min-microvolt = <750000>;
379				regulator-max-microvolt = <1350000>;
380				regulator-ramp-delay = <6001>;
381				regulator-state-mem {
382					regulator-off-in-suspend;
383				};
384			};
385
386			vdd_cpu_l: DCDC_REG2 {
387				regulator-name = "vdd_cpu_l";
388				regulator-always-on;
389				regulator-boot-on;
390				regulator-min-microvolt = <750000>;
391				regulator-max-microvolt = <1350000>;
392				regulator-ramp-delay = <6001>;
393				regulator-state-mem {
394					regulator-off-in-suspend;
395				};
396			};
397
398			vcc_ddr: DCDC_REG3 {
399				regulator-name = "vcc_ddr";
400				regulator-always-on;
401				regulator-boot-on;
402				regulator-state-mem {
403					regulator-on-in-suspend;
404				};
405			};
406
407			vcc_1v8: DCDC_REG4 {
408				regulator-name = "vcc_1v8";
409				regulator-always-on;
410				regulator-boot-on;
411				regulator-min-microvolt = <1800000>;
412				regulator-max-microvolt = <1800000>;
413				regulator-state-mem {
414					regulator-on-in-suspend;
415					regulator-suspend-microvolt = <1800000>;
416				};
417			};
418
419			vcc1v8_dvp: LDO_REG1 {
420				regulator-name = "vcc1v8_dvp";
421				regulator-always-on;
422				regulator-boot-on;
423				regulator-min-microvolt = <1800000>;
424				regulator-max-microvolt = <1800000>;
425				regulator-state-mem {
426					regulator-off-in-suspend;
427				};
428			};
429
430			vcc3v0_touch: LDO_REG2 {
431				regulator-name = "vcc3v0_touch";
432				regulator-min-microvolt = <3000000>;
433				regulator-max-microvolt = <3000000>;
434				regulator-state-mem {
435					regulator-off-in-suspend;
436				};
437			};
438
439			vcca_1v8: LDO_REG3 {
440				regulator-name = "vcca_1v8";
441				regulator-always-on;
442				regulator-boot-on;
443				regulator-min-microvolt = <1800000>;
444				regulator-max-microvolt = <1800000>;
445				regulator-state-mem {
446					regulator-on-in-suspend;
447					regulator-suspend-microvolt = <1800000>;
448				};
449			};
450
451			vcc_sdio: LDO_REG4 {
452				regulator-name = "vcc_sdio";
453				regulator-always-on;
454				regulator-boot-on;
455				regulator-min-microvolt = <1800000>;
456				regulator-max-microvolt = <3000000>;
457				regulator-state-mem {
458					regulator-on-in-suspend;
459					regulator-suspend-microvolt = <3000000>;
460				};
461			};
462
463			vcca3v0_codec: LDO_REG5 {
464				regulator-name = "vcca3v0_codec";
465				regulator-always-on;
466				regulator-boot-on;
467				regulator-min-microvolt = <3000000>;
468				regulator-max-microvolt = <3000000>;
469				regulator-state-mem {
470					regulator-off-in-suspend;
471				};
472			};
473
474			vcc_1v5: LDO_REG6 {
475				regulator-name = "vcc_1v5";
476				regulator-always-on;
477				regulator-boot-on;
478				regulator-min-microvolt = <1500000>;
479				regulator-max-microvolt = <1500000>;
480				regulator-state-mem {
481					regulator-on-in-suspend;
482					regulator-suspend-microvolt = <1500000>;
483				};
484			};
485
486			vcca1v8_codec: LDO_REG7 {
487				regulator-name = "vcca1v8_codec";
488				regulator-always-on;
489				regulator-boot-on;
490				regulator-min-microvolt = <1800000>;
491				regulator-max-microvolt = <1800000>;
492				regulator-state-mem {
493					regulator-off-in-suspend;
494				};
495			};
496
497			vcc_3v0: LDO_REG8 {
498				regulator-name = "vcc_3v0";
499				regulator-always-on;
500				regulator-boot-on;
501				regulator-min-microvolt = <3000000>;
502				regulator-max-microvolt = <3000000>;
503				regulator-state-mem {
504					regulator-on-in-suspend;
505					regulator-suspend-microvolt = <3000000>;
506				};
507			};
508
509			vcc3v3_s3: vcc_lan: SWITCH_REG1 {
510				regulator-name = "vcc3v3_s3";
511				regulator-always-on;
512				regulator-boot-on;
513				regulator-state-mem {
514					regulator-off-in-suspend;
515				};
516			};
517
518			vcc3v3_s0: SWITCH_REG2 {
519				regulator-name = "vcc3v3_s0";
520				regulator-state-mem {
521					regulator-off-in-suspend;
522				};
523			};
524		};
525	};
526
527	vdd_cpu_b: regulator@40 {
528		compatible = "silergy,syr827";
529		reg = <0x40>;
530		fcs,suspend-voltage-selector = <1>;
531		pinctrl-names = "default";
532		pinctrl-0 = <&vsel1_pin>;
533		regulator-name = "vdd_cpu_b";
534		regulator-min-microvolt = <712500>;
535		regulator-max-microvolt = <1500000>;
536		regulator-ramp-delay = <1000>;
537		regulator-always-on;
538		regulator-boot-on;
539		vin-supply = <&vcc5v0_sys>;
540
541		regulator-state-mem {
542			regulator-off-in-suspend;
543		};
544	};
545
546	vdd_gpu: regulator@41 {
547		compatible = "silergy,syr828";
548		reg = <0x41>;
549		fcs,suspend-voltage-selector = <1>;
550		pinctrl-names = "default";
551		pinctrl-0 = <&vsel2_pin>;
552		regulator-name = "vdd_gpu";
553		regulator-min-microvolt = <712500>;
554		regulator-max-microvolt = <1500000>;
555		regulator-ramp-delay = <1000>;
556		regulator-always-on;
557		regulator-boot-on;
558		vin-supply = <&vcc5v0_sys>;
559
560		regulator-state-mem {
561			regulator-off-in-suspend;
562		};
563	};
564};
565
566&i2c1 {
567	i2c-scl-rising-time-ns = <300>;
568	i2c-scl-falling-time-ns = <15>;
569	status = "okay";
570};
571
572&i2c3 {
573	i2c-scl-rising-time-ns = <450>;
574	i2c-scl-falling-time-ns = <15>;
575	status = "okay";
576};
577
578&i2c4 {
579	i2c-scl-rising-time-ns = <600>;
580	i2c-scl-falling-time-ns = <20>;
581	status = "okay";
582
583	fusb0: typec-portc@22 {
584		compatible = "fcs,fusb302";
585		reg = <0x22>;
586		interrupt-parent = <&gpio1>;
587		interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
588		pinctrl-names = "default";
589		pinctrl-0 = <&fusb0_int>;
590		vbus-supply = <&vcc5v0_typec>;
591		status = "okay";
592	};
593
594	/* enable for pine64 touch screen support */
595	touch: touchscreen@5d {
596		compatible = "goodix,gt911";
597		reg = <0x5d>;
598		interrupt-parent = <&gpio4>;
599		interrupts = <RK_PD5 IRQ_TYPE_EDGE_FALLING>;
600		AVDD28-supply = <&vcc3v0_touch>;
601		VDDIO-supply = <&vcc3v0_touch>;
602		irq-gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>;
603		reset-gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_HIGH>;
604		status = "disabled";
605	};
606};
607
608&i2s0 {
609	rockchip,playback-channels = <8>;
610	rockchip,capture-channels = <8>;
611	status = "okay";
612};
613
614&i2s1 {
615	rockchip,playback-channels = <2>;
616	rockchip,capture-channels = <2>;
617	status = "okay";
618
619	i2s1_p0: port {
620		i2s1_p0_0: endpoint {
621			dai-format = "i2s";
622			mclk-fs = <256>;
623			remote-endpoint = <&es8316_p0_0>;
624		};
625	};
626};
627
628&i2s2 {
629	status = "okay";
630};
631
632&io_domains {
633	status = "okay";
634
635	bt656-supply = <&vcc1v8_dvp>;
636	audio-supply = <&vcc_3v0>;
637	sdmmc-supply = <&vcc_sdio>;
638	gpio1830-supply = <&vcc_3v0>;
639};
640
641/* enable for pine64 panel display support */
642&mipi_dsi {
643	clock-master;
644	status = "disabled";
645
646	ports {
647		mipi_out: port@1 {
648			reg = <1>;
649
650			mipi_out_panel: endpoint {
651				remote-endpoint = <&mipi_in_panel>;
652			};
653		};
654	};
655
656	mipi_panel: panel@0 {
657		compatible = "feiyang,fy07024di26a30d";
658		reg = <0>;
659		avdd-supply = <&avdd>;
660		backlight = <&backlight>;
661		dvdd-supply = <&vcc3v3_s0>;
662
663		port {
664			mipi_in_panel: endpoint {
665				remote-endpoint = <&mipi_out_panel>;
666			};
667		};
668	};
669};
670
671&pcie0 {
672	ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
673	num-lanes = <4>;
674	pinctrl-names = "default";
675	pinctrl-0 = <&pcie_perst>;
676	vpcie0v9-supply = <&vcca_0v9>;
677	vpcie1v8-supply = <&vcca_1v8>;
678	vpcie12v-supply = <&vcc12v_dcin>;
679	vpcie3v3-supply = <&vcc3v3_pcie>;
680	status = "okay";
681};
682
683&pcie_phy {
684	status = "okay";
685};
686
687&pmu_io_domains {
688	pmu1830-supply = <&vcc_3v0>;
689	status = "okay";
690};
691
692&pinctrl {
693	bt {
694		bt_enable_h: bt-enable-h {
695			rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
696		};
697
698		bt_host_wake_l: bt-host-wake-l {
699			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>;
700		};
701
702		bt_wake_l: bt-wake-l {
703			rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
704		};
705	};
706
707	buttons {
708		pwrbtn: pwrbtn {
709			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
710		};
711	};
712
713	fusb302x {
714		fusb0_int: fusb0-int {
715			rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
716		};
717	};
718
719	ir {
720		ir_int: ir-int {
721			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
722		};
723	};
724
725	leds {
726		work_led_pin: work-led-pin {
727			rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
728		};
729
730		diy_led_pin: diy-led-pin {
731			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
732		};
733	};
734
735	pcie {
736		pcie_perst: pcie-perst {
737			rockchip,pins = <2 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
738		};
739
740		pcie_pwr_en: pcie-pwr-en {
741			rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
742		};
743	};
744
745	pmic {
746		pmic_int_l: pmic-int-l {
747			rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
748		};
749
750		vsel1_pin: vsel1-pin {
751			rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
752		};
753
754		vsel2_pin: vsel2-pin {
755			rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
756		};
757	};
758
759	sdcard {
760		sdmmc0_pwr_h: sdmmc0-pwr-h {
761			rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
762		};
763
764	};
765
766	sdio-pwrseq {
767		wifi_enable_h: wifi-enable-h {
768			rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
769		};
770	};
771
772	usb-typec {
773		vcc5v0_typec_en: vcc5v0_typec_en {
774			rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
775		};
776	};
777
778	usb2 {
779		vcc5v0_host_en: vcc5v0-host-en {
780			rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
781		};
782	};
783};
784
785&pwm0 {
786	status = "okay";
787};
788
789&pwm1 {
790	status = "okay";
791};
792
793&pwm2 {
794	status = "okay";
795};
796
797&saradc {
798	vref-supply = <&vcca1v8_s3>;
799	status = "okay";
800};
801
802&sdio0 {
803	bus-width = <4>;
804	cap-sd-highspeed;
805	cap-sdio-irq;
806	disable-wp;
807	keep-power-in-suspend;
808	mmc-pwrseq = <&sdio_pwrseq>;
809	non-removable;
810	pinctrl-names = "default";
811	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
812	sd-uhs-sdr104;
813	status = "okay";
814};
815
816&sdmmc {
817	bus-width = <4>;
818	cap-sd-highspeed;
819	cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
820	disable-wp;
821	max-frequency = <150000000>;
822	pinctrl-names = "default";
823	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
824	vmmc-supply = <&vcc3v0_sd>;
825	vqmmc-supply = <&vcc_sdio>;
826	status = "okay";
827};
828
829&sdhci {
830	bus-width = <8>;
831	mmc-hs200-1_8v;
832	non-removable;
833	status = "okay";
834};
835
836&spdif {
837	pinctrl-0 = <&spdif_bus_1>;
838
839	spdif_p0: port {
840		spdif_p0_0: endpoint {
841			remote-endpoint = <&dit_p0_0>;
842		};
843	};
844};
845
846&spi1 {
847	status = "okay";
848
849	flash@0 {
850		compatible = "jedec,spi-nor";
851		reg = <0>;
852		spi-max-frequency = <10000000>;
853	};
854};
855
856&tcphy0 {
857	status = "okay";
858};
859
860&tcphy1 {
861	status = "okay";
862};
863
864&tsadc {
865	/* tshut mode 0:CRU 1:GPIO */
866	rockchip,hw-tshut-mode = <1>;
867	/* tshut polarity 0:LOW 1:HIGH */
868	rockchip,hw-tshut-polarity = <1>;
869	status = "okay";
870};
871
872&u2phy0 {
873	status = "okay";
874
875	u2phy0_otg: otg-port {
876		status = "okay";
877	};
878
879	u2phy0_host: host-port {
880		phy-supply = <&vcc5v0_host>;
881		status = "okay";
882	};
883};
884
885&u2phy1 {
886	status = "okay";
887
888	u2phy1_otg: otg-port {
889		status = "okay";
890	};
891
892	u2phy1_host: host-port {
893		phy-supply = <&vcc5v0_host>;
894		status = "okay";
895	};
896};
897
898&uart0 {
899	pinctrl-names = "default";
900	pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
901	status = "okay";
902
903	bluetooth {
904		compatible = "brcm,bcm43438-bt";
905		clocks = <&rk808 1>;
906		clock-names = "lpo";
907		device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
908		host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
909		shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
910		pinctrl-names = "default";
911		pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
912		vbat-supply = <&vcc3v3_sys>;
913		vddio-supply = <&vcc_1v8>;
914	};
915};
916
917&uart2 {
918	status = "okay";
919};
920
921&usb_host0_ehci {
922	status = "okay";
923};
924
925&usb_host0_ohci {
926	status = "okay";
927};
928
929&usb_host1_ehci {
930	status = "okay";
931};
932
933&usb_host1_ohci {
934	status = "okay";
935};
936
937&usbdrd3_0 {
938	status = "okay";
939};
940
941&usbdrd_dwc3_0 {
942	status = "okay";
943	dr_mode = "host";
944};
945
946&usbdrd3_1 {
947	status = "okay";
948};
949
950&usbdrd_dwc3_1 {
951	status = "okay";
952	dr_mode = "host";
953};
954
955&vopb {
956	status = "okay";
957};
958
959&vopb_mmu {
960	status = "okay";
961};
962
963&vopl {
964	status = "okay";
965};
966
967&vopl_mmu {
968	status = "okay";
969};
970