rk3399-rockpro64.dts 24.5 KB
Newer Older
1
/*
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd
 *
 * This file is dual-licensed: you can use it either under the terms
 * of the GPL or the X11 license, at your option. Note that this dual
 * licensing only applies to this file, and not this project as a
 * whole.
 *
 *  a) This file is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License as
 *     published by the Free Software Foundation; either version 2 of the
 *     License, or (at your option) any later version.
 *
 *     This file is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 * Or, alternatively,
 *
 *  b) Permission is hereby granted, free of charge, to any person
 *     obtaining a copy of this software and associated documentation
 *     files (the "Software"), to deal in the Software without
 *     restriction, including without limitation the rights to use,
 *     copy, modify, merge, publish, distribute, sublicense, and/or
 *     sell copies of the Software, and to permit persons to whom the
 *     Software is furnished to do so, subject to the following
 *     conditions:
 *
 *     The above copyright notice and this permission notice shall be
 *     included in all copies or substantial portions of the Software.
 *
 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *     OTHER DEALINGS IN THE SOFTWARE.
41 42 43
 */

/dts-v1/;
44 45 46 47
#include <dt-bindings/pwm/pwm.h>
#include <dt-bindings/input/input.h>
#include "rk3399.dtsi"
#include "rk3399-opp.dtsi"
48 49 50 51

/ {
	model = "Pine64 RockPro64";
	compatible = "pine64,rockpro64", "rockchip,rk3399";
52 53

	chosen {
54
		bootargs = "earlycon=uart8250,mmio32,0xff1a0000 swiotlb=1";
55 56 57
		stdout-path = "serial2:1500000n8";
	};

58 59 60 61 62 63 64 65 66 67 68
	reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;

		drm_logo: drm-logo@00000000 {
			compatible = "rockchip,drm-logo";
			reg = <0x0 0x0 0x0 0x0>;
		};
	};

69 70 71 72 73 74
	/* first 64k(0xff8c0000~0xff8d0000) for ddr and suspend */
	iram: sram@ff8d0000 {
		compatible = "mmio-sram";
		reg = <0x0 0xff8d0000 0x0 0x20000>; /* 128k */
	};

75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
	aliases {
		ethernet0 = &gmac;
	};

	dc_12v: dc-12v {
		compatible = "regulator-fixed";
		regulator-name = "dc_12v";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <12000000>;
		regulator-max-microvolt = <12000000>;
	};

	vcc3v3_pcie: vcc3v3-pcie-regulator {
		compatible = "regulator-fixed";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		enable-active-high;
		gpio = <&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&pcie_pwr_en>;
		regulator-name = "vcc3v3_pcie";
		vin-supply = <&dc_12v>;
	};

	vcc1v8_s0: vcc1v8-s0 {
		compatible = "regulator-fixed";
		regulator-name = "vcc1v8_s0";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-always-on;
	};

	vcc_sys: vcc-sys {
		compatible = "regulator-fixed";
		regulator-name = "vcc_sys";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
		vin-supply = <&dc_12v>;
	};

	vcc_phy: vcc-phy-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vcc_phy";
		regulator-always-on;
		regulator-boot-on;
	};

	vcc3v3_sys: vcc3v3-sys {
		compatible = "regulator-fixed";
		regulator-name = "vcc3v3_sys";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
		vin-supply = <&vcc_sys>;
	};

	vcc5v0_host: vcc5v0-host-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&host_vbus_drv>;
		regulator-name = "vcc5v0_host";
		regulator-always-on;
	};

	vdd_log: vdd-log {
		compatible = "pwm-regulator";
		pwms = <&pwm2 0 25000 1>;
146
		pwm-supply = <&vcc_sys>;
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
		regulator-name = "vdd_log";
		regulator-min-microvolt = <800000>;
		regulator-max-microvolt = <1400000>;
		regulator-always-on;
		regulator-boot-on;

		/* for rockchip boot on */
		rockchip,pwm_id= <2>;
		rockchip,pwm_voltage = <900000>;
	};

	clkin_gmac: external-gmac-clock {
		compatible = "fixed-clock";
		clock-frequency = <125000000>;
		clock-output-names = "clkin_gmac";
		#clock-cells = <0>;
	};

	spdif_out: spdif-out {
		status = "okay";
		compatible = "linux,spdif-dit";
		#sound-dai-cells = <0>;
	};

	sdio_pwrseq: sdio-pwrseq {
		compatible = "mmc-pwrseq-simple";
		clocks = <&rk808 1>;
		clock-names = "ext_clock";
		pinctrl-names = "default";
		pinctrl-0 = <&wifi_enable_h>;

		/*
		 * On the module itself this is one of these (depending
		 * on the actual card populated):
		 * - SDIO_RESET_L_WL_REG_ON
		 * - PDN (power down when low)
		 */
		reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
	};

