Blame README.org

Packit 9c3e7e
Packit 9c3e7e
* Introduction
Packit 9c3e7e
Packit 9c3e7e
  This software is an implementation of the Precision Time Protocol
Packit 9c3e7e
  (PTP) according to IEEE standard 1588 for Linux. The dual design
Packit 9c3e7e
  goals are to provide a robust implementation of the standard and to
Packit 9c3e7e
  use the most relevant and modern Application Programming Interfaces
Packit 9c3e7e
  (API) offered by the Linux kernel. Supporting legacy APIs and other
Packit 9c3e7e
  platforms is not a goal.
Packit 9c3e7e
Packit 9c3e7e
* License
Packit 9c3e7e
Packit 9c3e7e
  The software is copyrighted by the authors and is licensed under the
Packit 9c3e7e
  GNU General Public License. See the file, COPYING, for details of
Packit 9c3e7e
  the license terms.
Packit 9c3e7e
Packit 9c3e7e
* Features
Packit 9c3e7e
Packit 9c3e7e
  - Supports hardware and software time stamping via the Linux
Packit 9c3e7e
    SO_TIMESTAMPING socket option.
Packit 9c3e7e
Packit 9c3e7e
  - Supports the Linux PTP Hardware Clock (PHC) subsystem by using the
Packit 9c3e7e
    clock_gettime family of calls, including the new clock_adjtimex
Packit 9c3e7e
    system call.
Packit 9c3e7e
Packit 9c3e7e
  - Implements Boundary Clock (BC) and Ordinary Clock (OC).
Packit 9c3e7e
Packit 9c3e7e
  - Transport over UDP/IPv4, UDP/IPv6, and raw Ethernet (Layer 2).
Packit 9c3e7e
Packit 9c3e7e
  - Supports IEEE 802.1AS-2011 in the role of end station.
Packit 9c3e7e
Packit 9c3e7e
  - Modular design allowing painless addition of new transports and
Packit 9c3e7e
    clock servos.
Packit 9c3e7e
Packit 9c3e7e
* Getting the Code
Packit 9c3e7e
Packit 9c3e7e
  You can download the latest released version at Source Forge.
Packit 9c3e7e
Packit 9c3e7e
  http://sourceforge.net/projects/linuxptp/files/latest/download
Packit 9c3e7e
Packit 9c3e7e
  The source code is managed using the git version control system. To
Packit 9c3e7e
  get your own copy of the project sources, use the following command.
Packit 9c3e7e
Packit 9c3e7e
#+BEGIN_EXAMPLE
Packit 9c3e7e
  git clone git://git.code.sf.net/p/linuxptp/code linuxptp
Packit 9c3e7e
#+END_EXAMPLE
Packit 9c3e7e
Packit 9c3e7e
  If the git protocol is blocked by your local area network, then you
Packit 9c3e7e
  can use the alternative HTTP protocol instead.
Packit 9c3e7e
Packit 9c3e7e
#+BEGIN_EXAMPLE
Packit 9c3e7e
  git clone http://git.code.sf.net/p/linuxptp/code linuxptp
Packit 9c3e7e
#+END_EXAMPLE
Packit 9c3e7e
Packit 9c3e7e
* System Requirements
Packit 9c3e7e
Packit 9c3e7e
  In order to run this software, you need Linux kernel
Packit 9c3e7e
  version 3.0 or newer, and the kernel header files must available at
Packit 9c3e7e
  compile time.
Packit 9c3e7e
Packit 9c3e7e
  In addition, you will also need to have either:
Packit 9c3e7e
Packit 9c3e7e
  1. A supported Ethernet MAC device.
Packit 9c3e7e
Packit 9c3e7e
  2. A supported PHY device paired with a MAC that allows time
Packit 9c3e7e
     stamping in the PHY (indicated by PHY=Y in the table below).
Packit 9c3e7e
Packit 9c3e7e
** Linux Kernel Support
Packit 9c3e7e
Packit 9c3e7e
   In order to support PTP, the operating system needs to provide two
Packit 9c3e7e
   services: network packet time stamping and clock control. In 2009,
