Commit 0cf91580 authored by Sonic Zhang's avatar Sonic Zhang Committed by David S. Miller

driver:stmmac: Adjust time stamp increase for 0.465 ns accurate only when Time...

driver:stmmac: Adjust time stamp increase for 0.465 ns accurate only when Time stamp binary rollover is set.

The synopsys spec says When TSCRLSSR is cleard, the rollover value of
sub-second register is 0x7FFFFFFF(0.465 ns per clock).
Signed-off-by: default avatarSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c08751c8
...@@ -45,8 +45,8 @@ static void stmmac_config_sub_second_increment(void __iomem *ioaddr) ...@@ -45,8 +45,8 @@ static void stmmac_config_sub_second_increment(void __iomem *ioaddr)
data = (1000000000ULL / 50000000); data = (1000000000ULL / 50000000);
/* 0.465ns accuracy */ /* 0.465ns accuracy */
if (value & PTP_TCR_TSCTRLSSR) if (!(value & PTP_TCR_TSCTRLSSR))
data = (data * 100) / 465; data = (data * 1000) / 465;
writel(data, ioaddr + PTP_SSIR); writel(data, ioaddr + PTP_SSIR);
} }
......
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