Rock5b gmac (no ethernet)

Hi there,
When I bring up the rock5b with the following kernel :
BR2_LINUX_KERNEL_CUSTOM_REPO_URL=“https://github.com/radxa/kernel.git
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION=“52f51a2b5ba178f331af62260d2da86d7472c14b”

I don’t get any ethernet. I can’t see any gmac mentions.
I’m loading in the following dtb :
BR2_LINUX_KERNEL_INTREE_DTS_NAME=“rockchip/rk3588-rock-5b”

Any suggestions or pointers ?

thanks
Matt

1, check device node from /sys/firmware/devicetree/base/ to see if you have the gmac device.
2, check the driver status from /sys/devices/platform/.

They are present in the device tree :

/sys/firmware/devicetree/base/ethernet@fe1b0000
/sys/firmware/devicetree/base/ethernet@fe1c0000

Both are disabled :

# cat /sys/firmware/devicetree/base/ethernet@fe1c0000/status
disabled
# cat /sys/firmware/devicetree/base/ethernet@fe1b0000/status
disabled

I force enable them by altering the device tree :

&gmac0 {
	status = "okay";
};
&gmac1 {
	status = "okay";
};

But I still don’t see them on boot. Whilst the device tree says they are stats=okay
Here is the Linux boot detail :

[    4.303512] rk_gmac-dwmac fe1c0000.ethernet: IRQ eth_lpi not found
[    4.304090] rk_gmac-dwmac: probe of fe1c0000.ethernet failed with error -22
[    4.304852] rk_gmac-dwmac fe1b0000.ethernet: IRQ eth_lpi not found
[    4.305410] rk_gmac-dwmac: probe of fe1b0000.ethernet failed with error -22

Maybe you have a wrong kernel config. I don’t have your error in the kernel log serval days ago: https://gist.github.com/amazingfate/17af25d7d543d253c9d608d1d90ff2c0.
The gmac driver is enabled by option CONFIG_GMAC_ROCKCHIP=y.

Interesting, thanks for the dmesg printout.

I can’t see CONFIG_GMAC_ROCKCHIP anywhere in this linux repo I have.

Is it posisble to let me know your linux repo, branch and or version ?
Also which config file is in use (rockchip_linux_defconfig I assume).

Ahhh I got it.

modprobe r8125.ko

Does the trick !

# modprobe r8125.ko
[  327.003482] r8125 2.5Gigabit Ethernet driver 9.009.00-NAPI-RSS loaded
[  327.004098] r8125 0004:41:00.0: enabling device (0000 -> 0003)
[  327.022730] r8125: This product is covered by one or more of the following patents: US6,570,884, US6,115,776, and US6,327,625.
[  327.025880] r8125  Copyright (C) 2022 Realtek NIC software team <nicfae@realtek.com> 
[  327.025880]  This program comes with ABSOLUTELY NO WARRANTY; for details, please see <http://www.gnu.org/licenses/>. 
[  327.025880]  This is free software, and you are welcome to redistribute it under certain conditions; see <http://www.gnu.org/licenses/>. 
# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:E1:4C:68:00:14  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:126

Lol glad to see it works. FYI I’m using kernel config from armbian, which is based on rockchip_linux_deconfig: https://github.com/armbian/build/blob/master/config/kernel/linux-rockchip-rk3588-legacy.config. There is no CONFIG_GMAC_ROCKCHIP either but I can see CONFIG_GMAC_ROCKCHIP=y from the generated file .config.

1 Like