Skip to contentSkip to conversation

Add Ethernet and PDMA support to OrangePi RV2 board

PATCH Applied [email protected] 5 participants 9 messages Oct 22, 2025 – Oct 28, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover Add Ethernet and PDMA support to OrangePi RV2 board

From: Michael Opdenacker <[email protected]>

Reusing DTS code from the BananaPi F3 board.

iperf3 tcp performance results:

Eth1 client test (iperf3 -c <server-ip>)
[ 5] local 172.24.0.2 port 41914 connected to 172.24.0.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd

[  5]   0.00-1.00   sec   113 MBytes   946 Mbits/sec    0    378 KBytes
[  5]   1.00-2.00   sec   112 MBytes   942 Mbits/sec    0    424 KBytes
[  5]   2.00-3.00   sec   113 MBytes   947 Mbits/sec    0    424 KBytes
[  5]   3.00-4.00   sec   112 MBytes   939 Mbits/sec    0    445 KBytes
[  5]   4.00-5.00   sec   112 MBytes   944 Mbits/sec    0    445 KBytes
[  5]   5.00-6.00   sec   112 MBytes   937 Mbits/sec    0    445 KBytes
[  5]   6.00-7.00   sec   113 MBytes   944 Mbits/sec    1    445 KBytes
[  5]   7.00-8.00   sec   112 MBytes   936 Mbits/sec    0    445 KBytes
[  5]   8.00-9.00   sec   112 MBytes   943 Mbits/sec    0    445 KBytes
[  5]   9.00-10.01  sec   114 MBytes   944 Mbits/sec    0    445 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.01  sec  1.10 GBytes   942 Mbits/sec    1            sender
[  5]   0.00-10.02  sec  1.10 GBytes   940 Mbits/sec                  receiver

Eth1 server tests (iperf3 -s)
[ 5] local 172.24.0.2 port 5201 connected to 172.24.0.1 port 58420
[ ID] Interval Transfer Bitrate

[  5]   0.00-1.00   sec   112 MBytes   935 Mbits/sec
[  5]   1.00-2.00   sec   112 MBytes   942 Mbits/sec
[  5]   2.00-3.00   sec   112 MBytes   941 Mbits/sec
[  5]   3.00-4.00   sec   112 MBytes   941 Mbits/sec
[  5]   4.00-5.00   sec   112 MBytes   942 Mbits/sec
[  5]   5.00-6.00   sec   112 MBytes   942 Mbits/sec
[  5]   6.00-7.00   sec   112 MBytes   942 Mbits/sec
[  5]   7.00-8.00   sec   112 MBytes   942 Mbits/sec
[  5]   8.00-9.00   sec   112 MBytes   942 Mbits/sec
[  5]   9.00-10.00  sec   112 MBytes   942 Mbits/sec
[  5]  10.00-10.01  sec   512 KBytes   897 Mbits/sec

- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.01 sec 1.10 GBytes 941 Mbits/sec receiver

Eth0 client test (iperf3 -c <server-ip>)
[ 5] local 172.24.0.2 port 60496 connected to 172.24.0.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd

[  5]   0.00-1.00   sec   113 MBytes   947 Mbits/sec    0    362 KBytes
[  5]   1.00-2.00   sec   113 MBytes   945 Mbits/sec    0    464 KBytes
[  5]   2.00-3.00   sec   113 MBytes   945 Mbits/sec    0    464 KBytes
[  5]   3.00-4.00   sec   112 MBytes   941 Mbits/sec    0    467 KBytes
[  5]   4.00-5.00   sec   112 MBytes   940 Mbits/sec    0    467 KBytes
[  5]   5.00-6.00   sec   112 MBytes   937 Mbits/sec    0    467 KBytes
[  5]   6.00-7.00   sec   113 MBytes   948 Mbits/sec    0    494 KBytes
[  5]   7.00-8.00   sec   112 MBytes   938 Mbits/sec    0    520 KBytes
[  5]   8.00-9.00   sec   113 MBytes   945 Mbits/sec    0    520 KBytes
[  5]   9.00-10.02  sec   112 MBytes   919 Mbits/sec    0    520 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.02  sec  1.10 GBytes   941 Mbits/sec    0            sender
[  5]   0.00-10.03  sec  1.10 GBytes   940 Mbits/sec                  receiver

Eth0 server tests (iperf3 -s)
[ 5] local 172.24.0.2 port 5201 connected to 172.24.0.1 port 42930
[ ID] Interval Transfer Bitrate

