projects/linux·commit fb4da215

Merge tag 'pci-v5.3-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

fb4da215 · Linus Torvalds <[email protected]> · 2019-07-15 20:44:49 -07:00

Pull PCI updates from Bjorn Helgaas:
 "Enumeration changes:

   - Evaluate PCI Boot Configuration _DSM to learn if firmware wants us
     to preserve its resource assignments (Benjamin Herrenschmidt)

   - Simplify resource distribution (Nicholas Johnson)

   - Decode 32 GT/s link speed (Gustavo Pimentel)

  Virtualization:

   - Fix incorrect caching of VF config space size (Alex Williamson)

   - Fix VF driver probing sysfs knobs (Alex Williamson)

  Peer-to-peer DMA:

   - Fix dma_virt_ops check (Logan Gunthorpe)

  Altera host bridge driver:

   - Allow building as module (Ley Foon Tan)

  Armada 8K host bridge driver:

   - add PHYs support (Miquel Raynal)

  DesignWare host bridge driver:

   - Export APIs to support removable loadable module (Vidya Sagar)

   - Enable Relaxed Ordering erratum workaround only on Tegra20 &
     Tegra30 (Vidya Sagar)

  Hyper-V host bridge driver:

   - Fix use-after-free in eject (Dexuan Cui)

  Mobiveil host bridge driver:

   - Clean up and fix many issues, including non-identify mapped
     windows, 64-bit windows, multi-MSI, class code, INTx clearing (Hou
     Zhiqiang)

  Qualcomm host bridge driver:

   - Use clk bulk API for 2.4.0 controllers (Bjorn Andersson)

   - Add QCS404 support (Bjorn Andersson)

   - Assert PERST for at least 100ms (Niklas Cassel)

  R-Car host bridge driver:

   - Add r8a774a1 DT support (Biju Das)

  Tegra host bridge driver:

   - Add support for Gen2, opportunistic UpdateFC and ACK (PCIe protocol
     details) AER, GPIO-based PERST# (Manikanta Maddireddy)

   - Fix many issues, including power-on failure cases, interrupt
     masking in suspend, UPHY settings, AFI dynamic clock gating,
     pending DLL transactions (Manikanta Maddireddy)

  Xilinx host bridge driver:

   - Fix NWL Multi-MSI programming (Bharat Kumar Gogada)

  Endpoint support:

   - Fix 64bit BAR support (Alan Mikhak)

   - Fix pcitest build issues (Alan Mikhak, Andy Shevchenko)

  Bug fixes:

   - Fix NVIDIA GPU multi-function power dependencies (Abhishek Sahu)

   - Fix NVIDIA GPU HDA enablement issue (Lukas Wunner)

   - Ignore lockdep for sysfs "remove" (Marek Vasut)

  Misc:

   - Convert docs to reST (Changbin Du, Mauro Carvalho Chehab)"

* tag 'pci-v5.3-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (107 commits)
  PCI: Enable NVIDIA HDA controllers
  tools: PCI: Fix installation when `make tools/pci_install`
  PCI: dwc: pci-dra7xx: Fix compilation when !CONFIG_GPIOLIB
  PCI: Fix typos and whitespace errors
  PCI: mobiveil: Fix INTx interrupt clearing in mobiveil_pcie_isr()
  PCI: mobiveil: Fix infinite-loop in the INTx handling function
  PCI: mobiveil: Move PCIe PIO enablement out of inbound window routine
  PCI: mobiveil: Add upper 32-bit PCI base address setup in inbound window
  PCI: mobiveil: Add upper 32-bit CPU base address setup in outbound window
  PCI: mobiveil: Mask out hardcoded bits in inbound/outbound windows setup
  PCI: mobiveil: Clear the control fields before updating it
  PCI: mobiveil: Add configured inbound windows counter
  PCI: mobiveil: Fix the valid check for inbound and outbound windows
  PCI: mobiveil: Clean-up program_{ib/ob}_windows()
  PCI: mobiveil: Remove an unnecessary return value check
  PCI: mobiveil: Fix error return values
  PCI: mobiveil: Refactor the MEM/IO outbound window initialization
  PCI: mobiveil: Make some register updates more readable
  PCI: mobiveil: Reformat the code for readability
  dt-bindings: PCI: mobiveil: Change gpio_slave and apb_csr to optional
  ...
Commit
fb4da215ed92f564f7ca090bb81a199b0d6cab8a
Parents
2a3c389a · 7b4b0f6b

Merge commit. Changes below are compared with the first parent: 2a3c389a.

Changes

116 files changed · +4359 −2851

