SPRADH9 June   2024 AM6442

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Abbreviations
  5. 2Introduction
    1. 2.1 Peripheral Component Interconnect Express
      1. 2.1.1 Components of PCIe Communication
        1. 2.1.1.1 Root Complex
        2. 2.1.1.2 Repeater
        3. 2.1.1.3 Endpoints
      2. 2.1.2 Signaling
        1. 2.1.2.1 PERST
        2. 2.1.2.2 WAKE and CLKREQ
        3. 2.1.2.3 REFCLK
      3. 2.1.3 PCIe Common Usage
      4. 2.1.4 PCIe Aggregate Throughput
    2. 2.2 PCIe Features on AM64x and AM243x
  6. 3X86 as RC and AM64x as EP
    1. 3.1 Hardware Environment
    2. 3.2 Software Environment
      1. 3.2.1 Building Application
      2. 3.2.2 Usage
  7. 4Test Setup
    1. 4.1 Common Setup for LINUX and WIN
    2. 4.2 Linux Driver (VFIO)
      1. 4.2.1 Prerequisites
      2. 4.2.2 Building
      3. 4.2.3 Deploying
    3. 4.3 Test Application Usage
    4. 4.4 Setup Steps for LINUX PC
      1. 4.4.1 UART Console Output
    5. 4.5 MSI Example
    6. 4.6 Setup Steps for WINDOWS PC
      1. 4.6.1 Prerequisites
      2. 4.6.2 Building
      3. 4.6.3 Deploying
  8. 5PCIe Test Specification
    1. 5.1  Identification and Configuration Functionalities
      1. 5.1.1 Test Case
    2. 5.2  Reference Clock Functionalities
    3. 5.3  Inbound ATU and BAR Functionalities
    4. 5.4  Outbound ATU Functionalities
    5. 5.5  MSI Functionality
    6. 5.6  Downstream Interrupt Functionality
    7. 5.7  Device Power Management State Functionality
    8. 5.8  Function Level Reset Mechanism
    9. 5.9  Legacy Interrupt Mechanism
    10. 5.10 MSI-X Capability
    11. 5.11 Hot Reset Mechanism
  9. 6Windows Example Driver Verification
  10. 7References

Setup Steps for LINUX PC

Since a RC sample application ti-sample-vfio based on Linux VFIO driver is implemented for testing and verification purposes, some tests descripted on Section 5 require the usage. To use ti-sample-vfio, the following setup needs to be implemented:

  1. On successful PCIe boot up open Linux terminal and acquire root privileges:
    sudo su
  2. Determine bus-, device-, and function number of TMDS243EVM PCIe EP device using lspci command in Linux terminal. Use the vendor and device ID as set in Sysconfig. Search for it with the following command which shows related information of all PCIe devices numerically:
    lspci -vtn
    AM6442
  3. The output of the previous command is shown in the following figure. In that case, the PCIe EP is assigned the bus 4, device 00 and function 0.
  4. Load the VFIO-PCI driver using modprobe:
    modprobe vfio-pci
  5. Assign TMDS243EVM PCIe EP vendor and device ID to the VFIO driver.

    echo "17cd 0100" > /sys/bus/pci/drivers/vfio-pci/new_id
    AM6442
  6. Check which IOMMU group the PCIe EP is assigned to:
    readlink /sys/bus/pci/devices/0000:04:00.0/iommu_group
    1. The output of the previous command can provide: PCIe EP assigned the IOMMU group.
  7. Make sure the EP is the only device in this IOMMU group:
    ls -l /sys/bus/pci/devices/0000:04:00.0/iommu_group/devices
    AM6442

    As can be seen the TMDS243EVM PCIe EP is the only device in IOMMU group 60. In case of additional PCIe devices within the same IOMMU group, these PCIe devices must be bind to VFIO driver as well.

  8. Compile ti-sample-vfio (root privileges are no longer needed for the next steps):
    gcc ti-sample-vfio.c -o ti-sample-vfio -g -O2
  9. Execute ti-sample-vfio application with previously determined parameter:
    sudo ./ti-sample-vfio 40 0 60 1 wait
    AM6442
Note: The ti-sample-vfio application requires the following parameter for execution:
  1. [bus]: PCIe EP bus number
  2. [device]: PCIe EP device number
  3. [function]: PCIe EP function number
  4. [IOMMU group]: PCIe EP IOMMU group
  5. [test_mode] This parameter is only required for test case 4.3.2 which refers to an extended inbound ATU/BAR configuration (see the corresponding description). To start the test case, the parameter testbars must be passed. Otherwise, this parameter can be omitted, and the input is interpreted as the subsequent parameter [Number of MSI IRQs].
  6. [Number of MSI IRQs]: Number of to be tested MSI IRQs as descripted on Test 4.5.2. This parameter needs to be set to 1 if test 4.5.2 is not performed.
  7. [Number of loops]: Number of loops the test program can execute. This parameter is optional and can be left empty. The default value is 10.
  8. [‘wait’] This parameter instructs the test program to wait for user input throughout the execution of the test application.