xref: /OK3568_Linux_fs/kernel/Documentation/s390/pci.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun=========
4*4882a593SmuzhiyunS/390 PCI
5*4882a593Smuzhiyun=========
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunAuthors:
8*4882a593Smuzhiyun        - Pierre Morel
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunCopyright, IBM Corp. 2020
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunCommand line parameters and debugfs entries
14*4882a593Smuzhiyun===========================================
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunCommand line parameters
17*4882a593Smuzhiyun-----------------------
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun* nomio
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun  Do not use PCI Mapped I/O (MIO) instructions.
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun* norid
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun  Ignore the RID field and force use of one PCI domain per PCI function.
26*4882a593Smuzhiyun
27*4882a593Smuzhiyundebugfs entries
28*4882a593Smuzhiyun---------------
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunThe S/390 debug feature (s390dbf) generates views to hold various debug results in sysfs directories of the form:
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun * /sys/kernel/debug/s390dbf/pci_*/
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunFor example:
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun  - /sys/kernel/debug/s390dbf/pci_msg/sprintf
37*4882a593Smuzhiyun    Holds messages from the processing of PCI events, like machine check handling
38*4882a593Smuzhiyun    and setting of global functionality, like UID checking.
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun  Change the level of logging to be more or less verbose by piping
41*4882a593Smuzhiyun  a number between 0 and 6 to  /sys/kernel/debug/s390dbf/pci_*/level. For
42*4882a593Smuzhiyun  details, see the documentation on the S/390 debug feature at
43*4882a593Smuzhiyun  Documentation/s390/s390dbf.rst.
44*4882a593Smuzhiyun
45*4882a593SmuzhiyunSysfs entries
46*4882a593Smuzhiyun=============
47*4882a593Smuzhiyun
48*4882a593SmuzhiyunEntries specific to zPCI functions and entries that hold zPCI information.
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun* /sys/bus/pci/slots/XXXXXXXX
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun  The slot entries are set up using the function identifier (FID) of the
53*4882a593Smuzhiyun  PCI function.
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun  - /sys/bus/pci/slots/XXXXXXXX/power
56*4882a593Smuzhiyun
57*4882a593Smuzhiyun  A physical function that currently supports a virtual function cannot be
58*4882a593Smuzhiyun  powered off until all virtual functions are removed with:
59*4882a593Smuzhiyun  echo 0 > /sys/bus/pci/devices/XXXX:XX:XX.X/sriov_numvf
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun* /sys/bus/pci/devices/XXXX:XX:XX.X/
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun  - function_id
64*4882a593Smuzhiyun    A zPCI function identifier that uniquely identifies the function in the Z server.
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun  - function_handle
67*4882a593Smuzhiyun    Low-level identifier used for a configured PCI function.
68*4882a593Smuzhiyun    It might be useful for debuging.
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun  - pchid
71*4882a593Smuzhiyun    Model-dependent location of the I/O adapter.
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun  - pfgid
74*4882a593Smuzhiyun    PCI function group ID, functions that share identical functionality
75*4882a593Smuzhiyun    use a common identifier.
76*4882a593Smuzhiyun    A PCI group defines interrupts, IOMMU, IOTLB, and DMA specifics.
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun  - vfn
79*4882a593Smuzhiyun    The virtual function number, from 1 to N for virtual functions,
80*4882a593Smuzhiyun    0 for physical functions.
81*4882a593Smuzhiyun
82*4882a593Smuzhiyun  - pft
83*4882a593Smuzhiyun    The PCI function type
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun  - port
86*4882a593Smuzhiyun    The port corresponds to the physical port the function is attached to.
87*4882a593Smuzhiyun    It also gives an indication of the physical function a virtual function
88*4882a593Smuzhiyun    is attached to.
89*4882a593Smuzhiyun
90*4882a593Smuzhiyun  - uid
91*4882a593Smuzhiyun    The unique identifier (UID) is defined when configuring an LPAR and is
92*4882a593Smuzhiyun    unique in the LPAR.
93*4882a593Smuzhiyun
94*4882a593Smuzhiyun  - pfip/segmentX
95*4882a593Smuzhiyun    The segments determine the isolation of a function.
96*4882a593Smuzhiyun    They correspond to the physical path to the function.
97*4882a593Smuzhiyun    The more the segments are different, the more the functions are isolated.
98*4882a593Smuzhiyun
99*4882a593SmuzhiyunEnumeration and hotplug
100*4882a593Smuzhiyun=======================
101*4882a593Smuzhiyun
102*4882a593SmuzhiyunThe PCI address consists of four parts: domain, bus, device and function,
103*4882a593Smuzhiyunand is of this form: DDDD:BB:dd.f
104*4882a593Smuzhiyun
105*4882a593Smuzhiyun* When not using multi-functions (norid is set, or the firmware does not
106*4882a593Smuzhiyun  support multi-functions):
107*4882a593Smuzhiyun
108*4882a593Smuzhiyun  - There is only one function per domain.
109*4882a593Smuzhiyun
110*4882a593Smuzhiyun  - The domain is set from the zPCI function's UID as defined during the
111*4882a593Smuzhiyun    LPAR creation.
112*4882a593Smuzhiyun
113*4882a593Smuzhiyun* When using multi-functions (norid parameter is not set),
114*4882a593Smuzhiyun  zPCI functions are addressed differently:
115*4882a593Smuzhiyun
116*4882a593Smuzhiyun  - There is still only one bus per domain.
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun  - There can be up to 256 functions per bus.
119*4882a593Smuzhiyun
120*4882a593Smuzhiyun  - The domain part of the address of all functions for
121*4882a593Smuzhiyun    a multi-Function device is set from the zPCI function's UID as defined
122*4882a593Smuzhiyun    in the LPAR creation for the function zero.
123*4882a593Smuzhiyun
124*4882a593Smuzhiyun  - New functions will only be ready for use after the function zero
125*4882a593Smuzhiyun    (the function with devfn 0) has been enumerated.
126