xref: /netbsd/usr.sbin/pcictl/pcictl.8 (revision 8ae8201f)
1.\"	$NetBSD: pcictl.8,v 1.20 2019/11/30 02:47:14 riastradh Exp $
2.\"
3.\" Copyright 2001 Wasabi Systems, Inc.
4.\" All rights reserved.
5.\"
6.\" Written by Jason R. Thorpe for Wasabi Systems, Inc.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software
17.\"    must display the following acknowledgement:
18.\"	This product includes software developed for the NetBSD Project by
19.\"	Wasabi Systems, Inc.
20.\" 4. The name of Wasabi Systems, Inc. may not be used to endorse
21.\"    or promote products derived from this software without specific prior
22.\"    written permission.
23.\"
24.\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
25.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
26.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
28.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34.\" POSSIBILITY OF SUCH DAMAGE.
35.\"
36.Dd September 23, 2016
37.Dt PCICTL 8
38.Os
39.Sh NAME
40.Nm pcictl
41.Nd a program to manipulate the PCI bus
42.Sh SYNOPSIS
43.Nm
44.Ar pcibus
45.Ar command
46.Oo
47.Ar arg Oo ...
48.Oc
49.Oc
50.Sh DESCRIPTION
51.Nm
52allows a user or system administrator to access various resources
53on a PCI bus.
54.Pp
55The following commands are available:
56.Pp
57.Cm list
58.Op Fl Nn
59.Op Fl b Ar bus
60.Op Fl d Ar device
61.Op Fl f Ar function
62.Pp
63List the devices in the PCI domain, either as names or, if
64.Fl n
65is given, as numbers.
66The bus, device, and function
67numbers may be specified by flags.
68Any locator not specified defaults
69to a wildcard, or may be explicitly wildcarded by specifying
70.Dq any .
71If
72.Fl N
73is given, the driver name for this PCI device will be listed
74if any driver is attached.
75.Pp
76.Cm dump
77.Op Fl b Ar bus
78.Fl d Ar device
79.Op Fl f Ar function
80.Pp
81Dump the PCI configuration space for the specified device located
82at the specified bus, device, and function.
83If the bus is not specified, it defaults to the bus number of the
84PCI bus specified on the command line.
85If the function is not specified, it defaults to 0.
86.Pp
87.Cm read
88.Op Fl b Ar bus
89.Fl d Ar device
90.Op Fl f Ar function
91.Ar reg
92.Pp
93Read the specified 32-bit aligned PCI configuration register and print
94it in hexadecimal to standard output.
95If the bus is not specified, it defaults to the bus number of the
96PCI bus specified on the command line.
97If the function is not specified, it defaults to 0.
98.Pp
99.Sy WARNING :
100.Nm
101.Cm read
102is a dangerous command that can damage hardware and panic the operating
103system, even though it appears to be a harmless read-only operation.
104It is meant as a diagnostic tool for experiments or to debug device
105drivers.
106Do not use it as a substitute for a device driver!
107.Pp
108.Cm write
109.Op Fl b Ar bus
110.Fl d Ar device
111.Op Fl f Ar function
112.Ar reg
113.Ar value
114.Pp
115Write the specified value to the specified 32-bit aligned PCI
116configuration register.
117If the bus is not specified, it defaults to the bus number of the
118PCI bus specified on the command line.
119If the function is not specified, it defaults to 0.
120.Pp
121.Sy WARNING :
122.Nm
123.Cm write
124is a dangerous command that can damage hardware and panic the operating
125system.
126It is meant as a diagnostic tool for experiments or to debug device
127drivers.
128Do not use it as a substitute for a device driver!
129.Sh FILES
130.Pa /dev/pci*
131- PCI bus device nodes
132.Sh EXAMPLES
133This shows all PCI devices on the system:
134.Pp
135.Dl pcictl pci0 list
136.Pp
137This shows all PCI devices on the system, including attached drivers:
138.Pp
139.Dl pcictl pci0 list -N
140.Sh SEE ALSO
141.Xr pci 3 ,
142.Xr pci 4 ,
143.Xr drvctl 8
144.Sh HISTORY
145The
146.Nm
147command first appeared in
148.Nx 1.6 .
149