]> git.ipfire.org Git - thirdparty/pciutils.git/blob - setpci.8
5c622aa9866e5b5bc40922f609eddef3429448f2
[thirdparty/pciutils.git] / setpci.8
1 .TH setpci 8 "19 January 1999" "pciutils-1.10" "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. It requires Linux kernel 2.1.82
15 or newer as it uses the /proc/bus/pci interface.
16 .PP
17 All numbers are entered in hexadecimal notation.
18
19 .SH OPTIONS
20 .TP
21 .B -v
22 Tells
23 .I setpci
24 to be verbose and display detailed information about configuration space accesses.
25 .TP
26 .B -f
27 Tells
28 .I lspci
29 not to complain when there's nothing to do (when no devices are selected).
30 This option is intended for use in widely-distributed configuration scripts
31 where it's uncertain whether the device in question is present in the machine
32 or not.
33 .TP
34 .B -D
35 `Demo mode' -- simulate configuration space accesses instead of really doing them.
36 It's useful to try
37 .B setpci -vD
38 to see what your complex sequence of
39 .B setpci
40 operations does before you actually execute it.
41
42 .SH DEVICE SELECTION
43 .PP
44 Before each sequence of operations you need to select which devices you wish that
45 operation to affect.
46 .TP
47 .B -s [[<bus>]:][<slot>][.[<func>]]
48 Select devices in specified bus, slot and function. Each component of the device
49 address can be omitted or set as "*" meaning "any value". All numbers are
50 hexadecimal. E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
51 on any bus, "0.3" selects third function of device 0 on all busses and ".4" selects only
52 fourth function of each device.
53 .TP
54 .B -d [<vendor>]:[<device>]
55 Select devices with specified vendor and device ID. Both ID's are given in
56 hexadecimal and may be omitted or given as "*" meaning "any value".
57
58 .SH OPERATIONS
59 .PP
60 To query value of a configuration register, just name it (either by typing its name or
61 by typing register address with optional
62 .BR .B ,
63 .B .W
64 or
65 .B .L
66 suffix specifying register width as byte, word or longword).
67 .PP
68 To set a register, write
69 .BR reg = values
70 where
71 .B reg
72 is the same you would use to query the register and
73 .B values
74 is a comma-separated list of values you want to write starting with the given
75 address.
76
77 .SH REGISTER NAMES
78 .PP
79 .B setpci
80 knows the following configuration register names. See PCI bus specs for their precise
81 meaning or consult
82 .B /usr/include/linux/pci.h
83 for few comments.
84 .PP
85 .nf
86 VENDOR_ID
87 DEVICE_ID
88 COMMAND
89 STATUS
90 REVISION
91 CLASS_PROG
92 CLASS_DEVICE
93 CACHE_LINE_SIZE
94 LATENCY_TIMER
95 HEADER_TYPE
96 BIST
97 BASE_ADDRESS_0
98 BASE_ADDRESS_1
99 BASE_ADDRESS_2
100 BASE_ADDRESS_3
101 BASE_ADDRESS_4
102 BASE_ADDRESS_5
103 CARDBUS_CIS
104 SUBSYSTEM_VENDOR_ID
105 SUBSYSTEM_ID
106 ROM_ADDRESS
107 INTERRUPT_LINE
108 INTERRUPT_PIN
109 MIN_GNT
110 MAX_LAT
111 PRIMARY_BUS
112 SECONDARY_BUS
113 SUBORDINATE_BUS
114 SEC_LATENCY_TIMER
115 IO_BASE
116 IO_LIMIT
117 SEC_STATUS
118 MEMORY_BASE
119 MEMORY_LIMIT
120 PREF_MEMORY_BASE
121 PREF_MEMORY_LIMIT
122 PREF_BASE_UPPER32
123 PREF_LIMIT_UPPER32
124 IO_BASE_UPPER16
125 IO_LIMIT_UPPER16
126 BRIDGE_ROM_ADDRESS
127 BRIDGE_CONTROL
128 CB_CARDBUS_BASE
129 CB_CAPABILITIES
130 CB_SEC_STATUS
131 CB_BUS_NUMBER
132 CB_CARDBUS_NUMBER
133 CB_SUBORDINATE_BUS
134 CB_CARDBUS_LATENCY
135 CB_MEMORY_BASE_0
136 CB_MEMORY_LIMIT_0
137 CB_MEMORY_BASE_1
138 CB_MEMORY_LIMIT_1
139 CB_IO_BASE_0
140 CB_IO_BASE_0_HI
141 CB_IO_LIMIT_0
142 CB_IO_LIMIT_0_HI
143 CB_IO_BASE_1
144 CB_IO_BASE_1_HI
145 CB_IO_LIMIT_1
146 CB_IO_LIMIT_1_HI
147 CB_SUBSYSTEM_VENDOR_ID
148 CB_SUBSYSTEM_ID
149 CB_LEGACY_MODE_BASE
150
151 .SH EXAMPLES
152 .PP
153 `setpci -d *:* latency_timer=40' sets the latency timer to 64 (40 hexadecimal).
154 .PP
155 `setpci -s 0 device_id vendor_id' lists ID's of devices in slot 0 in all busses.
156 .PP
157 `setpci -s 12:3.4 34.l=1,2,3' writes longword 1 to register 34, 2 to register 35
158 and 3 to register 35 of device at bus 12, slot 3, function 4.
159
160 .SH AUTHOR
161 The Linux PCI Utilities are maintained by Martin Mares <mj@atrey.karlin.mff.cuni.cz>.