net: bcmgenet: Don't set ID_MODE_DIS when not using RGMII
authorNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Thu, 20 Feb 2020 16:36:31 +0000 (17:36 +0100)
committerMatthias Brugger <mbrugger@suse.com>
Tue, 12 May 2020 08:59:11 +0000 (10:59 +0200)
As per Linux's driver, ID_MODE_DIS is only set when the PHY interface is
RGMII. Don't enable it for the rest of setups.

This has been seen to misconfigure RPi4's PHY when booting Linux.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
drivers/net/bcmgenet.c

index 8f4848aec68a0ad7341141363e8d215692371331..e971b556acde730759c4030d37a9f9b7db7fee0d 100644 (file)
@@ -448,7 +448,10 @@ static int bcmgenet_adjust_link(struct bcmgenet_eth_priv *priv)
        }
 
        clrsetbits_32(priv->mac_reg + EXT_RGMII_OOB_CTRL, OOB_DISABLE,
-                       RGMII_LINK | RGMII_MODE_EN | ID_MODE_DIS);
+                       RGMII_LINK | RGMII_MODE_EN);
+
+       if (phy_dev->interface == PHY_INTERFACE_MODE_RGMII)
+               setbits_32(priv->mac_reg + EXT_RGMII_OOB_CTRL, ID_MODE_DIS);
 
        writel(speed << CMD_SPEED_SHIFT, (priv->mac_reg + UMAC_CMD));