blob: 2b5f001ff4a61f945456e9fdd7bf5c87a0af7ae8 [file] [log] [blame]
Peter Robinson70d70792020-04-20 20:27:35 +01001// 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
Peter Robinson7c79b872021-07-22 16:20:42 +010021 aliases {
22 mmc0 = &sdio0;
23 mmc1 = &sdmmc;
24 mmc2 = &sdhci;
25 };
26
Peter Robinson70d70792020-04-20 20:27:35 +010027 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
Peter Robinson7c79b872021-07-22 16:20:42 +010037 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
Peter Robinson70d70792020-04-20 20:27:35 +010044 edp_panel: edp-panel {
45 compatible = "boe,nv140fhmn49";
46 backlight = <&backlight>;
47 enable-gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
48 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +010049 pinctrl-0 = <&panel_en_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +010050 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";
Peter Robinson7c79b872021-07-22 16:20:42 +010076 pinctrl-0 = <&lidbtn_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +010077
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";
Peter Robinson7c79b872021-07-22 16:20:42 +010092 pinctrl-0 = <&pwrbtn_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +010093
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";
Peter Robinson7c79b872021-07-22 16:20:42 +0100106 pinctrl-0 = <&pwr_led_pin &slp_led_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100107
Peter Robinson7c79b872021-07-22 16:20:42 +0100108 green_led: led-0 {
Peter Robinson70d70792020-04-20 20:27:35 +0100109 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
Peter Robinson7c79b872021-07-22 16:20:42 +0100116 red_led: led-1 {
Peter Robinson70d70792020-04-20 20:27:35 +0100117 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";
Peter Robinson7c79b872021-07-22 16:20:42 +0100133 pinctrl-0 = <&wifi_enable_h_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100134 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";
Peter Robinson7c79b872021-07-22 16:20:42 +0100145 pinctrl-0 = <&hp_det_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100146 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";
Peter Robinson7c79b872021-07-22 16:20:42 +0100229 pinctrl-0 = <&pwr_5v_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100230 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";
Peter Robinson7c79b872021-07-22 16:20:42 +0100286 pinctrl-0 = <&sdmmc0_pwr_h_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100287 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";
Peter Robinson7c79b872021-07-22 16:20:42 +0100304 pinctrl-0 = <&lcdvcc_en_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100305 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";
Peter Robinson7c79b872021-07-22 16:20:42 +0100333 pinctrl-0 = <&vcc5v0_host_en_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100334 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";
Peter Robinson7c79b872021-07-22 16:20:42 +0100352 pinctrl-0 = <&vcc5v0_typec0_en_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100353 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";
Peter Robinson7c79b872021-07-22 16:20:42 +0100384 pinctrl-0 = <&dc_det_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100385 };
386};
387
388&cdn_dp {
389 status = "okay";
390};
391
392&cpu_b0 {
393 cpu-supply = <&vdd_cpu_b>;
394};
395
396&cpu_b1 {
397 cpu-supply = <&vdd_cpu_b>;
398};
399
400&cpu_l0 {
401 cpu-supply = <&vdd_cpu_l>;
402};
403
404&cpu_l1 {
405 cpu-supply = <&vdd_cpu_l>;
406};
407
408&cpu_l2 {
409 cpu-supply = <&vdd_cpu_l>;
410};
411
412&cpu_l3 {
413 cpu-supply = <&vdd_cpu_l>;
414};
415
416&edp {
417 force-hpd;
418 pinctrl-names = "default";
419 pinctrl-0 = <&edp_hpd>;
420 status = "okay";
421
422 ports {
423 edp_out: port@1 {
424 reg = <1>;
425 #address-cells = <1>;
426 #size-cells = <0>;
427
428 edp_out_panel: endpoint@0 {
429 reg = <0>;
430 remote-endpoint = <&panel_in_edp>;
431 };
432 };
433 };
434};
435
436&emmc_phy {
437 status = "okay";
438};
439
440&gpu {
441 mali-supply = <&vdd_gpu>;
442 status = "okay";
443};
444
445&hdmi_sound {
446 status = "okay";
447};
448
449&i2c0 {
450 clock-frequency = <400000>;
451 i2c-scl-falling-time-ns = <4>;
452 i2c-scl-rising-time-ns = <168>;
453 status = "okay";
454
455 rk808: pmic@1b {
456 compatible = "rockchip,rk808";
457 reg = <0x1b>;
458 #clock-cells = <1>;
459 clock-output-names = "xin32k", "rk808-clkout2";
460 interrupt-parent = <&gpio3>;
461 interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
462 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100463 pinctrl-0 = <&pmic_int_l_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100464 rockchip,system-power-controller;
465 wakeup-source;
466
467 vcc1-supply = <&vcc_sysin>;
468 vcc2-supply = <&vcc_sysin>;
469 vcc3-supply = <&vcc_sysin>;
470 vcc4-supply = <&vcc_sysin>;
471 vcc6-supply = <&vcc_sysin>;
472 vcc7-supply = <&vcc_sysin>;
473 vcc8-supply = <&vcc3v3_sys>;
474 vcc9-supply = <&vcc_sysin>;
475 vcc10-supply = <&vcc_sysin>;
476 vcc11-supply = <&vcc_sysin>;
477 vcc12-supply = <&vcc3v3_sys>;
478 vcc13-supply = <&vcc_sysin>;
479 vcc14-supply = <&vcc_sysin>;
480
481 regulators {
482 /* rk3399 center logic supply */
483 vdd_center: DCDC_REG1 {
484 regulator-name = "vdd_center";
485 regulator-always-on;
486 regulator-boot-on;
487 regulator-min-microvolt = <750000>;
488 regulator-max-microvolt = <1350000>;
489 regulator-ramp-delay = <6001>;
490
491 regulator-state-mem {
492 regulator-off-in-suspend;
493 };
494 };
495
496 vdd_cpu_l: DCDC_REG2 {
497 regulator-name = "vdd_cpu_l";
498 regulator-always-on;
499 regulator-boot-on;
500 regulator-min-microvolt = <750000>;
501 regulator-max-microvolt = <1350000>;
502 regulator-ramp-delay = <6001>;
503
504 regulator-state-mem {
505 regulator-off-in-suspend;
506 };
507 };
508
509 vcc_ddr: DCDC_REG3 {
510 regulator-name = "vcc_ddr";
511 regulator-always-on;
512 regulator-boot-on;
513
514 regulator-state-mem {
515 regulator-on-in-suspend;
516 };
517 };
518
519 vcc_1v8: vcc_wl: DCDC_REG4 {
520 regulator-name = "vcc_1v8";
521 regulator-always-on;
522 regulator-boot-on;
523 regulator-min-microvolt = <1800000>;
524 regulator-max-microvolt = <1800000>;
525
526 regulator-state-mem {
527 regulator-on-in-suspend;
528 regulator-suspend-microvolt = <1800000>;
529 };
530 };
531
532 /* not used */
533 LDO_REG1 {
534 };
535
536 /* not used */
537 LDO_REG2 {
538 };
539
540 vcc1v8_pmupll: LDO_REG3 {
541 regulator-name = "vcc1v8_pmupll";
542 regulator-always-on;
543 regulator-boot-on;
544 regulator-min-microvolt = <1800000>;
545 regulator-max-microvolt = <1800000>;
546
547 regulator-state-mem {
548 regulator-on-in-suspend;
549 regulator-suspend-microvolt = <1800000>;
550 };
551 };
552
553 vcc_sdio: LDO_REG4 {
554 regulator-name = "vcc_sdio";
555 regulator-always-on;
556 regulator-boot-on;
557 regulator-min-microvolt = <1800000>;
558 regulator-max-microvolt = <3000000>;
559
560 regulator-state-mem {
561 regulator-on-in-suspend;
562 regulator-suspend-microvolt = <3000000>;
563 };
564 };
565
566 vcca3v0_codec: LDO_REG5 {
567 regulator-name = "vcca3v0_codec";
568 regulator-always-on;
569 regulator-boot-on;
570 regulator-min-microvolt = <3000000>;
571 regulator-max-microvolt = <3000000>;
572
573 regulator-state-mem {
574 regulator-off-in-suspend;
575 };
576 };
577
578 vcc_1v5: LDO_REG6 {
579 regulator-name = "vcc_1v5";
580 regulator-always-on;
581 regulator-boot-on;
582 regulator-min-microvolt = <1500000>;
583 regulator-max-microvolt = <1500000>;
584
585 regulator-state-mem {
586 regulator-on-in-suspend;
587 regulator-suspend-microvolt = <1500000>;
588 };
589 };
590
591 vcca1v8_codec: LDO_REG7 {
592 regulator-name = "vcca1v8_codec";
593 regulator-always-on;
594 regulator-boot-on;
595 regulator-min-microvolt = <1800000>;
596 regulator-max-microvolt = <1800000>;
597
598 regulator-state-mem {
599 regulator-off-in-suspend;
600 };
601 };
602
603 vcc_3v0: LDO_REG8 {
604 regulator-name = "vcc_3v0";
605 regulator-always-on;
606 regulator-boot-on;
607 regulator-min-microvolt = <3000000>;
608 regulator-max-microvolt = <3000000>;
609
610 regulator-state-mem {
611 regulator-on-in-suspend;
612 regulator-suspend-microvolt = <3000000>;
613 };
614 };
615
616 vcc3v3_s3: SWITCH_REG1 {
617 regulator-name = "vcc3v3_s3";
618 regulator-always-on;
619 regulator-boot-on;
620
621 regulator-state-mem {
622 regulator-off-in-suspend;
623 };
624 };
625
626 vcc3v3_s0: SWITCH_REG2 {
627 regulator-name = "vcc3v3_s0";
628 regulator-always-on;
629 regulator-boot-on;
630
631 regulator-state-mem {
632 regulator-off-in-suspend;
633 };
634 };
635 };
636 };
637
638 vdd_cpu_b: regulator@40 {
639 compatible = "silergy,syr827";
640 reg = <0x40>;
641 fcs,suspend-voltage-selector = <1>;
642 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100643 pinctrl-0 = <&vsel1_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100644 regulator-name = "vdd_cpu_b";
645 regulator-always-on;
646 regulator-boot-on;
647 regulator-min-microvolt = <712500>;
648 regulator-max-microvolt = <1500000>;
649 regulator-ramp-delay = <1000>;
650 vin-supply = <&vcc_1v8>;
651
652 regulator-state-mem {
653 regulator-off-in-suspend;
654 };
655 };
656
657 vdd_gpu: regulator@41 {
658 compatible = "silergy,syr828";
659 reg = <0x41>;
660 fcs,suspend-voltage-selector = <1>;
661 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100662 pinctrl-0 = <&vsel2_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100663 regulator-name = "vdd_gpu";
664 regulator-always-on;
665 regulator-boot-on;
666 regulator-min-microvolt = <712500>;
667 regulator-max-microvolt = <1500000>;
668 regulator-ramp-delay = <1000>;
669 vin-supply = <&vcc_1v8>;
670
671 regulator-state-mem {
672 regulator-off-in-suspend;
673 };
674 };
675};
676
677&i2c1 {
678 clock-frequency = <100000>;
679 i2c-scl-falling-time-ns = <4>;
680 i2c-scl-rising-time-ns = <168>;
681 status = "okay";
682
683 es8316: es8316@11 {
684 compatible = "everest,es8316";
685 reg = <0x11>;
686 clocks = <&cru SCLK_I2S_8CH_OUT>;
687 clock-names = "mclk";
688 #sound-dai-cells = <0>;
689 };
690};
691
692&i2c3 {
693 i2c-scl-falling-time-ns = <15>;
694 i2c-scl-rising-time-ns = <450>;
695 status = "okay";
696};
697
698&i2c4 {
699 i2c-scl-falling-time-ns = <20>;
700 i2c-scl-rising-time-ns = <600>;
701 status = "okay";
702
703 fusb0: fusb30x@22 {
704 compatible = "fcs,fusb302";
705 reg = <0x22>;
Peter Robinson7c79b872021-07-22 16:20:42 +0100706 interrupt-parent = <&gpio1>;
707 interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
Peter Robinson70d70792020-04-20 20:27:35 +0100708 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100709 pinctrl-0 = <&fusb0_int_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100710 vbus-supply = <&vbus_typec>;
711
712 connector {
713 compatible = "usb-c-connector";
714 data-role = "host";
715 label = "USB-C";
716 op-sink-microwatt = <1000000>;
717 power-role = "dual";
718 sink-pdos =
719 <PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
720 source-pdos =
721 <PDO_FIXED(5000, 1400, PDO_FIXED_USB_COMM)>;
722 try-power-role = "sink";
723
724 ports {
725 #address-cells = <1>;
726 #size-cells = <0>;
727
728 port@0 {
729 reg = <0>;
730
731 usbc_hs: endpoint {
732 remote-endpoint =
733 <&u2phy0_typec_hs>;
734 };
735 };
736
737 port@1 {
738 reg = <1>;
739
740 usbc_ss: endpoint {
741 remote-endpoint =
742 <&tcphy0_typec_ss>;
743 };
744 };
745
746 port@2 {
747 reg = <2>;
748
749 usbc_dp: endpoint {
750 remote-endpoint =
751 <&tcphy0_typec_dp>;
752 };
753 };
754 };
755 };
756 };
Peter Robinson7c79b872021-07-22 16:20:42 +0100757
758 cw2015@62 {
759 compatible = "cellwise,cw2015";
760 reg = <0x62>;
761 cellwise,battery-profile = /bits/ 8 <
762 0x17 0x67 0x80 0x73 0x6E 0x6C 0x6B 0x63
763 0x77 0x51 0x5C 0x58 0x50 0x4C 0x48 0x36
764 0x15 0x0C 0x0C 0x19 0x5B 0x7D 0x6F 0x69
765 0x69 0x5B 0x0C 0x29 0x20 0x40 0x52 0x59
766 0x57 0x56 0x54 0x4F 0x3B 0x1F 0x7F 0x17
767 0x06 0x1A 0x30 0x5A 0x85 0x93 0x96 0x2D
768 0x48 0x77 0x9C 0xB3 0x80 0x52 0x94 0xCB
769 0x2F 0x00 0x64 0xA5 0xB5 0x11 0xF0 0x11
770 >;
771 cellwise,monitor-interval-ms = <5000>;
772 monitored-battery = <&bat>;
773 power-supplies = <&mains_charger>, <&fusb0>;
774 };
Peter Robinson70d70792020-04-20 20:27:35 +0100775};
776
777&i2s1 {
Peter Robinson70d70792020-04-20 20:27:35 +0100778 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100779 pinctrl-0 = <&i2s_8ch_mclk_pin>, <&i2s1_2ch_bus>;
Peter Robinson70d70792020-04-20 20:27:35 +0100780 rockchip,capture-channels = <8>;
781 rockchip,playback-channels = <8>;
782 status = "okay";
783};
784
785&io_domains {
786 audio-supply = <&vcc_3v0>;
787 gpio1830-supply = <&vcc_3v0>;
788 sdmmc-supply = <&vcc_sdio>;
789 status = "okay";
790};
791
792&pcie_phy {
793 status = "okay";
794};
795
796&pcie0 {
797 bus-scan-delay-ms = <1000>;
798 ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
Peter Robinson70d70792020-04-20 20:27:35 +0100799 num-lanes = <4>;
800 pinctrl-names = "default";
801 pinctrl-0 = <&pcie_clkreqn_cpm>;
802 vpcie0v9-supply = <&vcca0v9_s3>;
803 vpcie1v8-supply = <&vcca1v8_s3>;
804 vpcie3v3-supply = <&vcc3v3_ssd>;
805 status = "okay";
806};
807
808&pinctrl {
809 buttons {
Peter Robinson7c79b872021-07-22 16:20:42 +0100810 pwrbtn_pin: pwrbtn-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100811 rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
812 };
813
Peter Robinson7c79b872021-07-22 16:20:42 +0100814 lidbtn_pin: lidbtn-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100815 rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
816 };
817 };
818
819 dc-charger {
Peter Robinson7c79b872021-07-22 16:20:42 +0100820 dc_det_pin: dc-det-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100821 rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
822 };
823 };
824
825 es8316 {
Peter Robinson7c79b872021-07-22 16:20:42 +0100826 hp_det_pin: hp-det-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100827 rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
828 };
829 };
830
831 fusb302x {
Peter Robinson7c79b872021-07-22 16:20:42 +0100832 fusb0_int_pin: fusb0-int-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100833 rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
834 };
835 };
836
837 i2s1 {
Peter Robinson7c79b872021-07-22 16:20:42 +0100838 i2s_8ch_mclk_pin: i2s-8ch-mclk-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100839 rockchip,pins = <4 RK_PA0 1 &pcfg_pull_none>;
840 };
841 };
842
843 lcd-panel {
Peter Robinson7c79b872021-07-22 16:20:42 +0100844 lcdvcc_en_pin: lcdvcc-en-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100845 rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
846 };
847
Peter Robinson7c79b872021-07-22 16:20:42 +0100848 panel_en_pin: panel-en-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100849 rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
850 };
851
Peter Robinson7c79b872021-07-22 16:20:42 +0100852 lcd_panel_reset_pin: lcd-panel-reset-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100853 rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
854 };
855 };
856
857 leds {
Peter Robinson7c79b872021-07-22 16:20:42 +0100858 pwr_led_pin: pwr-led-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100859 rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
860 };
861
Peter Robinson7c79b872021-07-22 16:20:42 +0100862 slp_led_pin: slp-led-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100863 rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
864 };
865 };
866
867 pmic {
Peter Robinson7c79b872021-07-22 16:20:42 +0100868 pmic_int_l_pin: pmic-int-l-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100869 rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
870 };
871
Peter Robinson7c79b872021-07-22 16:20:42 +0100872 vsel1_pin: vsel1-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100873 rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
874 };
875
Peter Robinson7c79b872021-07-22 16:20:42 +0100876 vsel2_pin: vsel2-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100877 rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
878 };
879 };
880
881 sdcard {
Peter Robinson7c79b872021-07-22 16:20:42 +0100882 sdmmc0_pwr_h_pin: sdmmc0-pwr-h-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100883 rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
884 };
885
886 };
887
888 sdio-pwrseq {
Peter Robinson7c79b872021-07-22 16:20:42 +0100889 wifi_enable_h_pin: wifi-enable-h-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100890 rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
891 };
892 };
893
894 usb-typec {
Peter Robinson7c79b872021-07-22 16:20:42 +0100895 vcc5v0_typec0_en_pin: vcc5v0-typec0-en-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100896 rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
897 };
898 };
899
900 usb2 {
Peter Robinson7c79b872021-07-22 16:20:42 +0100901 pwr_5v_pin: pwr-5v-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100902 rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
903 };
904
Peter Robinson7c79b872021-07-22 16:20:42 +0100905 vcc5v0_host_en_pin: vcc5v0-host-en-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100906 rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
907 };
908 };
909
910 wireless-bluetooth {
Peter Robinson7c79b872021-07-22 16:20:42 +0100911 bt_wake_pin: bt-wake-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100912 rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
913 };
914
Peter Robinson7c79b872021-07-22 16:20:42 +0100915 bt_host_wake_pin: bt-host-wake-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100916 rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
917 };
918
Peter Robinson7c79b872021-07-22 16:20:42 +0100919 bt_reset_pin: bt-reset-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100920 rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
921 };
922 };
923};
924
925&pmu_io_domains {
926 pmu1830-supply = <&vcc_3v0>;
927 status = "okay";
928};
929
930&pwm0 {
931 status = "okay";
932};
933
934&pwm2 {
935 status = "okay";
936};
937
938&saradc {
939 vref-supply = <&vcca1v8_s3>;
940 status = "okay";
941};
942
943&sdmmc {
944 bus-width = <4>;
945 cap-mmc-highspeed;
946 cap-sd-highspeed;
947 cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
948 disable-wp;
949 pinctrl-names = "default";
950 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
951 sd-uhs-sdr104;
952 vmmc-supply = <&vcc3v0_sd>;
953 vqmmc-supply = <&vcc_sdio>;
954 status = "okay";
955};
956
957&sdio0 {
958 bus-width = <4>;
959 cap-sd-highspeed;
960 cap-sdio-irq;
961 keep-power-in-suspend;
962 mmc-pwrseq = <&sdio_pwrseq>;
963 non-removable;
964 pinctrl-names = "default";
965 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
966 sd-uhs-sdr104;
967 status = "okay";
968};
969
970&sdhci {
971 bus-width = <8>;
972 mmc-hs200-1_8v;
973 non-removable;
974 status = "okay";
975};
976
977&spi1 {
978 max-freq = <10000000>;
979 status = "okay";
980
981 spiflash: flash@0 {
982 compatible = "jedec,spi-nor";
983 reg = <0>;
984 m25p,fast-read;
985 spi-max-frequency = <10000000>;
986 };
987};
988
989&tcphy0 {
990 status = "okay";
991};
992
993&tcphy0_dp {
994 port {
995 tcphy0_typec_dp: endpoint {
996 remote-endpoint = <&usbc_dp>;
997 };
998 };
999};
1000
1001&tcphy0_usb3 {
1002 port {
1003 tcphy0_typec_ss: endpoint {
1004 remote-endpoint = <&usbc_ss>;
1005 };
1006 };
1007};
1008
1009&tcphy1 {
1010 status = "okay";
1011};
1012
1013&tsadc {
1014 /* tshut mode 0:CRU 1:GPIO */
1015 rockchip,hw-tshut-mode = <1>;
1016 /* tshut polarity 0:LOW 1:HIGH */
1017 rockchip,hw-tshut-polarity = <1>;
1018 status = "okay";
1019};
1020
1021&u2phy0 {
1022 status = "okay";
1023
1024 u2phy0_otg: otg-port {
1025 status = "okay";
1026 };
1027
1028 u2phy0_host: host-port {
1029 phy-supply = <&vcc5v0_otg>;
1030 status = "okay";
1031 };
1032
1033 port {
1034 u2phy0_typec_hs: endpoint {
1035 remote-endpoint = <&usbc_hs>;
1036 };
1037 };
1038};
1039
1040&u2phy1 {
1041 status = "okay";
1042
1043 u2phy1_otg: otg-port {
1044 status = "okay";
1045 };
1046
1047 u2phy1_host: host-port {
1048 phy-supply = <&vcc5v0_otg>;
1049 status = "okay";
1050 };
1051};
1052
1053&uart0 {
1054 pinctrl-names = "default";
1055 pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
1056 uart-has-rtscts;
1057 status = "okay";
1058
1059 bluetooth {
1060 compatible = "brcm,bcm4345c5";
1061 clocks = <&rk808 1>;
1062 clock-names = "lpo";
1063 device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
1064 host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
1065 max-speed = <1500000>;
1066 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +01001067 pinctrl-0 = <&bt_host_wake_pin &bt_wake_pin &bt_reset_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +01001068 shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
1069 vbat-supply = <&wifi_bat>;
1070 vddio-supply = <&vcc_wl>;
1071 };
1072};
1073
1074&uart2 {
1075 status = "okay";
1076};
1077
1078&usb_host0_ehci {
1079 status = "okay";
1080};
1081
1082&usb_host0_ohci {
1083 status = "okay";
1084};
1085
1086&usb_host1_ehci {
1087 status = "okay";
1088};
1089
1090&usb_host1_ohci {
1091 status = "okay";
1092};
1093
1094&usbdrd3_0 {
1095 status = "okay";
1096};
1097
1098&usbdrd_dwc3_0 {
1099 dr_mode = "host";
1100 status = "okay";
1101};
1102
1103&usbdrd3_1 {
1104 status = "okay";
1105};
1106
1107&usbdrd_dwc3_1 {
1108 dr_mode = "host";
1109 status = "okay";
1110};
1111
1112&vopb {
1113 status = "okay";
1114};
1115
1116&vopb_mmu {
1117 status = "okay";
1118};
1119
1120&vopl {
1121 status = "okay";
1122};
1123
1124&vopl_mmu {
1125 status = "okay";
1126};