Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: bcm54811: Fix GMII/MII/MII-Lite selection

The Broadcom bcm54811 is hardware-strapped to select among RGMII and
GMII/MII/MII-Lite modes. However, the corresponding bit, RGMII Enable
in Miscellaneous Control Register must be also set to select desired
RGMII or MII(-lite)/GMII mode.

Fixes: 3117a11fff5af9e7 ("net: phy: bcm54811: PHY initialization")
Signed-off-by: Kamil Horák - 2N <kamilh@axis.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20251009130656.1308237-2-kamilh@axis.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kamil Horák - 2N and committed by
Jakub Kicinski
e4d0c909 70f92ab9

+20 -1
+19 -1
drivers/net/phy/broadcom.c
··· 405 405 static int bcm54811_config_init(struct phy_device *phydev) 406 406 { 407 407 struct bcm54xx_phy_priv *priv = phydev->priv; 408 - int err, reg, exp_sync_ethernet; 408 + int err, reg, exp_sync_ethernet, aux_rgmii_en; 409 409 410 410 /* Enable CLK125 MUX on LED4 if ref clock is enabled. */ 411 411 if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) { ··· 431 431 err = bcm_phy_modify_exp(phydev, BCM_EXP_SYNC_ETHERNET, 432 432 BCM_EXP_SYNC_ETHERNET_MII_LITE, 433 433 exp_sync_ethernet); 434 + if (err < 0) 435 + return err; 436 + 437 + /* Enable RGMII if configured */ 438 + if (phy_interface_is_rgmii(phydev)) 439 + aux_rgmii_en = MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_EN | 440 + MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN; 441 + else 442 + aux_rgmii_en = 0; 443 + 444 + /* Also writing Reserved bits 6:5 because the documentation requires 445 + * them to be written to 0b11 446 + */ 447 + err = bcm54xx_auxctl_write(phydev, 448 + MII_BCM54XX_AUXCTL_SHDWSEL_MISC, 449 + MII_BCM54XX_AUXCTL_MISC_WREN | 450 + aux_rgmii_en | 451 + MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RSVD); 434 452 if (err < 0) 435 453 return err; 436 454
+1
include/linux/brcmphy.h
··· 137 137 138 138 #define MII_BCM54XX_AUXCTL_SHDWSEL_MISC 0x07 139 139 #define MII_BCM54XX_AUXCTL_SHDWSEL_MISC_WIRESPEED_EN 0x0010 140 + #define MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RSVD 0x0060 140 141 #define MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_EN 0x0080 141 142 #define MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN 0x0100 142 143 #define MII_BCM54XX_AUXCTL_MISC_FORCE_AMDIX 0x0200