netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v4 0/2] Add SQI and SQI+ support for OATC14 10Base-T1S PHYs and Microchip T1S driver
@ 2025-12-01  3:23 Parthiban Veerasooran
  2025-12-01  3:23 ` [PATCH net-next v4 1/2] net: phy: phy-c45: add SQI and SQI+ support for OATC14 10Base-T1S PHYs Parthiban Veerasooran
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Parthiban Veerasooran @ 2025-12-01  3:23 UTC (permalink / raw)
  To: Parthiban.Veerasooran, piergiorgio.beruto, andrew, hkallweit1,
	linux, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Parthiban Veerasooran

This patch series adds Signal Quality Indicator (SQI) and enhanced SQI+
support for OATC14 10Base-T1S PHYs, along with integration into the
Microchip T1S PHY driver. This enables ethtool to report the SQI value for
OATC14 10Base-T1S PHYs.

Patch Summary:
1. add SQI and SQI+ support for OATC14 10Base-T1S PHYs
   - Introduces MDIO register definitions for DCQ_SQI and DCQ_SQIPLUS.
   - Adds genphy_c45_oatc14_get_sqi_max() to report the maximum SQI/SQI+
     level.
   - Adds genphy_c45_oatc14_get_sqi() to return the current SQI or SQI+
     value.
   - Updates include/linux/phy.h to expose the new APIs.
   - SQI+ capability is read from the Advanced Diagnostic Features
     Capability register (ADFCAP). If unsupported, the driver falls back
     to basic SQI (0–7 levels).
   - If SQI+ capability is supported, the function returns the extended
     SQI+ value; otherwise, it returns the basic SQI value.
   - Open Alliance TC14 10BASE-T1S Advanced Diagnostic PHY Features.
     https://opensig.org/wp-content/uploads/2025/06/OPEN_Alliance_10BASE-T1S_Advanced_PHY_features_for-automotive_Ethernet_V2.1b.pdf
	
2. add SQI support for LAN867x Rev.D0 PHYs
   - Registers .get_sqi and .get_sqi_max callbacks in the Microchip T1S
     driver.
   - Enables network drivers and diagnostic tools to query link signal
     quality for LAN867x Rev.D0 PHYs.
   - Existing PHY functionality remains unchanged.

v2:
 - Updated cover letter description for better clarity.
 - Added oatc14_sqiplus_bits variable to cache the SQI+ capability in the
   phy device structure.
 - Fixed function description comment style warnings reported by the
   kernel test robot.

v3:
 - Reworked SQI/SQI+ update sequencing to address the issue,
   oatc14_sqiplus_bits being 0 until after
   genphy_c45_oatc14_get_sqi_max() is called.

v4:
 - Added the missing description for the  member
    to fix the kernel-doc warning.


Parthiban Veerasooran (2):
  net: phy: phy-c45: add SQI and SQI+ support for OATC14 10Base-T1S PHYs
  net: phy: microchip_t1s: add SQI support for LAN867x Rev.D0 PHYs

 drivers/net/phy/mdio-open-alliance.h |  13 +++
 drivers/net/phy/microchip_t1s.c      |   2 +
 drivers/net/phy/phy-c45.c            | 137 +++++++++++++++++++++++++++
 include/linux/phy.h                  |  29 ++++++
 4 files changed, 181 insertions(+)


base-commit: 0177f0f07886e54e12c6f18fa58f63e63ddd3c58
-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net-next v4 1/2] net: phy: phy-c45: add SQI and SQI+ support for OATC14 10Base-T1S PHYs
  2025-12-01  3:23 [PATCH net-next v4 0/2] Add SQI and SQI+ support for OATC14 10Base-T1S PHYs and Microchip T1S driver Parthiban Veerasooran
@ 2025-12-01  3:23 ` Parthiban Veerasooran
  2025-12-01 13:24   ` Andrew Lunn
  2025-12-02 16:21   ` Simon Horman
  2025-12-01  3:23 ` [PATCH net-next v4 2/2] net: phy: microchip_t1s: add SQI support for LAN867x Rev.D0 PHYs Parthiban Veerasooran
  2025-12-01 23:10 ` [PATCH net-next v4 0/2] Add SQI and SQI+ support for OATC14 10Base-T1S PHYs and Microchip T1S driver patchwork-bot+netdevbpf
  2 siblings, 2 replies; 8+ messages in thread
From: Parthiban Veerasooran @ 2025-12-01  3:23 UTC (permalink / raw)
  To: Parthiban.Veerasooran, piergiorgio.beruto, andrew, hkallweit1,
	linux, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Parthiban Veerasooran

Add support for reading Signal Quality Indicator (SQI) and enhanced SQI+
from OATC14 10Base-T1S PHYs.

- Introduce MDIO register definitions for DCQ_SQI and DCQ_SQIPLUS.
- Add `genphy_c45_oatc14_get_sqi_max()` to return the maximum supported
  SQI/SQI+ level.
- Add `genphy_c45_oatc14_get_sqi()` to return the current SQI or SQI+
  value.
- Update `include/linux/phy.h` to expose the new APIs.

SQI+ capability is read from the Advanced Diagnostic Features Capability
register (ADFCAP). If SQI+ is supported, the driver calculates the value
from the MSBs of the DCQ_SQIPLUS register; otherwise, it falls back to
basic SQI (0-7 levels). This enables ethtool to report the SQI value for
OATC14 10Base-T1S PHYs.

Open Alliance TC14 10BASE-T1S Advanced Diagnostic PHY Features
Specification ref:
https://opensig.org/wp-content/uploads/2025/06/OPEN_Alliance_10BASE-T1S_Advanced_PHY_features_for-automotive_Ethernet_V2.1b.pdf

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
---
 drivers/net/phy/mdio-open-alliance.h |  13 +++
 drivers/net/phy/phy-c45.c            | 137 +++++++++++++++++++++++++++
 include/linux/phy.h                  |  29 ++++++
 3 files changed, 179 insertions(+)

diff --git a/drivers/net/phy/mdio-open-alliance.h b/drivers/net/phy/mdio-open-alliance.h
index 6850a3f0b31e..449d0fb67093 100644
--- a/drivers/net/phy/mdio-open-alliance.h
+++ b/drivers/net/phy/mdio-open-alliance.h
@@ -56,6 +56,8 @@
 /* Advanced Diagnostic Features Capability Register*/
 #define MDIO_OATC14_ADFCAP		0xcc00
 #define OATC14_ADFCAP_HDD_CAPABILITY	GENMASK(10, 8)
+#define OATC14_ADFCAP_SQIPLUS_CAPABILITY	GENMASK(4, 1)
+#define OATC14_ADFCAP_SQI_CAPABILITY	BIT(0)
 
 /* Harness Defect Detection Register */
 #define MDIO_OATC14_HDD			0xcc01
@@ -65,6 +67,17 @@
 #define OATC14_HDD_VALID		BIT(2)
 #define OATC14_HDD_SHORT_OPEN_STATUS	GENMASK(1, 0)
 
