In general phch2sys can be used to synchronize two “POSIX” clocks. So you can
synchronize system clock with /dev/ptp0, /dev/ptp0 with system clock, or e.g.
/dev/ptp0 with /dev/ptp1 if you have two ptp devices.
For sure you can easily get the time from /dev/ptp0. You can look into the
ptp4l/ph2sys source code to find how you can open the device to get its
clock_id and read its time with a standard clock_gettime.
As far as I know, to control the clock of your DIO from phc2sys you need to
“expose” the clock implementing the PHC kernel interface in the driver…
HTH
William
From: John Hubbard [mailto:jhubb...@noao.edu]
Sent: 17 March 2016 23:03
To: linuxptp-users@lists.sourceforge.net
Subject: [Linuxptp-users] Can phc2sys sync two physical clocks?
As I understand it the phc2sys package is generally responsible for
synchronizing a physical clock to the system time or vice versa. Is it
possible to use the package to synchronize two physical clocks?
In my case I'm looking to take wall time as determined by a NIC that supports
hardware timestamping using the ptp4l package and write that time to a DIO card
that has its own internal clock. We were using a previous version of the DIO
card which had an ethernet input and was capable of synchronizing itself to
PTP. The new version lacks that feature. In case it helps the card in
question is a Spectracom TSync PCIe; we are using the cards input time
stamping, and output match time features.
My hope is that you, who are more knowledgeable on time than I, might have
suggestions on the best way to synchronize the card's time with the incoming
PTP time. Is my best bet to read the system time via
std::chrono::system_clock::now() and then write that time to my DIO card. Is
there some way to read the current time directly from /dev/ptp0? Is there an
easy way to extend phc2sys to write the time to my DIO card?
Thanks in advance for any suggestions.
--
-john
To be or not to be, that is the question
2b || !2b
(0b10)*(0b1100010) || !(0b10)*(0b1100010)
0b11000100 || !0b11000100
0b11000100 || 0b00111011
0b11111111
255, that is the answer.
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users