9 | | </p> |
10 | | <ul><li><a class="wiki" href="/wiki/linux/timesync#ieee1588-ptp">IEEE 1588 Precision Time Protocol (PTP)</a> - uses Ethernet frames |
11 | | </li><li><a class="wiki" href="/wiki/linux/timesync#gps-pps">GPS Pulse-Per-Seconds</a> - uses GPS information |
12 | | </li></ul><p> |
13 | | <span class="wikianchor" id="ieee1588-ptp"></span> |
14 | | </p> |
15 | | <h2 id="TimesynchronizationviaIEEE1588PrecisionTimeProtocolPTPEthernet">Time synchronization via IEEE 1588 Precision Time Protocol (PTP) (Ethernet)</h2> |
16 | | <p> |
| 6 | |
| 7 | IEEE 1588 Precision Time Protocol - uses Ethernet frames |
| 8 | GPS Pulse-Per-Seconds - uses GPS information |
| 9 | |
| 10 | = Time synchronization via IEEE 1588 Precision Time Protocol (PTP) (Ethernet) |
| 11 | |
24 | | </p> |
25 | | <p> |
26 | | The <a class="ext-link" href="http://linuxptp.sourceforge.net/"><span class="icon"></span>Linux PTP</a> project is an implementation of the IEEE 1588 for Linux featuring: |
27 | | </p> |
28 | | <ul><li>Supports hardware and software time stamping via the Linux SO_TIMESTAMPING socket option. |
29 | | </li><li>Supports the Linux PTP Hardware Clock (PHC) subsystem by using the clock_gettime family of calls, including the new clock_adjtimex system call. |
30 | | </li><li>Implements Boundary Clock (BC) and Ordinary Clock (OC). |
31 | | </li><li>Transport over UDP/IPv4, UDP/IPv6, and raw Ethernet (Layer 2). |
32 | | </li><li>Supports IEEE 802.1AS-2011 in the role of end station. |
33 | | </li><li>Modular design allowing painless addition of new transports and clock servos. |
34 | | </li></ul><p> |
| 17 | |
| 18 | The http://linuxptp.sourceforge.net/ project is an implementation of the IEEE 1588 for Linux featuring: |
| 19 | |
| 20 | * Supports hardware and software time stamping via the Linux SO_TIMESTAMPING socket option. |
| 21 | * Supports the Linux PTP Hardware Clock (PHC) subsystem by using the clock_gettime family of calls, including the new clock_adjtimex system call. |
| 22 | * Implements Boundary Clock (BC) and Ordinary Clock (OC). |
| 23 | * Transport over UDP/IPv4, UDP/IPv6, and raw Ethernet (Layer 2). |
| 24 | * Supports IEEE 802.1AS-2011 in the role of end station. |
| 25 | * Modular design allowing painless addition of new transports and clock servos. |
| 26 | |
51 | | </pre><ul><li>the ptp4l tries to use hardware time stamping by default, otherwise you can use the '-H' to force hardware timestamping, or '-S' to force software timestamping |
52 | | </li><li>the -m parameter tells ptp4l to output messages to the console |
53 | | </li><li>no master was found so this target became the master |
54 | | </li></ul></li><li>slave: |
55 | | <pre class="wiki">ptp4l[228.234]: selected /dev/ptp0 as PTP clock |
| 43 | }}} |
| 44 | * the ptp4l tries to use hardware time stamping by default, otherwise you can use the '-H' to force hardware timestamping, or '-S' to force software timestamping |
| 45 | * the -m parameter tells ptp4l to output messages to the console |
| 46 | * no master was found so this target became the master |
| 47 | slave: |
| 48 | {{{#!bash |
| 49 | selected /dev/ptp0 as PTP clock |
76 | | </p> |
77 | | <ul><li><a class="ext-link" href="http://events.linuxfoundation.org/sites/events/files/slides/lcjp14_ichikawa_0.pdf"><span class="icon"></span>Introduction to linuxptp</a> |
78 | | </li><li><a class="ext-link" href="http://linuxptp.sourceforge.net/"><span class="icon"></span>Linux PTP Project</a> |
79 | | <ul><li><a class="ext-link" href="http://sourceforge.net/p/linuxptp/code/ci/master/tree/"><span class="icon"></span>Linux PTP code</a> |
80 | | </li></ul></li><li><a class="ext-link" href="https://github.com/torvalds/linux/blob/master/Documentation/ptp/ptp.txt"><span class="icon"></span>Linux PTP Documentation</a> |
81 | | <ul><li><a class="ext-link" href="https://github.com/torvalds/linux/blob/master/Documentation/ABI/testing/sysfs-ptp"><span class="icon"></span>sysfs API</a> |
82 | | </li><li><a class="ext-link" href="https://github.com/torvalds/linux/blob/master/Documentation/ptp/testptp.c"><span class="icon"></span>userspace test program</a> |
83 | | </li></ul></li><li><a class="ext-link" href="http://www.ixxat.com/introduction_ieee_1588_en.html"><span class="icon"></span>IEEE 1588 PTP Introduction</a> |
84 | | </li><li><a class="ext-link" href="https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-Configuring_PTP_Using_ptp4l.html"><span class="icon"></span>Configuring PTP Using ptp4l</a> |
85 | | </li></ul><p> |
86 | | <span class="wikianchor" id="gps-pps"></span> |
87 | | </p> |
88 | | <h1 id="TimesynchronizationviaPPSPulse-Per-SecondGPS">Time synchronization via PPS (Pulse-Per-Second) (GPS)</h1> |
89 | | <p> |
| 71 | |
| 72 | * [http://events.linuxfoundation.org/sites/events/files/slides/lcjp14_ichikawa_0.pdf Introduction to linuxPTP] |
| 73 | * [http://linuxptp.sourceforge.net/ Linux PTP Project] |
| 74 | * [http://sourceforge.net/p/linuxptp/code/ci/master/tree/ Linux PTP code] |
| 75 | * [https://github.com/torvalds/linux/blob/master/Documentation/ptp/ptp.txt Linux PTP Documentation] |
| 76 | * [https://github.com/torvalds/linux/blob/master/Documentation/ABI/testing/sysfs-ptp sysfs API] |
| 77 | * [https://github.com/torvalds/linux/blob/master/Documentation/ptp/testptp.c userspace test program] |
| 78 | * [http://www.ixxat.com/introduction_ieee_1588_en.html IEEE 1588 PTP Introduction] |
| 79 | * [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-Configuring_PTP_Using_ptp4l.html Configuring PTP Using ptp4l] |
| 80 | |
| 81 | = Time synchronization via PPS (Pulse-Per-Second) (GPS)</h1> |
| 82 | |
91 | | </p> |
92 | | <p> |
93 | | See <a class="wiki" href="/wiki/gps#pps">the GPS page</a> for more info |
94 | | </p> |
95 | | </div> |
| 84 | |
| 85 | See [wiki:/gps#pps the GPS page] for more info. |
| 86 | |
| 87 | = Octeon TX IEEE 1588 |
| 88 | |
| 89 | From CN80xx refrence manual: |
| 90 | |
| 91 | The CN80XX hardware supports very accurate timestamping in the PTP, BGX, GTI, |
| 92 | and NIC blocks. This timestamping is suitable for use in IEEE 1588 Precision Time |
| 93 | Protocol (PTP) or other purposes. |
| 94 | |
| 95 | The CN80XX outbound timestamping hardware captures timestamps, but cannot |
| 96 | insert the timestamp into any outgoing packets. Using IEEE 1588 vernacular, this |
| 97 | means that the CN80XX outbound timestamping hardware is most useful when |
| 98 | implementing a two-step clock, not a one-step clock, for PTP event messages sent |
| 99 | from CN80XX. After the hardware captures the timestamp for the outgoing 1588 |
| 100 | event message and delivers it to software, the 1588 software running on the CN80XX |
| 101 | may need to send the timestamp to required recipients in a subsequent 1588 general |
| 102 | message as a second step. |
| 103 | |
| 104 | NIC has no specific mode supporting PTP timestamping, but contains a number of |
| 105 | features to compensate for the PTP timestamp introduced by BGX when it is |
| 106 | timestamping. |
| 107 | When BGX is in the receive-timestamp mode, NIC receives the timestamp plus |
| 108 | packet from the BGX. NIC packet parsing is able to skip over the received |
| 109 | timestamps (NIC_PF_PKIND(0..15)_CFG[HDR_SL]). NIC MAXERR, MINERR, and |
| 110 | LENERR checks can compensate for the additional header, since the MAXERR and |
| 111 | MINERR byte counts are programmable, and the programmed value can easily be |
| 112 | increased by 8. The LENERR check already compensates based on the skip value. |
| 113 | NIC makes the timestamp available for software with every packet. The timestamp |
| 114 | can be present in the completion-queue entry and/or the receive buffer in L2/DRAM |
| 115 | for software, depending on NIC configuration. The software will likely use the |
| 116 | timestamp when IEEE 1588 event messages arrive. For other packets, the software |
| 117 | may choose to discard or ignore the timestamp that is present with every packet in |
| 118 | this mode. |
| 119 | |
| 120 | [[Image(cavium-octeon-tx-block-diagram.jpg, width=600)]] |