]> git.ipfire.org Git - thirdparty/pciutils.git/blame - setpci.man
setpci: Fixed a silly bug in parsing of options.
[thirdparty/pciutils.git] / setpci.man
CommitLineData
4284af58 1.TH setpci 8 "@TODAY@" "@VERSION@" "The PCI Utilities"
b2c9b373
MM
2.IX setpci
3.SH NAME
6ece6bc6 4setpci \- configure PCI devices
b2c9b373
MM
5.SH SYNOPSIS
6.B setpci
7.RB [ options ]
8.B devices
9.BR operations ...
10
11.SH DESCRIPTION
12.PP
13.B setpci
727ce158
MM
14is a utility for querying and configuring PCI devices.
15
b2c9b373
MM
16All numbers are entered in hexadecimal notation.
17
84d437d6
MM
18Root privileges are necessary for almost all operations, excluding reads
19of the standard header of the configuration space on some operating systems.
20Please see
21.BR lspci(8)
22for details on access rights.
23
b2c9b373 24.SH OPTIONS
f2bf13dc
MM
25
26.SS General options
b2c9b373
MM
27.TP
28.B -v
29Tells
30.I setpci
31to be verbose and display detailed information about configuration space accesses.
32.TP
33.B -f
34Tells
727ce158 35.I setpci
b2c9b373
MM
36not to complain when there's nothing to do (when no devices are selected).
37This option is intended for use in widely-distributed configuration scripts
38where it's uncertain whether the device in question is present in the machine
39or not.
40.TP
41.B -D
5f5b1a7b 42`Demo mode' -- don't write anything to the configuration registers.
b2c9b373
MM
43It's useful to try
44.B setpci -vD
45to see what your complex sequence of
46.B setpci
47operations does before you actually execute it.
89984232
MM
48.TP
49.B --version
50Shows
51.I setpci
1f7c91cc 52version. This option should be used stand-alone.
89984232 53
f2bf13dc
MM
54.SS PCI access options
55.PP
56The PCI utilities use the PCI library to talk to PCI devices (see
57\fBpcilib\fP(7) for details). You can use the following options to
58influence its behavior:
59.TP
60.B -A <method>
61The library supports a variety of methods to access the PCI hardware.
62By default, it uses the first access method available, but you can use
63this option to override this decision. See \fB-A help\fP for a list of
64available methods and their descriptions.
65.TP
66.B -O <param>=<value>
67The behavior of the library is controlled by several named parameters.
68This option allows to set the value of any of the parameters. Use \fB-O help\fP
69for a list of known parameters and their default values.
70.TP
71.B -H1
72Use direct hardware access via Intel configuration mechanism 1.
73(This is a shorthand for \fB-A intel-conf1\fP.)
74.TP
75.B -H2
76Use direct hardware access via Intel configuration mechanism 2.
77(This is a shorthand for \fB-A intel-conf2\fP.)
78.TP
79.B -G
80Increase debug level of the library.
81
b2c9b373
MM
82.SH DEVICE SELECTION
83.PP
84Before each sequence of operations you need to select which devices you wish that
85operation to affect.
86.TP
1f7c91cc
MM
87.B -s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]
88Show only devices in the specified domain (in case your machine has several host bridges,
89they can either share a common bus number space or each of them can address a PCI domain
90of its own; domains are numbered from 0 to ffff), bus (0 to ff), slot (0 to 1f) and function (0 to 7).
91Each component of the device address can be omitted or set to "*", both meaning "any value". All numbers are
b2c9b373 92hexadecimal. E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
1f7c91cc
MM
93on any bus, "0.3" selects third function of device 0 on all buses and ".4" shows only
94the fourth function of each device.
b2c9b373
MM
95.TP
96.B -d [<vendor>]:[<device>]
97Select devices with specified vendor and device ID. Both ID's are given in
1f7c91cc 98hexadecimal and may be omitted or given as "*", both meaning "any value".
b2c9b373
MM
99
100.SH OPERATIONS
101.PP
102To query value of a configuration register, just name it (either by typing its name or
103by typing register address with optional
104.BR .B ,
105.B .W
106or
107.B .L
108suffix specifying register width as byte, word or longword).
109.PP
110To set a register, write
111.BR reg = values
112where
113.B reg
b7351143 114is the same as you would use to query the register and
b2c9b373
MM
115.B values
116is a comma-separated list of values you want to write starting with the given
b7351143
MM
117address. Each value to be written can be specified either as a hexadecimal number
118or as a
119.BR bits : mask
120pair which causes the bits corresponding to binary ones in the
121.B mask
122to be changed to values of the corresponding bits in the
123.B bits
124.
b2c9b373
MM
125
126.SH REGISTER NAMES
127.PP
128.B setpci
84d437d6 129knows the following configuration register names. See PCI bus specifications for their precise
b2c9b373 130meaning or consult
84d437d6
MM
131.B header.h
132or
b2c9b373 133.B /usr/include/linux/pci.h
84d437d6 134for a couple of comments.
b2c9b373
MM
135.PP
136.nf
137VENDOR_ID
138DEVICE_ID
139COMMAND
140STATUS
141REVISION
142CLASS_PROG
143CLASS_DEVICE
144CACHE_LINE_SIZE
145LATENCY_TIMER
146HEADER_TYPE
147BIST
148BASE_ADDRESS_0
149BASE_ADDRESS_1
150BASE_ADDRESS_2
151BASE_ADDRESS_3
152BASE_ADDRESS_4
153BASE_ADDRESS_5
154CARDBUS_CIS
155SUBSYSTEM_VENDOR_ID
156SUBSYSTEM_ID
157ROM_ADDRESS
158INTERRUPT_LINE
159INTERRUPT_PIN
160MIN_GNT
161MAX_LAT
162PRIMARY_BUS
163SECONDARY_BUS
164SUBORDINATE_BUS
165SEC_LATENCY_TIMER
166IO_BASE
167IO_LIMIT
168SEC_STATUS
169MEMORY_BASE
170MEMORY_LIMIT
171PREF_MEMORY_BASE
172PREF_MEMORY_LIMIT
173PREF_BASE_UPPER32
174PREF_LIMIT_UPPER32
175IO_BASE_UPPER16
176IO_LIMIT_UPPER16
177BRIDGE_ROM_ADDRESS
178BRIDGE_CONTROL
179CB_CARDBUS_BASE
180CB_CAPABILITIES
181CB_SEC_STATUS
182CB_BUS_NUMBER
183CB_CARDBUS_NUMBER
184CB_SUBORDINATE_BUS
185CB_CARDBUS_LATENCY
186CB_MEMORY_BASE_0
187CB_MEMORY_LIMIT_0
188CB_MEMORY_BASE_1
189CB_MEMORY_LIMIT_1
190CB_IO_BASE_0
191CB_IO_BASE_0_HI
192CB_IO_LIMIT_0
193CB_IO_LIMIT_0_HI
194CB_IO_BASE_1
195CB_IO_BASE_1_HI
196CB_IO_LIMIT_1
197CB_IO_LIMIT_1_HI
198CB_SUBSYSTEM_VENDOR_ID
199CB_SUBSYSTEM_ID
200CB_LEGACY_MODE_BASE
201
727ce158 202.SH SEE ALSO
f2bf13dc
MM
203.BR lspci (8),
204.BR pcilib (7)
727ce158 205
b2c9b373 206.SH AUTHOR
4284af58 207The PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.