Skip to content

Commit 612eb1c

Browse files
Doug Bergerdavem330
authored andcommitted
Revert "net: bcmgenet: use RGMII loopback for MAC reset"
This reverts commit 3a55402. This is not a good solution when connecting to an external switch that may not support the isolation of the TXC signal resulting in output driver contention on the pin. A different solution is necessary. Signed-off-by: Doug Berger <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d36963b commit 612eb1c

File tree

2 files changed

+2
-34
lines changed

2 files changed

+2
-34
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,6 +1989,8 @@ static void reset_umac(struct bcmgenet_priv *priv)
19891989

19901990
/* issue soft reset with (rg)mii loopback to ensure a stable rxclk */
19911991
bcmgenet_umac_writel(priv, CMD_SW_RESET | CMD_LCL_LOOP_EN, UMAC_CMD);
1992+
udelay(2);
1993+
bcmgenet_umac_writel(priv, 0, UMAC_CMD);
19921994
}
19931995

19941996
static void bcmgenet_intr_disable(struct bcmgenet_priv *priv)

drivers/net/ethernet/broadcom/genet/bcmmii.c

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -181,38 +181,8 @@ int bcmgenet_mii_config(struct net_device *dev, bool init)
181181
const char *phy_name = NULL;
182182
u32 id_mode_dis = 0;
183183
u32 port_ctrl;
184-
int bmcr = -1;
185-
int ret;
186184
u32 reg;
187185

188-
/* MAC clocking workaround during reset of umac state machines */
189-
reg = bcmgenet_umac_readl(priv, UMAC_CMD);
190-
if (reg & CMD_SW_RESET) {
191-
/* An MII PHY must be isolated to prevent TXC contention */
192-
if (priv->phy_interface == PHY_INTERFACE_MODE_MII) {
193-
ret = phy_read(phydev, MII_BMCR);
194-
if (ret >= 0) {
195-
bmcr = ret;
196-
ret = phy_write(phydev, MII_BMCR,
197-
bmcr | BMCR_ISOLATE);
198-
}
199-
if (ret) {
200-
netdev_err(dev, "failed to isolate PHY\n");
201-
return ret;
202-
}
203-
}
204-
/* Switch MAC clocking to RGMII generated clock */
205-
bcmgenet_sys_writel(priv, PORT_MODE_EXT_GPHY, SYS_PORT_CTRL);
206-
/* Ensure 5 clks with Rx disabled
207-
* followed by 5 clks with Reset asserted
208-
*/
209-
udelay(4);
210-
reg &= ~(CMD_SW_RESET | CMD_LCL_LOOP_EN);
211-
bcmgenet_umac_writel(priv, reg, UMAC_CMD);
212-
/* Ensure 5 more clocks before Rx is enabled */
213-
udelay(2);
214-
}
215-
216186
switch (priv->phy_interface) {
217187
case PHY_INTERFACE_MODE_INTERNAL:
218188
phy_name = "internal PHY";
@@ -282,10 +252,6 @@ int bcmgenet_mii_config(struct net_device *dev, bool init)
282252

283253
bcmgenet_sys_writel(priv, port_ctrl, SYS_PORT_CTRL);
284254

285-
/* Restore the MII PHY after isolation */
286-
if (bmcr >= 0)
287-
phy_write(phydev, MII_BMCR, bmcr);
288-
289255
priv->ext_phy = !priv->internal_phy &&
290256
(priv->phy_interface != PHY_INTERFACE_MODE_MOCA);
291257

0 commit comments

Comments
 (0)