+/* Dynamic Channel Quality SQI Register */
+#define MDIO_OATC14_DCQ_SQI		0xcc03
+#define OATC14_DCQ_SQI_VALUE		GENMASK(2, 0)
+
+/* Dynamic Channel Quality SQI Plus Register */
+#define MDIO_OATC14_DCQ_SQIPLUS		0xcc04
+#define OATC14_DCQ_SQIPLUS_VALUE	GENMASK(7, 0)
+
+/* SQI is supported using 3 bits means 8 levels (0-7) */
+#define OATC14_SQI_MAX_LEVEL		7
+
 /* Bus Short/Open Status:
  * 0 0 - no fault; everything is ok. (Default)
  * 0 1 - detected as an open or missing termination(s)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index f5e23b53994f..d48aa7231b37 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -1695,3 +1695,140 @@ int genphy_c45_oatc14_cable_test_start(struct phy_device *phydev)
 				OATC14_HDD_START_CONTROL);
 }
 EXPORT_SYMBOL(genphy_c45_oatc14_cable_test_start);
+
+/**
+ * oatc14_update_sqi_capability - Read and update OATC14 10Base-T1S PHY SQI/SQI+
+ *                                capability
+ * @phydev: Pointer to the PHY device structure
+ *
+ * This helper reads the OATC14 ADFCAP capability register to determine whether
+ * the PHY supports SQI or SQI+ reporting.
+ *
+ * SQI+ capability is detected first. The SQI+ field indicates the number of
+ * valid MSBs (3–8), corresponding to 8–256 SQI+ levels. When present, the
+ * function stores the number of SQI+ bits and computes the maximum SQI+ value
+ * as (2^bits - 1).
+ *
+ * If SQI+ is not supported, the function checks for basic SQI capability,
+ * which provides 0–7 SQI levels.
+ *
+ * On success, the capability information is stored in
+ * @phydev->oatc14_sqi_capability and marked as updated.
+ *
+ * Return:
+ * * 0        - capability successfully read and stored
+ * * -EOPNOTSUPP - SQI/SQI+ not supported by this PHY
+ * * Negative errno on read failure
+ */
+static int oatc14_update_sqi_capability(struct phy_device *phydev)
+{
+	u8 bits;
+	int ret;
+
+	ret = phy_read_mmd(phydev, MDIO_MMD_VEND2, MDIO_OATC14_ADFCAP);
+	if (ret < 0)
+		return ret;
+
+	/* Check for SQI+ capability
+	 * 0 - SQI+ is not supported
+	 * (3-8) bits for (8-256) SQI+ levels supported
+	 */
+	bits = FIELD_GET(OATC14_ADFCAP_SQIPLUS_CAPABILITY, ret);
+	if (bits) {
+		phydev->oatc14_sqi_capability.sqiplus_bits = bits;
+		/* Max sqi+ level supported: (2 ^ bits) - 1 */
+		phydev->oatc14_sqi_capability.sqi_max = BIT(bits) - 1;
+		goto update_done;
+	}
+
+	/* Check for SQI capability
+	 * 0 - SQI is not supported
+	 * 1 - SQI is supported (0-7 levels)
+	 */
+	if (ret & OATC14_ADFCAP_SQI_CAPABILITY) {
+		phydev->oatc14_sqi_capability.sqi_max = OATC14_SQI_MAX_LEVEL;
+		goto update_done;
+	}
+
+	return -EOPNOTSUPP;
+
+update_done:
+	phydev->oatc14_sqi_capability.updated = true;
+	return 0;
+}
+
+/**
+ * genphy_c45_oatc14_get_sqi_max - Get maximum supported SQI or SQI+ level of
+ *				   OATC14 10Base-T1S PHY
+ * @phydev: pointer to the PHY device structure
+ *
+ * This function returns the maximum supported Signal Quality Indicator (SQI) or
+ * SQI+ level. The SQI capability is updated on first invocation if it has not
+ * already been updated.
+ *
+ * Return:
+ * * Maximum SQI/SQI+ level supported
+ * * Negative errno on capability read failure
+ */
+int genphy_c45_oatc14_get_sqi_max(struct phy_device *phydev)
+{
+	int ret;
+
+	if (!phydev->oatc14_sqi_capability.updated) {
+		ret = oatc14_update_sqi_capability(phydev);
+		if (ret)
+			return ret;
+	}
+
+	return phydev->oatc14_sqi_capability.sqi_max;
+}
+EXPORT_SYMBOL(genphy_c45_oatc14_get_sqi_max);
+
+/**
+ * genphy_c45_oatc14_get_sqi - Get Signal Quality Indicator (SQI) from an OATC14
+ *			       10Base-T1S PHY
+ * @phydev: pointer to the PHY device structure
+ *
+ * This function reads the SQI+ or SQI value from an OATC14-compatible
+ * 10Base-T1S PHY. If SQI+ capability is supported, the function returns the
+ * extended SQI+ value; otherwise, it returns the basic SQI value. The SQI
+ * capability is updated on first invocation if it has not already been updated.
+ *
+ * Return:
+ * * SQI/SQI+ value on success
+ * * Negative errno on read failure
+ */
+int genphy_c45_oatc14_get_sqi(struct phy_device *phydev)
+{
+	u8 shift;
+	int ret;
+
+	if (!phydev->oatc14_sqi_capability.updated) {
+		ret = oatc14_update_sqi_capability(phydev);
+		if (ret)
+			return ret;
+	}
+
+	/* Calculate and return SQI+ value if supported */
+	if (phydev->oatc14_sqi_capability.sqiplus_bits) {
+		ret = phy_read_mmd(phydev, MDIO_MMD_VEND2,
+				   MDIO_OATC14_DCQ_SQIPLUS);
+		if (ret < 0)
+			return ret;
+
+		/* SQI+ uses N MSBs out of 8 bits, left-aligned with padding 1's
+		 * Calculate the right-shift needed to isolate the N bits.
+		 */
+		shift = 8 - phydev->oatc14_sqi_capability.sqiplus_bits;
+
+		return (ret & OATC14_DCQ_SQIPLUS_VALUE) >> shift;
+	}
+
+	/* Read and return SQI value if SQI+ capability is not supported */
+	ret = phy_read_mmd(phydev, MDIO_MMD_VEND2, MDIO_OATC14_DCQ_SQI);
+	if (ret < 0)
+		return ret;
+
+	return ret & OATC14_DCQ_SQI_VALUE;
+}
+EXPORT_SYMBOL(genphy_c45_oatc14_get_sqi);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 059a104223c4..fbbe028cc4b7 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -530,6 +530,30 @@ struct phy_c45_device_ids {
 struct macsec_context;
 struct macsec_ops;
 
+/**
+ * struct phy_oatc14_sqi_capability - SQI capability information for OATC14
+ *                                    10Base-T1S PHY
+ * @updated: Indicates whether the SQI capability fields have been updated.
+ * @sqi_max: Maximum supported Signal Quality Indicator (SQI) level reported by
+ *           the PHY.
+ * @sqiplus_bits: Bits for SQI+ levels supported by the PHY.
+ *                0 - SQI+ is not supported
+ *                3 - SQI+ is supported, using 3 bits (8 levels)
+ *                4 - SQI+ is supported, using 4 bits (16 levels)
+ *                5 - SQI+ is supported, using 5 bits (32 levels)
+ *                6 - SQI+ is supported, using 6 bits (64 levels)
+ *                7 - SQI+ is supported, using 7 bits (128 levels)
+ *                8 - SQI+ is supported, using 8 bits (256 levels)
+ *
+ * This structure is used by the OATC14 10Base-T1S PHY driver to store the SQI
+ * and SQI+ capability information retrieved from the PHY.
+ */
+struct phy_oatc14_sqi_capability {
+	bool updated;
+	int sqi_max;
+	u8 sqiplus_bits;
+};
+
 /**
  * struct phy_device - An instance of a PHY
  *
@@ -626,6 +650,7 @@ struct macsec_ops;
  * @link_down_events: Number of times link was lost
  * @shared: Pointer to private data shared by phys in one package
  * @priv: Pointer to driver private data
+ * @oatc14_sqi_capability: SQI capability information for OATC14 10Base-T1S PHY
  *
  * interrupts currently only supports enabled or disabled,
  * but could be changed in the future to support enabling
@@ -772,6 +797,8 @@ struct phy_device {
 	/* MACsec management functions */
 	const struct macsec_ops *macsec_ops;
 #endif
+
+	struct phy_oatc14_sqi_capability oatc14_sqi_capability;
 };
 
 /* Generic phy_device::dev_flags */
