netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v8 0/2] Enable RX HW timestamp for PTP packets using CPTS FIFO
@ 2024-04-19  8:26 Chintan Vankar
  2024-04-19  8:26 ` [PATCH net-next v8 1/2] net: ethernet: ti: am65-cpts: " Chintan Vankar
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Chintan Vankar @ 2024-04-19  8:26 UTC (permalink / raw)
  To: Julien Panis, Arnd Bergmann, Dan Carpenter, Heiner Kallweit,
	Chintan Vankar, Vladimir Oltean, Andrew Lunn, Roger Quadros,
	Richard Cochran, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, s-vadapalli
  Cc: linux-kernel, netdev

The CPSW offers two mechanisms for communicating packet ingress timestamp
information to the host.

The first mechanism is via the CPTS Event FIFO which records timestamp
when triggered by certain events. One such event is the reception of an
Ethernet packet with a specified EtherType field. This is used to capture
ingress timestamps for PTP packets. With this mechanism the host must
read the timestamp (from the CPTS FIFO) separately from the packet payload
which is delivered via DMA.

In the second mechanism of timestamping, CPSW 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 is responsible for triggering errata i2401:
"CPSW: Host Timestamps Cause CPSW Port to Lock up."

The errata affects all K3 SoCs. Link to errata for AM64x:
https://www.ti.com/lit/er/sprz457h/sprz457h.pdf

As a workaround we can use first mechanism to timestamp received
packets.

Series is based on linux-next tagged next-20240419.

Link to v7:
https://lore.kernel.org/r/20240417120913.3811519-1-c-vankar@ti.com/

Changes from v7 to v8:
- Removed empty lines between trailers in [PATCH v7 2/2] as suggested
  by Jakub.

Chintan Vankar (2):
  net: ethernet: ti: am65-cpts: Enable RX HW timestamp for PTP packets
    using CPTS FIFO
  net: ethernet: ti: am65-cpsw/ethtool: Enable RX HW timestamp only for
    PTP packets

 drivers/net/ethernet/ti/am65-cpsw-ethtool.c |  13 ++-
 drivers/net/ethernet/ti/am65-cpsw-nuss.c    |  51 +++++-----
 drivers/net/ethernet/ti/am65-cpts.c         | 107 ++++++++++++++------
 drivers/net/ethernet/ti/am65-cpts.h         |  11 +-
 4 files changed, 118 insertions(+), 64 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-23 10:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-19  8:26 [PATCH net-next v8 0/2] Enable RX HW timestamp for PTP packets using CPTS FIFO Chintan Vankar
2024-04-19  8:26 ` [PATCH net-next v8 1/2] net: ethernet: ti: am65-cpts: " Chintan Vankar
2024-04-19  8:26 ` [PATCH net-next v8 2/2] net: ethernet: ti: am65-cpsw/ethtool: Enable RX HW timestamp only for PTP packets Chintan Vankar
2024-04-22 11:39 ` [PATCH net-next v8 0/2] Enable RX HW timestamp for PTP packets using CPTS FIFO Chintan Vankar
2024-04-22 18:44   ` Jakub Kicinski
2024-04-23 10:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).