{"id":3574,"date":"2022-12-20T17:09:03","date_gmt":"2022-12-20T20:09:03","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/setpci-man8\/"},"modified":"2022-12-20T17:09:03","modified_gmt":"2022-12-20T20:09:03","slug":"setpci-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/setpci-man8\/","title":{"rendered":"setpci (man8)"},"content":{"rendered":"<h1 align=\"center\">setpci<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#DEVICE SELECTION\">DEVICE SELECTION<\/a><br \/> <a href=\"#OPERATIONS\">OPERATIONS<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">setpci \u2212 configure PCI devices<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>setpci<\/b> [<b>options<\/b>] <b>devices operations<\/b>&#8230;<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>setpci<\/b> is a utility for querying and configuring PCI devices.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">All numbers are entered in hexadecimal notation.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Root privileges are necessary for almost all operations, excluding reads of the standard header of the configuration space on some operating systems. Please see <b>lspci(8)<\/b> for details on access rights.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>General options<\/b><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>-v<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Tells <i>setpci<\/i> to be verbose and display detailed information about configuration space accesses.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>-f<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Tells <i>setpci<\/i> not to complain when there\u2019s nothing to do (when no devices are selected). This option is intended for use in widely-distributed configuration scripts where it\u2019s uncertain whether the device in question is present in the machine or not.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>-D<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>\u2018Demo mode\u2019 &#8212; don\u2019t write anything to the configuration registers. It\u2019s useful to try <b>setpci -vD<\/b> to verify that your complex sequence of <b>setpci<\/b> operations does what you think it should do.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>-r<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Avoids bus scan if each operation selects a specific device (uses the <b>-s<\/b> selector with specific domain, bus, slot, and function). This is faster, but if the device does not exist, it fails instead of matching an empty set of devices.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>&#8211;version<\/b><\/p>\n<p style=\"margin-left:22%;\">Show <i>setpci<\/i> version. This option should be used stand-alone.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>&#8211;help<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>Show detailed help on available options. This option should be used stand-alone.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>&#8211;dumpregs<\/b><\/p>\n<p style=\"margin-left:22%;\">Show a list of all known PCI registers and capabilities. This option should be used stand-alone.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>PCI access options<\/b> <br \/> The PCI utilities use the PCI library to talk to PCI devices (see <b>pcilib<\/b>(7) for details). You can use the following options to influence its behavior: <b><br \/> -A <method><\/b><\/p>\n<p style=\"margin-left:22%;\">The library supports a variety of methods to access the PCI hardware. By default, it uses the first access method available, but you can use this option to override this decision. See <b>-A help<\/b> for a list of available methods and their descriptions.<\/p>\n<p style=\"margin-left:11%;\"><b>-O <param>=<value><\/b><\/p>\n<p style=\"margin-left:22%;\">The behavior of the library is controlled by several named parameters. This option allows to set the value of any of the parameters. Use <b>-O help<\/b> for a list of known parameters and their default values.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p><b>-H1<\/b><\/p>\n<\/td>\n<td width=\"7%\"><\/td>\n<td width=\"78%\">\n<p>Use direct hardware access via Intel configuration mechanism 1. (This is a shorthand for <b>-A intel-conf1<\/b>.)<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p><b>-H2<\/b><\/p>\n<\/td>\n<td width=\"7%\"><\/td>\n<td width=\"78%\">\n<p>Use direct hardware access via Intel configuration mechanism 2. (This is a shorthand for <b>-A intel-conf2<\/b>.)<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p><b>-G<\/b><\/p>\n<\/td>\n<td width=\"7%\"><\/td>\n<td width=\"78%\">\n<p>Increase debug level of the library.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>DEVICE SELECTION <a name=\"DEVICE SELECTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Before each sequence of operations you need to select which devices you wish that operation to affect. <b><br \/> -s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]<\/b><\/p>\n<p style=\"margin-left:22%;\">Consider only devices in the specified domain (in case your machine has several host bridges, they can either share a common bus number space or each of them can address a PCI domain of its own; domains are numbered from 0 to ffff), bus (0 to ff), slot (0 to 1f) and function (0 to 7). Each component of the device address can be omitted or set to &#8220;*&#8221;, both meaning &#8220;any value&#8221;. All numbers are hexadecimal. E.g., &#8220;0:&#8221; means all devices on bus 0, &#8220;0&#8221; means all functions of device 0 on any bus, &#8220;0.3&#8221; selects third function of device 0 on all buses and &#8220;.4&#8221; matches only the fourth function of each device.<\/p>\n<p style=\"margin-left:11%;\"><b>-d [<vendor>]:[<device>]<\/b><\/p>\n<p style=\"margin-left:22%;\">Select devices with specified vendor and device ID. Both ID\u2019s are given in hexadecimal and may be omitted or given as &#8220;*&#8221;, both meaning &#8220;any value&#8221;.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When <b>-s<\/b> and <b>-d<\/b> are combined, only devices that match both criteria are selected. When multiple options of the same kind are specified, the rightmost one overrides the others.<\/p>\n<h2>OPERATIONS <a name=\"OPERATIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">There are two kinds of operations: reads and writes. To read a register, just specify its name. Writes have the form <i>name<\/i>=<i>value<\/i>,<i>value<\/i>&#8230; where each <i>value<\/i> is either a hexadecimal number or an expression of type <i>data<\/i>:<i>mask<\/i> where both <i>data<\/i> and <i>mask<\/i> are hexadecimal numbers. In the latter case, only the bits corresponding to binary ones in the <i>mask<\/i> are changed (technically, this is a read-modify-write operation).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">There are several ways how to identity a register:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"78%\">\n<p>Tell its address in hexadecimal.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"78%\">\n<p>Spell its name. Setpci knows the names of all registers in the standard configuration headers. Use \u2018<b>setpci &#8211;dumpregs<\/b>\u2019 to get the complete list. See PCI bus specifications for the precise meaning of these registers or consult <b>header.h<\/b> or <b>\/usr\/include\/pci\/pci.h<\/b> for a brief sketch.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"78%\">\n<p>If the register is a part of a PCI capability, you can specify the name of the capability to get the address of its first register. See the names starting with \u2018CAP_\u2019 or \u2018ECAP_\u2019 in the <b>&#8211;dumpregs<\/b> output.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"78%\">\n<p>If the name of the capability is not known to <b>setpci<\/b>, you can refer to it by its number in the form CAP<b>id<\/b> or ECAP<b>id<\/b>, where <b>id<\/b> is the numeric identifier of the capability in hexadecimal.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"78%\">\n<p>Each of the previous formats can be followed by <b>+offset<\/b> to add an offset (a hex number) to the address. This feature can be useful for addressing of registers living within a capability, or to modify parts of standard registers.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"78%\">\n<p>To choose how many bytes (1, 2, or 4) should be transferred, you should append a width specifier <b>.B<\/b>, <b>.W<\/b>, or <b>.L<\/b>. The width can be omitted if you are referring to a register by its name and the width of the register is well known.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"78%\">\n<p>Finally, if a capability exists multiple times you can choose which one to target using <b>@number<\/b>. Indexing starts at 0.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">All names of registers and width specifiers are case-insensitive.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">COMMAND<\/p>\n<p style=\"margin-left:22%;\">asks for the word-sized command register.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p>4.w<\/p>\n<\/td>\n<td width=\"7%\"><\/td>\n<td width=\"64%\">\n<p>is a numeric address of the same register.<\/p>\n<\/td>\n<td width=\"14%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\">COMMAND.l<\/p>\n<p style=\"margin-left:22%;\">asks for a 32-bit word starting at the location of the command register, i.e., the command and status registers together.<\/p>\n<p style=\"margin-left:11%;\">VENDOR_ID+1.b<\/p>\n<p style=\"margin-left:22%;\">specifies the upper byte of the vendor ID register (remember, PCI is little-endian).<\/p>\n<p style=\"margin-left:11%;\">CAP_PM+2.w<\/p>\n<p style=\"margin-left:22%;\">corresponds to the second word of the power management capability.<\/p>\n<p style=\"margin-left:11%;\">ECAP108.l<\/p>\n<p style=\"margin-left:22%;\">asks for the first 32-bit word of the extended capability with ID 0x108.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>lspci<\/b>(8), <b>pcilib<\/b>(7)<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  setpci \u2212 configure PCI devices <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,692],"class_list":["post-3574","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-setpci"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3574"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3574\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}