diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/marvell.c | 5 | ||||
-rw-r--r-- | drivers/net/phy/phy.c | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index a62c695c5c..d74ddb21b0 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -373,6 +373,11 @@ static int m88e151x_config(struct phy_device *phydev) reg |= MIIM_88E1111_HWCFG_MODE_SGMII_NO_CLK; reg |= MIIM_88E1111_HWCFG_FIBER_COPPER_AUTO; +#if CONFIG_IS_ENABLED(FPGA_GMAC_SPEED10) + reg &= ~((1 << 6) | (1 << 13));//10M +#elif CONFIG_IS_ENABLED(FPGA_GMAC_SPEED100) + reg |= (1 << 13);//100M +#endif phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1111_PHY_EXT_SR, reg); } diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 69acb69460..65fbc02ec6 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -80,6 +80,11 @@ static int genphy_config_advert(struct phy_device *phydev) return err; changed = 1; } +#if CONFIG_IS_ENABLED(FPGA_GMAC_SPEED10) + phy_write(phydev, MDIO_DEVAD_NONE, 4, 0x61);//Auto-Negotiation Advertisement 10M +#elif CONFIG_IS_ENABLED(FPGA_GMAC_SPEED100) + phy_write(phydev, MDIO_DEVAD_NONE, 4, 0x181);//Auto-Negotiation Advertisement 100M +#endif bmsr = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR); if (bmsr < 0) @@ -112,7 +117,11 @@ static int genphy_config_advert(struct phy_device *phydev) if (adv != oldadv) changed = 1; +#if CONFIG_IS_ENABLED(FPGA_GMAC_SPEED_AUTO) err = phy_write(phydev, MDIO_DEVAD_NONE, MII_CTRL1000, adv); +#else + err = phy_write(phydev, MDIO_DEVAD_NONE, MII_CTRL1000, 0); +#endif if (err < 0) return err; |