Enable the DWC3 USB 3.0 controller and its associated usbphy2 on the
OrangePi RV2 board.
The board utilizes a Genesys Logic GL3523 hub, which requires two
separate power supplies: one VBUS and one for hub itself.
Add two GPIO-controlled fixed-regulators to manage this.
Define a 3.3v fixed voltage regulator to be used by PCIe on OPi RV2.
Define PCIe and PHY-related Device Tree nodes for the OPi RV2.
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
---
.../boot/dts/spacemit/k1-orangepi-rv2.dts | 90 +++++++++++++++++++
1 file changed, 90 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
index 1f08a2713345..fa30f8ba5c77 100644
--- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
@@ -23,6 +23,15 @@ chosen {
stdout-path = "serial0";
};
+ pcie_vcc_3v3: regulator-pcie-vcc3v3 {
+ compatible = "regulator-fixed";
+ regulator-name = "PCIE_VCC3V3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ gpio = <&gpio K1_GPIO(116) GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
reg_dc_in: regulator-dc-in-12v {
compatible = "regulator-fixed";
regulator-name = "dc_in_12v";
@@ -42,6 +51,24 @@ reg_vcc_4v: regulator-vcc-4v {
vin-supply = <®_dc_in>;
};
+ regulator-usb3-vbus-5v {
+ compatible = "regulator-fixed";
+ regulator-name = "USB30_VBUS";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpio K1_GPIO(97) GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ usb3_hub_5v: regulator-usb3-hub-5v {
+ compatible = "regulator-fixed";
+ regulator-name = "USB30_HUB";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpio K1_GPIO(123) GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
leds {
compatible = "gpio-leds";
@@ -54,6 +81,10 @@ led1 {
};
};
+&combo_phy {
+ status = "okay";
+};
+
ð0 {
phy-handle = <&rgmii0>;
phy-mode = "rgmii-id";
@@ -230,8 +261,67 @@ dldo7 {
};
};
+&pcie1_phy {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pcie1_3_cfg>;
+ status = "okay";
+};
+
+&pcie1_port {
+ phys = <&pcie1_phy>;
+ vpcie3v3-supply = <&pcie_vcc_3v3>;
+};
+
+&pcie1 {
+ vpcie3v3-supply = <&pcie_vcc_3v3>;
+ status = "okay";
+};
+
+&pcie2_phy {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pcie2_4_cfg>;
+ status = "okay";
+};
+
+&pcie2_port {
+ phys = <&pcie2_phy>;
+ vpcie3v3-supply = <&pcie_vcc_3v3>;
+};
+
+&pcie2 {
+ vpcie3v3-supply = <&pcie_vcc_3v3>;
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_2_cfg>;
status = "okay";
};
+
+&usbphy2 {
+ status = "okay";
+};
+
+&usb_dwc3 {
+ dr_mode = "host";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ hub_2_0: hub@1 {
+ compatible = "usb5e3,610";
+ reg = <0x1>;
+ vdd-supply = <&usb3_hub_5v>;
+ peer-hub = <&hub_3_0>;
+ reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>;
+ };
+
+ hub_3_0: hub@2 {
+ compatible = "usb5e3,620";
+ reg = <0x2>;
+ vdd-supply = <&usb3_hub_5v>;
+ peer-hub = <&hub_2_0>;
+ reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>;
+ };
+};
--
2.47.3
Hi,
> + regulator-usb3-vbus-5v {
> + compatible = "regulator-fixed";
> + regulator-name = "USB30_VBUS";
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> + gpio = <&gpio K1_GPIO(97) GPIO_ACTIVE_HIGH>;
Is this true?
> + enable-active-high;
> + };
> +
> + usb3_hub_5v: regulator-usb3-hub-5v {
> + compatible = "regulator-fixed";
> + regulator-name = "USB30_HUB";
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> + gpio = <&gpio K1_GPIO(123) GPIO_ACTIVE_HIGH>;
Although GPIO123 is labeled as USB_HUB_EN, it actually
supplies for USB3 vbus.
> + enable-active-high;
> + };
> ...
> + peer-hub = <&hub_3_0>;
> + reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>;
Really? GPIO124 is floating.
> + };
I still insist that the regulator name of DT should be the same
as on the schematic. This will force us to review the schematic.
Thanks,
Chukun
Hi Chukun, Han
I've merely checked the schematics..
On 16:00 Sat 14 Mar , Chukun Pan wrote:
> Hi,
>
> > + regulator-usb3-vbus-5v {
> > + compatible = "regulator-fixed";
> > + regulator-name = "USB30_VBUS";
> > + regulator-min-microvolt = <5000000>;
> > + regulator-max-microvolt = <5000000>;
> > + gpio = <&gpio K1_GPIO(97) GPIO_ACTIVE_HIGH>;
>
> Is this true?
GPIO97 should be DVL1 which labeled as CAMERA1_RST..
>
> > + enable-active-high;
> > + };
> > +
> > + usb3_hub_5v: regulator-usb3-hub-5v {
> > + compatible = "regulator-fixed";
> > + regulator-name = "USB30_HUB";
> > + regulator-min-microvolt = <5000000>;
> > + regulator-max-microvolt = <5000000>;
> > + gpio = <&gpio K1_GPIO(123) GPIO_ACTIVE_HIGH>;
>
> Although GPIO123 is labeled as USB_HUB_EN, it actually
> supplies for USB3 vbus.
>
I agree
> > + enable-active-high;
> > + };
>
> > ...
> > + peer-hub = <&hub_3_0>;
> > + reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>;
>
> Really? GPIO124 is floating.
>
Right, GPIO123 doesn't connect to any device
check the reset pin of GL3523, it connect to VCC_5V0 which is pulled high
unconditionally..
> > + };
>
> I still insist that the regulator name of DT should be the same
> as on the schematic. This will force us to review the schematic.
>
> Thanks,
> Chukun
Also, it seems the VCC5V0_USB20 is missing too, which controlled by
pin USB0_OTG_EN -> GPIO126
--
Yixun Lan (dlan)
© 2016 - 2026 Red Hat, Inc.