BPI-M4-Zero: Fast Ethernet (AC300 internal EPHY) working on current 6.18
Following up on the reports that EMAC1 never detects a PHY on this board — I got it working and submitted a PR: armbian/build#10328
WHAT WAS WRONG
The board DTS describes an external RMII PHY at MDIO address 1. That PHY doesn't exist. The Fast Ethernet comes from the SoC-internal AC300 EPHY, routed through the 24-pin FPC connector, so the MAC was probing correctly and finding nothing on the bus.
WHAT WAS NEEDED
Three things had to line up.
First, CONFIG_AC300_PHY=y and the h616-internal-phy stmmac patch. These landed in main around June/July 2026, so stable 26.2.1 doesn't have them. I lost a good while on that. Rolling/nightly or a self-built image is required.
Second, compatible changed from allwinner,sun50i-h616-emac to allwinner,sun50i-h616-internal-emac. The first one maps to the H6 variant, which is external PHY only.
Third, the AC300 description itself: mdio-mux plus mdio-internal, PWM5 as the 2MHz reference clock, and the SID calibration cell. I based it on arm64-dts-sun50i-h616-bigtreetech-cb1-emac1-ac300.patch
RESULTS (BPI-M4-Zero v2, Noble, current 6.18.42)
Link at 100Mb/s full duplex, DHCP on first boot
iperf3: 94.7 Mbit/s over 20s, zero retransmissions
I kept EMAC1 disabled in the base DTS since it needs the FPC expansion board, and enabling it would reserve PA0-PA9 plus PWM5 for everyone else. There's a separate overlay (bananapi-m4-zero-fpc24-eth) to turn it on.
ONE ODDITY
ethtool reports "Supported link modes: 10baseT/Half 10baseT/Full" even though the link negotiates 100/Full and reaches line rate. Looks like a capability-reporting issue in the AC300 PHY driver rather than anything in the DTS. Worth a look from someone more familiar with that driver.
ALSO
The analog codec just needs &codec enabled with "Line Out", "LINEOUT" routing, same as sun50i-h618-orangepi-zero2w.dts. Included in the same PR.
A note for anyone who finds unofficial images in the Banana Pi wiki's Google Drive: those are built from the BPI fork of armbian-build, which doesn't carry the AC300 patches. The newer kernel version alone won't help.