blob: d6b68d77d63a5f2d1ea77e6df8fb9f5f631c4ed8 [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";
Peter Robinson36d70892022-06-12 15:25:29 +010020 chassis-type = "laptop";
Peter Robinson70d70792020-04-20 20:27:35 +010021
Peter Robinson7c79b872021-07-22 16:20:42 +010022 aliases {
23 mmc0 = &sdio0;
24 mmc1 = &sdmmc;
25 mmc2 = &sdhci;
26 };
27
Peter Robinson70d70792020-04-20 20:27:35 +010028 chosen {
29 stdout-path = "serial2:1500000n8";
30 };
31
32 backlight: edp-backlight {
33 compatible = "pwm-backlight";
34 power-supply = <&vcc_12v>;
35 pwms = <&pwm0 0 740740 0>;
36 };
37
Peter Robinson7c79b872021-07-22 16:20:42 +010038 bat: battery {
39 compatible = "simple-battery";
40 charge-full-design-microamp-hours = <9800000>;
41 voltage-max-design-microvolt = <4350000>;
42 voltage-min-design-microvolt = <3000000>;
43 };
44
Peter Robinson70d70792020-04-20 20:27:35 +010045 edp_panel: edp-panel {
46 compatible = "boe,nv140fhmn49";
47 backlight = <&backlight>;
48 enable-gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
49 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +010050 pinctrl-0 = <&panel_en_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +010051 power-supply = <&vcc3v3_panel>;
52
53 ports {
54 #address-cells = <1>;
55 #size-cells = <0>;
56
57 port@0 {
58 reg = <0>;
59 #address-cells = <1>;
60 #size-cells = <0>;
61
62 panel_in_edp: endpoint@0 {
63 reg = <0>;
64 remote-endpoint = <&edp_out_panel>;
65 };
66 };
67 };
68 };
69
70 /*
71 * Use separate nodes for gpio-keys to allow for selective deactivation
72 * of wakeup sources via sysfs without disabling the whole key
73 */
74 gpio-key-lid {
75 compatible = "gpio-keys";
76 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +010077 pinctrl-0 = <&lidbtn_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +010078
79 lid {
80 debounce-interval = <20>;
81 gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_LOW>;
82 label = "Lid";
83 linux,code = <SW_LID>;
84 linux,input-type = <EV_SW>;
85 wakeup-event-action = <EV_ACT_DEASSERTED>;
86 wakeup-source;
87 };
88 };
89
90 gpio-key-power {
91 compatible = "gpio-keys";
92 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +010093 pinctrl-0 = <&pwrbtn_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +010094
95 power {
96 debounce-interval = <20>;
97 gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
98 label = "Power";
99 linux,code = <KEY_POWER>;
100 wakeup-source;
101 };
102 };
103
104 leds {
105 compatible = "gpio-leds";
106 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100107 pinctrl-0 = <&pwr_led_pin &slp_led_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100108
Peter Robinson7c79b872021-07-22 16:20:42 +0100109 green_led: led-0 {
Peter Robinson70d70792020-04-20 20:27:35 +0100110 color = <LED_COLOR_ID_GREEN>;
111 default-state = "on";
112 function = LED_FUNCTION_POWER;
113 gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>;
114 label = "green:power";
115 };
116
Peter Robinson7c79b872021-07-22 16:20:42 +0100117 red_led: led-1 {
Peter Robinson70d70792020-04-20 20:27:35 +0100118 color = <LED_COLOR_ID_RED>;
119 default-state = "off";
120 function = LED_FUNCTION_STANDBY;
121 gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
122 label = "red:standby";
123 panic-indicator;
124 retain-state-suspended;
125 };
126 };
127
128 /* Power sequence for SDIO WiFi module */
129 sdio_pwrseq: sdio-pwrseq {
130 compatible = "mmc-pwrseq-simple";
131 clocks = <&rk808 1>;
132 clock-names = "ext_clock";
133 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100134 pinctrl-0 = <&wifi_enable_h_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100135 post-power-on-delay-ms = <100>;
136 power-off-delay-us = <500000>;
137
138 /* WL_REG_ON on module */
139 reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
140 };
141
142 /* Audio components */
143 es8316-sound {
144 compatible = "simple-audio-card";
145 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100146 pinctrl-0 = <&hp_det_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100147 simple-audio-card,name = "rockchip,es8316-codec";
148 simple-audio-card,format = "i2s";
149 simple-audio-card,mclk-fs = <256>;
150
151 simple-audio-card,widgets =
152 "Microphone", "Mic Jack",
153 "Headphone", "Headphones",
154 "Speaker", "Speaker";
155 simple-audio-card,routing =
156 "MIC1", "Mic Jack",
157 "Headphones", "HPOL",
158 "Headphones", "HPOR",
159 "Speaker Amplifier INL", "HPOL",
160 "Speaker Amplifier INR", "HPOR",
161 "Speaker", "Speaker Amplifier OUTL",
162 "Speaker", "Speaker Amplifier OUTR";
163
164 simple-audio-card,hp-det-gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>;
165 simple-audio-card,aux-devs = <&speaker_amp>;
166 simple-audio-card,pin-switches = "Speaker";
167
168 simple-audio-card,cpu {
169 sound-dai = <&i2s1>;
170 };
171
172 simple-audio-card,codec {
173 sound-dai = <&es8316>;
174 };
175 };
176
177 speaker_amp: speaker-amplifier {
178 compatible = "simple-audio-amplifier";
179 enable-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_HIGH>;
180 sound-name-prefix = "Speaker Amplifier";
181 VCC-supply = <&pa_5v>;
182 };
183
184 /* Power tree */
185 /* Root power source */
186 vcc_sysin: vcc-sysin {
187 compatible = "regulator-fixed";
188 regulator-name = "vcc_sysin";
189 regulator-always-on;
190 regulator-boot-on;
191 };
192
193 /* Regulators supplied by vcc_sysin */
194 /* LCD backlight supply */
195 vcc_12v: vcc-12v {
196 compatible = "regulator-fixed";
197 regulator-name = "vcc_12v";
198 regulator-always-on;
199 regulator-boot-on;
200 regulator-min-microvolt = <12000000>;
201 regulator-max-microvolt = <12000000>;
202 vin-supply = <&vcc_sysin>;
203
204 regulator-state-mem {
205 regulator-off-in-suspend;
206 };
207 };
208
209 /* Main 3.3 V supply */
210 vcc3v3_sys: wifi_bat: vcc3v3-sys {
211 compatible = "regulator-fixed";
212 regulator-name = "vcc3v3_sys";
213 regulator-always-on;
214 regulator-boot-on;
215 regulator-min-microvolt = <3300000>;
216 regulator-max-microvolt = <3300000>;
217 vin-supply = <&vcc_sysin>;
218
219 regulator-state-mem {
220 regulator-on-in-suspend;
221 };
222 };
223
224 /* 5 V USB power supply */
225 vcc5v0_usb: pa_5v: vcc5v0-usb-regulator {
226 compatible = "regulator-fixed";
227 enable-active-high;
228 gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
229 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100230 pinctrl-0 = <&pwr_5v_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100231 regulator-name = "vcc5v0_usb";
232 regulator-always-on;
233 regulator-min-microvolt = <5000000>;
234 regulator-max-microvolt = <5000000>;
235 vin-supply = <&vcc_sysin>;
236
237 regulator-state-mem {
238 regulator-off-in-suspend;
239 };
240 };
241
242 /* RK3399 logic supply */
243 vdd_log: vdd-log {
244 compatible = "pwm-regulator";
245 pwms = <&pwm2 0 25000 1>;
Peter Robinson36d70892022-06-12 15:25:29 +0100246 pwm-supply = <&vcc_sysin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100247 regulator-name = "vdd_log";
248 regulator-always-on;
249 regulator-boot-on;
250 regulator-min-microvolt = <800000>;
251 regulator-max-microvolt = <1400000>;
Peter Robinson70d70792020-04-20 20:27:35 +0100252
253 regulator-state-mem {
254 regulator-on-in-suspend;
255 };
256 };
257
258 /* Regulators supplied by vcc3v3_sys */
259 /* 0.9 V supply, always on */
260 vcc_0v9: vcc-0v9 {
261 compatible = "regulator-fixed";
262 regulator-name = "vcc_0v9";
263 regulator-always-on;
264 regulator-boot-on;
265 regulator-min-microvolt = <900000>;
266 regulator-max-microvolt = <900000>;
267 vin-supply = <&vcc3v3_sys>;
268 };
269
270 /* S3 1.8 V supply, switched by vcc1v8_s3 */
271 vcca1v8_s3: vcc1v8-s3 {
272 compatible = "regulator-fixed";
273 regulator-name = "vcca1v8_s3";
274 regulator-always-on;
275 regulator-boot-on;
276 regulator-min-microvolt = <1800000>;
277 regulator-max-microvolt = <1800000>;
278 vin-supply = <&vcc3v3_sys>;
279 };
280
281 /* micro SD card power */
282 vcc3v0_sd: vcc3v0-sd {
283 compatible = "regulator-fixed";
284 enable-active-high;
285 gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
286 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100287 pinctrl-0 = <&sdmmc0_pwr_h_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100288 regulator-name = "vcc3v0_sd";
289 regulator-always-on;
290 regulator-min-microvolt = <3000000>;
291 regulator-max-microvolt = <3000000>;
292 vin-supply = <&vcc3v3_sys>;
293
294 regulator-state-mem {
295 regulator-off-in-suspend;
296 };
297 };
298
299 /* LCD panel power, called VCC3V3_S0 in schematic */
300 vcc3v3_panel: vcc3v3-panel {
301 compatible = "regulator-fixed";
302 enable-active-high;
303 gpio = <&gpio1 RK_PC6 GPIO_ACTIVE_HIGH>;
304 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100305 pinctrl-0 = <&lcdvcc_en_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100306 regulator-name = "vcc3v3_panel";
307 regulator-always-on;
308 regulator-min-microvolt = <3300000>;
309 regulator-max-microvolt = <3300000>;
310 regulator-enable-ramp-delay = <100000>;
311 vin-supply = <&vcc3v3_sys>;
312
313 regulator-state-mem {
314 regulator-off-in-suspend;
315 };
316 };
317
318 /* M.2 adapter power, switched by vcc1v8_s3 */
319 vcc3v3_ssd: vcc3v3-ssd {
320 compatible = "regulator-fixed";
321 regulator-name = "vcc3v3_ssd";
322 regulator-min-microvolt = <3300000>;
323 regulator-max-microvolt = <3300000>;
324 vin-supply = <&vcc3v3_sys>;
325 };
326
327 /* Regulators supplied by vcc5v0_usb */
328 /* USB 3 port power supply regulator */
329 vcc5v0_otg: vcc5v0-otg {
330 compatible = "regulator-fixed";
331 enable-active-high;
332 gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
333 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100334 pinctrl-0 = <&vcc5v0_host_en_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100335 regulator-name = "vcc5v0_otg";
336 regulator-always-on;
337 regulator-min-microvolt = <5000000>;
338 regulator-max-microvolt = <5000000>;
339 vin-supply = <&vcc5v0_usb>;
340
341 regulator-state-mem {
342 regulator-off-in-suspend;
343 };
344 };
345
346 /* Regulators supplied by vcc5v0_usb */
347 /* Type C port power supply regulator */
348 vbus_5vout: vbus_typec: vbus-5vout {
349 compatible = "regulator-fixed";
350 enable-active-high;
351 gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
352 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100353 pinctrl-0 = <&vcc5v0_typec0_en_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100354 regulator-name = "vbus_5vout";
355 regulator-min-microvolt = <5000000>;
356 regulator-max-microvolt = <5000000>;
357 vin-supply = <&vcc5v0_usb>;
358
359 regulator-state-mem {
360 regulator-off-in-suspend;
361 };
362 };
363
364 /* Regulators supplied by vcc_1v8 */
365 /* Primary 0.9 V LDO */
366 vcca0v9_s3: vcca0v9-s3 {
367 compatible = "regulator-fixed";
368 regulator-name = "vcc0v9_s3";
369 regulator-min-microvolt = <5000000>;
370 regulator-max-microvolt = <5000000>;
371 vin-supply = <&vcc_1v8>;
372
373 regulator-state-mem {
374 regulator-on-in-suspend;
375 };
376 };
377
378 mains_charger: dc-charger {
379 compatible = "gpio-charger";
380 charger-type = "mains";
381 gpios = <&gpio4 RK_PD0 GPIO_ACTIVE_LOW>;
382
383 /* Also triggered by USB charger */
384 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100385 pinctrl-0 = <&dc_det_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100386 };
387};
388
Peter Robinson70d70792020-04-20 20:27:35 +0100389&cpu_b0 {
390 cpu-supply = <&vdd_cpu_b>;
391};
392
393&cpu_b1 {
394 cpu-supply = <&vdd_cpu_b>;
395};
396
397&cpu_l0 {
398 cpu-supply = <&vdd_cpu_l>;
399};
400
401&cpu_l1 {
402 cpu-supply = <&vdd_cpu_l>;
403};
404
405&cpu_l2 {
406 cpu-supply = <&vdd_cpu_l>;
407};
408
409&cpu_l3 {
410 cpu-supply = <&vdd_cpu_l>;
411};
412
413&edp {
414 force-hpd;
415 pinctrl-names = "default";
416 pinctrl-0 = <&edp_hpd>;
417 status = "okay";
418
419 ports {
420 edp_out: port@1 {
421 reg = <1>;
422 #address-cells = <1>;
423 #size-cells = <0>;
424
425 edp_out_panel: endpoint@0 {
426 reg = <0>;
427 remote-endpoint = <&panel_in_edp>;
428 };
429 };
430 };
431};
432
433&emmc_phy {
434 status = "okay";
435};
436
437&gpu {
438 mali-supply = <&vdd_gpu>;
439 status = "okay";
440};
441
442&hdmi_sound {
443 status = "okay";
444};
445
446&i2c0 {
447 clock-frequency = <400000>;
448 i2c-scl-falling-time-ns = <4>;
449 i2c-scl-rising-time-ns = <168>;
450 status = "okay";
451
452 rk808: pmic@1b {
453 compatible = "rockchip,rk808";
454 reg = <0x1b>;
455 #clock-cells = <1>;
456 clock-output-names = "xin32k", "rk808-clkout2";
457 interrupt-parent = <&gpio3>;
458 interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
459 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100460 pinctrl-0 = <&pmic_int_l_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100461 rockchip,system-power-controller;
462 wakeup-source;
463
464 vcc1-supply = <&vcc_sysin>;
465 vcc2-supply = <&vcc_sysin>;
466 vcc3-supply = <&vcc_sysin>;
467 vcc4-supply = <&vcc_sysin>;
468 vcc6-supply = <&vcc_sysin>;
469 vcc7-supply = <&vcc_sysin>;
470 vcc8-supply = <&vcc3v3_sys>;
471 vcc9-supply = <&vcc_sysin>;
472 vcc10-supply = <&vcc_sysin>;
473 vcc11-supply = <&vcc_sysin>;
474 vcc12-supply = <&vcc3v3_sys>;
Peter Robinson70d70792020-04-20 20:27:35 +0100475
476 regulators {
477 /* rk3399 center logic supply */
478 vdd_center: DCDC_REG1 {
479 regulator-name = "vdd_center";
480 regulator-always-on;
481 regulator-boot-on;
482 regulator-min-microvolt = <750000>;
483 regulator-max-microvolt = <1350000>;
484 regulator-ramp-delay = <6001>;
485
486 regulator-state-mem {
487 regulator-off-in-suspend;
488 };
489 };
490
491 vdd_cpu_l: DCDC_REG2 {
492 regulator-name = "vdd_cpu_l";
493 regulator-always-on;
494 regulator-boot-on;
495 regulator-min-microvolt = <750000>;
496 regulator-max-microvolt = <1350000>;
497 regulator-ramp-delay = <6001>;
498
499 regulator-state-mem {
500 regulator-off-in-suspend;
501 };
502 };
503
504 vcc_ddr: DCDC_REG3 {
505 regulator-name = "vcc_ddr";
506 regulator-always-on;
507 regulator-boot-on;
508
509 regulator-state-mem {
510 regulator-on-in-suspend;
511 };
512 };
513
514 vcc_1v8: vcc_wl: DCDC_REG4 {
515 regulator-name = "vcc_1v8";
516 regulator-always-on;
517 regulator-boot-on;
518 regulator-min-microvolt = <1800000>;
519 regulator-max-microvolt = <1800000>;
520
521 regulator-state-mem {
522 regulator-on-in-suspend;
523 regulator-suspend-microvolt = <1800000>;
524 };
525 };
526
527 /* not used */
528 LDO_REG1 {
529 };
530
531 /* not used */
532 LDO_REG2 {
533 };
534
535 vcc1v8_pmupll: LDO_REG3 {
536 regulator-name = "vcc1v8_pmupll";
537 regulator-always-on;
538 regulator-boot-on;
539 regulator-min-microvolt = <1800000>;
540 regulator-max-microvolt = <1800000>;
541
542 regulator-state-mem {
543 regulator-on-in-suspend;
544 regulator-suspend-microvolt = <1800000>;
545 };
546 };
547
548 vcc_sdio: LDO_REG4 {
549 regulator-name = "vcc_sdio";
550 regulator-always-on;
551 regulator-boot-on;
552 regulator-min-microvolt = <1800000>;
553 regulator-max-microvolt = <3000000>;
554
555 regulator-state-mem {
556 regulator-on-in-suspend;
557 regulator-suspend-microvolt = <3000000>;
558 };
559 };
560
561 vcca3v0_codec: LDO_REG5 {
562 regulator-name = "vcca3v0_codec";
563 regulator-always-on;
564 regulator-boot-on;
565 regulator-min-microvolt = <3000000>;
566 regulator-max-microvolt = <3000000>;
567
568 regulator-state-mem {
569 regulator-off-in-suspend;
570 };
571 };
572
573 vcc_1v5: LDO_REG6 {
574 regulator-name = "vcc_1v5";
575 regulator-always-on;
576 regulator-boot-on;
577 regulator-min-microvolt = <1500000>;
578 regulator-max-microvolt = <1500000>;
579
580 regulator-state-mem {
581 regulator-on-in-suspend;
582 regulator-suspend-microvolt = <1500000>;
583 };
584 };
585
586 vcca1v8_codec: LDO_REG7 {
587 regulator-name = "vcca1v8_codec";
588 regulator-always-on;
589 regulator-boot-on;
590 regulator-min-microvolt = <1800000>;
591 regulator-max-microvolt = <1800000>;
592
593 regulator-state-mem {
594 regulator-off-in-suspend;
595 };
596 };
597
598 vcc_3v0: LDO_REG8 {
599 regulator-name = "vcc_3v0";
600 regulator-always-on;
601 regulator-boot-on;
602 regulator-min-microvolt = <3000000>;
603 regulator-max-microvolt = <3000000>;
604
605 regulator-state-mem {
606 regulator-on-in-suspend;
607 regulator-suspend-microvolt = <3000000>;
608 };
609 };
610
611 vcc3v3_s3: SWITCH_REG1 {
612 regulator-name = "vcc3v3_s3";
613 regulator-always-on;
614 regulator-boot-on;
615
616 regulator-state-mem {
617 regulator-off-in-suspend;
618 };
619 };
620
621 vcc3v3_s0: SWITCH_REG2 {
622 regulator-name = "vcc3v3_s0";
623 regulator-always-on;
624 regulator-boot-on;
625
626 regulator-state-mem {
627 regulator-off-in-suspend;
628 };
629 };
630 };
631 };
632
633 vdd_cpu_b: regulator@40 {
634 compatible = "silergy,syr827";
635 reg = <0x40>;
636 fcs,suspend-voltage-selector = <1>;
637 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100638 pinctrl-0 = <&vsel1_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100639 regulator-name = "vdd_cpu_b";
640 regulator-always-on;
641 regulator-boot-on;
642 regulator-min-microvolt = <712500>;
643 regulator-max-microvolt = <1500000>;
644 regulator-ramp-delay = <1000>;
645 vin-supply = <&vcc_1v8>;
646
647 regulator-state-mem {
648 regulator-off-in-suspend;
649 };
650 };
651
652 vdd_gpu: regulator@41 {
653 compatible = "silergy,syr828";
654 reg = <0x41>;
655 fcs,suspend-voltage-selector = <1>;
656 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100657 pinctrl-0 = <&vsel2_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100658 regulator-name = "vdd_gpu";
659 regulator-always-on;
660 regulator-boot-on;
661 regulator-min-microvolt = <712500>;
662 regulator-max-microvolt = <1500000>;
663 regulator-ramp-delay = <1000>;
664 vin-supply = <&vcc_1v8>;
665
666 regulator-state-mem {
667 regulator-off-in-suspend;
668 };
669 };
670};
671
672&i2c1 {
673 clock-frequency = <100000>;
674 i2c-scl-falling-time-ns = <4>;
675 i2c-scl-rising-time-ns = <168>;
676 status = "okay";
677
678 es8316: es8316@11 {
679 compatible = "everest,es8316";
680 reg = <0x11>;
681 clocks = <&cru SCLK_I2S_8CH_OUT>;
682 clock-names = "mclk";
683 #sound-dai-cells = <0>;
684 };
685};
686
687&i2c3 {
688 i2c-scl-falling-time-ns = <15>;
689 i2c-scl-rising-time-ns = <450>;
690 status = "okay";
691};
692
693&i2c4 {
694 i2c-scl-falling-time-ns = <20>;
695 i2c-scl-rising-time-ns = <600>;
696 status = "okay";
697
698 fusb0: fusb30x@22 {
699 compatible = "fcs,fusb302";
700 reg = <0x22>;
Peter Robinson7c79b872021-07-22 16:20:42 +0100701 interrupt-parent = <&gpio1>;
702 interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
Peter Robinson70d70792020-04-20 20:27:35 +0100703 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100704 pinctrl-0 = <&fusb0_int_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +0100705 vbus-supply = <&vbus_typec>;
706
707 connector {
708 compatible = "usb-c-connector";
Peter Robinson36d70892022-06-12 15:25:29 +0100709 data-role = "dual";
Peter Robinson70d70792020-04-20 20:27:35 +0100710 label = "USB-C";
711 op-sink-microwatt = <1000000>;
712 power-role = "dual";
713 sink-pdos =
714 <PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
715 source-pdos =
716 <PDO_FIXED(5000, 1400, PDO_FIXED_USB_COMM)>;
717 try-power-role = "sink";
718
719 ports {
720 #address-cells = <1>;
721 #size-cells = <0>;
722
723 port@0 {
724 reg = <0>;
725
726 usbc_hs: endpoint {
727 remote-endpoint =
728 <&u2phy0_typec_hs>;
729 };
730 };
731
732 port@1 {
733 reg = <1>;
734
735 usbc_ss: endpoint {
736 remote-endpoint =
737 <&tcphy0_typec_ss>;
738 };
739 };
740
741 port@2 {
742 reg = <2>;
743
744 usbc_dp: endpoint {
745 remote-endpoint =
746 <&tcphy0_typec_dp>;
747 };
748 };
749 };
750 };
751 };
Peter Robinson7c79b872021-07-22 16:20:42 +0100752
753 cw2015@62 {
754 compatible = "cellwise,cw2015";
755 reg = <0x62>;
756 cellwise,battery-profile = /bits/ 8 <
757 0x17 0x67 0x80 0x73 0x6E 0x6C 0x6B 0x63
758 0x77 0x51 0x5C 0x58 0x50 0x4C 0x48 0x36
759 0x15 0x0C 0x0C 0x19 0x5B 0x7D 0x6F 0x69
760 0x69 0x5B 0x0C 0x29 0x20 0x40 0x52 0x59
761 0x57 0x56 0x54 0x4F 0x3B 0x1F 0x7F 0x17
762 0x06 0x1A 0x30 0x5A 0x85 0x93 0x96 0x2D
763 0x48 0x77 0x9C 0xB3 0x80 0x52 0x94 0xCB
764 0x2F 0x00 0x64 0xA5 0xB5 0x11 0xF0 0x11
765 >;
766 cellwise,monitor-interval-ms = <5000>;
767 monitored-battery = <&bat>;
768 power-supplies = <&mains_charger>, <&fusb0>;
769 };
Peter Robinson70d70792020-04-20 20:27:35 +0100770};
771
772&i2s1 {
Peter Robinson70d70792020-04-20 20:27:35 +0100773 pinctrl-names = "default";
Peter Robinson7c79b872021-07-22 16:20:42 +0100774 pinctrl-0 = <&i2s_8ch_mclk_pin>, <&i2s1_2ch_bus>;
Peter Robinson70d70792020-04-20 20:27:35 +0100775 rockchip,capture-channels = <8>;
776 rockchip,playback-channels = <8>;
777 status = "okay";
778};
779
780&io_domains {
781 audio-supply = <&vcc_3v0>;
782 gpio1830-supply = <&vcc_3v0>;
783 sdmmc-supply = <&vcc_sdio>;
784 status = "okay";
785};
786
787&pcie_phy {
788 status = "okay";
789};
790
791&pcie0 {
792 bus-scan-delay-ms = <1000>;
793 ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
Peter Robinson70d70792020-04-20 20:27:35 +0100794 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 {
Peter Robinson7c79b872021-07-22 16:20:42 +0100805 pwrbtn_pin: pwrbtn-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100806 rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
807 };
808
Peter Robinson7c79b872021-07-22 16:20:42 +0100809 lidbtn_pin: lidbtn-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100810 rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
811 };
812 };
813
814 dc-charger {
Peter Robinson7c79b872021-07-22 16:20:42 +0100815 dc_det_pin: dc-det-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100816 rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
817 };
818 };
819
820 es8316 {
Peter Robinson7c79b872021-07-22 16:20:42 +0100821 hp_det_pin: hp-det-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100822 rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
823 };
824 };
825
826 fusb302x {
Peter Robinson7c79b872021-07-22 16:20:42 +0100827 fusb0_int_pin: fusb0-int-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100828 rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
829 };
830 };
831
832 i2s1 {
Peter Robinson7c79b872021-07-22 16:20:42 +0100833 i2s_8ch_mclk_pin: i2s-8ch-mclk-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100834 rockchip,pins = <4 RK_PA0 1 &pcfg_pull_none>;
835 };
836 };
837
838 lcd-panel {
Peter Robinson7c79b872021-07-22 16:20:42 +0100839 lcdvcc_en_pin: lcdvcc-en-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100840 rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
841 };
842
Peter Robinson7c79b872021-07-22 16:20:42 +0100843 panel_en_pin: panel-en-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100844 rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
845 };
846
Peter Robinson7c79b872021-07-22 16:20:42 +0100847 lcd_panel_reset_pin: lcd-panel-reset-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100848 rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
849 };
850 };
851
852 leds {
Peter Robinson7c79b872021-07-22 16:20:42 +0100853 pwr_led_pin: pwr-led-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100854 rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
855 };
856
Peter Robinson7c79b872021-07-22 16:20:42 +0100857 slp_led_pin: slp-led-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100858 rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
859 };
860 };
861
862 pmic {
Peter Robinson7c79b872021-07-22 16:20:42 +0100863 pmic_int_l_pin: pmic-int-l-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100864 rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
865 };
866
Peter Robinson7c79b872021-07-22 16:20:42 +0100867 vsel1_pin: vsel1-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100868 rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
869 };
870
Peter Robinson7c79b872021-07-22 16:20:42 +0100871 vsel2_pin: vsel2-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100872 rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
873 };
874 };
875
876 sdcard {
Peter Robinson7c79b872021-07-22 16:20:42 +0100877 sdmmc0_pwr_h_pin: sdmmc0-pwr-h-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100878 rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
879 };
880
881 };
882
883 sdio-pwrseq {
Peter Robinson7c79b872021-07-22 16:20:42 +0100884 wifi_enable_h_pin: wifi-enable-h-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100885 rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
886 };
887 };
888
889 usb-typec {
Peter Robinson7c79b872021-07-22 16:20:42 +0100890 vcc5v0_typec0_en_pin: vcc5v0-typec0-en-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100891 rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
892 };
893 };
894
895 usb2 {
Peter Robinson7c79b872021-07-22 16:20:42 +0100896 pwr_5v_pin: pwr-5v-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100897 rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
898 };
899
Peter Robinson7c79b872021-07-22 16:20:42 +0100900 vcc5v0_host_en_pin: vcc5v0-host-en-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100901 rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
902 };
903 };
904
905 wireless-bluetooth {
Peter Robinson7c79b872021-07-22 16:20:42 +0100906 bt_wake_pin: bt-wake-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100907 rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
908 };
909
Peter Robinson7c79b872021-07-22 16:20:42 +0100910 bt_host_wake_pin: bt-host-wake-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100911 rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
912 };
913
Peter Robinson7c79b872021-07-22 16:20:42 +0100914 bt_reset_pin: bt-reset-pin {
Peter Robinson70d70792020-04-20 20:27:35 +0100915 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";
Peter Robinson7c79b872021-07-22 16:20:42 +01001062 pinctrl-0 = <&bt_host_wake_pin &bt_wake_pin &bt_reset_pin>;
Peter Robinson70d70792020-04-20 20:27:35 +01001063 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};