FileStatusAddDelContent
Documentation/ABI/testing/sysfs-class-powercapmodified+1−1View file
Documentation/PCI/acpi-info.txt → Documentation/PCI/acpi-info.rstrenamed+10−5View file
Documentation/PCI/endpoint/index.rstadded+13−0View file
Documentation/PCI/endpoint/pci-endpoint-cfs.txt → Documentation/PCI/endpoint/pci-endpoint-cfs.rstrenamed+56−43View file
Documentation/PCI/endpoint/pci-endpoint.txt → Documentation/PCI/endpoint/pci-endpoint.rstrenamed+54−38View file
Documentation/PCI/endpoint/pci-test-function.rstadded+103−0View file
Documentation/PCI/endpoint/pci-test-function.txtdeleted+0−87View before deletion
Documentation/PCI/endpoint/pci-test-howto.txt → Documentation/PCI/endpoint/pci-test-howto.rstrenamed+55−26View file
Documentation/PCI/index.rstadded+18−0View file
Documentation/PCI/MSI-HOWTO.txt → Documentation/PCI/msi-howto.rstrenamed+51−34View file
Documentation/PCI/pci-error-recovery.txt → Documentation/PCI/pci-error-recovery.rstrenamed+149−138View file
Documentation/PCI/pci-iov-howto.txt → Documentation/PCI/pci-iov-howto.rstrenamed+93−68View file
Documentation/PCI/pci.txt → Documentation/PCI/pci.rstrenamed+149−207View file
Documentation/PCI/pcieaer-howto.txt → Documentation/PCI/pcieaer-howto.rstrenamed+100−56View file
Documentation/PCI/PCIEBUS-HOWTO.txt → Documentation/PCI/picebus-howto.rstrenamed+81−59View file
Documentation/admin-guide/kernel-parameters.txtmodified+3−3View file
Documentation/cpu-freq/core.txtmodified+1−1View file
Documentation/devicetree/bindings/pci/mobiveil-pcie.txtmodified+2−0View file
Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txtmodified+8−0View file
Documentation/devicetree/bindings/pci/pci.txtmodified+3−0View file
Documentation/devicetree/bindings/pci/qcom,pcie.txtmodified+23−2View file
Documentation/devicetree/bindings/pci/rcar-pci.txtmodified+1−0View file
Documentation/driver-api/pm/devices.rstmodified+3−3View file
Documentation/driver-api/usb/power-management.rstmodified+1−1View file
Documentation/index.rstmodified+1−0View file
Documentation/power/apm-acpi.txt → Documentation/power/apm-acpi.rstrenamed+7−3View file
Documentation/power/basic-pm-debugging.txt → Documentation/power/basic-pm-debugging.rstrenamed+47−32View file
Documentation/power/charger-manager.txt → Documentation/power/charger-manager.rstrenamed+55−50View file
Documentation/power/drivers-testing.txt → Documentation/power/drivers-testing.rstrenamed+10−5View file
Documentation/power/energy-model.txt → Documentation/power/energy-model.rstrenamed+54−51View file
Documentation/power/freezing-of-tasks.txt → Documentation/power/freezing-of-tasks.rstrenamed+52−39View file
Documentation/power/index.rstadded+46−0View file
Documentation/power/interface.txt → Documentation/power/interface.rstrenamed+13−11View file
Documentation/power/opp.txt → Documentation/power/opp.rstrenamed+106−69View file
Documentation/power/pci.txt → Documentation/power/pci.rstrenamed+64−23View file
Documentation/power/pm_qos_interface.txt → Documentation/power/pm_qos_interface.rstrenamed+70−57View file
Documentation/power/power_supply_class.rstadded+282−0View file
Documentation/power/power_supply_class.txtdeleted+0−231View before deletion
Documentation/power/powercap/powercap.rstadded+257−0View file
Documentation/power/powercap/powercap.txtdeleted+0−236View before deletion
Documentation/power/regulator/consumer.txt → Documentation/power/regulator/consumer.rstrenamed+76−65View file
Documentation/power/regulator/design.txt → Documentation/power/regulator/design.rstrenamed+7−2View file
Documentation/power/regulator/machine.txt → Documentation/power/regulator/machine.rstrenamed+24−23View file
Documentation/power/regulator/overview.txt → Documentation/power/regulator/overview.rstrenamed+32−25View file
Documentation/power/regulator/regulator.txt → Documentation/power/regulator/regulator.rstrenamed+10−8View file
Documentation/power/runtime_pm.txt → Documentation/power/runtime_pm.rstrenamed+123−111View file
Documentation/power/s2ram.txt → Documentation/power/s2ram.rstrenamed+11−9View file
Documentation/power/suspend-and-cpuhotplug.txt → Documentation/power/suspend-and-cpuhotplug.rstrenamed+27−15View file
Documentation/power/suspend-and-interrupts.txt → Documentation/power/suspend-and-interrupts.rstrenamed+2−0View file
Documentation/power/swsusp-and-swap-files.txt → Documentation/power/swsusp-and-swap-files.rstrenamed+10−7View file
Documentation/power/swsusp-dmcrypt.txt → Documentation/power/swsusp-dmcrypt.rstrenamed+62−60View file
Documentation/power/swsusp.txt → Documentation/power/swsusp.rstrenamed+327−272View file
Documentation/power/tricks.txt → Documentation/power/tricks.rstrenamed+4−2View file
Documentation/power/userland-swsusp.txt → Documentation/power/userland-swsusp.rstrenamed+38−17View file
Documentation/power/video.txt → Documentation/power/video.rstrenamed+92−64View file
Documentation/process/submitting-drivers.rstmodified+1−1View file
Documentation/scheduler/sched-energy.rstmodified+3−3View file
Documentation/trace/coresight-cpu-debug.txtmodified+1−1View file
Documentation/translations/zh_CN/process/submitting-drivers.rstmodified+1−1View file
MAINTAINERSmodified+4−4View file
arch/arm64/kernel/pci.cmodified+11−2View file
arch/x86/Kconfigmodified+1−1View file
drivers/acpi/pci_root.cmodified+12−0View file
drivers/gpu/drm/i915/intel_runtime_pm.hmodified+1−1View file
drivers/opp/Kconfigmodified+1−1View file
drivers/pci/ats.cmodified+1−1View file
drivers/pci/controller/Kconfigmodified+2−2View file
drivers/pci/controller/dwc/Kconfigmodified+1−1View file
drivers/pci/controller/dwc/pci-dra7xx.cmodified+1−0View file
drivers/pci/controller/dwc/pcie-armada8k.cmodified+82−2View file
drivers/pci/controller/dwc/pcie-designware-host.cmodified+12−0View file
drivers/pci/controller/dwc/pcie-designware.cmodified+45−16View file
drivers/pci/controller/dwc/pcie-designware.hmodified+21−18View file
drivers/pci/controller/dwc/pcie-kirin.cmodified+1−1View file
drivers/pci/controller/dwc/pcie-qcom.cmodified+54−61View file
drivers/pci/controller/pci-aardvark.cmodified+1−1View file
drivers/pci/controller/pci-hyperv.cmodified+9−6View file
drivers/pci/controller/pci-tegra.cmodified+507−82View file
drivers/pci/controller/pcie-altera-msi.cmodified+10−0View file
drivers/pci/controller/pcie-altera.cmodified+53−16View file
drivers/pci/controller/pcie-iproc-platform.cmodified+1−1View file
drivers/pci/controller/pcie-iproc.cmodified+1−1View file
drivers/pci/controller/pcie-mobiveil.cmodified+312−213View file
drivers/pci/controller/pcie-xilinx-nwl.cmodified+5−6View file
drivers/pci/controller/vmd.cmodified+1−1View file
drivers/pci/endpoint/functions/pci-epf-test.cmodified+20−15View file
drivers/pci/endpoint/pci-epc-core.cmodified+2−1View file
drivers/pci/iov.cmodified+0−2View file
drivers/pci/mmap.cmodified+1−1View file
drivers/pci/msi.cmodified+22−21View file
drivers/pci/p2pdma.cmodified+12−4View file
drivers/pci/pci-bridge-emul.cmodified+1−1View file
drivers/pci/pci-driver.cmodified+9−7View file
drivers/pci/pci-pf-stub.cmodified+1−1View file
drivers/pci/pci-sysfs.cmodified+4−1View file
drivers/pci/pci.cmodified+4−2View file
drivers/pci/pci.hmodified+0−1View file
drivers/pci/pcie/aer_inject.cmodified+1−1View file
drivers/pci/probe.cmodified+13−15View file
drivers/pci/proc.cmodified+1−1View file
drivers/pci/quirks.cmodified+90−20View file
drivers/pci/setup-bus.cmodified+33−27View file
drivers/pci/slot.cmodified+1−0View file
drivers/power/supply/power_supply_core.cmodified+1−1View file
drivers/soc/tegra/pmc.cmodified+1−0View file
include/linux/interrupt.hmodified+1−1View file
include/linux/mod_devicetable.hmodified+24−5View file
include/linux/pci-acpi.hmodified+4−3View file
include/linux/pci.hmodified+51−2View file
include/linux/pci_ids.hmodified+4−3View file
include/linux/pm.hmodified+1−1View file
include/uapi/linux/pci_regs.hmodified+4−0View file
kernel/power/Kconfigmodified+3−3View file
net/wireless/Kconfigmodified+1−1View file
tools/pci/Makefilemodified+2−3View file
tools/pci/pcitest.cmodified+4−4View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/ABI/testing/sysfs-class-powercap

