net: emac: fix fixed-link setup for the RTL8363SB switch
Subsystems (2)
PATCH 1/1 net: emac: fix fixed-link setup for the RTL8363SB switch
On the Netgear WNDAP620, the emac ethernet isn't receiving nor xmitting any frames from/to the RTL8363SB (identifies itself as a RTL8367RB).
This is caused by the emac hardware not knowing the forced link parameters for speed, duplex, pause, etc.
This begs the question, how this was working on the original driver code, when it was necessary to set the phy_address and phy_map to 0xffffffff. But I guess without access to the old PPC405/440/460 hardware, it's not possible to know.
--- drivers/net/ethernet/ibm/emac/core.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/ethernet/ibm/emac/core.c +10 -5
@@ -2677,12 +2677,17 @@ static int emac_init_phy(struct emac_instance *dev)if (of_phy_is_fixed_link (np)) {int res =emac_dt_mdio_probe (dev); -if (!res) { - res =of_phy_register_fixed_link (np); -if (res) -mdiobus_unregister (dev->mii_bus); +if (res) +return res; + + res =of_phy_register_fixed_link (np); + dev->phy_dev =of_phy_find_device (np); +if (res || !dev->phy_dev) { +mdiobus_unregister (dev->mii_bus); +return res ? res : -EINVAL ; } -return res; +emac_adjust_link (dev->ndev); +put_device (&dev->phy_dev->mdio.dev); }return 0 ; }
Signature · 1 line
2.19.0.rc2
David Miller
AppliedFrom: Christian Lamparter <[email protected]>
Date: Mon, 17 Sep 2018 17:22:40 +0200
Quoted 7 lines
On the Netgear WNDAP620, the emac ethernet isn't receiving nor xmitting any frames from/to the RTL8363SB (identifies itself as a RTL8367RB).
This is caused by the emac hardware not knowing the forced link parameters for speed, duplex, pause, etc.
Quoted 6 lines
This begs the question, how this was working on the original driver code, when it was necessary to set the
phy_addressandphy_mapto0xffffffff. But I guess without access to the old PPC405/440/460 hardware, it's not possible to know.Signed-off-by Christian Lamparter <[email protected]>
Applied.