1
0
Fork 0

net: phy: vsc8514: enable in-band SGMII auto-negotiation setting

The default in-band AN setting for the VSC8514 PHY is not very reliable:
its out-of-reset state is with SerDes AN disabled, but certain boot
firmware (such as U-Boot) enables it during the boot process.

So its final state as seen by Linux depends on whether the U-Boot PHY
driver has run or not.

If SGMII auto-negotiation is enabled but not acknowledged by the MAC,
the PHY does not pass traffic.

But otherwise, it is able to pass traffic both with AN disabled, and
with AN enabled.

We would like to make this explicitly configurable rather than hardcoded
as "on" as we are doing right now, but we'd rather hardcode it in LSDK
and wait until a solution lands upstream, than invent a solution for
this here.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
(cherry picked from commit 485ce40d18b8ff08620997f5eada324cd67111a1)
5.4-rM2-2.2.x-imx-squashed
Alex Marginean 2019-12-27 21:44:46 +02:00 committed by Jason Liu
parent bef7199d2b
commit 6469b97591
1 changed files with 10 additions and 0 deletions

View File

@ -176,6 +176,8 @@ enum rgmii_rx_clock_delay {
#define SECURE_ON_PASSWD_LEN_4 0x4000
/* Extended Page 3 Registers */
#define MSCC_PHY_SERDES_CON 16
#define MSCC_PHY_SERDES_ANEG BIT(7)
#define MSCC_PHY_SERDES_TX_VALID_CNT 21
#define MSCC_PHY_SERDES_TX_CRC_ERR_CNT 22
#define MSCC_PHY_SERDES_RX_VALID_CNT 28
@ -2131,6 +2133,14 @@ static int vsc8514_config_init(struct phy_device *phydev)
mutex_unlock(&phydev->mdio.bus->mdio_lock);
ret = phy_write(phydev, MSCC_EXT_PAGE_ACCESS, MSCC_PHY_PAGE_EXTENDED_3);
if (ret)
return ret;
ret = phy_set_bits(phydev, MSCC_PHY_SERDES_CON, MSCC_PHY_SERDES_ANEG);
if (ret)
return ret;
ret = phy_write(phydev, MSCC_EXT_PAGE_ACCESS, MSCC_PHY_PAGE_STANDARD);
if (ret)