lkml.org 
[lkml]   [2024]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH net-next v7 0/2] Enable RX HW timestamp for PTP packets using CPTS FIFO
Date
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-20240417.

Link to v6:
- Due to some issue in my email client cover-letter and [PATCH v6 1/1]
is missing from v6.

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

Changes from v6 to v7:
- No changes.

Changes from v5 to v6:
- Defined lockless variant of "am65_cpts_fifo_read()" as
"__am65_cpts_fifo_read()", suggested by Paolo to avoid acquiring the
same lock on cpts again in "am65_cpts_fifo_read()".
- Replaced "list_del_entry()" and "list_add()" functions with equivalent
"list_move()" function.
- Replaced "list_del_init()" and "list_add_tail()" functions with
equivalent "list_move_tail()" function.

This changes are done as per the discussion at here:
https://lore.kernel.org/r/7c8be16329668d343a971e265e923543cba5e304.camel@redhat.com/

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


\
 
 \ /
  Last update: 2024-04-17 14:10    [W:0.086 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site