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