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 EP configuration on IDK

Part Number: AM5728
Other Parts Discussed in Thread: AM5728

Tool/software: Linux

I followed  training video, I have the cable and modification done.

SDK version 4.1.0.6

Procedures I have done:

1. clean install SDK from *.bin installation file.

2. setup environment path

3 run /bin/create-sdcard.sh to create a sd card using pre-built image.

4. in SDK root folder, run make all to compile once (otherwise I dont see anything under linux-4.9.41+gitxxxxxxx, where I need dts to modify)

5. still in sdk root,  make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig

6. enable bus support --->PCI Endpoint ---> PCI Endpoint Support and PCI Endpoint Test driver

7. enable PCI host controller drivers ---> Generic PCI host controller and Altera PCIe controller (not be unnecessary)

8. save config and exit

9. open am572x-idk.dts,

change 

&pcie1_rc {

status = "okay";
gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
};

&pcie1_ep {

gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
};

to 

&pcie1_rc {
gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
};

&pcie1_ep {
status = "okay";
gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
};

10. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage

11. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am572x-idk.dtb

12. copy zImage and am572x-idk.dtb into sdcard rootfs/boot/

13 plug in the sd card into IDK and boot. (without connecting the cable). nothing shows when I "lspci"

14. plug in the cable on IDK as well as PC motherboard, boot again, problem remains.

According to the training video from above link, I should see a bunch of stuff under /sys/kernel/config/pci_ep/pci_epf_test.0.  However, I only see epc and epf in there. And there is nothing shows when I "lspci"

Please help. Thank you.

Peter

  • Hi, Peter,

    I believe lspci only applies to RC, not to EP. To connect to a PC, it's a different story. please refer to the following thread for discussion on connecting AM57x to a PC (windows or Linux).

    e2e.ti.com/.../653443

    Rex
  • According to that post, it seems like IDK needed to be modified in order to talk to PC via PCIE, I will wait for our custom board to be ready before going further.

    However, when following the PCIE training video, I only see epc and epf instead of other stuff (in second pic)

    Anyone knows why?

  • Xiang,

    SDK 4.1.0.9 is Kernel v4.9. Are you following the PCIe EP User's Guide, processors.wiki.ti.com/.../Linux_Core_PCIe_EP_User's_Guide

    Rex
  • Yes, I found the problem because there are two Kernel sections, labeled as 4.4 and 4.9 but does not say which one to follow for am5728.

    Anyway, I am again stuck at another place. In the Host setting section.

    When configuring kernel, in order to enbale Endpoint test feature, I will have to enable endpoint mode. (my under standing for endpoint_test feature is that it creates such driver on RC/host in order for test program to use, so that I will see a test drive under /dev; on the other hand, endpoint mode is to change the function to endpoint) Then my question is how do you enable endpoint test feature while still not enable endpoint mode?

    "pci_endpoint_test driver creates the Endpoint Test function device (/dev/pci-endpoint-test.0)"

    I dont see the /dev/pci-endpoint-test.o.

    I managed to fix the EP side, but still have issue on RC side.

    On RC side, I am supposed to see a pci driver under root/dev (not /sys/kernel/config/dev). I thought thats because I didn't enable the driver. So, then I tried to enable the Endpoint Test feature for the RC in the kernel, but that requires enabling endpoint mode (this is RC side). Could you show me how that works?

  • Hi, Xiang,

    The PCIe EP User's Guide shows how to configure on the EP side in EP section and also a section about what RC needs to do. It also indicates EP needs to come up first before powering up the RC. Let me revisit the User's Guide to see if there is anywhere causing the confusion.

    Rex
  • I managed to fix the EP side, but still have issue on RC side.

    On RC side, I am supposed to see a pci driver ("pci_endpoint_test driver creates the Endpoint Test function device (/dev/pci-endpoint-test.0)") under root/dev (not /sys/kernel/config/dev), but its not there. I thought thats because I didn't enable the driver. So, then I tried to enable the Endpoint Test feature for the RC in the kernel, but that requires enabling endpoint mode (this is RC side). Could you show me how that works?
  • Hi, Xiang,

    I checked the .config file in 4.1 release, the configuration has all set up already by default.

    #
    # PCI Endpoint
    #
    CONFIG_PCI_ENDPOINT=y
    CONFIG_PCI_EPF_TEST=y

    # DesignWare PCI Core Support
    #
    CONFIG_PCIE_DW=y
    CONFIG_PCIE_DW_HOST=y
    CONFIG_PCIE_DW_EP=y
    CONFIG_PCI_DRA7XX=y
    CONFIG_PCI_DRA7XX_HOST=y
    CONFIG_PCI_DRA7XX_EP=y

    # CONFIG_LATTICE_ECP3_CONFIG is not set
    CONFIG_SRAM=y
    CONFIG_PCI_ENDPOINT_TEST=y

    All you need to do is to have 2 different DTS files, one for EP and one for RC. Is it not your case?

    If it still doesn't work for you, then I'll need to bring up my set up. If I can't get it done today, I'll be out of office starting tomorrow and continue after I am back on 2/21.

    Rex
  • IDK-to-IDK connection works now. I will create another post for further support on PC linux-to-IDK connection.