[BPi-R3-Mini] Airoha EN8811H 2.5G PHY driver

using genphy_parse_link seems not working here…code looks similar, structured differently, but does not work like this way:

			ret = en8811h_get_autonego(phydev, &phydev->autoneg);
			if (ret) {
				printf("EN8811H get AN fail.\n");
				return ret;
			}
			ret = genphy_parse_link(phydev);
			printf("EN8811H genphy_parse_link (ret:%d)...\n",ret);
			printf("EN8811H speed (after genphy): %d duplex: %d pause: %d asym_pause: %d\n",phydev->speed, phydev->duplex,phydev->pause,phydev->asym_pause);
EN8811H speed: 100 duplex: 1 pause: 0 asym_pause: 0
EN8811H BMSR_LSTATUS
EN8811H driver get autoneg.
EN8811H genphy_parse_link (ret:0)...
EN8811H speed (after genphy): 100 duplex: 1 pause: 0 asym_pause: 0
Using ethernet@15100000 device

ARP Retry count exceeded; starting again
ping failed; host 192.168.0.10 is not alive
BPI-R3M>

current code matches for LPA flags where genphy looks for SUPPORTED_1000baseT_Full

	if (common_adv_gb & (LPA_1000FULL | LPA_1000HALF))
	else if (common_adv & (LPA_100FULL | LPA_100HALF))

seems like current phy-driver does not set the phydev->supported field…so i added like this:

phydev->supported = ( SUPPORTED_1000baseT_Full | SUPPORTED_1000baseT_Half);

and genphy_parselink returns with

EN8811H speed (after genphy): 1000 duplex: 1 pause: 0 asym_pause: 0

but ping does not work ;(

something is still different…but output is same (and after adding the phylink-suported set i can change back the 1G-“fix” back to &)

EN8811H speed: 100 duplex: 1 pause: 0 asym_pause: 0
EN8811H BMSR_LSTATUS
EN8811H driver get autoneg.
EN8811H genphy_parse_link (ret:0)...
EN8811H (after genphy) speed: 1000 duplex: 1 pause: 0 asym_pause: 0
AN mode...SPEED 1000/100!
EN8811H speed detection (adv_gb: 0x00000800,adv: 0x00000101)...
EN8811H speed 1000...
EN8811H (after original code) speed: 1000 duplex: 1 pause: 0 asym_pause: 0      
Using ethernet@15100000 device                                                  
host 192.168.0.10 is alive                                                      
BPI-R3M>

wonder why genphy is not enough…both seem to only read and set only the phydev members and do this to same values

Check the other phy drivers in u-boot: drivers/net/phy · master · U-Boot / U-Boot · GitLab (denx.de)

They all have the #define’s inside 1 file, together with the code.

yes i can do later, but first i need to fix the genphy-issue…it looks like code does the same as in the airoha driver, but it does not work…it sets only the phydev fields the same way…no external writes/calls to the phy itself…only changing the struct that is then read from the phylib

i guess the or change is wrong…i guess it should intersect the advertised modes with the received advertising…

I’ve modified the driver to load the EN8811H firmware from either eMMC boot1 or a UBI volume called ‘en8811h-firmware’ from UBI – that will allow updating the firmware for U-Boot without having to replace U-Boot itself. It also prevents the firmware being linked into U-Boot which would require it to be licensed under GPL-2.0+ (like U-Boot)…

I had not got the flash of firmware to emmc boot1 working [R3mini] uboot getting ethernet/nvme to work - #18 by frank-w

we can also continue in this thread as this is u-boot specific

@dangowrt have you an idea why genphy function does not work?

btw. my current code is in branch 2024-04-bpi-r3mini…and now 1000Mbit works without the or-change (maybe because the phydev->supported addition) a cleaner version (without the genphy part) is in 2024-04-bpi…if you want to change openwrt/immortalwrt at this point to get the second network access working

@eric: have you seen that on Mar 28, 2024 firmware got an update (merged today based on ML)?

Btw. Added phy driver to my 6.6-main and also the other patches to support r3mini - also tested with new firmware…seems to work well :wink:

Thanks!!!

Hi everyone,

. I’m trying to get 2.5Gb/s speed on my BPI-R3 Mini running OpenWrt 24.10.5.

  • PHY: Airoha EN8811H
  • Driver: mtk_soc_eth
  • Using Cat8 cables
  • Connected to a 2.5Gb/s switch

Right now, the link only reaches 1Gb/s, even though the hardware supports 2.5Gb/s. I tried using ethtool to force it, but it still shows 1Gb/s.

Has anyone successfully enabled 2.5Gb/s on the EN8811H with OpenWrt? Is there a driver update or workaround?

Any help or guidance would be greatly appreciated!

Banana Pi R3 mini........I'm lost - #97 by WC23

Therein lies the solution

Do you have the output of:

ethtool eth0

You need to connect via serial or Wi-Fi to enable the network again.

What ever you prefer,… You used ethtool before, so you can share the output to help you find where the problem may be right?

That is not what was asked for, not very helpful. And also, you have shared a similar image before.

So just share the output of your attempt.

First, please connect either:

  • via WiFi, or
  • via serial console

During testing the Ethernet link may temporarily go down, so you could lose SSH access if you are connected over LAN.

Install required tools

 opkg update
 opkg install ethtool

Check current link status

ethtool eth0
ethtool eth1
ethtool -i eth0
ethtool -i eth1

Full 2.5G Diagnostic Script (BPI-R3 Mini)

Paste:

#!/bin/sh
# Script to diagnose 2.5G negotiation on BPI-R3 Mini

echo "=== CURRENT STATUS ETH0 ==="
ethtool eth0

echo "=== CURRENT STATUS ETH1 ==="
ethtool eth1

echo "=== ADVERTISED AND DRIVER INFO ==="
echo "--- ETH0 ---"
ethtool -a eth0
ethtool -i eth0

echo "--- ETH1 ---"
ethtool -a eth1
ethtool -i eth1

echo "=== FORCING AUTONEGOTIATION WITH 2.5G ADVERTISE ==="
echo "Trying autoneg on, advertise 2.5G..."

ip link set eth0 down
ethtool -s eth0 autoneg on advertise 0x80000000002
ip link set eth0 up

ip link set eth1 down
ethtool -s eth1 autoneg on advertise 0x80000000002
ip link set eth1 up

echo "=== NEW STATUS AFTER ATTEMPT ==="
ethtool eth0 | grep -i speed
ethtool eth1 | grep -i speed

echo "=== RECENT PHY LOGS ==="
dmesg | tail -n 30 | grep -i en8811h

Then:

chmod +x diagnose_2_5g.sh
./diagnose_2_5g.sh

I really do not understand. Are you now giving me instructions on how to diagnose the problem you are having?

I’m not the one asking for help here.

Please stop cluttering this topic with useless AI output.

eso a mi me funciono y tengo 2.5 sin problema

That worked for me and I have 2.5 without any problems

Eric needs the output of 2 simple commands not an ai generated script…and always write in englich…

It does not help us to help you when you say the script was working :smiley: or is your issue fixed (i guess no)?

I’m sure R3Mini (and other dev boards) are not good choice for you…

It seems his problem is solved. Otherwise please continue in another topic, this is not a phy driver issue.

I don’t understand. Mine is working perfectly, and it’s a good motherboard; I recommend it.

I think you need to find a better translator :wink: