[PATCH RFC v4 04/15] net: pcs: xpcs: allow a PCS to opt out of soft reset and EEE

Jan Petrous via B4 Relay devnull+jan.petrous.oss.nxp.com at kernel.org
Wed Nov 25 01:33:46 PST 2026


From: "Jan Petrous (OSS)" <jan.petrous at oss.nxp.com>

Add a quirks mask to struct dw_xpcs_desc, with two flags:

 - DW_XPCS_QUIRK_NO_SOFT_RESET: no soft reset in pcs_pre_config(). When
   the XPCS shares its PMA with another controller, the reset belongs
   to a bring-up sequence owned by the platform.

 - DW_XPCS_QUIRK_NO_EEE: VR_MII_EEE_MCTRL0/1 are not implemented and
   must not be written.

No entry sets a quirk yet, so there is no functional change.

Signed-off-by: Jan Petrous (OSS) <jan.petrous at oss.nxp.com>
---
 drivers/net/pcs/pcs-xpcs.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 6466e0ff2a98..442c64a731b7 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -158,10 +158,20 @@ struct dw_xpcs_compat {
 	int (*pma_config)(struct dw_xpcs *xpcs);
 };
 
+/*
+ * The integration owns the PCS reset sequence: skip the soft reset in
+ * pcs_pre_config(). Only for PCS without Clause 73, whose fault recovery
+ * still resets.
+ */
+#define DW_XPCS_QUIRK_NO_SOFT_RESET	BIT(0)
+/* VR_MII_EEE_MCTRL0/1 are not implemented */
+#define DW_XPCS_QUIRK_NO_EEE		BIT(1)
+
 struct dw_xpcs_desc {
 	u32 id;
 	u32 mask;
 	const struct dw_xpcs_compat *compat;
+	unsigned int quirks;
 };
 
 static const struct dw_xpcs_compat *
@@ -729,6 +739,9 @@ static void xpcs_pre_config(struct phylink_pcs *pcs, phy_interface_t interface)
 		dev_err(&xpcs->mdiodev->dev, "switch interface failed: %pe\n",
 			ERR_PTR(ret));
 
+	if (xpcs->desc->quirks & DW_XPCS_QUIRK_NO_SOFT_RESET)
+		xpcs->need_reset = false;
+
 	if (!xpcs->need_reset)
 		return;
 
@@ -1318,6 +1331,9 @@ static void xpcs_disable_eee(struct phylink_pcs *pcs)
 {
 	struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs);
 
+	if (xpcs->desc->quirks & DW_XPCS_QUIRK_NO_EEE)
+		return;
+
 	xpcs_config_eee(xpcs, false);
 }
 
@@ -1325,6 +1341,9 @@ static void xpcs_enable_eee(struct phylink_pcs *pcs)
 {
 	struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs);
 
+	if (xpcs->desc->quirks & DW_XPCS_QUIRK_NO_EEE)
+		return;
+
 	xpcs_config_eee(xpcs, true);
 }
 

-- 
2.55.0





More information about the linux-phy mailing list