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.

AM625: VAR-SOM-AM62

Part Number: AM625
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello everyone,

I managed to implement ptp in my SoM VAR-SOM-AM62. Now I have to test pps. For this I installed testptp.
In the device tree of the board I have the following:


&cpsw3g {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&main_rgmii1_pins_default
&main_rgmii2_pins_default>;

cpts@3d000 {
/* MAP HW3_TS_PUSH to GENF1 */
ti,pps = <2 1>;
};
};

#define K3_TS_OFFSET(pa, val) (0x4+(pa)*4) (0x10000 | val)

&timesync_router {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cpsw_cpts>;

/* Use Time Sync Router to map GENF1 input to HW3_TS_PUSH output */
cpsw_cpts: cpsw-cpts {
pinctrl-single,pins = <
/* pps [cpsw cpts genef1] in17 -> out12 [cpsw cpts hw3_push] */
K3_TS_OFFSET(12, 17)
/* pps [cpsw cpts genef1] in17 -> out22 [SYNC2_OUT pin] */
K3_TS_OFFSET(22, 17)

>;
};
};


&main_pmx0 {

pps_pins_default: pps-default-pins {
pinctrl-single,pins = <
AM62X_IOPAD(0x01d8, PIN_OUTPUT, 3) /* (C15) MCAN0_TX.SYNC2_OUT */


>;
};
};

Like you see i configured the SYNC2_OUT of time sync router to output the signal of GENF1. But i can not measure this signal on the oszilloscop. 

Another problem with the testptp program: when i want ot get the timestamping value out of cpsw cpts hw3_push i get an error. And when i want to test the GENF1 that i configured i get an error.

  • root@am62x-var-som:~# testptp -d /dev/ptp0 -p 500000000 -i 1
    PTP_PEROUT_REQUEST: Invalid argument (1 refers to genf1 that i configured)

  • root@am62x-var-som:~# testptp -d /dev/ptp0 -p 500000000 -i 0
    periodic output request okay (0 is genf0 that i did not configured)

  • root@am62x-var-som:~# testptp -d /dev/ptp0 -e 5 -i 2
    PTP_EXTTS_REQUEST: Invalid argument (2 refers to hw3 push that i configured)
    PTP_EXTTS_REQUEST: Invalid argument

  • root@am62x-var-som:~# testptp -d /dev/ptp0 -e 5 -i 3
    external time stamp request okay (3 is hw4 that i did not configured and it hangs here and nothing else happens)

This is wierd, because i use genf1 not genf0 and the hw3 push pin of cpts not anything else. 

Can someone helps?

Thank you 

BR

