testptp

vanness_205發表於2024-07-03
Test the PTP Physical Hardware Clock functionality using the "phc_ctl" (a
part of "linuxptp").

The test contains three sub-tests:
  * "settime" test
  * "adjtime" test
  * "adjfreq" test

"settime" test:
  * set the PHC time to 0 seconds.
  * wait for 120.5 seconds.
  * check if PHC time equal to 120.XX seconds.

"adjtime" test:
  * set the PHC time to 0 seconds.
  * adjust the time by 10 seconds.
  * check if PHC time equal to 10.XX seconds.

"adjfreq" test:
  * adjust the PHC frequency to be 1% faster.
  * set the PHC time to 0 seconds.
  * wait for 100.5 seconds.
  * check if PHC time equal to 101.XX seconds.

Usage:
  $ ./phc.sh /dev/ptp<X>

  It is possible to run a subset of the tests, for example:
    * To run only the "settime" test:
      $ TESTS="settime" ./phc.sh /dev/ptp<X>



ptp_dev=`ethtool -T enp66s0f1 | awk '/PTP Hardware Clock:/ {print $4}'` && testptp -d /dev/ptp$ptp_dev -L 0,1

Set PPS-in read external time stamp events:

ptp_dev=`ethtool -T enp66s0f1 | awk '/PTP Hardware Clock:/ {print $4}'` && testptp -d /dev/ptp$ptp_dev -e 1000

標誌“-e<number>”讀取指定數量的外部時間戳事件。<number> 設定為 -1 可讓 testptp 無限讀取時間戳。

ts2PHC 和 testptp 都以檔案描述符的形式讀取 PPS 訊息,不能一起執行。Testptp 仍可用於引腳配置或啟用 pps 輸出。

在 clx-zeus-18 (GM) 上設定 PPS-out

在 PPS 輸出端生成周期性訊號

ts2phc“是linuxptp軟體包中的一個應用程式,ts2phc將PTP硬體時鐘(PHC)同步到外部時間戳訊號。單個源可用於將時間分配給一個或多個PHC裝置。