View file
diff --git a/Documentation/ABI/testing/sysfs-class-powercap b/Documentation/ABI/testing/sysfs-class-powercap
index f333a0c..ca491ec 100644
--- a/Documentation/ABI/testing/sysfs-class-powercap
+++ b/Documentation/ABI/testing/sysfs-class-powercap
@@ -5,7 +5,7 @@ Contact: [email protected]
Description:
The powercap/ class sub directory belongs to the power cap
subsystem. Refer to
- Documentation/power/powercap/powercap.txt for details.
+ Documentation/power/powercap/powercap.rst for details.
What: /sys/class/powercap/<control type>
Date: September 2013

Documentation/PCI/acpi-info.rst

View file
diff --git a/Documentation/PCI/acpi-info.txt b/Documentation/PCI/acpi-info.rst
similarity index 91%
rename from Documentation/PCI/acpi-info.txt
rename to Documentation/PCI/acpi-info.rst
index 3ffa3b0..0602170 100644
--- a/Documentation/PCI/acpi-info.txt
+++ b/Documentation/PCI/acpi-info.rst
@@ -1,4 +1,8 @@
- ACPI considerations for PCI host bridges
+.. SPDX-License-Identifier: GPL-2.0
+
+========================================
+ACPI considerations for PCI host bridges
+========================================
The general rule is that the ACPI namespace should describe everything the
OS might use unless there's another way for the OS to find it [1, 2].
@@ -131,12 +135,13 @@ address always corresponds to bus 0, even if the bus range below the bridge
[4] ACPI 6.2, sec 6.4.3.5.1, 2, 3, 4:
QWord/DWord/Word Address Space Descriptor (.1, .2, .3)
- General Flags: Bit [0] Ignored
+ General Flags: Bit [0] Ignored
Extended Address Space Descriptor (.4)
- General Flags: Bit [0] Consumer/Producer:
- 1–This device consumes this resource
- 0–This device produces and consumes this resource
+ General Flags: Bit [0] Consumer/Producer:
+
+ * 1 – This device consumes this resource
+ * 0 – This device produces and consumes this resource
[5] ACPI 6.2, sec 19.6.43:
ResourceUsage specifies whether the Memory range is consumed by

