summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2013-11-12 14:25:29 +0100
committerMichal Simek <michal.simek@xilinx.com>2014-01-21 16:07:10 +0100
commit4ed4aa20de50661de89dbe7896595e2b0bf44d5c (patch)
tree53efa3a2c8a22cb041058bdc9e5402dfb73268f2 /drivers/net
parentb44bd2c73c4cfb6e3b9e7f8cf987e8e39aa74a0b (diff)
downloadu-boot-imx-4ed4aa20de50661de89dbe7896595e2b0bf44d5c.zip
u-boot-imx-4ed4aa20de50661de89dbe7896595e2b0bf44d5c.tar.gz
u-boot-imx-4ed4aa20de50661de89dbe7896595e2b0bf44d5c.tar.bz2
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 <michal.simek@xilinx.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/zynq_gem.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 6a017a8..381bca4 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,