net: mvpp2: allow MDIO registration for fixed links
authorStefan Chulski <stefanc@marvell.com>
Mon, 3 May 2021 06:08:52 +0000 (08:08 +0200)
committerStefan Roese <sr@denx.de>
Thu, 20 May 2021 11:03:31 +0000 (13:03 +0200)
commit27844000ef5f6717570789cace60af76f739f564
tree5985ed9a479fd2988e159b580776879c48daaa78
parentd757c859c758330bccf460d6c192109fc94b1443
net: mvpp2: allow MDIO registration for fixed links

Currently, there are 2 valid cases for interface, PHY
and mdio relation:
  - If an interface has PHY handler, it'll call
    mdio_mii_bus_get_from_phy(), which will register
    MDIO bus.
  - If we want to use fixed-link for an interface,
    PHY handle is not defined in the DTS, and no
    MDIO is registered.

There is a third case, for some boards (with switch),
the MDIO is used for switch configuration, but the interface
itself uses fixed link. This patch allows this option by
checking if fixed-link subnode is defined, in this case,
MDIO bus is registers, but the PHY address is set to
PHY_MAX_ADDR for this interface, so this interface will
not try to access the PHY later on.

Signed-off-by: Stefan Chulski <stefanc@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
drivers/net/mvpp2.c