net: bcmgenet: power on MII block for all MII modes
Subsystems (3)
PATCH 1/1 net: bcmgenet: power on MII block for all MII modes
The RGMII block is currently only powered on when using RGMII or RGMII_NO_ID, which is not correct when using the GENET interface in MII or Reverse MII modes. We always need to power on the RGMII interface for this block to properly work, regardless of the MII mode in which we operate.
---
David,
I am targetting "net" here since this is a bug fix, however, we have few people using MII or Reverse MII with GENET, such that there is no need to queue this for -stable unless you want to.
Thanks!
drivers/net/ethernet/broadcom/genet/bcmmii.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmmii.c +9 -3
@@ -299,9 +299,6 @@ int bcmgenet_mii_config(struct net_device *dev, bool init) phy_name ="external RGMII (no delay)" ; else phy_name ="external RGMII (TX delay)" ; - reg =bcmgenet_ext_readl (priv,EXT_RGMII_OOB_CTRL ); - reg |=RGMII_MODE_EN | id_mode_dis; -bcmgenet_ext_writel (priv, reg,EXT_RGMII_OOB_CTRL );bcmgenet_sys_writel (priv,PORT_MODE_EXT_GPHY ,SYS_PORT_CTRL );break ;
@@ -310,6 +307,15 @@ int bcmgenet_mii_config(struct net_device *dev, bool init)return -EINVAL ; } +/* This is an external PHY (xMII), so we need to enable the RGMII +* block for the interface to work +*/ +if (priv->ext_phy) { + reg =bcmgenet_ext_readl (priv,EXT_RGMII_OOB_CTRL ); + reg |=RGMII_MODE_EN | id_mode_dis; +bcmgenet_ext_writel (priv, reg,EXT_RGMII_OOB_CTRL ); + } +if (init)dev_info (kdev,"configuring instance for %s\n" , phy_name);
Signature · 1 line
2.1.0
David Miller
maintainerFrom: Florian Fainelli <[email protected]>
Date: Mon, 8 Jun 2015 10:47:57 -0700
Quoted 6 lines
The RGMII block is currently only powered on when using RGMII or
RGMII_NO_ID, which is not correct when using the GENET interface in MII or Reverse MII modes. We always need to power on the RGMII interface for this block to properly work, regardless of the MII mode in which we operate.
Quoted 8 lines
Fixes aa09677cba423 ("net: bcmgenet: add MDIO routines")Signed-off-by Florian Fainelli <[email protected]>---
David,I am targetting "net" here since this is a bug fix, however, we have few people using MII or Reverse MII with GENET, such that there is no need to queue this for -stable unless you want to.
Ok, applied, thanks Florian.