OSDN Git Service

enetc: Add mdio bus driver for the PCIe MDIO endpoint
authorClaudiu Manoil <claudiu.manoil@nxp.com>
Thu, 1 Aug 2019 11:52:51 +0000 (14:52 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 Aug 2019 01:22:18 +0000 (18:22 -0700)
commit231ece36f50df5d0d648011c58d4255d112a8bbf
tree707edd0211ede4ebfb4b68ba2debd147e9f4dcce
parent0c010a9deb33179169fa867d3c76833ce80165b7
enetc: Add mdio bus driver for the PCIe MDIO endpoint

ENETC ports can manage the MDIO bus via local register
interface.  However there's also a centralized way
to manage the MDIO bus, via the MDIO PCIe endpoint
device integrated by the same root complex that also
integrates the ENETC ports (eth controllers).

Depending on board design and use case, centralized
access to MDIO may be better than using local ENETC
port registers.  For instance, on the LS1028A QDS board
where MDIO muxing is required.  Also, the LS1028A on-chip
switch doesn't have a local MDIO register interface.

The current patch registers the above PCIe endpoint as a
separate MDIO bus and provides a driver for it by re-using
the code used for local MDIO access.  It also allows the
ENETC port PHYs to be managed by this driver if the local
"mdio" node is missing from the ENETC port node.

Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/Kconfig
drivers/net/ethernet/freescale/enetc/Makefile
drivers/net/ethernet/freescale/enetc/enetc_mdio.c
drivers/net/ethernet/freescale/enetc/enetc_mdio.h [new file with mode: 0644]
drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c [new file with mode: 0644]
drivers/net/ethernet/freescale/enetc/enetc_pf.c