Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3789154yba; Tue, 23 Apr 2019 09:37:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqysSb1gVxQNxrPaWjCWQyXKCCIINLlxVady5aWd9PsoXbyb3t6ZwZ4LvlLwF0p+ICy31Qem X-Received: by 2002:a63:7843:: with SMTP id t64mr25362821pgc.130.1556037444595; Tue, 23 Apr 2019 09:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556037444; cv=none; d=google.com; s=arc-20160816; b=Eu07PhmsbkU8WwrE41cZrz7y/nCvxasHXdOYBWfAs6JcO+LpZhcnkjYgTRROfpGI0H 8sbEMWm5t+s65/9d8tWW58Tw1V8r88TUF18aleV3nkh19cP/RG79KgtIRi1E9tp+8QDs yo91cauEiAolvIbj/IAC7cGVMd1yia0nl4TDCq3HavLUgewzyv1iEweBoOtHE4DP8k2m Euq/xfV13shMTmcuny7nlJYpVaty/wCMz1teIelYMjOE82ETm0Zgwjtkwep29p6malgL mJeluVb+u0YLrC3Ykl1DjH+MgHdl9hcBjiBK0yZzpISqL8m/TGmsbuUl0utAykWSVNOH sBfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=70bPnOCiyT/McnTHJ3/ThQzEgD9Y96j/IQ+8yT0RXAA=; b=r8aaRdcNth+fL3nS3Jf+6adWWPh7gXQZiTmTSGU5kS/uUUPXuJj5tuZiLz7+nVr4tj p62PqOfDOznmoWl297+rine2kYrqSirrOJrMf+/+pNE8qgFuI953up5K+bCjPK5B6gvk TcPfpBqHZrd1j+SeEgAE7Y7nuPlJg/9/8mmmi58UVX0GgBU+q4lRvIDUF1kTe6mj9OhE HlipfDTjyHICArx74/96aKpJKKtVI3U88gM6Bx1+omwLb/8s+YXQXG64UgyfY3hugpnS 3ReN2V9VHCaHuY6jUraBl/vdjP56n6VlcGQKmM1PoFIfwu9bSS2gVQj1lAOp85QJVTxz tb3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CJwohfyN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 41si16839164plb.164.2019.04.23.09.37.09; Tue, 23 Apr 2019 09:37:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CJwohfyN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729234AbfDWQgV (ORCPT + 99 others); Tue, 23 Apr 2019 12:36:21 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34089 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728569AbfDWQgU (ORCPT ); Tue, 23 Apr 2019 12:36:20 -0400 Received: by mail-pf1-f196.google.com with SMTP id b3so7781291pfd.1; Tue, 23 Apr 2019 09:36:19 -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=70bPnOCiyT/McnTHJ3/ThQzEgD9Y96j/IQ+8yT0RXAA=; b=CJwohfyNyOcOjrjBjfqlgtXEtrh3HEgUIhaCB7eOoSsngkvWRBN/stGF4CxSYdf8n8 W4xLZIq8lBL0opyHWnQHLZ3+/6uSDT5CnMMWpV2hpYFU3qOgpTUVK3SKaqcdlJ0djgDf l52qORM1S3r14SJG84sq4Sv+saCezWfSnXyCvCtRDjjg/9lxylB9EVxB0qt4rx3VDekS FBZGKSRwlSRO3Z+iuXqg84Xz0unWOzkTZQD9BOqoNYb+vHDBXc6I/OyxI08iPwLszEK8 ZTrYTh9YEopCHRBzIjBkOdCiBqMCNzyjuH97O5bZC4n0Mq5+IhLPJo7/v1TD/3tRL2EH hcng== 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=70bPnOCiyT/McnTHJ3/ThQzEgD9Y96j/IQ+8yT0RXAA=; b=C29Dd3yvRmH3SqsMXV1sgYtwWKd+hfxiJPpS4zeQkmsyK+R+B0LvYktHs8h7UEZvdb CbLQwsmlDpA+wleRf97N8iZp+IyWPWjBSNR9VXOSilzH4DmJY77pzKm158PrPFhzJxR+ IVKxgjU+e+WWuHioLVaJa/mhkOBHiTeWwNwiPvDxyUnCI9DdYtt6cB/PpnpwSqQ6gK1t oh/0KmKuCtuPYmgMnR+vAM+kJ8Fdv+WdpqvOpHBqCluGi1lUEiFqFdWXXu2b59f7j1ni BENHqTxKO28UrjtpI5G4cP5VihlEUt0uZGuk1OugED92oEDPyt0TP5IOUIg3gh8uuD7C emkw== X-Gm-Message-State: APjAAAV4Djc/MDegOmrkgv8A/lH7cPYbAIVpXfawO+95Vq2CXRP+9eTy 2f5hRZL5d5CP+4csORVwaR4= X-Received: by 2002:a63:de0a:: with SMTP id f10mr15882421pgg.418.1556037379239; Tue, 23 Apr 2019 09:36:19 -0700 (PDT) Received: from localhost.localdomain ([104.238.181.70]) by smtp.gmail.com with ESMTPSA id v1sm24364801pff.81.2019.04.23.09.36.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Apr 2019 09:36:18 -0700 (PDT) From: Changbin Du To: Jonathan Corbet Cc: Bjorn Helgaas , rjw@rjwysocki.net, linux-pci@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, fenghua.yu@intel.com, linuxppc-dev@lists.ozlabs.org, linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, mchehab+samsung@kernel.org, Changbin Du Subject: [PATCH v4 36/63] Documentation: PCI: convert endpoint/pci-test-howto.txt to reST Date: Wed, 24 Apr 2019 00:29:05 +0800 Message-Id: <20190423162932.21428-37-changbin.du@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190423162932.21428-1-changbin.du@gmail.com> References: <20190423162932.21428-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Acked-by: Bjorn Helgaas --- 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