Menu

Tree [6bcda2] v1.3 /
 History

HTTPS access


File Date Author Commit
 .gitignore 2012-11-05 Miroslav Lichvar Miroslav Lichvar [23ebe8] Add .gitignore.
 CODING_STYLE.org 2013-02-06 Richard Cochran Richard Cochran [89562f] Add a coding style document.
 COPYING 2011-11-01 Richard Cochran Richard Cochran [af380e] Add the license, a readme, and some header files.
 README.org 2013-07-07 Richard Cochran Richard Cochran [4b2140] Add another Freescale driver into the support m...
 bmc.c 2013-07-14 Richard Cochran Richard Cochran [46db40] Become the grand master when all alone.
 bmc.h 2011-11-04 Richard Cochran Richard Cochran [c9a15e] Add the best master clock algorithm.
 clock.c 2013-07-14 Richard Cochran Richard Cochran [46db40] Become the grand master when all alone.
 clock.h 2013-07-07 Richard Cochran Richard Cochran [a36717] Throw a state decision event if the clock quali...
 clockadj.c 2013-04-08 Miroslav Lichvar Miroslav Lichvar [4929d5] Let kernel synchronize RTC to system clock.
 clockadj.h 2013-04-08 Miroslav Lichvar Miroslav Lichvar [4929d5] Let kernel synchronize RTC to system clock.
 config.c 2013-06-28 Miroslav Lichvar Miroslav Lichvar [c7c675] Adjust constants of PI servo according to sync ...
 config.h 2013-06-28 Miroslav Lichvar Miroslav Lichvar [c7c675] Adjust constants of PI servo according to sync ...
 contain.h 2011-11-12 Richard Cochran Richard Cochran [5c0103] Add a modular clock servo interface with a PI c...
 ddt.h 2013-02-24 Geoff Salmon Geoff Salmon [e91997] adds CLOCK_DESCRIPTION struct
 default.cfg 2013-06-28 Miroslav Lichvar Miroslav Lichvar [c7c675] Adjust constants of PI servo according to sync ...
 dm.h 2012-04-05 Richard Cochran Richard Cochran [a8a540] Expose the peer delay flavors in their own head...
 ds.h 2013-07-05 Richard Cochran Richard Cochran [4782d6] Add a clock variable to hold the value of the t...
 ether.h 2012-08-14 Richard Cochran Richard Cochran [08bee2] raw: accept VLAN tagged packets.
 fault.c 2013-03-20 Richard Cochran Richard Cochran [bd28ac] Merge branch 'mlichvar_leap'
 fault.h 2013-03-20 Richard Cochran Richard Cochran [bd28ac] Merge branch 'mlichvar_leap'
 fd.h 2012-03-21 Richard Cochran Richard Cochran [0ca814] Remove a useless variable from the file descrip...
 foreign.h 2011-11-12 Richard Cochran Richard Cochran [49cd10] Implement the PTP clock.
 fsm.c 2012-01-06 Richard Cochran Richard Cochran [222c9b] Fix the port finite state machine.
 fsm.h 2013-02-06 Richard Cochran Richard Cochran [f530ae] Hide the grandmaster port state.
 gPTP.cfg 2013-06-28 Miroslav Lichvar Miroslav Lichvar [c7c675] Adjust constants of PI servo according to sync ...
 hwstamp_ctl.8 2013-02-05 Miroslav Lichvar Miroslav Lichvar [9e7517] Remove trailing whitespaces.
 hwstamp_ctl.c 2013-03-21 Jiri Benc Jiri Benc [fb1b78] hwstamp_ctl: explain ERANGE error better
 makefile 2013-06-08 Richard Cochran Richard Cochran [c14a24] Silence grep error during build.
 mave.c 2011-11-27 Richard Cochran Richard Cochran [56a5ad] Smooth the path delay estimate with a moving av...
 mave.h 2011-11-27 Richard Cochran Richard Cochran [56a5ad] Smooth the path delay estimate with a moving av...
 missing.h 2013-06-14 Richard Cochran Richard Cochran [f394e1] uClinux: Add another missing system call wrapper.
 msg.c 2013-07-22 Richard Cochran Richard Cochran [b4b548] msg: Add missing network byte order conversion.
 msg.h 2013-03-28 Libor Pechacek Libor Pechacek [0367bb] Distinguish between ignored and malformed packets
 pdt.h 2011-11-01 Richard Cochran Richard Cochran [af380e] Add the license, a readme, and some header files.
 phc.c 2013-06-06 Ken ICHIKAWA Ken ICHIKAWA [67c925] Don't return bogus clock id
 phc.h 2013-04-19 Jiri Benc Jiri Benc [400427] phc2sys: enable PPS output from PHC
 phc2sys.8 2013-06-20 Ken ICHIKAWA Ken ICHIKAWA [28b8dc] Add a new servo option which specifies first st...
 phc2sys.c 2013-07-21 Richard Cochran Richard Cochran [b0d789] pmc: optional legacy zero length TLV for GET ac...
 pi.c 2013-06-28 Miroslav Lichvar Miroslav Lichvar [c7c675] Adjust constants of PI servo according to sync ...
 pi.h 2013-06-28 Miroslav Lichvar Miroslav Lichvar [c7c675] Adjust constants of PI servo according to sync ...
 pmc.8 2013-07-21 Richard Cochran Richard Cochran [b0d789] pmc: optional legacy zero length TLV for GET ac...
 pmc.c 2013-07-23 Richard Cochran Richard Cochran [b74e46] pmc: release the message cache on exit.
 pmc_common.c 2013-07-22 Richard Cochran Richard Cochran [923ff5] pmc_common: introduce a variable for the target...
 pmc_common.h 2013-07-22 Richard Cochran Richard Cochran [923ff5] pmc_common: introduce a variable for the target...
 port.c 2013-08-01 Richard Cochran Richard Cochran [7be069] Fix bug in unlucky sync/follow up handling.
 port.h 2013-03-20 Richard Cochran Richard Cochran [bd28ac] Merge branch 'mlichvar_leap'
 print.c 2013-02-05 Miroslav Lichvar Miroslav Lichvar [a41e9f] Print messages with level below LOG_NOTICE to s...
 print.h 2013-01-29 Miroslav Lichvar Miroslav Lichvar [d28f77] Set program name for print().
 ptp4l.8 2013-06-28 Miroslav Lichvar Miroslav Lichvar [c7c675] Adjust constants of PI servo according to sync ...
 ptp4l.c 2013-07-27 Andy Lutomirski Andy Lutomirski [f6536f] Fix check for timestamping modes
 raw.c 2013-01-09 Geoff Salmon Geoff Salmon [d67798] raw: implement getting physical and protocol addrs
 raw.h 2012-08-25 Richard Cochran Richard Cochran [529206] Move shared layer 2 global declarations into an...
 servo.c 2013-05-16 Richard Cochran Richard Cochran [369513] Let the clock servo know the expected sync inte...
 servo.h 2013-05-16 Richard Cochran Richard Cochran [369513] Let the clock servo know the expected sync inte...
 servo_private.h 2013-05-16 Richard Cochran Richard Cochran [369513] Let the clock servo know the expected sync inte...
 sk.c 2013-05-15 Jiri Bohac Jiri Bohac [7b02a5] fix misleading pr_err on poll timeout
 sk.h 2013-04-05 Jacob Keller Jacob Keller [76e10e] ptp4l: Use poll() instead of a try-again loop
 stats.c 2013-02-07 Miroslav Lichvar Miroslav Lichvar [3136e3] Add summary statistics.
 stats.h 2013-02-07 Miroslav Lichvar Miroslav Lichvar [3136e3] Add summary statistics.
 sysoff.c 2013-02-07 Miroslav Lichvar Miroslav Lichvar [42b305] phc2sys: Print clock reading delay.
 sysoff.h 2013-02-07 Miroslav Lichvar Miroslav Lichvar [42b305] phc2sys: Print clock reading delay.
 tlv.c 2013-07-28 Richard Cochran Richard Cochran [7789f0] Be more careful when receiving clock descriptio...
 tlv.h 2013-07-06 Richard Cochran Richard Cochran [64ec04] Introduce a non-portable management TLV for gra...
 tmtab.c 2011-11-22 Richard Cochran Richard Cochran [1d6737] Add a time out table for delay requests.
 tmtab.h 2011-11-22 Richard Cochran Richard Cochran [1d6737] Add a time out table for delay requests.
 tmv.h 2012-09-20 Richard Cochran Richard Cochran [6ce135] Merge branch 'as2'
 transport.c 2013-01-09 Geoff Salmon Geoff Salmon [e01093] transport: adds interface for getting type, and...
 transport.h 2013-01-09 Geoff Salmon Geoff Salmon [e01093] transport: adds interface for getting type, and...
 transport_private.h 2013-01-09 Geoff Salmon Geoff Salmon [e01093] transport: adds interface for getting type, and...
 udp.c 2013-01-09 Geoff Salmon Geoff Salmon [c54f8a] udp: implement getting physical and protocol addrs
 udp.h 2012-03-17 Richard Cochran Richard Cochran [9d4d68] Add missing release method to the UDPv4 transport.
 udp6.c 2013-01-09 Geoff Salmon Geoff Salmon [d4db76] udp6: implement getting physical and protocol a...
 udp6.h 2012-11-25 Richard Cochran Richard Cochran [d83cd7] udp6: add an option to set the multicast scope.
 uds.c 2012-08-27 Richard Cochran Richard Cochran [2b819b] uds: fix bug in file descriptor array opening.
 uds.h 2013-02-05 Miroslav Lichvar Miroslav Lichvar [ecbbf4] Move Unix domain sockets to /var/run.
 util.c 2013-07-22 Richard Cochran Richard Cochran [a3762c] pmc: add a command to select the target port.
 util.h 2013-07-22 Richard Cochran Richard Cochran [a3762c] pmc: add a command to select the target port.
 version.c 2012-12-09 Richard Cochran Richard Cochran [c31198] Add utility functions to get the software versi...
 version.h 2012-12-09 Richard Cochran Richard Cochran [c31198] Add utility functions to get the software versi...
 version.sh 2013-08-02 Richard Cochran Richard Cochran [6bcda2] Version 1.3

Read Me

* Introduction

  This software is an implementation of the Precision Time Protocol
  (PTP) according to IEEE standard 1588 for Linux. The dual design
  goals are to provide a robust implementation of the standard and to
  use the most relevant and modern Application Programming Interfaces
  (API) offered by the Linux kernel. Supporting legacy APIs and other
  platforms is not a goal.

* License

  The software is copyrighted by the authors and is licensed under the
  GNU General Public License. See the file, COPYING, for details of
  the license terms.

* Features

  - Supports hardware and software time stamping via the Linux
    SO_TIMESTAMPING socket option.

  - Supports the Linux PTP Hardware Clock (PHC) subsystem by using the
    clock_gettime family of calls, including the new clock_adjtimex
    system call.

  - Implements Boundary Clock (BC) and Ordinary Clock (OC).

  - Transport over UDP/IPv4, UDP/IPv6, and raw Ethernet (Layer 2).

  - Supports IEEE 802.1AS-2011 in the role of end station.

  - Modular design allowing painless addition of new transports and
    clock servos.

* Getting the Code

  You can download the latest released version at Source Forge.

  http://sourceforge.net/projects/linuxptp/files/latest/download

  The source code is managed using the git version control system. To
  get your own copy of the project sources, use the following command.

#+BEGIN_EXAMPLE
  git clone git://git.code.sf.net/p/linuxptp/code linuxptp
#+END_EXAMPLE

  If the git protocol is blocked by your local area network, then you
  can use the alternative HTTP protocol instead.

#+BEGIN_EXAMPLE
  git clone http://git.code.sf.net/p/linuxptp/code linuxptp
#+END_EXAMPLE

* System Requirements

  In order to run this software, you need Linux kernel
  version 3.0 or newer, and the kernel header files must available at
  compile time.

  In addition, you will also need to have either:

  1. A supported Ethernet MAC device.

  2. A supported PHY device paired with a MAC that allows time
     stamping in the PHY (indicated by PHY=Y in the table below).

** Linux Kernel Support

   In order to support PTP, the operating system needs to provide two
   services: network packet time stamping and clock control. In 2009,
   Patrick Ohly added a new socket option called SO_TIMESTAMPING for
   packet time stamping, especially for PTP. This work appeared in
   Linux version 2.6.30.

   In July of 2011, the PTP Hardware Clock (PHC) subsystem was merged
   into Linux version 3.0. The PHC code provides a driver framework and
   the user space API for clock control.

** Ethtool Support

   Starting with version 3.5 of the Linux kernel, you can query the
   time stamping capabilities of a network interface using the
   ETHTOOL_GET_TS_INFO ioctl. Using ethtool version 3.4 or later, you
   can check your system's time stamping support as shown in the
   following example.