187 188 189 190 191 192 193
	xin32k: xin32k {
		compatible = "fixed-clock";
		clock-frequency = <32768>;
		clock-output-names = "xin32k";
		#clock-cells = <0>;
	};

194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
	wireless-wlan {
		compatible = "wlan-platdata";
		rockchip,grf = <&grf>;
		wifi_chip_type = "ap6354";
		sdio_vref = <1800>;
		WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>;
		status = "okay";
	};

	wireless-bluetooth {
		compatible = "bluetooth-platdata";
		clocks = <&rk808 1>;
		clock-names = "ext_clock";
		uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default", "rts_gpio";
		pinctrl-0 = <&uart0_rts>;
		pinctrl-1 = <&uart0_gpios>;
		BT,reset_gpio    = <&gpio0 9 GPIO_ACTIVE_HIGH>;
		BT,wake_gpio     = <&gpio2 27 GPIO_ACTIVE_HIGH>;
		BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>;
		status = "okay";
	};

217 218 219 220 221 222 223
	hdmi_dp_sound: hdmi-dp-sound {
		status = "okay";
		compatible = "rockchip,rk3399-hdmi-dp";
		rockchip,cpu = <&i2s2>;
		rockchip,codec = <&hdmi>, <&cdn_dp>;
	};

224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
	es8316-sound {
		status = "okay";
		compatible = "simple-audio-card";
		simple-audio-card,format = "i2s";
		simple-audio-card,name = "rockchip,es8316-codec";
		simple-audio-card,mclk-fs = <256>;
		simple-audio-card,widgets =
			"Microphone", "Mic Jack",
			"Headphone", "Headphone Jack";
		simple-audio-card,routing =
			"Mic Jack", "MICBIAS1",
			"IN1P", "Mic Jack",
			"Headphone Jack", "HPOL",
			"Headphone Jack", "HPOR";
		simple-audio-card,cpu {
			sound-dai = <&i2s1>;
		};
		simple-audio-card,codec {
			sound-dai = <&es8316>;
		};
	};

246 247 248 249 250 251 252 253 254 255 256 257
	spdif-sound {
		status = "okay";
		compatible = "simple-audio-card";
		simple-audio-card,name = "ROCKCHIP,SPDIF";
		simple-audio-card,cpu {
			sound-dai = <&spdif>;
		};
		simple-audio-card,codec {
			sound-dai = <&spdif_out>;
		};
	};

258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
	test-power {
		status = "okay";
	};

	leds {
		status = "okay";
		compatible = "gpio-leds";
		work-led {
			gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "none";
			default-state = "on";
			mode = <0x23>;
		};
		diy-led {
			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "none";
			default-state = "on";
			mode = <0x23>;
		};
	};

279 280
	fan0: pwm-fan {
		compatible = "pwm-fan";
281
		pwms = <&pwm1 0 20000000 0>;
282 283 284 285 286 287
		cooling-min-state = <0>;
		cooling-max-state = <3>;
		#cooling-cells = <2>;
		cooling-levels = <0 102 170 230>;
	}; 

