PTP/IEEE1588

1. Introduction

This document describes PTP related configuration and get of status information. This covers multiple PTP profiles:

  • gPTP

  • automotive gPTP

2. Generate 1PPS output

Configure the HW to generate a 1PPS on one of the PTP pins. This feature can be used for example to check that two different HWs are synchronized by checking the 1PPS and make sure that is aligned.

The 1PPS will be generated whenever the second part will increment. This will be generated regardless timestamping is enabled or not or even if there is a servo or not.

The 1PPS can be adjusted only when the local time counter is adjusted. For example when the frequency is increased or there is a jump in time. The local time counter can be adjusted only if there is a servo and that servo is in slave state. So if there is no servo then the local time will not be adjusted to any other remote GMs.

The ptp-pin that is used here is just an example and needs to be set according to the schematic of the board.

iPATCH request message:

- ? "/ieee1588-ptp:ptp/mchp-velocitysp-ptp:ltcs/ltc"
  : ltc-index: 1
    ptp-pins:
      ptp-pin:
      - index: 4
        function: 1pps-out

3. Disable 1PPS output

This will show how to stop generating 1PPS on that PTP port.

iPATCH request message:

- ? "/ieee1588-ptp:ptp/mchp-velocitysp-ptp:ltcs/ltc[ltc-index='1']"
  :

4. Add PTP instance with 1 port and a servo

Configure the HW to behave like a ordinary clock. In case the HW will become a follower then it would synchronize its own local time according to the grandmaster. Otherwise if the HW will become a GM then it would provide the time to the network.

iPATCH request message:

- ? "/ieee1588-ptp:ptp/instances/instance"
  : instance-index: 0
    ports:
      port:
      - port-index: 25
    mchp-velocitysp-ptp:servos:
      servo:
      - servo-index: 0
        servo-type: pi
        ltc-index: 0

5. Get PTP instance

Get the PTP instance and see all the status and all the default parameters

FETCH request message:

- "/ieee1588-ptp:ptp/instances/instance[instance-index='0']"

FETCH response message:

- ? "/ieee1588-ptp:ptp/instances/instance"
  : instance-index: 0
    default-ds:
      clock-identity: 00-11-22-FF-FE-33-44-00
      priority1: 246
      priority2: 248
      domain-number: 0
      instance-enable: true
      external-port-config-enable: false
      max-steps-removed: 255
      instance-type: relay
    parent-ds:
      parent-port-identity:
        clock-identity: 00-00-00-00-00-00-00-00
        port-number: 0
      grandmaster-identity: 00-11-22-FF-FE-33-44-00
      grandmaster-clock-quality:
        clock-class: ieee1588-ptp:cc-default
        clock-accuracy: mchp-velocitysp-ptp:ca-time-accurate-unknown
      grandmaster-priority1: 246
      grandmaster-priority2: 248
      ieee802-dot1as-ptp:cumulative-rate-ratio: 0
    ports:
      port:
      - port-index: 25
        port-ds:
          port-state: disabled
          mean-link-delay: '0'
          log-sync-interval: -3
          log-min-pdelay-req-interval: 0
          port-enable: true
          ieee802-dot1as-ptp:as-capable: false
          ieee802-dot1as-ptp:mean-link-delay-thresh: '52428800'
          ieee802-dot1as-ptp:neighbor-rate-ratio: 0
          ieee802-dot1as-ptp:sync-receipt-timeout: 3
          ieee802-dot1as-ptp:use-mgt-one-step-tx-oper: false
          ieee802-dot1as-ptp:mgt-one-step-tx-oper: 0
        timestamp-correction-port-ds:
          egress-latency: '0'
          ingress-latency: '0'
        external-port-config-port-ds:
          desired-state: disabled
    mchp-velocitysp-ptp:servos:
      servo:
      - servo-index: 0
        servo-type: pi
        ltc-index: 0
        offset: '0'
        state: 0
    mchp-velocitysp-ptp:automotive:
      profile: none
    mchp-velocitysp-ptp:l2:
      mac-address: 00-00-00-00-00-00
      mac-address-enable: false
      vlan: 0
      vlan-enable: false

When looking at the response there are some fields that are usufull to check both for status but also for debugging any issues:

  1. instance-enable: make sure that this is true (which is by default) otherwise the instance will not see any frames

  2. port-enable: make sure that this is true (which is by default) otherwise the port will not send or receive any frames.

  3. mean-link-delay: this will say what is the link delay between the port and the partner. The value is represented in nanoseconds with a 16 bit sub fractional port. If this value is bigger than the mean-link-delay-thresh then the port will not be as-capable meaning that the port state is disabled

  4. port-state: this will say what is the current port state. It can be in one of the following:

    1. master: it would send out SYNC and FOLLOW_UP frames with the information that it received on the slave port, or if the DUT is a GM with its own local timer.

    2. slave: it would receive SYNC and FOLLOW_UP frames from partner with the time information.

    3. disabled: the port will be in this state, if the port is not as-capable

    4. passive: the port will be in this state if there another port on the DUT that has the same information from the master.

  5. parent-port-identity: describes the partner port that send out the ANNOUNCE frame

  6. grandmaster-identity: describes the GM of the network