#+BEGIN_EXAMPLE
  ethtool -T eth0
#+END_EXAMPLE

   If the ethtool ioctl is available, then the ptp4l program will use
   it in order to discover the proper PHC device.

** Driver Support Matrix

   The table below shows the Linux drivers that support the new
   API. The meaning of the column abbreviations is as follows.

   - SOTS: SO_TIMESTAMPING support. This comes in three flavors.

     1. RAW: Supports time stamping using the PHC time values.
     2. SW:  Supports software time stamping using the system time.
     3. SYS: Supports time stamping using PHC time values scaled to
             the system time. This is a legacy mode and its use in new
             drivers is discouraged.

   - PHC: PTP Hardware Clock support.  These drivers will offer a
     character device that allows direct control of the hardware
     clock.

   - PHY: Supports time stamping in the PHY. This indicates an
     Ethernet MAC driver supporting SO_TIMESTAMPING and PHC in the
     PHY. If you have or build a computer that combines this MAC with
     a PTP capable PHY, then it will work with the Linux PHC
     subsystem.

   - VER: Linux kernel version when the PTP API support was added.

*** Hardware Timestamping

    |------------+-------------------------+------+-----+-----+-----|
    | Driver     | Hardware                | SOTS | PHC | PHY | VER |
    |------------+-------------------------+------+-----+-----+-----|
    | bfin_mac   | Analog Blackfin         | RAW  | Y   | NA  | 3.8 |
    | e1000e     | Intel 82574, 82583      | RAW  | Y   | NA  | 3.9 |
    | fec        | Freescale i.mx6         | RAW  | Y   | NA  | 3.8 |
    | gianfar    | Freescale eTSEC PowerPC | RAW  | Y   | NA  | 3.0 |
    | igb        | Intel 82576, 82580      | RAW  | Y   | NA  | 3.5 |
    | ixgbe      | Intel 82599             | RAW  | Y   | NA  | 3.5 |
    | dp83640    | Nat Semi PHYTER         | RAW  | Y   | NA  | 3.0 |
    | ptp_ixp46x | Intel IXP465            | RAW  | Y   | NA  | 3.0 |
    | ptp_phc    | Lapis EG20T PCH         | RAW  | Y   | NA  | 3.5 |
    | sfc        | Solarflare SFC9000      | RAW  | Y   | NA  | 3.7 |
    |------------+-------------------------+------+-----+-----+-----|