288 289 290 291 292 293 294 295 296 297 298 299 300
	rk_key: rockchip-key {
		compatible = "rockchip,key";
		status = "okay";

		io-channels = <&saradc 1>;

		power-key {
			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
			linux,code = <116>;
			label = "power";
			gpio-key,wakeup;
		};
	};
301 302
};

303 304 305 306 307 308 309 310 311
&sdmmc {
	clock-frequency = <50000000>;
	clock-freq-min-max = <400000 150000000>;
	supports-sd;
	bus-width = <4>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	disable-wp;
	num-slots = <1>;
312
	sd-uhs-sdr104;
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
	vqmmc-supply = <&vcc_sd>;
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
	card-detect-delay = <800>;
	status = "okay";
};

&sdio0 {
	clock-frequency = <50000000>;
	clock-freq-min-max = <200000 50000000>;
	supports-sdio;
	bus-width = <4>;
	disable-wp;
	cap-sd-highspeed;
	cap-sdio-irq;
	keep-power-in-suspend;
	mmc-pwrseq = <&sdio_pwrseq>;
	non-removable;
	num-slots = <1>;
332
	pinctrl-names = "default";
333 334
	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
	sd-uhs-sdr104;
335
	status = "disabled";
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
};

&emmc_phy {
	status = "okay";
};

&sdhci {
	bus-width = <8>;
	//mmc-hs400-1_8v;
	mmc-hs200-1_8v;
	supports-emmc;
	non-removable;
	keep-power-in-suspend;
	//mmc-hs400-enhanced-strobe;
	status = "okay";
};

&i2s0 {
	status = "okay";
	rockchip,i2s-broken-burst-len;
	rockchip,playback-channels = <8>;
	rockchip,capture-channels = <8>;
	#sound-dai-cells = <0>;
};

&i2s1 {
	status = "okay";
	rockchip,i2s-broken-burst-len;
	rockchip,playback-channels = <8>;
	rockchip,capture-channels = <8>;
	#sound-dai-cells = <0>;
};

&i2s2 {
370
	status = "okay";
371 372 373 374 375 376 377 378 379 380 381
	#sound-dai-cells = <0>;
};

&spdif {
	pinctrl-0 = <&spdif_bus_1>;
	status = "okay";
	#sound-dai-cells = <0>;
};

