9d8090441a0f66726fded3f6aed7ae0420ca2a55
[openwrt/staging/ansuel.git] /
1 From cff8c5c2a95a4afd65bfa3198258d03bc790cddb Mon Sep 17 00:00:00 2001
2 From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
3 Date: Tue, 25 Feb 2020 14:11:59 +0100
4 Subject: [PATCH] net: bcmgenet: Clear ID_MODE_DIS in
5 EXT_RGMII_OOB_CTRL when not needed
6
7 commit 402482a6a78e5c61d8a2ec6311fc5b4aca392cd6 upstream.
8
9 Outdated Raspberry Pi 4 firmware might configure the external PHY as
10 rgmii although the kernel currently sets it as rgmii-rxid. This makes
11 connections unreliable as ID_MODE_DIS is left enabled. To avoid this,
12 explicitly clear that bit whenever we don't need it.
13
14 Fixes: da38802211cc ("net: bcmgenet: Add RGMII_RXID support")
15 Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
16 Acked-by: Florian Fainelli <f.fainelli@gmail.com>
17 Signed-off-by: David S. Miller <davem@davemloft.net>
18 Signed-off-by: Matthias Reichl <hias@horus.com>
19 ---
20 drivers/net/ethernet/broadcom/genet/bcmmii.c | 1 +
21 1 file changed, 1 insertion(+)
22
23 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
24 +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
25 @@ -292,6 +292,7 @@ int bcmgenet_mii_config(struct net_devic
26 */
27 if (priv->ext_phy) {
28 reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
29 + reg &= ~ID_MODE_DIS;
30 reg |= id_mode_dis;
31 if (GENET_IS_V1(priv) || GENET_IS_V2(priv) || GENET_IS_V3(priv))
32 reg |= RGMII_MODE_EN_V123;