From: Siva Durga Prasad Paladugu Date: Tue, 26 Feb 2019 12:12:44 +0000 (+0530) Subject: net: phy: xilinx_gmii2rgmii: Add check for external phy detection X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=195c620e348891ca2d90c759781413f2adb3f748;p=thirdparty%2Fu-boot.git net: phy: xilinx_gmii2rgmii: Add check for external phy detection Add check if an external phy is detected or not before proceeding further to config the external phy. This patch fixes the issue of u-boot hang or reset, if u-boot is not able to communicate with external connected over gmiitorgmii bridge. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c index dad2bf7d840..19d8d4d8207 100644 --- a/drivers/net/phy/xilinx_gmii2rgmii.c +++ b/drivers/net/phy/xilinx_gmii2rgmii.c @@ -82,6 +82,11 @@ static int xilinxgmiitorgmii_probe(struct phy_device *phydev) 1 << ext_phyaddr, PHY_INTERFACE_MODE_RGMII); + if (!phydev->priv) { + printf("%s, No external phy device found\n", __func__); + return -EINVAL; + } + debug("%s, gmii2rgmmi:0x%x, extphy:0x%x\n", __func__, phydev->addr, ext_phyaddr);