All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@kernel.org>
To: Rob Herring <robh+dt@kernel.org>, Heiko Stuebner <heiko@sntech.de>
Cc: Chen-Yu Tsai <wens@csie.org>,
	devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] arm64: dts: rockchip: rk3328: Enable USB3 Ethernet on NanoPi R2S
Date: Tue,  4 May 2021 16:36:16 +0800	[thread overview]
Message-ID: <20210504083616.9654-5-wens@kernel.org> (raw)
In-Reply-To: <20210504083616.9654-1-wens@kernel.org>

From: Chen-Yu Tsai <wens@csie.org>

The NanoPi R2S has a Realtek RTL8153B USB 3.0 Ethernet chip connected
to the USB 3.0 pins of the RK3328 SoC. Power to the chip is controlled
by a GPIO line toggled transistor switch, which is not a full-blown
voltage regulator.

At least in Linux, the USB 3.0 XHCI controller has two ports: the first
port is for legacy USB 2.0 and slower, while the second port is for USB
3.0. Since the Ethernet chip supports USB 3.0, it should be described
as connected to the second port.

Add the device nodes for the power switch and Ethernet chip, and enable
the USB 3.0 controller. The USB device node follows the standard USB
device binding.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 .../boot/dts/rockchip/rk3328-nanopi-r2s.dts   | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
index f807bc066ccb..64cf07ee3d10 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
@@ -14,6 +14,7 @@ / {
 	compatible = "friendlyarm,nanopi-r2s", "rockchip,rk3328";
 
 	aliases {
+		ethernet1 = &rtl8153;
 		mmc0 = &sdmmc;
 	};
 
@@ -101,6 +102,18 @@ vdd_5v: vdd-5v {
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
 	};
+
+	vdd_5v_lan: vdd-5v-lan {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
+		pinctrl-0 = <&lan_vdd_pin>;
+		pinctrl-names = "default";
+		regulator-name = "vdd_5v_lan";
+		regulator-always-on;
+		regulator-boot-on;
+		vin-supply = <&vdd_5v>;
+	};
 };
 
 &cpu0 {
@@ -309,6 +322,12 @@ wan_led_pin: wan-led-pin {
 		};
 	};
 