*** Software Timestamping

    |--------------+--------------------------+------+-----+-----+-----|
    | Driver       | Hardware                 | SOTS | PHC | PHY | VER |
    |--------------+--------------------------+------+-----+-----+-----|
    | bnx2x        | Broadcom Everest         | SW   | N   | N   | 3.5 |
    | davinci_emac | TI DaVinci, Sitara       | SW   | N   | Y   | 3.1 |
    | dnet         | Dave Ethernet MAC        | SW   | N   | Y   | 3.1 |
    | e100         | Intel PRO/100            | SW   | N   | N   | 3.5 |
    | e1000        | Intel PRO/1000 PCI/PCI-X | SW   | N   | N   | 3.5 |
    | e1000e       | Intel PRO/1000 PCIe      | SW   | N   | N   | 3.5 |
    | emaclite     | Xilinx Ethernet Lite     | SW   | N   | Y   | 3.1 |
    | ethoc        | OpenCores 10/100 MAC     | SW   | N   | Y   | 3.1 |
    | fec          | Freescale Coldfire       | SW   | N   | Y   | 3.1 |
    | fec_mpc52xx  | Freescale MPC5200        | SW   | N   | Y   | 3.1 |
    | forcedeth    | NVIDIA nForce            | SW   | N   | N   | 3.5 |
    | fs_enet      | Freescale MPC512x        | SW   | N   | Y   | 3.1 |
    | ixp4xx_eth   | Intel IXP4xx             | SW   | N   | Y   | 3.0 |
    | lib8390      | Asix AX88796             | SW   | N   | Y   | 3.1 |
    | lib8390      | Various 8390 based HW    | SW   | N   | N   | 3.1 |
    | ll_temac     | Xilinx LL TEMAC          | SW   | N   | Y   | 3.1 |
    | macb         | Atmel AT32, AT91         | SW   | N   | Y   | 3.1 |
    | mv643xx_eth  | Marvell Discovery, Orion | SW   | N   | Y   | 3.1 |
    | pxa168_eth   | Marvell pxa168           | SW   | N   | Y   | 3.1 |
    | r6040        | RDC Ethernet MAC         | SW   | N   | Y   | 3.1 |
    | r8169        | Realtek 8169/8168/8101   | SW   | N   | N   | 3.4 |
    | smsc911x     | SMSC LAN911x, LAN921x    | SW   | N   | Y   | 3.1 |
    | smsc9420     | SMSC LAN9420 PCI         | SW   | N   | Y   | 3.1 |
    | stmmac       | STM Synopsys IP Core     | SW   | N   | Y   | 3.1 |
    | tg3          | Broadcom Tigon3 PCI      | SW   | N   | Y   | 3.1 |
    | ucc_geth     | Freescale QE Gigabit     | SW   | N   | Y   | 3.1 |
    | usbnet       | USB network devices      | SW   | N   | Y/N | 3.2 |
    |--------------+--------------------------+------+-----+-----+-----|

* Installation

** Linux kernel

   There are many ways of getting a precompiled Linux kernel or
   compiling your own, so this section is only meant as an example. It
   is important to have the kernel headers available when compiling
   the Linux PTP stack.

#+BEGIN_EXAMPLE
   export ARCH=x86
   export CROSS_COMPILE=
   export KBUILD_OUTPUT=/home/richard/kernel/ptp_debian
   mkdir -p $KBUILD_OUTPUT
   cp /boot/config-2.6.38-bpo.2-686 $KBUILD_OUTPUT/.config
   make oldnoconfig
   make menuconfig
   time make -j4
   make headers_install
#+END_EXAMPLE

   Here is a table of kernel configuration options needed for PTP
   support. In addtion to these, you should enable the specific
   Ethernet MAC and PHY drivers for your hardware.

   |---------------------------------+-----------------------------|
   | Option                          | Description                 |
   |---------------------------------+-----------------------------|
   | CONFIG_PPS                      | Required                    |
   | CONFIG_NETWORK_PHY_TIMESTAMPING | Timestamping in PHY devices |
   | PTP_1588_CLOCK                  | PTP clock support           |
   |---------------------------------+-----------------------------|

** PTP stack

   1. Just type 'make'

   2. If you compiled your own kernel (and the headers are not
      installed into the system path), then you should set the
      KBUILD_OUTPUT environment variable as in the example, above.

   3. In order to install the programs and man pages into /usr/local,
      run the 'make install' target. You can change the installation
      directories by setttings the variables prefix, sbindir, mandir,
      and man8dir on the make command line.

* Getting Involved

  The software development is hosted at Source Forge.

  https://sourceforge.net/projects/linuxptp/

** Reporting Bugs

   Please report any bugs or other issues with the software to the
   linuxptp-users mailing list.

   https://lists.sourceforge.net/lists/listinfo/linuxptp-users

** Development

   If you would like to get involved in improving the software, please
   join the linuxptp-devel mailing list.

   https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

* Thanks

  Thanks to AudioScience Inc for sponsoring the 8021.AS support.

  - http://www.audioscience.com

  Thanks to Intel Corporation for donating four NICs, the 82574,
  82580, 82599, and the i210.

  - http://www.intel.com
  - http://e1000.sourceforge.net

  For testing I use an OTMC 100 grandmaster clock donated by OMICRON Lab.

  - http://www.omicron-lab.com/ptp
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.