diff options
-rw-r--r-- | board/toradex/apalis_imx6/apalis_imx6.c | 2 | ||||
-rw-r--r-- | drivers/net/phy/micrel.c | 22 | ||||
-rw-r--r-- | include/micrel.h | 1 |
3 files changed, 23 insertions, 2 deletions
diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index e42d9bd2531..b2bb8757897 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -480,6 +480,8 @@ int board_mmc_init(bd_t *bis) int board_phy_config(struct phy_device *phydev) { + ksz9031_center_flp_timing(phydev); + mx6_rgmii_rework(phydev); if (phydev->drv->config) phydev->drv->config(phydev); diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 28a14018835..45db5117643 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -436,9 +436,27 @@ static int ksz9031_of_config(struct phy_device *phydev) { return 0; } -static int ksz9031_center_flp_timing(struct phy_device *phydev) +int ksz9031_center_flp_timing(struct phy_device *phydev) { - return 0; + struct phy_driver *drv = phydev->drv; + int ret = 0; + + if (!drv || !drv->writeext) + return -EOPNOTSUPP; + + ret = drv->writeext(phydev, 0, 0, MII_KSZ9031_FLP_BURST_TX_LO, 0x1A80); + if (ret) { + puts("Write failed"); + return ret; + } + + ret = drv->writeext(phydev, 0, 0, MII_KSZ9031_FLP_BURST_TX_HI, 0x6); + if (ret) { + puts("Write failed"); + return ret; + } + + return genphy_restart_aneg(phydev); } #endif diff --git a/include/micrel.h b/include/micrel.h index 3e6b5312d85..783dc634e2c 100644 --- a/include/micrel.h +++ b/include/micrel.h @@ -35,5 +35,6 @@ int ksz9031_phy_extended_write(struct phy_device *phydev, int devaddr, int regnum, u16 mode, u16 val); int ksz9031_phy_extended_read(struct phy_device *phydev, int devaddr, int regnum, u16 mode); +int ksz9031_center_flp_timing(struct phy_device *phydev); #endif |