@@ -2257,6 +2284,8 @@ int genphy_c45_an_config_eee_aneg(struct phy_device *phydev);
 int genphy_c45_oatc14_cable_test_start(struct phy_device *phydev);
 int genphy_c45_oatc14_cable_test_get_status(struct phy_device *phydev,
 					    bool *finished);
+int genphy_c45_oatc14_get_sqi_max(struct phy_device *phydev);
+int genphy_c45_oatc14_get_sqi(struct phy_device *phydev);
 
 /* The gen10g_* functions are the old Clause 45 stub */
 int gen10g_config_aneg(struct phy_device *phydev);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-next v4 2/2] net: phy: microchip_t1s: add SQI support for LAN867x Rev.D0 PHYs
  2025-12-01  3:23 [PATCH net-next v4 0/2] Add SQI and SQI+ support for OATC14 10Base-T1S PHYs and Microchip T1S driver Parthiban Veerasooran
  2025-12-01  3:23 ` [PATCH net-next v4 1/2] net: phy: phy-c45: add SQI and SQI+ support for OATC14 10Base-T1S PHYs Parthiban Veerasooran
@ 2025-12-01  3:23 ` Parthiban Veerasooran
  2025-12-01 13:25   ` Andrew Lunn
  2025-12-01 23:10 ` [PATCH net-next v4 0/2] Add SQI and SQI+ support for OATC14 10Base-T1S PHYs and Microchip T1S driver patchwork-bot+netdevbpf
  2 siblings, 1 reply; 8+ messages in thread