+	lan {
+		lan_vdd_pin: lan-vdd-pin {
+			rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	pmic {
 		pmic_int_l: pmic-int-l {
 			rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
@@ -368,6 +387,19 @@ &usb20_otg {
 	dr_mode = "host";
 };
 
+&usbdrd3 {
+	dr_mode = "host";
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	/* Second port is for USB 3.0 */
+	rtl8153: device@2 {
+		compatible = "usbbda,8153";
+		reg = <2>;
+	};
+};
+
 &usb_host0_ehci {
 	status = "okay";
 };
-- 
2.31.1


WARNING: multiple messages have this Message-ID (diff)
From: Chen-Yu Tsai <wens@kernel.org>
To: Rob Herring <robh+dt@kernel.org>, Heiko Stuebner <heiko@sntech.de>
Cc: Chen-Yu Tsai <wens@csie.org>,
	devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] arm64: dts: rockchip: rk3328: Enable USB3 Ethernet on NanoPi R2S
Date: Tue,  4 May 2021 16:36:16 +0800	[thread overview]
Message-ID: <20210504083616.9654-5-wens@kernel.org> (raw)
In-Reply-To: <20210504083616.9654-1-wens@kernel.org>

From: Chen-Yu Tsai <wens@csie.org>

The NanoPi R2S has a Realtek RTL8153B USB 3.0 Ethernet chip connected
to the USB 3.0 pins of the RK3328 SoC. Power to the chip is controlled
by a GPIO line toggled transistor switch, which is not a full-blown
voltage regulator.

At least in Linux, the USB 3.0 XHCI controller has two ports: the first
port is for legacy USB 2.0 and slower, while the second port is for USB
3.0. Since the Ethernet chip supports USB 3.0, it should be described
as connected to the second port.

Add the device nodes for the power switch and Ethernet chip, and enable
the USB 3.0 controller. The USB device node follows the standard USB
device binding.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 .../boot/dts/rockchip/rk3328-nanopi-r2s.dts   | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
index f807bc066ccb..64cf07ee3d10 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
@@ -14,6 +14,7 @@ / {
 	compatible = "friendlyarm,nanopi-r2s", "rockchip,rk3328";
 
 	aliases {
+		ethernet1 = &rtl8153;
 		mmc0 = &sdmmc;
 	};
 
@@ -101,6 +102,18 @@ vdd_5v: vdd-5v {
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
 	};
+
+	vdd_5v_lan: vdd-5v-lan {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
+		pinctrl-0 = <&lan_vdd_pin>;
+		pinctrl-names = "default";
+		regulator-name = "vdd_5v_lan";
+		regulator-always-on;
+		regulator-boot-on;
+		vin-supply = <&vdd_5v>;
+	};
 };
 
 &cpu0 {
@@ -309,6 +322,12 @@ wan_led_pin: wan-led-pin {
 		};
 	};
 
+	lan {
+		lan_vdd_pin: lan-vdd-pin {
+			rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	pmic {
 		pmic_int_l: pmic-int-l {
 			rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
@@ -368,6 +387,19 @@ &usb20_otg {
 	dr_mode = "host";
 };
 
+&usbdrd3 {
+	dr_mode = "host";
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	/* Second port is for USB 3.0 */
+	rtl8153: device@2 {
+		compatible = "usbbda,8153";
+		reg = <2>;
+	};
+};
+
 &usb_host0_ehci {
 	status = "okay";
 };
-- 
2.31.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
From: Chen-Yu Tsai <wens@kernel.org>
To: Rob Herring <robh+dt@kernel.org>, Heiko Stuebner <heiko@sntech.de>
Cc: Chen-Yu Tsai <wens@csie.org>,
	devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] arm64: dts: rockchip: rk3328: Enable USB3 Ethernet on NanoPi R2S
Date: Tue,  4 May 2021 16:36:16 +0800	[thread overview]
Message-ID: <20210504083616.9654-5-wens@kernel.org> (raw)
In-Reply-To: <20210504083616.9654-1-wens@kernel.org>

From: Chen-Yu Tsai <wens@csie.org>

The NanoPi R2S has a Realtek RTL8153B USB 3.0 Ethernet chip connected
to the USB 3.0 pins of the RK3328 SoC. Power to the chip is controlled
by a GPIO line toggled transistor switch, which is not a full-blown
voltage regulator.

At least in Linux, the USB 3.0 XHCI controller has two ports: the first
port is for legacy USB 2.0 and slower, while the second port is for USB
3.0. Since the Ethernet chip supports USB 3.0, it should be described
as connected to the second port.

Add the device nodes for the power switch and Ethernet chip, and enable
the USB 3.0 controller. The USB device node follows the standard USB
device binding.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 .../boot/dts/rockchip/rk3328-nanopi-r2s.dts   | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
index f807bc066ccb..64cf07ee3d10 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
@@ -14,6 +14,7 @@ / {
 	compatible = "friendlyarm,nanopi-r2s", "rockchip,rk3328";
 
 	aliases {
+		ethernet1 = &rtl8153;
 		mmc0 = &sdmmc;
 	};
 
@@ -101,6 +102,18 @@ vdd_5v: vdd-5v {
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
 	};
+
+	vdd_5v_lan: vdd-5v-lan {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
+		pinctrl-0 = <&lan_vdd_pin>;
+		pinctrl-names = "default";
+		regulator-name = "vdd_5v_lan";
+		regulator-always-on;
+		regulator-boot-on;
+		vin-supply = <&vdd_5v>;
+	};
 };
 
 &cpu0 {
@@ -309,6 +322,12 @@ wan_led_pin: wan-led-pin {
 		};
 	};
 
+	lan {
+		lan_vdd_pin: lan-vdd-pin {
+			rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	pmic {
 		pmic_int_l: pmic-int-l {
 			rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
@@ -368,6 +387,19 @@ &usb20_otg {
 	dr_mode = "host";
 };
 
+&usbdrd3 {
+	dr_mode = "host";
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	/* Second port is for USB 3.0 */
+	rtl8153: device@2 {
+		compatible = "usbbda,8153";
+		reg = <2>;
+	};
+};
+
 &usb_host0_ehci {
 	status = "okay";
 };
-- 
2.31.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-05-04  8:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04  8:36 [PATCH 0/4] arm64: dts: rockchip: rk3328: Enable USB3 on some SBCs Chen-Yu Tsai
2021-05-04  8:36 ` Chen-Yu Tsai
2021-05-04  8:36 ` Chen-Yu Tsai
2021-05-04  8:36 ` [PATCH 1/4] arm64: dts: rockchip: rk3328: Enable USB3 for Rock64 Chen-Yu Tsai
2021-05-04  8:36   ` Chen-Yu Tsai
2021-05-04  8:36   ` Chen-Yu Tsai
2021-05-04  8:36 ` [PATCH 2/4] arm64: dts: rockchip: rk3328: Enable USB3 for ROC-RK3328-CC Chen-Yu Tsai
2021-05-04  8:36   ` Chen-Yu Tsai
2021-05-04  8:36   ` Chen-Yu Tsai
2021-05-04  8:36 ` [PATCH 3/4] arm64: dts: rockchip: rk3328: Enable USB3 for Rock Pi E Chen-Yu Tsai
2021-05-04  8:36   ` Chen-Yu Tsai
2021-05-04  8:36   ` Chen-Yu Tsai
2021-05-04  8:36 ` Chen-Yu Tsai [this message]
2021-05-04  8:36   ` [PATCH 4/4] arm64: dts: rockchip: rk3328: Enable USB3 Ethernet on NanoPi R2S Chen-Yu Tsai
2021-05-04  8:36   ` Chen-Yu Tsai
2021-05-09 23:55 ` [PATCH 0/4] arm64: dts: rockchip: rk3328: Enable USB3 on some SBCs Heiko Stuebner
2021-05-09 23:55   ` Heiko Stuebner
2021-05-09 23:55   ` Heiko Stuebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210504083616.9654-5-wens@kernel.org \
    --to=wens@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.