Lines Matching +full:pps +full:- +full:channel
1 // SPDX-License-Identifier: GPL-2.0-only
46 /* For GMAC3.x, 4.x versions, in "fine adjustement mode" set sub-second in config_sub_second_increment()
49 * to mid-range = 2^31 when the remainder of this division is zero, in config_sub_second_increment()
78 void __iomem *ioaddr = priv->ptpaddr; in hwtstamp_correct_latency()
84 /* MAC-internal ingress latency */ in hwtstamp_correct_latency()
93 scaled_ns = ((u64)NSEC_PER_SEC << 16) - scaled_ns; in hwtstamp_correct_latency()
96 scaled_ns = ((1ULL << 31) << 16) - in hwtstamp_correct_latency()
108 /* MAC-internal egress latency */ in hwtstamp_correct_latency()
148 while (limit--) { in config_addend()
154 return -EBUSY; in config_addend()
171 sec = -sec; in adjust_systime()
175 nsec = (PTP_DIGITAL_ROLLOVER_MODE - nsec); in adjust_systime()
177 nsec = (PTP_BINARY_ROLLOVER_MODE - nsec); in adjust_systime()
191 while (limit--) { in adjust_systime()
197 return -EBUSY; in adjust_systime()
234 u32 acr_value, channel; in timestamp_interrupt() local
239 if (priv->plat->flags & STMMAC_FLAG_INT_SNAPSHOT_EN) { in timestamp_interrupt()
240 wake_up(&priv->tstamp_busy_wait); in timestamp_interrupt()
244 tsync_int = readl(priv->ioaddr + GMAC_INT_STATUS) & GMAC_INT_TSIE; in timestamp_interrupt()
250 * timestamp or start/end of PPS. in timestamp_interrupt()
252 ts_status = readl(priv->ioaddr + GMAC_TIMESTAMP_STATUS); in timestamp_interrupt()
254 if (!(priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN)) in timestamp_interrupt()
260 acr_value = readl(priv->ptpaddr + PTP_ACR); in timestamp_interrupt()
261 channel = ilog2(FIELD_GET(PTP_ACR_MASK, acr_value)); in timestamp_interrupt()
264 read_lock_irqsave(&priv->ptp_lock, flags); in timestamp_interrupt()
265 get_ptptime(priv->ptpaddr, &ptp_time); in timestamp_interrupt()
266 read_unlock_irqrestore(&priv->ptp_lock, flags); in timestamp_interrupt()
268 event.index = channel; in timestamp_interrupt()
270 ptp_clock_event(priv->ptp_clock, &event); in timestamp_interrupt()