Packit 9c3e7e
   Patrick Ohly added a new socket option called SO_TIMESTAMPING for
Packit 9c3e7e
   packet time stamping, especially for PTP. This work appeared in
Packit 9c3e7e
   Linux version 2.6.30.
Packit 9c3e7e
Packit 9c3e7e
   In July of 2011, the PTP Hardware Clock (PHC) subsystem was merged
Packit 9c3e7e
   into Linux version 3.0. The PHC code provides a driver framework and
Packit 9c3e7e
   the user space API for clock control.
Packit 9c3e7e
Packit 9c3e7e
** Ethtool Support
Packit 9c3e7e
Packit 9c3e7e
   Starting with version 3.5 of the Linux kernel, you can query the
Packit 9c3e7e
   time stamping capabilities of a network interface using the
Packit 9c3e7e
   ETHTOOL_GET_TS_INFO ioctl. Using ethtool version 3.4 or later, you
Packit 9c3e7e
   can check your system's time stamping support as shown in the
Packit 9c3e7e
   following example.
Packit 9c3e7e
Packit 9c3e7e
#+BEGIN_EXAMPLE
Packit 9c3e7e
  ethtool -T eth0
Packit 9c3e7e
#+END_EXAMPLE
Packit 9c3e7e
Packit 9c3e7e
   If the ethtool ioctl is available, then the ptp4l program will use
Packit 9c3e7e
   it in order to discover the proper PHC device.
Packit 9c3e7e
Packit 9c3e7e
** Driver Support Matrix
Packit 9c3e7e
Packit 9c3e7e
   The following two tables list the drivers that support the PHC
Packit 9c3e7e
   subsystem and the Linux kernel version when they first appeared.
Packit 9c3e7e
   These drivers will create a PHC device for controlling the hardware
Packit 9c3e7e
   clock.
Packit 9c3e7e
Packit 9c3e7e
*** Hardware Timestamping - PHY
Packit 9c3e7e
Packit 9c3e7e
    |---------+-------------------------------+---------|
Packit 9c3e7e
    | Driver  | Hardware                      | Version |
Packit 9c3e7e
    |---------+-------------------------------+---------|
Packit 9c3e7e
    | dp83640 | National Semiconductor PHYTER |     3.0 |
Packit 9c3e7e
    |---------+-------------------------------+---------|
Packit 9c3e7e
Packit 9c3e7e
*** Hardware Timestamping - MAC
Packit 9c3e7e
Packit 9c3e7e
    |------------+--------------------------+---------|
Packit 9c3e7e
    | Driver     | Hardware                 | Version |
Packit 9c3e7e
    |------------+--------------------------+---------|
Packit 9c3e7e
    | amd-xgbe   | AMD 10GbE Ethernet Soc   |    3.17 |
Packit 9c3e7e
    | bfin_mac   | Analog Blackfin          |     3.8 |
Packit 9c3e7e
    | bnx2x      | Broadcom NetXtremeII 10G |    3.18 |
Packit 9c3e7e
    | cpts       | Texas Instruments am335x |     3.8 |
Packit 9c3e7e
    | e1000e     | Intel 82574, 82583       |     3.9 |
Packit 9c3e7e
    | fm10k      | Intel FM10000            |    3.18 |
Packit 9c3e7e
    | fec        | Freescale i.mx6          |     3.8 |
Packit 9c3e7e
    | gianfar    | Freescale eTSEC PowerPC  |     3.0 |
Packit 9c3e7e
    | i40e       | Intel XL710 Family       |    3.14 |
Packit 9c3e7e
    | igb        | Intel 82576, 82580       |     3.5 |
Packit 9c3e7e
    | ixgbe      | Intel 82599              |     3.5 |
Packit 9c3e7e
    | mlx4       | Mellanox 40G PCI         |    3.14 |
Packit 9c3e7e
    | ptp_ixp46x | Intel IXP465             |     3.0 |
Packit 9c3e7e
    | ptp_phc    | Lapis EG20T PCH          |     3.5 |
