Skip to content

Commit 4893952

Browse files
Andrei Botilakuba-moo
authored andcommitted
net: phy: nxp-c45-tja11xx: add TJA112XB SGMII PCS restart errata
TJA1120B/TJA1121B can achieve a stable operation of SGMII after a startup event by putting the SGMII PCS into power down mode and restart afterwards. It is necessary to put the SGMII PCS into power down mode and back up. Cc: stable@vger.kernel.org Fixes: f1fe5df ("net: phy: nxp-c45-tja11xx: add TJA1120 support") Signed-off-by: Andrei Botila <andrei.botila@oss.nxp.com> Link: https://patch.msgid.link/20250304160619.181046-3-andrei.botila@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent a07364b commit 4893952

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

drivers/net/phy/nxp-c45-tja11xx.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@
114114
#define MII_BASIC_CONFIG_RMII 0x5
115115
#define MII_BASIC_CONFIG_MII 0x4
116116

117+
#define VEND1_SGMII_BASIC_CONTROL 0xB000
118+
#define SGMII_LPM BIT(11)
119+
117120
#define VEND1_SYMBOL_ERROR_CNT_XTD 0x8351
118121
#define EXTENDED_CNT_EN BIT(15)
119122
#define VEND1_MONITOR_STATUS 0xAC80
@@ -1598,11 +1601,11 @@ static int nxp_c45_set_phy_mode(struct phy_device *phydev)
15981601
return 0;
15991602
}
16001603

1601-
/* Errata: ES_TJA1120 and ES_TJA1121 Rev. 1.0 — 28 November 2024 Section 3.1 */
1604+
/* Errata: ES_TJA1120 and ES_TJA1121 Rev. 1.0 — 28 November 2024 Section 3.1 & 3.2 */
16021605
static void nxp_c45_tja1120_errata(struct phy_device *phydev)
16031606
{
1607+
bool macsec_ability, sgmii_ability;
16041608
int silicon_version, sample_type;
1605-
bool macsec_ability;
16061609
int phy_abilities;
16071610
int ret = 0;
16081611

@@ -1619,6 +1622,7 @@ static void nxp_c45_tja1120_errata(struct phy_device *phydev)
16191622
phy_abilities = phy_read_mmd(phydev, MDIO_MMD_VEND1,
16201623
VEND1_PORT_ABILITIES);
16211624
macsec_ability = !!(phy_abilities & MACSEC_ABILITY);
1625+
sgmii_ability = !!(phy_abilities & SGMII_ABILITY);
16221626
if ((!macsec_ability && silicon_version == 2) ||
16231627
(macsec_ability && silicon_version == 1)) {
16241628
/* TJA1120/TJA1121 PHY configuration errata workaround.
@@ -1639,6 +1643,18 @@ static void nxp_c45_tja1120_errata(struct phy_device *phydev)
16391643

16401644
phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x01F8, 0x0);
16411645
phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x01F9, 0x0);
1646+
1647+
if (sgmii_ability) {
1648+
/* TJA1120B/TJA1121B SGMII PCS restart errata workaround.
1649+
* Put SGMII PCS into power down mode and back up.
1650+
*/
1651+
phy_set_bits_mmd(phydev, MDIO_MMD_VEND1,
1652+
VEND1_SGMII_BASIC_CONTROL,
1653+
SGMII_LPM);
1654+
phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1,
1655+
VEND1_SGMII_BASIC_CONTROL,
1656+
SGMII_LPM);
1657+
}
16421658
}
16431659
}
16441660

0 commit comments

Comments
 (0)