Documentation/PCI/endpoint/index.rst

View file
diff --git a/Documentation/PCI/endpoint/index.rst b/Documentation/PCI/endpoint/index.rst
new file mode 100644
index 0000000..d114ea7
--- /dev/null
+++ b/Documentation/PCI/endpoint/index.rst
@@ -0,0 +1,13 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+======================
+PCI Endpoint Framework
+======================
+
+.. toctree::
+ :maxdepth: 2
+
+ pci-endpoint
+ pci-endpoint-cfs
+ pci-test-function
+ pci-test-howto

Documentation/PCI/endpoint/pci-endpoint-cfs.rst

View file
diff --git a/Documentation/PCI/endpoint/pci-endpoint-cfs.txt b/Documentation/PCI/endpoint/pci-endpoint-cfs.rst
similarity index 84%
rename from Documentation/PCI/endpoint/pci-endpoint-cfs.txt
rename to Documentation/PCI/endpoint/pci-endpoint-cfs.rst
index d740f29..b6d39cd 100644
--- a/Documentation/PCI/endpoint/pci-endpoint-cfs.txt
+++ b/Documentation/PCI/endpoint/pci-endpoint-cfs.rst
@@ -1,41 +1,51 @@
- CONFIGURING PCI ENDPOINT USING CONFIGFS
- Kishon Vijay Abraham I <[email protected]>
+.. SPDX-License-Identifier: GPL-2.0
+
+=======================================
+Configuring PCI Endpoint Using CONFIGFS
+=======================================
+
+:Author: Kishon Vijay Abraham I <[email protected]>
The PCI Endpoint Core exposes configfs entry (pci_ep) to configure the
PCI endpoint function and to bind the endpoint function
with the endpoint controller. (For introducing other mechanisms to
configure the PCI Endpoint Function refer to [1]).
-*) Mounting configfs
+Mounting configfs
+=================
The PCI Endpoint Core layer creates pci_ep directory in the mounted configfs
-directory. configfs can be mounted using the following command.
+directory. configfs can be mounted using the following command::
mount -t configfs none /sys/kernel/config
-*) Directory Structure
+Directory Structure
+===================
The pci_ep configfs has two directories at its root: controllers and
functions. Every EPC device present in the system will have an entry in
the *controllers* directory and and every EPF driver present in the system
will have an entry in the *functions* directory.
+::
-/sys/kernel/config/pci_ep/
- .. controllers/
- .. functions/
+ /sys/kernel/config/pci_ep/
+ .. controllers/
+ .. functions/
-*) Creating EPF Device
+Creating EPF Device
+===================
Every registered EPF driver will be listed in controllers directory. The
entries corresponding to EPF driver will be created by the EPF core.
+::
-/sys/kernel/config/pci_ep/functions/
- .. <EPF Driver1>/
- ... <EPF Device 11>/
- ... <EPF Device 21>/
- .. <EPF Driver2>/
- ... <EPF Device 12>/
- ... <EPF Device 22>/
+ /sys/kernel/config/pci_ep/functions/
+ .. <EPF Driver1>/
+ ... <EPF Device 11>/
+ ... <EPF Device 21>/
+ .. <EPF Driver2>/
+ ... <EPF Device 12>/
+ ... <EPF Device 22>/
In order to create a <EPF device> of the type probed by <EPF Driver>, the
user has to create a directory inside <EPF DriverN>.
@@ -44,34 +54,37 @@ Every <EPF device> directory 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 <EPF Device> is
created)
-
- .. <EPF Driver1>/
- ... <EPF Device 11>/
- ... vendorid
- ... deviceid
- ... revid
- ... progif_code
- ... subclass_code
- ... baseclass_code
- ... cache_line_size
- ... subsys_vendor_id
- ... subsys_id
- ... interrupt_pin
-
-*) EPC Device
+::
+
+ .. <EPF Driver1>/
+ ... <EPF Device 11>/
+ ... vendorid
+ ... deviceid
+ ... revid
+ ... progif_code
+ ... subclass_code
+ ... baseclass_code
+ ... cache_line_size
+ ... subsys_vendor_id
+ ... subsys_id
+ ... interrupt_pin
+
+EPC Device
+==========
Every registered EPC device will be listed in controllers directory. The
entries corresponding to EPC device will be created by the EPC core.
-
-/sys/kernel/config/pci_ep/controllers/
- .. <EPC Device1>/
- ... <Symlink EPF Device11>/
- ... <Symlink EPF Device12>/
- ... start
- .. <EPC Device2>/
- ... <Symlink EPF Device21>/
- ... <Symlink EPF Device22>/
- ... start
+::
+
+ /sys/kernel/config/pci_ep/controllers/
+ .. <EPC Device1>/
+ ... <Symlink EPF Device11>/
+ ... <Symlink EPF Device12>/
+ ... start
+ .. <EPC Device2>/
+ ... <Symlink EPF Device21>/
+ ... <Symlink EPF Device22>/
+ ... start
The <EPC Device> directory will have a list of symbolic links to
<EPF Device>. These symbolic links should be created by the user to
@@ -81,7 +94,7 @@ The <EPC Device> directory will also have a *start* field. Once
"1" is written to this field, the endpoint device will be ready to
establish the link with the host. This is usually done after
all the EPF devices are created and linked with the EPC device.
-
+::
| controllers/
| <Directory: EPC name>/
@@ -102,4 +115,4 @@ all the EPF devices are created and linked with the EPC device.
| interrupt_pin
| function
-[1] -> Documentation/PCI/endpoint/pci-endpoint.txt
+[1] :doc:`pci-endpoint`

