Changes between Version 17 and Version 18 of timesync


Ignore:
Timestamp:
04/30/2025 08:03:10 PM (5 days ago)
Author:
Tim Harvey
Comment:

added additional information about the types of PTP

Legend:

Unmodified
Added
Removed
Modified
  • timesync

    v17 v18  
    11[[PageOutline]]
    2 = Linux Time Syncrhronization
     2= Linux Time Synchronization
    33
    44Many applications in factory automation, test and measurement, and telecommunications require close time synchronization. This is often a scenario where multiple boards are transmitting on the same RF channel and the system clocks must be synchronized precisely. Time Division Multiplex (TDM) is used so the transmitters are not producing collisions, thus maximizing RF throughput.
     
    1010
    1111= Time synchronization via IEEE 1588 Precision Time Protocol (PTP) (Ethernet)
     12The IEEE 1588 Precision Time Protocol (PTP) is designed to provide high-precision clock synchronization across networked devices, achieving sub-microsecond accuracy. The implementation of PTP varies between Ethernet Media Access Controllers (MACs) and Physical Layer (PHY) devices which may include dedicated GPIO support for 1588.
    1213
    13 The purpose of the IEEE 1588 Precision Time Protocol (PTP) is to synchronize the time between different nodes on an Ethernet network.
     14The following timestamping scenarios exist:
     15 * '''software-only PTP (lowest accuracy)''': relies on the OS to timestamp PTP even messages as they pass through the network statck without requiring hardware support for precise timestamping. This is supported in the kernel with timestamps based on the system clock rather than a dedicated PTP Hardware Clock (PHC)
     16 * '''MAC timestamping''': if supported by MAC, this allows captured timestamps to be inserted by the hardware via a dedicated PTP Hardware Clock (PHC) at the MAC layer which reduces latency introduced by the network stack and queuing ensuring high accuracy.
     17 * '''PHY timestamping (highest accuracy)''': if supported by PHY, this allows timestamps to be captured as frames pass through the PHY minimizing latency and jitter compared to MAC-only timestamping.
    1418
    15 The Linux kernel has IEEE 1588 PTP support for a handful of ethernet devices that offer this feature.
     19The Linux kernel has IEEE 1588 PTP support for a handful of ethernet devices.
    1620
    17 Ventana: The Freescale IMX6 FEC which is used as eth0 on the majority of the Gateworks Ventana boards including the GW51xx, GW52xx, GW53xx, and GW54xx (Note GW5520 does not use the IMX6 FEC and instead provides 2x full GigE capable PCIe based MAC/PHY devices so it lacks IEEE 1588 hardware support).
     21[=#venice_ptp]
     22== Gateworks Venice PTP
     23Gateworks venice MAC/PHY's supporting IEEE 1588 PTP include:
     24- IMX8M FEC ethernet MAC
     25- IMX8MP EQOS ethernet MAC
     26- LAN7430 PCIe Gigabit Ethernet controller MAC/PHY (used as an additional ethernet device on boards)
    1827
    19 Venice: The NXP IMX8M Mini FEC MAC from the processor supports 1588 on the single Ethernet port.
     28The NXP FEC MAC and EQOS supports timestamping at the MAC layer and achieves sub-microsecond synchronization accuracy, suitable for industrial automation, automotive, and IoT applications. The iMX8M’s improved timer and driver support offer slightly better precision than the iMX6, especially in modern Linux kernels. Both MAC's additionally have GPIO support where PTP-related timing signals (ie Pulse-per-Second or event triggers) can be pinmuxed to specific GPIO's and made available if supported by the individual board design.
    2029
    21 In hardware PTP the ethernet MAC is responsible for getting and setting the timestamps to remove latency of the queuing and network stack which provides the best accuracy.
     30The LAN7430 PCIe Ethernet controller supports timestamping at the PHY layer (which minimizes latency and jitter compared to MAC-layer using a dedicated PTP clock. The LAN7430 supports both one-step and two-step PTP modes, where timestamps are either inserted directly into packets (one-step) or sent in follow-up messages (two-step)
    2231
    23 The http://linuxptp.sourceforge.net/ project is an implementation of the IEEE 1588 for Linux featuring:
     32[=#newport_ptp]
     33== Gateworks Newport PTP
     34The CN80xx SoC supports PTP at the MAC layer. From CN80xx reference manual:
    2435
    25 * Supports hardware and software time stamping via the Linux SO_TIMESTAMPING socket option.
     36The CN80XX hardware supports very accurate timestamping in the PTP, BGX, GTI, and NIC blocks. This timestamping is suitable for use in IEEE 1588 Precision Time Protocol (PTP) or other purposes.
     37
     38The CN80XX outbound timestamping hardware captures timestamps, but cannot insert the timestamp into any outgoing packets. Using IEEE 1588 vernacular, this means that the CN80XX outbound timestamping hardware is most useful when implementing a two-step clock, not a one-step clock, for PTP event messages sent from CN80XX. After the hardware captures the timestamp for the outgoing 1588 event message and delivers it to software, the 1588 software running on the CN80XX
     39may need to send the timestamp to required recipients in a subsequent 1588 general message as a second step.
     40
     41NIC has no specific mode supporting PTP timestamping, but contains a number of features to compensate for the PTP timestamp introduced by BGX when it is timestamping. When BGX is in the receive-timestamp mode, NIC receives the timestamp plus packet from the BGX. NIC packet parsing is able to skip over the received timestamps. NIC MAXERR, MINERR, and LENERR checks can compensate for the additional header, since the MAXERR and MINERR byte counts are programmable, and the programmed value can easily be increased by 8. The LENERR check already compensates based on the skip value. NIC makes the timestamp available for software with every packet. The timestamp can be present in the completion-queue entry and/or the receive buffer in L2/DRAM for software, depending on NIC configuration. The software will likely use the timestamp when IEEE 1588 event messages arrive. For other packets, the software may choose to discard or ignore the timestamp that is present with every packet in this mode.
     42
     43
     44[=#ventana_ptp]
     45== Gateworks Ventana PTP
     46Gateworks ventana MAC/PHY's supporting IEEE 1588 PTP include:
     47- IMX6Q/DL FEC ethernet
     48- Intel I210 PCIe Gigabit Ethernet controller MAC/PHY (used as an additional ethernet device on boards)
     49
     50The NXP FEC MAC supports timestamping at the MAC layer and achieves sub-microsecond synchronization accuracy, suitable for industrial automation, automotive, and IoT applications. The MAC additionally has GPIO support where PTP-related timing signals (ie Pulse-per-Second or event triggers) can be pinmuxed to specific GPIO's and made available if supported by the individual board design.
     51
     52The I210 Ethernet controller implements PTP timestamping ath the PHY layer minimizing latency and jitter compared to MAC-only timestamping. The I210 includes a dedicated hardware clock for PTP and supports both one-step and two-step PTP modes, where timestamps are either inserted directly into packets (one-step) or sent in follow-up messages (two-step)
     53
     54[=#linuxptp]
     55== The Linux PTP Project (linuxptp)
     56The [http://linuxptp.sourceforge.net/ Linux PTP Project] is an implementation of the IEEE 1588 for Linux featuring:
     57
     58* Supports software time stamping via the Linux SO_TIMESTAMPING socket option (use the -S parameter)
    2659* Supports the Linux PTP Hardware Clock (PHC) subsystem by using the clock_gettime family of calls, including the new clock_adjtimex system call.
    2760* Implements Boundary Clock (BC) and Ordinary Clock (OC).
     
    93126
    94127See [wiki:/gps#pps the GPS page] for more info.
    95 
    96 = Octeon TX IEEE 1588
    97 
    98 From CN80xx refrence manual:
    99 
    100 The CN80XX hardware supports very accurate timestamping in the PTP, BGX, GTI,
    101 and NIC blocks. This timestamping is suitable for use in IEEE 1588 Precision Time
    102 Protocol (PTP) or other purposes.
    103 
    104 The CN80XX outbound timestamping hardware captures timestamps, but cannot
    105 insert the timestamp into any outgoing packets. Using IEEE 1588 vernacular, this
    106 means that the CN80XX outbound timestamping hardware is most useful when
    107 implementing a two-step clock, not a one-step clock, for PTP event messages sent
    108 from CN80XX. After the hardware captures the timestamp for the outgoing 1588
    109 event message and delivers it to software, the 1588 software running on the CN80XX
    110 may need to send the timestamp to required recipients in a subsequent 1588 general
    111 message as a second step.
    112 
    113 NIC has no specific mode supporting PTP timestamping, but contains a number of
    114 features to compensate for the PTP timestamp introduced by BGX when it is
    115 timestamping.
    116 When BGX is in the receive-timestamp mode, NIC receives the timestamp plus
    117 packet from the BGX. NIC packet parsing is able to skip over the received
    118 timestamps. NIC MAXERR, MINERR, and LENERR checks can compensate for the additional header, since the MAXERR and MINERR byte counts are programmable, and the programmed value can easily be
    119 increased by 8. The LENERR check already compensates based on the skip value.
    120 NIC makes the timestamp available for software with every packet. The timestamp
    121 can be present in the completion-queue entry and/or the receive buffer in L2/DRAM
    122 for software, depending on NIC configuration. The software will likely use the
    123 timestamp when IEEE 1588 event messages arrive. For other packets, the software
    124 may choose to discard or ignore the timestamp that is present with every packet in
    125 this mode.
    126 
    127 
    128