1 .TH setpci 8 "@TODAY@" "@VERSION@" "The PCI Utilities"
3 setpci \- configure PCI devices
13 is a utility for querying and configuring PCI devices.
15 All numbers are entered in hexadecimal notation.
17 Root privileges are necessary for almost all operations, excluding reads
18 of the standard header of the configuration space on some operating systems.
21 for details on access rights.
30 to be verbose and display detailed information about configuration space accesses.
35 not to complain when there's nothing to do (when no devices are selected).
36 This option is intended for use in widely-distributed configuration scripts
37 where it's uncertain whether the device in question is present in the machine
41 `Demo mode' -- don't write anything to the configuration registers.
44 to verify that your complex sequence of
46 operations does what you think it should do.
51 version. This option should be used stand-alone.
54 Show detailed help on available options. This option should be used stand-alone.
57 Show a list of all known PCI registers and capabilities. This option should be
60 .SS PCI access options
62 The PCI utilities use the PCI library to talk to PCI devices (see
63 \fBpcilib\fP(7) for details). You can use the following options to
64 influence its behavior:
67 The library supports a variety of methods to access the PCI hardware.
68 By default, it uses the first access method available, but you can use
69 this option to override this decision. See \fB-A help\fP for a list of
70 available methods and their descriptions.
73 The behavior of the library is controlled by several named parameters.
74 This option allows to set the value of any of the parameters. Use \fB-O help\fP
75 for a list of known parameters and their default values.
78 Use direct hardware access via Intel configuration mechanism 1.
79 (This is a shorthand for \fB-A intel-conf1\fP.)
82 Use direct hardware access via Intel configuration mechanism 2.
83 (This is a shorthand for \fB-A intel-conf2\fP.)
86 Increase debug level of the library.
90 Before each sequence of operations you need to select which devices you wish that
93 .B -s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]
94 Consider only devices in the specified domain (in case your machine has several host bridges,
95 they can either share a common bus number space or each of them can address a PCI domain
96 of its own; domains are numbered from 0 to ffff), bus (0 to ff), slot (0 to 1f) and function (0 to 7).
97 Each component of the device address can be omitted or set to "*", both meaning "any value". All numbers are
98 hexadecimal. E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
99 on any bus, "0.3" selects third function of device 0 on all buses and ".4" matches only
100 the fourth function of each device.
102 .B -d [<vendor>]:[<device>]
103 Select devices with specified vendor and device ID. Both ID's are given in
104 hexadecimal and may be omitted or given as "*", both meaning "any value".
110 are combined, only devices that match both criteria are selected. When multiple
111 options of the same kind are specified, the rightmost one overrides the others.
115 There are two kinds of operations: reads and writes. To read a register, just specify
116 its name. Writes have the form
117 .IR name = value , value ...\&
120 is either a hexadecimal number or an expression of type
126 are hexadecimal numbers. In the latter case, only the bits corresponding to binary
127 ones in the \fImask\fP are changed (technically, this is a read-modify-write operation).
130 There are several ways how to identity a register:
132 Tell its address in hexadecimal.
134 Spell its name. Setpci knows the names of all registers in the standard configuration
135 headers. Use `\fBsetpci --dumpregs\fP' to get the complete list.
136 See PCI bus specifications for the precise meaning of these registers or consult
137 \fBheader.h\fP or \fB/usr/include/pci/pci.h\fP for a brief sketch.
139 If the register is a part of a PCI capability, you can specify the name of the
140 capability to get the address of its first register. See the names starting with
141 `CAP_' or `ECAP_' in the \fB--dumpregs\fP output.
143 If the name of the capability is not known to \fBsetpci\fP, you can refer to it
144 by its number in the form CAP\fBid\fP or ECAP\fBid\fP, where \fBid\fP is the numeric
145 identifier of the capability in hexadecimal.
147 Each of the previous formats can be followed by \fB+offset\fP to add an offset
148 (a hex number) to the address. This feature can be useful for addressing of registers
149 living within a capability, or to modify parts of standard registers.
151 Finally, you should append a width specifier \fB.B\fP, \fB.W\fP, or \fB.L\fP to choose
152 how many bytes (1, 2, or 4) should be transferred. The width can be omitted if you are
153 referring to a register by its name and the width of the register is well known.
156 All names of registers and width specifiers are case-insensitive.
162 asks for the word-sized command register.
164 is a numeric address of the same register.
166 asks for a 32-bit word starting at the location of the command register,
167 i.e., the command and status registers together.
169 specifies the upper byte of the vendor ID register (remember, PCI is little-endian).
171 corresponds to the second word of the power management capability.
173 asks for the first 32-bit word of the extended capability with ID 0x108.
180 The PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.