xref: /netbsd/usr.sbin/pcictl/pcictl.8 (revision 8ae8201f)
1*8ae8201fSriastradh.\"	$NetBSD: pcictl.8,v 1.20 2019/11/30 02:47:14 riastradh Exp $
20c91ac68Sthorpej.\"
30c91ac68Sthorpej.\" Copyright 2001 Wasabi Systems, Inc.
40c91ac68Sthorpej.\" All rights reserved.
50c91ac68Sthorpej.\"
60c91ac68Sthorpej.\" Written by Jason R. Thorpe for Wasabi Systems, Inc.
70c91ac68Sthorpej.\"
80c91ac68Sthorpej.\" Redistribution and use in source and binary forms, with or without
90c91ac68Sthorpej.\" modification, are permitted provided that the following conditions
100c91ac68Sthorpej.\" are met:
110c91ac68Sthorpej.\" 1. Redistributions of source code must retain the above copyright
120c91ac68Sthorpej.\"    notice, this list of conditions and the following disclaimer.
130c91ac68Sthorpej.\" 2. Redistributions in binary form must reproduce the above copyright
140c91ac68Sthorpej.\"    notice, this list of conditions and the following disclaimer in the
150c91ac68Sthorpej.\"    documentation and/or other materials provided with the distribution.
160c91ac68Sthorpej.\" 3. All advertising materials mentioning features or use of this software
170c91ac68Sthorpej.\"    must display the following acknowledgement:
180c91ac68Sthorpej.\"	This product includes software developed for the NetBSD Project by
190c91ac68Sthorpej.\"	Wasabi Systems, Inc.
200c91ac68Sthorpej.\" 4. The name of Wasabi Systems, Inc. may not be used to endorse
210c91ac68Sthorpej.\"    or promote products derived from this software without specific prior
220c91ac68Sthorpej.\"    written permission.
230c91ac68Sthorpej.\"
240c91ac68Sthorpej.\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
250c91ac68Sthorpej.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
260c91ac68Sthorpej.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
270c91ac68Sthorpej.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
280c91ac68Sthorpej.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
290c91ac68Sthorpej.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
300c91ac68Sthorpej.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
310c91ac68Sthorpej.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
320c91ac68Sthorpej.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
330c91ac68Sthorpej.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
340c91ac68Sthorpej.\" POSSIBILITY OF SUCH DAMAGE.
350c91ac68Sthorpej.\"
36a0887677Smrg.Dd September 23, 2016
370c91ac68Sthorpej.Dt PCICTL 8
38997634feSjoerg.Os
390c91ac68Sthorpej.Sh NAME
400c91ac68Sthorpej.Nm pcictl
410c91ac68Sthorpej.Nd a program to manipulate the PCI bus
420c91ac68Sthorpej.Sh SYNOPSIS
430c91ac68Sthorpej.Nm
440c91ac68Sthorpej.Ar pcibus
450c91ac68Sthorpej.Ar command
460c91ac68Sthorpej.Oo
470c91ac68Sthorpej.Ar arg Oo ...
480c91ac68Sthorpej.Oc
490c91ac68Sthorpej.Oc
500c91ac68Sthorpej.Sh DESCRIPTION
510c91ac68Sthorpej.Nm
529d1bacfdSyyamanoallows a user or system administrator to access various resources
530c91ac68Sthorpejon a PCI bus.
540c91ac68Sthorpej.Pp
550c91ac68SthorpejThe following commands are available:
560c91ac68Sthorpej.Pp
57800653e1Swiz.Cm list
581447fe10Swiz.Op Fl Nn
590c91ac68Sthorpej.Op Fl b Ar bus
600c91ac68Sthorpej.Op Fl d Ar device
610c91ac68Sthorpej.Op Fl f Ar function
620c91ac68Sthorpej.Pp
63de593fa0SwizList the devices in the PCI domain, either as names or, if
64fe81bd2fShubertf.Fl n
65de593fa0Swizis given, as numbers.
66fe81bd2fShubertfThe bus, device, and function
67de593fa0Swiznumbers may be specified by flags.
6826b5a191SjmcneillAny locator not specified defaults
690c91ac68Sthorpejto a wildcard, or may be explicitly wildcarded by specifying
700c91ac68Sthorpej.Dq any .
717ef7291eSmrgIf
727ef7291eSmrg.Fl N
737ef7291eSmrgis given, the driver name for this PCI device will be listed
747ef7291eSmrgif any driver is attached.
750c91ac68Sthorpej.Pp
76800653e1Swiz.Cm dump
770c91ac68Sthorpej.Op Fl b Ar bus
780c91ac68Sthorpej.Fl d Ar device
790c91ac68Sthorpej.Op Fl f Ar function
800c91ac68Sthorpej.Pp
810c91ac68SthorpejDump the PCI configuration space for the specified device located
82de593fa0Swizat the specified bus, device, and function.
83de593fa0SwizIf the bus is not specified, it defaults to the bus number of the
84de593fa0SwizPCI bus specified on the command line.
85de593fa0SwizIf the function is not specified, it defaults to 0.
86d92cacd8Smanu.Pp
877e1cfde7Sriastradh.Cm read
88d92cacd8Smanu.Op Fl b Ar bus
89d92cacd8Smanu.Fl d Ar device
90d92cacd8Smanu.Op Fl f Ar function
91d92cacd8Smanu.Ar reg
92d92cacd8Smanu.Pp
93d92cacd8SmanuRead the specified 32-bit aligned PCI configuration register and print
94d92cacd8Smanuit in hexadecimal to standard output.
95d92cacd8SmanuIf the bus is not specified, it defaults to the bus number of the
96d92cacd8SmanuPCI bus specified on the command line.
97d92cacd8SmanuIf the function is not specified, it defaults to 0.
98d92cacd8Smanu.Pp
99*8ae8201fSriastradh.Sy WARNING :
1007e1cfde7Sriastradh.Nm
1017e1cfde7Sriastradh.Cm read
1027e1cfde7Sriastradhis a dangerous command that can damage hardware and panic the operating
1037e1cfde7Sriastradhsystem, even though it appears to be a harmless read-only operation.
1047e1cfde7SriastradhIt is meant as a diagnostic tool for experiments or to debug device
1057e1cfde7Sriastradhdrivers.
1067e1cfde7SriastradhDo not use it as a substitute for a device driver!
1077e1cfde7Sriastradh.Pp
1087e1cfde7Sriastradh.Cm write
109d92cacd8Smanu.Op Fl b Ar bus
110d92cacd8Smanu.Fl d Ar device
111d92cacd8Smanu.Op Fl f Ar function
112d92cacd8Smanu.Ar reg
113d92cacd8Smanu.Ar value
114d92cacd8Smanu.Pp
115d92cacd8SmanuWrite the specified value to the specified 32-bit aligned PCI
116d92cacd8Smanuconfiguration register.
117d92cacd8SmanuIf the bus is not specified, it defaults to the bus number of the
118d92cacd8SmanuPCI bus specified on the command line.
119d92cacd8SmanuIf the function is not specified, it defaults to 0.
1207e1cfde7Sriastradh.Pp
121*8ae8201fSriastradh.Sy WARNING :
1227e1cfde7Sriastradh.Nm
123f93f10b5Swiz.Cm write
1247e1cfde7Sriastradhis a dangerous command that can damage hardware and panic the operating
1257e1cfde7Sriastradhsystem.
1267e1cfde7SriastradhIt is meant as a diagnostic tool for experiments or to debug device
1277e1cfde7Sriastradhdrivers.
1287e1cfde7SriastradhDo not use it as a substitute for a device driver!
12970629d98Swiz.Sh FILES
13070629d98Swiz.Pa /dev/pci*
13170629d98Swiz- PCI bus device nodes
132a0887677Smrg.Sh EXAMPLES
13362670575SmrgThis shows all PCI devices on the system:
134a0887677Smrg.Pp
135a0887677Smrg.Dl pcictl pci0 list
136a0887677Smrg.Pp
13770629d98SwizThis shows all PCI devices on the system, including attached drivers:
138a0887677Smrg.Pp
139a0887677Smrg.Dl pcictl pci0 list -N
1400c91ac68Sthorpej.Sh SEE ALSO
1410c91ac68Sthorpej.Xr pci 3 ,
1420cc11701Shubertf.Xr pci 4 ,
1430cc11701Shubertf.Xr drvctl 8
1440c91ac68Sthorpej.Sh HISTORY
1450c91ac68SthorpejThe
1460c91ac68Sthorpej.Nm
1470c91ac68Sthorpejcommand first appeared in
1480c91ac68Sthorpej.Nx 1.6 .
149