From: Parthiban Veerasooran @ 2025-12-01  3:23 UTC (permalink / raw)
  To: Parthiban.Veerasooran, piergiorgio.beruto, andrew, hkallweit1,
	linux, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Parthiban Veerasooran

Add support for Signal Quality Index (SQI) reporting in the
Microchip T1S PHY driver for LAN867x Rev.D0 (OATC14-compliant) PHYs.

This patch registers the following callbacks in the microchip_t1s driver
structure:

- .get_sqi      - returns the current SQI value
- .get_sqi_max  - returns the maximum SQI value

This enables ethtool to report the SQI value for LAN867x Rev.D0 PHYs.

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
---
 drivers/net/phy/microchip_t1s.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/phy/microchip_t1s.c b/drivers/net/phy/microchip_t1s.c
index 5a0a66778977..e601d56b2507 100644
--- a/drivers/net/phy/microchip_t1s.c
+++ b/drivers/net/phy/microchip_t1s.c
@@ -575,6 +575,8 @@ static struct phy_driver microchip_t1s_driver[] = {
 		.get_plca_status    = genphy_c45_plca_get_status,
 		.cable_test_start   = genphy_c45_oatc14_cable_test_start,
 		.cable_test_get_status = genphy_c45_oatc14_cable_test_get_status,
+		.get_sqi            = genphy_c45_oatc14_get_sqi,
+		.get_sqi_max        = genphy_c45_oatc14_get_sqi_max,
 	},
 	{
 		PHY_ID_MATCH_EXACT(PHY_ID_LAN865X_REVB),
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next v4 1/2] net: phy: phy-c45: add SQI and SQI+ support for OATC14 10Base-T1S PHYs
  2025-12-01  3:23 ` [PATCH net-next v4 1/2] net: phy: phy-c45: add SQI and SQI+ support for OATC14 10Base-T1S PHYs Parthiban Veerasooran
@ 2025-12-01 13:24   ` Andrew Lunn
  2025-12-02 16:21   ` Simon Horman
  1 sibling, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2025-12-01 13:24 UTC (permalink / raw)
  To: Parthiban Veerasooran
  Cc: piergiorgio.beruto, hkallweit1, linux, davem, edumazet, kuba,
	pabeni, netdev, linux-kernel

On Mon, Dec 01, 2025 at 08:53:45AM +0530, Parthiban Veerasooran wrote:
> Add support for reading Signal Quality Indicator (SQI) and enhanced SQI+
> from OATC14 10Base-T1S PHYs.
> 
> - Introduce MDIO register definitions for DCQ_SQI and DCQ_SQIPLUS.
> - Add `genphy_c45_oatc14_get_sqi_max()` to return the maximum supported
>   SQI/SQI+ level.
> - Add `genphy_c45_oatc14_get_sqi()` to return the current SQI or SQI+
>   value.
> - Update `include/linux/phy.h` to expose the new APIs.
> 
> SQI+ capability is read from the Advanced Diagnostic Features Capability
> register (ADFCAP). If SQI+ is supported, the driver calculates the value
> from the MSBs of the DCQ_SQIPLUS register; otherwise, it falls back to
> basic SQI (0-7 levels). This enables ethtool to report the SQI value for
> OATC14 10Base-T1S PHYs.
> 
> Open Alliance TC14 10BASE-T1S Advanced Diagnostic PHY Features
> Specification ref:
> https://opensig.org/wp-content/uploads/2025/06/OPEN_Alliance_10BASE-T1S_Advanced_PHY_features_for-automotive_Ethernet_V2.1b.pdf
> 
> Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next v4 2/2] net: phy: microchip_t1s: add SQI support for LAN867x Rev.D0 PHYs
  2025-12-01  3:23 ` [PATCH net-next v4 2/2] net: phy: microchip_t1s: add SQI support for LAN867x Rev.D0 PHYs Parthiban Veerasooran
