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.

RTOS/AM5728: Sitara (EP) PCIe Link Training and Enumeration w/ Linux PC (RC)

Part Number: AM5728

Tool/software: TI-RTOS

  We are trying to demonstrate PCIe enumeration of a Sitara Processor AM5728 acting as a PCIe endpoint with a Linux computer acting as root complex.  We are using a SOM manufacturer’s PCBA (phyCORE®-AM57x PCM-057) for this along with their carrier board (phyCORE-AM57x Carrier Board PCM-948) for this testing  .  Their schematic closely matches the TI reference design (both SOM and development board schematics are attached).  We also are using the recommended PCIe male to male crossover PCIe cable (3” length) from Adex.  The cable crosses the TX/RX lines, passes the REFCLK signals straight through

 

  We first did a successful enumeration demo between two carrier boards with the clocks disconnected via a SMT jumper option on the ADEX PCIe jumper cable  (Note each carrier board by default has their own clock generator and buffer ICs).  We did this with the sample code named:   PCIE_am572x_phycore_rdk_wSoCFile_armExampleProject (that was slightly modified for use with the Phytec SOM).  One carrier board were running pre-built RTOS BSP configured as EP, and the other BSP-Yocto-TISDK-AM57xx-PD18.2.0 as RC.  The demo software reports that link training succeeded, the correct number of lanes is seen (1) and the correct speed is detected (gen 2), and passed all tests and data xfers. 

 

  After reading the forums on TI’s E2E we knew that the spread spectrum nature of most Linux computers would not allow us to use the separate clock scheme used above.  Because of this we reworked the carrier board to disable the on board clock generator and pass the clock from the boards PCIe connector onto the Sitara.  We also added back the SMT jumpers we had removed before to this time pass the ref clock from one board to the next.  We repeated the above demo with two carrier boards and were able show link training had once again succeeded, the correct number of lanes were seen (1) and the correct speed was detected (gen 2).  Because of this demo we believe the rework is at minimum good enough to succeed at PCIe enumeration.

 

  Using the, we repeated the above hardware configuration (2 carrier boards), this time one running Linux and acting as RC and the other running TI RTOS acting as the EP.  With an >>lspci command through the pre-built RTOS BSP we were able to see the endpoint had been enumerated and had a string describing it as a non-vga unclassified TI device.

 

  Our problem comes when we try to interface the carrier board acting as endpoint with a Linux computer (intel).  Note the carrier board here is the one modified to pass the refclk signals from the PCIe connector directly through to the Sitara processor.  The Linux computer (intel) does not properly enumerate it.  Most of the time we see no acknowledgement what-so-ever of there being anything plugged in on the Linux computer.  Other times we’ve seen the PCIe slot show up with no identification string.  We’ve never had a successful test which shows the equivalent of what was seen in the paragraph above: non-vga unclassified TI device.  On the EP we run a terminal that announces the link training state we are stuck in if link training doesn’t initially succeed.  It updates every 100ms (again only if training failed).  If training passes the debug console continues giving output – ultimately ending with if the correct number of lanes and speed were sensed.  We’ve never seen indication on the EP (when interfacing with the intel computer) that the link was established.  This includes when the Linux computer (intel) lists the PCIe port the EP is connected to with no identification string. 

