Skip to content

Commit 34bf222

Browse files
Kamil Horák - 2Nkuba-moo
authored andcommitted
net: phy: bcm5481x: MII-Lite activation
Broadcom PHYs featuring the BroadR-Reach two-wire link mode are usually capable to operate in simplified MII mode, without TXER, RXER, CRS and COL signals as defined for the MII. The absence of COL signal makes half-duplex link modes impossible, however, the BroadR-Reach modes are all full-duplex only. Depending on the IC encapsulation, there exist MII-Lite-only PHYs such as bcm54811 in MLP. The PHY itself is hardware-strapped to select among multiple RGMII and MII-Lite modes, but the MII-Lite mode must be also activated by software. Add MII-Lite activation for bcm5481x PHYs. Signed-off-by: Kamil Horák - 2N <kamilh@axis.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/20250708090140.61355-4-kamilh@axis.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent fbe9374 commit 34bf222

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

drivers/net/phy/broadcom.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static int bcm5481x_set_brrmode(struct phy_device *phydev, bool on)
407407
static int bcm54811_config_init(struct phy_device *phydev)
408408
{
409409
struct bcm54xx_phy_priv *priv = phydev->priv;
410-
int err, reg;
410+
int err, reg, exp_sync_ethernet;
411411

412412
/* Enable CLK125 MUX on LED4 if ref clock is enabled. */
413413
if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) {
@@ -424,6 +424,18 @@ static int bcm54811_config_init(struct phy_device *phydev)
424424
if (priv->brr_mode)
425425
phydev->autoneg = 0;
426426

427+
/* Enable MII Lite (No TXER, RXER, CRS, COL) if configured */
428+
if (phydev->interface == PHY_INTERFACE_MODE_MIILITE)
429+
exp_sync_ethernet = BCM_EXP_SYNC_ETHERNET_MII_LITE;
430+
else
431+
exp_sync_ethernet = 0;
432+
433+
err = bcm_phy_modify_exp(phydev, BCM_EXP_SYNC_ETHERNET,
434+
BCM_EXP_SYNC_ETHERNET_MII_LITE,
435+
exp_sync_ethernet);
436+
if (err < 0)
437+
return err;
438+
427439
return bcm5481x_set_brrmode(phydev, priv->brr_mode);
428440
}
429441

include/linux/brcmphy.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@
182182
#define BCM_LED_MULTICOLOR_ACT 0x9
183183
#define BCM_LED_MULTICOLOR_PROGRAM 0xa
184184

185+
/*
186+
* Broadcom Synchronous Ethernet Controls (expansion register 0x0E)
187+
*/
188+
#define BCM_EXP_SYNC_ETHERNET (MII_BCM54XX_EXP_SEL_ER + 0x0E)
189+
#define BCM_EXP_SYNC_ETHERNET_MII_LITE BIT(11)
190+
185191
/*
186192
* BCM5482: Shadow registers
187193
* Shadow values go into bits [14:10] of register 0x1c to select a shadow

0 commit comments

Comments
 (0)