Commit e228a8e228452a95e0af521570b020c118e70c88

Authored by Costin Carabas
Committed by Larisa Grigore
1 parent be2a703453

enet: Force start PHY after Linux reboot

Force the start of the PHY after Linux reboot.

Issue: ALB-290
Signed-off-by: Costin Carabas <costin.carabas@nxp.com>

Showing 1 changed file with 13 additions and 0 deletions Side-by-side Diff

drivers/net/phy/micrel_ksz90x1.c
... ... @@ -7,6 +7,7 @@
7 7 * (C) 2012 NetModule AG, David Andrey, added KSZ9031
8 8 * (C) Copyright 2017 Adaptrum, Inc.
9 9 * Written by Alexandru Gagniuc <alex.g@adaptrum.com> for Adaptrum, Inc.
  10 + * (C) Copyright 2017 NXP
10 11 */
11 12 #include <common.h>
12 13 #include <dm.h>
... ... @@ -344,6 +345,18 @@
344 345 static int ksz9031_config(struct phy_device *phydev)
345 346 {
346 347 int ret;
  348 + u16 bmcr;
  349 +
  350 + /*
  351 + * Check if Power-Down bit from Basic Control Register is set.
  352 + * If so, set it to 0.
  353 + */
  354 + bmcr = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR);
  355 +
  356 + if (bmcr & BMCR_PDOWN) {
  357 + bmcr &= ~BMCR_PDOWN;
  358 + phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, bmcr);
  359 + }
347 360  
348 361 ret = ksz9031_of_config(phydev);
349 362 if (ret)