Documentation/PCI/endpoint/pci-endpoint.rst

View file
diff --git a/Documentation/PCI/endpoint/pci-endpoint.txt b/Documentation/PCI/endpoint/pci-endpoint.rst
similarity index 66%
rename from Documentation/PCI/endpoint/pci-endpoint.txt
rename to Documentation/PCI/endpoint/pci-endpoint.rst
index e86a96b..0e2311b 100644
--- a/Documentation/PCI/endpoint/pci-endpoint.txt
+++ b/Documentation/PCI/endpoint/pci-endpoint.rst
@@ -1,11 +1,13 @@
- PCI ENDPOINT FRAMEWORK
- Kishon Vijay Abraham I <[email protected]>
+.. SPDX-License-Identifier: GPL-2.0
+
+:Author: Kishon Vijay Abraham I <[email protected]>
This document is a guide to use the PCI Endpoint Framework in order to create
endpoint controller driver, endpoint function driver, and using configfs
interface to bind the function driver to the controller driver.
-1. Introduction
+Introduction
+============
Linux has a comprehensive PCI subsystem to support PCI controllers that
operates in Root Complex mode. The subsystem has capability to scan PCI bus,
@@ -19,26 +21,30 @@ add endpoint mode support in Linux. This will help to run Linux in an
EP system which can have a wide variety of use cases from testing or
validation, co-processor accelerator, etc.
-2. PCI Endpoint Core
+PCI Endpoint Core
+=================
The PCI Endpoint Core layer comprises 3 components: the Endpoint Controller
library, the Endpoint Function library, and the configfs layer to bind the
endpoint function with the endpoint controller.
-2.1 PCI Endpoint Controller(EPC) Library
+PCI Endpoint Controller(EPC) Library
+------------------------------------
The EPC library provides APIs to be used by the controller that can operate
in endpoint mode. It also provides APIs to be used by function driver/library
in order to implement a particular endpoint function.
-2.1.1 APIs for the PCI controller Driver
+APIs for the PCI controller Driver
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This section lists the APIs that the PCI Endpoint core provides to be used
by the PCI controller driver.
-*) devm_pci_epc_create()/pci_epc_create()
+* devm_pci_epc_create()/pci_epc_create()
The PCI controller driver should implement the following ops:
+
* write_header: ops to populate configuration space header
* set_bar: ops to configure the BAR
* clear_bar: ops to reset the BAR
@@ -51,110 +57,116 @@ by the PCI controller driver.
The PCI controller driver can then create a new EPC device by invoking
devm_pci_epc_create()/pci_epc_create().
-*) devm_pci_epc_destroy()/pci_epc_destroy()
+* devm_pci_epc_destroy()/pci_epc_destroy()
The PCI controller driver can destroy the EPC device created by either
devm_pci_epc_create() or pci_epc_create() using devm_pci_epc_destroy() or
pci_epc_destroy().
-*) pci_epc_linkup()
+* pci_epc_linkup()
In order to notify all the function devices that the EPC device to which
they are linked has established a link with the host, the PCI controller
driver should invoke pci_epc_linkup().
-*) pci_epc_mem_init()
+* pci_epc_mem_init()
Initialize the pci_epc_mem structure used for allocating EPC addr space.
-*) pci_epc_mem_exit()
+* pci_epc_mem_exit()
Cleanup the pci_epc_mem structure allocated during pci_epc_mem_init().
-2.1.2 APIs for the PCI Endpoint Function Driver
+
+APIs for the PCI Endpoint Function Driver
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This section lists the APIs that the PCI Endpoint core provides to be used
by the PCI endpoint function driver.
-*) pci_epc_write_header()
+* pci_epc_write_header()
The PCI endpoint function driver should use pci_epc_write_header() to
write the standard configuration header to the endpoint controller.
-*) pci_epc_set_bar()
+* pci_epc_set_bar()
The PCI endpoint function driver should use pci_epc_set_bar() to configure
the Base Address Register in order for the host to assign PCI addr space.
Register space of the function driver is usually configured
using this API.
-*) pci_epc_clear_bar()
+* pci_epc_clear_bar()
The PCI endpoint function driver should use pci_epc_clear_bar() to reset
the BAR.
-*) pci_epc_raise_irq()
+* pci_epc_raise_irq()
The PCI endpoint function driver should use pci_epc_raise_irq() to raise
Legacy Interrupt, MSI or MSI-X Interrupt.
-*) pci_epc_mem_alloc_addr()
+* pci_epc_mem_alloc_addr()
The PCI endpoint function driver should use pci_epc_mem_alloc_addr(), to
allocate memory address from EPC addr space which is required to access
RC's buffer
-*) pci_epc_mem_free_addr()
+* pci_epc_mem_free_addr()
The PCI endpoint function driver should use pci_epc_mem_free_addr() to
free the memory space allocated using pci_epc_mem_alloc_addr().
-2.1.3 Other APIs
+Other APIs
+~~~~~~~~~~
There are other APIs provided by the EPC library. These are used for binding
the EPF device with EPC device. pci-ep-cfs.c can be used as reference for
using these APIs.
-*) pci_epc_get()
+* pci_epc_get()
Get a reference to the PCI endpoint controller based on the device name of
the controller.
-*) pci_epc_put()
+* pci_epc_put()
Release the reference to the PCI endpoint controller obtained using
pci_epc_get()
-*) pci_epc_add_epf()
+* pci_epc_add_epf()
Add a PCI endpoint function to a PCI endpoint controller. A PCIe device
can have up to 8 functions according to the specification.
-*) pci_epc_remove_epf()
+* pci_epc_remove_epf()
Remove the PCI endpoint function from PCI endpoint controller.
-*) pci_epc_start()
+* pci_epc_start()
The PCI endpoint function driver should invoke pci_epc_start() once it
has configured the endpoint function and wants to start the PCI link.
-*) pci_epc_stop()
+* pci_epc_stop()
The PCI endpoint function driver should invoke pci_epc_stop() to stop
the PCI LINK.
-2.2 PCI Endpoint Function(EPF) Library
+
+PCI Endpoint Function(EPF) Library
+----------------------------------
The EPF library provides APIs to be used by the function driver and the EPC
library to provide endpoint mode functionality.
-2.2.1 APIs for the PCI Endpoint Function Driver
+APIs for the PCI Endpoint Function Driver
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This section lists the APIs that the PCI Endpoint core provides to be used
by the PCI endpoint function driver.
-*) pci_epf_register_driver()
+* pci_epf_register_driver()
The PCI Endpoint Function driver should implement the following ops:
* bind: ops to perform when a EPC device has been bound to EPF device
@@ -166,50 +178,54 @@ by the PCI endpoint function driver.
The PCI Function driver can then register the PCI EPF driver by using
pci_epf_register_driver().
-*) pci_epf_unregister_driver()
+* pci_epf_unregister_driver()
The PCI Function driver can unregister the PCI EPF driver by using
pci_epf_unregister_driver().
-*) pci_epf_alloc_space()
+* pci_epf_alloc_space()
The PCI Function driver can allocate space for a particular BAR using
pci_epf_alloc_space().
-*) pci_epf_free_space()
+* pci_epf_free_space()
The PCI Function driver can free the allocated space
(using pci_epf_alloc_space) by invoking pci_epf_free_space().
-2.2.2 APIs for the PCI Endpoint Controller Library
+APIs for the PCI Endpoint Controller Library
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
This section lists the APIs that the PCI Endpoint core provides to be used
by the PCI endpoint controller library.
-*) pci_epf_linkup()
+* pci_epf_linkup()
The PCI endpoint controller library invokes pci_epf_linkup() when the
EPC device has established the connection to the host.
-2.2.2 Other APIs
+Other APIs
+~~~~~~~~~~
+
There are other APIs provided by the EPF library. These are used to notify
the function driver when the EPF device is bound to the EPC device.
pci-ep-cfs.c can be used as reference for using these APIs.
-*) pci_epf_create()
+* pci_epf_create()
Create a new PCI EPF device by passing the name of the PCI EPF device.
This name will be used to bind the the EPF device to a EPF driver.
-*) pci_epf_destroy()
+* pci_epf_destroy()
Destroy the created PCI EPF device.
-*) pci_epf_bind()
+* pci_epf_bind()
pci_epf_bind() should be invoked when the EPF device has been bound to
a EPC device.
-*) pci_epf_unbind()
+* pci_epf_unbind()
pci_epf_unbind() should be invoked when the binding between EPC device
and EPF device is lost.