&i2c0 {
	status = "okay";
382 383
	i2c-scl-rising-time-ns = <180>;
	i2c-scl-falling-time-ns = <30>;
384 385 386 387 388 389 390 391 392
	clock-frequency = <400000>;

	vdd_cpu_b: syr827@40 {
		compatible = "silergy,syr827";
		reg = <0x40>;
		regulator-compatible = "fan53555-reg";
		pinctrl-0 = <&vsel1_gpio>;
		vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
		regulator-name = "vdd_cpu_b";
393
		regulator-min-microvolt = <712500>;
394
		regulator-max-microvolt = <1500000>;
395
		regulator-ramp-delay = <1000>;
396 397 398 399 400 401 402 403 404 405
		fcs,suspend-voltage-selector = <1>;
		regulator-always-on;
		regulator-boot-on;
		vin-supply = <&vcc_sys>;
		regulator-state-mem {
			regulator-off-in-suspend;
		};
	};

	vdd_gpu: syr828@41 {
406
		compatible = "silergy,syr828";
407 408 409 410 411
		reg = <0x41>;
		regulator-compatible = "fan53555-reg";
		pinctrl-0 = <&vsel2_gpio>;
		vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
		regulator-name = "vdd_gpu";
412
		regulator-min-microvolt = <712500>;
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434
		regulator-max-microvolt = <1500000>;
		regulator-ramp-delay = <1000>;
		fcs,suspend-voltage-selector = <1>;
		regulator-always-on;
		regulator-boot-on;
		vin-supply = <&vcc_sys>;
		regulator-initial-mode = <1>; /* 1:force PWM 2:auto */
		regulator-state-mem {
			regulator-off-in-suspend;
		};
	};

	rk808: pmic@1b {
		compatible = "rockchip,rk808";
		reg = <0x1b>;
		interrupt-parent = <&gpio1>;
		interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&pmic_int_l>;
		rockchip,system-power-controller;
		wakeup-source;
		#clock-cells = <1>;
435
		clock-output-names = "rk808-clkout1", "rk808-clkout2";
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452

		vcc1-supply = <&vcc_sys>;
		vcc2-supply = <&vcc_sys>;
		vcc3-supply = <&vcc_sys>;
		vcc4-supply = <&vcc_sys>;
		vcc6-supply = <&vcc_sys>;
		vcc7-supply = <&vcc_sys>;
		vcc8-supply = <&vcc3v3_sys>;
		vcc9-supply = <&vcc_sys>;
		vcc10-supply = <&vcc_sys>;
		vcc11-supply = <&vcc_sys>;
		vcc12-supply = <&vcc3v3_sys>;
		vddio-supply = <&vcc_1v8>;

		regulators {
			vdd_center: DCDC_REG1 {
				regulator-name = "vdd_center";
453 454
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <900000>;
455
				regulator-ramp-delay = <6001>;
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-off-in-suspend;
				};
			};

			vdd_cpu_l: DCDC_REG2 {
				regulator-name = "vdd_cpu_l";
				regulator-min-microvolt = <750000>;
				regulator-max-microvolt = <1350000>;
				regulator-ramp-delay = <6001>;
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-off-in-suspend;
				};
			};

			vcc_ddr: DCDC_REG3 {
				regulator-name = "vcc_ddr";
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
				};
			};

			vcc_1v8: DCDC_REG4 {
				regulator-name = "vcc_1v8";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <1800000>;
				};
			};

			vcc1v8_dvp: LDO_REG1 {
				regulator-name = "vcc1v8_dvp";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <1800000>;
				};
			};

			vcc3v0_touch: LDO_REG2 {
				regulator-name = "vcc3v0_touch";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3000000>;
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <3000000>;
				};
			};

			vcc1v8_pmu: LDO_REG3 {
				regulator-name = "vcc1v8_pmu";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <1800000>;
				};
			};

			vcc_sd: LDO_REG4 {
				regulator-name = "vcc_sd";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <3300000>;
				};
			};

			vcca3v0_codec: LDO_REG5 {
				regulator-name = "vcca3v0_codec";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3000000>;
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <3000000>;
				};
			};

			vcc_1v5: LDO_REG6 {
				regulator-name = "vcc_1v5";
				regulator-min-microvolt = <1500000>;
				regulator-max-microvolt = <1500000>;
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <1500000>;
				};
			};

			vcca1v8_codec: LDO_REG7 {
				regulator-name = "vcca1v8_codec";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <1800000>;
				};
			};

			vcc_3v0: LDO_REG8 {
				regulator-name = "vcc_3v0";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3000000>;
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <3000000>;
				};
			};

			vcc3v3_s3: SWITCH_REG1 {
				regulator-name = "vcc3v3_s3";
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
				};
			};

			vcc3v3_s0: SWITCH_REG2 {
				regulator-name = "vcc3v3_s0";
				regulator-always-on;
				regulator-boot-on;
				regulator-state-mem {
					regulator-on-in-suspend;
				};
			};
		};
	};
};

&cpu_l0 {
	cpu-supply = <&vdd_cpu_l>;
};

&cpu_l1 {
	cpu-supply = <&vdd_cpu_l>;
};

&cpu_l2 {
	cpu-supply = <&vdd_cpu_l>;
};

&cpu_l3 {
	cpu-supply = <&vdd_cpu_l>;
};

&cpu_b0 {
	cpu-supply = <&vdd_cpu_b>;
};

&cpu_b1 {
	cpu-supply = <&vdd_cpu_b>;
};

&gpu {
638
	status = "okay";
639 640 641 642
	mali-supply = <&vdd_gpu>;
};

&threshold {
643
	temperature = <80000>;
644 645 646
};

&target {
647
	temperature = <95000>;
648 649 650
};

&soc_crit {
651
	temperature = <100000>;
652 653
};

