1
0
Fork 0
forked from mirror/openwrt
openwrt/target/linux/realtek
Jonas Jelonek 322041ffeb
realtek: mdio: enhance reading phy id
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>
2026-01-25 12:12:15 +01:00
..
base-files realtek/rtl839x: Edgecore ECS4100-12PH support 2026-01-09 21:03:41 +02:00
dts realtek: mdio: derive phy smi-bus from parent node 2026-01-21 23:32:54 +01:00
files/firmware/rtl838x_phy realtek: phy: drop unused firmware setup for RTL8214FC 2026-01-15 15:26:44 +01:00
files-6.12 realtek: mdio: enhance reading phy id 2026-01-25 12:12:15 +01:00
image realtek: image: switch cameo devices from gzip to lzma 2026-01-18 11:15:10 +01:00
patches-6.12 kernel: bump 6.12 to 6.12.66 2026-01-20 01:15:32 +01:00
profiles
rtl838x realtek: phy: drop unused firmware setup for RTL8214FC 2026-01-15 15:26:44 +01:00
rtl839x kernel: cleanup CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU 2026-01-11 12:52:54 +01:00
rtl930x kernel: cleanup CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU 2026-01-11 12:52:54 +01:00
rtl930x_nand kernel: cleanup CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU 2026-01-11 12:52:54 +01:00
rtl931x kernel: cleanup CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU 2026-01-11 12:52:54 +01:00
rtl931x_nand kernel: cleanup CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU 2026-01-11 12:52:54 +01:00
Makefile realtek: add NAND targets for RTL93xx 2025-08-10 11:46:52 +02:00