4.12.2 Identifying PTP Packets for Timestamping
The LAN8670/1/2 supports the implementation of PTP over Ethernet within the station’s host controller by being able to detect the exact time of transmission and reception of PTP messages. This is done by examining the bytes of a packet that contain the EtherType and the first 2 bytes of the PTP header, and signaling when the correct pattern is detected.
To configure the desired pattern on transmitted packets, the most significant byte of the desired value is written into the Transmit Match Pattern High (TXMPATH) register and the lower two octets of the match value is written into the Transmit Match Pattern Low (TXMPATL) register. As an example, to match on a SYNC message, the EtherType value of 0x88F7 and PTP header value of 0x10 creates a 24-bit match value of 0x88F710. The value 0x88 is written into TXMPATH and the value 0xF710 is written into TXMPATL.
Configuring the receive pattern matcher is done in a similar manner but using Receive Match Pattern High (RXMPATH) register and Receive Match Pattern Low (RXMPATL) register.
Pattern matching can be used to support time synchronization in two different ways. Pattern match output pins can be used on both transmitted and received packets. MAC Transmit Time Stamp works directly with certain MACs. These are described in the next sections.