It is still not working unfortunately. Driver is loaded but not being used by 2.5Gbps nic? (I am assuming eth1)
root@bpi-r4:~# lsmod | grep mtk
mtk_2p5ge 16384 0
root@bpi-r4:~# modinfo mtk-2p5ge
filename: /lib/modules/6.17.0-bpi-r4-main/kernel/drivers/net/phy/mediatek/mtk-2p5ge.ko
firmware: mediatek/mt7988/i2p5ge-phy-pmb.bin
license: GPL
author: SkyLake Huang <[email protected] >
description: MediaTek 2.5Gb Ethernet PHY driver
alias: mdio:0000000000110011100111??????????
depends:
intree: Y
name: mtk_2p5ge
vermagic: 6.17.0-bpi-r4-main SMP mod_unload aarch64
root@bpi-r4:~# dmesg | grep -i mtk
[ 0.647361] mtk-socinfo mtk-socinfo.0.auto: error -ENOENT: Failed to get socinfo data
[ 0.655238] mtk-socinfo mtk-socinfo.0.auto: probe with driver mtk-socinfo failed with error -2
[ 0.977434] mtk_soc_eth 15100000.ethernet: generated random MAC address fe:b8:d9:f2:03:10
[ 1.120952] mtk-lvts-thermal 1100a000.lvts: fake golden temp=60
[ 1.128418] mtk-wdt 1001c000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[ 1.224374] mtk-pcie-gen3 11280000.pcie: host bridge /soc/pcie@11280000 ranges:
[ 1.231723] mtk-pcie-gen3 11280000.pcie: Parsing ranges property...
[ 1.231741] mtk-pcie-gen3 11280000.pcie: IO 0x0020000000..0x00201fffff -> 0x0020000000
[ 1.231754] mtk-pcie-gen3 11280000.pcie: MEM 0x0020200000..0x002fffffff -> 0x0020200000
[ 1.367279] mtk_soc_eth 15100000.ethernet: generated random MAC address 76:42:32:be:8d:1f
[ 1.375551] mtk_soc_eth 15100000.ethernet: generated random MAC address ba:7c:bb:08:be:ad
[ 1.387553] mtk_soc_eth 15100000.ethernet eth0: mediatek frame engine at 0xffffffc084200000, irq 69
[ 1.397445] mtk_soc_eth 15100000.ethernet eth1: mediatek frame engine at 0xffffffc084200000, irq 69
[ 1.407103] xhci-mtk 11200000.usb: supply vbus not found, using dummy regulator
[ 1.414518] xhci-mtk 11200000.usb: supply vusb33 not found, using dummy regulator
[ 1.422728] xhci-mtk 11200000.usb: xHCI Host Controller
[ 1.428001] xhci-mtk 11200000.usb: new USB bus registered, assigned bus number 1
[ 1.438383] xhci-mtk 11200000.usb: hcc params 0x01443f99 hci version 0x120 quirks 0x0000000020200010
[ 1.447552] xhci-mtk 11200000.usb: irq 75, io mem 0x11200000
[ 1.453306] xhci-mtk 11200000.usb: xHCI Host Controller
[ 1.456204] mtk-pcie-gen3 11280000.pcie: PCIe link down, current LTSSM state: detect.quiet (0x1)
[ 1.458535] xhci-mtk 11200000.usb: new USB bus registered, assigned bus number 2
[ 1.467325] mtk-pcie-gen3 11280000.pcie: probe with driver mtk-pcie-gen3 failed with error -110
[ 1.474676] xhci-mtk 11200000.usb: Host supports USB 3.2 Enhanced SuperSpeed
[ 1.689332] mtk_soc_eth 15100000.ethernet eth0: entered promiscuous mode
[ 1.856131] usb 2-1: new SuperSpeed USB device number 2 using xhci-mtk
[ 2.006084] usb 1-1: new high-speed USB device number 2 using xhci-mtk
[ 7.520951] mtk_soc_eth 15100000.ethernet eth1: PHY [mdio-bus:0f] driver [Generic Clause 45 PHY] (irq=POLL)
[ 7.528174] mtk_soc_eth 15100000.ethernet eth1: configuring for phy/internal link mode
[ 7.530977] mtk_soc_eth 15100000.ethernet eth0: entered allmulticast mode
[ 7.551963] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/2500base-x link mode
[ 7.553444] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control off
Here is my ip addr results…
root@bpi-r4:/tmp/itb# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
link/sit 0.0.0.0 brd 0.0.0.0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc mq state UP group default qlen 1000
link/ether 76:42:32:be:8d:1f brd ff:ff:ff:ff:ff:ff
4: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether ba:7c:bb:08:be:ad brd ff:ff:ff:ff:ff:ff
5: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master lanbr0 state LOWERLAYERDOWN group default qlen 1000
link/ether 76:42:32:be:8d:1f brd ff:ff:ff:ff:ff:ff
6: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master lanbr0 state LOWERLAYERDOWN group default qlen 1000
link/ether 76:42:32:be:8d:1f brd ff:ff:ff:ff:ff:ff
7: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master lanbr0 state LOWERLAYERDOWN group default qlen 1000
link/ether 76:42:32:be:8d:1f brd ff:ff:ff:ff:ff:ff
8: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master lanbr0 state LOWERLAYERDOWN group default qlen 1000
link/ether 76:42:32:be:8d:1f brd ff:ff:ff:ff:ff:ff
9: sfp0@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 76:42:32:be:8d:1f brd ff:ff:ff:ff:ff:ff
10: lanbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 12:2a:21:ff:78:f2 brd ff:ff:ff:ff:ff:ff
inet 10.168.2.0/24 brd 10.168.2.255 scope global lanbr0
valid_lft forever preferred_lft forever
frank-w
(Frank W.)
November 1, 2025, 5:29pm
42
The phy is eth1…have you put firmware in the right folder?
root@bpi-r4:/lib# ll /lib/firmware/mediatek/mt7987
total 132
drwxr-xr-x 2 root root 4096 Oct 31 21:43 ./
drwxr-xr-x 16 root root 4096 Oct 31 20:05 ../
-rw-r--r-- 1 root root 28672 Oct 31 21:43 i2p5ge-phy-DSPBitTb.bin
-rw-r--r-- 1 root root 98304 Oct 31 21:43 i2p5ge-phy-pmb.bin
Generic driver is getting loaded?
[ 7.520951] mtk_soc_eth 15100000.ethernet eth1: PHY [mdio-bus:0f] driver [Generic Clause 45 PHY] (irq=POLL)
[ 7.528174] mtk_soc_eth 15100000.ethernet eth1: configuring for phy/internal link mode
frank-w
(Frank W.)
November 1, 2025, 10:17pm
44
why generic? this is really strange…have you added another driver?
No I only added these
i2p5ge-phy-DSPBitTb.bin
i2p5ge-phy-pmb.bin
It always did this, even before adding the i2p5ge drivers.
[ 7.520951] mtk_soc_eth 15100000.ethernet eth1: PHY [mdio-bus:0f] driver [Generic Clause 45 PHY] (irq=POLL)
After adding them nothing changed. I think maybe something in the DT?
I used this…
variant=bpi-r4-lite
skipubootdownload=1
imgfile=bpi-r4lite_emmc.img.gz
skipkerneldownload=1
kernelfile=bpi-r4lite_6.17.0-main.tar.gz
fipfile=bpi-r4lite_emmc_fip.bin
But I think you used a a different kernel?
frank-w
(Frank W.)
November 2, 2025, 6:55am
46
I also used 6.17-main tree,but self compiled because i transferred it via tftp. It is no issued in images repo,it is kernel related. Maybe because i have driver and firmware builtin.
But i’m unsure why in your case a generic phy is detected.
ericwoud
(Eric W.)
November 2, 2025, 9:30am
47
With phylink, the driver is loaded quite early. So if the driver is a module and not present in initrd, that may explain the generic driver.
frank-w
(Frank W.)
November 2, 2025, 10:04am
48
how can we force using the mtk driver instead of the generic one?
ericwoud
(Eric W.)
November 2, 2025, 10:10am
49
It should be recognized by id, so just put the module in initrd or set config to ‘y’ to build in
If it is somehow not recognized:
- pattern: "^ethernet-phy-id[a-f0-9]{4}\\.[a-f0-9]{4}$"
description:
If the PHY reports an incorrect ID (or none at all) then the
compatible list may contain an entry with the correct PHY ID
in the above form.
The first group of digits is the 16 bit Phy Identifier 1
register, this is the chip vendor OUI bits 3:18. The
second group of digits is the Phy Identifier 2 register,
this is the chip vendor OUI bits 19:24, followed by 10
bits of a vendor specific ID.
ethernet {
#address-cells = <1>;
#size-cells = <0>;
ethernet-phy@0 {
compatible = "ethernet-phy-id0141.0e90", "ethernet-phy-ieee802.3-c45";
Change the ID to the appropriate one.
But that is only for fixing a problem temporarily, this should not be the final solution
frank-w
(Frank W.)
November 2, 2025, 10:21am
50
yes, i’ve tested with builtin (needs firmware also builtin of course).
but preferred way should be having it as module and imho it should be mapped via phy_id
size = <256>;
};
};
};
};
&mdio {
/* built-in 2.5G Ethernet PHY */
phy15: phy@15 {
pinctrl-names = "i2p5gbe-led";
pinctrl-0 = <&i2p5gbe_led0_pins>;
compatible = "ethernet-phy-ieee802.3-c45";
reg = <15>;
phy-mode = "internal";
active-low;
};
switch31: switch@31 {
compatible = "mediatek,mt7531";
reg = <31>;
reset-gpios = <&pio 42 0>;
status = "okay";
};
so we should change the phy-id to the one in driver?
ethernet-phy-ieee802.3-id0033.9c91
?
i guess with fallback also the generic driver binds first
ericwoud
(Eric W.)
November 2, 2025, 11:11am
51
That would be nice,
I think it will be the same problem as the r3mini, the driver needs to be available (phylink needs), before the rootfs is mounted. So buildin, or add to initrd.
Defered probing did not work (then).
What are next steps? Patch bpi-r4lite_6.17.0-main.tar.gz kernel? But have to wait for Sky to fix the driver repo for mt7987?
ericwoud
(Eric W.)
November 3, 2025, 11:17am
53
Have you tried setting
CONFIG_MEDIATEK_2P5GE_PHY=y
CONFIG_EXTRA_FIRMWARE="mediatek/mt7987/i2p5ge-phy-DSPBitTb.bin mediatek/mt7987/i2p5ge-phy-pmb.bin"
CONFIG_EXTRA_FIRMWARE_DIR="utils/firmware/"
Or adding the module and firmware files to the initramdisk?
ericwoud
(Eric W.)
November 3, 2025, 11:22am
54
Maybe try without this line, perhaps this prevents the correct driver to be probed? Not sure…
frank-w
(Frank W.)
November 3, 2025, 11:34am
55
Afaik this line is needed for phylink to probe the phy itself. We will have similar issues with R4Pro and the aeonsemi (external) phys i guess
But i have no idea how to target it to mtk driver instead of generic…seems software design is broken when phy driver is module as it should be because of firmware depend on rootfs mounted.
ericwoud
(Eric W.)
November 3, 2025, 1:07pm
56
It can be in initrd? I do so for the R3-mini. I guess the module can be in initrd as well, but I use buildin, as the size is not that much
The R3-mini does not use the compatible string in devicetree at all for the en8811h. The other phy’s should be functional the same. Only using the id retrieved using mdio from the phy itself
frank-w
(Frank W.)
November 3, 2025, 3:41pm
57
Adding such apecific initrd (need to add the module too) is more complex than adding the driver and firmware to kernel.
But it is imho the wrong way…driver allows module (could be bool too),so it has tobwork as module…imho this is broken design if phylink catches the phy device before driver module is loaded
ericwoud
(Eric W.)
November 3, 2025, 5:04pm
58
Perhaps ask Russel if this can be done somehow. Or maybe this has been added in the meanwhile?
Edit:
Adding a module to the initrd should not be so difficult, some initrd systems have buildin functionally for it.
I’ve added that functionally to my initrd-builder also, but not using it at the moment.
Edit2:
It may be the case, that if mtk_eth_soc is build as a module, it gets probed when the module is available, then phylink will also link the phy later…
ericwoud
(Eric W.)
November 4, 2025, 3:38pm
59
@frank-w
See Edit2 above,
I think that if the mac driver (mtk_eth_soc in our case) is builtin, then the phy driver that is linked to it also needs to be builtin.
So to have the phy as module, I think the mac(+pcs) driver need to be a module. But do you even want mtk_eth_soc as module?
frank-w
(Frank W.)
November 4, 2025, 4:23pm
60
No i do not want eth driver as module…only the phy driver because of firmware
And i have a generic initrd not want to build one for every kernel