1*560cfcceSriastradh.\" $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.\" 36c47bfd7dSmrg.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 5723f0d17fSwiz.Cm list 5812e23721Swiz.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. 686c24ed80SjmcneillAny locator not specified defaults 690c91ac68Sthorpejto a wildcard, or may be explicitly wildcarded by specifying 700c91ac68Sthorpej.Dq any . 718865fe7cSmrgIf 728865fe7cSmrg.Fl N 738865fe7cSmrgis given, the driver name for this PCI device will be listed 748865fe7cSmrgif any driver is attached. 750c91ac68Sthorpej.Pp 7623f0d17fSwiz.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. 865b311939Smanu.Pp 873393ff7dSriastradh.Cm read 885b311939Smanu.Op Fl b Ar bus 895b311939Smanu.Fl d Ar device 905b311939Smanu.Op Fl f Ar function 915b311939Smanu.Ar reg 925b311939Smanu.Pp 935b311939SmanuRead the specified 32-bit aligned PCI configuration register and print 945b311939Smanuit in hexadecimal to standard output. 955b311939SmanuIf the bus is not specified, it defaults to the bus number of the 965b311939SmanuPCI bus specified on the command line. 975b311939SmanuIf the function is not specified, it defaults to 0. 985b311939Smanu.Pp 99*560cfcceSriastradh.Sy WARNING : 1003393ff7dSriastradh.Nm 1013393ff7dSriastradh.Cm read 1023393ff7dSriastradhis a dangerous command that can damage hardware and panic the operating 1033393ff7dSriastradhsystem, even though it appears to be a harmless read-only operation. 1043393ff7dSriastradhIt is meant as a diagnostic tool for experiments or to debug device 1053393ff7dSriastradhdrivers. 1063393ff7dSriastradhDo not use it as a substitute for a device driver! 1073393ff7dSriastradh.Pp 1083393ff7dSriastradh.Cm write 1095b311939Smanu.Op Fl b Ar bus 1105b311939Smanu.Fl d Ar device 1115b311939Smanu.Op Fl f Ar function 1125b311939Smanu.Ar reg 1135b311939Smanu.Ar value 1145b311939Smanu.Pp 1155b311939SmanuWrite the specified value to the specified 32-bit aligned PCI 1165b311939Smanuconfiguration register. 1175b311939SmanuIf the bus is not specified, it defaults to the bus number of the 1185b311939SmanuPCI bus specified on the command line. 1195b311939SmanuIf the function is not specified, it defaults to 0. 1203393ff7dSriastradh.Pp 121*560cfcceSriastradh.Sy WARNING : 1223393ff7dSriastradh.Nm 123c48417e2Swiz.Cm write 1243393ff7dSriastradhis a dangerous command that can damage hardware and panic the operating 1253393ff7dSriastradhsystem. 1263393ff7dSriastradhIt is meant as a diagnostic tool for experiments or to debug device 1273393ff7dSriastradhdrivers. 1283393ff7dSriastradhDo not use it as a substitute for a device driver! 129c0666de3Swiz.Sh FILES 130c0666de3Swiz.Pa /dev/pci* 131c0666de3Swiz- PCI bus device nodes 132c47bfd7dSmrg.Sh EXAMPLES 133cf3fd925SmrgThis shows all PCI devices on the system: 134c47bfd7dSmrg.Pp 135c47bfd7dSmrg.Dl pcictl pci0 list 136c47bfd7dSmrg.Pp 137c0666de3SwizThis shows all PCI devices on the system, including attached drivers: 138c47bfd7dSmrg.Pp 139c47bfd7dSmrg.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