I have a Unifi Mesh AC unit that I flashed it with OpenWRT 19.07.0 (ath79-based). I noticed a weird phenomenon that if I boot the unit without connecting it to a switch or a computer, the Ethernet interface doesn't come up. If I access the unit using a serial cable and run "ip link" command, the command shows that the interface isn't detecting any carrier, as shown below, although I am connecting it to my laptop via Ethernet cable!
eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
Nevertheless, if I set the interface down then up, the problem will be solved, and I can connect to the unit via the Ethernet interface.
I noticed, however, that the boot log messages state that the detected PHY mode is MII, as shown below:
[ 0.768847] libphy: ag71xx_mdio: probed [ 1.144711] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:04 [uid=004dd074, driver=Atheros 8031 ethernet] [ 1.155719] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
However the device dts states that the PHY mode should be SGMII. (see "qca9563_ubnt_unifiac-lite.dtsi" which is included by "qca9563_ubnt_unifiac-mesh.dts".
I flashed the unit with OpenWRT 19.07.0 (ar71xx-based) and found that the problem doesn't exist. Here are the corresponding messages:
[ 0.664040] libphy: ag71xx_mdio: probed [ 1.331534] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:04 [uid=004dd074, driver=Atheros 8031/8033 ethernet] [ 1.342870] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:SGMII
Does that mean that the device dts is wrong? How to fix this issue?
By the way, I tried the most recent OpenWRT head and the problem still exists with ath79-based firmware.