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/AM5728: PCIe driver for PC

Part Number: AM5728

Tool/software: Linux

As it's been asked sometimes on how to connect AM5728 to PC using PCIE, the answer is that we need a PC pcie driver (similar to pci_endpoint_test )

I have tried to compile the pcitest.c (under <linux kernel>tools/pci) using 

"gcc -Iusr/include <sdk kernel>/tools/pci/pcitest.c -o pcitest"

and run it on PC linux (ubuntu 16.04). It doesn't work because PC cannot recognize the board (no /dev/pci-endpoint-test.0).   (EP (IDK) side has been boot up and set up correctly before booting up the PC)

So what is TI's suggestion to start with such driver? Is it just some simple modification to the .c file or something much more than that? I have no experience on PCIE driver. 

  • Hi, Xiang,

    Does Ubuntu enumerate the am572x endpoint? Be sure Ubuntu 16.04(kernel 4.4?) has PCIe driver support for TI AM5728 device.

    Rex
  • No it does seem to enum am572x endpoint. I just dont see it under /dev Or how do I check?

    Ubuntu very unlikely to have such driver for am572x (I wonder any linux distros would have since even TI itself doesn't provide it). Does that mean I have to write the driver from scratch? or can I start with the driver on the IDK and modify from there? if so, would you suggest some resources for such modification guide line?

    Appreciate.

    Peter
  • Hi, Xiang,

    Just want to be sure you meant it does "NOT" seem to enum 572x, right?

    TI has not tried to connect AM572x EVM as an EP to a PC (windows or Linux). TI only verified the EP mode between 2 TI platforms, one as RC and the other EP. The kernel supports TI devices usually get upstreamed to the mainstream kernel which you should be able to git from the latest mainstream development branch. If Ubuntu is kernel 4.4, the upstream kernel should have the am572x EP mode support, but please check to confirm the EP mode has been upstreamed.

    Theoretically, with the am572x device PCIe EP support, the RC should be able to enumerate the device. For it to be functional, a host side driver is needed. In TI's reference design, we use the pci-epf-test.c on EP side and pci_endpoint_test.c on host side. You can port them to Ubuntu, or write your own on both sides.

    Rex
  • Yes, " it does "NOT" seem to enum 572x"

    Ubuntu 16.04 uses kernel 4.13, and how do I know verify whether it got the am572x support upstreamed?

    Sorry I don't have much experience at the driver level, but I am willing to dig into with help.

    Thanks.

    Peter

  • Hi, Peter,

    Kernel 4.13 May not have am572x EP support. TI's latest kernel version is 4.9. It may need some effort to port the feature from 4.9 to 4.13. I will have to leave that to you to go through kernel open forum. I won't be able to support that, but can give you pointer to start. Linux Kernel development branch is at https://www.kernel.org/

    You can look through to see in which development branch the am572x EP got upstreamed in. It may be under DRA7x device instead of AM57xx.

    Rex
  • Hi, Peter,

    I'll close this thread for now. If you have other TI related issue, please open a new one. Thanks!

    Rex