From patchwork Fri Feb 17 09:50:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 9579433 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 48BB3600F6 for ; Fri, 17 Feb 2017 09:58:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E4D5286A3 for ; Fri, 17 Feb 2017 09:58:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33147286A8; Fri, 17 Feb 2017 09:58:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D060B286A3 for ; Fri, 17 Feb 2017 09:58:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933804AbdBQJ6i (ORCPT ); Fri, 17 Feb 2017 04:58:38 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:44793 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933346AbdBQJwc (ORCPT ); Fri, 17 Feb 2017 04:52:32 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v1H9pCvi023683; Fri, 17 Feb 2017 03:51:12 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v1H9p7gw024356; Fri, 17 Feb 2017 03:51:07 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Fri, 17 Feb 2017 03:51:07 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v1H9omdJ011603; Fri, 17 Feb 2017 03:51:04 -0600 From: Kishon Vijay Abraham I To: Bjorn Helgaas , Jingoo Han , Joao Pinto CC: , , , , , , , Kishon Vijay Abraham I Subject: [PATCH v2 04/22] Documentation: PCI: Guide to use pci endpoint configfs Date: Fri, 17 Feb 2017 15:20:24 +0530 Message-ID: <1487325042-28227-5-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1487325042-28227-1-git-send-email-kishon@ti.com> References: <1487325042-28227-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-By: Joao Pinto --- 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 + +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/ + | / --------------------------------------> [2] + | epc + | epf/ + | / --------------------------> [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 . + +*) 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/