Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/pciconf/pciconf.8
Show All 19 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd November 23, 2015 | .Dd June 14, 2018 | ||||
.Dt PCICONF 8 | .Dt PCICONF 8 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm pciconf | .Nm pciconf | ||||
.Nd diagnostic utility for the PCI bus | .Nd diagnostic utility for the PCI bus | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Fl l Oo Fl BbceVv Oc Op Ar device | .Fl l Oo Fl BbceVv Oc Op Ar device | ||||
.Nm | .Nm | ||||
.Fl a Ar device | .Fl a Ar device | ||||
.Nm | .Nm | ||||
.Fl r Oo Fl b | h Oc Ar device addr Ns Op : Ns Ar addr2 | .Fl r Oo Fl b | h Oc Ar device addr Ns Op : Ns Ar addr2 | ||||
.Nm | .Nm | ||||
.Fl w Oo Fl b | h Oc Ar device addr value | .Fl w Oo Fl b | h Oc Ar device addr value | ||||
.Nm | |||||
.Fl D Oo Fl b | h | x Oc Ar device addr Op start Ns Op : Ns Ar count | |||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
utility provides a command line interface to functionality provided by the | utility provides a command line interface to functionality provided by the | ||||
.Xr pci 4 | .Xr pci 4 | ||||
.Xr ioctl 2 | .Xr ioctl 2 | ||||
interface. | interface. | ||||
As such, some of the functions are only available to users with write | As such, some of the functions are only available to users with write | ||||
▲ Show 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | |||||
The | The | ||||
.Fl w | .Fl w | ||||
option writes the | option writes the | ||||
.Ar value | .Ar value | ||||
into a configuration space register at byte offset | into a configuration space register at byte offset | ||||
.Ar addr | .Ar addr | ||||
of device | of device | ||||
.Ar selector . | .Ar selector . | ||||
For both operations, the flags | .Pp | ||||
.Fl b | The | ||||
.Fl D | |||||
option request a dump of the specified BAR. | |||||
Dump is performed to the standard output, raw register values | |||||
are written. | |||||
Use | |||||
.Xr hexdump 1 | |||||
to convert them to human-readable dump, | |||||
or redirect into a file to save the snapshot of the device state. | |||||
Optionally, the | |||||
.Ar start | |||||
and | and | ||||
.Fl h | .Ar count | ||||
of the registers dumped can be specified, in multiple of the operation width, | |||||
see next paragraph. | |||||
.Pp | |||||
For read, write, and dump operations, the flags | |||||
.Fl b , | |||||
.Fl h , | |||||
and | |||||
.Fl x | |||||
select the width of the operation; | select the width of the operation; | ||||
.Fl b | .Fl b | ||||
indicates a byte operation, and | indicates a byte operation, and | ||||
.Fl h | .Fl h | ||||
indicates a halfword (two-byte) operation. | indicates a halfword (two-byte) operation. | ||||
.Fl x | |||||
indicates a quadword (four-byte) operation. | |||||
The default is to read or | The default is to read or | ||||
write a longword (four bytes). | write a longword (four bytes). | ||||
The quadword mode is only valid for BAR dump. | |||||
.Sh ENVIRONMENT | .Sh ENVIRONMENT | ||||
PCI vendor and device information is read from | PCI vendor and device information is read from | ||||
.Pa /usr/local/share/pciids/pci.ids . | .Pa /usr/local/share/pciids/pci.ids . | ||||
If that file is not present, it is read from | If that file is not present, it is read from | ||||
.Pa /usr/share/misc/pci_vendors . | .Pa /usr/share/misc/pci_vendors . | ||||
This path can be overridden by setting the environment variable | This path can be overridden by setting the environment variable | ||||
.Ev PCICONF_VENDOR_DATABASE . | .Ev PCICONF_VENDOR_DATABASE . | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
Show All 36 Lines | |||||
.Fl r | .Fl r | ||||
options. | options. | ||||
But only root will be able to execute a | But only root will be able to execute a | ||||
.Nm kldload | .Nm kldload | ||||
to provide the device with a driver KLD, and reading of configuration space | to provide the device with a driver KLD, and reading of configuration space | ||||
registers may cause a failure in badly designed | registers may cause a failure in badly designed | ||||
.Tn PCI | .Tn PCI | ||||
chips. | chips. | ||||
.Pp | |||||
There is currently no way to specify the caching mode for the mapping | |||||
established by the | |||||
.Fl D | |||||
option, | |||||
.Nm | |||||
always uses uncached access. | |||||
This is fine for control register BARs. |