Skip to content
Commit 19d857c9 authored by Phil Reid's avatar Phil Reid Committed by David S. Miller
Browse files

stmmac: Fix calculations for ptp counters when clock input = 50Mhz.



stmmac_config_sub_second_increment set the sub second increment to 20ns.
Driver is configured to use the fine adjustment method where the sub second
register is incremented when the acculumator incremented by the addend
register wraps overflows. This accumulator is update on every ptp clk
cycle. If a ptp clk with a period of greater than 20ns was used the
sub second register would not get updated correctly.

Instead set the sub sec increment to twice the period of the ptp clk.
This result in the addend register being set mid range and overflow
the accumlator every 2 clock cycles.

Signed-off-by: default avatarPhil Reid <preid@electromag.com.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bf171f01
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