xref: /linux/arch/arm64/boot/dts/rockchip/rk3588-rock-5-itx.dts (revision fcc79e1714e8c2b8e216dc3149812edd37884eef)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2024 Radxa Limited
4 * Copyright (c) 2024 Heiko Stuebner <heiko@sntech.de>
5 */
6
7/dts-v1/;
8
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/input/input.h>
11#include <dt-bindings/leds/common.h>
12#include <dt-bindings/pinctrl/rockchip.h>
13#include <dt-bindings/pwm/pwm.h>
14#include "dt-bindings/usb/pd.h"
15#include "rk3588.dtsi"
16
17/ {
18	model = "Radxa ROCK 5 ITX";
19	compatible = "radxa,rock-5-itx", "rockchip,rk3588";
20
21	aliases {
22		mmc0 = &sdhci;
23		mmc1 = &sdmmc;
24		mmc2 = &sdio;
25	};
26
27	chosen {
28		stdout-path = "serial2:1500000n8";
29	};
30
31	adc_keys: adc-keys {
32		compatible = "adc-keys";
33		io-channels = <&saradc 0>;
34		io-channel-names = "buttons";
35		keyup-threshold-microvolt = <1800000>;
36		poll-interval = <100>;
37
38		button-maskrom {
39			label = "Mask Rom";
40			linux,code = <KEY_SETUP>;
41			press-threshold-microvolt = <1750>;
42		};
43	};
44
45	analog-sound {
46		compatible = "audio-graph-card";
47		label = "rk3588-es8316";
48		dais = <&i2s0_8ch_p0>;
49		hp-det-gpios = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>;
50		pinctrl-names = "default";
51		pinctrl-0 = <&hp_detect>;
52		routing = "MIC2", "Mic Jack",
53			  "Headphones", "HPOL",
54			  "Headphones", "HPOR";
55		widgets = "Microphone", "Mic Jack",
56			  "Headphone", "Headphones";
57	};
58
59	gpio-leds {
60		compatible = "gpio-leds";
61		pinctrl-names = "default";
62		pinctrl-0 = <&led_pins>;
63
64		power-led1 {
65			gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
66			linux,default-trigger = "default-on";
67		};
68
69		hdd-led2 {
70			gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>;
71			linux,default-trigger = "disk-activity";
72		};
73	};
74
75	/* Unnamed gated oscillator: 100MHz,3.3V,3225 */
76	pcie30_port0_refclk: pcie30_port1_refclk: pcie-oscillator {
77		compatible = "gated-fixed-clock";
78		#clock-cells = <0>;
79		clock-frequency = <100000000>;
80		clock-output-names = "pcie30_refclk";
81		vdd-supply = <&vcc3v3_pi6c_05>;
82	};
83
84	fan0: pwm-fan {
85		compatible = "pwm-fan";
86		#cooling-cells = <2>;
87		cooling-levels = <0 64 128 192 255>;
88		fan-supply = <&vcc12v_dcin>;
89		pwms = <&pwm14 0 10000 0>;
90	};
91
92	/* M.2 E-KEY */
93	sdio_pwrseq: sdio-pwrseq {
94		compatible = "mmc-pwrseq-simple";
95		clocks = <&hym8563>;
96		clock-names = "ext_clock";
97		pinctrl-names = "default";
98		pinctrl-0 = <&wifi_enable_h>;
99		reset-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_LOW>;
100	};
101
102	typec_vin: regulator-typec-vin {
103		compatible = "regulator-fixed";
104		enable-active-high;
105		gpio = <&gpio1 RK_PB6 GPIO_ACTIVE_HIGH>;
106		pinctrl-names = "default";
107		pinctrl-0 = <&vbus5v0_typec_en>;
108		regulator-name = "typec_vin";
109		regulator-min-microvolt = <5000000>;
110		regulator-max-microvolt = <5000000>;
111		vin-supply = <&vcc5v0_sys>;
112	};
113
114	vcc12v_dcin: regulator-vcc12v-dcin {
115		compatible = "regulator-fixed";
116		regulator-name = "vcc12v_dcin";
117		regulator-always-on;
118		regulator-boot-on;
119		regulator-min-microvolt = <12000000>;
120		regulator-max-microvolt = <12000000>;
121	};
122
123	vcc33_io64: regulator-vcc33-io64 {
124		compatible = "regulator-fixed";
125		regulator-name = "vcc33_io64";
126		regulator-always-on;
127		regulator-boot-on;
128		regulator-min-microvolt = <3300000>;
129		regulator-max-microvolt = <3300000>;
130		vin-supply = <&vcc12v_dcin>;
131	};
132
133	vcc3v3_ekey: regulator-vcc3v3-ekey {
134		compatible = "regulator-fixed";
135		enable-active-high;
136		gpios = <&gpio1 RK_PD2 GPIO_ACTIVE_HIGH>;
137		pinctrl-names = "default";
138		pinctrl-0 = <&ekey_en>;
139		regulator-name = "vcc3v3_ekey";
140		regulator-always-on;
141		regulator-boot-on;
142		regulator-min-microvolt = <3300000>;
143		regulator-max-microvolt = <3300000>;
144		startup-delay-us = <50000>;
145		vin-supply = <&vcc5v0_sys>;
146	};
147
148	vcc3v3_lan: vcc3v3_lan_phy2: regulator-vcc3v3-lan {
149		compatible = "regulator-fixed";
150		regulator-name = "vcc3v3_lan";
151		regulator-always-on;
152		regulator-boot-on;
153		regulator-min-microvolt = <3300000>;
154		regulator-max-microvolt = <3300000>;
155		vin-supply = <&vcc_3v3_s3>;
156	};
157
158	/* The PCIE30x4_PWREN_H controls two regulators */
159	vcc3v3_mkey: vcc3v3_pi6c_05: regulator-vcc3v3-pi6c-05 {
160		compatible = "regulator-fixed";
161		enable-active-high;
162		gpios = <&gpio1 RK_PA4 GPIO_ACTIVE_HIGH>;
163		pinctrl-names = "default";
164		pinctrl-0 = <&pcie30x4_pwren_h>;
165		regulator-name = "vcc3v3_pi6c_05";
166		regulator-min-microvolt = <3300000>;
167		regulator-max-microvolt = <3300000>;
168		startup-delay-us = <5000>;
169		vin-supply = <&vcc5v0_sys>;
170	};
171
172	vcc3v3_sys: regulator-vcc3v3-sys {
173		compatible = "regulator-fixed";
174		regulator-name = "vcc3v3_sys";
175		regulator-always-on;
176		regulator-boot-on;
177		regulator-min-microvolt = <3300000>;
178		regulator-max-microvolt = <3300000>;
179		vin-supply = <&vcc12v_dcin>;
180	};
181
182	vcc5v0_sys: regulator-vcc5v0-sys {
183		compatible = "regulator-fixed";
184		regulator-name = "vcc5v0_sys";
185		regulator-always-on;
186		regulator-boot-on;
187		regulator-min-microvolt = <5000000>;
188		regulator-max-microvolt = <5000000>;
189		vin-supply = <&vcc12v_dcin>;
190	};
191
192	vcc5v0_usb20: vcc5v0_usb12: vcc5v0_usb34: regulator-vcc5v0-usb {
193		compatible = "regulator-fixed";
194		enable-active-high;
195		gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_HIGH>;
196		pinctrl-names = "default";
197		pinctrl-0 = <&usb_host_pwren_h>;
198		regulator-name = "vcc5v0_usb";
199		regulator-min-microvolt = <5000000>;
200		regulator-max-microvolt = <5000000>;
201		vin-supply = <&vcc5v0_sys>;
202	};
203
204	vcc_1v1_nldo_s3: regulator-vcc-1v1-nldo-s3 {
205		compatible = "regulator-fixed";
206		regulator-name = "vcc_1v1_nldo_s3";
207		regulator-always-on;
208		regulator-boot-on;
209		regulator-min-microvolt = <1100000>;
210		regulator-max-microvolt = <1100000>;
211		vin-supply = <&vcc5v0_sys>;
212	};
213};
214
215&combphy0_ps {
216	status = "okay";
217};
218
219&combphy1_ps {
220	status = "okay";
221};
222
223&combphy2_psu {
224	status = "okay";
225};
226
227&cpu_b0 {
228	cpu-supply = <&vdd_cpu_big0_s0>;
229};
230
231&cpu_b1 {
232	cpu-supply = <&vdd_cpu_big0_s0>;
233};
234
235&cpu_b2 {
236	cpu-supply = <&vdd_cpu_big1_s0>;
237};
238
239&cpu_b3 {
240	cpu-supply = <&vdd_cpu_big1_s0>;
241};
242
243&cpu_l0 {
244	cpu-supply = <&vdd_cpu_lit_s0>;
245};
246
247&cpu_l1 {
248	cpu-supply = <&vdd_cpu_lit_s0>;
249};
250
251&cpu_l2 {
252	cpu-supply = <&vdd_cpu_lit_s0>;
253};
254
255&cpu_l3 {
256	cpu-supply = <&vdd_cpu_lit_s0>;
257};
258
259&gpu {
260	mali-supply = <&vdd_gpu_s0>;
261	status = "okay";
262};
263
264&i2c0 {
265	pinctrl-names = "default";
266	pinctrl-0 = <&i2c0m2_xfer>;
267	status = "okay";
268
269	vdd_cpu_big0_s0: regulator@42 {
270		compatible = "rockchip,rk8602";
271		reg = <0x42>;
272		fcs,suspend-voltage-selector = <1>;
273		regulator-name = "vdd_cpu_big0_s0";
274		regulator-always-on;
275		regulator-boot-on;
276		regulator-min-microvolt = <550000>;
277		regulator-max-microvolt = <1050000>;
278		regulator-ramp-delay = <2300>;
279		vin-supply = <&vcc5v0_sys>;
280
281		regulator-state-mem {
282			regulator-off-in-suspend;
283		};
284	};
285
286	vdd_cpu_big1_s0: regulator@43 {
287		compatible = "rockchip,rk8603", "rockchip,rk8602";
288		reg = <0x43>;
289		fcs,suspend-voltage-selector = <1>;
290		regulator-name = "vdd_cpu_big1_s0";
291		regulator-always-on;
292		regulator-boot-on;
293		regulator-min-microvolt = <550000>;
294		regulator-max-microvolt = <1050000>;
295		regulator-ramp-delay = <2300>;
296		vin-supply = <&vcc5v0_sys>;
297
298		regulator-state-mem {
299			regulator-off-in-suspend;
300		};
301	};
302};
303
304&i2c1 {
305	pinctrl-names = "default";
306	pinctrl-0 = <&i2c1m2_xfer>;
307	status = "okay";
308
309	vdd_npu_s0: regulator@42 {
310		compatible = "rockchip,rk8602";
311		reg = <0x42>;
312		fcs,suspend-voltage-selector = <1>;
313		regulator-name = "vdd_npu_s0";
314		regulator-always-on;
315		regulator-boot-on;
316		regulator-min-microvolt = <550000>;
317		regulator-max-microvolt = <950000>;
318		regulator-ramp-delay = <2300>;
319		vin-supply = <&vcc5v0_sys>;
320
321		regulator-state-mem {
322			regulator-off-in-suspend;
323		};
324	};
325};
326
327/* CAM0 connector */
328&i2c3 {
329	pinctrl-names = "default";
330	pinctrl-0 = <&i2c3m0_xfer>;
331};
332
333/* M.2 E-key */
334&i2c4 {
335	pinctrl-names = "default";
336	pinctrl-0 = <&i2c4m1_xfer>;
337};
338
339/* RTC and LCD0 connector */
340&i2c6 {
341	pinctrl-names = "default";
342	pinctrl-0 = <&i2c6m0_xfer>;
343	status = "okay";
344
345	hym8563: rtc@51 {
346		compatible = "haoyu,hym8563";
347		reg = <0x51>;
348		#clock-cells = <0>;
349		clock-output-names = "wifi_32kout";
350		interrupt-parent = <&gpio0>;
351		interrupts = <RK_PB0 IRQ_TYPE_LEVEL_LOW>;
352		pinctrl-names = "default";
353		pinctrl-0 = <&rtc_int>;
354	};
355};
356
357/* Audio codec and CAM1 connector */
358&i2c7 {
359	pinctrl-names = "default";
360	pinctrl-0 = <&i2c7m0_xfer>;
361	status = "okay";
362
363	es8316: audio-codec@11 {
364		compatible = "everest,es8316";
365		reg = <0x11>;
366		assigned-clocks = <&cru I2S0_8CH_MCLKOUT>;
367		assigned-clock-rates = <12288000>;
368		clocks = <&cru I2S0_8CH_MCLKOUT>;
369		clock-names = "mclk";
370		#sound-dai-cells = <0>;
371
372		port {
373			es8316_p0_0: endpoint {
374				remote-endpoint = <&i2s0_8ch_p0_0>;
375			};
376		};
377	};
378};
379
380/* FUSB302 and LCD1 connector */
381&i2c8 {
382	pinctrl-names = "default";
383	pinctrl-0 = <&i2c8m4_xfer>;
384	status = "okay";
385
386	usbc0: usb-typec@22 {
387		compatible = "fcs,fusb302";
388		reg = <0x22>;
389		interrupt-parent = <&gpio3>;
390		interrupts = <RK_PB4 IRQ_TYPE_LEVEL_LOW>;
391		pinctrl-names = "default";
392		pinctrl-0 = <&usbc0_int>;
393		vbus-supply = <&typec_vin>;
394
395		usb_con: connector {
396			compatible = "usb-c-connector";
397			data-role = "dual";
398			label = "USB-C";
399			power-role = "source";
400			source-pdos =
401				<PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
402
403			ports {
404				#address-cells = <1>;
405				#size-cells = <0>;
406
407				port@0 {
408					reg = <0>;
409
410					usbc0_orien_sw: endpoint {
411						remote-endpoint = <&usbdp_phy0_orientation_switch>;
412					};
413				};
414
415				port@1 {
416					reg = <1>;
417
418					usbc0_role_sw: endpoint {
419						remote-endpoint = <&dwc3_0_role_switch>;
420					};
421				};
422
423				port@2 {
424					reg = <2>;
425
426					dp_altmode_mux: endpoint {
427						remote-endpoint = <&usbdp_phy0_dp_altmode_mux>;
428					};
429				};
430			};
431		};
432	};
433};
434
435&i2c8m4_xfer {
436	rockchip,pins =
437		/* i2c8_scl_m4 */
438		<3 RK_PC2 9 &pcfg_pull_up_drv_level_6>,
439		/* i2c8_sda_m4 */
440		<3 RK_PC3 9 &pcfg_pull_up_drv_level_6>;
441};
442
443&i2s0_8ch {
444	pinctrl-names = "default";
445	pinctrl-0 = <&i2s0_lrck
446		     &i2s0_mclk
447		     &i2s0_sclk
448		     &i2s0_sdi0
449		     &i2s0_sdo0>;
450	status = "okay";
451
452	i2s0_8ch_p0: port {
453		i2s0_8ch_p0_0: endpoint {
454			dai-format = "i2s";
455			mclk-fs = <256>;
456			remote-endpoint = <&es8316_p0_0>;
457		};
458	};
459};
460
461&package_thermal {
462	polling-delay = <1000>;
463
464	trips {
465		package_fan0: package-fan0 {
466			hysteresis = <2000>;
467			temperature = <50000>;
468			type = "active";
469		};
470
471		package_fan1: package-fan1 {
472			hysteresis = <2000>;
473			temperature = <65000>;
474			type = "active";
475		};
476	};
477
478	cooling-maps {
479		map0 {
480			cooling-device = <&fan0 THERMAL_NO_LIMIT 1>;
481			trip = <&package_fan0>;
482		};
483		map1 {
484			cooling-device = <&fan0 2 THERMAL_NO_LIMIT>;
485			trip = <&package_fan1>;
486		};
487	};
488};
489
490/* M.2 E-key */
491&pcie2x1l0 {
492	pinctrl-names = "default";
493	pinctrl-0 = <&pcie30x1_0_perstn_m1_l>;
494	reset-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>;
495	vpcie3v3-supply = <&vcc3v3_ekey>;
496	status = "okay";
497};
498
499/* RTL8125B_1 */
500&pcie2x1l1 {
501	pinctrl-names = "default";
502	pinctrl-0 = <&pcie30x1_1_perstn>;
503	reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>;
504	vpcie3v3-supply = <&vcc3v3_lan>;
505	status = "okay";
506};
507
508/* RTL8125B_2 */
509&pcie2x1l2 {
510	pinctrl-names = "default";
511	pinctrl-0 = <&pcie20x1_2_perstn>;
512	reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>;
513	vpcie3v3-supply = <&vcc3v3_lan_phy2>;
514	status = "okay";
515};
516
517&pcie30phy {
518	data-lanes = <1 1 2 2>;
519	/* separate clock lines from the clock generator to phy and devices */
520	rockchip,rx-common-refclk-mode = <0 0 0 0>;
521	status = "okay";
522};
523
524/* ASMedia ASM1164 Sata controller */
525&pcie3x2 {
526	/*
527	 * The board has a "pcie_refclk" oscillator that needs enabling,
528	 * so add it to the list of clocks.
529	 */
530	clocks = <&cru ACLK_PCIE_2L_MSTR>, <&cru ACLK_PCIE_2L_SLV>,
531		 <&cru ACLK_PCIE_2L_DBI>, <&cru PCLK_PCIE_2L>,
532		 <&cru CLK_PCIE_AUX1>, <&cru CLK_PCIE2L_PIPE>,
533		 <&pcie30_port1_refclk>;
534	clock-names = "aclk_mst", "aclk_slv",
535		      "aclk_dbi", "pclk",
536		      "aux", "pipe",
537		      "ref";
538	pinctrl-names = "default";
539	pinctrl-0 = <&pcie30x2_perstn_m1_l>;
540	reset-gpios = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>;
541	vpcie3v3-supply = <&vcc33_io64>;
542	status = "okay";
543};
544
545/* M.2 M.key */
546&pcie3x4 {
547	/*
548	 * The board has a "pcie_refclk" oscillator that needs enabling,
549	 * so add it to the list of clocks.
550	 */
551	clocks = <&cru ACLK_PCIE_4L_MSTR>, <&cru ACLK_PCIE_4L_SLV>,
552		 <&cru ACLK_PCIE_4L_DBI>, <&cru PCLK_PCIE_4L>,
553		 <&cru CLK_PCIE_AUX0>, <&cru CLK_PCIE4L_PIPE>,
554		 <&pcie30_port0_refclk>;
555	clock-names = "aclk_mst", "aclk_slv",
556		      "aclk_dbi", "pclk",
557		      "aux", "pipe",
558		      "ref";
559	num-lanes = <2>;
560	pinctrl-names = "default";
561	pinctrl-0 = <&pcie30x4_perstn_m1_l>;
562	reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>;
563	vpcie3v3-supply = <&vcc3v3_mkey>;
564	status = "okay";
565};
566
567&pinctrl {
568	hym8563 {
569		rtc_int: rtc-int {
570			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
571		};
572	};
573
574	leds {
575		led_pins: led-pins {
576			rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>,
577					<0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
578		};
579	};
580
581	pcie {
582		pcie20x1_2_perstn: pcie20x1-2-perstn {
583			rockchip,pins = <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
584		};
585
586		pcie30x1_0_perstn_m1_l: pcie30x1-0-perstn-m1-l {
587			rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
588		};
589
590		pcie30x1_1_perstn: pcie30x1-1-perstn {
591			rockchip,pins = <4 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
592		};
593
594		pcie30x2_perstn_m1_l: pcie30x2-perstn-m1-l {
595			rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
596		};
597
598		pcie30x4_perstn_m1_l: pcie30x4-perstn-m1-l {
599			rockchip,pins = <4 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
600		};
601
602		ekey_en: ekey-en {
603			rockchip,pins = <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_down>;
604		};
605
606		pcie30x4_pwren_h: pcie30x4-pwren-h {
607			rockchip,pins = <1 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>;
608		};
609	};
610
611	sound {
612		hp_detect: hp-detect {
613			rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_down>;
614		};
615	};
616
617	usb {
618		usb_host_pwren_h: usb-host-pwren-h {
619			rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
620		};
621
622		vcc5v0_otg_en: vcc5v0-otg-en {
623			rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
624		};
625
626		gl3523_reset: rl3523-reset {
627			rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
628		};
629	};
630
631	usb-typec {
632		usbc0_int: usbc0-int {
633			rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>;
634		};
635
636		vbus5v0_typec_en: vbus5v0-typec-en {
637			rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
638		};
639	};
640
641	hdmirx {
642		hdmirx_det: hdmirx-det {
643			rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
644		};
645	};
646
647	sdio-pwrseq {
648		wifi_enable_h: wifi-enable-h {
649			rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
650		};
651	};
652
653	wireless-wlan {
654		wifi_host_wake_irq: wifi-host-wake-irq {
655			rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_down>;
656		};
657	};
658
659	bt {
660		bt_enable_h: bt-enable-h {
661			rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
662		};
663
664		bt_host_wake_l: bt-host-wake-l {
665			rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
666		};
667
668		bt_wake_l: bt-wake-l {
669			rockchip,pins = <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
670		};
671	};
672
673	dp {
674		dp1_hpd: dp1-hpd {
675			rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
676		};
677	};
678};
679
680&pwm14 {
681	pinctrl-names = "default";
682	pinctrl-0 = <&pwm14m1_pins>;
683	status = "okay";
684};
685
686&saradc {
687	vref-supply = <&avcc_1v8_s0>;
688	status = "okay";
689};
690
691&sdhci {
692	bus-width = <8>;
693	max-frequency = <200000000>;
694	mmc-hs400-1_8v;
695	mmc-hs400-enhanced-strobe;
696	mmc-hs200-1_8v;
697	no-sdio;
698	no-sd;
699	non-removable;
700	status = "okay";
701};
702
703&sdmmc {
704	bus-width = <4>;
705	cap-mmc-highspeed;
706	cap-sd-highspeed;
707	disable-wp;
708	max-frequency = <200000000>;
709	no-sdio;
710	no-mmc;
711	pinctrl-names = "default";
712	pinctrl-0 = <&sdmmc_bus4 &sdmmc_clk &sdmmc_cmd &sdmmc_det>;
713	sd-uhs-sdr104;
714	vmmc-supply = <&vcc_3v3_s3>;
715	vqmmc-supply = <&vccio_sd_s0>;
716	status = "okay";
717};
718
719/* M.2 E-KEY */
720&sdio {
721	broken-cd;
722	bus-width = <4>;
723	cap-sdio-irq;
724	keep-power-in-suspend;
725	max-frequency = <150000000>;
726	mmc-pwrseq = <&sdio_pwrseq>;
727	no-sd;
728	no-mmc;
729	non-removable;
730	pinctrl-names = "default";
731	pinctrl-0 = <&sdiom0_pins>;
732	sd-uhs-sdr104;
733	vmmc-supply = <&vcc3v3_ekey>;
734	status = "okay";
735};
736
737&sfc {
738	pinctrl-names = "default";
739	pinctrl-0 = <&fspim2_pins>;
740	status = "okay";
741
742	spi_flash: flash@0 {
743		compatible = "jedec,spi-nor";
744		reg = <0x0>;
745		spi-max-frequency = <50000000>;
746		spi-rx-bus-width = <4>;
747		spi-tx-bus-width = <1>;
748	};
749};
750
751&spi2 {
752	status = "okay";
753	assigned-clocks = <&cru CLK_SPI2>;
754	assigned-clock-rates = <200000000>;
755	num-cs = <1>;
756	pinctrl-names = "default";
757	pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>;
758
759	pmic@0 {
760		compatible = "rockchip,rk806";
761		reg = <0x0>;
762		gpio-controller;
763		#gpio-cells = <2>;
764		interrupt-parent = <&gpio0>;
765		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
766		pinctrl-names = "default";
767		pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
768			    <&rk806_dvs2_null>, <&rk806_dvs3_null>;
769		spi-max-frequency = <1000000>;
770		system-power-controller;
771
772		vcc1-supply = <&vcc5v0_sys>;
773		vcc2-supply = <&vcc5v0_sys>;
774		vcc3-supply = <&vcc5v0_sys>;
775		vcc4-supply = <&vcc5v0_sys>;
776		vcc5-supply = <&vcc5v0_sys>;
777		vcc6-supply = <&vcc5v0_sys>;
778		vcc7-supply = <&vcc5v0_sys>;
779		vcc8-supply = <&vcc5v0_sys>;
780		vcc9-supply = <&vcc5v0_sys>;
781		vcc10-supply = <&vcc5v0_sys>;
782		vcc11-supply = <&vcc_2v0_pldo_s3>;
783		vcc12-supply = <&vcc5v0_sys>;
784		vcc13-supply = <&vcc_1v1_nldo_s3>;
785		vcc14-supply = <&vcc_1v1_nldo_s3>;
786		vcca-supply = <&vcc5v0_sys>;
787
788		rk806_dvs1_null: dvs1-null-pins {
789			pins = "gpio_pwrctrl1";
790			function = "pin_fun0";
791		};
792
793		rk806_dvs2_null: dvs2-null-pins {
794			pins = "gpio_pwrctrl2";
795			function = "pin_fun0";
796		};
797
798		rk806_dvs3_null: dvs3-null-pins {
799			pins = "gpio_pwrctrl3";
800			function = "pin_fun0";
801		};
802
803		regulators {
804			vdd_gpu_s0: vdd_gpu_mem_s0: dcdc-reg1 {
805				regulator-boot-on;
806				regulator-min-microvolt = <550000>;
807				regulator-max-microvolt = <950000>;
808				regulator-ramp-delay = <12500>;
809				regulator-name = "vdd_gpu_s0";
810				regulator-enable-ramp-delay = <400>;
811
812				regulator-state-mem {
813					regulator-off-in-suspend;
814				};
815			};
816
817			vdd_cpu_lit_s0: vdd_cpu_lit_mem_s0: dcdc-reg2 {
818				regulator-always-on;
819				regulator-boot-on;
820				regulator-min-microvolt = <550000>;
821				regulator-max-microvolt = <950000>;
822				regulator-ramp-delay = <12500>;
823				regulator-name = "vdd_cpu_lit_s0";
824
825				regulator-state-mem {
826					regulator-off-in-suspend;
827				};
828			};
829
830			vdd_log_s0: dcdc-reg3 {
831				regulator-always-on;
832				regulator-boot-on;
833				regulator-min-microvolt = <675000>;
834				regulator-max-microvolt = <750000>;
835				regulator-ramp-delay = <12500>;
836				regulator-name = "vdd_log_s0";
837
838				regulator-state-mem {
839					regulator-on-in-suspend;
840					regulator-suspend-microvolt = <750000>;
841				};
842			};
843
844			vdd_vdenc_s0: vdd_vdenc_mem_s0: dcdc-reg4 {
845				regulator-always-on;
846				regulator-boot-on;
847				regulator-min-microvolt = <550000>;
848				regulator-max-microvolt = <950000>;
849				regulator-ramp-delay = <12500>;
850				regulator-name = "vdd_vdenc_s0";
851
852				regulator-state-mem {
853					regulator-off-in-suspend;
854				};
855			};
856
857			vdd_ddr_s0: dcdc-reg5 {
858				regulator-always-on;
859				regulator-boot-on;
860				regulator-min-microvolt = <675000>;
861				regulator-max-microvolt = <900000>;
862				regulator-ramp-delay = <12500>;
863				regulator-name = "vdd_ddr_s0";
864
865				regulator-state-mem {
866					regulator-off-in-suspend;
867					regulator-suspend-microvolt = <850000>;
868				};
869			};
870
871			vdd2_ddr_s3: dcdc-reg6 {
872				regulator-always-on;
873				regulator-boot-on;
874				regulator-name = "vdd2_ddr_s3";
875
876				regulator-state-mem {
877					regulator-on-in-suspend;
878				};
879			};
880
881			vcc_2v0_pldo_s3: dcdc-reg7 {
882				regulator-always-on;
883				regulator-boot-on;
884				regulator-min-microvolt = <2000000>;
885				regulator-max-microvolt = <2000000>;
886				regulator-ramp-delay = <12500>;
887				regulator-name = "vdd_2v0_pldo_s3";
888
889				regulator-state-mem {
890					regulator-on-in-suspend;
891					regulator-suspend-microvolt = <2000000>;
892				};
893			};
894
895			vcc_3v3_s3: dcdc-reg8 {
896				regulator-always-on;
897				regulator-boot-on;
898				regulator-min-microvolt = <3300000>;
899				regulator-max-microvolt = <3300000>;
900				regulator-name = "vcc_3v3_s3";
901
902				regulator-state-mem {
903					regulator-on-in-suspend;
904					regulator-suspend-microvolt = <3300000>;
905				};
906			};
907
908			vddq_ddr_s0: dcdc-reg9 {
909				regulator-always-on;
910				regulator-boot-on;
911				regulator-name = "vddq_ddr_s0";
912
913				regulator-state-mem {
914					regulator-off-in-suspend;
915				};
916			};
917
918			vcc_1v8_s3: dcdc-reg10 {
919				regulator-always-on;
920				regulator-boot-on;
921				regulator-min-microvolt = <1800000>;
922				regulator-max-microvolt = <1800000>;
923				regulator-name = "vcc_1v8_s3";
924
925				regulator-state-mem {
926					regulator-on-in-suspend;
927					regulator-suspend-microvolt = <1800000>;
928				};
929			};
930
931			avcc_1v8_s0: pldo-reg1 {
932				regulator-always-on;
933				regulator-boot-on;
934				regulator-min-microvolt = <1800000>;
935				regulator-max-microvolt = <1800000>;
936				regulator-name = "avcc_1v8_s0";
937
938				regulator-state-mem {
939					regulator-on-in-suspend;
940					regulator-suspend-microvolt = <1800000>;
941				};
942			};
943
944			vcc_1v8_s0: pldo-reg2 {
945				regulator-always-on;
946				regulator-boot-on;
947				regulator-min-microvolt = <1800000>;
948				regulator-max-microvolt = <1800000>;
949				regulator-name = "vcc_1v8_s0";
950
951				regulator-state-mem {
952					regulator-on-in-suspend;
953					regulator-suspend-microvolt = <1800000>;
954				};
955			};
956
957			avdd_1v2_s0: pldo-reg3 {
958				regulator-always-on;
959				regulator-boot-on;
960				regulator-min-microvolt = <1200000>;
961				regulator-max-microvolt = <1200000>;
962				regulator-name = "avdd_1v2_s0";
963
964				regulator-state-mem {
965					regulator-off-in-suspend;
966				};
967			};
968
969			vcc_3v3_s0: pldo-reg4 {
970				regulator-always-on;
971				regulator-boot-on;
972				regulator-min-microvolt = <3300000>;
973				regulator-max-microvolt = <3300000>;
974				regulator-ramp-delay = <12500>;
975				regulator-name = "vcc_3v3_s0";
976
977				regulator-state-mem {
978					regulator-on-in-suspend;
979					regulator-suspend-microvolt = <3300000>;
980				};
981			};
982
983			vccio_sd_s0: pldo-reg5 {
984				regulator-always-on;
985				regulator-boot-on;
986				regulator-min-microvolt = <1800000>;
987				regulator-max-microvolt = <3300000>;
988				regulator-ramp-delay = <12500>;
989				regulator-name = "vccio_sd_s0";
990
991				regulator-state-mem {
992					regulator-off-in-suspend;
993				};
994			};
995
996			pldo6_s3: pldo-reg6 {
997				regulator-always-on;
998				regulator-boot-on;
999				regulator-min-microvolt = <1800000>;
1000				regulator-max-microvolt = <1800000>;
1001				regulator-name = "pldo6_s3";
1002
1003				regulator-state-mem {
1004					regulator-on-in-suspend;
1005					regulator-suspend-microvolt = <1800000>;
1006				};
1007			};
1008
1009			vdd_0v75_s3: nldo-reg1 {
1010				regulator-always-on;
1011				regulator-boot-on;
1012				regulator-min-microvolt = <750000>;
1013				regulator-max-microvolt = <750000>;
1014				regulator-name = "vdd_0v75_s3";
1015
1016				regulator-state-mem {
1017					regulator-on-in-suspend;
1018					regulator-suspend-microvolt = <750000>;
1019				};
1020			};
1021
1022			vdd_ddr_pll_s0: nldo-reg2 {
1023				regulator-always-on;
1024				regulator-boot-on;
1025				regulator-min-microvolt = <850000>;
1026				regulator-max-microvolt = <850000>;
1027				regulator-name = "vdd_ddr_pll_s0";
1028
1029				regulator-state-mem {
1030					regulator-on-in-suspend;
1031					regulator-suspend-microvolt = <850000>;
1032				};
1033			};
1034
1035			avdd_0v75_s0: nldo-reg3 {
1036				regulator-always-on;
1037				regulator-boot-on;
1038				regulator-min-microvolt = <750000>;
1039				regulator-max-microvolt = <750000>;
1040				regulator-name = "avdd_0v75_s0";
1041
1042				regulator-state-mem {
1043					regulator-off-in-suspend;
1044				};
1045			};
1046
1047			vdd_0v85_s0: nldo-reg4 {
1048				regulator-always-on;
1049				regulator-boot-on;
1050				regulator-min-microvolt = <850000>;
1051				regulator-max-microvolt = <850000>;
1052				regulator-name = "vdd_0v85_s0";
1053
1054				regulator-state-mem {
1055					regulator-on-in-suspend;
1056					regulator-suspend-microvolt = <837500>;
1057				};
1058			};
1059
1060			vdd_0v75_s0: nldo-reg5 {
1061				regulator-always-on;
1062				regulator-boot-on;
1063				regulator-min-microvolt = <750000>;
1064				regulator-max-microvolt = <750000>;
1065				regulator-name = "vdd_0v75_s0";
1066
1067				regulator-state-mem {
1068					regulator-on-in-suspend;
1069					regulator-suspend-microvolt = <750000>;
1070				};
1071			};
1072		};
1073	};
1074};
1075
1076&tsadc {
1077	status = "okay";
1078};
1079
1080&uart2 {
1081	pinctrl-0 = <&uart2m0_xfer>;
1082	status = "okay";
1083};
1084
1085/* Connected to M.2 E-key */
1086&uart6 {
1087	pinctrl-names = "default";
1088	pinctrl-0 = <&uart6m1_xfer &uart6m1_ctsn &uart6m1_rtsn>;
1089	status = "okay";
1090};
1091
1092&u2phy0 {
1093	status = "okay";
1094};
1095
1096&u2phy0_otg {
1097	status = "okay";
1098};
1099
1100&u2phy1 {
1101	status = "okay";
1102};
1103
1104&u2phy1_otg {
1105	/* connected to USB3 hub, which is powered by vcc5v0_usb12 */
1106	phy-supply = <&vcc5v0_usb12>;
1107	status = "okay";
1108};
1109
1110&u2phy2 {
1111	status = "okay";
1112};
1113
1114&u2phy2_host {
1115	/* connected to USB2 hub, which is powered by vcc5v0_usb20 */
1116	phy-supply = <&vcc5v0_usb20>;
1117	status = "okay";
1118};
1119
1120&u2phy3 {
1121	status = "okay";
1122};
1123
1124&u2phy3_host {
1125	phy-supply = <&vcc5v0_usb20>;
1126	status = "okay";
1127};
1128
1129&usb_host0_ehci {
1130	status = "okay";
1131};
1132
1133&usb_host0_ohci {
1134	status = "okay";
1135};
1136
1137&usb_host1_ehci {
1138	status = "okay";
1139};
1140
1141&usb_host1_ohci {
1142	status = "okay";
1143};
1144
1145&usb_host0_xhci {
1146	usb-role-switch;
1147	status = "okay";
1148
1149	port {
1150		#address-cells = <1>;
1151		#size-cells = <0>;
1152
1153		dwc3_0_role_switch: endpoint@0 {
1154			reg = <0>;
1155			remote-endpoint = <&usbc0_role_sw>;
1156		};
1157	};
1158};
1159
1160&usb_host1_xhci {
1161	dr_mode = "host";
1162	#address-cells = <1>;
1163	#size-cells = <0>;
1164	status = "okay";
1165
1166	/* 2.0 hub on port 1 */
1167	hub_2_0: hub@1 {
1168		compatible = "usb5e3,610";
1169		reg = <1>;
1170		peer-hub = <&hub_3_0>;
1171		vdd-supply = <&vcc_3v3_s3>;
1172	};
1173
1174	/* 3.0 hub on port 4 */
1175	hub_3_0: hub@2 {
1176		compatible = "usb5e3,620";
1177		reg = <2>;
1178		peer-hub = <&hub_2_0>;
1179		pinctrl-names = "default";
1180		pinctrl-0 = <&gl3523_reset>;
1181		reset-gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_LOW>;
1182		vdd-supply = <&vcc_3v3_s3>;
1183	};
1184};
1185
1186&usbdp_phy0 {
1187	mode-switch;
1188	orientation-switch;
1189	sbu1-dc-gpios = <&gpio4 RK_PB7 GPIO_ACTIVE_HIGH>;
1190	sbu2-dc-gpios = <&gpio4 RK_PC0 GPIO_ACTIVE_HIGH>;
1191	status = "okay";
1192
1193	port {
1194		#address-cells = <1>;
1195		#size-cells = <0>;
1196		usbdp_phy0_orientation_switch: endpoint@0 {
1197			reg = <0>;
1198			remote-endpoint = <&usbc0_orien_sw>;
1199		};
1200
1201		usbdp_phy0_dp_altmode_mux: endpoint@1 {
1202			reg = <1>;
1203			remote-endpoint = <&dp_altmode_mux>;
1204		};
1205	};
1206};
1207
1208&usbdp_phy1 {
1209	rockchip,dp-lane-mux = <2 3>;
1210	status = "okay";
1211};
1212