Documentation/PCI/endpoint/pci-test-function.rst

View file
diff --git a/Documentation/PCI/endpoint/pci-test-function.rst b/Documentation/PCI/endpoint/pci-test-function.rst
new file mode 100644
index 0000000..3c8521d
--- /dev/null
+++ b/Documentation/PCI/endpoint/pci-test-function.rst
@@ -0,0 +1,103 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+=================
+PCI Test Function
+=================
+
+:Author: Kishon Vijay Abraham I <[email protected]>
+
+Traditionally PCI RC has always been validated by using standard
+PCI cards like ethernet PCI cards or USB PCI cards or SATA PCI cards.
+However with the addition of EP-core in linux kernel, it is possible
+to configure a PCI controller that can operate in EP mode to work as
+a test device.
+
+The PCI endpoint test device is a virtual device (defined in software)
+used to test the endpoint functionality and serve as a sample driver
+for other PCI endpoint devices (to use the EP framework).
+
+The PCI endpoint test device has the following registers:
+
+ 1) PCI_ENDPOINT_TEST_MAGIC
+ 2) PCI_ENDPOINT_TEST_COMMAND
+ 3) PCI_ENDPOINT_TEST_STATUS
+ 4) PCI_ENDPOINT_TEST_SRC_ADDR
+ 5) PCI_ENDPOINT_TEST_DST_ADDR
+ 6) PCI_ENDPOINT_TEST_SIZE
+ 7) PCI_ENDPOINT_TEST_CHECKSUM
+ 8) PCI_ENDPOINT_TEST_IRQ_TYPE
+ 9) PCI_ENDPOINT_TEST_IRQ_NUMBER
+
+* PCI_ENDPOINT_TEST_MAGIC
+
+This register will be used to test BAR0. A known pattern will be written
+and read back from MAGIC register to verify BAR0.
+
+* PCI_ENDPOINT_TEST_COMMAND
+
+This register will be used by the host driver to indicate the function
+that the endpoint device must perform.
+
+======== ================================================================
+Bitfield Description
+======== ================================================================
+Bit 0 raise legacy IRQ
+Bit 1 raise MSI IRQ
+Bit 2 raise MSI-X IRQ
+Bit 3 read command (read data from RC buffer)
+Bit 4 write command (write data to RC buffer)
+Bit 5 copy command (copy data from one RC buffer to another RC buffer)
+======== ================================================================
+
+* PCI_ENDPOINT_TEST_STATUS
+
+This register reflects the status of the PCI endpoint device.
+
+======== ==============================
+Bitfield Description
+======== ==============================
+Bit 0 read success
+Bit 1 read fail
+Bit 2 write success
+Bit 3 write fail
+Bit 4 copy success
+Bit 5 copy fail
+Bit 6 IRQ raised
+Bit 7 source address is invalid
+Bit 8 destination address is invalid
+======== ==============================
+
+* PCI_ENDPOINT_TEST_SRC_ADDR
+
+This register contains the source address (RC buffer address) for the
+COPY/READ command.
+
+* PCI_ENDPOINT_TEST_DST_ADDR
+
+This register contains the destination address (RC buffer address) for
+the COPY/WRITE command.
+
+* PCI_ENDPOINT_TEST_IRQ_TYPE
+
+This register contains the interrupt type (Legacy/MSI) triggered
+for the READ/WRITE/COPY and raise IRQ (Legacy/MSI) commands.
+
+Possible types:
+
+====== ==
+Legacy 0
+MSI 1
+MSI-X 2
+====== ==
+
+* PCI_ENDPOINT_TEST_IRQ_NUMBER
+
+This register contains the triggered ID interrupt.
+
+Admissible values:
+
+====== ===========
+Legacy 0
+MSI [1 .. 32]
+MSI-X [1 .. 2048]
+====== ===========

