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