@ 2025-12-01 13:25   ` Andrew Lunn
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2025-12-01 13:25 UTC (permalink / raw)
  To: Parthiban Veerasooran
  Cc: piergiorgio.beruto, hkallweit1, linux, davem, edumazet, kuba,
	pabeni, netdev, linux-kernel

On Mon, Dec 01, 2025 at 08:53:46AM +0530, Parthiban Veerasooran wrote:
> Add support for Signal Quality Index (SQI) reporting in the
> Microchip T1S PHY driver for LAN867x Rev.D0 (OATC14-compliant) PHYs.
> 
> This patch registers the following callbacks in the microchip_t1s driver
> structure:
> 
> - .get_sqi      - returns the current SQI value
> - .get_sqi_max  - returns the maximum SQI value
> 
> This enables ethtool to report the SQI value for LAN867x Rev.D0 PHYs.
> 
> Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next v4 0/2] Add SQI and SQI+ support for OATC14 10Base-T1S PHYs and Microchip T1S driver
  2025-12-01  3:23 [PATCH net-next v4 0/2] Add SQI and SQI+ support for OATC14 10Base-T1S PHYs and Microchip T1S driver Parthiban Veerasooran
  2025-12-01  3:23 ` [PATCH net-next v4 1/2] net: phy: phy-c45: add SQI and SQI+ support for OATC14 10Base-T1S PHYs Parthiban Veerasooran
  2025-12-01  3:23 ` [PATCH net-next v4 2/2] net: phy: microchip_t1s: add SQI support for LAN867x Rev.D0 PHYs Parthiban Veerasooran
@ 2025-12-01 23:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-12-01 23:10 UTC (permalink / raw)
  To: Parthiban Veerasooran
  Cc: piergiorgio.beruto, andrew, hkallweit1, linux, davem, edumazet,
	kuba, pabeni, netdev, linux-kernel, parthiban.veerasooran

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 1 Dec 2025 08:53:44 +0530 you wrote:
> This patch series adds Signal Quality Indicator (SQI) and enhanced SQI+
> support for OATC14 10Base-T1S PHYs, along with integration into the
> Microchip T1S PHY driver. This enables ethtool to report the SQI value for
> OATC14 10Base-T1S PHYs.
> 
> Patch Summary:
> 1. add SQI and SQI+ support for OATC14 10Base-T1S PHYs
>    - Introduces MDIO register definitions for DCQ_SQI and DCQ_SQIPLUS.
>    - Adds genphy_c45_oatc14_get_sqi_max() to report the maximum SQI/SQI+
>      level.
>    - Adds genphy_c45_oatc14_get_sqi() to return the current SQI or SQI+
>      value.
>    - Updates include/linux/phy.h to expose the new APIs.
>    - SQI+ capability is read from the Advanced Diagnostic Features
>      Capability register (ADFCAP). If unsupported, the driver falls back
>      to basic SQI (0–7 levels).
>    - If SQI+ capability is supported, the function returns the extended
>      SQI+ value; otherwise, it returns the basic SQI value.
>    - Open Alliance TC14 10BASE-T1S Advanced Diagnostic PHY Features.
>      https://opensig.org/wp-content/uploads/2025/06/OPEN_Alliance_10BASE-T1S_Advanced_PHY_features_for-automotive_Ethernet_V2.1b.pdf
> 
> [...]

Here is the summary with links:
  - [net-next,v4,1/2] net: phy: phy-c45: add SQI and SQI+ support for OATC14 10Base-T1S PHYs
    https://git.kernel.org/netdev/net-next/c/5e1bf5ae5e3b
  - [net-next,v4,2/2] net: phy: microchip_t1s: add SQI support for LAN867x Rev.D0 PHYs
    https://git.kernel.org/netdev/net-next/c/16416c835287

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next v4 1/2] net: phy: phy-c45: add SQI and SQI+ support for OATC14 10Base-T1S PHYs
  2025-12-01  3:23 ` [PATCH net-next v4 1/2] net: phy: phy-c45: add SQI and SQI+ support for OATC14 10Base-T1S PHYs Parthiban Veerasooran
  2025-12-01 13:24   ` Andrew Lunn
@ 2025-12-02 16:21   ` Simon Horman
  2025-12-03  8:22     ` Parthiban.Veerasooran
  1 sibling, 1 reply; 8+ messages in thread
From: Simon Horman @ 2025-12-02 16:21 UTC (permalink / raw)
  To: Parthiban Veerasooran
  Cc: piergiorgio.beruto, andrew, hkallweit1, linux, davem, edumazet,
	kuba, pabeni, netdev, linux-kernel

On Mon, Dec 01, 2025 at 08:53:45AM +0530, Parthiban Veerasooran wrote:

...

> +int genphy_c45_oatc14_get_sqi_max(struct phy_device *phydev)
> +{
> +	int ret;
> +
> +	if (!phydev->oatc14_sqi_capability.updated) {
> +		ret = oatc14_update_sqi_capability(phydev);
> +		if (ret)
> +			return ret;
> +	}

Hi Parthiban,

I think the check for phydev->oatc14_sqi_capability.updated can be folded
into oatc14_update_sqi_capability(), avoiding duplicating it here and in
genphy_c45_oatc14_get_sqi().

If you agree, could you consider posting a follow-up once net-next has
re-opened?

> +
> +	return phydev->oatc14_sqi_capability.sqi_max;
> +}
> +EXPORT_SYMBOL(genphy_c45_oatc14_get_sqi_max);
> +
> +/**
> + * genphy_c45_oatc14_get_sqi - Get Signal Quality Indicator (SQI) from an OATC14
> + *			       10Base-T1S PHY
> + * @phydev: pointer to the PHY device structure
> + *
> + * This function reads the SQI+ or SQI value from an OATC14-compatible
> + * 10Base-T1S PHY. If SQI+ capability is supported, the function returns the
> + * extended SQI+ value; otherwise, it returns the basic SQI value. The SQI
> + * capability is updated on first invocation if it has not already been updated.
> + *
> + * Return:
> + * * SQI/SQI+ value on success
> + * * Negative errno on read failure
> + */
> +int genphy_c45_oatc14_get_sqi(struct phy_device *phydev)
> +{
> +	u8 shift;
> +	int ret;
> +
> +	if (!phydev->oatc14_sqi_capability.updated) {
> +		ret = oatc14_update_sqi_capability(phydev);
> +		if (ret)
> +			return ret;
> +	}

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next v4 1/2] net: phy: phy-c45: add SQI and SQI+ support for OATC14 10Base-T1S PHYs
  2025-12-02 16:21   ` Simon Horman