Documentation/PCI/endpoint/pci-test-function.txt

View before deletion
diff --git a/Documentation/PCI/endpoint/pci-test-function.txt b/Documentation/PCI/endpoint/pci-test-function.txt
deleted file mode 100644
index 5916f1f..0000000
--- a/Documentation/PCI/endpoint/pci-test-function.txt
+++ /dev/null
@@ -1,87 +0,0 @@
- PCI TEST
- Kishon Vijay Abraham I <[email protected]>
-

This diff is incomplete. Download the complete patch.

Documentation/PCI/endpoint/pci-test-howto.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/PCI/index.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/PCI/msi-howto.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/PCI/pci-error-recovery.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/PCI/pci-iov-howto.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/PCI/pci.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/PCI/pcieaer-howto.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/PCI/picebus-howto.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/admin-guide/kernel-parameters.txt

View file

This diff is incomplete. Download the complete patch.

Documentation/cpu-freq/core.txt

View file

This diff is incomplete. Download the complete patch.

Documentation/devicetree/bindings/pci/mobiveil-pcie.txt

View file

This diff is incomplete. Download the complete patch.

Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt

View file

This diff is incomplete. Download the complete patch.

Documentation/devicetree/bindings/pci/pci.txt

View file

This diff is incomplete. Download the complete patch.