I need to complete link training and enumeration with a AM57x (TI-RTOS EP) -> PC (Linux RC), so that the AM57x will show up under >lspci.  My understanding is that there are no additional drivers needed on the Linux PC side to accomplish this task, and that this is an electrical and connectivity problem (and possibly configuration on the AM57x). 

  • Hi, Lucas,

    If I understand correctly that you are able to connect 2 SOM cards, one running Linux as RC and the other RTOS as EP, and have PCIe enumerated. The problem is when the SOM card connected to Linux PC which doesn't get enumerated.

    I think the issue is the PC Linux kernel. It will need AM572x PCIe EP driver in the kernel. If my recollection is right, The AM572x EP support was first done on Kernel 4.4 and has been upstreamed. Your Linux PC kernel needs to have the EP driver to enumerate the EP.

    Rex
  • Rex,

    | If I understand correctly that you are able to connect 2 SOM cards, one running Linux as RC and the other RTOS as EP, and have PCIe enumerated. The problem is when the SOM | card |connected to Linux PC which doesn't get enumerated. 

    Yes, your understanding is correct.

    I am running Ubuntu 18.04.1 LTS, w/ uname -r, and kernel 4.18.14.  

    However, it is my understanding of PCIe, that Link Training and Enumeration should happen regardless of the presence of a driver or not on a Linux PC 
    (and my experiments where I removed a driver for a PCIe device verified this, as it would enumerate and show up on #lspci, but would not function when the driver was not present).  Is there anyone at TI that has had the Sitara device enumerate with a Linux PC?  We've already done rework to deal with the PCs spread spectrum clock.  What else am I missing?  (FYI, I tried with Win 10 and it doesn't enumerate there either) .

    Luke 

  • Hi,

    Can I summarize you test cases:

    Case 1: Board 1 (EP, RTOS code) ----- Board 2 (RC, Yocto, RTOS?), separate PCIE reference clock, working
    Case 2: Board 1 (EP, RTOS code) ----- Board 2 (RC, Yocto, RTOS?), common PCIE reference clock, working
    Case 3: Board 1 (EP, RTOS code) ----- Board 2 (RC, Linux), common PCIE reference clock, working
    Case 4: Board 1 (EP, RTOS code) ----- Windows/Linux PC(RC), common PCIE reference clock, doesn't working

    In case 2/3 where worked, do you change the RTOS code to accept the clock from remote side instead of using on-board crystal? See some discussion e2e.ti.com/.../653443

    Regards, Eric
  • Hi, Lucas,

    We didn't try connecting an EVM to a PC, Linux or Windows. However, one of customers had successfully brought up the PCIe with a Windows PC.
    Please refer to this e2e thread, e2e.ti.com/.../653443

    One thing I want to point out is that the EP needs to be up before RC starts. That's what we did when testing EP mode using 2 AM57x EVMs. It is vague how the other customer managed to have AM57x EVM EP up and got it detected in the thread.

    Rex
  • Rex,

    Thank you for your response, I have read e2e.ti.com/.../653443 multiple time before, but it it really isn't clear to me what needs to be done to accomplish a PCIe link from it. 

    The threads don't seem to be providing the direct answers and support that I need to achieve my end goal (both the ones I stared and anything remotely related that I've read). We are looking to make a commercial product using PCIe coms between a Sitara device and a Linux PC and this really isn't seeming to be as straight forward as I had anticipated and doesn't seem to be anything that TI has done or is currently supporting as a use case.  Are there PCIe specialists at TI that I can engage with to get a direct answer on how to establish these types of coms?  I am willing to pay for a support contract to achieve this?  We need to establish how to achieve this link in order to move forward with our current design and the use of the Sitara device.      

    Thanks,

    Luke

  • Hi, Luke,

    Just want to confirm that in the Linux PC/SOM EP card test. the EP had been powered up and running before Linux started.

    Rex
  • Confirmed.
    1. PC is power off (all LEDs off)
    2. Connect PCIe cable
    3. Power up Sitara as EP
    4. Power up PC

    Luke
  • a few more questions. What is this BSP-Yocto-TISDK-AM57xx-PD18.2.0? is it RTOS? and when you have Linux running on SOM, what Linux? The kernel version, provided by Phytec or TI download?
  • I have 2 Phytec Development Kit Boards that I have been working with.

    #1 - PROCESSOR-SDK-RTOS-AM57X:

    root@am57xx-phycore-rdk:~# uname -r
    4.4.32

    #2 - PROCESSOR-SDK-LINUX-AM57X

    root@am5728-phycore-rdk:~# uname -r
    4.9.41-ga962b18-BSP-Yocto-TISDK-AM57xx-PD18.1.0

    Did this sufficiently answer your question?

    Luke

  • Hi, Luke,

    When successfully getting PCIe enumerated using 2 SoM cards, you mentioned how the jumper was restored, etc. but didn't mention how the PCIe EP was configured. We had other customer getting PCIe enumerated between Ubuntu RC Linux and AM572x EP Linux with patch to configure ACSPCIE in Rx mode. Therefore, I suspect it is the RTOS EP configuration. I'll need to have Eric to work with you on RTOS side.

    Rex
  • Hi,

    Can you answer my post 10/23 below:
    ===========================================================
    Hi,

    Can I summarize you test cases:

    Case 1: Board 1 (EP, RTOS code) ----- Board 2 (RC, Yocto, RTOS?), separate PCIE reference clock, working
    Case 2: Board 1 (EP, RTOS code) ----- Board 2 (RC, Yocto, RTOS?), common PCIE reference clock, working
    Case 3: Board 1 (EP, RTOS code) ----- Board 2 (RC, Linux), common PCIE reference clock, working
    Case 4: Board 1 (EP, RTOS code) ----- Windows/Linux PC(RC), common PCIE reference clock, doesn't working

    In case 2/3 where worked, do you change the RTOS code to accept the clock from remote side instead of using on-board crystal? See some discussion e2e.ti.com/.../653443
    ==========================================================

    Specifically, please look at AM5728 TRM:
    1. CTRL_CORE_SMA_SW_6

    17:16 PCIE_TX_RX_CONTROL PCIe RX and TX control of ACSPCIe.
    0x0: ACSPCIe Power Down Mode
    0x1: ACSPCIe TX Mode
    0x2: ACSPCIe RX Mode
    0x3: Reserved

    2. CM_CLKMODE_APLL_PCIE
    7 REFSEL Select source of reference input clock RW 0x0
    0x0: APLL reference input clock is from ADPLL
    0x1: APLL reference input clock is from ACSPCIE

    8 CLKDIV_BYPASS 0x0: Division of CLKVCOLDO_DIV clock is controlled by RW 0x0
    OUTSEL pin driven by PCIE controlleur. If OUTSEL is '0',
    CLKVCOLDO_DIV is at same frequency than
    CLKVCOLDO output If OUTSEL is '1', CLKVCOLDO_DIV
    is at CLKVCOLDO divide by 2 frequency
    0x1: CLKVCOLDO_DIV clock is not divided by 2
    (CLKVCOLDO_DIV is at same frequency than
    CLKVCOLDO output)

    Please indicate what you used for above bits. I don't understand how you make case 2 and case 3 work using the default RTOS PCIE code setting.

    Regards, Eric
  • Rex,

    For both SOM(EP) to SOM(RC), and SOM(RC) to PC(EP), we ran the  PCIE_am572x_phycore_rdk_wSoCFile_armExampleProject w/ the pcie_sample.c file on the SOMS.  During startup you are prompted to to choose E or R, to put the SOM into an endpoint or root complex mode.  

    Luke

  • Hi Luke,

    Thanks! The RTOS PCIE sample is a board to board test setup with each board using its on board PCIE reference clock and this clock is also Tx to the remote side, that is why we have to use a PCIE cross-over cable WITH clock signal cut off to avoiding clock conflict.

    Given your case 2 and 3, if RC sends the PCIE clock to EP through the PCIE connection, and EP side DOESN'T configure the ACSPCIE in RX mode and EP side has no crystal to generate PCIE reference clock, I don't understand how that you have PCIE link worked. I don't understand where the EP gets reference clock. My best guess is that RC and EP somehow still get its own 100MHz clock separately, that why it worked?

    In your test case 4 where Linux PC using a spread spectrum clock, you have to configure the EP side in ACSPCIE Rx mode. Please try to change:

    1. CTRL_CORE_SMA_SW_6

    17:16 PCIE_TX_RX_CONTROL PCIe RX and TX control of ACSPCIe.

    0x2: ACSPCIe RX Mode

    2. CM_CLKMODE_APLL_PCIE

    7 REFSEL Select source of reference input clock RW 0x0

    0x1: APLL reference input clock is from ACSPCIE

    8 CLKDIV_BYPASS

    0x1: CLKVCOLDO_DIV clock is not divided by 2

    (CLKVCOLDO_DIV is at same frequency than

    CLKVCOLDO output)

    Let me know if this change on EP side only doesn't break case 2 and case 3, then if it helps in case 4.

    Regards, Eric

  • Luke,

    Any update for this?

    Regards, Eric
  • Eric,

    I'm on vacation and will try this when I get back on Monday the 5th of November.

    Thanks,

    Luke

  • Luke,

    Let us know if you get chance to try this.

    Regards, Eric
  • Lucas,

    I am closing this for now. Please open a new one when you have chance to re-visit the topic.

    Regards, Eric