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 <Akash_Gajjar@mentor.com>
5 * Copyright (c) 2020 Tobias Schramm <t.schramm@manjaro.org>
6 */
7
8/dts-v1/;
9#include <dt-bindings/input/gpio-keys.h>
10#include <dt-bindings/input/linux-event-codes.h>
11#include <dt-bindings/pwm/pwm.h>
12#include <dt-bindings/usb/pd.h>
13#include <dt-bindings/leds/common.h>
14#include "rk3399.dtsi"
15#include "rk3399-opp.dtsi"
16
17/ {
18	model = "Pine64 Pinebook Pro";
19	compatible = "pine64,pinebook-pro", "rockchip,rk3399";
20
21	chosen {
22		stdout-path = "serial2:1500000n8";
23	};
24
25	backlight: edp-backlight {
26		compatible = "pwm-backlight";
27		power-supply = <&vcc_12v>;
28		pwms = <&pwm0 0 740740 0>;
29	};
30
31	bat: battery {
32		compatible = "simple-battery";
33		charge-full-design-microamp-hours = <9800000>;
34		voltage-max-design-microvolt = <4350000>;
35		voltage-min-design-microvolt = <3000000>;
36	};
37
38	edp_panel: edp-panel {
39		compatible = "boe,nv140fhmn49";
40		backlight = <&backlight>;
41		enable-gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
42		pinctrl-names = "default";
43		pinctrl-0 = <&panel_en_pin>;
44		power-supply = <&vcc3v3_panel>;
45
46		ports {
47			#address-cells = <1>;
48			#size-cells = <0>;
49
50			port@0 {
51				reg = <0>;
52				#address-cells = <1>;
53				#size-cells = <0>;
54
55				panel_in_edp: endpoint@0 {
56					reg = <0>;
57					remote-endpoint = <&edp_out_panel>;
58				};
59			};
60		};
61	};
62
63	/*
64	 * Use separate nodes for gpio-keys to allow for selective deactivation
65	 * of wakeup sources via sysfs without disabling the whole key
66	 */
67	gpio-key-lid {
68		compatible = "gpio-keys";
69		pinctrl-names = "default";
70		pinctrl-0 = <&lidbtn_pin>;
71
72		lid {
73			debounce-interval = <20>;
74			gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_LOW>;
75			label = "Lid";
76			linux,code = <SW_LID>;
77			linux,input-type = <EV_SW>;
78			wakeup-event-action = <EV_ACT_DEASSERTED>;
79			wakeup-source;
80		};
81	};
82
83	gpio-key-power {
84		compatible = "gpio-keys";
85		pinctrl-names = "default";
86		pinctrl-0 = <&pwrbtn_pin>;
87
88		power {
89			debounce-interval = <20>;
90			gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
91			label = "Power";
92			linux,code = <KEY_POWER>;
93			wakeup-source;
94		};
95	};
96
97	leds {
98		compatible = "gpio-leds";
99		pinctrl-names = "default";
100		pinctrl-0 = <&pwr_led_pin &slp_led_pin>;
101
102		green_led: led-0 {
103			color = <LED_COLOR_ID_GREEN>;
104			default-state = "on";
105			function = LED_FUNCTION_POWER;
106			gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>;
107			label = "green:power";
108		};
109
110		red_led: led-1 {
111			color = <LED_COLOR_ID_RED>;
112			default-state = "off";
113			function = LED_FUNCTION_STANDBY;
114			gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
115			label = "red:standby";
116			panic-indicator;
117			retain-state-suspended;
118		};
119	};
120
121	/* Power sequence for SDIO WiFi module */
122	sdio_pwrseq: sdio-pwrseq {
123		compatible = "mmc-pwrseq-simple";
124		clocks = <&rk808 1>;
125		clock-names = "ext_clock";
126		pinctrl-names = "default";
127		pinctrl-0 = <&wifi_enable_h_pin>;
128		post-power-on-delay-ms = <100>;
129		power-off-delay-us = <500000>;
130
131		/* WL_REG_ON on module */
132		reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
133	};
134
135	/* Audio components */
136	es8316-sound {
137		compatible = "simple-audio-card";
138		pinctrl-names = "default";
139		pinctrl-0 = <&hp_det_pin>;
140		simple-audio-card,name = "rockchip,es8316-codec";
141		simple-audio-card,format = "i2s";
142		simple-audio-card,mclk-fs = <256>;
143
144		simple-audio-card,widgets =
145			"Microphone", "Mic Jack",
146			"Headphone", "Headphones",
147			"Speaker", "Speaker";
148		simple-audio-card,routing =
149			"MIC1", "Mic Jack",
150			"Headphones", "HPOL",
151			"Headphones", "HPOR",
152			"Speaker Amplifier INL", "HPOL",
153			"Speaker Amplifier INR", "HPOR",
154			"Speaker", "Speaker Amplifier OUTL",
155			"Speaker", "Speaker Amplifier OUTR";
156
157		simple-audio-card,hp-det-gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>;
158		simple-audio-card,aux-devs = <&speaker_amp>;
159		simple-audio-card,pin-switches = "Speaker";
160
161		simple-audio-card,cpu {
162			sound-dai = <&i2s1>;
163		};
164
165		simple-audio-card,codec {
166			sound-dai = <&es8316>;
167		};
168	};
169
170	speaker_amp: speaker-amplifier {
171		compatible = "simple-audio-amplifier";
172		enable-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_HIGH>;
173		sound-name-prefix = "Speaker Amplifier";
174		VCC-supply = <&pa_5v>;
175	};
176
177	/* Power tree */
178	/* Root power source */
179	vcc_sysin: vcc-sysin {
180		compatible = "regulator-fixed";
181		regulator-name = "vcc_sysin";
182		regulator-always-on;
183		regulator-boot-on;
184	};
185
186	/* Regulators supplied by vcc_sysin */
187	/* LCD backlight supply */
188	vcc_12v: vcc-12v {
189		compatible = "regulator-fixed";
190		regulator-name = "vcc_12v";
191		regulator-always-on;
192		regulator-boot-on;
193		regulator-min-microvolt = <12000000>;
194		regulator-max-microvolt = <12000000>;
195		vin-supply = <&vcc_sysin>;
196
197		regulator-state-mem {
198			regulator-off-in-suspend;
199		};
200	};
201
202	/* Main 3.3 V supply */
203	vcc3v3_sys: wifi_bat: vcc3v3-sys {
204		compatible = "regulator-fixed";
205		regulator-name = "vcc3v3_sys";
206		regulator-always-on;
207		regulator-boot-on;
208		regulator-min-microvolt = <3300000>;
209		regulator-max-microvolt = <3300000>;
210		vin-supply = <&vcc_sysin>;
211
212		regulator-state-mem {
213			regulator-on-in-suspend;
214		};
215	};
216
217	/* 5 V USB power supply */
218	vcc5v0_usb: pa_5v: vcc5v0-usb-regulator {
219		compatible = "regulator-fixed";
220		enable-active-high;
221		gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
222		pinctrl-names = "default";
223		pinctrl-0 = <&pwr_5v_pin>;
224		regulator-name = "vcc5v0_usb";
225		regulator-always-on;
226		regulator-min-microvolt = <5000000>;
227		regulator-max-microvolt = <5000000>;
228		vin-supply = <&vcc_sysin>;
229
230		regulator-state-mem {
231			regulator-off-in-suspend;
232		};
233	};
234
235	/* RK3399 logic supply */
236	vdd_log: vdd-log {
237		compatible = "pwm-regulator";
238		pwms = <&pwm2 0 25000 1>;
239		regulator-name = "vdd_log";
240		regulator-always-on;
241		regulator-boot-on;
242		regulator-min-microvolt = <800000>;
243		regulator-max-microvolt = <1400000>;
244		vin-supply = <&vcc_sysin>;
245
246		regulator-state-mem {
247			regulator-on-in-suspend;
248		};
249	};
250
251	/* Regulators supplied by vcc3v3_sys */
252	/* 0.9 V supply, always on */
253	vcc_0v9: vcc-0v9 {
254		compatible = "regulator-fixed";
255		regulator-name = "vcc_0v9";
256		regulator-always-on;
257		regulator-boot-on;
258		regulator-min-microvolt = <900000>;
259		regulator-max-microvolt = <900000>;
260		vin-supply = <&vcc3v3_sys>;
261	};
262
263	/* S3 1.8 V supply, switched by vcc1v8_s3 */
264	vcca1v8_s3: vcc1v8-s3 {
265		compatible = "regulator-fixed";
266		regulator-name = "vcca1v8_s3";
267		regulator-always-on;
268		regulator-boot-on;
269		regulator-min-microvolt = <1800000>;
270		regulator-max-microvolt = <1800000>;
271		vin-supply = <&vcc3v3_sys>;
272	};
273
274	/* micro SD card power */
275	vcc3v0_sd: vcc3v0-sd {
276		compatible = "regulator-fixed";
277		enable-active-high;
278		gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
279		pinctrl-names = "default";
280		pinctrl-0 = <&sdmmc0_pwr_h_pin>;
281		regulator-name = "vcc3v0_sd";
282		regulator-always-on;
283		regulator-min-microvolt = <3000000>;
284		regulator-max-microvolt = <3000000>;
285		vin-supply = <&vcc3v3_sys>;
286
287		regulator-state-mem {
288			regulator-off-in-suspend;
289		};
290	};
291
292	/* LCD panel power, called VCC3V3_S0 in schematic */
293	vcc3v3_panel: vcc3v3-panel {
294		compatible = "regulator-fixed";
295		enable-active-high;
296		gpio = <&gpio1 RK_PC6 GPIO_ACTIVE_HIGH>;
297		pinctrl-names = "default";
298		pinctrl-0 = <&lcdvcc_en_pin>;
299		regulator-name = "vcc3v3_panel";
300		regulator-always-on;
301		regulator-min-microvolt = <3300000>;
302		regulator-max-microvolt = <3300000>;
303		regulator-enable-ramp-delay = <100000>;
304		vin-supply = <&vcc3v3_sys>;
305
306		regulator-state-mem {
307			regulator-off-in-suspend;
308		};
309	};
310
311	/* M.2 adapter power, switched by vcc1v8_s3 */
312	vcc3v3_ssd: vcc3v3-ssd {
313		compatible = "regulator-fixed";
314		regulator-name = "vcc3v3_ssd";
315		regulator-min-microvolt = <3300000>;
316		regulator-max-microvolt = <3300000>;
317		vin-supply = <&vcc3v3_sys>;
318	};
319
320	/* Regulators supplied by vcc5v0_usb */
321	/* USB 3 port power supply regulator  */
322	vcc5v0_otg: vcc5v0-otg {
323		compatible = "regulator-fixed";
324		enable-active-high;
325		gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
326		pinctrl-names = "default";
327		pinctrl-0 = <&vcc5v0_host_en_pin>;
328		regulator-name = "vcc5v0_otg";
329		regulator-always-on;
330		regulator-min-microvolt = <5000000>;
331		regulator-max-microvolt = <5000000>;
332		vin-supply = <&vcc5v0_usb>;
333
334		regulator-state-mem {
335			regulator-off-in-suspend;
336		};
337	};
338
339	/* Regulators supplied by vcc5v0_usb */
340	/* Type C port power supply regulator */
341	vbus_5vout: vbus_typec: vbus-5vout {
342		compatible = "regulator-fixed";
343		enable-active-high;
344		gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
345		pinctrl-names = "default";
346		pinctrl-0 = <&vcc5v0_typec0_en_pin>;
347		regulator-name = "vbus_5vout";
348		regulator-min-microvolt = <5000000>;
349		regulator-max-microvolt = <5000000>;
350		vin-supply = <&vcc5v0_usb>;
351
352		regulator-state-mem {
353			regulator-off-in-suspend;
354		};
355	};
356
357	/* Regulators supplied by vcc_1v8 */
358	/* Primary 0.9 V LDO */
359	vcca0v9_s3: vcca0v9-s3 {
360		compatible = "regulator-fixed";
361		regulator-name = "vcc0v9_s3";
362		regulator-min-microvolt = <5000000>;
363		regulator-max-microvolt = <5000000>;
364		vin-supply = <&vcc_1v8>;
365
366		regulator-state-mem {
367			regulator-on-in-suspend;
368		};
369	};
370
371	mains_charger: dc-charger {
372		compatible = "gpio-charger";
373		charger-type = "mains";
374		gpios = <&gpio4 RK_PD0 GPIO_ACTIVE_LOW>;
375
376		/* Also triggered by USB charger */
377		pinctrl-names = "default";
378		pinctrl-0 = <&dc_det_pin>;
379	};
380};
381
382&cdn_dp {
383	status = "okay";
384};
385
386&cpu_b0 {
387	cpu-supply = <&vdd_cpu_b>;
388};
389
390&cpu_b1 {
391	cpu-supply = <&vdd_cpu_b>;
392};
393
394&cpu_l0 {
395	cpu-supply = <&vdd_cpu_l>;
396};
397
398&cpu_l1 {
399	cpu-supply = <&vdd_cpu_l>;
400};
401
402&cpu_l2 {
403	cpu-supply = <&vdd_cpu_l>;
404};
405
406&cpu_l3 {
407	cpu-supply = <&vdd_cpu_l>;
408};
409
410&edp {
411	force-hpd;
412	pinctrl-names = "default";
413	pinctrl-0 = <&edp_hpd>;
414	status = "okay";
415
416	ports {
417		edp_out: port@1 {
418			reg = <1>;
419			#address-cells = <1>;
420			#size-cells = <0>;
421
422			edp_out_panel: endpoint@0 {
423				reg = <0>;
424				remote-endpoint = <&panel_in_edp>;
425			};
426		};
427	};
428};
429
430&emmc_phy {
431	status = "okay";
432};
433
434&gpu {
435	mali-supply = <&vdd_gpu>;
436	status = "okay";
437};
438
439&hdmi_sound {
440	status = "okay";
441};
442
443&i2c0 {
444	clock-frequency = <400000>;
445	i2c-scl-falling-time-ns = <4>;
446	i2c-scl-rising-time-ns = <168>;
447	status = "okay";
448
449	rk808: pmic@1b {
450		compatible = "rockchip,rk808";
451		reg = <0x1b>;
452		#clock-cells = <1>;
453		clock-output-names = "xin32k", "rk808-clkout2";
454		interrupt-parent = <&gpio3>;
455		interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
456		pinctrl-names = "default";
457		pinctrl-0 = <&pmic_int_l_pin>;
458		rockchip,system-power-controller;
459		wakeup-source;
460
461		vcc1-supply = <&vcc_sysin>;
462		vcc2-supply = <&vcc_sysin>;
463		vcc3-supply = <&vcc_sysin>;
464		vcc4-supply = <&vcc_sysin>;
465		vcc6-supply = <&vcc_sysin>;
466		vcc7-supply = <&vcc_sysin>;
467		vcc8-supply = <&vcc3v3_sys>;
468		vcc9-supply = <&vcc_sysin>;
469		vcc10-supply = <&vcc_sysin>;
470		vcc11-supply = <&vcc_sysin>;
471		vcc12-supply = <&vcc3v3_sys>;
472		vcc13-supply = <&vcc_sysin>;
473		vcc14-supply = <&vcc_sysin>;
474
475		regulators {
476			/* rk3399 center logic supply */
477			vdd_center: DCDC_REG1 {
478				regulator-name = "vdd_center";
479				regulator-always-on;
480				regulator-boot-on;
481				regulator-min-microvolt = <750000>;
482				regulator-max-microvolt = <1350000>;
483				regulator-ramp-delay = <6001>;
484
485				regulator-state-mem {
486					regulator-off-in-suspend;
487				};
488			};
489
490			vdd_cpu_l: DCDC_REG2 {
491				regulator-name = "vdd_cpu_l";
492				regulator-always-on;
493				regulator-boot-on;
494				regulator-min-microvolt = <750000>;
495				regulator-max-microvolt = <1350000>;
496				regulator-ramp-delay = <6001>;
497
498				regulator-state-mem {
499					regulator-off-in-suspend;
500				};
501			};
502
503			vcc_ddr: DCDC_REG3 {
504				regulator-name = "vcc_ddr";
505				regulator-always-on;
506				regulator-boot-on;
507
508				regulator-state-mem {
509					regulator-on-in-suspend;
510				};
511			};
512
513			vcc_1v8: vcc_wl: DCDC_REG4 {
514				regulator-name = "vcc_1v8";
515				regulator-always-on;
516				regulator-boot-on;
517				regulator-min-microvolt = <1800000>;
518				regulator-max-microvolt = <1800000>;
519
520				regulator-state-mem {
521					regulator-on-in-suspend;
522					regulator-suspend-microvolt = <1800000>;
523				};
524			};
525
526			/* not used */
527			LDO_REG1 {
528			};
529
530			/* not used */
531			LDO_REG2 {
532			};
533
534			vcc1v8_pmupll: LDO_REG3 {
535				regulator-name = "vcc1v8_pmupll";
536				regulator-always-on;
537				regulator-boot-on;
538				regulator-min-microvolt = <1800000>;
539				regulator-max-microvolt = <1800000>;
540
541				regulator-state-mem {
542					regulator-on-in-suspend;
543					regulator-suspend-microvolt = <1800000>;
544				};
545			};
546
547			vcc_sdio: LDO_REG4 {
548				regulator-name = "vcc_sdio";
549				regulator-always-on;
550				regulator-boot-on;
551				regulator-min-microvolt = <1800000>;
552				regulator-max-microvolt = <3000000>;
553
554				regulator-state-mem {
555					regulator-on-in-suspend;
556					regulator-suspend-microvolt = <3000000>;
557				};
558			};
559
560			vcca3v0_codec: LDO_REG5 {
561				regulator-name = "vcca3v0_codec";
562				regulator-always-on;
563				regulator-boot-on;
564				regulator-min-microvolt = <3000000>;
565				regulator-max-microvolt = <3000000>;
566
567				regulator-state-mem {
568					regulator-off-in-suspend;
569				};
570			};
571
572			vcc_1v5: LDO_REG6 {
573				regulator-name = "vcc_1v5";
574				regulator-always-on;
575				regulator-boot-on;
576				regulator-min-microvolt = <1500000>;
577				regulator-max-microvolt = <1500000>;
578
579				regulator-state-mem {
580					regulator-on-in-suspend;
581					regulator-suspend-microvolt = <1500000>;
582				};
583			};
584
585			vcca1v8_codec: LDO_REG7 {
586				regulator-name = "vcca1v8_codec";
587				regulator-always-on;
588				regulator-boot-on;
589				regulator-min-microvolt = <1800000>;
590				regulator-max-microvolt = <1800000>;
591
592				regulator-state-mem {
593					regulator-off-in-suspend;
594				};
595			};
596
597			vcc_3v0: LDO_REG8 {
598				regulator-name = "vcc_3v0";
599				regulator-always-on;
600				regulator-boot-on;
601				regulator-min-microvolt = <3000000>;
602				regulator-max-microvolt = <3000000>;
603
604				regulator-state-mem {
605					regulator-on-in-suspend;
606					regulator-suspend-microvolt = <3000000>;
607				};
608			};
609
610			vcc3v3_s3: SWITCH_REG1 {
611				regulator-name = "vcc3v3_s3";
612				regulator-always-on;
613				regulator-boot-on;
614
615				regulator-state-mem {
616					regulator-off-in-suspend;
617				};
618			};
619
620			vcc3v3_s0: SWITCH_REG2 {
621				regulator-name = "vcc3v3_s0";
622				regulator-always-on;
623				regulator-boot-on;
624
625				regulator-state-mem {
626					regulator-off-in-suspend;
627				};
628			};
629		};
630	};
631
632	vdd_cpu_b: regulator@40 {
633		compatible = "silergy,syr827";
634		reg = <0x40>;
635		fcs,suspend-voltage-selector = <1>;
636		pinctrl-names = "default";
637		pinctrl-0 = <&vsel1_pin>;
638		regulator-name = "vdd_cpu_b";
639		regulator-always-on;
640		regulator-boot-on;
641		regulator-min-microvolt = <712500>;
642		regulator-max-microvolt = <1500000>;
643		regulator-ramp-delay = <1000>;
644		vin-supply = <&vcc_1v8>;
645
646		regulator-state-mem {
647			regulator-off-in-suspend;
648		};
649	};
650
651	vdd_gpu: regulator@41 {
652		compatible = "silergy,syr828";
653		reg = <0x41>;
654		fcs,suspend-voltage-selector = <1>;
655		pinctrl-names = "default";
656		pinctrl-0 = <&vsel2_pin>;
657		regulator-name = "vdd_gpu";
658		regulator-always-on;
659		regulator-boot-on;
660		regulator-min-microvolt = <712500>;
661		regulator-max-microvolt = <1500000>;
662		regulator-ramp-delay = <1000>;
663		vin-supply = <&vcc_1v8>;
664
665		regulator-state-mem {
666			regulator-off-in-suspend;
667		};
668	};
669};
670
671&i2c1 {
672	clock-frequency = <100000>;
673	i2c-scl-falling-time-ns = <4>;
674	i2c-scl-rising-time-ns = <168>;
675	status = "okay";
676
677	es8316: es8316@11 {
678		compatible = "everest,es8316";
679		reg = <0x11>;
680		clocks = <&cru SCLK_I2S_8CH_OUT>;
681		clock-names = "mclk";
682		#sound-dai-cells = <0>;
683	};
684};
685
686&i2c3 {
687	i2c-scl-falling-time-ns = <15>;
688	i2c-scl-rising-time-ns = <450>;
689	status = "okay";
690};
691
692&i2c4 {
693	i2c-scl-falling-time-ns = <20>;
694	i2c-scl-rising-time-ns = <600>;
695	status = "okay";
696
697	fusb0: fusb30x@22 {
698		compatible = "fcs,fusb302";
699		reg = <0x22>;
700		interrupt-parent = <&gpio1>;
701		interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
702		pinctrl-names = "default";
703		pinctrl-0 = <&fusb0_int_pin>;
704		vbus-supply = <&vbus_typec>;
705
706		connector {
707			compatible = "usb-c-connector";
708			data-role = "host";
709			label = "USB-C";
710			op-sink-microwatt = <1000000>;
711			power-role = "dual";
712			sink-pdos =
713				<PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
714			source-pdos =
715				<PDO_FIXED(5000, 1400, PDO_FIXED_USB_COMM)>;
716			try-power-role = "sink";
717
718			ports {
719				#address-cells = <1>;
720				#size-cells = <0>;
721
722				port@0 {
723					reg = <0>;
724
725					usbc_hs: endpoint {
726						remote-endpoint =
727							<&u2phy0_typec_hs>;
728					};
729				};
730
731				port@1 {
732					reg = <1>;
733
734					usbc_ss: endpoint {
735						remote-endpoint =
736							<&tcphy0_typec_ss>;
737					};
738				};
739
740				port@2 {
741					reg = <2>;
742
743					usbc_dp: endpoint {
744						remote-endpoint =
745							<&tcphy0_typec_dp>;
746					};
747				};
748			};
749		};
750	};
751
752	cw2015@62 {
753		compatible = "cellwise,cw2015";
754		reg = <0x62>;
755		cellwise,battery-profile = /bits/ 8 <
756			0x17 0x67 0x80 0x73 0x6E 0x6C 0x6B 0x63
757			0x77 0x51 0x5C 0x58 0x50 0x4C 0x48 0x36
758			0x15 0x0C 0x0C 0x19 0x5B 0x7D 0x6F 0x69
759			0x69 0x5B 0x0C 0x29 0x20 0x40 0x52 0x59
760			0x57 0x56 0x54 0x4F 0x3B 0x1F 0x7F 0x17
761			0x06 0x1A 0x30 0x5A 0x85 0x93 0x96 0x2D
762			0x48 0x77 0x9C 0xB3 0x80 0x52 0x94 0xCB
763			0x2F 0x00 0x64 0xA5 0xB5 0x11 0xF0 0x11
764		>;
765		cellwise,monitor-interval-ms = <5000>;
766		monitored-battery = <&bat>;
767		power-supplies = <&mains_charger>, <&fusb0>;
768	};
769};
770
771&i2s1 {
772	pinctrl-names = "default";
773	pinctrl-0 = <&i2s_8ch_mclk_pin>, <&i2s1_2ch_bus>;
774	rockchip,capture-channels = <8>;
775	rockchip,playback-channels = <8>;
776	status = "okay";
777};
778
779&io_domains {
780	audio-supply = <&vcc_3v0>;
781	gpio1830-supply = <&vcc_3v0>;
782	sdmmc-supply = <&vcc_sdio>;
783	status = "okay";
784};
785
786&pcie_phy {
787	status = "okay";
788};
789
790&pcie0 {
791	bus-scan-delay-ms = <1000>;
792	ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
793	max-link-speed = <2>;
794	num-lanes = <4>;
795	pinctrl-names = "default";
796	pinctrl-0 = <&pcie_clkreqn_cpm>;
797	vpcie0v9-supply = <&vcca0v9_s3>;
798	vpcie1v8-supply = <&vcca1v8_s3>;
799	vpcie3v3-supply = <&vcc3v3_ssd>;
800	status = "okay";
801};
802
803&pinctrl {
804	buttons {
805		pwrbtn_pin: pwrbtn-pin {
806			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
807		};
808
809		lidbtn_pin: lidbtn-pin {
810			rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
811		};
812	};
813
814	dc-charger {
815		dc_det_pin: dc-det-pin {
816			rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
817		};
818	};
819
820	es8316 {
821		hp_det_pin: hp-det-pin {
822			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
823		};
824	};
825
826	fusb302x {
827		fusb0_int_pin: fusb0-int-pin {
828			rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
829		};
830	};
831
832	i2s1 {
833		i2s_8ch_mclk_pin: i2s-8ch-mclk-pin {
834			rockchip,pins = <4 RK_PA0 1 &pcfg_pull_none>;
835		};
836	};
837
838	lcd-panel {
839		lcdvcc_en_pin: lcdvcc-en-pin {
840			rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
841		};
842
843		panel_en_pin: panel-en-pin {
844			rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
845		};
846
847		lcd_panel_reset_pin: lcd-panel-reset-pin {
848			rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
849		};
850	};
851
852	leds {
853		pwr_led_pin: pwr-led-pin {
854			rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
855		};
856
857		slp_led_pin: slp-led-pin {
858			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
859		};
860	};
861
862	pmic {
863		pmic_int_l_pin: pmic-int-l-pin {
864			rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
865		};
866
867		vsel1_pin: vsel1-pin {
868			rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
869		};
870
871		vsel2_pin: vsel2-pin {
872			rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
873		};
874	};
875
876	sdcard {
877		sdmmc0_pwr_h_pin: sdmmc0-pwr-h-pin {
878			rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
879		};
880
881	};
882
883	sdio-pwrseq {
884		wifi_enable_h_pin: wifi-enable-h-pin {
885			rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
886		};
887	};
888
889	usb-typec {
890		vcc5v0_typec0_en_pin: vcc5v0-typec0-en-pin {
891			rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
892		};
893	};
894
895	usb2 {
896		pwr_5v_pin: pwr-5v-pin {
897			rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
898		};
899
900		vcc5v0_host_en_pin: vcc5v0-host-en-pin {
901			rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
902		};
903	};
904
905	wireless-bluetooth {
906		bt_wake_pin: bt-wake-pin {
907			rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
908		};
909
910		bt_host_wake_pin: bt-host-wake-pin {
911			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
912		};
913
914		bt_reset_pin: bt-reset-pin {
915			rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
916		};
917	};
918};
919
920&pmu_io_domains {
921	pmu1830-supply = <&vcc_3v0>;
922	status = "okay";
923};
924
925&pwm0 {
926	status = "okay";
927};
928
929&pwm2 {
930	status = "okay";
931};
932
933&saradc {
934	vref-supply = <&vcca1v8_s3>;
935	status = "okay";
936};
937
938&sdmmc {
939	bus-width = <4>;
940	cap-mmc-highspeed;
941	cap-sd-highspeed;
942	cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
943	disable-wp;
944	pinctrl-names = "default";
945	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
946	sd-uhs-sdr104;
947	vmmc-supply = <&vcc3v0_sd>;
948	vqmmc-supply = <&vcc_sdio>;
949	status = "okay";
950};
951
952&sdio0 {
953	bus-width = <4>;
954	cap-sd-highspeed;
955	cap-sdio-irq;
956	keep-power-in-suspend;
957	mmc-pwrseq = <&sdio_pwrseq>;
958	non-removable;
959	pinctrl-names = "default";
960	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
961	sd-uhs-sdr104;
962	status = "okay";
963};
964
965&sdhci {
966	bus-width = <8>;
967	mmc-hs200-1_8v;
968	non-removable;
969	status = "okay";
970};
971
972&spi1 {
973	max-freq = <10000000>;
974	status = "okay";
975
976	spiflash: flash@0 {
977		compatible = "jedec,spi-nor";
978		reg = <0>;
979		m25p,fast-read;
980		spi-max-frequency = <10000000>;
981	};
982};
983
984&tcphy0 {
985	status = "okay";
986};
987
988&tcphy0_dp {
989	port {
990		tcphy0_typec_dp: endpoint {
991			remote-endpoint = <&usbc_dp>;
992		};
993	};
994};
995
996&tcphy0_usb3 {
997	port {
998		tcphy0_typec_ss: endpoint {
999			remote-endpoint = <&usbc_ss>;
1000		};
1001	};
1002};
1003
1004&tcphy1 {
1005	status = "okay";
1006};
1007
1008&tsadc {
1009	/* tshut mode 0:CRU 1:GPIO */
1010	rockchip,hw-tshut-mode = <1>;
1011	/* tshut polarity 0:LOW 1:HIGH */
1012	rockchip,hw-tshut-polarity = <1>;
1013	status = "okay";
1014};
1015
1016&u2phy0 {
1017	status = "okay";
1018
1019	u2phy0_otg: otg-port {
1020		status = "okay";
1021	};
1022
1023	u2phy0_host: host-port {
1024		phy-supply = <&vcc5v0_otg>;
1025		status = "okay";
1026	};
1027
1028	port {
1029		u2phy0_typec_hs: endpoint {
1030			remote-endpoint = <&usbc_hs>;
1031		};
1032	};
1033};
1034
1035&u2phy1 {
1036	status = "okay";
1037
1038	u2phy1_otg: otg-port {
1039		status = "okay";
1040	};
1041
1042	u2phy1_host: host-port {
1043		phy-supply = <&vcc5v0_otg>;
1044		status = "okay";
1045	};
1046};
1047
1048&uart0 {
1049	pinctrl-names = "default";
1050	pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
1051	uart-has-rtscts;
1052	status = "okay";
1053
1054	bluetooth {
1055		compatible = "brcm,bcm4345c5";
1056		clocks = <&rk808 1>;
1057		clock-names = "lpo";
1058		device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
1059		host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
1060		max-speed = <1500000>;
1061		pinctrl-names = "default";
1062		pinctrl-0 = <&bt_host_wake_pin &bt_wake_pin &bt_reset_pin>;
1063		shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
1064		vbat-supply = <&wifi_bat>;
1065		vddio-supply = <&vcc_wl>;
1066	};
1067};
1068
1069&uart2 {
1070	status = "okay";
1071};
1072
1073&usb_host0_ehci {
1074	status = "okay";
1075};
1076
1077&usb_host0_ohci {
1078	status = "okay";
1079};
1080
1081&usb_host1_ehci {
1082	status = "okay";
1083};
1084
1085&usb_host1_ohci {
1086	status = "okay";
1087};
1088
1089&usbdrd3_0 {
1090	status = "okay";
1091};
1092
1093&usbdrd_dwc3_0 {
1094	dr_mode = "host";
1095	status = "okay";
1096};
1097
1098&usbdrd3_1 {
1099	status = "okay";
1100};
1101
1102&usbdrd_dwc3_1 {
1103	dr_mode = "host";
1104	status = "okay";
1105};
1106
1107&vopb {
1108	status = "okay";
1109};
1110
1111&vopb_mmu {
1112	status = "okay";
1113};
1114
1115&vopl {
1116	status = "okay";
1117};
1118
1119&vopl_mmu {
1120	status = "okay";
1121};
1122