diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2013-09-03 13:55:07 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-04 14:37:02 -0400 |
commit | 0cf915809ce775cba3f08de5df1fb89bdbd95a28 (patch) | |
tree | 2db34de46fe2eab1e6b83a2d0d8c05d123b4b42f | |
parent | c08751c851b78514f6ec5f77f7cbebaac63d15c0 (diff) | |
download | op-kernel-dev-0cf915809ce775cba3f08de5df1fb89bdbd95a28.zip op-kernel-dev-0cf915809ce775cba3f08de5df1fb89bdbd95a28.tar.gz |
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: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c index def7e75..76ad214 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c @@ -45,8 +45,8 @@ static void stmmac_config_sub_second_increment(void __iomem *ioaddr) data = (1000000000ULL / 50000000); /* 0.465ns accuracy */ - if (value & PTP_TCR_TSCTRLSSR) - data = (data * 100) / 465; + if (!(value & PTP_TCR_TSCTRLSSR)) + data = (data * 1000) / 465; writel(data, ioaddr + PTP_SSIR); } |