Re: [PATCH net-next] net: phy: micrel: Add loopback support for ksz9131

From: Andrew Lunn

Date: Tue Jul 28 2026 - 16:06:34 EST


On Tue, Jul 28, 2026 at 09:52:20AM +0200, Maxime Chevallier wrote:
> ksz9131 is configured for local loopback in a similar fashion as the
> ksz9031, with a need for full-duplex operation, but with some extra
> steps to take as specified in section 4.13.1 :
>
> 1. Configure the following registers:
> - MMD 1C, Register 15 = EEEE
> - MMD 1C, Register 16 = EEEE
> - MMD 1C, Register 18 = EEEE
> - MMD 1C, Register 1B = EEEE
>
> These 4 registers are marked as "Reserved" in the register map.
>
> When setting loopback up without configuring these 4 registers, the PHY
> appears to shut its RXC down, which can trigger failures on MACs that
> require it, such as stmmac.
>
> The datasheet does not specify to which state the registers must be
> reset when disabling loopback, so let's restore them to their measured
> initial values.
>
> This was discovered when trying to use stmmac selftests on imx8mp with a
> ksz9131 connected in RGMII.
>
> Signed-off-by: Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew