On Sat, Jun 27, 2020 at 11:27:47AM +0300, Vladimir Oltean wrote: > Hi Richard, > > I have a board with multiple DSA switches which I'm trying to make act as a > single boundary clock.
Okay, so I think I got it... > But looking at the current object model in ts2phc, I figured my changes would > be rather intrusive to its current design, so I would like to have a > discussion > with you before I even start. Yes, it would be too complex of a change for ts2phc. I want to keep these programs (ptp4l, phc2sys, and ts2phc) relatively simple, in the tradition of discrete unix command line tools. Of course, there are pros and cons of this "distributed" architecture, but I don't want to move in the direction of a super-programmable, monolithic mega library that handles every imaginable HW and use case. (That would be a interesting approach, but it would mean starting a new project.) It may be that writing your own service for your device is the best approach. I bet you could re-use some of the existing code. Let me suggest how you might tackle this with the least amount of effort. 1. Run ts2phc with the simple configuration that you mentioned. Let it run forever, making /dev/ptp1 the source of time. 2. For the TC use case, run ptp4l with the free_running and boundary_clock_jbod options. (Using a custom shell script or program, you can optionally monitor the frequency offset via management messages and syntonize /dev/ptp1 to the remote GM). 3. For the BC use case, again use ptp4l + free_running + boundary_clock_jbod. Write a custom program that queries TIME_STATUS_NP, feeds the offsets into a servo, and adjusts /dev/ptp1 accordingly. This will work provided the Sync rate is not too high. To support very high Sync rates, your program can receive "pushed" Sync timestamps using the new SLAVE_RX_SYNC_TIMING_DATA TLV. Together with CURRENT_DATA_SET.meanPathDelay you can figure the offsets and feed them into the servo. Thanks, Richard _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel