diff options
author | Kishon Vijay Abraham I <kishon@ti.com> | 2017-03-27 05:45:00 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-04-11 15:18:36 -0400 |
commit | bea37d3d3121d051b12541f06327d7ac63996fc0 (patch) | |
tree | 29f6db70b26218cf01d14646ba4af794c6c56266 | |
parent | d746799116103d857be203382b09035bbe225d03 (diff) |
Documentation: PCI: Guide to use PCI endpoint configfs
Add Documentation to help users use PCI endpoint to configure PCI endpoint
function and to bind the endpoint function with endpoint controller.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-By: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | Documentation/PCI/00-INDEX | 2 | ||||
-rw-r--r-- | Documentation/PCI/endpoint/pci-endpoint-cfs.txt | 105 |
2 files changed, 107 insertions, 0 deletions
diff --git a/Documentation/PCI/00-INDEX b/Documentation/PCI/00-INDEX index ba950b296bd8..bf8223a1bf08 100644 --- a/Documentation/PCI/00-INDEX +++ b/Documentation/PCI/00-INDEX | |||
@@ -14,3 +14,5 @@ pcieaer-howto.txt | |||
14 | - the PCI Express Advanced Error Reporting Driver Guide HOWTO | 14 | - the PCI Express Advanced Error Reporting Driver Guide HOWTO |
15 | endpoint/pci-endpoint.txt | 15 | endpoint/pci-endpoint.txt |
16 | - guide to add endpoint controller driver and endpoint function driver. | 16 | - guide to add endpoint controller driver and endpoint function driver. |
17 | endpoint/pci-endpoint-cfs.txt | ||
18 | - guide to use configfs to configure the PCI endpoint function. | ||
diff --git a/Documentation/PCI/endpoint/pci-endpoint-cfs.txt b/Documentation/PCI/endpoint/pci-endpoint-cfs.txt new file mode 100644 index 000000000000..d740f29960a4 --- /dev/null +++ b/Documentation/PCI/endpoint/pci-endpoint-cfs.txt | |||
@@ -0,0 +1,105 @@ | |||
1 | CONFIGURING PCI ENDPOINT USING CONFIGFS | ||
2 | Kishon Vijay Abraham I <kishon@ti.com> | ||
3 | |||
4 | The PCI Endpoint Core exposes configfs entry (pci_ep) to configure the | ||
5 | PCI endpoint function and to bind the endpoint function | ||
6 | with the endpoint controller. (For introducing other mechanisms to | ||
7 | configure the PCI Endpoint Function refer to [1]). | ||
8 | |||
9 | *) Mounting configfs | ||
10 | |||
11 | The PCI Endpoint Core layer creates pci_ep directory in the mounted configfs | ||
12 | directory. configfs can be mounted using the following command. | ||
13 | |||
14 | mount -t configfs none /sys/kernel/config | ||
15 | |||
16 | *) Directory Structure | ||
17 | |||
18 | The pci_ep configfs has two directories at its root: controllers and | ||
19 | functions. Every EPC device present in the system will have an entry in | ||
20 | the *controllers* directory and and every EPF driver present in the system | ||
21 | will have an entry in the *functions* directory. | ||
22 | |||
23 | /sys/kernel/config/pci_ep/ | ||
24 | .. controllers/ | ||
25 | .. functions/ | ||
26 | |||
27 | *) Creating EPF Device | ||
28 | |||
29 | Every registered EPF driver will be listed in controllers directory. The | ||
30 | entries corresponding to EPF driver will be created by the EPF core. | ||
31 | |||
32 | /sys/kernel/config/pci_ep/functions/ | ||
33 | .. <EPF Driver1>/ | ||
34 | ... <EPF Device 11>/ | ||
35 | ... <EPF Device 21>/ | ||
36 | .. <EPF Driver2>/ | ||
37 | ... <EPF Device 12>/ | ||
38 | ... <EPF Device 22>/ | ||
39 | |||
40 | In order to create a <EPF device> of the type probed by <EPF Driver>, the | ||
41 | user has to create a directory inside <EPF DriverN>. | ||
42 | |||
43 | Every <EPF device> directory consists of the following entries that can be | ||
44 | used to configure the standard configuration header of the endpoint function. | ||
45 | (These entries are created by the framework when any new <EPF Device> is | ||
46 | created) | ||
47 | |||
48 | .. <EPF Driver1>/ | ||
49 | ... <EPF Device 11>/ | ||
50 | ... vendorid | ||
51 | ... deviceid | ||
52 | ... revid | ||
53 | ... progif_code | ||
54 | ... subclass_code | ||
55 | ... baseclass_code | ||
56 | ... cache_line_size | ||
57 | ... subsys_vendor_id | ||
58 | ... subsys_id | ||
59 | ... interrupt_pin | ||
60 | |||
61 | *) EPC Device | ||
62 | |||
63 | Every registered EPC device will be listed in controllers directory. The | ||
64 | entries corresponding to EPC device will be created by the EPC core. | ||
65 | |||
66 | /sys/kernel/config/pci_ep/controllers/ | ||
67 | .. <EPC Device1>/ | ||
68 | ... <Symlink EPF Device11>/ | ||
69 | ... <Symlink EPF Device12>/ | ||
70 | ... start | ||
71 | .. <EPC Device2>/ | ||
72 | ... <Symlink EPF Device21>/ | ||
73 | ... <Symlink EPF Device22>/ | ||
74 | ... start | ||
75 | |||
76 | The <EPC Device> directory will have a list of symbolic links to | ||
77 | <EPF Device>. These symbolic links should be created by the user to | ||
78 | represent the functions present in the endpoint device. | ||
79 | |||
80 | The <EPC Device> directory will also have a *start* field. Once | ||
81 | "1" is written to this field, the endpoint device will be ready to | ||
82 | establish the link with the host. This is usually done after | ||
83 | all the EPF devices are created and linked with the EPC device. | ||
84 | |||
85 | |||
86 | | controllers/ | ||
87 | | <Directory: EPC name>/ | ||
88 | | <Symbolic Link: Function> | ||
89 | | start | ||
90 | | functions/ | ||
91 | | <Directory: EPF driver>/ | ||
92 | | <Directory: EPF device>/ | ||
93 | | vendorid | ||
94 | | deviceid | ||
95 | | revid | ||
96 | | progif_code | ||
97 | | subclass_code | ||
98 | | baseclass_code | ||
99 | | cache_line_size | ||
100 | | subsys_vendor_id | ||
101 | | subsys_id | ||
102 | | interrupt_pin | ||
103 | | function | ||
104 | |||
105 | [1] -> Documentation/PCI/endpoint/pci-endpoint.txt | ||