]> mj.ucw.cz Git - pciutils.git/blob - setpci.man
Support masking in setpci
[pciutils.git] / setpci.man
1 .TH setpci 8 "@TODAY@" "@VERSION@" "Linux 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' -- simulate configuration space accesses instead of really doing them.
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 standalone.
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 [[<bus>]:][<slot>][.[<func>]]
53 Select devices in specified bus, slot and function. Each component of the device
54 address can be omitted or set as "*" meaning "any value". All numbers are
55 hexadecimal.  E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
56 on any bus, "0.3" selects third function of device 0 on all busses and ".4" selects only
57 fourth function of each device.
58 .TP
59 .B -d [<vendor>]:[<device>]
60 Select devices with specified vendor and device ID. Both ID's are given in
61 hexadecimal and may be omitted or given as "*" meaning "any value".
62
63 .SH OPERATIONS
64 .PP
65 To query value of a configuration register, just name it (either by typing its name or
66 by typing register address with optional
67 .BR .B ,
68 .B .W
69 or
70 .B .L
71 suffix specifying register width as byte, word or longword).
72 .PP
73 To set a register, write
74 .BR reg = values
75 where
76 .B reg
77 is the same as you would use to query the register and
78 .B values
79 is a comma-separated list of values you want to write starting with the given
80 address. Each value to be written can be specified either as a hexadecimal number
81 or as a
82 .BR bits : mask
83 pair which causes the bits corresponding to binary ones in the
84 .B mask
85 to be changed to values of the corresponding bits in the
86 .B bits
87 .
88
89 .SH REGISTER NAMES
90 .PP
91 .B setpci
92 knows the following configuration register names. See PCI bus specs for their precise
93 meaning or consult
94 .B /usr/include/linux/pci.h
95 for few comments.
96 .PP
97 .nf
98 VENDOR_ID
99 DEVICE_ID
100 COMMAND
101 STATUS
102 REVISION
103 CLASS_PROG
104 CLASS_DEVICE
105 CACHE_LINE_SIZE
106 LATENCY_TIMER
107 HEADER_TYPE
108 BIST
109 BASE_ADDRESS_0
110 BASE_ADDRESS_1
111 BASE_ADDRESS_2
112 BASE_ADDRESS_3
113 BASE_ADDRESS_4
114 BASE_ADDRESS_5
115 CARDBUS_CIS
116 SUBSYSTEM_VENDOR_ID
117 SUBSYSTEM_ID
118 ROM_ADDRESS
119 INTERRUPT_LINE
120 INTERRUPT_PIN
121 MIN_GNT
122 MAX_LAT
123 PRIMARY_BUS
124 SECONDARY_BUS
125 SUBORDINATE_BUS
126 SEC_LATENCY_TIMER
127 IO_BASE
128 IO_LIMIT
129 SEC_STATUS
130 MEMORY_BASE
131 MEMORY_LIMIT
132 PREF_MEMORY_BASE
133 PREF_MEMORY_LIMIT
134 PREF_BASE_UPPER32
135 PREF_LIMIT_UPPER32
136 IO_BASE_UPPER16
137 IO_LIMIT_UPPER16
138 BRIDGE_ROM_ADDRESS
139 BRIDGE_CONTROL
140 CB_CARDBUS_BASE
141 CB_CAPABILITIES
142 CB_SEC_STATUS
143 CB_BUS_NUMBER
144 CB_CARDBUS_NUMBER
145 CB_SUBORDINATE_BUS
146 CB_CARDBUS_LATENCY
147 CB_MEMORY_BASE_0
148 CB_MEMORY_LIMIT_0
149 CB_MEMORY_BASE_1
150 CB_MEMORY_LIMIT_1
151 CB_IO_BASE_0
152 CB_IO_BASE_0_HI
153 CB_IO_LIMIT_0
154 CB_IO_LIMIT_0_HI
155 CB_IO_BASE_1
156 CB_IO_BASE_1_HI
157 CB_IO_LIMIT_1
158 CB_IO_LIMIT_1_HI
159 CB_SUBSYSTEM_VENDOR_ID
160 CB_SUBSYSTEM_ID
161 CB_LEGACY_MODE_BASE
162
163 .SH PCILIB OPTIONS
164 The PCI utilities use PCILIB (a portable library providing platform-independent
165 functions for PCI configuration space access) to talk to the PCI cards. The following
166 options control parameters of the library, especially what access method it uses.
167 By default, PCILIB uses the first available access method and displays no debugging
168 messages. Each switch is accompanied by a list of hardware/software configurations
169 it's supported in.
170
171 .TP
172 .B -P <dir>
173 Force use of Linux /proc/bus/pci style configuration access, using
174 .B <dir>
175 instead of /proc/bus/pci. (Linux 2.1 or newer only)
176 .TP
177 .B -H1
178 Use direct hardware access via Intel configuration mechanism 1. (i386 and compatible only)
179 .TP
180 .B -H2
181 Use direct hardware access via Intel configuration mechanism 2. Warning: This method
182 is able to address only first 16 devices on any bus and it seems to be very
183 unrealiable in many cases. (i386 and compatible only)
184 .TP
185 .B -S
186 Use PCI access syscalls. (Linux on Alpha and UltraSparc only)
187 .TP
188 .B -F <file>
189 Extract all information from given file containing output of lspci -x. This is very
190 useful for analysis of user-supplied bug reports, because you can display the
191 hardware configuration in any way you want without disturbing the user with
192 requests for more dumps. (All systems)
193 .TP
194 .B -G
195 Increase debug level of the library. (All systems)
196
197 .SH EXAMPLES
198 .PP
199 `setpci -d *:* latency_timer=40' sets the latency timer to 64 (40 hexadecimal).
200 .PP
201 `setpci -s 0 device_id vendor_id' lists ID's of devices in slot 0 in all busses.
202 .PP
203 `setpci -s 12:3.4 3c.l=1,2,3' writes longword 1 to register 3c, 2 to register 3d
204 and 3 to register 3e of device at bus 12, slot 3, function 4.
205 .PP
206 `setpci -s 13:8.4 40.b=50:d0,04:0c,ff' works on bus 13, device 8, function
207 4: turns bit 7 off and bits 6 and 4 on in the byte register 40; turns
208 bit 3 off and bit 2 on in the byte register 41; sets byte register
209 42 to ff.
210
211 .SH SEE ALSO
212 .BR lspci (8)
213
214 .SH AUTHOR
215 The Linux PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.