[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230724102341.10401-2-jiawenwu@trustnetic.com>
Date: Mon, 24 Jul 2023 18:23:35 +0800
From: Jiawen Wu <jiawenwu@...stnetic.com>
To: netdev@...r.kernel.org,
andrew@...n.ch,
hkallweit1@...il.com,
linux@...linux.org.uk,
Jose.Abreu@...opsys.com
Cc: mengyuanlou@...-swift.com,
Jiawen Wu <jiawenwu@...stnetic.com>
Subject: [PATCH net-next 1/7] net: pcs: xpcs: add specific vendor supoprt for Wangxun 10Gb NICs
Since Wangxun 10Gb NICs require some special configuration on the IP of
Synopsys Designware XPCS, the vendor identification of wangxun devices
is added by comparing the name of mii bus.
And interrupt mode is used in Wangxun devices, so make it to be the first
specific configuration.
Signed-off-by: Jiawen Wu <jiawenwu@...stnetic.com>
---
drivers/net/pcs/pcs-xpcs.c | 11 ++++++++++-
include/linux/pcs/pcs-xpcs.h | 2 ++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 44b037646865..79a34ffb7518 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -238,6 +238,14 @@ static int xpcs_write_vpcs(struct dw_xpcs *xpcs, int reg, u16 val)
return xpcs_write_vendor(xpcs, MDIO_MMD_PCS, reg, val);
}
+static bool xpcs_dev_is_txgbe(struct dw_xpcs *xpcs)
+{
+ if (!strcmp(xpcs->mdiodev->bus->name, DW_MII_BUS_TXGBE))
+ return true;
+
+ return false;
+}
+
static int xpcs_poll_reset(struct dw_xpcs *xpcs, int dev)
{
/* Poll until the reset bit clears (50ms per retry == 0.6 sec) */
@@ -1289,7 +1297,8 @@ static struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev,
if (compat->an_mode == DW_10GBASER)
return xpcs;
- xpcs->pcs.poll = true;
+ if (!xpcs_dev_is_txgbe(xpcs))
+ xpcs->pcs.poll = true;
ret = xpcs_soft_reset(xpcs, compat);
if (ret)
diff --git a/include/linux/pcs/pcs-xpcs.h b/include/linux/pcs/pcs-xpcs.h
index ff99cf7a5d0d..fb60c7e28623 100644
--- a/include/linux/pcs/pcs-xpcs.h
+++ b/include/linux/pcs/pcs-xpcs.h
@@ -20,6 +20,8 @@
#define DW_AN_C37_1000BASEX 4
#define DW_10GBASER 5
+#define DW_MII_BUS_TXGBE "txgbe_pcs_mdio_bus"
+
struct xpcs_id;
struct dw_xpcs {
--
2.27.0
Powered by blists - more mailing lists