Documentation/devicetree/bindings/pci/qcom,pcie.txt

View file

This diff is incomplete. Download the complete patch.

Documentation/devicetree/bindings/pci/rcar-pci.txt

View file

This diff is incomplete. Download the complete patch.

Documentation/driver-api/pm/devices.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/driver-api/usb/power-management.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/index.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/apm-acpi.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/basic-pm-debugging.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/charger-manager.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/drivers-testing.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/energy-model.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/freezing-of-tasks.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/index.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/interface.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/opp.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/pci.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/pm_qos_interface.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/power_supply_class.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/power_supply_class.txt

View before deletion

This diff is incomplete. Download the complete patch.

Documentation/power/powercap/powercap.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/powercap/powercap.txt

View before deletion

This diff is incomplete. Download the complete patch.

Documentation/power/regulator/consumer.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/regulator/design.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/regulator/machine.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/regulator/overview.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/regulator/regulator.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/runtime_pm.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/s2ram.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/suspend-and-cpuhotplug.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/suspend-and-interrupts.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/swsusp-and-swap-files.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/swsusp-dmcrypt.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/swsusp.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/tricks.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/userland-swsusp.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/power/video.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/process/submitting-drivers.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/scheduler/sched-energy.rst

View file

This diff is incomplete. Download the complete patch.

Documentation/trace/coresight-cpu-debug.txt

View file

This diff is incomplete. Download the complete patch.

Documentation/translations/zh_CN/process/submitting-drivers.rst

View file

This diff is incomplete. Download the complete patch.

MAINTAINERS

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/pci.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/pci_root.c

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/i915/intel_runtime_pm.h

View file

This diff is incomplete. Download the complete patch.

drivers/opp/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/pci/ats.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/dwc/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/dwc/pci-dra7xx.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/dwc/pcie-armada8k.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/dwc/pcie-designware-host.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/dwc/pcie-designware.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/dwc/pcie-designware.h

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/dwc/pcie-kirin.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/dwc/pcie-qcom.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/pci-aardvark.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/pci-hyperv.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/pci-tegra.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/pcie-altera-msi.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/pcie-altera.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/pcie-iproc-platform.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/pcie-iproc.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/pcie-mobiveil.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/pcie-xilinx-nwl.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/controller/vmd.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/endpoint/functions/pci-epf-test.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/endpoint/pci-epc-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/iov.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/mmap.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/msi.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/p2pdma.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/pci-bridge-emul.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/pci-driver.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/pci-pf-stub.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/pci-sysfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/pci.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/pci.h

View file

This diff is incomplete. Download the complete patch.

drivers/pci/pcie/aer_inject.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/probe.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/proc.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/quirks.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/setup-bus.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/slot.c

View file

This diff is incomplete. Download the complete patch.

drivers/power/supply/power_supply_core.c

View file

This diff is incomplete. Download the complete patch.

drivers/soc/tegra/pmc.c

View file

This diff is incomplete. Download the complete patch.

include/linux/interrupt.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mod_devicetable.h

View file

This diff is incomplete. Download the complete patch.

include/linux/pci-acpi.h

View file

This diff is incomplete. Download the complete patch.

include/linux/pci.h

View file

This diff is incomplete. Download the complete patch.

include/linux/pci_ids.h

View file

This diff is incomplete. Download the complete patch.

include/linux/pm.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/pci_regs.h

View file

This diff is incomplete. Download the complete patch.

kernel/power/Kconfig

View file

This diff is incomplete. Download the complete patch.

net/wireless/Kconfig

View file

This diff is incomplete. Download the complete patch.

tools/pci/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/pci/pcitest.c

View file

This diff is incomplete. Download the complete patch.