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.

AM6442: How to implement IEEE 1588 Hardware PTP on AM64x (AM6422/AM6442) with PRU-ICSSG in Yocto

Part Number: AM6442
Other Parts Discussed in Thread: AM6422

Tool/software:

Hi everyone,

I'm working on enabling IEEE 1588 PTP with hardware timestamping on an AM6422 based platform using Yocto Linux.

What I’m trying to achieve:

  • Full hardware timestamping-based time synchronization between one Grandmaster and one Ordinary Clock.
  • Correct usage of ptp4l and phc2sys with hardware timestamping.

Questions:

  • What kernel/device tree configuration is required to bind Ethernet ports to PRU-ICSSG with HW timestamping?
  • Do I need any special firmware loaded onto the PRU cores (PTU firmware)?
  • How do I confirm timestamps are actually being taken in hardware and not in software?
  • Any working example or reference project using Yocto, ptp4l, and PRU-based Ethernet for PTP?

Any guidance, documentation, or working example setup would be extremely helpful.

Thanks in advance!

  • ICSSG is just one implementation of Ethernet with IEEE1588 timestamping, nothing unique compared to the other Ethernet peripheral CPSW3G in AM6x family. PTP example has been part of the SDKs using standard Linux commands for several years.

    https://software-dl.ti.com/processor-sdk-linux-rt/esd/AM64X/latest/exports/docs/linux/Foundational_Components/PRU-ICSS/Linux_Drivers/PRU_ICSSG_Ethernet.html#ptp-ordinary-clock 

    Nothing TI unique,

    ethtool -T eth2

    will print out the capability of the Ethernet port with regard to HW timestamping in Linux.

    There is a step by step webinar on running this https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1009997/am6442-linux-time-sensitive-networking-on-sitara-processors-including-am64x . for ICSSG just substitute whatever Ethernet device, default SDK eth2 is ICSSG1 port.

      Pekka

  • Hi Pekka,

    I now have the device with me and have continued working on IEEE 1588 PTP with hardware timestamping on the AM6422, using the documentation and webinar pdf you shared earlier. I'm still relatively new to PRU-ICSSG Ethernet and PTP, so I wanted to confirm some observations and clarify a few doubts.

    I've confirmed that hardware timestamping is supported on eth2

    root@am64xx-evm:~# ethtool -T eth2
    Time stamping parameters for eth2:
    Capabilities:
            hardware-transmit
            software-transmit
            hardware-receive
            software-receive
            software-system-clock
            hardware-raw-clock
    PTP Hardware Clock: 2
    Hardware Transmit Timestamp Modes:
            off
            on
    Hardware Receive Filter Modes:
            none
            all

    I also see that PRU Ethernet firmware is being loaded successfully:

    root@am64xx-evm:~# dmesg | grep prueth
    [   14.307022] icssg-prueth icssg1-eth: TI PRU ethernet driver initialized: single EMAC mode
    [   15.272186] remoteproc remoteproc12: Booting fw image ti-pruss/am65x-sr2-pru0-prueth-fw.elf, size 39464
    [   15.313383] remoteproc remoteproc13: Booting fw image ti-pruss/am65x-sr2-rtu0-prueth-fw.elf, size 31140
    [   15.343257] remoteproc remoteproc4: Booting fw image ti-pruss/am65x-sr2-txpru0-prueth-fw.elf, size 39068

    However, I noticed a discrepancy: in the device tree (k3-am642-evm.dts), the firmware names are listed as am64x-sr2-*, but the dmesg log refers to am65x-sr2-*. Interestingly, I can also see the same am65x-sr2 strings referenced inside the icssg-prueth.c driver.

    	icssg1_eth: icssg1-eth {
    		compatible = "ti,am642-icssg-prueth";
    		pinctrl-names = "default";
    		pinctrl-0 = <&icssg1_rgmii1_pins_default>;
    		sram = <&oc_sram>;
    		ti,prus = <&pru1_0>, <&rtu1_0>, <&tx_pru1_0>, <&pru1_1>, <&rtu1_1>, <&tx_pru1_1>;
    		firmware-name = "ti-pruss/am64x-sr2-pru0-prueth-fw.elf",
    				"ti-pruss/am64x-sr2-rtu0-prueth-fw.elf",
    				"ti-pruss/am64x-sr2-txpru0-prueth-fw.elf",
    				"ti-pruss/am64x-sr2-pru1-prueth-fw.elf",
    				"ti-pruss/am64x-sr2-rtu1-prueth-fw.elf",
    				"ti-pruss/am64x-sr2-txpru1-prueth-fw.elf";
    

    Questions:

    1. Even though there's a naming mismatch (am64x-sr2 in DT vs am65x-sr2 in the logs and driver), the PRU Ethernet interface works fine.
      Is this just a common naming reuse between AM64x/AM65x devices?

    2. Instead of analyzing prebuilt firmware binaries, is there a way to look at the source code of the PRU-eth firmware (especially for PTP handling)?
      I would like to understand how the actual hardware timestamping is implemented inside PRU.

  • Even though there's a naming mismatch (am64x-sr2 in DT vs am65x-sr2 in the logs and driver), the PRU Ethernet interface works fine.
    Is this just a common naming reuse between AM64x/AM65x devices?

    The subsystem ICSSG is the same. The first device with this subsystem was AM65x so some files and drivers have that in their name. So the naming mismatch is just an artifact of this.

    Instead of analyzing prebuilt firmware binaries, is there a way to look at the source code of the PRU-eth firmware (especially for PTP handling)?
    I would like to understand how the actual hardware timestamping is implemented inside PRU.

    We do not share the source code for the PRU networking firmwares. The timestamp is generated as close to the RGMII interface as theoretically possible by HW. Firmware just reads the timestamp and passes it to the data structures used by the driver.

      Pekka

  • Thanks for the clarification.

    I just had one more doubt, if the PRU Ethernet firmware is precompiled and not open-sourced, then what is the intended use of the INDUSTRIAL-COMMUNICATIONS-SDK-AM64X? Am I missing something?

    Is it mainly intended for evaluating protocols like Profinet, EtherCAT? Or does it also contain tools or examples related to IEEE 1588 PTP with PRU-ICSSG?

  • I just had one more doubt, if the PRU Ethernet firmware is precompiled and not open-sourced, then what is the intended use of the INDUSTRIAL-COMMUNICATIONS-SDK-AM64X? Am I missing something?

    This freeRTOS based INDUSTRIAL-COMMUNICATIONS-SDK-AM64X for R5 cores has nothing to do with Linux usage of ICSSG. Running R5 based networking using an industrial fieldbus can coexist with Linux, but each Ethernet peripheral is owned either by a fieldbus protocol or Linux. INDUSTRIAL-COMMUNICATIONS-SDK-AM64X has different firmware for the ICSSG, this is also closed source. There is one example of this co-existance for EtherNet/IP filedbus, see https://software-dl.ti.com/processor-industrial-sw/esd/ind_comms_sdk/am64x/latest/docs/api_guide_am64x/EXAMPLES_INDUSTRIAL_COMMS_ETHERNETIP_ADAPTER_TUNNELING_DEMO.html 

    Is it mainly intended for evaluating protocols like Profinet, EtherCAT? Or does it also contain tools or examples related to IEEE 1588 PTP with PRU-ICSSG?

    INDUSTRIAL-COMMUNICATIONS-SDK-AM64X is for evaluation and production of IO-link master, EtherCAT subdevice, PROFINET device and EtherNet/IP adapter. The Ethernet based versions of these leverage the IEEE 1588 timestamping functionality for clock synchronization. Depending on which one it might be close to IEEE1588 PTP or utilized differently.

      Pekka