From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-5.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id 2D5D87D917 for ; Wed, 3 Apr 2019 15:51:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728712AbfDCPvD (ORCPT ); Wed, 3 Apr 2019 11:51:03 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:37194 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728702AbfDCPvC (ORCPT ); Wed, 3 Apr 2019 11:51:02 -0400 Received: by mail-pg1-f196.google.com with SMTP id e6so4176521pgc.4; Wed, 03 Apr 2019 08:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JiCc3xWTT61mWt/yeSj2EwwdCqRf8pJjDtK9JcvQptY=; b=T9krHCM3RjQbcrCY+yX6c9c2Ys4OZiZV+L+GAECKJBaBZ3O2FmqltmzBWjvzb5E/t1 xrQQ49FxGFzRKwAkB2xLlWK9uXtSZC23S3LSi6nk088GrmKksNxe8G2kvgJa7RZvWrT9 2xQxvrS5V9BvS+FkLQksyZNfOH9jEyFXhP0OhD8I6VxvOleVx9hwEJYL9PjDHUAIAP9J HJr6kmgZvT+e7Cm0BI/YJQsSUQBAmvCtWIpH+/xYqAaB9B61FvoJG0Q5FRjQJB1/0U4r CQdroRDVklfcIV4Emjvcxg/sx3WTEffO0t+CRrtDDXCRi3LPQqTW2t9pIF6b26vJGxML FLfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JiCc3xWTT61mWt/yeSj2EwwdCqRf8pJjDtK9JcvQptY=; b=mjkAZ9x1ff6gGzLLWCQuGrNj73pB6LIZd5zGZfoBftLbD3KlsPGw1ttItz6Iw0KqX5 +znx5NZam1CRhPiQGH+WNPSVMZ2EToceTqIIPGlV1f/MeQC6PqL+Zfkj2BXxFm69banX gBc8g7O2WtgRxLvh+C/yL3QvLMRxuogvHd3K/t3sYibyRNsECrf2WTAeYJ+4O5bZRDpC zk/kswWV0A33cQenSRqDumJLXeGt/qoQAYsj9PGEbxIsGesJfuOhiUOFkDMleIdnuu1l VFxh3gCs+oYEtAkUHLbMByDKHgsQYp69/K4B8pW6YA61LG63OlH4QGcneFew6UvTC7qL MheA== X-Gm-Message-State: APjAAAW3BdpeSagRb12YuLer9+DvKD49jd5ml7iaQzftOeD2hACP0UP0 eXv1uwMiA9RPEPFb/Qvln1Y= X-Google-Smtp-Source: APXvYqxYS5R29ABCMndJ6CgEEo3uygLgviwhDH0tlsZ+6iPk0oM0ZsMUzrAQnoqWmw0yIun2iKG4PA== X-Received: by 2002:a63:700f:: with SMTP id l15mr369478pgc.3.1554306661733; Wed, 03 Apr 2019 08:51:01 -0700 (PDT) Received: from localhost.localdomain ([104.238.181.70]) by smtp.gmail.com with ESMTPSA id b8sm18906922pgq.33.2019.04.03.08.50.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Apr 2019 08:51:00 -0700 (PDT) From: Changbin Du To: Jonathan Corbet , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Changbin Du Subject: [PATCH v2 12/12] Documentation: PCI: convert PCI/endpoint/pci-test-howto.txt to reST format Date: Wed, 3 Apr 2019 23:49:55 +0800 Message-Id: <20190403154955.12096-13-changbin.du@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190403154955.12096-1-changbin.du@gmail.com> References: <20190403154955.12096-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org This converts the plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Changbin Du --- Documentation/PCI/endpoint/index.rst | 1 + ...{pci-test-howto.txt => pci-test-howto.rst} | 81 +++++++++++++------ 2 files changed, 56 insertions(+), 26 deletions(-) rename Documentation/PCI/endpoint/{pci-test-howto.txt => pci-test-howto.rst} (78%) diff --git a/Documentation/PCI/endpoint/index.rst b/Documentation/PCI/endpoint/index.rst index b680a3fc4fec..d114ea74b444 100644 --- a/Documentation/PCI/endpoint/index.rst +++ b/Documentation/PCI/endpoint/index.rst @@ -10,3 +10,4 @@ PCI Endpoint Framework pci-endpoint pci-endpoint-cfs pci-test-function + pci-test-howto diff --git a/Documentation/PCI/endpoint/pci-test-howto.txt b/Documentation/PCI/endpoint/pci-test-howto.rst similarity index 78% rename from Documentation/PCI/endpoint/pci-test-howto.txt rename to Documentation/PCI/endpoint/pci-test-howto.rst index 040479f437a5..909f770a07d6 100644 --- a/Documentation/PCI/endpoint/pci-test-howto.txt +++ b/Documentation/PCI/endpoint/pci-test-howto.rst @@ -1,38 +1,51 @@ - PCI TEST USERGUIDE - Kishon Vijay Abraham I +.. SPDX-License-Identifier: GPL-2.0 + +=================== +PCI Test User Guide +=================== + +:Author: Kishon Vijay Abraham I This document is a guide to help users use pci-epf-test function driver and pci_endpoint_test host driver for testing PCI. The list of steps to be followed in the host side and EP side is given below. -1. Endpoint Device +Endpoint Device +=============== -1.1 Endpoint Controller Devices +Endpoint Controller Devices +--------------------------- -To find the list of endpoint controller devices in the system: +To find the list of endpoint controller devices in the system:: # ls /sys/class/pci_epc/ 51000000.pcie_ep -If PCI_ENDPOINT_CONFIGFS is enabled +If PCI_ENDPOINT_CONFIGFS is enabled:: + # ls /sys/kernel/config/pci_ep/controllers 51000000.pcie_ep -1.2 Endpoint Function Drivers -To find the list of endpoint function drivers in the system: +Endpoint Function Drivers +------------------------- + +To find the list of endpoint function drivers in the system:: # ls /sys/bus/pci-epf/drivers pci_epf_test -If PCI_ENDPOINT_CONFIGFS is enabled +If PCI_ENDPOINT_CONFIGFS is enabled:: + # ls /sys/kernel/config/pci_ep/functions pci_epf_test -1.3 Creating pci-epf-test Device + +Creating pci-epf-test Device +---------------------------- PCI endpoint function device can be created using the configfs. To create -pci-epf-test device, the following commands can be used +pci-epf-test device, the following commands can be used:: # mount -t configfs none /sys/kernel/config # cd /sys/kernel/config/pci_ep/ @@ -42,7 +55,7 @@ The "mkdir func1" above creates the pci-epf-test function device that will be probed by pci_epf_test driver. The PCI endpoint framework populates the directory with the following -configurable fields. +configurable fields:: # ls functions/pci_epf_test/func1 baseclass_code interrupt_pin progif_code subsys_id @@ -51,67 +64,83 @@ configurable fields. The PCI endpoint function driver populates these entries with default values when the device is bound to the driver. The pci-epf-test driver populates -vendorid with 0xffff and interrupt_pin with 0x0001 +vendorid with 0xffff and interrupt_pin with 0x0001:: # cat functions/pci_epf_test/func1/vendorid 0xffff # cat functions/pci_epf_test/func1/interrupt_pin 0x0001 -1.4 Configuring pci-epf-test Device + +Configuring pci-epf-test Device +------------------------------- The user can configure the pci-epf-test device using configfs entry. In order to change the vendorid and the number of MSI interrupts used by the function -device, the following commands can be used. +device, the following commands can be used:: # echo 0x104c > functions/pci_epf_test/func1/vendorid # echo 0xb500 > functions/pci_epf_test/func1/deviceid # echo 16 > functions/pci_epf_test/func1/msi_interrupts # echo 8 > functions/pci_epf_test/func1/msix_interrupts -1.5 Binding pci-epf-test Device to EP Controller + +Binding pci-epf-test Device to EP Controller +-------------------------------------------- In order for the endpoint function device to be useful, it has to be bound to a PCI endpoint controller driver. Use the configfs to bind the function -device to one of the controller driver present in the system. +device to one of the controller driver present in the system:: # ln -s functions/pci_epf_test/func1 controllers/51000000.pcie_ep/ Once the above step is completed, the PCI endpoint is ready to establish a link with the host. -1.6 Start the Link + +Start the Link +-------------- In order for the endpoint device to establish a link with the host, the _start_ -field should be populated with '1'. +field should be populated with '1':: # echo 1 > controllers/51000000.pcie_ep/start -2. RootComplex Device -2.1 lspci Output +RootComplex Device +================== + +lspci Output +------------ -Note that the devices listed here correspond to the value populated in 1.4 above +Note that the devices listed here correspond to the value populated in 1.4 +above:: 00:00.0 PCI bridge: Texas Instruments Device 8888 (rev 01) 01:00.0 Unassigned class [ff00]: Texas Instruments Device b500 -2.2 Using Endpoint Test function Device + +Using Endpoint Test function Device +----------------------------------- pcitest.sh added in tools/pci/ can be used to run all the default PCI endpoint -tests. To compile this tool the following commands should be used: +tests. To compile this tool the following commands should be used:: # cd # make -C tools/pci -or if you desire to compile and install in your system: +or if you desire to compile and install in your system:: # cd # make -C tools/pci install The tool and script will be located in /usr/bin/ -2.2.1 pcitest.sh Output + +pcitest.sh Output +~~~~~~~~~~~~~~~~~ +:: + # pcitest.sh BAR tests -- 2.20.1