]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: phy: broadcom: implement .disable_autonomous_eee for BCM54xx
authorNicolai Buchwitz <nb@tipi-net.de>
Mon, 6 Apr 2026 07:13:08 +0000 (09:13 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sun, 12 Apr 2026 18:33:23 +0000 (11:33 -0700)
Implement the .disable_autonomous_eee callback for the BCM54210E.

In AutogrEEEn mode the PHY manages EEE autonomously. Clearing the
AutogrEEEn enable bit in MII_BUF_CNTL_0 switches the PHY to Native
EEE mode.

Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20260406-devel-autonomous-eee-v1-2-b335e7143711@tipi-net.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/broadcom.c
include/linux/brcmphy.h

index cb306f9e80cca6f810afcab967923dd1896638dd..bf0c6a04481ee23110e249118bbe086ffe8e7a8f 100644 (file)
@@ -1452,6 +1452,12 @@ static int bcm54811_read_status(struct phy_device *phydev)
        return genphy_read_status(phydev);
 }
 
+static int bcm54xx_disable_autonomous_eee(struct phy_device *phydev)
+{
+       return bcm_phy_modify_exp(phydev, BCM54XX_TOP_MISC_MII_BUF_CNTL0,
+                                 BCM54XX_MII_BUF_CNTL0_AUTOGREEEN_EN, 0);
+}
+
 static struct phy_driver broadcom_drivers[] = {
 {
        PHY_ID_MATCH_MODEL(PHY_ID_BCM5411),
@@ -1495,6 +1501,7 @@ static struct phy_driver broadcom_drivers[] = {
        .get_wol        = bcm54xx_phy_get_wol,
        .set_wol        = bcm54xx_phy_set_wol,
        .led_brightness_set     = bcm_phy_led_brightness_set,
+       .disable_autonomous_eee = bcm54xx_disable_autonomous_eee,
 }, {
        PHY_ID_MATCH_MODEL(PHY_ID_BCM5461),
        .name           = "Broadcom BCM5461",
index 115a964f3006965e9bfd247eb969b9ca586ae675..174687c4c80a8b12eb841cdb4e8865813bb34adc 100644 (file)
 #define BCM54XX_TOP_MISC_IDDQ_SD               (1 << 2)
 #define BCM54XX_TOP_MISC_IDDQ_SR               (1 << 3)
 
+#define BCM54XX_TOP_MISC_MII_BUF_CNTL0         (MII_BCM54XX_EXP_SEL_TOP + 0x00)
+#define  BCM54XX_MII_BUF_CNTL0_AUTOGREEEN_EN   BIT(0)
+
 #define BCM54XX_TOP_MISC_LED_CTL               (MII_BCM54XX_EXP_SEL_TOP + 0x0C)
 #define  BCM54XX_LED4_SEL_INTR                 BIT(1)