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.

Linux/AM5726: Enabling Auto-forward feature on PRU MII port

Part Number: AM5726

Tool/software: Linux

Champs,

Customer requires to put PRU Ethernet port into a test mode where all Rx traffic is looped back into Tx directly without FW/SW involvement (for pure HW data path verification purpose). The autoforward mode described in paragraph 30.1.9.2.1.1 seem to be the right tool for the job however there are two questions:

1. From PRU Ethernet driver description it is  not clear if it supports putting port in this mode at all. 

2. I can not find anywhere in the TRM how to enable this mode. RX_AUTO_FWD_PRE bit seems to only enable preamble forwarding not the whole packet. 

Basically what they want to do is something similar to CPSW FIFO loopback (paragraph 24.11.4.8.13 in TRM). Is this at all possible?

Thanks

Michael

  • Hi Micheal,

    I think I see what you are talking about but I will have to research with developers to verify. I have seen customers do this technique with the CPSW to look for board issues. I believe the customer used bare metal code and not Linux for this effort.

    Best Regards,
    Schuyler
  • Hi Schuyler,

    In my case customer wants to just stress test the HW (board, PHY, HW MAC) and not have any SW in the loop at all. I put the question under Linux but if this can be done with bare metal code (or even JTAG for that matter) then it's ok too.

    thanks
    Michael
  • Hi Schuyler,

    Did you get any feedback from development?

    thanks

    Michael

  • Hi Michael,

    From a Linux perspective we do not provide a means to do the loopback. As you point this is very low level and preferably without SW. The next place to look would be in the RTOS PDK perhaps. I will check with that team to see about support and then perhaps hand off the thread to them.

    Best Regards,
    Schuyler
  • Hi Schuyler,

    thank you for your help, I guess at this point the main question is #2 from the original post, namely how to enable this mode? RX_AUTO_FWD_PRE bit seems to only enable preamble forwarding not the whole packet. Possibly the question needs to be directed to the the PRU HW owners rather than PSDK RTOS

    thanks

    Michael

  • Hi Michael,

    I will see who the hardware expert is, this method of loopback may not be possible since nobody seems familiar with this method. Depending on where they are trying to isolate the issue to digital or analog they may have to do a combination test setup. First an external test by putting the phy (if it supports it) into a loopback mode that is inside the phy. And then perhaps use the RTOS and add code (if the phy supports it) to loopback to the MAC from inside the phy.

    For the RTOS loopback test currently provided here is a link I received from talking with development team. This method is different from what the customer is thinking about in that it uses the RTOS PDK and an external cable that is loopbacked on itself.  

    The ICSS EMAC loopback (external by a loopback plug on RJ-45) for AM57x is documented here:  Loopback Link

    Would this approach work for the customer?

    Best Regards,

    Schuyler

  • Hi Schuyler,

    The customer is not looking to debug particular issue, but to have a stress test setup where they would use a specialized test equipment to send test patterns (varying actual speed, inter-packet gap etc) and receive them back for verification. I have asked if it is feasible to initiate the traffic on the CPU side but I doubt this would be of the same value. 

    Please let me know what you can find about this HW loopback mode in PRU. If it does exist and can be enabled via register config this would be best since they may even do it with JTAG/CCS only...

    thanks a lot for your help,

    Michael

  • Hi Michael,
    After discussing with fellow team members and the IP team this section in the TRM that perhaps describes what the customer is looking for.

    30.1.9.2.1.1 Auto-forward with Optional PRU Snoop

    Data is automatically forwarded from the MII RX port to the MII TX port without manipulations, as shown in
    Figure 30-29. This configuration does not depend on the PRU core. However, it does support an option for
    PRU to snoop or monitor the received data through the RX L2, shown in Figure 30-30. The PRU does not
    access data and status bits through R31, and it does not modify and push data.

    To set this auto forward mode up this register of the PRU desired must use these settings:

    There are two PRUs so this example use the register documentation is from the first one.

    30.1.9.3.2.2 PRUSS_MII_RT Register Description

    Table 30-355. PRUSS_MII_RT_RXCFG0
    These bits must be disabled, RX_CUT_PREAMBLE, RX_AUTO_FWD_PRE

    Table 30-359. PRUSS_MII_RT_TXCFG0
    This bit must be enabled TX_AUTO_SEQUENCE and this bit must be disabled TX_AUTO_PREAMBLE

    This is just about setting up auto-forward mode, please be aware that there maybe other registers required to complete what the customer requires here.

    Best Regards,
    Schuyler