Skip to content

Commit 857f864

Browse files
committed
Merge tag 'pci-v4.12-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI updates from Bjorn Helgaas: - add framework for supporting PCIe devices in Endpoint mode (Kishon Vijay Abraham I) - use non-postable PCI config space mappings when possible (Lorenzo Pieralisi) - clean up and unify mmap of PCI BARs (David Woodhouse) - export and unify Function Level Reset support (Christoph Hellwig) - avoid FLR for Intel 82579 NICs (Sasha Neftin) - add pci_request_irq() and pci_free_irq() helpers (Christoph Hellwig) - short-circuit config access failures for disconnected devices (Keith Busch) - remove D3 sleep delay when possible (Adrian Hunter) - freeze PME scan before suspending devices (Lukas Wunner) - stop disabling MSI/MSI-X in pci_device_shutdown() (Prarit Bhargava) - disable boot interrupt quirk for ASUS M2N-LR (Stefan Assmann) - add arch-specific alignment control to improve device passthrough by avoiding multiple BARs in a page (Yongji Xie) - add sysfs sriov_drivers_autoprobe to control VF driver binding (Bodong Wang) - allow slots below PCI-to-PCIe "reverse bridges" (Bjorn Helgaas) - fix crashes when unbinding host controllers that don't support removal (Brian Norris) - add driver for MicroSemi Switchtec management interface (Logan Gunthorpe) - add driver for Faraday Technology FTPCI100 host bridge (Linus Walleij) - add i.MX7D support (Andrey Smirnov) - use generic MSI support for Aardvark (Thomas Petazzoni) - make Rockchip driver modular (Brian Norris) - advertise 128-byte Read Completion Boundary support for Rockchip (Shawn Lin) - advertise PCI_EXP_LNKSTA_SLC for Rockchip root port (Shawn Lin) - convert atomic_t to refcount_t in HV driver (Elena Reshetova) - add CPU IRQ affinity in HV driver (K. Y. Srinivasan) - fix PCI bus removal in HV driver (Long Li) - add support for ThunderX2 DMA alias topology (Jayachandran C) - add ThunderX pass2.x 2nd node MCFG quirk (Tomasz Nowicki) - add ITE 8893 bridge DMA alias quirk (Jarod Wilson) - restrict Cavium ACS quirk only to CN81xx/CN83xx/CN88xx devices (Manish Jaggi) * tag 'pci-v4.12-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (146 commits) PCI: Don't allow unbinding host controllers that aren't prepared ARM: DRA7: clockdomain: Change the CLKTRCTRL of CM_PCIE_CLKSTCTRL to SW_WKUP MAINTAINERS: Add PCI Endpoint maintainer Documentation: PCI: Add userguide for PCI endpoint test function tools: PCI: Add sample test script to invoke pcitest tools: PCI: Add a userspace tool to test PCI endpoint Documentation: misc-devices: Add Documentation for pci-endpoint-test driver misc: Add host side PCI driver for PCI test function device PCI: Add device IDs for DRA74x and DRA72x dt-bindings: PCI: dra7xx: Add DT bindings to enable unaligned access PCI: dwc: dra7xx: Workaround for errata id i870 dt-bindings: PCI: dra7xx: Add DT bindings for PCI dra7xx EP mode PCI: dwc: dra7xx: Add EP mode support PCI: dwc: dra7xx: Facilitate wrapper and MSI interrupts to be enabled independently dt-bindings: PCI: Add DT bindings for PCI designware EP mode PCI: dwc: designware: Add EP mode support Documentation: PCI: Add binding documentation for pci-test endpoint function ixgbe: Use pcie_flr() instead of duplicating it IB/hfi1: Use pcie_flr() instead of duplicating it PCI: imx6: Fix spelling mistake: "contol" -> "control" ...
2 parents 8f3207c + 3146c8f commit 857f864

File tree

148 files changed

+8937
-1004
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+8937
-1004
lines changed

