]> mj.ucw.cz Git - pciutils.git/blob - setpci.man
Added more parts of the Windows port.
[pciutils.git] / setpci.man
1 .TH setpci 8 "@TODAY@" "@VERSION@" "The PCI Utilities"
2 .IX setpci
3 .SH NAME
4 setpci \- configure PCI devices
5 .SH SYNOPSIS
6 .B setpci
7 .RB [ options ]
8 .B devices
9 .BR operations ...
10
11 .SH DESCRIPTION
12 .PP
13 .B setpci
14 is a utility for querying and configuring PCI devices.
15
16 All numbers are entered in hexadecimal notation.
17
18 .SH OPTIONS
19 .TP
20 .B -v
21 Tells
22 .I setpci
23 to be verbose and display detailed information about configuration space accesses.
24 .TP
25 .B -f
26 Tells
27 .I setpci
28 not to complain when there's nothing to do (when no devices are selected).
29 This option is intended for use in widely-distributed configuration scripts
30 where it's uncertain whether the device in question is present in the machine
31 or not.
32 .TP
33 .B -D
34 `Demo mode' -- don't write anything to the configuration registers.
35 It's useful to try
36 .B setpci -vD
37 to see what your complex sequence of
38 .B setpci
39 operations does before you actually execute it.
40 .TP
41 .B --version
42 Shows
43 .I setpci
44 version. This option should be used stand-alone.
45
46
47 .SH DEVICE SELECTION
48 .PP
49 Before each sequence of operations you need to select which devices you wish that
50 operation to affect.
51 .TP
52 .B -s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]
53 Show only devices in the specified domain (in case your machine has several host bridges,
54 they can either share a common bus number space or each of them can address a PCI domain
55 of its own; domains are numbered from 0 to ffff), bus (0 to ff), slot (0 to 1f) and function (0 to 7).
56 Each component of the device address can be omitted or set to "*", both meaning "any value". All numbers are
57 hexadecimal.  E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
58 on any bus, "0.3" selects third function of device 0 on all buses and ".4" shows only
59 the fourth function of each device.
60 .TP
61 .B -d [<vendor>]:[<device>]
62 Select devices with specified vendor and device ID. Both ID's are given in
63 hexadecimal and may be omitted or given as "*", both meaning "any value".
64
65 .SH OPERATIONS
66 .PP
67 To query value of a configuration register, just name it (either by typing its name or
68 by typing register address with optional
69 .BR .B ,
70 .B .W
71 or
72 .B .L
73 suffix specifying register width as byte, word or longword).
74 .PP
75 To set a register, write
76 .BR reg = values
77 where
78 .B reg
79 is the same as you would use to query the register and
80 .B values
81 is a comma-separated list of values you want to write starting with the given
82 address. Each value to be written can be specified either as a hexadecimal number
83 or as a
84 .BR bits : mask
85 pair which causes the bits corresponding to binary ones in the
86 .B mask
87 to be changed to values of the corresponding bits in the
88 .B bits
89 .
90
91 .SH REGISTER NAMES
92 .PP
93 .B setpci
94 knows the following configuration register names. See PCI bus specs for their precise
95 meaning or consult
96 .B /usr/include/linux/pci.h
97 for few comments.
98 .PP
99 .nf
100 VENDOR_ID
101 DEVICE_ID
102 COMMAND
103 STATUS
104 REVISION
105 CLASS_PROG
106 CLASS_DEVICE
107 CACHE_LINE_SIZE
108 LATENCY_TIMER
109 HEADER_TYPE
110 BIST
111 BASE_ADDRESS_0
112 BASE_ADDRESS_1
113 BASE_ADDRESS_2
114 BASE_ADDRESS_3
115 BASE_ADDRESS_4
116 BASE_ADDRESS_5
117 CARDBUS_CIS
118 SUBSYSTEM_VENDOR_ID
119 SUBSYSTEM_ID
120 ROM_ADDRESS
121 INTERRUPT_LINE
122 INTERRUPT_PIN
123 MIN_GNT
124 MAX_LAT
125 PRIMARY_BUS
126 SECONDARY_BUS
127 SUBORDINATE_BUS
128 SEC_LATENCY_TIMER
129 IO_BASE
130 IO_LIMIT
131 SEC_STATUS
132 MEMORY_BASE
133 MEMORY_LIMIT
134 PREF_MEMORY_BASE
135 PREF_MEMORY_LIMIT
136 PREF_BASE_UPPER32
137 PREF_LIMIT_UPPER32
138 IO_BASE_UPPER16
139 IO_LIMIT_UPPER16
140 BRIDGE_ROM_ADDRESS
141 BRIDGE_CONTROL
142 CB_CARDBUS_BASE
143 CB_CAPABILITIES
144 CB_SEC_STATUS
145 CB_BUS_NUMBER
146 CB_CARDBUS_NUMBER
147 CB_SUBORDINATE_BUS
148 CB_CARDBUS_LATENCY
149 CB_MEMORY_BASE_0
150 CB_MEMORY_LIMIT_0
151 CB_MEMORY_BASE_1
152 CB_MEMORY_LIMIT_1
153 CB_IO_BASE_0
154 CB_IO_BASE_0_HI
155 CB_IO_LIMIT_0
156 CB_IO_LIMIT_0_HI
157 CB_IO_BASE_1
158 CB_IO_BASE_1_HI
159 CB_IO_LIMIT_1
160 CB_IO_LIMIT_1_HI
161 CB_SUBSYSTEM_VENDOR_ID
162 CB_SUBSYSTEM_ID
163 CB_LEGACY_MODE_BASE
164
165 .SH PCILIB OPTIONS
166 The PCI utilities use PCILIB (a portable library providing platform-independent
167 functions for PCI configuration space access) to talk to the PCI cards. The following
168 options control parameters of the library, especially what access method it uses.
169 By default, PCILIB uses the first available access method and displays no debugging
170 messages. Each switch is accompanied by a list of hardware/software configurations
171 it's supported in.
172
173 .TP
174 .B -P <dir>
175 Force use of Linux /proc/bus/pci style configuration access, using
176 .B <dir>
177 instead of /proc/bus/pci. (Linux 2.1 or newer only)
178 .TP
179 .B -H1
180 Use direct hardware access via Intel configuration mechanism 1. (i386 and compatible only)
181 .TP
182 .B -H2
183 Use direct hardware access via Intel configuration mechanism 2. Warning: This method
184 is able to address only first 16 devices on any bus and it seems to be very
185 unreliable in many cases. (i386 and compatible only)
186 .TP
187 .B -F <file>
188 Extract all information from given file containing output of lspci -x. This is very
189 useful for analysis of user-supplied bug reports, because you can display the
190 hardware configuration in any way you want without disturbing the user with
191 requests for more dumps. (All systems)
192 .TP
193 .B -G
194 Increase debug level of the library. (All systems)
195
196 .SH EXAMPLES
197 .PP
198 `setpci -d *:* latency_timer=40' sets the latency timer to 64 (40 hexadecimal).
199 .PP
200 `setpci -s 0 device_id vendor_id' lists ID's of devices in slot 0 in all busses.
201 .PP
202 `setpci -s 12:3.4 3c.l=1,2,3' writes longword 1 to register 3c, 2 to register 3d
203 and 3 to register 3e of device at bus 12, slot 3, function 4.
204 .PP
205 `setpci -s 13:8.4 40.b=50:d0,04:0c,ff' works on bus 13, device 8, function
206 4: turns bit 7 off and bits 6 and 4 on in the byte register 40; turns
207 bit 3 off and bit 2 on in the byte register 41; sets byte register
208 42 to ff.
209
210 .SH SEE ALSO
211 .BR lspci (8)
212
213 .SH AUTHOR
214 The PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.