654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671
&cooling_maps {
	map3 {
		trip = <&threshold>;
		cooling-device = <&fan0 0 1>;
		contribution = <4096>;
	};
	map4 {
		trip = <&target>;
		cooling-device = <&fan0 1 2>;
		contribution = <4096>;
	};
	map5 {
		trip = <&soc_crit>;
		cooling-device = <&fan0 2 3>;
		contribution = <4096>;
	};
};

672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719
&tcphy0 {
	extcon = <&fusb0>;
	status = "okay";
};

&tcphy1 {
	status = "okay";
};

&tsadc {
	/* tshut mode 0:CRU 1:GPIO */
	rockchip,hw-tshut-mode = <1>;
	/* tshut polarity 0:LOW 1:HIGH */
	rockchip,hw-tshut-polarity = <1>;
	rockchip,hw-tshut-temp = <110000>;
	status = "okay";
};

&u2phy0 {
	status = "okay";
	extcon = <&fusb0>;

	u2phy0_otg: otg-port {
		status = "okay";
	};

	u2phy0_host: host-port {
		phy-supply = <&vcc5v0_host>;
		status = "okay";
	};
};

&u2phy1 {
	status = "okay";

	u2phy1_otg: otg-port {
		status = "okay";
	};

	u2phy1_host: host-port {
		phy-supply = <&vcc5v0_host>;
		status = "okay";
	};
};

&uart0 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart0_xfer &uart0_cts>;
720
	status = "disabled";
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761
};

&uart2 {
	status = "okay";
};

&usb_host0_ehci {
	status = "okay";
};

&usb_host0_ohci {
	status = "okay";
};

&usb_host1_ehci {
	status = "okay";
};

&usb_host1_ohci {
	status = "okay";
};

&usbdrd3_0 {
	extcon = <&fusb0>;
	status = "okay";
};

&usbdrd_dwc3_0 {
	dr_mode = "otg";
	status = "okay";
};

&usbdrd3_1 {
	status = "okay";
};

&usbdrd_dwc3_1 {
	dr_mode = "host";
	status = "okay";
};

762 763 764 765 766
&pwm1 {
	status = "okay";
	pinctrl-names = "active";
};

767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951
&pwm2 {
	status = "okay";
	pinctrl-names = "active";
	pinctrl-0 = <&pwm2_pin_pull_down>;
};

