net: ethernet: ti: am65-cpsw/ethtool: Enable RX HW timestamp only for PTP packets
authorChintan Vankar <c-vankar@ti.com>
Fri, 19 Apr 2024 08:26:26 +0000 (13:56 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 23 Apr 2024 10:07:24 +0000 (12:07 +0200)
commitc03a6fd398269e345ee808cdced311fd01215c18
tree81f7b6959f22e50e621c6340f010227417043cb4
parentc459f606f66dfdb14aef5a7927c2f4b274682fee
net: ethernet: ti: am65-cpsw/ethtool: Enable RX HW timestamp only for PTP packets

In the current mechanism of timestamping, am65-cpsw-nuss driver
enables hardware timestamping for 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 causes CPSW Port to
Lock up.

To prevent port lock up, don't enable rx packet timestamping by
setting TSTAMP_EN bit in CPTS_CONTROL register. The workaround for
timestamping received packets is to utilize the CPTS Event FIFO
that records timestamps corresponding to certain events. The CPTS
module is configured to generate timestamps for Multicast Ethernet,
UDP/IPv4 and UDP/IPv6 PTP packets.

Update supported hwtstamp_rx_filters values for CPSW's timestamping
capability.

Fixes: b1f66a5bee07 ("net: ethernet: ti: am65-cpsw-nuss: enable packet timestamping support")
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/ti/am65-cpsw-ethtool.c
drivers/net/ethernet/ti/am65-cpsw-nuss.c
drivers/net/ethernet/ti/am65-cpts.c
drivers/net/ethernet/ti/am65-cpts.h