6. Delete PTP instance

Delete the PTP instance that was created.

iPATCH request message:

- ? "/ieee1588-ptp:ptp/instances/instance[instance-index='0']"
  :

7. Add relay with two ports

When adding multiple ports under a PTP instance and not having a servo then the PTP instance will behave as an relay as described in 802.1AS.

iPATCH request message:

- ? "/ieee1588-ptp:ptp/instances/instance"
  : instance-index: 0
    ports:
      port:
      - port-index: 25
      - port-index: 26
When operating in this mode the local time is not updated to any remove grandmasters.

8. Add relay with 2 ports and a servo

There are many cases where you want to be able to run different TSN protocols like TAS or PSFP on top of the relay. As the relay will not adjust the local time it is required to add an end node which will adjust the local time that is used by TAS.

iPATCH request message:

- ? "/ieee1588-ptp:ptp/instances/instance"
  : instance-index: 0
    ports:
      port:
      - port-index: 25
      - port-index: 26
    mchp-velocitysp-ptp:servos:
      servo:
      - servo-index: 0
        servo-type: pi
        ltc-index: 1

9. Add PTP instance enabling automotive bridge profile

There are cases when the Automotive Ethernet AVB Functional and Interoperability Specification(Auto GPTP) is need. The main differences between Auto GPTP and GPTP are:

  1. Grandmaster Information and Topology: there should not be any Announce messages in the topology as there is no BMCA running because it presumes that the topology doesn’t change and it is know from start which is the GM

  2. asCpable: If the port has a link, then it presumes that the port is asCapable, in this way it improves the bring up time of the network

  3. initialLogPdelayReqInterval: there is an initial interval of the peer delay request (1 frame per second) and it is using this interval until the mean path delay is stabalized. The standard doesn’t explain what means stabalized but in implementation it means 2 consecutive mean path delays to have the same value.

  4. operLogPdelayReqInterval: the interval of peer delay requests after the link has stablized. (1 frame every 2 second).

  5. syncReceiptTimeout: In case the AED-B stops receiving Sync frames, then it should continue to send out frames with the last received information, or if the AED-B doesn’t receive at all Sync frames from beginning then it is required for AED-B to start to send own Sync frames with a fix preciseOriginTimestamp.

To be able to configure that there is not a single configuration that needs to be set but multiple ones to get the full configuration.

Here is an example for configuring an automotive bridge

iPATCH request message:

- ? "/ieee1588-ptp:ptp/instances/instance"
  : instance-index: 0
    default-ds:
      external-port-config-enable: true
    mchp-velocitysp-ptp:automotive:
      profile: bridge
    ports:
      port:
      - port-index: 25
        external-port-config-port-ds:
          desired-state: slave
      - port-index: 26
        external-port-config-port-ds:
          desired-state: master

10. Add PTP instance enabling automotive grandmaster profile

This is similar with the previous configuration with the only difference being the automotive profile and the port states.

iPATCH request message:

- ? "/ieee1588-ptp:ptp/instances/instance"
  : instance-index: 0
    default-ds:
      external-port-config-enable: true
    mchp-velocitysp-ptp:automotive:
      profile: gm
    ports:
      port:
      - port-index: 25
        external-port-config-port-ds:
          desired-state: master
      - port-index: 26
        external-port-config-port-ds:
          desired-state: master

11. Allow to configure the MAC and VLAN to be used by PTP

There are configuration where is required to set a custom MAC address and add a VLAN tag.

iPATCH request message:

- ? "/ieee1588-ptp:ptp/instances/instance"
  : instance-index: 0
    mchp-velocitysp-ptp:l2:
      mac-address: 00-11-22-33-44-55
      mac-address-enable: true
      vlan: 100
      vlan-enable: true
    ports:
      port:
      - port-index: 25
      - port-index: 26

12. Enable transparent clock with 1-step transmission

There are configuration where is required to set the HW as transparent clock using 1-step timestamping. The only supported transparent clock is P2P-TC.

iPATCH request message:

- ? "/ieee1588-ptp:ptp/instances/instance"
  : instance-index: 0
    default-ds:
      instance-type: p2p-tc
    ports:
      port:
      - port-index: 25
        port-ds:
          ieee802-dot1as-ptp:use-mgt-one-step-tx-oper: true
          ieee802-dot1as-ptp:mgt-one-step-tx-oper: 1
      - port-index: 26
        port-ds:
          ieee802-dot1as-ptp:use-mgt-one-step-tx-oper: true
          ieee802-dot1as-ptp:mgt-one-step-tx-oper: 1