pci-test-function.txt 2.4 KB

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