pci-endpoint-cfs.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. CONFIGURING PCI ENDPOINT USING CONFIGFS
  2. Kishon Vijay Abraham I <kishon@ti.com>
  3. The PCI Endpoint Core exposes configfs entry (pci_ep) in order to configure the
  4. PCI endpoint function and in order to bind the endpoint function
  5. with the endpoint controller. (For introducing other mechanisms to
  6. configure the PCI Endpoint Function refer [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 directory structure has been created to reflect the
  13. natural tree like structure of PCI devices. So every directory created
  14. inside pci_ep represents a EPC device and every directory created inside
  15. epf directory represents EPF device.
  16. /sys/kernel/config/pci_ep/
  17. | <dir>/ --------------------------------------> [2]
  18. | epc
  19. | epf/
  20. | <dir>/ --------------------------> [3]
  21. | vendorid
  22. | deviceid
  23. | revid
  24. | progif_code
  25. | subclass_code
  26. | baseclass_code
  27. | cache_line_size
  28. | subsys_vendor_id
  29. | subsys_id
  30. | interrupt_pin
  31. | function
  32. *) Creating configfs entry for EPC
  33. Any directory created inside *pci_ep* represents an EPC device. In the above
  34. directory structure [2] represents an EPC device. It consists of
  35. *) epc: Use it to associate the configfs entry to an actual EPC device.
  36. The list of valid entries for this field can be obtained from
  37. ls /sys/class/pci_epc/
  38. *) epf: Directory that contains all the endpoint functions. The name
  39. of the created directory determines the driver this particular
  40. epf device will be bound to. The name can be obtained either
  41. from the function binding documentation [4] or
  42. ls /sys/bus/pci-epf/drivers
  43. If more than one endpoint function device has to be bound to
  44. the same driver, then the directory should be created using
  45. the following notation
  46. mkdir <name>.<num>
  47. *) Creating configfs entry for EPF
  48. Any directory created inside *epf* directory represents an EPF device. In the
  49. above directory structure, [3] represents an EPF device. It consists of the
  50. following entries that can be used to configure the standard configuration
  51. header of the endpoint function. (These entries are created by the
  52. framework when any new directory is created inside epf directory.)
  53. | vendorid
  54. | deviceid
  55. | revid
  56. | progif_code
  57. | subclass_code
  58. | baseclass_code
  59. | cache_line_size
  60. | subsys_vendor_id
  61. | subsys_id
  62. | interrupt_pin
  63. The following entry identifies the function driver that is bound to the
  64. function device
  65. | function
  66. [1] -> Documentation/PCI/endpoint/pci-endpoint.txt
  67. [4] -> Documentation/PCI/endpoint/function/binding/