Rock Pi e Board Version 1.21 ethhernet not working in Armbian

Hi evrybody,
I tried the current Armbian images for RockPi E and found that eth0 (1GBit) is not working. I tried both Sid and Lunar Armbian flavours. Both with the same result.

I tried the Armbian images with the older V1.2 board version and everything works well. I guess the problem is related to the new RTL8211F chip.

In dmesg I can find the following errors:

mdio_bus stmmac-0: MDIO device at address 1 is missing.

rk_gmac-dwmac ff540000.ethernet end0: no phy found
rk_gmac-dwmac ff540000.ethernet end0: __stmmac_open: Cannot attach to PHY (error: -19)

I hope that somebody can help me.

Hi,

I have only 1.2 boards sofar, but maybee one of the following links might help:
https://forum.odroid.com/viewtopic.php?t=41873

Greetings, M.

I have had the same issue and have been working through this the past few days.

The issue is that there are some differences between timing of the rtl8211e and rtl8211f chips. In the official debian buster release from radxa, there is a overlay which can be applied to support the newer rtl8211f chip, but this has been built using a slightly older format for the device tree.

Armbian, using a newer kernel, also has some changes and improvements to the device tree structure. There are some hints on what we need to modify here:

Based on this, I ran the following commands prior to building armbian for the Rock Pi E in order to patch the device tree file:

./compile.sh BOARD=rockpi-e BRANCH=current kernel-patch
./compile.sh BOARD=rockpi-e BRANCH=current uboot-patch

During guided patching, you can find the required files using find:

find . -name "rk3328-rock-pi-e.dts"

We need to patch the files for both the kernel and uboot to:

  • Set the tx_delay
  • Set the rx_delay
  • Rename phy-handle from rtl8211e to rtl8211f
  • Add an entry to identify the rtl8211f PHY (which has a device ID of 0x001cc916)
  • Set a max speed parameter for 1GbE

I have below for an example of the patch files that I found to work in my instance (armbian 23.05.0, debian bullseye current, kernel 5.15.110). Do note you have to make similar changes to both u-boot and kernel sources. I haven’t fully stress tested this however:

---
 arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts | 14 ++++++----
 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts b/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
index 018a3a507..257a3cdbc 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
@@ -144,36 +144,38 @@ &emmc {
 &gmac2io {
 	assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
 	assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
 	clock_in_out = "input";
-	phy-handle = <&rtl8211e>;
+	phy-handle = <&rtl8211f>;
 	phy-mode = "rgmii";
 	phy-supply = <&vcc_io>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&rgmiim1_pins>;
 	snps,aal;
 	snps,rxpbl = <0x4>;
 	snps,txpbl = <0x4>;
-	tx_delay = <0x26>;
-	rx_delay = <0x11>;
+	tx_delay = <0x1a>;
+	rx_delay = <0x14>;
 	status = "okay";
 	mdio {
 		compatible = "snps,dwmac-mdio";
 		#address-cells = <1>;
 		#size-cells = <0>;
-		rtl8211e: ethernet-phy@1 {
+		rtl8211f: ethernet-phy@1 {
+			compatible = "ethernet-phy-id001c.c916", "ethernet-phy-ieee802.3-c22";
 			reg = <1>;
 			pinctrl-0 = <&eth_phy_int_pin>, <&eth_phy_reset_pin>;
 			pinctrl-names = "default";
 			interrupt-parent = <&gpio1>;
 			interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
-			reset-assert-us = <10000>;
-			reset-deassert-us = <50000>;
+			reset-assert-us = <20000>;
+			reset-deassert-us = <100000>;
 			reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
+			max-speed = <1000>;
 		};
 	};
 };
 
 &gmac2phy {
-- 

For more information on providing userpatches to armbian, see here:

https://docs.armbian.com/Developer-Guide_User-Configurations/#user-provided-patches

Finally, you can build your image as follows:

./compile.sh BOARD=rockpi-e BRANCH=current RELEASE=bullseye BUILD_MINIMAL=yes BUILD_DESKTOP=no BUILD_ONLY=default KERNEL_CONFIGURE=no

Note that this solution may change with newer kernel, distribution, or armbian versions.

1 Like

Thank you very much @xantaxnz for your detailed help.
That helped me a lot - problem solved !

Hi, I just created a overlay for Armbian Bookworm so that you don’t have to recompile the image.

Just place the file somewhere on your SBC and issue: armbian-add-overlay <FILENAME> (add sudo if needed in front) and reboot afterwards.

/dts-v1/;
/ {
	compatible = "rockchip,rk3328";
	fragment@0 {
		target-path = "/ethernet@ff540000";
		__overlay__ {
			snps,reset-delays-us = <0 20000 100000>;
			tx_delay = <0x1a>;
			rx_delay = <0x14>;
		};
	};
	fragment@1 {
		target-path = "/ethernet@ff540000/mdio";
		__overlay__ {
			ethernet-phy@1 {
				compatible = "ethernet-phy-id001c.c916", "ethernet-phy-ieee802.3-c22";
				reset-assert-us = <20000>;
				reset-deassert-us = <100000>;
				max-speed = <1000>;
			};
		};
	};
};