1 .. SPDX-License-Identifier: GPL-2.0
3 =======================================
4 Configuring PCI Endpoint Using CONFIGFS
5 =======================================
7 :Author: Kishon Vijay Abraham I <kishon@ti.com>
9 The PCI Endpoint Core exposes configfs entry (pci_ep) to configure the
10 PCI endpoint function and to bind the endpoint function
11 with the endpoint controller. (For introducing other mechanisms to
12 configure the PCI Endpoint Function refer to [1]).
17 The PCI Endpoint Core layer creates pci_ep directory in the mounted configfs
18 directory. configfs can be mounted using the following command::
20 mount -t configfs none /sys/kernel/config
25 The pci_ep configfs has two directories at its root: controllers and
26 functions. Every EPC device present in the system will have an entry in
27 the *controllers* directory and every EPF driver present in the system
28 will have an entry in the *functions* directory.
31 /sys/kernel/config/pci_ep/
38 Every registered EPF driver will be listed in controllers directory. The
39 entries corresponding to EPF driver will be created by the EPF core.
42 /sys/kernel/config/pci_ep/functions/
50 In order to create a <EPF device> of the type probed by <EPF Driver>, the
51 user has to create a directory inside <EPF DriverN>.
53 Every <EPF device> directory consists of the following entries that can be
54 used to configure the standard configuration header of the endpoint function.
55 (These entries are created by the framework when any new <EPF Device> is
72 ... <Symlink EPC Device1>/
74 ... <Symlink EPC Device2>/
76 If an EPF device has to be associated with 2 EPCs (like in the case of
77 Non-transparent bridge), symlink of endpoint controller connected to primary
78 interface should be added in 'primary' directory and symlink of endpoint
79 controller connected to secondary interface should be added in 'secondary'
85 Every registered EPC device will be listed in controllers directory. The
86 entries corresponding to EPC device will be created by the EPC core.
89 /sys/kernel/config/pci_ep/controllers/
91 ... <Symlink EPF Device11>/
92 ... <Symlink EPF Device12>/
95 ... <Symlink EPF Device21>/
96 ... <Symlink EPF Device22>/
99 The <EPC Device> directory will have a list of symbolic links to
100 <EPF Device>. These symbolic links should be created by the user to
101 represent the functions present in the endpoint device.
103 The <EPC Device> directory will also have a *start* field. Once
104 "1" is written to this field, the endpoint device will be ready to
105 establish the link with the host. This is usually done after
106 all the EPF devices are created and linked with the EPC device.
110 | <Directory: EPC name>/
111 | <Symbolic Link: Function>
114 | <Directory: EPF driver>/
115 | <Directory: EPF device>/
128 [1] :doc:`pci-endpoint`