[  5]   0.00-1.00   sec   112 MBytes   934 Mbits/sec
[  5]   1.00-2.00   sec   112 MBytes   942 Mbits/sec
[  5]   2.00-3.00   sec   112 MBytes   941 Mbits/sec
[  5]   3.00-4.00   sec   112 MBytes   940 Mbits/sec
[  5]   4.00-5.00   sec   112 MBytes   942 Mbits/sec
[  5]   5.00-6.00   sec   112 MBytes   940 Mbits/sec
[  5]   6.00-7.00   sec   112 MBytes   941 Mbits/sec
[  5]   7.00-8.00   sec   112 MBytes   941 Mbits/sec
[  5]   8.00-9.00   sec   112 MBytes   942 Mbits/sec
[  5]   9.00-10.00  sec   112 MBytes   941 Mbits/sec
[  5]  10.00-10.01  sec   512 KBytes  1.07 Gbits/sec

- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.01 sec 1.10 GBytes 941 Mbits/sec receiver

In comparison, for the 6.6 vendor kernel in OrangePiOS:
- Client tests give similar results both on eth0 and eth1
- Server tests are very similar on eth0, but lose between 50-60 Mbits/sec on eth1:
[ 5] 0.00-10.00 sec 1.04 GBytes 889 Mbits/sec 56 sender [ 5] 0.00-10.01 sec 1.03 GBytes 882 Mbits/sec receiver (as seen from the PC client)

Changes in V2:
- Remove the commit configuring k1_emac driver as a built-in by default, as suggested by Emil Renner Berthing
- Improve the message for the commit adding Ethernet and PDMA, as suggested by Yixun Lan
- Add DT aliases for eth0 and eth1
as suggested by Vivian Wang
- Add iperf3 test results to this cover letter
as suggested by Vivian Wang

CC Emil Renner Berthing <[email protected]>
CC Yixun Lan <[email protected]>
CC Vivian Wang <[email protected]>

Michael Opdenacker (1):
riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2

 .../boot/dts/spacemit/k1-orangepi-rv2.dts     | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
#1 lore raw

PATCH v2 1/1 riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2

From: Michael Opdenacker <[email protected]>

The OrangePi RV2 board ships two RGMII ethernet ports.
Each has an external Motorcomm YT8531C PHY attached, the PHY uses GPIO for reset pin control.

Enable PDMA for the SpacemiT K1-based SoC in the OrangePi RV2 board.

CC Emil Renner Berthing <[email protected]>
CC Yixun Lan <[email protected]>
CC Vivian Wang <[email protected]>
---
 .../boot/dts/spacemit/k1-orangepi-rv2.dts     | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts +52 -0
