pci-endpoint-cfs.txt 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. CONFIGURING PCI ENDPOINT USING CONFIGFS
  2. Kishon Vijay Abraham I <kishon@ti.com>
  3. The PCI Endpoint Core exposes configfs entry (pci_ep) to configure the
  4. PCI endpoint function and to bind the endpoint function
  5. with the endpoint controller. (For introducing other mechanisms to
  6. configure the PCI Endpoint Function refer to [1]).
  7. *) Mounting configfs
  8. The PCI Endpoint Core layer creates pci_ep directory in the mounted configfs
  9. directory. configfs can be mounted using the following command.
  10. mount -t configfs none /sys/kernel/config
  11. *) Directory Structure
  12. The pci_ep configfs has two directories at its root: controllers and
  13. functions. Every EPC device present in the system will have an entry in
  14. the *controllers* directory and and every EPF driver present in the system
  15. will have an entry in the *functions* directory.
  16. /sys/kernel/config/pci_ep/
  17. .. controllers/
  18. .. functions/
  19. *) Creating EPF Device
  20. Every registered EPF driver will be listed in controllers directory. The
  21. entries corresponding to EPF driver will be created by the EPF core.
  22. /sys/kernel/config/pci_ep/functions/
  23. .. <EPF Driver1>/
  24. ... <EPF Device 11>/
  25. ... <EPF Device 21>/
  26. .. <EPF Driver2>/
  27. ... <EPF Device 12>/
  28. ... <EPF Device 22>/
  29. In order to create a <EPF device> of the type probed by <EPF Driver>, the
  30. user has to create a directory inside <EPF DriverN>.
  31. Every <EPF device> directory consists of the following entries that can be
  32. used to configure the standard configuration header of the endpoint function.
  33. (These entries are created by the framework when any new <EPF Device> is
  34. created)
  35. .. <EPF Driver1>/
  36. ... <EPF Device 11>/
  37. ... vendorid
  38. ... deviceid
  39. ... revid
  40. ... progif_code
  41. ... subclass_code
  42. ... baseclass_code
  43. ... cache_line_size
  44. ... subsys_vendor_id
  45. ... subsys_id
  46. ... interrupt_pin
  47. *) EPC Device
  48. Every registered EPC device will be listed in controllers directory. The
  49. entries corresponding to EPC device will be created by the EPC core.
  50. /sys/kernel/config/pci_ep/controllers/
  51. .. <EPC Device1>/
  52. ... <Symlink EPF Device11>/
  53. ... <Symlink EPF Device12>/
  54. ... start
  55. .. <EPC Device2>/
  56. ... <Symlink EPF Device21>/
  57. ... <Symlink EPF Device22>/
  58. ... start
  59. The <EPC Device> directory will have a list of symbolic links to
  60. <EPF Device>. These symbolic links should be created by the user to
  61. represent the functions present in the endpoint device.
  62. The <EPC Device> directory will also have a *start* field. Once
  63. "1" is written to this field, the endpoint device will be ready to
  64. establish the link with the host. This is usually done after
  65. all the EPF devices are created and linked with the EPC device.
  66. | controllers/
  67. | <Directory: EPC name>/
  68. | <Symbolic Link: Function>
  69. | start
  70. | functions/
  71. | <Directory: EPF driver>/
  72. | <Directory: EPF device>/
  73. | vendorid
  74. | deviceid
  75. | revid
  76. | progif_code
  77. | subclass_code
  78. | baseclass_code
  79. | cache_line_size
  80. | subsys_vendor_id
  81. | subsys_id
  82. | interrupt_pin
  83. | function
  84. [1] -> Documentation/PCI/endpoint/pci-endpoint.txt