@@ -494,7 +494,7 @@ int dwmac5_rxp_config(void __iomem *ioaddr, struct stmmac_tc_entry *entries,
int dwmac5_flex_pps_config(void __iomem *ioaddr, int index,
struct stmmac_pps_cfg *cfg, bool enable,
- u32 sub_second_inc, u32 systime_flags)
+ u32 sub_second_inc)
{
u32 tnsec = readl(ioaddr + MAC_PPSx_TARGET_TIME_NSEC(index));
u32 val = readl(ioaddr + MAC_PPS_CONTROL);
@@ -504,7 +504,7 @@ int dwmac5_flex_pps_config(void __iomem *ioaddr, int index,
return -EINVAL;
if (tnsec & TRGTBUSY0)
return -EBUSY;
- if (!sub_second_inc || !systime_flags)
+ if (!sub_second_inc)
return -EINVAL;
val &= ~PPSx_MASK(index);
@@ -522,8 +522,7 @@ int dwmac5_flex_pps_config(void __iomem *ioaddr, int index,
writel(cfg->start.tv_sec, ioaddr + MAC_PPSx_TARGET_TIME_SEC(index));
- if (!(systime_flags & PTP_TCR_TSCTRLSSR))
- cfg->start.tv_nsec = (cfg->start.tv_nsec * 1000) / 465;
+ /* HW timestamping init always sets PTP_TCR_TSCTRLSSR, so no conversion necessary */
writel(cfg->start.tv_nsec, ioaddr + MAC_PPSx_TARGET_TIME_NSEC(index));
period = cfg->period.tv_sec * 1000000000;
@@ -108,7 +108,7 @@ int dwmac5_rxp_config(void __iomem *ioaddr, struct stmmac_tc_entry *entries,
unsigned int count);
int dwmac5_flex_pps_config(void __iomem *ioaddr, int index,
struct stmmac_pps_cfg *cfg, bool enable,
- u32 sub_second_inc, u32 systime_flags);
+ u32 sub_second_inc);
int dwmac5_est_configure(void __iomem *ioaddr, struct stmmac_est *cfg,
unsigned int ptp_rate);
void dwmac5_fpe_configure(void __iomem *ioaddr, u32 num_txq, u32 num_rxq,
@@ -1109,7 +1109,7 @@ static int dwxgmac2_get_mac_tx_timestamp(struct mac_device_info *hw, u64 *ts)
static int dwxgmac2_flex_pps_config(void __iomem *ioaddr, int index,
struct stmmac_pps_cfg *cfg, bool enable,
- u32 sub_second_inc, u32 systime_flags)
+ u32 sub_second_inc)
{
u32 tnsec = readl(ioaddr + XGMAC_PPSx_TARGET_TIME_NSEC(index));
u32 val = readl(ioaddr + XGMAC_PPS_CONTROL);
@@ -1119,7 +1119,7 @@ static int dwxgmac2_flex_pps_config(void __iomem *ioaddr, int index,
return -EINVAL;
if (tnsec & XGMAC_TRGTBUSY0)
return -EBUSY;
- if (!sub_second_inc || !systime_flags)
+ if (!sub_second_inc)
return -EINVAL;
val &= ~XGMAC_PPSx_MASK(index);
@@ -1136,8 +1136,7 @@ static int dwxgmac2_flex_pps_config(void __iomem *ioaddr, int index,
writel(cfg->start.tv_sec, ioaddr + XGMAC_PPSx_TARGET_TIME_SEC(index));
- if (!(systime_flags & PTP_TCR_TSCTRLSSR))
- cfg->start.tv_nsec = (cfg->start.tv_nsec * 1000) / 465;
+ /* HW timestamping init always sets PTP_TCR_TSCTRLSSR, so no conversion necessary */
writel(cfg->start.tv_nsec, ioaddr + XGMAC_PPSx_TARGET_TIME_NSEC(index));
period = cfg->period.tv_sec * 1000000000;
@@ -360,7 +360,7 @@ struct stmmac_ops {
/* Flexible PPS */
int (*flex_pps_config)(void __iomem *ioaddr, int index,
struct stmmac_pps_cfg *cfg, bool enable,
- u32 sub_second_inc, u32 systime_flags);
+ u32 sub_second_inc);
/* Loopback for selftests */
void (*set_mac_loopback)(void __iomem *ioaddr, bool enable);
/* RSS */
@@ -217,7 +217,6 @@ struct stmmac_priv {
struct ptp_clock_info ptp_clock_ops;
unsigned int default_addend;
u32 sub_second_inc;
- u32 systime_flags;
u32 adv_ts;
int use_riwt;
int irq_wake;
@@ -697,9 +697,6 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
ptp_over_ipv6_udp | ptp_over_ipv4_udp | ts_event_en |
ts_master_en | snap_type_sel);
stmmac_config_hw_tstamping(priv, priv->ptpaddr, value);
-
- /* Store flags for later use */
- priv->systime_flags = value;
}
memcpy(&priv->tstamp_config, &config, sizeof(config));
@@ -806,9 +803,8 @@ static int stmmac_init_hwtstamp(struct stmmac_priv *priv)
xmac, &sec_inc);
temp = div_u64(1000000000ULL, sec_inc);
- /* Store sub second increment and flags for later use */
+ /* Store sub second increment for later use */
priv->sub_second_inc = sec_inc;
- priv->systime_flags = value;
/* calculate default added value:
* formula is :
@@ -154,8 +154,7 @@ static int stmmac_enable(struct ptp_clock_info *ptp,
spin_lock_irqsave(&priv->ptp_lock, flags);
ret = stmmac_flex_pps_config(priv, priv->ioaddr,
rq->perout.index, cfg, on,
- priv->sub_second_inc,
- priv->systime_flags);
+ priv->sub_second_inc);
spin_unlock_irqrestore(&priv->ptp_lock, flags);
break;
default: