@@ -511,96 +511,95 @@ The following config options have to be enabled in order to use the
511511
512512.. ifconfig :: CONFIG_part_family in ('AM64X_family','J7_family')
513513
514- pci\_ endpoint\_ test driver creates the Endpoint Test function device which
515- will be used by the following pcitest utility. pci\_ endpoint\_ test can
516- either be built-in to the kernel or built as a module. For testing legacy
517- interrupt, MSI interrupt has to be disabled in the host.
514+ The ``pci_endpoint_test `` driver creates an endpoint test function device that
515+ the following ``pci_endpoint_test `` utility uses. The ``pci_endpoint_test `` driver
516+ can either be built-in to the kernel or built as a module.
518517
519- pcitest.sh added in tools/pci/ can be used to run all the default PCI
520- endpoint tests. Before pcitest.sh can be used, pcitest.c should be compiled
521- using following steps:
518+ The test utility at :file: ` tools/testing/selftests/pci_endpoint/pci_endpoint_test.c `
519+ is present in SDK rootfs at :file: ` /usr/kernel-selftest/pci_endpoint/pci_endpoint_test `.
520+ Use this utility to run all the default PCI endpoint tests.
522521
523- ::
522+ .. code-block :: console
524523
525- cd <kernel-dir>
526- make headers_install ARCH=arm64
527- aarch64-linux-gnu-gcc -Iusr/include tools/pci/pcitest.c -o pcitest
528- cp pcitest <rootfs>/usr/sbin/
529- cp tools/pci/pcitest.sh <rootfs>
524+ export PATH=$PATH:/usr/kernel-selftest/pci_endpoint
530525
531- .. rubric :: pcitest output
526+ .. rubric :: pci_endpoint_test output
532527
533- pcitest can be used as follows:
534- ::
528+ Run pci_endpoint_test as follows:
535529
536- root@evm:~# ./pcitest -h
537- usage: -h Print this help message
538- [options]
539- Options:
540- -D <dev> PCI endpoint test device {default: /dev/pci-endpoint-test.0}
541- -b <bar num> BAR test (bar number between 0..5)
542- -m <msi num> MSI test (msi number between 1..32)
543- -x <msix num> MSI-X test (msix number between 1..2048)
544- -i <irq type> Set IRQ type (0 - Legacy, 1 - MSI, 2 - MSI-X)
545- -e Clear IRQ
546- -I Get current IRQ type configured
547- -l Legacy IRQ test
548- -r Read buffer test
549- -w Write buffer test
550- -c Copy buffer test
551- -s <size> Size of buffer {default: 100KB}
552-
553-
554- Sample usage
555- ::
530+ .. code-block :: console
531+
532+ root@evm:~# pci_endpoint_test -h
533+ Usage: ./pci_endpoint_test [-h|-l|-d] [-t|-T|-v|-V|-f|-F|-r name]
534+ -h print help
535+ -l list all tests
536+ -d enable debug prints
537+
538+ -t name include test
539+ -T name exclude test
540+ -v name include variant
541+ -V name exclude variant
542+ -f name include fixture
543+ -F name exclude fixture
544+ -r name run specified test
545+
546+ Test filter options can be specified multiple times. The filtering stops
547+ at the first match. For example to include all tests from variant 'bla'
548+ but not test 'foo' specify '-T foo -v bla'.
549+
550+ The command ``pci_endpoint_test `` runs all the bar tests, interrupt tests,
551+ read tests, write tests and copy tests. Run various tests individually using
552+ the following commands:
553+
554+ .. code-block :: console
555+
556+ root@evm:~# pci_endpoint_test -r pci_ep_basic.MSI_TEST
557+ root@evm:~# pci_endpoint_test -r pci_ep_basic.MSIX_TEST
558+ root@evm:~# pci_endpoint_test -r pci_ep_basic.LEGACY_IRQ_TEST
559+
560+ root@evm:~# pci_endpoint_test -r pci_ep_bar.BAR0.BAR_TEST
561+ root@evm:~# pci_endpoint_test -r pci_ep_bar.BAR1.BAR_TEST
562+ root@evm:~# pci_endpoint_test -r pci_ep_bar.BAR2.BAR_TEST
563+ root@evm:~# pci_endpoint_test -r pci_ep_bar.BAR3.BAR_TEST
564+ root@evm:~# pci_endpoint_test -r pci_ep_bar.BAR4.BAR_TEST
565+ root@evm:~# pci_endpoint_test -r pci_ep_bar.BAR5.BAR_TEST
556566
557- root@evm:~# ./pcitest -i 1 -D /dev/pci-endpoint-test.0
558- SET IRQ TYPE TO MSI: OKAY
559- root@evm:~# ./pcitest -m 1 -D /dev/pci-endpoint-test.0
560- MSI1: OKAY
561- root@evm:~# ./pcitest -e -D /dev/pci-endpoint-test.0
562- CLEAR IRQ: OKAY
563- root@evm:~# ./pcitest -i 2 -D /dev/pci-endpoint-test.0
564- SET IRQ TYPE TO MSI-X: OKAY
565- root@evm:~# ./pcitest -x 1 -D /dev/pci-endpoint-test.0
566- MSI-X1: OKAY
567- root@evm:~# ./pcitest -e -D /dev/pci-endpoint-test.0
568- CLEAR IRQ: OKAY
569-
570- The script pcitest.sh runs all the bar tests, interrupt tests, read tests,
571- write tests and copy tests.
567+ root@evm:~# pci_endpoint_test -r pci_ep_data_transfer.dma.READ_TEST
568+ root@evm:~# pci_endpoint_test -r pci_ep_data_transfer.memcpy.READ_TEST
569+ root@evm:~# pci_endpoint_test -r pci_ep_data_transfer.dma.WRITE_TEST
570+ root@evm:~# pci_endpoint_test -r pci_ep_data_transfer.memcpy.WRITE_TEST
571+ root@evm:~# pci_endpoint_test -r pci_ep_data_transfer.dma.COPY_TEST
572+ root@evm:~# pci_endpoint_test -r pci_ep_data_transfer.memcpy.COPY_TEST
572573
573574 .. rubric :: **Files**
574575
575576.. ifconfig :: CONFIG_part_family in ('AM64X_family','J7_family')
576577
577- +-----------+---------------------------------------------------+-----------------------------------+
578- | Serial No | Location | Description |
579- +===========+===================================================+===================================+
580- | 1 | drivers/pci/endpoint/pci-epc-core.c | PCI Endpoint Framework |
581- + +---------------------------------------------------+ +
582- | | drivers/pci/endpoint/pci-ep-cfs.c | |
583- + +---------------------------------------------------+ +
584- | | drivers/pci/endpoint/pci-epc-mem.c | |
585- + +---------------------------------------------------+ +
586- | | drivers/pci/endpoint/pci-epf-core.c | |
587- +-----------+---------------------------------------------------+-----------------------------------+
588- | 2 | drivers/pci/endpoint/functions/pci-epf-test.c | PCI Endpoint Function Driver |
589- +-----------+---------------------------------------------------+-----------------------------------+
590- | 3 | drivers/misc/pci_endpoint_test.c | PCI Driver |
591- +-----------+---------------------------------------------------+-----------------------------------+
592- | 4 | tools/pci/pcitest.c | PCI Userspace Tools |
593- + +---------------------------------------------------+ +
594- | | tools/pci/pcitest.sh | |
595- +-----------+---------------------------------------------------+-----------------------------------+
596- | 5 | drivers/pci/controller/pci-j721e.c | PCI Controller Driver |
597- + +---------------------------------------------------+ +
598- | | drivers/pci/controller/pcie-cadence.c | |
599- + +---------------------------------------------------+ +
600- | | drivers/pci/controller/pcie-cadence-ep.c | |
601- + +---------------------------------------------------+ +
602- | | drivers/pci/endpoint/pcie-cadence-host.c | |
603- +-----------+---------------------------------------------------+-----------------------------------+
578+ +-----------+-----------------------------------------------------------+-----------------------------------+
579+ | Serial No | Location | Description |
580+ +===========+===========================================================+===================================+
581+ | 1 | drivers/pci/endpoint/pci-epc-core.c | PCI Endpoint Framework |
582+ + +-----------------------------------------------------------+ +
583+ | | drivers/pci/endpoint/pci-ep-cfs.c | |
584+ + +-----------------------------------------------------------+ +
585+ | | drivers/pci/endpoint/pci-epc-mem.c | |
586+ + +-----------------------------------------------------------+ +
587+ | | drivers/pci/endpoint/pci-epf-core.c | |
588+ +-----------+-----------------------------------------------------------+-----------------------------------+
589+ | 2 | drivers/pci/endpoint/functions/pci-epf-test.c | PCI Endpoint Function Driver |
590+ +-----------+-----------------------------------------------------------+-----------------------------------+
591+ | 3 | drivers/misc/pci_endpoint_test.c | PCI Driver |
592+ +-----------+-----------------------------------------------------------+-----------------------------------+
593+ | 4 | tools/testing/selftests/pci_endpoint/pci_endpoint_test.c | PCI Userspace Tools |
594+ +-----------+-----------------------------------------------------------+-----------------------------------+
595+ | 5 | drivers/pci/controller/pci-j721e.c | PCI Controller Driver |
596+ + +-----------------------------------------------------------+ +
597+ | | drivers/pci/controller/pcie-cadence.c | |
598+ + +-----------------------------------------------------------+ +
599+ | | drivers/pci/controller/pcie-cadence-ep.c | |
600+ + +-----------------------------------------------------------+ +
601+ | | drivers/pci/controller/pcie-cadence-host.c | |
602+ +-----------+-----------------------------------------------------------+-----------------------------------+
604603
605604.. ifconfig :: CONFIG_part_family in ('J7_family')
606605
0 commit comments