Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1583254 > unrolled thread
| Started by | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| First post | 2017-02-17 11:00 +0100 |
| Last post | 2017-02-17 18:20 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 04/22] Documentation: PCI: Guide to use pci endpoint configfs Kishon Vijay Abraham I <kishon@ti.com> - 2017-02-17 11:00 +0100
Re: [PATCH v2 04/22] Documentation: PCI: Guide to use pci endpoint configfs Joao Pinto <Joao.Pinto@synopsys.com> - 2017-02-17 14:10 +0100
Re: [PATCH v2 04/22] Documentation: PCI: Guide to use pci endpoint configfs Christoph Hellwig <hch@infradead.org> - 2017-02-17 18:20 +0100
| From | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| Date | 2017-02-17 11:00 +0100 |
| Subject | [PATCH v2 04/22] Documentation: PCI: Guide to use pci endpoint configfs |
| Message-ID | <tbNux-2Ef-3@gated-at.bofh.it> |
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> --- Documentation/PCI/00-INDEX | 2 + Documentation/PCI/endpoint/pci-endpoint-cfs.txt | 84 +++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 Documentation/PCI/endpoint/pci-endpoint-cfs.txt diff --git a/Documentation/PCI/00-INDEX b/Documentation/PCI/00-INDEX index ba950b2..f84a23c 100644 --- a/Documentation/PCI/00-INDEX +++ b/Documentation/PCI/00-INDEX @@ -14,3 +14,5 @@ pcieaer-howto.txt - the PCI Express Advanced Error Reporting Driver Guide HOWTO endpoint/pci-endpoint.txt - guide to add endpoint controller driver and endpoint function driver. +endpoint/pci-endpoint-cfs.txt + - 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 0000000..d9f8734 --- /dev/null +++ b/Documentation/PCI/endpoint/pci-endpoint-cfs.txt @@ -0,0 +1,84 @@ + CONFIGURING PCI ENDPOINT USING CONFIGFS + Kishon Vijay Abraham I <kishon@ti.com> + +The PCI Endpoint Core exposes configfs entry (pci_ep) in order to configure the +PCI endpoint function and in order to bind the endpoint function +with the endpoint controller. (For introducing other mechanisms to +configure the PCI Endpoint Function refer [1]). + +*) Mounting configfs + +The PCI Endpoint Core layer creates pci_ep directory in the mounted configfs +directory. configfs can be mounted using the following command. + + mount -t configfs none /sys/kernel/config + +*) Directory Structure + +The pci_ep configfs directory structure has been created to reflect the +natural tree like structure of PCI devices. So every directory created +inside pci_ep represents a EPC device and every directory created inside +epf directory represents EPF device. + +/sys/kernel/config/pci_ep/ + | <dir>/ --------------------------------------> [2] + | epc + | epf/ + | <dir>/ --------------------------> [3] + | vendorid + | deviceid + | revid + | progif_code + | subclass_code + | baseclass_code + | cache_line_size + | subsys_vendor_id + | subsys_id + | interrupt_pin + | function + +*) Creating configfs entry for EPC + +Any directory created inside *pci_ep* represents an EPC device. In the above +directory structure [2] represents an EPC device. It consists of + + *) epc: Use it to associate the configfs entry to an actual EPC device. + The list of valid entries for this field can be obtained from + ls /sys/class/pci_epc/ + + *) epf: Directory that contains all the endpoint functions. The name + of the created directory determines the driver this particular + epf device will be bound to. The name can be obtained either + from the function binding documentation [4] or + ls /sys/bus/pci-epf/drivers + + If more than one endpoint function device has to be bound to + the same driver, then the directory should be created using + the following notation + mkdir <name>.<num> + +*) Creating configfs entry for EPF + +Any directory created inside *epf* directory represents an EPF device. In the +above directory structure, [3] represents an EPF device. It consists of the +following entries that can be used to configure the standard configuration +header of the endpoint function. (These entries are created by the +framework when any new directory is created inside epf directory.) + + | vendorid + | deviceid + | revid + | progif_code + | subclass_code + | baseclass_code + | cache_line_size + | subsys_vendor_id + | subsys_id + | interrupt_pin + +The following entry identifies the function driver that is bound to the +function device + | function + +[1] -> Documentation/PCI/endpoint/pci-endpoint.txt +[4] -> Documentation/PCI/endpoint/function/binding/ -- 1.7.9.5
[toc] | [next] | [standalone]
| From | Joao Pinto <Joao.Pinto@synopsys.com> |
|---|---|
| Date | 2017-02-17 14:10 +0100 |
| Subject | Re: [PATCH v2 04/22] Documentation: PCI: Guide to use pci endpoint configfs |
| Message-ID | <tbQsq-4Hl-11@gated-at.bofh.it> |
| In reply to | #1583254 |
Às 9:50 AM de 2/17/2017, Kishon Vijay Abraham I escreveu: > 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> > --- > Documentation/PCI/00-INDEX | 2 + > Documentation/PCI/endpoint/pci-endpoint-cfs.txt | 84 +++++++++++++++++++++++ > 2 files changed, 86 insertions(+) > create mode 100644 Documentation/PCI/endpoint/pci-endpoint-cfs.txt > > diff --git a/Documentation/PCI/00-INDEX b/Documentation/PCI/00-INDEX > index ba950b2..f84a23c 100644 > --- a/Documentation/PCI/00-INDEX > +++ b/Documentation/PCI/00-INDEX > @@ -14,3 +14,5 @@ pcieaer-howto.txt > - the PCI Express Advanced Error Reporting Driver Guide HOWTO > endpoint/pci-endpoint.txt > - guide to add endpoint controller driver and endpoint function driver. > +endpoint/pci-endpoint-cfs.txt > + - 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 0000000..d9f8734 > --- /dev/null > +++ b/Documentation/PCI/endpoint/pci-endpoint-cfs.txt > @@ -0,0 +1,84 @@ > + CONFIGURING PCI ENDPOINT USING CONFIGFS > + Kishon Vijay Abraham I <kishon@ti.com> > + > +The PCI Endpoint Core exposes configfs entry (pci_ep) in order to configure the > +PCI endpoint function and in order to bind the endpoint function > +with the endpoint controller. (For introducing other mechanisms to > +configure the PCI Endpoint Function refer [1]). > + > +*) Mounting configfs > + > +The PCI Endpoint Core layer creates pci_ep directory in the mounted configfs > +directory. configfs can be mounted using the following command. > + > + mount -t configfs none /sys/kernel/config > + > +*) Directory Structure > + > +The pci_ep configfs directory structure has been created to reflect the > +natural tree like structure of PCI devices. So every directory created > +inside pci_ep represents a EPC device and every directory created inside > +epf directory represents EPF device. > + > +/sys/kernel/config/pci_ep/ > + | <dir>/ --------------------------------------> [2] > + | epc > + | epf/ > + | <dir>/ --------------------------> [3] > + | vendorid > + | deviceid > + | revid > + | progif_code > + | subclass_code > + | baseclass_code > + | cache_line_size > + | subsys_vendor_id > + | subsys_id > + | interrupt_pin > + | function > + > +*) Creating configfs entry for EPC > + > +Any directory created inside *pci_ep* represents an EPC device. In the above > +directory structure [2] represents an EPC device. It consists of > + > + *) epc: Use it to associate the configfs entry to an actual EPC device. > + The list of valid entries for this field can be obtained from > + ls /sys/class/pci_epc/ > + > + *) epf: Directory that contains all the endpoint functions. The name > + of the created directory determines the driver this particular > + epf device will be bound to. The name can be obtained either > + from the function binding documentation [4] or > + ls /sys/bus/pci-epf/drivers > + > + If more than one endpoint function device has to be bound to > + the same driver, then the directory should be created using > + the following notation > + mkdir <name>.<num> > + > +*) Creating configfs entry for EPF > + > +Any directory created inside *epf* directory represents an EPF device. In the > +above directory structure, [3] represents an EPF device. It consists of the > +following entries that can be used to configure the standard configuration > +header of the endpoint function. (These entries are created by the > +framework when any new directory is created inside epf directory.) > + > + | vendorid > + | deviceid > + | revid > + | progif_code > + | subclass_code > + | baseclass_code > + | cache_line_size > + | subsys_vendor_id > + | subsys_id > + | interrupt_pin > + > +The following entry identifies the function driver that is bound to the > +function device > + | function > + > +[1] -> Documentation/PCI/endpoint/pci-endpoint.txt > +[4] -> Documentation/PCI/endpoint/function/binding/ > Good content. Acked-By: Joao Pinto <jpinto@synopsys.com>
[toc] | [prev] | [next] | [standalone]
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Date | 2017-02-17 18:20 +0100 |
| Subject | Re: [PATCH v2 04/22] Documentation: PCI: Guide to use pci endpoint configfs |
| Message-ID | <tbUml-79M-7@gated-at.bofh.it> |
| In reply to | #1583254 |
I'm commenting on the configfs layout here instead of the patch with the
code as the issues are easier to explain that way. I think the layout
is a bit confusing and could be cleaner by making use of pre-created
entries and symlinks. Here is my suggestion:
/sys/kernel/config/pci_ep/functions/
.. test/ # a directory for each function driver
... user-specified-name1/
... user-specified-name2
.. nvme/
... user-specified-name42/
Each directory under /sys/kernel/config/pci_ep/functions/ is owned
by a function drivers. Under that function driver's directory you
can create a directory for each instance of a function driver. The
configfs layout is controlled by the function driver. E.g. your current
EPF fields would move into the test function driver, while the nvme
function would expose totally different fields.
/sys/kernel/config/pci_ep/controllers/
... dwc-0/
... function
... dwc-1/
... function
... vhost-0/
... function
Here you have a directory for each controller that can be bound
to a function. The directories are pre-created for each
controller port that is EP capable.
Function is a symlink to the function instance above.
Additional parameters might also be present depending on the
EPC driver.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web