Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
}