Skip to content

Commit 6e71dcf

Browse files
nbuchwitzpopcornmix
authored andcommitted
net: phy: broadcom: disable AutogrEEEn mode on BCM54xx
BCM54xx PHYs default to AutogrEEEn mode (MII_BUF_CNTL_0 bit 0), which manages EEE Low Power Idle autonomously without forwarding LPI signaling to the MAC over the RGMII interface. This prevents the MAC from tracking LPI activity and controlling TX LPI entry/exit. Unconditionally clear the AutogrEEEn enable bit during config_init to switch all BCM54xx PHYs to Native EEE mode. In Native EEE mode the MAC controls TX LPI and the PHY forwards received LPI on the RGMII interface, allowing MACs with IEEE 802.3az support to observe RX LPI transitions. Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
1 parent c92621b commit 6e71dcf

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

drivers/net/phy/broadcom.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,15 @@ static int bcm54xx_config_init(struct phy_device *phydev)
490490
if (of_property_read_bool(np, "brcm,powerdown-enable"))
491491
phydev->dev_flags |= PHY_BRCM_AUTO_PWRDWN_ENABLE;
492492

493+
/* Disable AutogrEEEn and switch to Native EEE mode so the MAC
494+
* can control LPI signaling and observe RX LPI on the RGMII
495+
* interface.
496+
*/
497+
err = bcm_phy_modify_exp(phydev, BCM54XX_TOP_MISC_MII_BUF_CNTL0,
498+
BCM54XX_MII_BUF_CNTL0_AUTOGREEEN_EN, 0);
499+
if (err)
500+
return err;
501+
493502
bcm54xx_adjust_rxrefclk(phydev);
494503

495504
switch (phydev->drv->phy_id & PHY_ID_MATCH_MODEL_MASK) {

include/linux/brcmphy.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@
267267
#define BCM54XX_TOP_MISC_IDDQ_SD (1 << 2)
268268
#define BCM54XX_TOP_MISC_IDDQ_SR (1 << 3)
269269

270+
#define BCM54XX_TOP_MISC_MII_BUF_CNTL0 (MII_BCM54XX_EXP_SEL_TOP + 0x00)
271+
#define BCM54XX_MII_BUF_CNTL0_AUTOGREEEN_EN BIT(0)
272+
270273
#define BCM54XX_TOP_MISC_LED_CTL (MII_BCM54XX_EXP_SEL_TOP + 0x0C)
271274
#define BCM54XX_LED4_SEL_INTR BIT(1)
272275

0 commit comments

Comments
 (0)