linux:kernel:pci_devices
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux:kernel:pci_devices [2021/01/29 10:29] – peter | linux:kernel:pci_devices [2022/10/08 11:37] (current) – peter | ||
---|---|---|---|
Line 3: | Line 3: | ||
The PCI standard has become the de-facto standard for system buses. | The PCI standard has become the de-facto standard for system buses. | ||
- | Linux provide extensive support for PCI, and contains numerous drivers for network, storage and 3rd party adapters. | + | Linux provide extensive support for PCI, and contains numerous drivers for network, storage and 3rd party adapters. |
---- | ---- | ||
Line 66: | Line 66: | ||
</ | </ | ||
+ | ---- | ||
+ | |||
+ | ===== Analyze one device ===== | ||
+ | |||
+ | Take one example from the list: | ||
+ | |||
+ | <code bash> | ||
+ | lrwxrwxrwx 1 root root 0 Jan 29 03:47 0000: | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * **0000** : PCI domain. | ||
+ | * **03** | ||
+ | * **00** | ||
+ | * **.0** | ||
+ | |||
+ | Vendor and device information is stored in a centralized [[http:// | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Obtain Information on a specific PCI device ===== | ||
+ | |||
+ | <code bash> | ||
+ | cd / | ||
+ | ls -al | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | total 0 | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x 28 root root 0 Jan 23 13:03 .. | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | lrwxrwxrwx | ||
+ | lrwxrwxrwx | ||
+ | -r--r--r-- | ||
+ | drwxr-xr-x | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | drwxr-xr-x | ||
+ | --w--w---- | ||
+ | --w------- | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | lrwxrwxrwx | ||
+ | -r--r--r-- | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- | ||
+ | -r--r--r-- | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Get Vendor ==== | ||
+ | |||
+ | <code bash> | ||
+ | cat vendor 0x14e4 | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | 0x1022 | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Get Device ==== | ||
+ | |||
+ | <code bash> | ||
+ | cat device | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | 0x1482 | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Get Class ==== | ||
+ | |||
+ | <code bash> | ||
+ | cat class | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | 0x060000 | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Viewing PCI data with lspci ===== | ||
+ | |||
+ | View the devices connected to your system: | ||
+ | |||
+ | <code bash> | ||
+ | lspci | tail -10 | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | 06:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller | ||
+ | 07:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 51) | ||
+ | 08:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 51) | ||
+ | 09:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1) | ||
+ | 09:00.1 Audio device: NVIDIA Corporation GP107GL High Definition Audio Controller (rev a1) | ||
+ | 0a:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Starship/ | ||
+ | 0b:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Starship/ | ||
+ | 0b:00.1 Encryption controller: Advanced Micro Devices, Inc. [AMD] Starship/ | ||
+ | 0b:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller | ||
+ | 0b:00.4 Audio device: Advanced Micro Devices, Inc. [AMD] Starship/ | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE:** lspci read through the sysfs entries and decoded the vendor and device numbers using the vendor and device information in **/ | ||
+ | |||
+ | lspci uses libpci, which returns the data using the PCI identification data in / | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | <code bash> | ||
+ | lspci -n | tail -10 | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | 06:00.3 0c03: 1022:149c | ||
+ | 07:00.0 0106: 1022:7901 (rev 51) | ||
+ | 08:00.0 0106: 1022:7901 (rev 51) | ||
+ | 09:00.0 0300: 10de:1c82 (rev a1) | ||
+ | 09:00.1 0403: 10de:0fb9 (rev a1) | ||
+ | 0a:00.0 1300: 1022:148a | ||
+ | 0b:00.0 1300: 1022:1485 | ||
+ | 0b:00.1 1080: 1022:1486 | ||
+ | 0b:00.3 0c03: 1022:149c | ||
+ | 0b:00.4 0403: 1022:1487 | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Expand on one device ==== | ||
+ | |||
+ | As an example, taking this from above list: | ||
+ | |||
+ | <code bash> | ||
+ | 09:00.0 0300: 10de:1c82 (rev a1) | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * 09:00.0 : Bus number (09), Device number (00) and Function (0). | ||
+ | * 0300 : Device class. | ||
+ | * 10de : Vendor ID. | ||
+ | * 1c82 : Device ID. | ||
+ | |||
+ | Looking up the identifiers in the [[http:// | ||
+ | |||
+ | * 0300 : Device class => Display controller. | ||
+ | * 10de : Vendor ID => NVIDIA Corporation. | ||
+ | * 1c82 : Device ID => GP107 [GeForce GTX 1050 Ti]. | ||
+ | |||
+ | which matches the output from the default **lspci | tail -10**: | ||
+ | |||
+ | <code bash> | ||
+ | 09:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1) | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Updating the PCI identification list ===== | ||
+ | |||
+ | The lspci utility uses the pci.ids file to determine the vendor and device type. | ||
+ | |||
+ | This file will grow as new vendors and devices are added, and can be updated automatically by running the update-pciids utility: | ||
+ | |||
+ | <code bash> | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | |||
+ | <code bash> | ||
+ | % Total % Received % Xferd Average Speed | ||
+ | | ||
+ | 100 264k 100 264k 0 | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== References ===== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | http:// | ||
linux/kernel/pci_devices.1611916192.txt.gz · Last modified: 2021/01/29 10:29 by peter