* [PATCH] net: ti: am65-cpsw: Update hw timestamping filter for PTPv1 RX packets
@ 2025-09-17 4:14 vishnu singh
2025-09-17 11:08 ` Vadim Fedorenko
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: vishnu singh @ 2025-09-17 4:14 UTC (permalink / raw)
To: andrew+netdev, davem, edumazet, kuba, pabeni, richardcochran,
rogerq, horms, mwalle, alexander.sverdlin, npitre, netdev,
linux-kernel
Cc: c-vankar
From: Vishnu Singh <v-singh1@ti.com>
CPTS module of CPSW supports hardware timestamping of PTPv1 packets.Update
the "hwtstamp_rx_filters" of CPSW driver to enable timestamping of received
PTPv1 packets. Also update the advertised capability to include PTPv1.
Signed-off-by: Vishnu Singh <v-singh1@ti.com>
---
drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 27 ++++++++++++---------
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 9 ++++---
2 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
index 9032444435e9..c57497074ae6 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-ethtool.c
@@ -694,17 +694,20 @@ static int am65_cpsw_get_ethtool_ts_info(struct net_device *ndev,
struct kernel_ethtool_ts_info *info)
{
struct am65_cpsw_common *common = am65_ndev_to_common(ndev);
- unsigned int ptp_v2_filter;
-
- ptp_v2_filter = BIT(HWTSTAMP_FILTER_PTP_V2_L4_EVENT) |
- BIT(HWTSTAMP_FILTER_PTP_V2_L4_SYNC) |
- BIT(HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ) |
- BIT(HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
- BIT(HWTSTAMP_FILTER_PTP_V2_L2_SYNC) |
- BIT(HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ) |
- BIT(HWTSTAMP_FILTER_PTP_V2_EVENT) |
- BIT(HWTSTAMP_FILTER_PTP_V2_SYNC) |
- BIT(HWTSTAMP_FILTER_PTP_V2_DELAY_REQ);
+ unsigned int ptp_filter;
+
+ ptp_filter = BIT(HWTSTAMP_FILTER_PTP_V2_L4_EVENT) |
+ BIT(HWTSTAMP_FILTER_PTP_V2_L4_SYNC) |
+ BIT(HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ) |
+ BIT(HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
+ BIT(HWTSTAMP_FILTER_PTP_V2_L2_SYNC) |
+ BIT(HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ) |
+ BIT(HWTSTAMP_FILTER_PTP_V2_EVENT) |
+ BIT(HWTSTAMP_FILTER_PTP_V2_SYNC) |
+ BIT(HWTSTAMP_FILTER_PTP_V2_DELAY_REQ) |
+ BIT(HWTSTAMP_FILTER_PTP_V1_L4_EVENT) |
+ BIT(HWTSTAMP_FILTER_PTP_V1_L4_SYNC) |
+ BIT(HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ);
if (!IS_ENABLED(CONFIG_TI_K3_AM65_CPTS))
return ethtool_op_get_ts_info(ndev, info);
@@ -716,7 +719,7 @@ static int am65_cpsw_get_ethtool_ts_info(struct net_device *ndev,
SOF_TIMESTAMPING_RAW_HARDWARE;
info->phc_index = am65_cpts_phc_index(common->cpts);
info->tx_types = BIT(HWTSTAMP_TX_OFF) | BIT(HWTSTAMP_TX_ON);
- info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) | ptp_v2_filter;
+ info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) | ptp_filter;
return 0;
}
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 8b2364f5f731..110eb2da8dbc 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -1813,6 +1813,9 @@ static int am65_cpsw_nuss_hwtstamp_set(struct net_device *ndev,
case HWTSTAMP_FILTER_NONE:
port->rx_ts_enabled = false;
break;
+ case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
+ case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
+ case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
@@ -1823,7 +1826,7 @@ static int am65_cpsw_nuss_hwtstamp_set(struct net_device *ndev,
case HWTSTAMP_FILTER_PTP_V2_SYNC:
case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
port->rx_ts_enabled = true;
- cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
+ cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT | HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
break;
case HWTSTAMP_FILTER_ALL:
case HWTSTAMP_FILTER_SOME:
@@ -1884,8 +1887,8 @@ static int am65_cpsw_nuss_hwtstamp_get(struct net_device *ndev,
cfg.flags = 0;
cfg.tx_type = port->tx_ts_enabled ?
HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF;
- cfg.rx_filter = port->rx_ts_enabled ?
- HWTSTAMP_FILTER_PTP_V2_EVENT : HWTSTAMP_FILTER_NONE;
+ cfg.rx_filter = port->rx_ts_enabled ? HWTSTAMP_FILTER_PTP_V2_EVENT |
+ HWTSTAMP_FILTER_PTP_V1_L4_EVENT : HWTSTAMP_FILTER_NONE;
return copy_to_user(ifr->ifr_data, &cfg, sizeof(cfg)) ? -EFAULT : 0;
}
--
2.50.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net: ti: am65-cpsw: Update hw timestamping filter for PTPv1 RX packets
2025-09-17 4:14 [PATCH] net: ti: am65-cpsw: Update hw timestamping filter for PTPv1 RX packets vishnu singh
@ 2025-09-17 11:08 ` Vadim Fedorenko
2025-09-17 11:49 ` MD Danish Anwar
2025-09-18 22:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Vadim Fedorenko @ 2025-09-17 11:08 UTC (permalink / raw)
To: vishnu singh, andrew+netdev, davem, edumazet, kuba, pabeni,
richardcochran, rogerq, horms, mwalle, alexander.sverdlin, npitre,
netdev, linux-kernel
Cc: c-vankar
On 17/09/2025 05:14, vishnu singh wrote:
> From: Vishnu Singh <v-singh1@ti.com>
>
> CPTS module of CPSW supports hardware timestamping of PTPv1 packets.Update
> the "hwtstamp_rx_filters" of CPSW driver to enable timestamping of received
> PTPv1 packets. Also update the advertised capability to include PTPv1.
>
> Signed-off-by: Vishnu Singh <v-singh1@ti.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: ti: am65-cpsw: Update hw timestamping filter for PTPv1 RX packets
2025-09-17 4:14 [PATCH] net: ti: am65-cpsw: Update hw timestamping filter for PTPv1 RX packets vishnu singh
2025-09-17 11:08 ` Vadim Fedorenko
@ 2025-09-17 11:49 ` MD Danish Anwar
2025-09-18 22:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: MD Danish Anwar @ 2025-09-17 11:49 UTC (permalink / raw)
To: vishnu singh, andrew+netdev, davem, edumazet, kuba, pabeni,
richardcochran, rogerq, horms, mwalle, alexander.sverdlin, npitre,
netdev, linux-kernel
Cc: c-vankar
On 17/09/25 9:44 am, vishnu singh wrote:
> From: Vishnu Singh <v-singh1@ti.com>
>
> CPTS module of CPSW supports hardware timestamping of PTPv1 packets.Update
> the "hwtstamp_rx_filters" of CPSW driver to enable timestamping of received
> PTPv1 packets. Also update the advertised capability to include PTPv1.
>
> Signed-off-by: Vishnu Singh <v-singh1@ti.com>
Patch prefix should mention which tree you are targeting. Since this
looks like new feature and not a bug fix. Prefix should have been
"[PATCH net-next]". Please note that for future posting.
The patch however looks okay to me.
Reviewed-by: MD Danish Anwar <danishanwar@ti.com>
--
Thanks and Regards,
Danish
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: ti: am65-cpsw: Update hw timestamping filter for PTPv1 RX packets
2025-09-17 4:14 [PATCH] net: ti: am65-cpsw: Update hw timestamping filter for PTPv1 RX packets vishnu singh
2025-09-17 11:08 ` Vadim Fedorenko
2025-09-17 11:49 ` MD Danish Anwar
@ 2025-09-18 22:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-18 22:50 UTC (permalink / raw)
To: vishnu singh
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, richardcochran,
rogerq, horms, mwalle, alexander.sverdlin, npitre, netdev,
linux-kernel, c-vankar
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 17 Sep 2025 09:44:55 +0530 you wrote:
> From: Vishnu Singh <v-singh1@ti.com>
>
> CPTS module of CPSW supports hardware timestamping of PTPv1 packets.Update
> the "hwtstamp_rx_filters" of CPSW driver to enable timestamping of received
> PTPv1 packets. Also update the advertised capability to include PTPv1.
>
> Signed-off-by: Vishnu Singh <v-singh1@ti.com>
>
> [...]
Here is the summary with links:
- net: ti: am65-cpsw: Update hw timestamping filter for PTPv1 RX packets
https://git.kernel.org/netdev/net-next/c/97248adb5a3b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-18 22:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-17 4:14 [PATCH] net: ti: am65-cpsw: Update hw timestamping filter for PTPv1 RX packets vishnu singh
2025-09-17 11:08 ` Vadim Fedorenko
2025-09-17 11:49 ` MD Danish Anwar
2025-09-18 22:50 ` 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).