Commit eb9c0d67 authored by Horatiu Vultur's avatar Horatiu Vultur Committed by Jakub Kicinski

net: lan966x: Update lan966x_ptp_get_nominal_value

The clk_per_cfg register represents the value added to the system clock
for each clock cycle. The issue is that the default value is wrong,
meaning that in case the DUT was a grandmaster then everone in the
network was too slow. In case there was a grandmaster, then there is no
issue because the DUT will configure clk_per_cfg register based on the
master frequency.

Fixes: d0964594 ("net: lan966x: Add support for ptp clocks")
Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 8467dda0
...@@ -29,10 +29,10 @@ enum { ...@@ -29,10 +29,10 @@ enum {
static u64 lan966x_ptp_get_nominal_value(void) static u64 lan966x_ptp_get_nominal_value(void)
{ {
u64 res = 0x304d2df1; /* This is the default value that for each system clock, the time of day
* is increased. It has the format 5.59 nanosecond.
res <<= 32; */
return res; return 0x304d4873ecade305;
} }
int lan966x_ptp_hwtstamp_set(struct lan966x_port *port, struct ifreq *ifr) int lan966x_ptp_hwtstamp_set(struct lan966x_port *port, struct ifreq *ifr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment