User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 521
UG585 (v1.11) September 27, 2016
Chapter 16: Gigabit Ethernet Controller
Example: BMCA
1. Compare the fields of the Announce frame received with that of the current grandmaster starting
with Priority1, progressing to the next field in the event of a tie.
2. The one with a higher priority becomes the new grandmaster.
16.4.4 PTP Packet Handling at the Master
Refer to IEEE 1588 Standard Specification for more information on packet formats and protocol.
1. Form and send Sync frames at regular intervals. For two-step clocks (as in the Zynq-7000
AP SoC) the originTimestamp field should be zero. The sequenceId should be 1 greater than the
sequenceId of the last Sync frame transmitted from the same master port. Refer to section
16.4.1 Overview for some examples on setting header fields.
2. Read and store exact time stamp for the transmitted Sync frame. The Controller generates an
interrupt on successful transmission of a Sync frame. The registers gem.ptp_tx_s and
gem.ptp_tx_ns are read and stored to represent the exact time stamp for the transmitted Sync
frame in the interrupt handler.
3. Form and send the Follow_Up frame immediately after the successful transmission of the
Sync frame. The sequenceId should be the same as that of the just transmitted Sync frame. The
10 byte preciseOriginTimestamp field should be created using the stored seconds and
nanoseconds timestamp for the Sync frame. The Follow_Up frame is transmitted and since it is
not an event message, it is not time stamped by the hardware.
Note: The clock time stamp point for the AP SoC’s GigE is the MII interface. Since the Sync frame
travels through the external PHY after this time stamp point, the hardware observed time stamp
does not take care of the delay introduced by the external PHY. Users should determine the
typical external PHY latencies for their systems and add the same to the preciseOriginTimestamp
field.
4. Form and send Announce frames at regular intervals. The Announce frame should be set with
the clock attributes for the PTP master clock. The Announce frame is transmitted and since it is
not an event message, it is not time stamped by the hardware.
5. Send PDelay_Req frames at regular intervals. The master, acting as a peer for the PDelay
measurement state machine must send PDelay_Req frames at regular intervals. The sequenceId
field is assigned with a value of 1 greater than the last sent PDelay_Req frame. The field
originTimestamp can typically be filled up with a zero value along with the reserved field.
6. Read and store the exact time stamp for the transmitted PDelay_Req frame. The controller
generates an interrupt on successful transmission of the PDelay_Req frame. The registers
gem.ptp_peer_tx_s and gem.ptp_peer_tx_ns are read and stored to represent the time stamp of
the transmitted PDelay_Req frame in the interrupt handler. Let this time stamp be t1.
Note: Since the clock time stamp point is the MII interface and the PDelay_Req frame travels
through the external PHY after this point, the exact time stamp should be created by adding the
introduced delays by the external PHY.
7. Store the time stamp for the received PDelay_Resp frame. The Master receives a PDelay_Resp
frame from the peer clock. The controller generates a PDelay_Resp received interrupt. The master
reads the registers gem.ptp_peer_rx_s and gem.ptp_peer_rx_ns registers and stores them as the
received timestamp for the PDelay_Resp frame. Let this timestamp be t4.