// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2022 Rockchip Electronics Co., Ltd.
 *
 */

/dts-v1/;

#include "rk3562.dtsi"
#include "rk3562-evb.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>

/ {
	model = "Rockchip RK3562 TEST2 DDR4 V10 Board";
	compatible = "rockchip,rk3562-test2-ddr4-v10", "rockchip,rk3562";

	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>;
	};

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

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

	vdd_npu: vdd-npu {
		compatible = "pwm-regulator";
		pwms = <&pwm6 0 5000 1>;
		regulator-name = "vdd_npu";
		regulator-min-microvolt = <800000>;
		regulator-max-microvolt = <1100000>;
		regulator-init-microvolt = <900000>;
		regulator-always-on;
		regulator-boot-on;
		regulator-settling-time-up-us = <250>;
		pwm-supply = <&vcc5v0_sys>;
		status = "okay";
	};
};

&dsi {
	status = "okay";
};

&dsi_in_vp0 {
	status = "okay";
};

&gmac0 {
	/* Use rgmii-rxid mode to disable rx delay inside Soc */
	phy-mode = "rmii";
	clock_in_out = "output";

	snps,reset-gpio = <&gpio4 RK_PB1 GPIO_ACTIVE_LOW>;
	snps,reset-active-low;
	/* Reset time is 20ms, 100ms for rtl8211f */
	snps,reset-delays-us = <0 20000 100000>;

	pinctrl-names = "default";
	pinctrl-0 = <&rgmiim0_miim
		     &rgmiim0_tx_bus2
		     &rgmiim0_rx_bus2
		     &rgmiim0_clk>;

	phy-handle = <&rmii_phy>;
	status = "okay";
};

&mdio0 {
	rmii_phy: phy@1 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <0x1>;
	};
};

&pwm6 {
	status = "okay";
};

&u2phy {
	status = "okay";
};

&u2phy_otg {
	status = "okay";
};

&usbdrd30 {
	status = "okay";
};

&usbdrd_dwc3 {
	status = "okay";
	dr_mode = "otg";
	extcon = <&u2phy>;
	maximum-speed = "high-speed";
	phys = <&u2phy_otg>;
	phy-names = "usb2-phy";
	snps,dis_u2_susphy_quirk;
	snps,usb2-lpm-disable;
};

&video_phy {
	status = "okay";
};
