From: Michal Simek Date: Tue, 12 Nov 2013 13:25:29 +0000 (+0100) Subject: net: gem: Check if phy was correctly detected X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=4ed4aa20de50661de89dbe7896595e2b0bf44d5c;p=u-boot.git net: gem: Check if phy was correctly detected As tsec and fm drivers checking phydev->link ensure that u-boot don't try access device if link is not ready. Signed-off-by: Michal Simek --- diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 6a017a8102..381bca459e 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -339,6 +339,11 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis) phy_config(phydev); phy_startup(phydev); + if (!phydev->link) { + printf("%s: No link.\n", phydev->dev->name); + return -1; + } + switch (phydev->speed) { case SPEED_1000: writel(ZYNQ_GEM_NWCFG_INIT | ZYNQ_GEM_NWCFG_SPEED1000,