1setpci(8)                      The PCI Utilities                     setpci(8)
2
3
4

NAME

6       setpci - configure PCI devices
7

SYNOPSIS

9       setpci [options] devices operations...
10
11

DESCRIPTION

13       setpci is a utility for querying and configuring PCI devices.
14
15       All numbers are entered in hexadecimal notation.
16
17       Root  privileges  are  necessary  for  almost all operations, excluding
18       reads of the standard header of the configuration space on some operat‐
19       ing systems.  Please see lspci(8) for details on access rights.
20
21

OPTIONS

23   General options
24       -v     Tells  setpci  to  be  verbose  and display detailed information
25              about configuration space accesses.
26
27       -f     Tells setpci not to complain when there's nothing to do (when no
28              devices  are  selected).   This  option  is  intended for use in
29              widely-distributed configuration scripts  where  it's  uncertain
30              whether the device in question is present in the machine or not.
31
32       -D     `Demo  mode' -- don't write anything to the configuration regis‐
33              ters.  It's useful to try setpci -vD to verify that your complex
34              sequence of setpci operations does what you think it should do.
35
36       --version
37              Show setpci version. This option should be used stand-alone.
38
39       --help Show  detailed  help on available options. This option should be
40              used stand-alone.
41
42       --dumpregs
43              Show a list of all known PCI registers  and  capabilities.  This
44              option should be used stand-alone.
45
46
47   PCI access options
48       The  PCI  utilities  use  the  PCI  library to talk to PCI devices (see
49       pcilib(7) for details). You can use the following options to  influence
50       its behavior:
51
52       -A <method>
53              The  library  supports  a  variety  of methods to access the PCI
54              hardware.  By default, it uses the first  access  method  avail‐
55              able, but you can use this option to override this decision. See
56              -A help for a list of available methods and their descriptions.
57
58       -O <param>=<value>
59              The behavior of the  library  is  controlled  by  several  named
60              parameters.   This  option allows to set the value of any of the
61              parameters. Use -O help for a list of known parameters and their
62              default values.
63
64       -H1    Use  direct hardware access via Intel configuration mechanism 1.
65              (This is a shorthand for -A intel-conf1.)
66
67       -H2    Use direct hardware access via Intel configuration mechanism  2.
68              (This is a shorthand for -A intel-conf2.)
69
70       -G     Increase debug level of the library.
71
72

DEVICE SELECTION

74       Before each sequence of operations you need to select which devices you
75       wish that operation to affect.
76
77       -s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]
78              Consider only devices in the  specified  domain  (in  case  your
79              machine has several host bridges, they can either share a common
80              bus number space or each of them can address a PCI domain of its
81              own;  domains  are numbered from 0 to ffff), bus (0 to ff), slot
82              (0 to 1f) and function (0 to 7).  Each component of  the  device
83              address  can be omitted or set to "*", both meaning "any value".
84              All numbers are hexadecimal.  E.g., "0:" means  all  devices  on
85              bus  0,  "0"  means  all functions of device 0 on any bus, "0.3"
86              selects third function of device 0 on all buses and ".4" matches
87              only the fourth function of each device.
88
89       -d [<vendor>]:[<device>]
90              Select  devices  with  specified vendor and device ID. Both ID's
91              are given in hexadecimal and may be omitted  or  given  as  "*",
92              both meaning "any value".
93
94       When  -s and -d are combined, only devices that match both criteria are
95       selected. When multiple options of the same  kind  are  specified,  the
96       rightmost one overrides the others.
97
98

OPERATIONS

100       There  are  two kinds of operations: reads and writes. To read a regis‐
101       ter, just specify its name. Writes have  the  form  name=value,value...
102       where  each  value  is  either a hexadecimal number or an expression of
103       type data:mask where both data and mask are hexadecimal numbers. In the
104       latter case, only the bits corresponding to binary ones in the mask are
105       changed (technically, this is a read-modify-write operation).
106
107
108       There are several ways how to identity a register:
109
110       ·      Tell its address in hexadecimal.
111
112       ·      Spell its name. Setpci knows the names of all registers  in  the
113              standard  configuration  headers. Use `setpci --dumpregs' to get
114              the complete list.  See PCI bus specifications for  the  precise
115              meaning    of   these   registers   or   consult   header.h   or
116              /usr/include/pci/pci.h for a brief sketch.
117
118       ·      If the register is a part of a PCI capability, you  can  specify
119              the  name of the capability to get the address of its first reg‐
120              ister. See the names starting with  `CAP_'  or  `ECAP_'  in  the
121              --dumpregs output.
122
123       ·      If  the  name  of the capability is not known to setpci, you can
124              refer to it by its number in the form CAPid or ECAPid, where  id
125              is the numeric identifier of the capability in hexadecimal.
126
127       ·      Each  of  the previous formats can be followed by +offset to add
128              an offset (a hex number) to the address.  This  feature  can  be
129              useful  for  addressing of registers living within a capability,
130              or to modify parts of standard registers.   IP  ·  Finally,  you
131              should append a width specifier .B, .W, or .L to choose how many
132              bytes (1, 2, or 4) should be transferred. The width can be omit‐
133              ted  if  you  are accessing a named register whose width is well
134              known.
135
136
137       All names of registers and width specifiers are case-insensitive.
138
139

EXAMPLES

141       COMMAND
142              asks for the word-sized command register.
143
144       4.w    is a numeric address of the same register.
145
146       COMMAND.l
147              asks for a 32-bit word starting at the location of  the  command
148              register, i.e., the command and status registers together.
149
150       VENDOR_ID+1.b
151              specifies  the  upper  byte of the vendor ID register (remember,
152              PCI is little-endian).
153
154       CAP_PM+2.w
155              corresponds to the second word of the power management  capabil‐
156              ity.
157
158       ECAP108.l
159              asks  for  the first 32-bit word of the extended capability with
160              ID 0x108.
161
162

SEE ALSO

164       lspci(8), pcilib(7)
165
166

AUTHOR

168       The PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.
169
170
171
172pciutils-3.1.7                  31 January 2010                      setpci(8)
Impressum