4.12.4 MAC Timestamping
Many MACs have special hardware dedicated to timestamping outbound and inbound packets. In this mode, the MAC assumes that the delay through the PHY is nearly constant. While PLCA has no impact on inbound packets, on transmitted packets, delay through the PLCA RS can range from 0, if the transmit packet arrives during the transmit opportunity, to as high as 39.6 μs, if the PLCA RS delay line is completely full. The LAN8670/1/2 incorporates a unique feature to allow the MAC to transmit PTP frames through the PLCA-enabled PHY without incurring any PLCA delay.
MAC transmit timestamping support requires that the pattern matcher is programmed to match the desired outbound packet, usually PTP SYNC. When this feature is enabled, any time that an outbound packet is detected that matches the pattern and will encounter a delay in the PLCA RS, the PHY will emulate a collision to the MAC causing the MAC to terminate transmission of the current packet, producing a JAM signal back off to wait to retransmit. The PLCA algorithm will then assert carrier sense to hold off the MAC from attempting to retransmit the packet until the back-off has expired. When the next PLCA transmit opportunity has arrived, the PHY will begin to transmit COMMIT symbols onto the network to claim the transmit opportunity while releasing carrier sense to the MAC. Once carrier sense has been released, the MAC will wait for the mandatory 9.6 μs inter-packet gap delay and retransmit the packet. This time the packet will be transmitted directly through the PLCA RS to the network without delay, allowing the MAC to capture an accurate time stamp of the packet’s departure to the network.
This mode of MAC timestamping support is enabled by setting the MAC Transmit Time Stamp Enable (MACTXTSE) bit in the Transmit Match Control (TXMCTL) Register. Pattern matching must be configured as above for the desired PTP message.