diff options
author | Maxime Chevallier <maxime.chevallier@bootlin.com> | 2024-11-12 18:06:54 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-11-13 18:52:13 -0800 |
commit | 774f57d6562d615d887dddfe00fb4d05d48d897b (patch) | |
tree | cb5213800dbdc86bbb1ccc3bb7e8cf3c24a15bcd | |
parent | 477c3e1f63638a26cf5debbe3dad5e5929b4c31e (diff) | |
download | linux-stable-774f57d6562d615d887dddfe00fb4d05d48d897b.tar.gz linux-stable-774f57d6562d615d887dddfe00fb4d05d48d897b.tar.bz2 linux-stable-774f57d6562d615d887dddfe00fb4d05d48d897b.zip |
net: stmmac: Enable timestamping interrupt on dwmac1000
The default configuration for the interrupts on dwmac1000 have the
timestamping interrupt masked. Now that the timestamping has been
adapted to dwmac1000, enable the timestamping interrupt on these
platforms.
On dwmac1000, the external snapshot interrupt is configured through a
dedicated bit, that is set as reserved on other dwmac variants. The
timestaming interrupt is acknowledged by reading the
GMAC3_X_TIMESTAMP_STATUS register.
Make sure that this interrupt is enabled when snapshot is enabled, and
masked when disabled.
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20241112170658.2388529-7-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c index 73bba4fdc2e4..96bcda0856ec 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c @@ -595,6 +595,20 @@ void dwmac1000_timestamp_interrupt(struct stmmac_priv *priv) /* DWMAC 1000 ptp_clock_info ops */ +static void dwmac1000_timestamp_interrupt_cfg(struct stmmac_priv *priv, bool en) +{ + void __iomem *ioaddr = priv->ioaddr; + + u32 intr_mask = readl(ioaddr + GMAC_INT_MASK); + + if (en) + intr_mask &= ~GMAC_INT_DISABLE_TIMESTAMP; + else + intr_mask |= GMAC_INT_DISABLE_TIMESTAMP; + + writel(intr_mask, ioaddr + GMAC_INT_MASK); +} + int dwmac1000_ptp_enable(struct ptp_clock_info *ptp, struct ptp_clock_request *rq, int on) { @@ -628,6 +642,8 @@ int dwmac1000_ptp_enable(struct ptp_clock_info *ptp, 10, 10000); mutex_unlock(&priv->aux_ts_lock); + + dwmac1000_timestamp_interrupt_cfg(priv, on); break; default: |