^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) =====================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Driver for PCI Endpoint Test Function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) =====================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) This driver should be used as a host side driver if the root complex is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) connected to a configurable PCI endpoint running ``pci_epf_test`` function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) driver configured according to [1]_.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) The "pci_endpoint_test" driver can be used to perform the following tests.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) The PCI driver for the test device performs the following tests:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #) verifying addresses programmed in BAR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #) raise legacy IRQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #) raise MSI IRQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #) raise MSI-X IRQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #) read data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #) write data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #) copy data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) This misc driver creates /dev/pci-endpoint-test.<num> for every
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) ``pci_epf_test`` function connected to the root complex and "ioctls"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) should be used to perform the above tests.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) ioctl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) -----
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) PCITEST_BAR:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Tests the BAR. The number of the BAR to be tested
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) should be passed as argument.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) PCITEST_LEGACY_IRQ:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) Tests legacy IRQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) PCITEST_MSI:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) Tests message signalled interrupts. The MSI number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) to be tested should be passed as argument.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) PCITEST_MSIX:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) Tests message signalled interrupts. The MSI-X number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) to be tested should be passed as argument.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) PCITEST_SET_IRQTYPE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) Changes driver IRQ type configuration. The IRQ type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) should be passed as argument (0: Legacy, 1:MSI, 2:MSI-X).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) PCITEST_GET_IRQTYPE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) Gets driver IRQ type configuration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) PCITEST_WRITE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) Perform write tests. The size of the buffer should be passed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) as argument.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) PCITEST_READ:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) Perform read tests. The size of the buffer should be passed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) as argument.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) PCITEST_COPY:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) Perform read tests. The size of the buffer should be passed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) as argument.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) .. [1] Documentation/PCI/endpoint/function/binding/pci-test.rst