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>
phy_config(phydev);
phy_startup(phydev);
+ if (!phydev->link) {
+ printf("%s: No link.\n", phydev->dev->name);
+ return 0;
+ }
+
/* Do not setup anything */
return 1;
}
out_be32((u32 *)(dev->iobase + XEL_MDIOCTRL_OFFSET), XEL_MDIOCTRL_MDIOEN_MASK);
temp = in_be32((u32 *)(dev->iobase + XEL_MDIOCTRL_OFFSET));
if (temp & XEL_MDIOCTRL_MDIOEN_MASK)
- setup_phy(dev);
+ if (!setup_phy(dev))
+ return -1;
#endif
debug("EmacLite Initialization complete\n");