Skip to content

Commit 9780f53

Browse files
HoratiuVulturPaolo Abeni
authored andcommitted
net: lan966x: Fix the initialization of taprio
To initialize the taprio block in lan966x, it is required to configure the register REVISIT_DLY. The purpose of this register is to set the delay before revisit the next gate and the value of this register depends on the system clock. The problem is that the we calculated wrong the value of the system clock period in picoseconds. The actual system clock is ~165.617754MHZ and this correspond to a period of 6038 pico seconds and not 15125 as currently set. Fixes: e462b27 ("net: lan966x: Add offload support for taprio") Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251121061411.810571-1-horatiu.vultur@microchip.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 081156c commit 9780f53

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
// SPDX-License-Identifier: GPL-2.0+
22

33
#include <linux/ptp_classify.h>
4+
#include <linux/units.h>
45

56
#include "lan966x_main.h"
67
#include "vcap_api.h"
78
#include "vcap_api_client.h"
89

10+
#define LAN9X66_CLOCK_RATE 165617754
11+
912
#define LAN966X_MAX_PTP_ID 512
1013

1114
/* Represents 1ppm adjustment in 2^59 format with 6.037735849ns as reference
@@ -1126,5 +1129,5 @@ void lan966x_ptp_rxtstamp(struct lan966x *lan966x, struct sk_buff *skb,
11261129
u32 lan966x_ptp_get_period_ps(void)
11271130
{
11281131
/* This represents the system clock period in picoseconds */
1129-
return 15125;
1132+
return PICO / LAN9X66_CLOCK_RATE;
11301133
}

0 commit comments

Comments
 (0)