Packit 9c3e7e
    | sfc        | Solarflare SFC9000       |     3.7 |
Packit 9c3e7e
    | stmmac     | STM Synopsys IP Core     |    3.10 |
Packit 9c3e7e
    | tg3        | Broadcom Tigon3 PCI      |     3.8 |
Packit 9c3e7e
    | tilegx     | Tilera GBE/XGBE          |    3.12 |
Packit 9c3e7e
    |------------+--------------------------+---------|
Packit 9c3e7e
Packit 9c3e7e
*** Software Timestamping
Packit 9c3e7e
Packit 9c3e7e
    The table below shows the Linux drivers that support software time
Packit 9c3e7e
    stamping. In addition, the 'PHY' column indicates whether the
Packit 9c3e7e
    Ethernet MAC driver can support a PTP Hardware Clock in an
Packit 9c3e7e
    external PHY. The letter 'Y' in this column means that if you
Packit 9c3e7e
    design a mother board that combines such a MAC with a PTP capable
Packit 9c3e7e
    PHY, then it will work with the Linux PHC subsystem.
Packit 9c3e7e
Packit 9c3e7e
    |--------------+--------------------------+---------+-----|
Packit 9c3e7e
    | Driver       | Hardware                 | Version | PHY |
Packit 9c3e7e
    |--------------+--------------------------+---------+-----|
Packit 9c3e7e
    | 3c59x        | 3Com EtherLink PCI       |    3.14 | N   |
Packit 9c3e7e
    | altera_tse   | Altera Triple-Speed MAC  |    3.15 | Y   |
Packit 9c3e7e
    | bna          | Brocade 1010/1020 10Gb   |    3.14 | N   |
Packit 9c3e7e
    | bnx2x        | Broadcom Everest         |     3.5 | N   |
Packit 9c3e7e
    | davinci_emac | TI DaVinci, Sitara       |     3.1 | Y   |
Packit 9c3e7e
    | dnet         | Dave Ethernet MAC        |     3.1 | Y   |
Packit 9c3e7e
    | e100         | Intel PRO/100            |     3.5 | N   |
Packit 9c3e7e
    | e1000        | Intel PRO/1000 PCI/PCI-X |     3.5 | N   |
Packit 9c3e7e
    | e1000e       | Intel PRO/1000 PCIe      |     3.5 | N   |
Packit 9c3e7e
    | emaclite     | Xilinx Ethernet Lite     |     3.1 | Y   |
Packit 9c3e7e
    | ethoc        | OpenCores 10/100 MAC     |     3.1 | Y   |
Packit 9c3e7e
    | fec          | Freescale Coldfire       |     3.1 | Y   |
Packit 9c3e7e
    | fec_mpc52xx  | Freescale MPC5200        |     3.1 | Y   |
Packit 9c3e7e
    | forcedeth    | NVIDIA nForce            |     3.5 | N   |
Packit 9c3e7e
    | fs_enet      | Freescale MPC512x        |     3.1 | Y   |
Packit 9c3e7e
    | genet        | Broadcom GENET           |    3.15 | Y   |
Packit 9c3e7e
    | ixp4xx_eth   | Intel IXP4xx             |     3.0 | Y   |
Packit 9c3e7e
    | lib8390      | Asix AX88796             |     3.1 | Y   |
Packit 9c3e7e
    | lib8390      | Various 8390 based HW    |     3.1 | N   |
Packit 9c3e7e
    | ll_temac     | Xilinx LL TEMAC          |     3.1 | Y   |
Packit 9c3e7e
    | macb         | Atmel AT32, AT91         |     3.1 | Y   |
Packit 9c3e7e
    | mv643xx_eth  | Marvell Discovery, Orion |     3.1 | Y   |
Packit 9c3e7e
    | pxa168_eth   | Marvell pxa168           |     3.1 | Y   |
Packit 9c3e7e
    | r6040        | RDC Ethernet MAC         |     3.1 | Y   |
Packit 9c3e7e
    | r8169        | Realtek 8169/8168/8101   |     3.4 | N   |
Packit 9c3e7e
    | samsun-sxgbe | Samsung SXGBE 10G        |    3.15 | Y   |
Packit 9c3e7e
    | smsc911x     | SMSC LAN911x, LAN921x    |     3.1 | Y   |
Packit 9c3e7e
    | smsc9420     | SMSC LAN9420 PCI         |     3.1 | Y   |
Packit 9c3e7e
    | stmmac       | STM Synopsys IP Core     |     3.1 | Y   |
Packit 9c3e7e
    | tg3          | Broadcom Tigon3 PCI      |     3.1 | Y   |
Packit 9c3e7e
    | ucc_geth     | Freescale QE Gigabit     |     3.1 | Y   |
Packit 9c3e7e
    | usbnet       | USB network devices      |     3.2 | Y/N |
Packit 9c3e7e
    | xgene-enet   | APM X-Gene SoC           |    3.17 | Y   |
Packit 9c3e7e
    |--------------+--------------------------+---------+-----|
Packit 9c3e7e
Packit 9c3e7e
* Installation
Packit 9c3e7e
Packit 9c3e7e
** Linux kernel
Packit 9c3e7e
Packit 9c3e7e
   There are many ways of getting a precompiled Linux kernel or
Packit 9c3e7e
   compiling your own, so this section is only meant as an example. It
Packit 9c3e7e
   is important to have the kernel headers available when compiling
Packit 9c3e7e
   the Linux PTP stack.
Packit 9c3e7e
Packit 9c3e7e
#+BEGIN_EXAMPLE
Packit 9c3e7e
   export ARCH=x86
Packit 9c3e7e
   export CROSS_COMPILE=
Packit 9c3e7e
   export KBUILD_OUTPUT=/home/richard/kernel/ptp_debian
Packit 9c3e7e
   mkdir -p $KBUILD_OUTPUT
Packit 9c3e7e
   cp /boot/config-2.6.38-bpo.2-686 $KBUILD_OUTPUT/.config
Packit 9c3e7e
   make oldnoconfig
Packit 9c3e7e
   make menuconfig
Packit 9c3e7e
   time make -j4
Packit 9c3e7e
   make headers_install
Packit 9c3e7e
#+END_EXAMPLE
Packit 9c3e7e
Packit 9c3e7e
   Here is a table of kernel configuration options needed for PTP
Packit 9c3e7e
   support. In addtion to these, you should enable the specific
Packit 9c3e7e
   Ethernet MAC and PHY drivers for your hardware.
Packit 9c3e7e
Packit 9c3e7e
   |---------------------------------+-----------------------------|
Packit 9c3e7e
   | Option                          | Description                 |
Packit 9c3e7e
   |---------------------------------+-----------------------------|
Packit 9c3e7e
   | CONFIG_PPS                      | Required                    |
Packit 9c3e7e
   | CONFIG_NETWORK_PHY_TIMESTAMPING | Timestamping in PHY devices |
Packit 9c3e7e
   | PTP_1588_CLOCK                  | PTP clock support           |
Packit 9c3e7e
   |---------------------------------+-----------------------------|
Packit 9c3e7e
Packit 9c3e7e
** PTP stack
Packit 9c3e7e
Packit 9c3e7e
   1. Just type 'make'
Packit 9c3e7e
Packit 9c3e7e
   2. If you compiled your own kernel (and the headers are not
Packit 9c3e7e
      installed into the system path), then you should set the
Packit 9c3e7e
      KBUILD_OUTPUT environment variable as in the example, above.
Packit 9c3e7e
Packit 9c3e7e
   3. In order to install the programs and man pages into /usr/local,
Packit 9c3e7e
      run the 'make install' target. You can change the installation
Packit 9c3e7e
      directories by setttings the variables prefix, sbindir, mandir,
Packit 9c3e7e
      and man8dir on the make command line.
Packit 9c3e7e
Packit 9c3e7e
* Getting Involved
Packit 9c3e7e
Packit 9c3e7e
  The software development is hosted at Source Forge.
Packit 9c3e7e
Packit 9c3e7e
  https://sourceforge.net/projects/linuxptp/