Documentation/ABI/testing/sysfs-bus-pci

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,3 +301,25 @@ Contact: Emil Velikov <emil.l.velikov@gmail.com>
301301
Description:
302302
This file contains the revision field of the PCI device.
303303
The value comes from device config space. The file is read only.
304+
305+
What: /sys/bus/pci/devices/.../sriov_drivers_autoprobe
306+
Date: April 2017
307+
Contact: Bodong Wang<bodong@mellanox.com>
308+
Description:
309+
This file is associated with the PF of a device that
310+
supports SR-IOV. It determines whether newly-enabled VFs
311+
are immediately bound to a driver. It initially contains
312+
1, which means the kernel automatically binds VFs to a
313+
compatible driver immediately after they are enabled. If
314+
an application writes 0 to the file before enabling VFs,
315+
the kernel will not bind VFs to a driver.
316+
317+
A typical use case is to write 0 to this file, then enable
318+
VFs, then assign the newly-created VFs to virtual machines.
319+
Note that changing this file does not affect already-
320+
enabled VFs. In this scenario, the user must first disable
321+
the VFs, write 0 to sriov_drivers_autoprobe, then re-enable
322+
the VFs.
323+
324+
This is similar to /sys/bus/pci/drivers_autoprobe, but
325+
affects only the VFs associated with a specific PF.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
switchtec - Microsemi Switchtec PCI Switch Management Endpoint
2+
3+
For details on this subsystem look at Documentation/switchtec.txt.
4+
5+
What: /sys/class/switchtec
6+
Date: 05-Jan-2017
7+
KernelVersion: v4.11
8+
Contact: Logan Gunthorpe <logang@deltatee.com>
9+
Description: The switchtec class subsystem folder.
10+
Each registered switchtec driver is represented by a switchtecX
11+
subfolder (X being an integer >= 0).
12+
13+
14+
What: /sys/class/switchtec/switchtec[0-9]+/component_id
15+
Date: 05-Jan-2017
16+
KernelVersion: v4.11
17+
Contact: Logan Gunthorpe <logang@deltatee.com>
18+
Description: Component identifier as stored in the hardware (eg. PM8543)
19+
(read only)
20+
Values: arbitrary string.
21+
22+
23+
What: /sys/class/switchtec/switchtec[0-9]+/component_revision
24+
Date: 05-Jan-2017
25+
KernelVersion: v4.11
26+
Contact: Logan Gunthorpe <logang@deltatee.com>
27+
Description: Component revision stored in the hardware (read only)
28+
Values: integer.
29+
30+
31+
What: /sys/class/switchtec/switchtec[0-9]+/component_vendor
32+
Date: 05-Jan-2017
33+
KernelVersion: v4.11
34+
Contact: Logan Gunthorpe <logang@deltatee.com>
35+
Description: Component vendor as stored in the hardware (eg. MICROSEM)
36+
(read only)
37+
Values: arbitrary string.
38+
39+
40+
What: /sys/class/switchtec/switchtec[0-9]+/device_version
41+
Date: 05-Jan-2017
42+
KernelVersion: v4.11
43+
Contact: Logan Gunthorpe <logang@deltatee.com>
44+
Description: Device version as stored in the hardware (read only)
45+
Values: integer.
46+
47+
48+
What: /sys/class/switchtec/switchtec[0-9]+/fw_version
49+
Date: 05-Jan-2017
50+
KernelVersion: v4.11
51+
Contact: Logan Gunthorpe <logang@deltatee.com>
52+
Description: Currently running firmware version (read only)
53+
Values: integer (in hexadecimal).
54+
55+
56+
What: /sys/class/switchtec/switchtec[0-9]+/partition
57+
Date: 05-Jan-2017
58+
KernelVersion: v4.11
59+
Contact: Logan Gunthorpe <logang@deltatee.com>
60+
Description: Partition number for this device in the switch (read only)
61+
Values: integer.
62+
63+
64+
What: /sys/class/switchtec/switchtec[0-9]+/partition_count
65+
Date: 05-Jan-2017
66+
KernelVersion: v4.11
67+
Contact: Logan Gunthorpe <logang@deltatee.com>
68+
Description: Total number of partitions in the switch (read only)
69+
Values: integer.
70+
71+
72+
What: /sys/class/switchtec/switchtec[0-9]+/product_id
73+
Date: 05-Jan-2017
74+
KernelVersion: v4.11
75+
Contact: Logan Gunthorpe <logang@deltatee.com>
76+
Description: Product identifier as stored in the hardware (eg. PSX 48XG3)
77+
(read only)
78+
Values: arbitrary string.
79+
80+
81+
What: /sys/class/switchtec/switchtec[0-9]+/product_revision
82+
Date: 05-Jan-2017
83+
KernelVersion: v4.11
84+
Contact: Logan Gunthorpe <logang@deltatee.com>
85+
Description: Product revision stored in the hardware (eg. RevB)
86+
(read only)
87+
Values: arbitrary string.
88+
89+
90+
What: /sys/class/switchtec/switchtec[0-9]+/product_vendor
91+
Date: 05-Jan-2017
92+
KernelVersion: v4.11
93+
Contact: Logan Gunthorpe <logang@deltatee.com>
94+
Description: Product vendor as stored in the hardware (eg. MICROSEM)
95+
(read only)
96+
Values: arbitrary string.

Documentation/PCI/00-INDEX

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,13 @@ pci.txt
1212
- info on the PCI subsystem for device driver authors
1313
pcieaer-howto.txt
1414
- the PCI Express Advanced Error Reporting Driver Guide HOWTO
15+
endpoint/pci-endpoint.txt
16+
- guide to add endpoint controller driver and endpoint function driver.
17+
endpoint/pci-endpoint-cfs.txt
18+
- guide to use configfs to configure the PCI endpoint function.
19+
endpoint/pci-test-function.txt
20+
- specification of *PCI test* function device.
21+
endpoint/pci-test-howto.txt
22+
- userguide for PCI endpoint test function.
23+
endpoint/function/binding/
24+
- binding documentation for PCI endpoint function
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
PCI TEST ENDPOINT FUNCTION
2+
3+
name: Should be "pci_epf_test" to bind to the pci_epf_test driver.
4+
5+
Configurable Fields:
6+
vendorid : should be 0x104c
7+
deviceid : should be 0xb500 for DRA74x and 0xb501 for DRA72x
8+
revid : don't care
9+
progif_code : don't care
10+
subclass_code : don't care
11+
baseclass_code : should be 0xff
12+
cache_line_size : don't care
13+
subsys_vendor_id : don't care
14+
subsys_id : don't care
15+
interrupt_pin : Should be 1 - INTA, 2 - INTB, 3 - INTC, 4 -INTD
16+
msi_interrupts : Should be 1 to 32 depending on the number of MSI interrupts
17+
to test
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
CONFIGURING PCI ENDPOINT USING CONFIGFS
2+
Kishon Vijay Abraham I <kishon@ti.com>
3+
4+
The PCI Endpoint Core exposes configfs entry (pci_ep) to configure the
5+
PCI endpoint function and to bind the endpoint function
6+
with the endpoint controller. (For introducing other mechanisms to
7+
configure the PCI Endpoint Function refer to [1]).
8+
9+
*) Mounting configfs
10+
11+
The PCI Endpoint Core layer creates pci_ep directory in the mounted configfs
12+
directory. configfs can be mounted using the following command.
13+
14+
mount -t configfs none /sys/kernel/config
15+
16+
*) Directory Structure
17+
18+
The pci_ep configfs has two directories at its root: controllers and
19+
functions. Every EPC device present in the system will have an entry in
20+
the *controllers* directory and and every EPF driver present in the system
21+
will have an entry in the *functions* directory.
22+
23+
/sys/kernel/config/pci_ep/
24+
.. controllers/
25+
.. functions/
26+
27+
*) Creating EPF Device
28+
29+
Every registered EPF driver will be listed in controllers directory. The
30+
entries corresponding to EPF driver will be created by the EPF core.
31+
32+
/sys/kernel/config/pci_ep/functions/
33+
.. <EPF Driver1>/
34+
... <EPF Device 11>/
35+
... <EPF Device 21>/
36+
.. <EPF Driver2>/
37+
... <EPF Device 12>/
38+
... <EPF Device 22>/
39+
40+
In order to create a <EPF device> of the type probed by <EPF Driver>, the
41+
user has to create a directory inside <EPF DriverN>.
42+
43+
Every <EPF device> directory consists of the following entries that can be
44+
used to configure the standard configuration header of the endpoint function.
45+
(These entries are created by the framework when any new <EPF Device> is
46+
created)
47+
48+
.. <EPF Driver1>/
49+
... <EPF Device 11>/
50+
... vendorid
51+
... deviceid
52+
... revid
53+
... progif_code
54+
... subclass_code
55+
... baseclass_code
56+
... cache_line_size
57+
... subsys_vendor_id
58+
... subsys_id
59+
... interrupt_pin
60+
61+
*) EPC Device
62+
63+
Every registered EPC device will be listed in controllers directory. The
64+
entries corresponding to EPC device will be created by the EPC core.
65+
66+
/sys/kernel/config/pci_ep/controllers/
67+
.. <EPC Device1>/
68+
... <Symlink EPF Device11>/
69+
... <Symlink EPF Device12>/
70+
... start
71+
.. <EPC Device2>/
72+
... <Symlink EPF Device21>/
73+
... <Symlink EPF Device22>/
74+
... start
75+
76+
The <EPC Device> directory will have a list of symbolic links to
77+
<EPF Device>. These symbolic links should be created by the user to
78+
represent the functions present in the endpoint device.
79+
80+
The <EPC Device> directory will also have a *start* field. Once
81+
"1" is written to this field, the endpoint device will be ready to
82+
establish the link with the host. This is usually done after
83+
all the EPF devices are created and linked with the EPC device.
84+
85+
86+
| controllers/
87+
| <Directory: EPC name>/
88+
| <Symbolic Link: Function>
89+
| start
90+
| functions/
91+
| <Directory: EPF driver>/
92+
| <Directory: EPF device>/
93+
| vendorid
94+
| deviceid
95+
| revid
96+
| progif_code
97+
| subclass_code
98+
| baseclass_code
99+
| cache_line_size
100+
| subsys_vendor_id
101+
| subsys_id
102+
| interrupt_pin
103+
| function
104+
105+
[1] -> Documentation/PCI/endpoint/pci-endpoint.txt

0 commit comments

Comments
 (0)