* [PATCH 0/2] Add Ethernet and PDMA support to OrangePi RV2 board
@ 2025-10-17 10:01 michael.opdenacker
2025-10-17 10:02 ` [PATCH 1/2] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2 michael.opdenacker
2025-10-17 10:02 ` [PATCH 2/2] net: spacemit: compile k1_emac driver as built-in by default michael.opdenacker
0 siblings, 2 replies; 9+ messages in thread
From: michael.opdenacker @ 2025-10-17 10:01 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Yixun Lan
Cc: Michael Opdenacker, linux-riscv, spacemit
From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
Tested by booting the board through NFS with these additional
kernel command line settings:
nfsroot=<server-ip>:<path-on-server>,nfsvers=3,tcp ip=<board-ip>:::::eth0
Michael Opdenacker (2):
riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2
net: spacemit: compile k1_emac driver as built-in by default
.../boot/dts/spacemit/k1-orangepi-rv2.dts | 50 +++++++++++++++++++
drivers/net/ethernet/spacemit/Kconfig | 2 +-
2 files changed, 51 insertions(+), 1 deletion(-)
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2
2025-10-17 10:01 [PATCH 0/2] Add Ethernet and PDMA support to OrangePi RV2 board michael.opdenacker
@ 2025-10-17 10:02 ` michael.opdenacker
2025-10-20 1:00 ` Yixun Lan
2025-10-20 9:07 ` Vivian Wang
2025-10-17 10:02 ` [PATCH 2/2] net: spacemit: compile k1_emac driver as built-in by default michael.opdenacker
1 sibling, 2 replies; 9+ messages in thread
From: michael.opdenacker @ 2025-10-17 10:02 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
Cc: Michael Opdenacker, devicetree, linux-riscv, spacemit,
linux-kernel
From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
Aligning with k1-bananapi-f3.dts
Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com>
---
.../boot/dts/spacemit/k1-orangepi-rv2.dts | 50 +++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
index 337240ebb7b7..2a75ca93b499 100644
--- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
@@ -33,6 +33,56 @@ led1 {
};
};
+ð0 {
+ 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>;
+ };
+ };
+};
+
+ð1 {
+ 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>;
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] net: spacemit: compile k1_emac driver as built-in by default
2025-10-17 10:01 [PATCH 0/2] Add Ethernet and PDMA support to OrangePi RV2 board michael.opdenacker
2025-10-17 10:02 ` [PATCH 1/2] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2 michael.opdenacker
@ 2025-10-17 10:02 ` michael.opdenacker
2025-10-17 15:33 ` Emil Renner Berthing
1 sibling, 1 reply; 9+ messages in thread
From: michael.opdenacker @ 2025-10-17 10:02 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Yixun Lan
Cc: Michael Opdenacker, netdev, linux-riscv, spacemit, linux-kernel
From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
Supports booting boards on NFS filesystems, without going
through an initramfs.
Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com>
---
drivers/net/ethernet/spacemit/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/spacemit/Kconfig b/drivers/net/ethernet/spacemit/Kconfig
index 85ef61a9b4ef..7fe1b2a308d1 100644
--- a/drivers/net/ethernet/spacemit/Kconfig
+++ b/drivers/net/ethernet/spacemit/Kconfig
@@ -18,7 +18,7 @@ config SPACEMIT_K1_EMAC
depends on ARCH_SPACEMIT || COMPILE_TEST
depends on MFD_SYSCON
depends on OF
- default m if ARCH_SPACEMIT
+ default y if ARCH_SPACEMIT
select PHYLIB
help
This driver supports the Ethernet MAC in the SpacemiT K1 SoC.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] net: spacemit: compile k1_emac driver as built-in by default
2025-10-17 10:02 ` [PATCH 2/2] net: spacemit: compile k1_emac driver as built-in by default michael.opdenacker
@ 2025-10-17 15:33 ` Emil Renner Berthing
2025-10-17 15:53 ` Michael Opdenacker
0 siblings, 1 reply; 9+ messages in thread
From: Emil Renner Berthing @ 2025-10-17 15:33 UTC (permalink / raw)
To: michael.opdenacker
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Yixun Lan, netdev, linux-riscv, spacemit,
linux-kernel
On Fri, 17 Oct 2025 at 12:03, <michael.opdenacker@rootcommit.com> wrote:
>
> From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
>
> Supports booting boards on NFS filesystems, without going
> through an initramfs.
Please don't do this. If we build in every ethernet driver that might
be used to boot from NFS we'll end up with almost every driver
built-in and huge kernels. If you need this there is nothing
preventing you from building the driver in, but please don't bloat
defconfig kernels for everyone else.
/Emil
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] net: spacemit: compile k1_emac driver as built-in by default
2025-10-17 15:33 ` Emil Renner Berthing
@ 2025-10-17 15:53 ` Michael Opdenacker
0 siblings, 0 replies; 9+ messages in thread
From: Michael Opdenacker @ 2025-10-17 15:53 UTC (permalink / raw)
To: Emil Renner Berthing
Cc: michael.opdenacker, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Yixun Lan, netdev, linux-riscv,
spacemit, linux-kernel
Hi Emil
Thanks for the review!
On 10/17/25 17:33, Emil Renner Berthing wrote:
> On Fri, 17 Oct 2025 at 12:03, <michael.opdenacker@rootcommit.com> wrote:
>> From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
>>
>> Supports booting boards on NFS filesystems, without going
>> through an initramfs.
> Please don't do this. If we build in every ethernet driver that might
> be used to boot from NFS we'll end up with almost every driver
> built-in and huge kernels. If you need this there is nothing
> preventing you from building the driver in, but please don't bloat
> defconfig kernels for everyone else.
Understood. You have a point. It's not really a problem to customize
kernel configuration for each board as you said.
So, please forget this particular patch :)
Cheers
Michael.
--
Michael Opdenacker
Root Commit
Embedded Linux Training and Consulting
https://rootcommit.com
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2
2025-10-17 10:02 ` [PATCH 1/2] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2 michael.opdenacker
@ 2025-10-20 1:00 ` Yixun Lan
2025-10-20 9:07 ` Vivian Wang
1 sibling, 0 replies; 9+ messages in thread
From: Yixun Lan @ 2025-10-20 1:00 UTC (permalink / raw)
To: michael.opdenacker
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, devicetree,
linux-riscv, spacemit, linux-kernel
Hi Michael,
On 10:02 Fri 17 Oct , michael.opdenacker@rootcommit.com wrote:
> From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
>
> Aligning with k1-bananapi-f3.dts
>
The DTS change looks good, but the commit message is kind of obscure
and unclear, I'd like to have an explict brief description for what
have done in the patch, without people looking at the actual DT code,
although in this case the title already says about it, but we could
still give slightly more info/context:
The OrangePi RV2 board ships two RGMII ethernet ports with each
has an external Motorcomm YT8531C PHY attached, the PHY use gpio
for the reset pin control.
Enable PDMA for OrangePi RV2 board which provided by SpacemiT K1-based SoC.
> Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com>
--
Yixun Lan (dlan)
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2
2025-10-17 10:02 ` [PATCH 1/2] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2 michael.opdenacker
2025-10-20 1:00 ` Yixun Lan
@ 2025-10-20 9:07 ` Vivian Wang
2025-10-21 5:39 ` Vivian Wang
2025-10-22 18:54 ` Michael Opdenacker
1 sibling, 2 replies; 9+ messages in thread
From: Vivian Wang @ 2025-10-20 9:07 UTC (permalink / raw)
To: michael.opdenacker
Cc: devicetree, linux-riscv, spacemit, linux-kernel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Yixun Lan
Hi Michael,
Thank you. I had meant to do this after v6.18-rc1 (which is now), but I
didn't have this hardware to test.
On 10/17/25 18:02, michael.opdenacker@rootcommit.com wrote:
> From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
>
> Aligning with k1-bananapi-f3.dts
>
> Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com>
> ---
> .../boot/dts/spacemit/k1-orangepi-rv2.dts | 50 +++++++++++++++++++
> 1 file changed, 50 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> index 337240ebb7b7..2a75ca93b499 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> @@ -33,6 +33,56 @@ led1 {
> };
> };
>
> +ð0 {
Please add eth0 and eth1 to /aliases so that U-Boot, udev, ... can
recognize them. This is used by U-Boot to set the mac-address to the
same value used in booting, and by (systemd) udev to set the interface name.
> + phy-handle = <&rgmii0>;
> + phy-mode = "rgmii-id";
> + pinctrl-names = "default";
> + pinctrl-0 = <&gmac0_cfg>;
> + rx-internal-delay-ps = <0>;
> + tx-internal-delay-ps = <0>;
The hardware design of OPI-RV2 is not the same as BPI-F3, so the
parameters here deserves some scruitiny. Same for eth1 below.
I would appreciate at least iperf TCP tests in both directions on both
ethernet ports. The expected speed should be at least 940 Mbit/sec - if
it's much lower than that something is wrong.
Thanks,
Vivian "dramforever" Wang
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2
2025-10-20 9:07 ` Vivian Wang
@ 2025-10-21 5:39 ` Vivian Wang
2025-10-22 18:54 ` Michael Opdenacker
1 sibling, 0 replies; 9+ messages in thread
From: Vivian Wang @ 2025-10-21 5:39 UTC (permalink / raw)
To: michael.opdenacker
Cc: devicetree, linux-riscv, spacemit, linux-kernel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Yixun Lan
On 10/20/25 17:07, Vivian Wang wrote:
> [...]
>> + phy-handle = <&rgmii0>;
>> + phy-mode = "rgmii-id";
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&gmac0_cfg>;
>> + rx-internal-delay-ps = <0>;
>> + tx-internal-delay-ps = <0>;
> The hardware design of OPI-RV2 is not the same as BPI-F3, so the
> parameters here deserves some scruitiny. Same for eth1 below.
(Apparently my spelling deserves scrutiny as well. Oh well.)
> I would appreciate at least iperf TCP tests in both directions on both
> ethernet ports. The expected speed should be at least 940 Mbit/sec - if
> it's much lower than that something is wrong.
Okay so this is not *necessarily* a problem, but just for context...
If you look at the DTS files provided by SpacemiT [1] you'd think the
OPI-RV2 also uses RTL8211F Ethernet PHYs. It does not. The schematics
(linked on the board main page [2]) says it uses Motorcomm YT8531C.
This doesn't mean that your DTS is wrong (because we don't write the id
here when the PHY-sent one is correct), but I hope you understand that
what I'm worried is that the electrical characteristics have been
changed since they have changed the board design. This is why I think
actually taking the time to check the delay parameters would be a good idea.
And yes, it would not be surprising if the parameters for BPI-F3 also
works completely reliably for OPI-RV2. The delay tuning has quite a bit
of margin for wiggle room.
Thanks,
Vivian "dramforever" Wang
[1]: https://github.com/spacemit-com/linux-k1x/blob/k1/arch/riscv/boot/dts/spacemit/k1-x_orangepi-rv2.dts
[2]: http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-RV2.html
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2
2025-10-20 9:07 ` Vivian Wang
2025-10-21 5:39 ` Vivian Wang
@ 2025-10-22 18:54 ` Michael Opdenacker
1 sibling, 0 replies; 9+ messages in thread
From: Michael Opdenacker @ 2025-10-22 18:54 UTC (permalink / raw)
To: Vivian Wang
Cc: michael.opdenacker, devicetree, linux-riscv, spacemit,
linux-kernel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Yixun Lan
Hi Vivian
Thanks for the guidance and help!
On 10/20/25 11:07, Vivian Wang wrote:
> Hi Michael,
>
> Thank you. I had meant to do this after v6.18-rc1 (which is now), but I
> didn't have this hardware to test.
Happy to help testing, if you have code to share :)
>
> On 10/17/25 18:02, michael.opdenacker@rootcommit.com wrote:
>> From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
>>
>> Aligning with k1-bananapi-f3.dts
>>
>> Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com>
>> ---
>> .../boot/dts/spacemit/k1-orangepi-rv2.dts | 50 +++++++++++++++++++
>> 1 file changed, 50 insertions(+)
>>
>> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
>> index 337240ebb7b7..2a75ca93b499 100644
>> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
>> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
>> @@ -33,6 +33,56 @@ led1 {
>> };
>> };
>>
>> +ð0 {
> Please add eth0 and eth1 to /aliases so that U-Boot, udev, ... can
> recognize them. This is used by U-Boot to set the mac-address to the
> same value used in booting, and by (systemd) udev to set the interface name.
Done. I'll submit a V2 soon.
>
>> + phy-handle = <&rgmii0>;
>> + phy-mode = "rgmii-id";
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&gmac0_cfg>;
>> + rx-internal-delay-ps = <0>;
>> + tx-internal-delay-ps = <0>;
> The hardware design of OPI-RV2 is not the same as BPI-F3, so the
> parameters here deserves some scruitiny. Same for eth1 below.
>
> I would appreciate at least iperf TCP tests in both directions on both
> ethernet ports. The expected speed should be at least 940 Mbit/sec - if
> it's much lower than that something is wrong.
Fortunately, the results are good. They are even better than the ones
from the vendor kernel in OrangePi OS 😂.
I'll share the results in my V2 cover letter.
Thanks again
Michael.
--
Michael Opdenacker
Root Commit
Yocto Project and OpenEmbedded Training course - Learn by doing:
https://rootcommit.com/training/yocto/
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-10-22 18:54 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17 10:01 [PATCH 0/2] Add Ethernet and PDMA support to OrangePi RV2 board michael.opdenacker
2025-10-17 10:02 ` [PATCH 1/2] riscv: dts: spacemit: add Ethernet and PDMA to OrangePi RV2 michael.opdenacker
2025-10-20 1:00 ` Yixun Lan
2025-10-20 9:07 ` Vivian Wang
2025-10-21 5:39 ` Vivian Wang
2025-10-22 18:54 ` Michael Opdenacker
2025-10-17 10:02 ` [PATCH 2/2] net: spacemit: compile k1_emac driver as built-in by default michael.opdenacker
2025-10-17 15:33 ` Emil Renner Berthing
2025-10-17 15:53 ` Michael Opdenacker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).