&pwm3 {
	status = "okay";

	interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH 0>;
	compatible = "rockchip,remotectl-pwm";
	remote_pwm_id = <3>;
	handle_cpu_id = <1>;
	remote_support_psci = <1>;

	ir_key1 {
		rockchip,usercode = <0x4040>;
		rockchip,key_table =
			<0xf2	KEY_REPLY>,
			<0xba	KEY_BACK>,
			<0xf4	KEY_UP>,
			<0xf1	KEY_DOWN>,
			<0xef	KEY_LEFT>,
			<0xee	KEY_RIGHT>,
			<0xbd	KEY_HOME>,
			<0xea	KEY_VOLUMEUP>,
			<0xe3	KEY_VOLUMEDOWN>,
			<0xe2	KEY_SEARCH>,
			<0xb2	KEY_POWER>,
			<0xbc	KEY_MUTE>,
			<0xec	KEY_MENU>,
			<0xbf	0x190>,
			<0xe0	0x191>,
			<0xe1	0x192>,
			<0xe9	183>,
			<0xe6	248>,
			<0xe8	185>,
			<0xe7	186>,
			<0xf0	388>,
			<0xbe	0x175>;
	};

	ir_key2 {
		rockchip,usercode = <0xff00>;
		rockchip,key_table =
			<0xf9	KEY_HOME>,
			<0xbf	KEY_BACK>,
			<0xfb	KEY_MENU>,
			<0xaa	KEY_REPLY>,
			<0xb9	KEY_UP>,
			<0xe9	KEY_DOWN>,
			<0xb8	KEY_LEFT>,
			<0xea	KEY_RIGHT>,
			<0xeb	KEY_VOLUMEDOWN>,
			<0xef	KEY_VOLUMEUP>,
			<0xf7	KEY_MUTE>,
			<0xe7	KEY_POWER>,
			<0xfc	KEY_POWER>,
			<0xa9	KEY_VOLUMEDOWN>,
			<0xa8	KEY_VOLUMEDOWN>,
			<0xe0	KEY_VOLUMEDOWN>,
			<0xa5	KEY_VOLUMEDOWN>,
			<0xab	183>,
			<0xb7	388>,
			<0xe8	388>,
			<0xf8	184>,
			<0xaf	185>,
			<0xed	KEY_VOLUMEDOWN>,
			<0xee	186>,
			<0xb3	KEY_VOLUMEDOWN>,
			<0xf1	KEY_VOLUMEDOWN>,
			<0xf2	KEY_VOLUMEDOWN>,
			<0xf3	KEY_SEARCH>,
			<0xb4	KEY_VOLUMEDOWN>,
			<0xbe	KEY_SEARCH>;
	};

	ir_key3 {
		rockchip,usercode = <0x1dcc>;
		rockchip,key_table =
			<0xee	KEY_REPLY>,
			<0xf0	KEY_BACK>,
			<0xf8	KEY_UP>,
			<0xbb	KEY_DOWN>,
			<0xef	KEY_LEFT>,
			<0xed	KEY_RIGHT>,
			<0xfc	KEY_HOME>,
			<0xf1	KEY_VOLUMEUP>,
			<0xfd	KEY_VOLUMEDOWN>,
			<0xb7	KEY_SEARCH>,
			<0xff	KEY_POWER>,
			<0xf3	KEY_MUTE>,
			<0xbf	KEY_MENU>,
			<0xf9	0x191>,
			<0xf5	0x192>,
			<0xb3	388>,
			<0xbe	KEY_1>,
			<0xba	KEY_2>,
			<0xb2	KEY_3>,
			<0xbd	KEY_4>,
			<0xf9	KEY_5>,
			<0xb1	KEY_6>,
			<0xfc	KEY_7>,
			<0xf8	KEY_8>,
			<0xb0	KEY_9>,
			<0xb6	KEY_0>,
			<0xb5	KEY_BACKSPACE>;
	};
};

&gmac {
	phy-supply = <&vcc_phy>;
	phy-mode = "rgmii";
	clock_in_out = "input";
	snps,reset-gpio = <&gpio3 15 GPIO_ACTIVE_LOW>;
	snps,reset-active-low;
	snps,reset-delays-us = <0 10000 50000>;
	assigned-clocks = <&cru SCLK_RMII_SRC>;
	assigned-clock-parents = <&clkin_gmac>;
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&rgmii_pins>;
	pinctrl-1 = <&rgmii_sleep_pins>;
	tx_delay = <0x28>;
	rx_delay = <0x20>;
	status = "okay";
};

&saradc {
	status = "okay";
};

&io_domains {
	status = "okay";

	bt656-supply = <&vcc1v8_s0>; /* bt656_gpio2ab_ms */
	audio-supply = <&vcc1v8_s0>; /* audio_gpio3d4a_ms */
	sdmmc-supply = <&vcc_sd>; /* sdmmc_gpio4b_ms */
	gpio1830-supply = <&vcc_3v0>; /* gpio1833_gpio4cd_ms */
};

