13 | | The purpose of the IEEE 1588 Precision Time Protocol (PTP) is to synchronize the time between different nodes on an Ethernet network. |
| 14 | The 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. |
25 | | * Supports hardware and software time stamping via the Linux SO_TIMESTAMPING socket option. |
| 36 | The 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 | |
| 38 | The 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 |
| 39 | may need to send the timestamp to required recipients in a subsequent 1588 general message as a second step. |
| 40 | |
| 41 | NIC 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 |
| 46 | Gateworks 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 | |
| 50 | The 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 | |
| 52 | The 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) |
| 56 | The [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) |
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 | | |