From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Date: Thu, 20 Feb 2020 11:05:22 -0800 Subject: [PATCH] net: bcmgenet: Don't set ID_MODE_DIS when not using RGMII In-Reply-To: <20200220163630.29806-1-nsaenzjulienne@suse.de> References: <20200220163630.29806-1-nsaenzjulienne@suse.de> Message-ID: <95fa3b2e-b317-fe1f-37af-4a44560e1f10@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2/20/20 8:36 AM, Nicolas Saenz Julienne wrote: > 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 Does the failure look like the following: you have a driver for the Broadcom PHY used on the Pi4 in u-boot, and the phy_dev->interface value is being used to configure the Ethernet PHY chip in a certain way. Later when you boot Linux, you do not have CONFIG_BROADCOM_PHY enabled so the Generic PHY driver gets used instead, and there is a disagreement between the AMAC and PHY as to whom should be adding the delays? At any rate: Reviewed-by: Florian Fainelli > --- > drivers/net/bcmgenet.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/bcmgenet.c b/drivers/net/bcmgenet.c > index 8f4848aec6..e971b556ac 100644 > --- a/drivers/net/bcmgenet.c > +++ b/drivers/net/bcmgenet.c > @@ -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)); > > -- Florian