pci-test-function.rst 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. .. SPDX-License-Identifier: GPL-2.0
  2. =================
  3. PCI Test Function
  4. =================
  5. :Author: Kishon Vijay Abraham I <kishon@ti.com>
  6. Traditionally PCI RC has always been validated by using standard
  7. PCI cards like ethernet PCI cards or USB PCI cards or SATA PCI cards.
  8. However with the addition of EP-core in linux kernel, it is possible
  9. to configure a PCI controller that can operate in EP mode to work as
  10. a test device.
  11. The PCI endpoint test device is a virtual device (defined in software)
  12. used to test the endpoint functionality and serve as a sample driver
  13. for other PCI endpoint devices (to use the EP framework).
  14. The PCI endpoint test device has the following registers:
  15. 1) PCI_ENDPOINT_TEST_MAGIC
  16. 2) PCI_ENDPOINT_TEST_COMMAND
  17. 3) PCI_ENDPOINT_TEST_STATUS
  18. 4) PCI_ENDPOINT_TEST_SRC_ADDR
  19. 5) PCI_ENDPOINT_TEST_DST_ADDR
  20. 6) PCI_ENDPOINT_TEST_SIZE
  21. 7) PCI_ENDPOINT_TEST_CHECKSUM
  22. 8) PCI_ENDPOINT_TEST_IRQ_TYPE
  23. 9) PCI_ENDPOINT_TEST_IRQ_NUMBER
  24. * PCI_ENDPOINT_TEST_MAGIC
  25. This register will be used to test BAR0. A known pattern will be written
  26. and read back from MAGIC register to verify BAR0.
  27. * PCI_ENDPOINT_TEST_COMMAND
  28. This register will be used by the host driver to indicate the function
  29. that the endpoint device must perform.
  30. ======== ================================================================
  31. Bitfield Description
  32. ======== ================================================================
  33. Bit 0 raise legacy IRQ
  34. Bit 1 raise MSI IRQ
  35. Bit 2 raise MSI-X IRQ
  36. Bit 3 read command (read data from RC buffer)
  37. Bit 4 write command (write data to RC buffer)
  38. Bit 5 copy command (copy data from one RC buffer to another RC buffer)
  39. ======== ================================================================
  40. * PCI_ENDPOINT_TEST_STATUS
  41. This register reflects the status of the PCI endpoint device.
  42. ======== ==============================
  43. Bitfield Description
  44. ======== ==============================
  45. Bit 0 read success
  46. Bit 1 read fail
  47. Bit 2 write success
  48. Bit 3 write fail
  49. Bit 4 copy success
  50. Bit 5 copy fail
  51. Bit 6 IRQ raised
  52. Bit 7 source address is invalid
  53. Bit 8 destination address is invalid
  54. ======== ==============================
  55. * PCI_ENDPOINT_TEST_SRC_ADDR
  56. This register contains the source address (RC buffer address) for the
  57. COPY/READ command.
  58. * PCI_ENDPOINT_TEST_DST_ADDR
  59. This register contains the destination address (RC buffer address) for
  60. the COPY/WRITE command.
  61. * PCI_ENDPOINT_TEST_IRQ_TYPE
  62. This register contains the interrupt type (Legacy/MSI) triggered
  63. for the READ/WRITE/COPY and raise IRQ (Legacy/MSI) commands.
  64. Possible types:
  65. ====== ==
  66. Legacy 0
  67. MSI 1
  68. MSI-X 2
  69. ====== ==
  70. * PCI_ENDPOINT_TEST_IRQ_NUMBER
  71. This register contains the triggered ID interrupt.
  72. Admissible values:
  73. ====== ===========
  74. Legacy 0
  75. MSI [1 .. 32]
  76. MSI-X [1 .. 2048]
  77. ====== ===========