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: Does the linux SDK8.0 support PTP on A72?

Part Number: TDA4VM

HI,

Please help me confirm the QA:

     1.I think Linux sdk8 2 does not support PTP, but MCU2_0(FreeRTOS) support PTP, right?

     2.If PTP on Linux sdk8.2 is not supported at present,then  which version will support?

     3.Now Is there any way for Linux sdk8.2 to get time stamps?

     

  • Hi,

    1.I think Linux sdk8 2 does not support PTP, but MCU2_0(FreeRTOS) support PTP, right?

    The Linux SDK supports ptp on CPSW2G but not on CPSW9G. With CPSW2G (eth0 interface while booting out-of-box), you can use the utility ptp4l to sync with any master clock running ptp4l. For more details, please see this : software-dl.ti.com/.../CPSW2g.html

    On FreeRTOS, we have implemented the CPTS driver and clock adjust APIs but we don't have a PTP stack with FreeRTOS. It is suggested that you rely on a 3P to augment ptp support with RTOS.

    2.If PTP on Linux sdk8.2 is not supported at present,then  which version will support?

    PTP will be supported on linux for CPSW9G by SDK 8.4.

         3.Now Is there any way for Linux sdk8.2 to get time stamps?

    Easiest way is to use CPSW2G. Can you please explain your use case so I can better guide you on this.

    Regards,
    Tanmay

  • >>Easiest way is to use CPSW2G. Can you please explain your use case so I can better guide you on this.

    In order to synchronize the time with other device in automotive Ethernet.

    A72(linux sdk8.2)  gets PTP timestamp from MCU2_0.

  • Hi Shiwei,

    CPSW2G has a native linux driver and is NOT configured by the ethfw. Hence the The use-case for it relies on using the linux-ptp utility (ptp4l).

    To synchronise the time with a master clock on an linux PC (assuming PC has HW timestamping capabilities, can also be done without HW timestamping capabilities as lesser accuracy), you can use the following commands:

    • For EVM:
      • ptp4l -E -2 -H -i eth0 -s -l 6 -m -q -f ptp.cfg
    • For PC:
      • ptp4l -E -2 -H -i $InterfaceName -l 6 -m -q -f ptp.cfg
    • The contents of ptp.cfg are :
      • [global]
        tx_timestamp_timeout 400
    • Create the file ptp.cfg on both the machines and provide its path to ptp4l where ptp.cfg is mentioned.
    • Connect CPSW2G port of EVM to the $InterfaceName interface of the linux PC through a LAN cable and run the commands. The hardware clock on the EVM will be syncronised with the Master clock on PC.
    • You can also use anothe TDA4VM EVM instead of a linux PC. Just use same commands with eth0 as $InterfaceName..

    Let me know if you have any further doubts.

    Regards,
    Tanmay

  • HI, Tanmay,

    Thanks for your reply.

       In linux, I want to get the timestamp on CPSW9G, beause there is no CPSW2G interface on my board.

    QA:1------------> 

        As the example below,is there interface I can use  linux SDK 8.2 to get the timestamp from mcu_2.0?

        For example:(on QNX)

                File:"enetlld_if.c" there is interface below:

                      int32_t EnetIf_GetTimestamp(uint8_t msgType,uint16_t sequenceId,uint8_t tx,uint64_t *ts)

                      {

                         ........

                             status = Enet_ioctl(gEnetIfObj.hEnet,gEnetIfObj.coreId,CPSW_CPTS_IOCTL_LOOKUP_EVENT,&prms);

                        .........

                     }

    QA:2----------->

           If the time stamp is only obtained on the A72 in the slave mode, I have the following ideas. Please help me confirm. If it can be implemented., can you tell me on MCU2_ 0 ,how to generate a hardware interrupt notification to A72 (on linux.)

          On linux(A72), i use "munmap" to read the REG of "CPTS_EVENT_0_REG,CPTS_EVENT_0_REG",then I can get the timestamp value,But on linux(A72) does not know when the timestamp has been updated. So i think if on the MCU2_0, when the time is updated, a hardware interrupt notification A72 is generated immediately, A72 responds to hard interrupts and reads the time immediately. In this way, as long as the interrupt generation and response time are subtracted, the accurate synchronization time is obtained.

  • Hi Shiwei,

    In linux, I want to get the timestamp on CPSW9G, beause there is no CPSW2G interface on my board.

    There is no direct way for this. The virtual mac driver running on linux does not read timestamp. It can be added separately. But currently there is no such plan to add time-stamping support.

    If the time stamp is only obtained on the A72 in the slave mode, I have the following ideas. Please help me confirm. If it can be implemented., can you tell me on MCU2_ 0 ,how to generate a hardware interrupt notification to A72 (on linux.)

    I don't think there is any need to do this. You should be able to easily parse the timestamp by modifying the virtual mac driver. I will confirm and let you know a way to do this.

    Regards,
    Tanmay

  • Hi Shiwei,

    Attachment : net-ethernet-ti-j721e-cpsw-virt-mac-Add-Rx-timestamp.patch

    Please find attached the patch to be applied on top of the linux kernel.

    The timestamp is stored in skb. You can get the timestamp by reading the first two elements of psdata. See definition of "ns" in "virt_cpsw_nuss_rx_ts" function in above patch.

    Regards,
    Tanmay