Commit 65a9dedc authored by Leszek Polak's avatar Leszek Polak Committed by Paolo Abeni

net: phy: marvell: Add errata section 5.1 for Alaska PHY

As per Errata Section 5.1, if EEE is intended to be used, some register
writes must be done once after every hardware reset. This patch now adds
the necessary register writes as listed in the Marvell errata.

Without this fix we experience ethernet problems on some of our boards
equipped with a new version of this ethernet PHY (different supplier).

The fix applies to Marvell Alaska 88E1510/88E1518/88E1512/88E1514
Rev. A0.
Signed-off-by: default avatarLeszek Polak <lpolak@arri.de>
Signed-off-by: default avatarStefan Roese <sr@denx.de>
Cc: Marek Behún <kabel@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: David S. Miller <davem@davemloft.net>
Reviewed-by: default avatarMarek Behún <kabel@kernel.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220516070859.549170-1-sr@denx.deSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent d1e7f009
......@@ -1191,7 +1191,44 @@ static int m88e1318_config_init(struct phy_device *phydev)
static int m88e1510_config_init(struct phy_device *phydev)
{
static const struct {
u16 reg17, reg16;
} errata_vals[] = {
{ 0x214b, 0x2144 },
{ 0x0c28, 0x2146 },
{ 0xb233, 0x214d },
{ 0xcc0c, 0x2159 },
};
int err;
int i;
/* As per Marvell Release Notes - Alaska 88E1510/88E1518/88E1512/
* 88E1514 Rev A0, Errata Section 5.1:
* If EEE is intended to be used, the following register writes
* must be done once after every hardware reset.
*/
err = marvell_set_page(phydev, 0x00FF);
if (err < 0)
return err;
for (i = 0; i < ARRAY_SIZE(errata_vals); ++i) {
err = phy_write(phydev, 17, errata_vals[i].reg17);
if (err)
return err;
err = phy_write(phydev, 16, errata_vals[i].reg16);
if (err)
return err;
}
err = marvell_set_page(phydev, 0x00FB);
if (err < 0)
return err;
err = phy_write(phydev, 07, 0xC00D);
if (err < 0)
return err;
err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE);
if (err < 0)
return err;
/* SGMII-to-Copper mode initialization */
if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment