diff options
| author | Fugang Duan <[email protected]> | 2015-06-05 09:22:08 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2015-06-07 22:30:42 +0000 |
| commit | 34270f5f6f1bcc2dc9d2e5aa28147667425cc424 (patch) | |
| tree | cbe559f5b5ba3d9b8c04541a177d99ef25a7ca11 /net/unix/af_unix.c | |
| parent | net: ll_temac: Remove sparse warnings (diff) | |
| download | kernel-34270f5f6f1bcc2dc9d2e5aa28147667425cc424.tar.gz kernel-34270f5f6f1bcc2dc9d2e5aa28147667425cc424.zip | |
net: fec: ptp: correct the ENET_ATCOR value
The current driver adjust freq formula is:
fe * diff = ppb * pc
Note:
fe: ENET ref clock frequency in Hz
diff = inc_corr - inc: difference between default increment and correction increment
ppb: parts per billion adjustment from base
pc: correction period (in number of fe clock cycles)
The correction increment will be used after N cycles of regular increments,
not every N cycles (with N being the correction period). For example, set ENET_ATCOR=4,
INC=8, INC_CORR=9, there will be 4 increments of 8 (ENET_ATINC[INC]) , followed by 1
increment of 9 (ENET_ATINC[INC_CORR]).
So, the correct formula is:
fe * diff = ppb * (pc + 1)
For ENET_ATCOR, a value 0 disables the correction counter and no corrections occur.
So base on the origin formula, set pc = pc > 1 ? pc - 1 : pc.
Signed-off-by: Fugang Duan <[email protected]>
Signed-off-by: Frank Li <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
