[PATCH net-next 5/8] net: stmmac: set number of snapshot external triggers for GMAC3

alexis.lothore at bootlin.com alexis.lothore at bootlin.com
Fri Jun 16 03:04:06 PDT 2023


From: Alexis Lothoré <alexis.lothore at bootlin.com>

While GMAC4 exposes number of available auxiliary snapshots inputs in
MAC_HW_FEATURE2 register, GMAC3 (DWMAC1000) does not expose this
information in its only hardware feature register.
When running on GMAC3, hardcode the value to 1 to allow external trigger
usage

Signed-off-by: Alexis Lothoré <alexis.lothore at bootlin.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index 167bfbf68911..090a9d803446 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -280,7 +280,10 @@ void stmmac_ptp_register(struct stmmac_priv *priv)
 		priv->plat->cdc_error_adj = (2 * NSEC_PER_SEC) / priv->plat->clk_ptp_rate;
 
 	stmmac_ptp_clock_ops.n_per_out = priv->dma_cap.pps_out_num;
-	stmmac_ptp_clock_ops.n_ext_ts = priv->dma_cap.aux_snapshot_n;
+	/* Number of available external triggers is not provided through a
+	 * hardware capabilities register for GMAC3
+	 */
+	stmmac_ptp_clock_ops.n_ext_ts = priv->plat->has_gmac ? 1 : priv->dma_cap.aux_snapshot_n;
 
 	rwlock_init(&priv->ptp_lock);
 	mutex_init(&priv->aux_ts_lock);
-- 
2.41.0




More information about the linux-arm-kernel mailing list