We are trying to sync the K2L EVM (XEVMK2LX) with a PTP master (Symmetricom TimeProvider 5000) but are having issues. We are running the latest version of Linux on the ARM core of the K2L (from Processor SDK 03.00.00.04) and using the included version of ptp4l (1.6). We are starting ptp4l using the options specified in the examples shown here: http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring#Testing_CPTS.2FPTP
ptp4l is able to "lock" onto the PTP master and enter s2 "slave" state with no issues. But we are seeing the master offset continually drifting further and further away. It seems as if ptp4l is not able to adjust the PHC (PTP HW clock, aka CPTS) properly and minimize the offset from the PTP master.
Here is an excerpt from the ptp4l logs showing the master offset continually drifting away:
ptp4l[1443.814]: master offset -147571523 s0 freq -1000000 path delay 265198
ptp4l[1444.814]: master offset -149354457 s1 freq -1000000 path delay 445169
ptp4l[1448.814]: master offset -6355926 s2 freq -1000000 path delay 389336
ptp4l[1449.814]: master offset -7958887 s2 freq -1000000 path delay 389336
ptp4l[1450.814]: master offset -9561875 s2 freq -1000000 path delay 389336
ptp4l[1451.814]: master offset -11164739 s2 freq -1000000 path delay 389336
ptp4l[1452.814]: master offset -12885626 s2 freq -1000000 path delay 507238
ptp4l[1453.814]: master offset -14488577 s2 freq -1000000 path delay 507238
ptp4l[1454.814]: master offset -16209417 s2 freq -1000000 path delay 625141
ptp4l[1455.814]: master offset -17752039 s2 freq -1000000 path delay 564854
...
ptp4l[1739.813]: master offset -472878721 s2 freq -1000000 path delay 454870
ptp4l[1740.813]: master offset -474481717 s2 freq -1000000 path delay 454870
ptp4l[1741.813]: master offset -476151584 s2 freq -1000000 path delay 521823
ptp4l[1742.813]: master offset -477754546 s2 freq -1000000 path delay 521823
ptp4l[1743.813]: master offset -479357540 s2 freq -1000000 path delay 521823
Also note that the "freq" adjustment is maxed out to -1000000. This leads us to believe that the CPTS counter is not stable.
We have another PTP slave (a Linux server) on the same LAN and it is able to properly sync with the PTP master and minimize the offset within 100s of nanoseconds. So we don't believe there is an issue with the PTP master. We have also tried different versions of ptp4l (1.4 and 1.7) on the EVM and they show similar behavior as 1.6.
1. Is this expected behavior on the K2L EVM board? Is there some known issue with PTP not working properly on this EVM?
2. In this section of the wiki page: http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring#CPTS_Driver_Internals_Overview
There is the following warning:
Note 5: (WARNING) On Keystone 2 platforms, the default rftclk select is the internal SYSCLK2. On K2L, core pll is configured (based on the programmed efuse of max speed of 1 GHz and ref clk of 122880000 Hz) to 1000594244 Hz. As such, SYSCLK2 = 1000594244 / 2 = 500297122 Hz. With such a rftclk frequency, it is unlikely that some "good" M/S/D can be found so that 1000000000 = ((500297122 * M) >> S) / D. Hence based on the algorithm in Note 4, the M/S/D corresponding to 500000000 Hz will be used and unfortunately inaccuracy will be observed in timestamping. However, this issue is not observed on K2HK and K2E since the respective core pll is configured to exactly 1200000000 Hz and 1000000000 Hz, thus the cpts rftclk frequency is 600000000 and 500000000 Hz respectively and "good" M/S/D exist for these rftclk frequencies.
Is this warning applicable to the K2L EVM board? If so, could this be causing the time drift we are seeing or is there some other issue or limitation with the EVM board?
3. If #2 is the problem, is there a way to configure CPTS to use an external clock source on this EVM? We did not modify the Linux dts/dtb so it currently has cpts "rftclk_sel = <0>". So it is still configured for to use the default SYSCLK2. Are any other rftclk_sel values valid for this EVM that would provide a stable reference for CPTS? If so, what are the correct device tree settings to use this other rftclk values?
4. We noticed on the EVM schematic that there is a RF connector at designator CN7 that is labeled EXT_10MHZ. Can this be used to provide a stable 10MHz reference clock for CPTS? If so, what do we need to do to enable this port?