Packit 9c3e7e
Packit 9c3e7e
** Reporting Bugs
Packit 9c3e7e
Packit 9c3e7e
   Please report any bugs or other issues with the software to the
Packit 9c3e7e
   linuxptp-users mailing list.
Packit 9c3e7e
Packit 9c3e7e
   https://lists.sourceforge.net/lists/listinfo/linuxptp-users
Packit 9c3e7e
Packit 9c3e7e
** Development
Packit 9c3e7e
Packit 9c3e7e
   If you would like to get involved in improving the software, please
Packit 9c3e7e
   join the linuxptp-devel mailing list.
Packit 9c3e7e
Packit 9c3e7e
   https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
Packit 9c3e7e
Packit 9c3e7e
*** Submitting Patches
Packit 9c3e7e
Packit 9c3e7e
   1. Before submitting patches, please make sure that you are starting
Packit 9c3e7e
      your work on the *current HEAD* of the git repository.
Packit 9c3e7e
Packit 9c3e7e
   2. Please checkout the ~CODING_STYLE.org~ file for guidelines on how to
Packit 9c3e7e
      properly format your code.
Packit 9c3e7e
Packit 9c3e7e
   3. Describe your changes. Each patch will be reviewed, and the reviewers
Packit 9c3e7e
      need to understand why you did what you did.
Packit 9c3e7e
Packit 9c3e7e
   4. *Sign-Off* each commit, so the changes can be properly attributed to
Packit 9c3e7e
      you and you explicitely give your agreement for distribution under
Packit 9c3e7e
      linuxptp's license. Signing-off is as simple as:
Packit 9c3e7e
Packit 9c3e7e
      #+BEGIN_EXAMPLE
Packit 9c3e7e
      git commit -s
Packit 9c3e7e
      #+END_EXAMPLE
Packit 9c3e7e
Packit 9c3e7e
      or by adding the following line (replace your real name and email)
Packit 9c3e7e
      to your patch:
Packit 9c3e7e
Packit 9c3e7e
      #+BEGIN_EXAMPLE
Packit 9c3e7e
      Signed-off-by: Random J Developer <random@developer.example.org>
Packit 9c3e7e
      #+END_EXAMPLE
Packit 9c3e7e
Packit 9c3e7e
   5. Finally, send your patches via email to the linuxptp-devel mailing
Packit 9c3e7e
      list, where they will be reviewed, and eventually be included in the
Packit 9c3e7e
      official code base.
Packit 9c3e7e
Packit 9c3e7e
      #+BEGIN_EXAMPLE
Packit 9c3e7e
      git send-email --to linuxptp-devel@lists.sourceforge.net origin/master
Packit 9c3e7e
      #+END_EXAMPLE
Packit 9c3e7e
Packit 9c3e7e
* Thanks
Packit 9c3e7e
Packit 9c3e7e
  Thanks to AudioScience Inc for sponsoring the 8021.AS support.
Packit 9c3e7e
Packit 9c3e7e
  - http://www.audioscience.com
Packit 9c3e7e
Packit 9c3e7e
  Thanks to Exablaze for donating an ExaNIC X10
Packit 9c3e7e
Packit 9c3e7e
  - http://exablaze.com/exanic-x10
Packit 9c3e7e
Packit 9c3e7e
  Thanks to Intel Corporation for donating four NICs, the 82574,
Packit 9c3e7e
  82580, 82599, and the i210.
Packit 9c3e7e
Packit 9c3e7e
  - http://www.intel.com
Packit 9c3e7e
  - http://e1000.sourceforge.net
Packit 9c3e7e
Packit 9c3e7e
  Thanks to Meinberg Funkuhren for donating a LANTIME M1000.
Packit 9c3e7e
Packit 9c3e7e
  - https://www.meinbergglobal.com
Packit 9c3e7e
Packit 9c3e7e
  For testing I use an OTMC 100 grandmaster clock donated by OMICRON Lab.
Packit 9c3e7e
Packit 9c3e7e
  - http://www.omicron-lab.com/ptp