Zain

  • Hello Zain, 

    Like you see i configured the SYNC2_OUT of time sync router to output the signal of GENF1. But i can not measure this signal on the oszilloscop. 

    First a couple of questions, 

    1. Which Linux SDK version are you using?

    2. How are you determining that out22 is associated with SYNC2_OUT pin? 

    3. Did you ensure the pinmux configuration for the SYNC2_OUT pin is correctly configured in the DTS?

    4. I assume you have some hardware platform that breaks out the pin for SYNC2_OUT that you are measuring?

    Please note that to get the PPS signal out on the physical pin that you are measuring, you typically need to run something like "testptp -d /dev/ptp0 -P 1"

    Another problem with the testptp program: when i want ot get the timestamping value out of cpsw cpts hw3_push i get an error. And when i want to test the GENF1 that i configured i get an error.

    • root@am62x-var-som:~# testptp -d /dev/ptp0 -p 500000000 -i 1
      PTP_PEROUT_REQUEST: Invalid argument (1 refers to genf1 that i configured)

    • root@am62x-var-som:~# testptp -d /dev/ptp0 -p 500000000 -i 0
      periodic output request okay (0 is genf0 that i did not configured)

    • root@am62x-var-som:~# testptp -d /dev/ptp0 -e 5 -i 2
      PTP_EXTTS_REQUEST: Invalid argument (2 refers to hw3 push that i configured)
      PTP_EXTTS_REQUEST: Invalid argument

    • root@am62x-var-som:~# testptp -d /dev/ptp0 -e 5 -i 3
      external time stamp request okay (3 is hw4 that i did not configured and it hangs here and nothing else happens)

    Regarding the -p, -i, -e options of testptp, I will need to do some additional investigation on. Upon testing on a AM62x SKEVM with the latest SDK Linux 10.1 (kernel 6.6), I also see a similar result.

    root@am62xx-evm:~# /usr/kernel-selftest/ptp/testptp -d /dev/ptp0 -p 500000000 -i 1
    PTP_PEROUT_REQUEST: Invalid argument
    root@am62xx-evm:~# /usr/kernel-selftest/ptp/testptp -d /dev/ptp0 -p 500000000 -i 0
    periodic output request okay
    root@am62xx-evm:~# /usr/kernel-selftest/ptp/testptp -d /dev/ptp0 -e 5 -i 2        
    PTP_EXTTS_REQUEST: Invalid argument
    PTP_EXTTS_REQUEST: Invalid argument
    root@am62xx-evm:~# /usr/kernel-selftest/ptp/testptp -d /dev/ptp0 -e 5 -i 3
    external time stamp request okay
    ^C
    root@am62xx-evm:~# uname -a
    Linux am62xx-evm 6.6.32-ti-g6de6e418c80e-dirty #1 SMP PREEMPT Fri Jul 26 14:32:20 UTC 2024 aarch64 GNU/Linux
    root@am62xx-evm:~# 

    I plan to give an update Tuesday next week. Please kindly ping this thread if I haven't responded by then.

    -Daolin

  • Hello Daolin,

    Thank you Daolin.

    BR

    Zain

  • Hi Zain, 

    Thanks for answering my questions. I've created an internal bug ticket on this issue and will try to discuss with the developer on Wednesday. I'll give an update on Wednesday. If I haven't responded by Wednesday, please kindly ping this thread again.

    In the meantime, the main files to try to look into this issue include the am65-cpts.c driver (drivers/net/ethernet/ti/) and the testptp.c application, you'd like to try looking into it during this time as well.

    -Daolin

  • Hello Daolin,

    do you have any good news?

    BR

    Zain

  • Update:

    I recently discussed this with the developer and it appears that with the following configuration in your device tree, you are setting the genf1 and hw3 push mapping statically. According to our developer, this means that using testptp with the -i and -e options to test pps is not correct since it only handles the dynamic test case.

    cpts@3d000 {
    /* MAP HW3_TS_PUSH to GENF1 */
    ti,pps = <2 1>;
    };
    };

    Instead, you should try testing pps with the steps in the "PPS Pulse Per Second support" section from the SDK documentation: https://software-dl.ti.com/processor-sdk-linux/esd/AM64X/latest/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW-PTP.html

    Please give this a try and let us know if it works!

    -Daolin

  • Alternatively, you could also try enabling the dynamic test case by commenting out the "ti,pps" static mapping in the DTS and running the same testptp sequence with the-i and -e options as before.

    After a quick test on my SK-AM62x board, it appears to be working

    DTS changes:

    diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
    index 910feb74c..532fbd83e 100644
    --- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
    +++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
    @@ -205,10 +205,10 @@ &cpsw3g {
           pinctrl-0 = <&main_rgmii1_pins_default
                        &main_rgmii2_pins_default>;
    
    -      cpts@3d000 {
    -              /* MAP HW3_TS_PUSH to GENF1 */
    -              ti,pps = <2 1>;
    -      };
    +      // cpts@3d000 {
    +      //     /* MAP HW3_TS_PUSH to GENF1 */
    +      //     ti,pps = <2 1>;
    +      // };
     };

    Test log:

    root@am62xx-evm:~# /usr/kernel-selftest/ptp/testptp -d /dev/ptp0 -p 500000000 -i 1
    periodic output request okay
    root@am62xx-evm:~# /usr/kernel-selftest/ptp/testptp -d /dev/ptp0 -e 5 -i 2
    external time stamp request okay
    event index 2 at 103.500000012
    event index 2 at 104.000000012
    event index 2 at 104.500000012
    event index 2 at 105.000000012
    event index 2 at 105.500000012
    root@am62xx-evm:~# uname -a
    Linux am62xx-evm 6.6.32-ti-g6de6e418c80e-dirty #1 SMP PREEMPT Fri Jul 26 14:32:20 UTC 2024 aarch64 GNU/Linux
    root@am62xx-evm:~#  

    -Daolin

  • Hello Daolin

    Thanks for your answers.

    I already have the same configuration in the device tree as mentioned in the SDK documentation.

    But I noticed that pps was tested with ppstest. When I run this command, I get appropriate output that pps works. But why I can't measure any pps signal on the osiliscop?

    BR

    Zain

  • Hi Zain,

    But I noticed that pps was tested with ppstest. When I run this command, I get appropriate output that pps works. But why I can't measure any pps signal on the osiliscop?
    Yes, i use sysconfig for it and then put the pinmux confiiguration in the dts of the evaluation board (symphony board) of the SoM

    You said you're using a SoM? Can you point me to the link of the SoM evaluation board? 

    &main_pmx0 {

    pps_pins_default: pps-default-pins {
    pinctrl-single,pins = <
    AM62X_IOPAD(0x01d8, PIN_OUTPUT, 3) /* (C15) MCAN0_TX.SYNC2_OUT */


    >;
    };
    };

    Do you have the "pps_pins_default" pinmux enabled somewhere in your DTS? I only see the pinmux configuration but I don't see where it is included in the "pinctrl-0" property of another DTS node.

    -Daolin

  • Hi Daolin,

    I forgot to enable the pinmux config of pps in the pinctrl-o property. I am now getting a signal from the oscilloscope Slight

    And yes, it also worked with genf1 and hw ts 3 when I commented out the ti,pps property.

    But what do you mean by static and dynamic mapping?

    Thanks Daolin Slight

    BR

    Zain

  • Hi Zain,

    But what do you mean by static and dynamic mapping?

    What I meant by "static" mapping is the mapping of the hw push event to the genf source manually by the below configuration in the DTS. By "dynamic" mapping, I mean changing to different hw push event to genf mappings with the -i and -e options of testptp as you did in the initial post by trying to test hw4 push and genf0 with testptp. I understand you did this to compare the behavior with the issue you see but it appears that -i and -e options are not supported when the below "static" mapping is made.

    cpts@3d000 {
    /* MAP HW3_TS_PUSH to GENF1 */
    ti,pps = <2 1>;
    };
    };

    I hope this helps clear up any confusion

    -Daolin