Lines Matching full:timestamp
191 * ice_ptp_cfg_tx_interrupt - Configure Tx timestamp interrupt for the device
194 * Program the device to respond appropriately to the Tx timestamp interrupt
220 /* Configure the Tx timestamp interrupt */ in ice_ptp_cfg_tx_interrupt()
243 /* Set the timestamp flag for all the Rx rings */ in ice_set_rx_tstamp()
252 * ice_ptp_disable_timestamp_mode - Disable current timestamp mode
272 * ice_ptp_restore_timestamp_mode - Restore timestamp configuration
275 * Called at the end of rebuild to restore timestamp configuration after
310 /* Read the system timestamp pre PHC read */ in ice_ptp_read_src_clk_reg()
316 /* Read the system timestamp post PHC read */ in ice_ptp_read_src_clk_reg()
324 /* Read the system timestamp post PHC read */ in ice_ptp_read_src_clk_reg()
344 * ice_ptp_extend_32b_ts - Convert a 32b nanoseconds timestamp to 64b
346 * @in_tstamp: Ingress/egress 32b nanoseconds timestamp value
350 * Note that the captured timestamp values may be 40 bits, but the lower
353 * Extend the 32bit nanosecond timestamp using the following algorithm and
359 * 3) calculate the delta between the cached time and the timestamp
360 * 4) if the delta is smaller than 2^31 nanoseconds, then the timestamp was
361 * captured after the PHC time. In this case, the full timestamp is just
364 * timestamp was captured *before* the PHC time, i.e. because the PHC
365 * cache was updated after the timestamp was captured by hardware. In this
366 * case, the full timestamp is the cached time minus the inverse delta.
368 * This algorithm works even if the PHC time was updated after a Tx timestamp
369 * was requested, but before the Tx timestamp event was reported from
373 * date. If the timestamp was captured more than 2^31 nanoseconds after the
375 * overflowed more than once, and we might generate an incorrect timestamp.
378 * a second, and (b) discarding any Tx timestamp packet if it has waited for
379 * a timestamp for more than one second.
411 * ice_ptp_extend_40b_ts - Convert a 40b timestamp to 64b nanoseconds
413 * @in_tstamp: Ingress/egress 40b timestamp value
422 * The low bit is an indicator of whether the timestamp is valid. The next
426 * It is assumed that the caller verifies the timestamp is valid prior to
430 * time stored in the device private PTP structure as the basis for timestamp
441 /* Discard the hardware timestamp if the cached PHC time is too old */ in ice_ptp_extend_40b_ts()
454 * @tx: the PTP Tx timestamp tracker to check
456 * Check that a given PTP Tx timestamp tracker is up, i.e. that it is ready
457 * to accept new timestamp requests.
470 * ice_ptp_req_tx_single_tstamp - Request Tx timestamp for a port from FW
471 * @tx: the PTP Tx timestamp tracker
472 * @idx: index of the timestamp to request
518 * ice_ptp_complete_tx_single_tstamp - Complete Tx timestamp for a port
519 * @tx: the PTP Tx timestamp tracker
572 /* Devices using this interface always verify the timestamp differs in ice_ptp_complete_tx_single_tstamp()
573 * relative to the last cached timestamp value. in ice_ptp_complete_tx_single_tstamp()
593 /* Extend the timestamp using cached PHC time */ in ice_ptp_complete_tx_single_tstamp()
606 * @tx: the PTP Tx timestamp tracker
611 * If a given index has a valid timestamp, perform the following steps:
613 * 1) check that the timestamp request is not stale
614 * 2) check that a timestamp is ready and available in the PHY memory bank
615 * 3) read and copy the timestamp out of the PHY register
617 * 5) check if the timestamp is stale, and discard if so
618 * 6) extend the 40 bit timestamp value to get a 64 bit timestamp value
619 * 7) send this 64 bit timestamp to the stack
621 * Note that we do not hold the tracking lock while reading the Tx timestamp.
622 * This is because reading the timestamp requires taking a mutex that might
625 * The only place where we set in_use is when a new timestamp is initiated
628 * function, or during teardown when the Tx timestamp tracker is being
629 * removed. A timestamp index will never be re-used until the in_use bit for
632 * If a Tx thread starts a new timestamp, we might not begin processing it
635 * If a Tx thread starts a new timestamp just after this function exits, the
636 * interrupt for that timestamp should re-trigger this function once
637 * a timestamp is ready.
640 * timestamps may not be able to safely use the timestamp extension math. In
646 * to correctly extend the timestamp using the cached PHC time. It is
647 * extremely unlikely that a packet will ever take this long to timestamp. If
648 * we detect a Tx timestamp request that has waited for this long we assume
650 * the timestamp register.
692 /* Only read a timestamp from the PHY if its marked as ready in ice_ptp_process_tx_tstamp()
716 /* For PHYs which don't implement a proper timestamp ready in ice_ptp_process_tx_tstamp()
717 * bitmap, verify that the timestamp value is different in ice_ptp_process_tx_tstamp()
718 * from the last cached timestamp. If it is not, skip this for in ice_ptp_process_tx_tstamp()
725 /* Discard any timestamp value without the valid bit set */ in ice_ptp_process_tx_tstamp()
751 /* Extend the timestamp using cached PHC time */ in ice_ptp_process_tx_tstamp()
813 /* Process the Tx timestamp tracker */ in ice_ptp_tx_tstamp()
884 /* If we fail to read the Tx timestamp ready bitmap just in ice_ptp_flush_tx_tracker()
894 /* In case this timestamp is ready, we need to clear it. */ in ice_ptp_flush_tx_tracker()
918 * their timestamp value to the stack. This is required to prevent extending
919 * the 40bit hardware timestamp incorrectly.
935 * ice_ptp_flush_all_tx_tracker - Flush all timestamp trackers on this clock
938 * Called by the clock owner to flush all the Tx timestamp trackers associated
955 * Free memory associated with the Tx timestamp tracker.
989 * Initialize the Tx timestamp tracker for this port. For generic MAC devices,
990 * the timestamp block is shared for all ports in the same quad. To avoid
991 * ports using the same timestamp index, logically break the block of
1013 * Initialize the Tx timestamp tracker for this PF. For all PHYs except E82X,
1024 /* The E810 PHY does not provide a timestamp ready bitmap. Instead, in ice_ptp_init_tx()
1026 * timestamp. in ice_ptp_init_tx()
1109 * with a wrong cached timestamp.
1136 * incorrect timestamp values. in ice_ptp_reset_cached_phctime()
1258 * used to configure and enable vernier timestamp calibration.
1452 * configures The E82X timestamp owner to react to interrupts from all PHYs.
1571 /* Don't process timestamp events if PTP is not ready */ in ice_ptp_extts_event()
1590 event.timestamp = (u64)hi << 32 | lo; in ice_ptp_extts_event()
1598 event.timestamp -= desc->delay[0]; in ice_ptp_extts_event()
1611 * @rq: External timestamp request
1614 * Configure an external timestamp event on the requested channel.
2101 /* Recalibrate and re-enable timestamp blocks for E822/E823 */ in ice_ptp_settime64()
2181 * struct ice_crosststamp_cfg - Device cross timestamp configuration
2184 * @ctl_reg: The hardware register to request cross timestamp
2185 * @ctl_active: Bit in the control register to request cross timestamp
2236 * struct ice_crosststamp_ctx - Device cross timestamp context
2239 * @cfg: pointer to hardware configuration for cross timestamp
2248 * ice_capture_crosststamp - Capture a device/system cross timestamp
2278 /* Poll until we obtain the cross-timestamp hardware semaphore */ in ice_capture_crosststamp()
2283 dev_err(ice_pf_to_dev(pf), "PTP failed to get cross timestamp lock\n"); in ice_capture_crosststamp()
2330 * ice_ptp_getcrosststamp - Capture a device cross timestamp
2332 * @cts: The memory to fill the cross timestamp info
2334 * Capture a cross timestamp between the ART and the device PTP hardware
2335 * clock. Fill the cross timestamp information and report it back to the
2338 * In order to correctly correlate the ART timestamp back to the TSC time, the
2390 * ice_ptp_set_timestamp_mode - Setup driver for requested timestamp mode
2468 * ice_ptp_get_rx_hwts - Get packet Rx timestamp in ns
2472 * The driver receives a notification in the receive descriptor with timestamp.
2485 /* Do not report a timestamp if we don't have a cached PHC time */ in ice_ptp_get_rx_hwts()
2790 * ice_ptp_request_ts - Request an available Tx timestamp index
2791 * @tx: the PTP Tx timestamp tracker to request from
2792 * @skb: the SKB to associate with this timestamp request
2801 /* Check that this tracker is accepting new timestamp requests */ in ice_ptp_request_ts()
2828 /* return the appropriate PHY timestamp register index, -1 if no in ice_ptp_request_ts()
2857 WARN_ONCE(1, "Unexpected Tx timestamp interrupt mode %u\n", in ice_ptp_process_ts()
2867 * Return: IRQ_WAKE_THREAD if Tx timestamp read has to be handled in the bottom
2877 * request a single timestamp in the top half and wait for in ice_ptp_ts_irq()
2926 * The device PHY issues Tx timestamp interrupts to the driver for processing
2927 * timestamp data from the PHY. It will not interrupt again until all
2928 * current timestamp data is read. In rare circumstances, it is possible that
2932 * outstanding timestamp data. If so, trigger an interrupt from software to
2963 …dev_dbg(dev, "PTP periodic task detected waiting timestamps. Triggering Tx timestamp interrupt now… in ice_ptp_maybe_trigger_tx_interrupt()
3073 * about to flush the PHY timestamp block. in ice_ptp_rebuild_owner()
3084 /* Re-enable all periodic outputs and external timestamp events */ in ice_ptp_rebuild_owner()
3319 * Initialize the Tx timestamp interrupt mode for this device. For most device