@ 2025-12-03  8:22     ` Parthiban.Veerasooran
  0 siblings, 0 replies; 8+ messages in thread
From: Parthiban.Veerasooran @ 2025-12-03  8:22 UTC (permalink / raw)
  To: horms
  Cc: piergiorgio.beruto, andrew, hkallweit1, linux, davem, edumazet,
	kuba, pabeni, netdev, linux-kernel

Hi Simon,

On 02/12/25 9:51 pm, Simon Horman wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On Mon, Dec 01, 2025 at 08:53:45AM +0530, Parthiban Veerasooran wrote:
> 
> ...
> 
>> +int genphy_c45_oatc14_get_sqi_max(struct phy_device *phydev)
>> +{
>> +     int ret;
>> +
>> +     if (!phydev->oatc14_sqi_capability.updated) {
>> +             ret = oatc14_update_sqi_capability(phydev);
>> +             if (ret)
>> +                     return ret;
>> +     }
> 
> Hi Parthiban,
> 
> I think the check for phydev->oatc14_sqi_capability.updated can be folded
> into oatc14_update_sqi_capability(), avoiding duplicating it here and in
> genphy_c45_oatc14_get_sqi().
> 
> If you agree, could you consider posting a follow-up once net-next has
> re-opened?
Yes, I agree with you. Thanks for pointing it out. I will send a 
separate patch for doing this once the net-next is reopened again.

Best regards,
Parthiban V
> 
>> +
>> +     return phydev->oatc14_sqi_capability.sqi_max;
>> +}
>> +EXPORT_SYMBOL(genphy_c45_oatc14_get_sqi_max);
>> +
>> +/**
>> + * genphy_c45_oatc14_get_sqi - Get Signal Quality Indicator (SQI) from an OATC14
>> + *                          10Base-T1S PHY
>> + * @phydev: pointer to the PHY device structure
>> + *
>> + * This function reads the SQI+ or SQI value from an OATC14-compatible
>> + * 10Base-T1S PHY. If SQI+ capability is supported, the function returns the
>> + * extended SQI+ value; otherwise, it returns the basic SQI value. The SQI
>> + * capability is updated on first invocation if it has not already been updated.
>> + *
>> + * Return:
>> + * * SQI/SQI+ value on success
>> + * * Negative errno on read failure
>> + */
>> +int genphy_c45_oatc14_get_sqi(struct phy_device *phydev)
>> +{
>> +     u8 shift;
>> +     int ret;
>> +
>> +     if (!phydev->oatc14_sqi_capability.updated) {
>> +             ret = oatc14_update_sqi_capability(phydev);
>> +             if (ret)
>> +                     return ret;
>> +     }


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-12-03  8:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-01  3:23 [PATCH net-next v4 0/2] Add SQI and SQI+ support for OATC14 10Base-T1S PHYs and Microchip T1S driver Parthiban Veerasooran
2025-12-01  3:23 ` [PATCH net-next v4 1/2] net: phy: phy-c45: add SQI and SQI+ support for OATC14 10Base-T1S PHYs Parthiban Veerasooran
2025-12-01 13:24   ` Andrew Lunn
2025-12-02 16:21   ` Simon Horman
2025-12-03  8:22     ` Parthiban.Veerasooran
2025-12-01  3:23 ` [PATCH net-next v4 2/2] net: phy: microchip_t1s: add SQI support for LAN867x Rev.D0 PHYs Parthiban Veerasooran
2025-12-01 13:25   ` Andrew Lunn
2025-12-01 23:10 ` [PATCH net-next v4 0/2] Add SQI and SQI+ support for OATC14 10Base-T1S PHYs and Microchip T1S driver patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).