&pinctrl {
	sdio-pwrseq {
		wifi_enable_h: wifi-enable-h {
			rockchip,pins =
				<0 10 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	wireless-bluetooth {
		uart0_gpios: uart0-gpios {
			rockchip,pins =
				<2 19 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	usb2 {
		host_vbus_drv: host-vbus-drv {
			rockchip,pins =
				<4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	pmic {
		pmic_int_l: pmic-int-l {
			rockchip,pins =
				<1 21 RK_FUNC_GPIO &pcfg_pull_up>;
		};

		vsel1_gpio: vsel1-gpio {
			rockchip,pins =
				<1 17 RK_FUNC_GPIO &pcfg_pull_down>;
		};

		vsel2_gpio: vsel2-gpio {
			rockchip,pins =
				<1 14 RK_FUNC_GPIO &pcfg_pull_down>;
		};
	};

	gmac {
		rgmii_sleep_pins: rgmii-sleep-pins {
			rockchip,pins =
				<3 15 RK_FUNC_GPIO &pcfg_output_low>;
		};
	};
952 953 954

	fusb30x {
		fusb0_int: fusb0-int {
955 956
			rockchip,pins =
				<1 2 RK_FUNC_GPIO &pcfg_pull_up>;
957 958
		};
	};
959

960 961 962 963 964
	pcie {
		pcie_pwr_en: pcie-pwr-en {
			rockchip,pins =
				<1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
		};
965 966 967
	};
};

968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010
&pvtm {
	status = "okay";
};

&pmu_pvtm {
	status = "okay";
};

&pmu_io_domains {
	status = "okay";
	pmu1830-supply = <&vcc_3v0>;
};

&rockchip_suspend {
	status = "okay";
	rockchip,sleep-debug-en = <0>;
	rockchip,sleep-mode-config = <
		(0
		| RKPM_SLP_ARMPD
		| RKPM_SLP_PERILPPD
		| RKPM_SLP_DDR_RET
		| RKPM_SLP_PLLPD
		| RKPM_SLP_CENTER_PD
		| RKPM_SLP_AP_PWROFF
		)
	>;
	rockchip,wakeup-config = <
		(0
		| RKPM_GPIO_WKUP_EN
		| RKPM_PWM_WKUP_EN
		)
	>;
	rockchip,pwm-regulator-config = <
		(0
		| PWM2_REGULATOR_EN
		)
	>;
	rockchip,power-ctrl =
		<&gpio1 17 GPIO_ACTIVE_HIGH>,
		<&gpio1 14 GPIO_ACTIVE_HIGH>;
};

&vopb {
1011
	status = "okay";
1012 1013 1014 1015
	assigned-clocks = <&cru DCLK_VOP0_DIV>;
	assigned-clock-parents = <&cru PLL_VPLL>;
};

1016 1017 1018 1019
&vopb_mmu {
	status = "okay";
};

1020
&vopl {
1021
	status = "okay";
1022 1023 1024 1025
	assigned-clocks = <&cru DCLK_VOP1_DIV>;
	assigned-clock-parents = <&cru PLL_CPLL>;
};

1026 1027 1028 1029
&vopb_mmu {
	status = "okay";
};

1030
&i2c4 {
1031
	status = "okay";
1032 1033 1034 1035 1036 1037 1038
	fusb0: fusb30x@22 {
		compatible = "fairchild,fusb302";
		reg = <0x22>;
		pinctrl-names = "default";
		pinctrl-0 = <&fusb0_int>;
		vbus-5v-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
		int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
1039 1040 1041 1042
		status = "okay";
	};
};

1043
&cdn_dp {
1044
	status = "okay";
1045
	extcon = <&fusb0>;
1046 1047
};

1048
&display_subsystem {
1049
	/delete-property/ devfreq;
1050
	status = "okay";
1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071

	ports = <&vopb_out>, <&vopl_out>;
	logo-memory-region = <&drm_logo>;

	route {
		route_hdmi: route-hdmi {
			logo,uboot = "logo.bmp";
			logo,kernel = "logo_kernel.bmp";
			logo,mode = "center";
			charge_logo,mode = "center";
			connect = <&vopb_out_hdmi>;
		};

		route_dp: route-dp {
			logo,uboot = "logo.bmp";
			logo,kernel = "logo_kernel.bmp";
			logo,mode = "center";
			charge_logo,mode = "center";
			connect = <&vopl_out_dp>;
		};
	};
1072 1073
};

1074
&hdmi {
1075
	status = "okay";
1076 1077 1078 1079 1080 1081
	rockchip,phy-table =
		<74250000 0x8009 0x0004 0x0272>,
		<165000000 0x802b 0x0004 0x0209>,
		<297000000 0x8039 0x0005 0x028d>,
		<594000000 0x8039 0x0000 0x019d>,
		<000000000 0x0000 0x0000 0x0000>;
1082 1083
};

1084
&pcie_phy {
1085 1086 1087
	status = "okay";
};

1088
&pcie0 {
1089 1090 1091 1092
	assigned-clocks = <&cru SCLK_PCIEPHY_REF>;
  assigned-clock-parents = <&cru SCLK_PCIEPHY_REF100M>;
  assigned-clock-rates = <100000000>;
	ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
1093 1094 1095
	num-lanes = <4>;
	max-link-speed = <2>;
	pinctrl-names = "default";
1096
	pinctrl-0 = <&pcie_clkreqn>;
1097
	vpcie3v3-supply = <&vcc3v3_pcie>;
1098 1099
	status = "okay";
};
1100 1101 1102 1103 1104 1105

&cluster0_opp {
	opp-1512000000 {
		opp-hz = /bits/ 64 <1512000000>;
		opp-microvolt = <1200000>;
		clock-latency-ns = <40000>;
1106
		status = "disabled";
1107 1108 1109
	};
};

1110 1111 1112 1113 1114
&cluster1_opp {
	opp-1992000000 {
		opp-hz = /bits/ 64 <1992000000>;
		opp-microvolt = <1300000>;
		clock-latency-ns = <40000>;
1115
		status = "disabled";
1116 1117 1118 1119 1120 1121 1122 1123 1124 1125
	};
};

&dmc_opp_table {
	opp-933000000 {
		opp-hz = /bits/ 64 <933000000>;
		opp-microvolt = <900000>;
	};
};

1126
&dfi {
1127
	status = "disabled";
1128 1129 1130
};

&dmc {
1131
	status = "disabled";
1132 1133 1134 1135 1136 1137
	center-supply = <&vdd_center>;
	upthreshold = <40>;
	downdifferential = <20>;
	system-status-freq = <
		/*system status         freq(KHz)*/
		SYS_STATUS_NORMAL       800000
1138 1139 1140 1141
		SYS_STATUS_REBOOT       400000
		SYS_STATUS_SUSPEND      400000
		SYS_STATUS_VIDEO_1080P  800000
		SYS_STATUS_VIDEO_4K     800000
1142 1143 1144
		SYS_STATUS_VIDEO_4K_10B 800000
		SYS_STATUS_PERFORMANCE  800000
		SYS_STATUS_BOOST        400000
1145 1146
		SYS_STATUS_DUALVIEW     800000
		SYS_STATUS_ISP          800000
1147 1148 1149 1150 1151 1152 1153 1154
	>;
	vop-bw-dmc-freq = <
	/* min_bw(MB/s) max_bw(MB/s) freq(KHz) */
		0       577      200000
		578     1701     300000
		1702    99999    400000
	>;
	auto-min-freq = <800000>;
1155
	auto-freq-en = <0>;
1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173
};

&i2c1 {
	status = "okay";
	i2c-scl-rising-time-ns = <168>;
	i2c-scl-falling-time-ns = <4>;

	es8316: es8316@10 {
		#sound-dai-cells = <0>;
		compatible = "everest,es8316";
		reg = <0x10>;
		clocks = <&cru SCLK_I2S_8CH_OUT>;
		clock-names = "mclk";
		pinctrl-names = "default";
		pinctrl-0 = <&i2s_8ch_mclk>;
		hp-det-gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_LOW>;
	};
};
1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207

&spi1 {
	status = "okay";

	spiflash: spi-flash@0 {
		#address-cells = <0x1>;
		#size-cells = <1>;
		compatible = "jedec,spi-nor";
		reg = <0x0>;
		spi-max-frequency = <25000000>;
		status = "okay";

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			loader@8000 {
				label = "loader";
				reg = <0x0 0x3F8000>;
			};

			env@3f8000 {
				label = "env";
				reg = <0x3F8000 0x8000>;
			};

			vendor@7c0000 {
				label = "vendor";
				reg = <0x7C0000 0x40000>;
			};
		};
	};
};