net: phy: prioritize GMII2RGMII bridge over DM-bound PHY lookup
Subsystems (2)
PATCH 1/1 net: phy: prioritize GMII2RGMII bridge over DM-bound PHY lookup
phy_connect() currently checks for a DM-bound PHY before attempting GMII-to-RGMII bridge discovery. On boards using a GMII-to-RGMII bridge, the external PHY node is already DM-bound, so phy_connect_dm_bound() returns it first and the bridge is never selected. This skips xilinxgmiitorgmii_startup(), preventing the GMII-to-RGMII converter from being configured for the negotiated link parameters and leaving the GEM's MAC-side phydev pointing at the external PHY instead of the bridge.
Check for the gmii2rgmii bridge first and fall back to the DM-bound lookup only when no bridge device is found, restoring the bridge as the MAC-side phydev on boards that have one.
--- drivers/net/phy/phy.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/phy/phy.c +6 -6
@@ -950,8 +950,13 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr,struct phy_device *phydev =NULL ;uint mask = (addr >=0 ) ? (1 << addr) :0xffffffff ; +#ifdef CONFIG_PHY_XILINX_GMII2RGMII + phydev =phy_connect_gmii2rgmii (bus, dev); +#endif +#ifdef CONFIG_DM_ETH_PHY - phydev =phy_connect_dm_bound (bus, dev, mask); +if (!phydev) + phydev =phy_connect_dm_bound (bus, dev, mask);#endif #ifdef CONFIG_PHY_FIXED
@@ -969,11 +974,6 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr, phydev =phy_connect_phy_id (bus, dev, addr);#endif -#ifdef CONFIG_PHY_XILINX_GMII2RGMII -if (!phydev) - phydev =phy_connect_gmii2rgmii (bus, dev); -#endif -if (!phydev) phydev =phy_find_by_mask (bus, mask);
Signature · 1 line
2.43.0
Quoted 10 lines · Pranav Tilak
phy_connect()currently checks for a DM-bound PHY before attempting GMII-to-RGMII bridge discovery. On boards using a GMII-to-RGMII bridge, the external PHY node is already DM-bound, sophy_connect_dm_bound()returns it first and the bridge is never selected. This skipsxilinxgmiitorgmii_startup(), preventing the GMII-to-RGMII converter from being configured for the negotiated link parameters and leaving the GEM's MAC-side phydev pointing at the external PHY instead of the bridge.[...]
Applied to u-boot-net branch for-next, thanks!
[1/1] net: phy: prioritize GMII2RGMII bridge over DM-bound PHY lookup
commit: 3518647f4d4d30e40cc015d670734e61f98e9133
Best regards,
Signature · 1 line
Jerome Forissier <[email protected]>