Re: [PATCH net-next 2/2] net: ethernet: ti: am65-cpsw: Enable RX HW timestamp only for PTP packets

From: Chintan Vankar
Date: Fri Mar 01 2024 - 05:49:04 EST




On 17/02/24 03:51, Jacob Keller wrote:


On 2/15/2024 3:09 AM, Chintan Vankar wrote:
The CPSW peripherals on J7AHP, J7VCL, J7AEP, J7ES, AM64 SoCs have
an errata i2401 "CPSW: Host Timestamps Cause CPSW Port to Lock up".


What's different about timestamping only PTP packets that prevents this
port lock up?

The difference is the way we are timestamping the packets. Instead of
getting the timestamp from CPTS module, we are getting the timestamp
from CPTS Event FIFO.

In the current mechanism of timestamping, am65-cpsw-nuss driver
timestamps all received packets by setting the TSTAMP_EN bit in
CPTS_CONTROL register, which directs the CPTS module to timestamp all
received packets, followed by passing timestamp via DMA descriptors.
This mechanism was responsible for the CPSW port to lock up in certain
condition. We are preventing port lock up by disabling TSTAMP_EN bit in
CPTS_CONTROL register.

The mechanism we are following in this patch, utilizes the CPTS Event
FIFO that records timestamps corresponding to certain events, with one
such event being the reception of an Ethernet packet with EtherType
field set to PTP.