From: Raju Rangoju <Raju.Rangoju@amd.com>
To: <netdev@vger.kernel.org>
Cc: <kuba@kernel.org>, <pabeni@redhat.com>, <edumazet@google.com>,
<davem@davemloft.net>, <andrew+netdev@lunn.ch>,
Raju Rangoju <Raju.Rangoju@amd.com>,
Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Subject: [PATCH net-next] amd-xgbe: re-initiate auto-negotiation for Broadcom PHYs
Date: Mon, 10 Feb 2025 17:39:33 +0530 [thread overview]
Message-ID: <20250210120933.1981517-1-Raju.Rangoju@amd.com> (raw)
Some PHYs on certain platforms may show a successful link after setting
the speed to 100Mbps through auto-negotiation (AN) even when
10M/100M/1G concurrent speed is configured. However, they may not be
able to transmit or receive data. These PHYs need an "additional
auto-negotiation (AN) cycle" after the speed change, to function correctly.
A quirk for these PHYs is that if the outcome of the AN leads to a
change in speed, the AN should be re-initiated at the new speed.
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
---
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 21 +++++++++++++++++++++
drivers/net/ethernet/amd/xgbe/xgbe.h | 3 +++
2 files changed, 24 insertions(+)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 268399dfcf22..4a9477554937 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -921,6 +921,24 @@ static void xgbe_phy_free_phy_device(struct xgbe_prv_data *pdata)
}
}
+static bool xgbe_phy_broadcom_phy_quirks(struct xgbe_prv_data *pdata)
+{
+ struct xgbe_phy_data *phy_data = pdata->phy_data;
+ unsigned int phy_id = phy_data->phydev->phy_id;
+ unsigned int ver;
+
+ ver = XGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER);
+
+ /* For Broadcom PHY, use the extra AN flag */
+ if (ver == SNPS_MAC_VER_0x21 && (phy_id & 0xffffffff) == 0x600d8595) {
+ dev_dbg(pdata->dev, "Broadcom PHY quirk in place\n");
+ pdata->an_again = 1;
+ return true;
+ }
+
+ return false;
+}
+
static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
{
struct xgbe_phy_data *phy_data = pdata->phy_data;
@@ -1035,6 +1053,9 @@ static void xgbe_phy_external_phy_quirks(struct xgbe_prv_data *pdata)
if (xgbe_phy_finisar_phy_quirks(pdata))
return;
+
+ if (xgbe_phy_broadcom_phy_quirks(pdata))
+ return;
}
static int xgbe_phy_find_phy_device(struct xgbe_prv_data *pdata)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h
index d85386cac8d1..543206976da6 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe.h
@@ -249,6 +249,9 @@
#define XGBE_TC_MIN_QUANTUM 10
+/* SNPS MAC version */
+#define SNPS_MAC_VER_0x21 0x21
+
/* Helper macro for descriptor handling
* Always use XGBE_GET_DESC_DATA to access the descriptor data
* since the index is free-running and needs to be and-ed
--
2.34.1
next reply other threads:[~2025-02-10 12:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 12:09 Raju Rangoju [this message]
2025-02-10 13:49 ` [PATCH net-next] amd-xgbe: re-initiate auto-negotiation for Broadcom PHYs Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250210120933.1981517-1-Raju.Rangoju@amd.com \
--to=raju.rangoju@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.