]> git.ipfire.org Git - thirdparty/pciutils.git/blame - setpci.man
Register caching rewrite
[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
MM
24.SH OPTIONS
25.TP
26.B -v
27Tells
28.I setpci
29to be verbose and display detailed information about configuration space accesses.
30.TP
31.B -f
32Tells
727ce158 33.I setpci
b2c9b373
MM
34not to complain when there's nothing to do (when no devices are selected).
35This option is intended for use in widely-distributed configuration scripts
36where it's uncertain whether the device in question is present in the machine
37or not.
38.TP
39.B -D
5f5b1a7b 40`Demo mode' -- don't write anything to the configuration registers.
b2c9b373
MM
41It's useful to try
42.B setpci -vD
43to see what your complex sequence of
44.B setpci
45operations does before you actually execute it.
89984232
MM
46.TP
47.B --version
48Shows
49.I setpci
1f7c91cc 50version. This option should be used stand-alone.
89984232 51
b2c9b373
MM
52.SH DEVICE SELECTION
53.PP
54Before each sequence of operations you need to select which devices you wish that
55operation to affect.
56.TP
1f7c91cc
MM
57.B -s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]
58Show only devices in the specified domain (in case your machine has several host bridges,
59they can either share a common bus number space or each of them can address a PCI domain
60of its own; domains are numbered from 0 to ffff), bus (0 to ff), slot (0 to 1f) and function (0 to 7).
61Each component of the device address can be omitted or set to "*", both meaning "any value". All numbers are
b2c9b373 62hexadecimal. E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
1f7c91cc
MM
63on any bus, "0.3" selects third function of device 0 on all buses and ".4" shows only
64the fourth function of each device.
b2c9b373
MM
65.TP
66.B -d [<vendor>]:[<device>]
67Select devices with specified vendor and device ID. Both ID's are given in
1f7c91cc 68hexadecimal and may be omitted or given as "*", both meaning "any value".
b2c9b373
MM
69
70.SH OPERATIONS
71.PP
72To query value of a configuration register, just name it (either by typing its name or
73by typing register address with optional
74.BR .B ,
75.B .W
76or
77.B .L
78suffix specifying register width as byte, word or longword).
79.PP
80To set a register, write
81.BR reg = values
82where
83.B reg
b7351143 84is the same as you would use to query the register and
b2c9b373
MM
85.B values
86is a comma-separated list of values you want to write starting with the given
b7351143
MM
87address. Each value to be written can be specified either as a hexadecimal number
88or as a
89.BR bits : mask
90pair which causes the bits corresponding to binary ones in the
91.B mask
92to be changed to values of the corresponding bits in the
93.B bits
94.
b2c9b373
MM
95
96.SH REGISTER NAMES
97.PP
98.B setpci
84d437d6 99knows the following configuration register names. See PCI bus specifications for their precise
b2c9b373 100meaning or consult
84d437d6
MM
101.B header.h
102or
b2c9b373 103.B /usr/include/linux/pci.h
84d437d6 104for a couple of comments.
b2c9b373
MM
105.PP
106.nf
107VENDOR_ID
108DEVICE_ID
109COMMAND
110STATUS
111REVISION
112CLASS_PROG
113CLASS_DEVICE
114CACHE_LINE_SIZE
115LATENCY_TIMER
116HEADER_TYPE
117BIST
118BASE_ADDRESS_0
119BASE_ADDRESS_1
120BASE_ADDRESS_2
121BASE_ADDRESS_3
122BASE_ADDRESS_4
123BASE_ADDRESS_5
124CARDBUS_CIS
125SUBSYSTEM_VENDOR_ID
126SUBSYSTEM_ID
127ROM_ADDRESS
128INTERRUPT_LINE
129INTERRUPT_PIN
130MIN_GNT
131MAX_LAT
132PRIMARY_BUS
133SECONDARY_BUS
134SUBORDINATE_BUS
135SEC_LATENCY_TIMER
136IO_BASE
137IO_LIMIT
138SEC_STATUS
139MEMORY_BASE
140MEMORY_LIMIT
141PREF_MEMORY_BASE
142PREF_MEMORY_LIMIT
143PREF_BASE_UPPER32
144PREF_LIMIT_UPPER32
145IO_BASE_UPPER16
146IO_LIMIT_UPPER16
147BRIDGE_ROM_ADDRESS
148BRIDGE_CONTROL
149CB_CARDBUS_BASE
150CB_CAPABILITIES
151CB_SEC_STATUS
152CB_BUS_NUMBER
153CB_CARDBUS_NUMBER
154CB_SUBORDINATE_BUS
155CB_CARDBUS_LATENCY
156CB_MEMORY_BASE_0
157CB_MEMORY_LIMIT_0
158CB_MEMORY_BASE_1
159CB_MEMORY_LIMIT_1
160CB_IO_BASE_0
161CB_IO_BASE_0_HI
162CB_IO_LIMIT_0
163CB_IO_LIMIT_0_HI
164CB_IO_BASE_1
165CB_IO_BASE_1_HI
166CB_IO_LIMIT_1
167CB_IO_LIMIT_1_HI
168CB_SUBSYSTEM_VENDOR_ID
169CB_SUBSYSTEM_ID
170CB_LEGACY_MODE_BASE
171
727ce158
MM
172.SH PCILIB OPTIONS
173The PCI utilities use PCILIB (a portable library providing platform-independent
84d437d6
MM
174functions for PCI configuration space access) to talk to the PCI cards. Please
175see
176.BR lspci(8)
177for a list of switches controlling behavior of the library.
727ce158 178
b2c9b373
MM
179.SH EXAMPLES
180.PP
181`setpci -d *:* latency_timer=40' sets the latency timer to 64 (40 hexadecimal).
182.PP
46ea554d 183`setpci -s 0 device_id vendor_id' lists ID's of devices in slot 0 in all buses.
b2c9b373 184.PP
d4798a32
MM
185`setpci -s 12:3.4 3c.l=1,2,3' writes longword 1 to register 3c, 2 to register 3d
186and 3 to register 3e of device at bus 12, slot 3, function 4.
b7351143
MM
187.PP
188`setpci -s 13:8.4 40.b=50:d0,04:0c,ff' works on bus 13, device 8, function
1894: turns bit 7 off and bits 6 and 4 on in the byte register 40; turns
190bit 3 off and bit 2 on in the byte register 41; sets byte register
19142 to ff.
b2c9b373 192
727ce158
MM
193.SH SEE ALSO
194.BR lspci (8)
195
b2c9b373 196.SH AUTHOR
4284af58 197The PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.