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