Re: [PATCH net-next v3 3/6] net: dsa: microchip: Refactor MDIO handling for side MDIO access

From: Andrew Lunn
Date: Tue Nov 05 2024 - 13:16:28 EST


On Tue, Nov 05, 2024 at 10:09:41AM +0100, Oleksij Rempel wrote:
> Add support for accessing PHYs via a side MDIO interface in LAN937x
> switches. The existing code already supports accessing PHYs via main
> management interfaces, which can be SPI, I2C, or MDIO, depending on the
> chip variant. This patch enables using a side MDIO bus, where SPI is
> used for the main switch configuration and MDIO for managing the
> integrated PHYs. On LAN937x, this is optional, allowing them to operate
> in both configurations: SPI only, or SPI + MDIO. Typically, the SPI
> interface is used for switch configuration, while MDIO handles PHY
> management.
>
> Additionally, update interrupt controller code to support non-linear
> port to PHY address mapping, enabling correct interrupt handling for
> configurations where PHY addresses do not directly correspond to port
> indexes. This change ensures that the interrupt mechanism properly
> aligns with the new, flexible PHY address mappings introduced by side
> MDIO support.
>
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew