xref: /aosp_15_r20/external/pciutils/README (revision c2e0c6b56a71da9abe8df5c8348fb3eb5c2c9251)
1*c2e0c6b5SAndroid Build Coastguard WorkerThis package contains the PCI Utilities, version @VERSION@.
2*c2e0c6b5SAndroid Build Coastguard Worker
3*c2e0c6b5SAndroid Build Coastguard WorkerCopyright (c) 1997--2024 Martin Mares <[email protected]>
4*c2e0c6b5SAndroid Build Coastguard Worker
5*c2e0c6b5SAndroid Build Coastguard WorkerAll files in this package can be freely distributed and used according
6*c2e0c6b5SAndroid Build Coastguard Workerto the terms of the GNU General Public License, either version 2 or
7*c2e0c6b5SAndroid Build Coastguard Worker(at your opinion) any newer version. See https://www.gnu.org/ for details.
8*c2e0c6b5SAndroid Build Coastguard Worker
9*c2e0c6b5SAndroid Build Coastguard WorkerThe author wants to clarify that he does not consider programs which link
10*c2e0c6b5SAndroid Build Coastguard Workerdynamically to the libpci to be derived works of the library.
11*c2e0c6b5SAndroid Build Coastguard Worker
12*c2e0c6b5SAndroid Build Coastguard Worker
13*c2e0c6b5SAndroid Build Coastguard Worker1. What's that?
14*c2e0c6b5SAndroid Build Coastguard Worker~~~~~~~~~~~~~~~
15*c2e0c6b5SAndroid Build Coastguard WorkerThe PCI Utilities package contains a library for portable access to PCI bus
16*c2e0c6b5SAndroid Build Coastguard Workerconfiguration registers and several utilities based on this library.
17*c2e0c6b5SAndroid Build Coastguard Worker
18*c2e0c6b5SAndroid Build Coastguard WorkerIn runs on the following systems:
19*c2e0c6b5SAndroid Build Coastguard Worker
20*c2e0c6b5SAndroid Build Coastguard Worker	Linux		(via /sys/bus/pci, /proc/bus/pci or i386 ports)
21*c2e0c6b5SAndroid Build Coastguard Worker	FreeBSD		(via /dev/pci)
22*c2e0c6b5SAndroid Build Coastguard Worker	NetBSD		(via libpci)
23*c2e0c6b5SAndroid Build Coastguard Worker	OpenBSD		(via /dev/pci or i386 ports)
24*c2e0c6b5SAndroid Build Coastguard Worker	GNU/kFreeBSD	(via /dev/pci)
25*c2e0c6b5SAndroid Build Coastguard Worker	Solaris/i386	(direct port access)
26*c2e0c6b5SAndroid Build Coastguard Worker	Aix		(via /dev/pci and odmget)
27*c2e0c6b5SAndroid Build Coastguard Worker	GNU Hurd	(direct port access)
28*c2e0c6b5SAndroid Build Coastguard Worker	Windows		(via cfgmgr32 or direct port access, see README.Windows for caveats)
29*c2e0c6b5SAndroid Build Coastguard Worker	CYGWIN		(direct port access)
30*c2e0c6b5SAndroid Build Coastguard Worker	BeOS		(via syscalls)
31*c2e0c6b5SAndroid Build Coastguard Worker	Haiku		(via /dev/misc/poke)
32*c2e0c6b5SAndroid Build Coastguard Worker	Darwin		(via IOKit)
33*c2e0c6b5SAndroid Build Coastguard Worker	DOS/DJGPP	(via i386 ports)
34*c2e0c6b5SAndroid Build Coastguard Worker	SylixOS		(via /proc/pci)
35*c2e0c6b5SAndroid Build Coastguard Worker	AmigaOS on PPC	(via Expansion library)
36*c2e0c6b5SAndroid Build Coastguard Worker
37*c2e0c6b5SAndroid Build Coastguard WorkerIt should be very easy to add support for other systems as well (volunteers
38*c2e0c6b5SAndroid Build Coastguard Workerwanted; if you want to try that, I'll be very glad to see the patches and
39*c2e0c6b5SAndroid Build Coastguard Workerinclude them in the next version).
40*c2e0c6b5SAndroid Build Coastguard Worker
41*c2e0c6b5SAndroid Build Coastguard WorkerThe utilities include:  (See manual pages for more details)
42*c2e0c6b5SAndroid Build Coastguard Worker
43*c2e0c6b5SAndroid Build Coastguard Worker  - lspci: displays detailed information about all PCI buses and devices.
44*c2e0c6b5SAndroid Build Coastguard Worker
45*c2e0c6b5SAndroid Build Coastguard Worker  - setpci: allows to read from and write to PCI device configuration
46*c2e0c6b5SAndroid Build Coastguard Worker    registers. For example, you can adjust the latency timers with it.
47*c2e0c6b5SAndroid Build Coastguard Worker    CAUTION: There is a couple of dangerous points and caveats, please read
48*c2e0c6b5SAndroid Build Coastguard Worker    the manual page first!
49*c2e0c6b5SAndroid Build Coastguard Worker
50*c2e0c6b5SAndroid Build Coastguard Worker  - update-pciids: download the current version of the pci.ids file.
51*c2e0c6b5SAndroid Build Coastguard Worker
52*c2e0c6b5SAndroid Build Coastguard Worker  - pcilmr: performs margining on PCIe links.
53*c2e0c6b5SAndroid Build Coastguard Worker
54*c2e0c6b5SAndroid Build Coastguard Worker
55*c2e0c6b5SAndroid Build Coastguard Worker2. Compiling and (un)installing
56*c2e0c6b5SAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57*c2e0c6b5SAndroid Build Coastguard WorkerJust run "make" to compile the package and then "make install" to install it.
58*c2e0c6b5SAndroid Build Coastguard WorkerPlease note that a C compiler supporting the C99 standard is required.
59*c2e0c6b5SAndroid Build Coastguard WorkerAlso, GNU make is needed on most platforms.
60*c2e0c6b5SAndroid Build Coastguard Worker
61*c2e0c6b5SAndroid Build Coastguard WorkerIf you want to change the default installation location, please override
62*c2e0c6b5SAndroid Build Coastguard Workerthe PREFIX variable specified in the Makefile -- e.g., you can use
63*c2e0c6b5SAndroid Build Coastguard Worker"make PREFIX=/opt/pciutils install" to create a separate installation
64*c2e0c6b5SAndroid Build Coastguard Workernot interfering with the rest of your system.  Setting the DESTDIR variable
65*c2e0c6b5SAndroid Build Coastguard Workerwill allow you to install to a different directory from the one you intend
66*c2e0c6b5SAndroid Build Coastguard Workerto eventually run it from.  This is useful for people who are packaging
67*c2e0c6b5SAndroid Build Coastguard Workerpciutils to install on other computers.
68*c2e0c6b5SAndroid Build Coastguard Worker
69*c2e0c6b5SAndroid Build Coastguard WorkerThere are several options which can be set in the Makefile or overridden
70*c2e0c6b5SAndroid Build Coastguard Workerwhen running make:
71*c2e0c6b5SAndroid Build Coastguard Worker
72*c2e0c6b5SAndroid Build Coastguard Worker  ZLIB=yes/no	Enable support for compressed pci.ids (requires zlib).
73*c2e0c6b5SAndroid Build Coastguard Worker		If it is enabled, pciutils will use pci.ids.gz in preference to
74*c2e0c6b5SAndroid Build Coastguard Worker		pci.ids, even if the pci.ids file is newer.  If the pci.ids.gz
75*c2e0c6b5SAndroid Build Coastguard Worker		file is missing, it will use pci.ids instead.  If you do not
76*c2e0c6b5SAndroid Build Coastguard Worker		specify this option, the configure script will try to guess
77*c2e0c6b5SAndroid Build Coastguard Worker		automatically based on the presence of zlib.
78*c2e0c6b5SAndroid Build Coastguard Worker
79*c2e0c6b5SAndroid Build Coastguard Worker  DNS=yes/no	Enable support for querying the central database of PCI IDs
80*c2e0c6b5SAndroid Build Coastguard Worker		using DNS.  Requires libresolv (which is available on most
81*c2e0c6b5SAndroid Build Coastguard Worker		systems as a part of the standard libraries) and tries to
82*c2e0c6b5SAndroid Build Coastguard Worker		autodetect its presence if the option is not specified.
83*c2e0c6b5SAndroid Build Coastguard Worker
84*c2e0c6b5SAndroid Build Coastguard Worker  SHARED=yes/	Build libpci as a shared library.  Requires GCC 4.0 or newer.
85*c2e0c6b5SAndroid Build Coastguard Worker  no/local	The ABI of the shared library is intended to remain backward
86*c2e0c6b5SAndroid Build Coastguard Worker		compatible for a long time (we use symbol versioning to achieve
87*c2e0c6b5SAndroid Build Coastguard Worker		that, like GNU libc does).  The value `local' includes the
88*c2e0c6b5SAndroid Build Coastguard Worker		right directory name in the binaries, so the utilities can be
89*c2e0c6b5SAndroid Build Coastguard Worker		run without installation.  This is not recommended for any
90*c2e0c6b5SAndroid Build Coastguard Worker		production builds.
91*c2e0c6b5SAndroid Build Coastguard Worker
92*c2e0c6b5SAndroid Build Coastguard Worker"make install-lib" installs the library together with its header files
93*c2e0c6b5SAndroid Build Coastguard Workerfor use by other programs.
94*c2e0c6b5SAndroid Build Coastguard Worker
95*c2e0c6b5SAndroid Build Coastguard WorkerWhen you are bored of dumping PCI registers, just use "make uninstall".
96*c2e0c6b5SAndroid Build Coastguard Worker
97*c2e0c6b5SAndroid Build Coastguard Worker
98*c2e0c6b5SAndroid Build Coastguard Worker3. Getting new IDs
99*c2e0c6b5SAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~~~~
100*c2e0c6b5SAndroid Build Coastguard WorkerThe database of PCI IDs (the pci.ids file) gets out of date much faster
101*c2e0c6b5SAndroid Build Coastguard Workerthan I release new versions of this package, so it is maintained separately.
102*c2e0c6b5SAndroid Build Coastguard Worker
103*c2e0c6b5SAndroid Build Coastguard WorkerIt lives at https://pci-ids.ucw.cz/, where you can browse the database,
104*c2e0c6b5SAndroid Build Coastguard Workerdownload the most recent pci.ids file (e.g., by running the update-ids utility)
105*c2e0c6b5SAndroid Build Coastguard Workerand also submit new entries.
106*c2e0c6b5SAndroid Build Coastguard Worker
107*c2e0c6b5SAndroid Build Coastguard WorkerAlternatively, you can use `lspci -q' to query the central database
108*c2e0c6b5SAndroid Build Coastguard Workerfor new entries via network.
109*c2e0c6b5SAndroid Build Coastguard Worker
110*c2e0c6b5SAndroid Build Coastguard WorkerThe pci.ids file is also mirrored at https://github.com/pciutils/pciids.
111*c2e0c6b5SAndroid Build Coastguard Worker
112*c2e0c6b5SAndroid Build Coastguard WorkerOn Linux systems with a recent enough version of libudev, UDEV's HWDB
113*c2e0c6b5SAndroid Build Coastguard Workerdatabase is consulted when pci.ids lacks the device.
114*c2e0c6b5SAndroid Build Coastguard Worker
115*c2e0c6b5SAndroid Build Coastguard Worker
116*c2e0c6b5SAndroid Build Coastguard Worker4. Getting new versions
117*c2e0c6b5SAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~~~~~~~~
118*c2e0c6b5SAndroid Build Coastguard WorkerThe current version of pciutils is available at:
119*c2e0c6b5SAndroid Build Coastguard Worker
120*c2e0c6b5SAndroid Build Coastguard Worker	https://mj.ucw.cz/sw/pciutils/
121*c2e0c6b5SAndroid Build Coastguard Worker
122*c2e0c6b5SAndroid Build Coastguard WorkerThe tarball can be downloaded at the following places:
123*c2e0c6b5SAndroid Build Coastguard Worker
124*c2e0c6b5SAndroid Build Coastguard Worker	https://mj.ucw.cz/download/linux/pci/
125*c2e0c6b5SAndroid Build Coastguard Worker	ftp://ftp.ucw.cz/pub/mj/linux/pci/
126*c2e0c6b5SAndroid Build Coastguard Worker	https://www.kernel.org/pub/software/utils/pciutils/ (expect a couple of hours delay)
127*c2e0c6b5SAndroid Build Coastguard Worker
128*c2e0c6b5SAndroid Build Coastguard WorkerThere is also a public GIT tree at:
129*c2e0c6b5SAndroid Build Coastguard Worker
130*c2e0c6b5SAndroid Build Coastguard Worker	https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git
131*c2e0c6b5SAndroid Build Coastguard Worker	https://github.com/pciutils/pciutils
132*c2e0c6b5SAndroid Build Coastguard Worker
133*c2e0c6b5SAndroid Build Coastguard Worker
134*c2e0c6b5SAndroid Build Coastguard Worker5. Using the library
135*c2e0c6b5SAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~~~~~
136*c2e0c6b5SAndroid Build Coastguard WorkerSo far, there is only a little documentation for the library except for the
137*c2e0c6b5SAndroid Build Coastguard Workergeneral introduction in the pcilib(7) man page. If you want to use the
138*c2e0c6b5SAndroid Build Coastguard Workerlibrary in your programs, please follow the comments in lib/pci.h and in
139*c2e0c6b5SAndroid Build Coastguard Workerthe example program example.c.
140*c2e0c6b5SAndroid Build Coastguard Worker
141*c2e0c6b5SAndroid Build Coastguard Worker
142*c2e0c6b5SAndroid Build Coastguard Worker6. Feedback
143*c2e0c6b5SAndroid Build Coastguard Worker~~~~~~~~~~~
144*c2e0c6b5SAndroid Build Coastguard WorkerIf you have any bug reports or suggestions, send them to the author.
145*c2e0c6b5SAndroid Build Coastguard Worker
146*c2e0c6b5SAndroid Build Coastguard WorkerIf you have any new IDs, I'll be very glad to add them to the database.
147*c2e0c6b5SAndroid Build Coastguard WorkerJust submit them at https://pci-ids.ucw.cz/.
148*c2e0c6b5SAndroid Build Coastguard Worker
149*c2e0c6b5SAndroid Build Coastguard WorkerAnnouncements of new versions are sent to [email protected]
150*c2e0c6b5SAndroid Build Coastguard Worker(see http://vger.kernel.org/ for instructions).
151*c2e0c6b5SAndroid Build Coastguard Worker
152*c2e0c6b5SAndroid Build Coastguard Worker					Have fun
153*c2e0c6b5SAndroid Build Coastguard Worker							Martin
154