index 337240ebb7b7..41dc8e35e6eb 100644
@@ -15,6 +15,8 @@ / {
 
 	aliases {
 		serial0 = &uart0;
+		ethernet0 = &eth0;
+		ethernet1 = &eth1;
 	};
 
 	chosen {
@@ -33,6 +35,56 @@ led1 {
 	};
 };
 
+&eth0 {
+	phy-handle = <&rgmii0>;
+	phy-mode = "rgmii-id";
+	pinctrl-names = "default";
+	pinctrl-0 = <&gmac0_cfg>;
+	rx-internal-delay-ps = <0>;
+	tx-internal-delay-ps = <0>;
+	status = "okay";
+
+	mdio-bus {
+		#address-cells = <0x1>;
+		#size-cells = <0x0>;
+
+		reset-gpios = <&gpio K1_GPIO(110) GPIO_ACTIVE_LOW>;
+		reset-delay-us = <10000>;
+		reset-post-delay-us = <100000>;
+
+		rgmii0: phy@1 {
+			reg = <0x1>;
+		};
+	};
+};
+
+&eth1 {
+	phy-handle = <&rgmii1>;
+	phy-mode = "rgmii-id";
+	pinctrl-names = "default";
+	pinctrl-0 = <&gmac1_cfg>;
+	rx-internal-delay-ps = <0>;
+	tx-internal-delay-ps = <250>;
+	status = "okay";
+
+	mdio-bus {
+		#address-cells = <0x1>;
+		#size-cells = <0x0>;
+
+		reset-gpios = <&gpio K1_GPIO(115) GPIO_ACTIVE_LOW>;
+		reset-delay-us = <10000>;
+		reset-post-delay-us = <100000>;
+
+		rgmii1: phy@1 {
+			reg = <0x1>;
+		};
+	};
+};
+
+&pdma {
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_2_cfg>;
Reviewed-by on v2 1/1
#2 lore raw

Re: [PATCH v2 1/1] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2

Hi Michael,

Quoted 6 lines · On 20:18 Wed 22 Oct , [email protected] wrote:

From: Michael Opdenacker <[email protected]>

The OrangePi RV2 board ships two RGMII ethernet ports.
Each has an external Motorcomm YT8531C PHY attached, the PHY uses GPIO for reset pin control.

Quoted 6 lines

Enable PDMA for the SpacemiT K1-based SoC in the OrangePi RV2 board.

CC Emil Renner Berthing <[email protected]>
CC Yixun Lan <[email protected]>
CC Vivian Wang <[email protected]>
Signature · 1 line
Yixun Lan (dlan)
#3 lore raw

Re: [PATCH v2 1/1] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2

In reply to [email protected]

Thank you so much for the patch and testing results. Only some nitpicks follow.

Quoted 6 lines · On 10/23/25 04:18, [email protected] wrote:

From: Michael Opdenacker <[email protected]>

The OrangePi RV2 board ships two RGMII ethernet ports.
Each has an external Motorcomm YT8531C PHY attached, the PHY uses GPIO for reset pin control.

Quoted 6 lines

Enable PDMA for the SpacemiT K1-based SoC in the OrangePi RV2 board.

CC Emil Renner Berthing <[email protected]>
CC Yixun Lan <[email protected]>
CC Vivian Wang <[email protected]>

Firstly, it is usually spelt "Cc:", with one upper-case C and one lower-case c.

Secondly, "Cc:" should not be necessary in the patch/commit message. From Documentation/process/submitting-patches.rst:

    If a person has had the opportunity to comment on a patch, but has not provided such comments, you may optionally add a ``Cc:`` tag to the patch. This tag documents that potentially interested parties have been included in the discussion.

If you look through the git logs of Linux, Cc tags are really not a regular occurrence except those marking patches as suitable for backporting to stable.

Thanks,
Vivian "dramforever"

#4 lore raw

Re: [PATCH v2 1/1] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2

Quoted 12 lines · Vivian Wang

Thank you so much for the patch and testing results. Only some nitpicks follow.

Quoted 8 lines · On 10/23/25 04:18, [email protected] wrote:

From: Michael Opdenacker <[email protected]>

The OrangePi RV2 board ships two RGMII ethernet ports.
Each has an external Motorcomm YT8531C PHY attached, the PHY uses GPIO for reset pin control.

Enable PDMA for the SpacemiT K1-based SoC in the OrangePi RV2 board.

Quoted 7 lines
Quoted 4 lines
CC Emil Renner Berthing <[email protected]>
CC Yixun Lan <[email protected]>
CC Vivian Wang <[email protected]>

Firstly, it is usually spelt "Cc:", with one upper-case C and one lower-case c.

I don't think this matters at all, the git tooling at least doesn't care.

Quoted 11 lines

Secondly, "Cc:" should not be necessary in the patch/commit message. From Documentation/process/submitting-patches.rst:

    If a person has had the opportunity to comment on a patch, but has not provided such comments, you may optionally add a ``Cc:`` tag to the patch. This tag documents that potentially interested parties have been included in the discussion.

If you look through the git logs of Linux, Cc tags are really not a regular occurrence except those marking patches as suitable for backporting to stable.

If people want to handle CC lists by putting it in the patches (it's what I do when I have no cover letter) just put them after the --- line and git send-email will still pick the CCs up but they won't end up in the history.

#5 lore raw

Re: [PATCH v2 1/1] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2

Hi Michael,

Since the patch itself is good enough, so I will just take it, I will drop those CCs if no objection..

Quoted 18 lines · Conor Dooley
Quoted 17 lines · Vivian Wang

Thank you so much for the patch and testing results. Only some nitpicks follow.

Quoted 12 lines · On 10/23/25 04:18, [email protected] wrote:

From: Michael Opdenacker <[email protected]>

The OrangePi RV2 board ships two RGMII ethernet ports.
Each has an external Motorcomm YT8531C PHY attached, the PHY uses GPIO for reset pin control.

Enable PDMA for the SpacemiT K1-based SoC in the OrangePi RV2 board.

CC Emil Renner Berthing <[email protected]>
CC Yixun Lan <[email protected]>
CC Vivian Wang <[email protected]>
Quoted 6 lines
Quoted 2 lines

Firstly, it is usually spelt "Cc:", with one upper-case C and one lower-case c.

I don't think this matters at all, the git tooling at least doesn't care.

I think it's super useful by putting additional "Cc" into individual patch especially for a large series to notify specific maintainers while not spam others

Quoted 8 lines
Quoted 8 lines

Secondly, "Cc:" should not be necessary in the patch/commit message. From Documentation/process/submitting-patches.rst:

    If a person has had the opportunity to comment on a patch, but has not provided such comments, you may optionally add a ``Cc:`` tag to the patch. This tag documents that potentially interested parties have been included in the discussion.

Quoted 9 lines
Quoted 3 lines

If you look through the git logs of Linux, Cc tags are really not a regular occurrence except those marking patches as suitable for backporting to stable.

If people want to handle CC lists by putting it in the patches (it's what I do when I have no cover letter) just put them after the --- line and git send-email will still pick the CCs up but they won't end up in the history.

indeed, good suggestion!

Signature · 1 line
Yixun Lan (dlan)
#6 lore raw

Re: [PATCH v2 1/1] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2

In reply to Conor Dooley

Hi Conor

Thanks for the review!

Quoted 30 lines · Conor Dooley
Quoted 10 lines · Vivian Wang

Thank you so much for the patch and testing results. Only some nitpicks follow.

Quoted 6 lines · On 10/23/25 04:18, [email protected] wrote:

From: Michael Opdenacker <[email protected]>

The OrangePi RV2 board ships two RGMII ethernet ports.
Each has an external Motorcomm YT8531C PHY attached, the PHY uses GPIO for reset pin control.

Quoted 8 lines
Quoted 6 lines

Enable PDMA for the SpacemiT K1-based SoC in the OrangePi RV2 board.

CC Emil Renner Berthing <[email protected]>
CC Yixun Lan <[email protected]>
CC Vivian Wang <[email protected]>

Firstly, it is usually spelt "Cc:", with one upper-case C and one lower-case c.

I don't think this matters at all, the git tooling at least doesn't care.

Quoted 8 lines

Secondly, "Cc:" should not be necessary in the patch/commit message.
From Documentation/process/submitting-patches.rst:

    If a person has had the opportunity to comment on a patch, but has not provided such comments, you may optionally add a ``Cc:`` tag to the patch. This tag documents that potentially interested parties have been included in the discussion.

Quoted 7 lines
Quoted 3 lines

If you look through the git logs of Linux, Cc tags are really not a regular occurrence except those marking patches as suitable for backporting to stable.

If people want to handle CC lists by putting it in the patches (it's what I do when I have no cover letter) just put them after the --- line and git send-email will still pick the CCs up but they won't end up in the history.

Oh yes, that was my mistake. The CCs were never intended to make it to the final commits. Thanks!
Michael.

Signature · 4 lines
Michael Opdenacker
Root Commit
Yocto Project and OpenEmbedded Training course - Learn by doing:
https://rootcommit.com/training/yocto/
Applied
#8 lore raw
In reply to [email protected]
Quoted 24 lines · On Wed, 22 Oct 2025 20:18:30 +0000, [email protected] wrote:

From: Michael Opdenacker <[email protected]>

Reusing DTS code from the BananaPi F3 board.

iperf3 tcp performance results:

Eth1 client test (iperf3 -c <server-ip>)
[ 5] local 172.24.0.2 port 41914 connected to 172.24.0.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd

[  5]   0.00-1.00   sec   113 MBytes   946 Mbits/sec    0    378 KBytes
[  5]   1.00-2.00   sec   112 MBytes   942 Mbits/sec    0    424 KBytes
[  5]   2.00-3.00   sec   113 MBytes   947 Mbits/sec    0    424 KBytes
[  5]   3.00-4.00   sec   112 MBytes   939 Mbits/sec    0    445 KBytes
[  5]   4.00-5.00   sec   112 MBytes   944 Mbits/sec    0    445 KBytes
[  5]   5.00-6.00   sec   112 MBytes   937 Mbits/sec    0    445 KBytes
[  5]   6.00-7.00   sec   113 MBytes   944 Mbits/sec    1    445 KBytes
[  5]   7.00-8.00   sec   112 MBytes   936 Mbits/sec    0    445 KBytes
[  5]   8.00-9.00   sec   112 MBytes   943 Mbits/sec    0    445 KBytes
[  5]   9.00-10.01  sec   114 MBytes   944 Mbits/sec    0    445 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.01  sec  1.10 GBytes   942 Mbits/sec    1            sender
[  5]   0.00-10.02  sec  1.10 GBytes   940 Mbits/sec                  receiver
Quoted 1 line

[...]

Applied, thanks!

[1/1] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2

      https://github.com/spacemit-com/linux/commit/9813395078352fed03c88742bd39b9c4a0e40c15

Best regards,

Signature · 1 line
Yixun Lan
Tested-by on v2 1/1
#7 lore raw

Re: [PATCH v2 1/1] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2

In reply to [email protected]
Quoted 6 lines · On Wed, Oct 22, 2025, [email protected]…

From: Michael Opdenacker <[email protected]>

The OrangePi RV2 board ships two RGMII ethernet ports.
Each has an external Motorcomm YT8531C PHY attached, the PHY uses GPIO for reset pin control.

Quoted 6 lines

Enable PDMA for the SpacemiT K1-based SoC in the OrangePi RV2 board.

CC Emil Renner Berthing <[email protected]>
CC Yixun Lan <[email protected]>
CC Vivian Wang <[email protected]>

I tested this patch on my RV2 board. I see similar iperf3 results.

JE