@@ -616,6 +616,10 @@ static void stmmac_get_rx_hwtstamp(struct stmmac_priv *priv, struct dma_desc *p,
*/
static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
{
+ u32 reset_mask = PTP_TCR_SNAPTYPSEL_1 | PTP_TCR_TSIPV4ENA |
+ PTP_TCR_TSIPV6ENA | PTP_TCR_TSEVNTENA |
+ PTP_TCR_TSMSTRENA | PTP_TCR_TSVER2ENA |
+ PTP_TCR_TSIPENA | PTP_TCR_TSENALL;
struct stmmac_priv *priv = netdev_priv(dev);
struct hwtstamp_config config;
u32 ptp_v2 = 0;
@@ -783,7 +787,9 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
priv->hwts_rx_en = ((config.rx_filter == HWTSTAMP_FILTER_NONE) ? 0 : 1);
priv->hwts_tx_en = config.tx_type == HWTSTAMP_TX_ON;
- priv->systime_flags = STMMAC_HWTS_ACTIVE;
+ priv->systime_flags = stmmac_config_hw_tstamping_get(priv, priv->ptpaddr);
+ priv->systime_flags &= ~reset_mask;
+ priv->systime_flags |= STMMAC_HWTS_ACTIVE;
if (priv->hwts_tx_en || priv->hwts_rx_en) {
priv->systime_flags |= tstamp_all | ptp_v2 |