This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: Multiple PTP domains in Linux

Part Number: TDA4VM

Hello again Team,

We are wanting to implement a design using 2 PTP time domains.
One will be the CPTS time from the CPSW2 (currently accessible on the A72 via linux PTP tools, thanks to existing driver support).
The other will be the CPTS time from the CPSW9 (currently accessible on RTOS MAIN-R via TimeSync API).

We ideally would like access to both time domains on both the A72 and MAIN-R.  So my questions are:

1. What would be the best way to access CPTS time of CPSW9 in linux user space on the A72?  My current thinking is that this would require custom driver code on the A72, which registers Time Sync Router callbacks from CPTS on MAIN-R, calculates the clock relationships, and exposes a device in /dev/ptpN?  Does this make sense?

2. And then accessing CPTS time of CPSW2 on MAIN-R.  I think the only way to do this is to (similarly to the previous case) write some code on the MAIN-R side which registers TSR callbacks from the CPTS of the A72.  The clock relationship can then be calculated, and an abstraction of the clock can be used by applications.  Does this make sense?  Can one use the TSR "backwards" in this way (from A72 to MAIN-R)?

Thanks very much

  • Hi,


    1. What would be the best way to access CPTS time of CPSW9 in linux user space on the A72?  My current thinking is that this would require custom driver code on the A72, which registers Time Sync Router callbacks from CPTS on MAIN-R, calculates the clock relationships, and exposes a device in /dev/ptpN?  Does this make sense?

    Yes, you need a custom code to get timestamps from R5F because A72 should not access CPTS Timestamp FIFO (architecture limitation) See this E2E You can use IPC, shared memory or any other mechanism. See this for reference

    2. And then accessing CPTS time of CPSW2 on MAIN-R.  I think the only way to do this is to (similarly to the previous case) write some code on the MAIN-R side which registers TSR callbacks from the CPTS of the A72.  The clock relationship can then be calculated, and an abstraction of the clock can be used by applications.  Does this make sense?  Can one use the TSR "backwards" in this way (from A72 to MAIN-R)?

    You can already do PTP on Linux for CPSW 2G, why do you want to access it from Main R5F ?

    Regards

    Vineet

  • Hi Vineet,

    Hope I've understood you correctly: I don't mean actually implementing PTP using timestamps from CPTS, which is what I think you're referring to in your answer?

    We just want to be able to synchronize clocks across the cores.  So assume PTP is happening on Linux for the CPSW 2G, and PTP is happening in EthFw for the CPSW9G.  But we want the cores to have access to each other's PTP time.

    Is the solution here to use Time Sync Router / hardware push events to schedule periodic callbacks with CPTS and GTC time? Then each core can calculate the offset/rate ratio between GTC and the other core's CPTS.  Or is there a better/easier way?

    Examples of why we would want this:

    • if we want to send AVB streams from the A72 out on CPSW9G, we need the PTP time of the CPSW9G CPTS here.
    • if we want to act as a PTP bridge between CPSW2G and CPSW9G, i.e. we want devices connected to the CPSW9G to be synchronised to a PTP master connected to the CPSW2G.  We would need to somehow convey the PTP time of the CPSW2G to the CPSW9G, so that it can be sent out to PTP listeners.  (Assume a PTP stack here that can act as master and handle 2 domains).

    Thanks

  • Hi Jean,

    Ok, I understand your requirement now.

    The correct way to do this is to use the TimeSync Router and it's push events, it's a HW specifically designed for this kind of use-case. Unfortunately we do not have support for it right now in J7 SDK beyond basic CSL API's and some unit tests in pdk/packages/ti/drv/enet.

    You can of course do it at application level by fetching timestamps through IPC but then you need to account for the delays in IPC and implement logic to handle that.

    There is an additional issue here : The PTP stack packaged in PDK, which is used for CPSW 5G/9G is only test/demo capable so it does not have ability to synchronize clock with other domains. We recommend using a commercial stack for this purpose.

    Regards

    Vineet