8212 manpages contain obsolete references
[unleashed.git] / usr / src / man / man4 / pci.4
blob7df0d6be9ac5e0763930915b5a507ccbbfd7e68b
1 '\" te
2 .\"  Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PCI 4 "May 13, 2017"
7 .SH NAME
8 pci, pcie \- configuration files for PCI and PCI Express device drivers
9 .SH DESCRIPTION
10 .LP
11 The Peripheral Component Interconnect (PCI) bus is a little endian bus. PCI
12 Express (PCIe) and PCI-X are successors to PCI. All three types of devices
13 share the same configuration parameters. What is specified here for PCI devices
14 applies to PCI-X 1.0 devices as well. All three types of devices are
15 self-identifying, which means that these devices provide configuration
16 parameters to the system that allow the system to identify the device and its
17 driver. The configuration parameters are represented in the form of name-value
18 pairs that can be retrieved using the \fBDDI\fR property interfaces. See
19 \fBddi_prop_lookup\fR(9F) for details.
20 .sp
21 .LP
22 The bus properties of PCI devices or logical bus properties of PCIe devices are
23 derived from PCI configuration space, or supplied by the Fcode \fBPROM\fR, if
24 it exists. Therefore, driver configuration files are not necessary for these
25 devices.
26 .sp
27 .LP
28 On some occasions, drivers for \fBPCI\fR and PCIe devices can use driver
29 configuration files to provide driver private properties through the global
30 property mechanism. See \fBdriver.conf\fR(4) for further details. Driver
31 configuration files can also be used to augment or override properties for a
32 specific instance of a driver.
33 .sp
34 .LP
35 All bus drivers of PCI and PCIe devices recognize the following properties:
36 .sp
37 .ne 2
38 .na
39 \fB\fBreg\fR\fR
40 .ad
41 .RS 14n
42 An arbitrary length array where each element of the array consists of a 5-tuple
43 of 32-bit values. Each array element describes a logically contiguous mappable
44 resource on the \fBPCI\fR bus or PCIe device tree.
45 .sp
46 The first three values in the 5-tuple describe the \fBPCI\fR address of the
47 mappable resource. The first tuple contains the following information:
48 .sp
50 .sp
51 .TS
52 l l l
53 l l l .
54 Bits 0 - 7      8-bit register number   
55 Bits 8 - 10     3-bit function number   
56 Bits 11 - 15    5-bit device number     
57 Bits 16 - 23    8-bit bus number        
58 Bits 24 - 25    2-bit address space type identifier     
59 Bits 31 - 28    T{
60 Register number extended bits 8:11 for extended config space. Zero for conventional configuration space.
61 T}      
62 .TE
64 The address space type identifier can be interpreted as follows:
65 .sp
67 .sp
68 .TS
69 l l l
70 l l l .
71 0x0     configuration space     
72 0x1     I/O space       
73 0x2     32-bit memory space address     
74 0x3     64-bit memory space address     
75 .TE
77 The bus number is a unique identifying number assigned to each \fBPCI\fR bus or
78 PCIe logical bus within its domain.
79 .sp
80 The device number is a unique identifying number assigned to each device on a
81 \fBPCI\fR bus or PCIe logical bus. Note that a device number is unique only
82 within the set of device numbers for a particular bus or logical bus.
83 .sp
84 Each \fBPCI\fR or PCIe device can have one to eight logically independent
85 functions, each with its own independent set of configuration registers. Each
86 function on a device is assigned a function number. For a device with only one
87 function, the function number must be \fB0\fR.
88 .sp
89 The register number fields select a particular register within the set of
90 configuration registers corresponding to the selected function. When the
91 address space type identifier indicates configuration space, non-zero register
92 number extended bits select registers in extended configuration space.
93 .sp
94 The second and third values in the \fBreg\fR property 5-tuple specify the
95 64-bit address of the mappable resource within the \fBPCI\fR or PCIe address
96 domain. The second 32-bit tuple corresponds to the high order four bytes of the
97 64-bit address. The third 32-bit tuple corresponds to the low order bytes.
98 .sp
99 The fourth and fifth 32-bit values in the 5-tuple \fBreg\fR property specify
100 the size of the mappable resource. The size is a 64-bit value, where the fourth
101 tuple corresponds to the high order bytes of the 64-bit size and the fifth
102 corresponds to the low order.
104 The driver can refer to the elements of this array by index, and construct
105 kernel mappings to these addresses using \fBddi_regs_map_setup\fR(9F). The
106 index into the array is passed as the \fIrnumber\fR argument of
107 \fBddi_regs_map_setup\fR(9F).
109 At a high-level interrupt context, you can use the \fBddi_get*\fR and
110 \fBddi_put*\fR family of functions to access I/O and memory space. However,
111 access to configuration space is not allowed when running at a high-interrupt
112 level.
116 .ne 2
118 \fB\fBinterrupts\fR\fR
120 .RS 14n
121 This property consists of a single-integer element array. Valid interrupt
122 property values are \fB1\fR, \fB2\fR, \fB3\fR, and \fB4\fR. This value is
123 derived directly from the contents of the device's configuration-interrupt-pin
124 register.
126 A driver should use an index value of \fB0\fR when registering its interrupt
127 handler with the DDI interrupt interfaces.
132 All \fBPCI\fR and PCIe devices support the \fBreg\fR property. The device
133 number and function number as derived from the \fBreg\fR property are used to
134 construct the address part of the device name under \fB/devices\fR.
137 Only devices that generate interrupts support an \fBinterrupts\fR property.
140 Occasionally it might be necessary to override or augment the configuration
141 information supplied by a \fBPCI\fR or PCIe device. This change can be achieved
142 by writing a driver configuration file that describes a prototype device node
143 specification containing the additional properties required.
146 For the system to merge the prototype node specification into an actual device
147 node, certain conditions must be met.
148 .RS +4
150 .ie t \(bu
151 .el o
152 First, the \fBname\fR property must be identical. The value of the \fBname\fR
153 property needs to match the binding name of the device. The binding name is the
154 name chosen by the system to bind a driver to a device and is either an alias
155 associated with the driver or the hardware node name of the device.
157 .RS +4
159 .ie t \(bu
160 .el o
161 Second, the parent property must identify the PCI bus or PCIe logical bus.
163 .RS +4
165 .ie t \(bu
166 .el o
167 Third, the unit-address property must identify the card. The format of the
168 unit-address property is:
172 \fBDD[,F]\fR
175 where \fBDD\fR is the device number and \fBF\fR is the function number. If the
176 function number is 0, only \fBDD\fR is specified.
177 .SH EXAMPLES
179 \fBExample 1 \fRSample Configuration File
182 An example configuration file called \fBACME,scsi-hba.conf\fR for a \fBPCI\fR
183 driver called \fBACME,scsi-hba\fR follows:
186 .in +2
189 # Copyright (c) 1995, ACME SCSI Host Bus Adaptor
190 # ident   "@(#)ACME,scsi-hba.conf  1.1  96/02/04"
191 name="ACME,scsi-hba" parent="/pci@1,0/pci@1f,4000"
192    unit-address="3" scsi-initiator-id=6;
193 hba-advanced-mode="on";
194 hba-dma-speed=10;
196 .in -2
201 In this example, a property \fBscsi-initiator-id\fR specifies the \fBSCSI\fR
202 bus initiator id that the adapter should use, for just one particular instance
203 of adapter installed in the machine. The \fBname\fR property identifies the
204 driver and the parent property to identify the particular bus the card is
205 plugged into. This example uses the parent's full path name to identify the
206 bus. The unit-address property identifies the card itself, with device number
207 of 3 and function number of 0.
211 Two global driver properties are also created: \fBhba-advanced-mode\fR (which
212 has the string value \fBon\fR) and \fBhba-dma-speed\fR (which has the value
213 \fB10\fR M bit/s). These properties apply to all device nodes of the
214 \fBACME,scsi-hba\fR.
218 Configuration files for PCIe devices are similar. Shown below is an example
219 configuration file called \fBACME,pcie-widget.conf\fR for a PCIe driver called
220 \fBACME,pcie-widget\fR.
223 .in +2
226 # Copyright (c) 2005, ACME PCIe Widget Adapter
227 # ident   "@(#)ACME,pcie-widget.conf  1.1  05/11/14"
228 name="ACME,pcie-widget" parent="/pci@780" unit-address="2,1"
229 debug-mode=12;
231 .in -2
236 In this example, we provide a property \fBdebug-mode\fR for a particular PCIe
237 device. As before, the logical bus is identified by the pathname of the parent
238 of the device. The device has a device number of 2, and a function number of 1.
240 .SH ATTRIBUTES
242 See \fBattributes\fR(5) for descriptions of the following attributes:
247 box;
248 c | c
249 l | l .
250 ATTRIBUTE TYPE  ATTRIBUTE VALUE
252 Architecture    SPARC, x86
255 .SH SEE ALSO
257 \fBdriver.conf\fR(4), \fBattributes\fR(5), \fBddi_intr_add_handler\fR(9F),
258 \fBddi_prop_lookup\fR(9F), \fBddi_regs_map_setup\fR(9F)
261 \fIWriting Device Drivers\fR
264 \fIIEEE 1275 PCI Bus Binding\fR
265 .SH NOTES
267 PCIe devices support an extended configuration space unavailable to PCI
268 devices. While PCIe devices can be operated using a PCI device driver,
269 operating them using a PCIe device driver can make use of the extended
270 properties and features made available only in the extended configuration
271 space.