mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-01-27 23:47:19 +01:00
Reading the PHY ID to assign a PHY config is currently simple. For C45 two MDIO reads of a hardcoded MMD are done to get the standard PHY ID registers. MMD 31 (MMD_VEND2) is used for that purpose, assuming there will be a valid PHY ID stored in this MMD in all cases. However, with Aquantia AQR813 there's at least one example for which this isn't true. This PHY returns 0 for the PHY ID in MMD_VEND2, instead MMD_VEND1 would have the correct ID. Enhance reading the PHY by accessing a common set of MMDs of which most PHY at least implement one and have a valid PHY ID in. To keep overhead low, do not scan all MMDs. As soon as a valid PHY ID is found, exit and use that. This is similar to the kernel logic, jsut reduced to fewer MMDs. Also handle possible errors coming from MDIO reads to avoid reading garbage. While at it, move reading the PHY ID to a separate function to not pollute the poll fixup retrievel function. Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21515 Signed-off-by: Robert Marko <robert.marko@sartura.hr> |
||
|---|---|---|
| .. | ||
| imagebuilder | ||
| linux | ||
| llvm-bpf | ||
| sdk | ||
| toolchain | ||
| Config.in | ||
| Makefile | ||