Thread View: linux.kernel.netdev
3 messages
3 total messages
Started by James Clark
Mon, 02 Nov 2026 13:51
[PATCH net] net: ethernet: ti: am65-cpsw-nuss: Enable timestamping of unicast PTP packets
Author: James Clark
Date: Mon, 02 Nov 2026 13:51
Date: Mon, 02 Nov 2026 13:51
54 lines
13582 bytes
13582 bytes
On a BeagleY-AI (J722S), ptp4l as a unicast master (unicast_listen) logs
"received DELAY_REQ without timestamp" for each unicast Delay_Req, and
its port goes to FAULTY after "timed out while polling for tx timestamp"
for the first unicast Sync.
am65_cpsw_nuss_hwtstamp_set() does not set the TS_UNI_EN bit (bit 24) of
the port's TS_CTL_LTYPE2 register. According to the TRM (J722S TRM
SPRUJB3D, 12.2.1.4.7.13.5.1 Ethernet Port Receive Event and
12.2.1.4.7.13.5.2 Ethernet Port Transmit Event), this bit must be set
for the port to timestamp PTP event messages over UDP sent to a unicast
address; without it, only messages sent to the PTP multicast addresses
selected by the TS_107 and TS_129 to TS_132 bits are timestamped. TI's
netcp_ethss driver for the Keystone 2 Ethernet switch, which has the
same timestamping registers, always sets TS_UNI_EN.
Set TS_UNI_EN along with the other bits. With this change, ptp4l in the
same setup gets timestamps for the unicast Delay_Req and Sync messages.
Fixes: b1f66a5bee07 ("net: ethernet: ti: am65-cpsw-nuss: enable packet timestamping support")
Cc: stable@vger.kernel.org
Signed-off-by: James Clark <jjc@jclark.com>
---
This was discovered while using ntpperf -D/-N to evaluate PTP hardware
timestamping performance. The patch was generated by an LLM coding
assistant.
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 2551554add17..9ed6644fd0bd 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -128,6 +128,7 @@
#define AM65_CPSW_PN_TS_CTL_LTYPE2_TS_319 BIT(21)
#define AM65_CPSW_PN_TS_CTL_LTYPE2_TS_320 BIT(22)
#define AM65_CPSW_PN_TS_CTL_LTYPE2_TS_TTL_NONZERO BIT(23)
+#define AM65_CPSW_PN_TS_CTL_LTYPE2_TS_UNI_EN BIT(24)
/* The PTP event messages - Sync, Delay_Req, Pdelay_Req, and Pdelay_Resp. */
#define AM65_CPSW_TS_EVENT_MSG_TYPE_BITS (BIT(0) | BIT(1) | BIT(2) | BIT(3))
@@ -1857,7 +1858,8 @@ static int am65_cpsw_nuss_hwtstamp_set(struct net_device *ndev,
AM65_CPSW_PN_TS_CTL_LTYPE2_TS_132 |
AM65_CPSW_PN_TS_CTL_LTYPE2_TS_319 |
AM65_CPSW_PN_TS_CTL_LTYPE2_TS_320 |
- AM65_CPSW_PN_TS_CTL_LTYPE2_TS_TTL_NONZERO;
+ AM65_CPSW_PN_TS_CTL_LTYPE2_TS_TTL_NONZERO |
+ AM65_CPSW_PN_TS_CTL_LTYPE2_TS_UNI_EN;
ts_ctrl = AM65_CPSW_TS_EVENT_MSG_TYPE_BITS <<
AM65_CPSW_PN_TS_CTL_MSG_TYPE_EN_SHIFT;
--
2.56.0
Re: [PATCH net] net: ethernet: ti: am65-cpsw-nuss: Enable timestamping of unicast PTP packets
Author: Sebastian Andrzej Siewior
Date: Tue, 03 Nov 2026 23:17
Date: Tue, 03 Nov 2026 23:17
46 lines
11741 bytes
11741 bytes
On 2026-11-02 20:51:17 [+0700], James Clark wrote:
> On a BeagleY-AI (J722S), ptp4l as a unicast master (unicast_listen) logs
> "received DELAY_REQ without timestamp" for each unicast Delay_Req, and
> its port goes to FAULTY after "timed out while polling for tx timestamp"
> for the first unicast Sync.
>
> am65_cpsw_nuss_hwtstamp_set() does not set the TS_UNI_EN bit (bit 24) of
> the port's TS_CTL_LTYPE2 register. According to the TRM (J722S TRM
> SPRUJB3D, 12.2.1.4.7.13.5.1 Ethernet Port Receive Event and
> 12.2.1.4.7.13.5.2 Ethernet Port Transmit Event), this bit must be set
> for the port to timestamp PTP event messages over UDP sent to a unicast
> address; without it, only messages sent to the PTP multicast addresses
> selected by the TS_107 and TS_129 to TS_132 bits are timestamped. TI's
> netcp_ethss driver for the Keystone 2 Ethernet switch, which has the
> same timestamping registers, always sets TS_UNI_EN.
>
> Set TS_UNI_EN along with the other bits. With this change, ptp4l in the
> same setup gets timestamps for the unicast Delay_Req and Sync messages.
>
> Fixes: b1f66a5bee07 ("net: ethernet: ti: am65-cpsw-nuss: enable packet timestamping support")
> Cc: stable@vger.kernel.org
> Signed-off-by: James Clark <jjc@jclark.com>
> ---
> This was discovered while using ntpperf -D/-N to evaluate PTP hardware
> timestamping performance. The patch was generated by an LLM coding
> assistant.
I have here a AM642 EVM and eth0 here uses am65-cpsw-nuss. I didn't
manage to get ntpperf up but
ptp4l -i eth0 configs/UNICAST-{MASTER|SLAVE}.cfg
uses UDPv4 and should do what you describe. But then I noticed that it
uses 224.0.1.129 as destination which is enabled by TS_129 and does not
look like a unicast address. Buh.
netcp_ethss sets TS_UNI_EN but it does not set the other TS_ bits. The
reference manual in Annex D (for am64x) describes how matching works but
it does not say if TS_UNI_EN should be enabled in addition to the other
TS_ bits, which match a specific address, or not. It just says it
matches either this with the specific bit set or anything with the UNI
bit.
It continues to work for MC with this bit set so
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Sebastian
Re: [PATCH net] net: ethernet: ti: am65-cpsw-nuss: Enable timestamping of unicast PTP packets
Author: patchwork-bot+netdevbpf
Date: Thu, 05 Nov 2026 10:30
Date: Thu, 05 Nov 2026 10:30
32 lines
9391 bytes
9391 bytes
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Mon, 2 Nov 2026 20:51:17 +0700 you wrote:
> On a BeagleY-AI (J722S), ptp4l as a unicast master (unicast_listen) logs
> "received DELAY_REQ without timestamp" for each unicast Delay_Req, and
> its port goes to FAULTY after "timed out while polling for tx timestamp"
> for the first unicast Sync.
>
> am65_cpsw_nuss_hwtstamp_set() does not set the TS_UNI_EN bit (bit 24) of
> the port's TS_CTL_LTYPE2 register. According to the TRM (J722S TRM
> SPRUJB3D, 12.2.1.4.7.13.5.1 Ethernet Port Receive Event and
> 12.2.1.4.7.13.5.2 Ethernet Port Transmit Event), this bit must be set
> for the port to timestamp PTP event messages over UDP sent to a unicast
> address; without it, only messages sent to the PTP multicast addresses
> selected by the TS_107 and TS_129 to TS_132 bits are timestamped. TI's
> netcp_ethss driver for the Keystone 2 Ethernet switch, which has the
> same timestamping registers, always sets TS_UNI_EN.
>
> [...]
Here is the summary with links:
- [net] net: ethernet: ti: am65-cpsw-nuss: Enable timestamping of unicast PTP packets
https://git.kernel.org/netdev/net/c/6887a8f98244
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads