]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: dsa: microchip: Refactor MDIO handling for side MDIO access
authorOleksij Rempel <o.rempel@pengutronix.de>
Wed, 6 Nov 2024 07:59:38 +0000 (08:59 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 Nov 2024 00:04:32 +0000 (16:04 -0800)
commit9afaf0eec2ab6bcfa227ab528fbdf2881fa7a293
tree8e708abcac119099f50e8e1a10527acdc619efe7
parent698b20a679bee9c4021f35e195760798f3530c88
net: dsa: microchip: Refactor MDIO handling for side MDIO access

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@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20241106075942.1636998-4-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/microchip/ksz_common.h