lspci命令 总线


INTEL 430HX PCISET 82439HX SYSTEM CONTROLLER (TXC)
https://theretroweb.com/chipset/documentation/29055102-intel-430hx-pciset-61f865e808367323253227.pdf

一、实验环境(云主机)
[root@aozhejin ~]$cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)
[root@aozhejin ~]$uname -r
3.10.0-1160.62.1.el7.x86_64


 二、pci/pcie/isa总线拓扑
     服务器上的PCI bus的树型结构示例:
    00:00.0(主桥)--00:01.0(PCI桥)-----01:00:0(nVidia显卡)  //1号总线
                   |
                   |---00:1d(USB控制器)--00:1d:0(USB1号控制器)
                   |                    |
                   |                    |--00:1d:1(USB2号控制器)                    |
                   |-00:1e:0(PCI桥)--02:00.0(IEEE1394)  //2号总线
                   |                |
                   |                |-02:01.0(8139网卡)
                   |                |
                   |                |-02:04(CardBus桥)-02:04.0(桥1)
                   |                                   |
                   |                                   |--02:04.1(桥2)
                   |
                   |-00:1f(多功能板卡)-00:1f:0(ISA桥)    //5号总线
                                        |
                                        |--00:1f:1(IDE接口)
                                        |
                                        |--00:1f:3(SMBus)
                                        |
                                        |--00:1f:5(多媒体声音控制器)
                                        |
                                        |--00:1f:6(调制解调器)
  8个PCI设备,其中0号总线上(host bridge)上连有4个,1号总线上连有1个,2号总线上连有3个。00:1f是一个连有5个功能的多功能板卡

   列出他们的pci总线设备的层级结构

[root@aozhejin ~]$lspci -t
-[0000:00]-+-00.0
           +-01.0-[01]--
           +-07.0
           +-07.1
           +-07.3
           +-07.7
           +-0f.0
           +-11.0-[02]--
           +-15.0-[03]----00.0
           +-15.1-[04]--
           +-15.2-[05]--
           +-15.3-[06]--
           +-15.4-[07]--
           +-15.5-[08]--
           +-15.6-[09]--
           +-15.7-[0a]--
           +-16.0-[0b]----00.0
           +-16.1-[0c]--
           +-16.2-[0d]--
           +-16.3-[0e]--
           +-16.4-[0f]--
           +-16.5-[10]--
           +-16.6-[11]--
           +-16.7-[12]--
           +-17.0-[13]----00.0
           +-17.1-[14]--
           +-17.2-[15]--
           +-17.3-[16]--
           +-17.4-[17]--
           +-17.5-[18]--
           +-17.6-[19]--
           +-17.7-[1a]--
           +-18.0-[1b]--
           +-18.1-[1c]--
           +-18.2-[1d]--
           +-18.3-[1e]--
           +-18.4-[1f]--
           +-18.5-[20]--
           +-18.6-[21]--
           \-18.7-[22]--

 

  Show kernel drivers handling each device

[root@aozhejin ~]$lspci -k
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
    Subsystem: VMware Virtual Machine Chipset
    Kernel driver in use: agpgart-intel
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
    Subsystem: VMware Virtual Machine Chipset
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
    Subsystem: VMware Virtual Machine Chipset
    Kernel driver in use: ata_piix
    Kernel modules: ata_piix, pata_acpi, ata_generic
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
    Subsystem: VMware Virtual Machine Chipset
    Kernel modules: i2c_piix4
00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
    Subsystem: VMware Virtual Machine Communication Interface
    Kernel driver in use: vmw_vmci
    Kernel modules: vmw_vmci
00:0f.0 VGA compatible controller: VMware SVGA II Adapter
    Subsystem: VMware SVGA II Adapter
    Kernel driver in use: vmwgfx
    Kernel modules: vmwgfx
00:11.0 PCI bridge: VMware PCI bridge (rev 02)
00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)
    Kernel driver in use: pcieport
00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)
    Kernel driver in use: pcieport
00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)
    Kernel driver in use: pcieport
00:15.3 PCI bridge: VMware PCI Express Root Port (rev 01)
    Kernel driver in use: pcieport
.....

 

[root@aozhejin ~]$ lspci -n | tail -5
00:18.6 0604: 15ad:07a0 (rev 01)
00:18.7 0604: 15ad:07a0 (rev 01)
03:00.0 0107: 1000:0054 (rev 01)
0b:00.0 0200: 15ad:07b0 (rev 01)
13:00.0 0200: 15ad:07b0 (rev 01)

  他们的意义如下

第1个字段 : 00:18.6 : bus number (00), device number (18) and function (6)
第2个字段 : 0604    : device class
第3个字段 : 15ed    : vendor ID
第4个字段 : 07a0    : device ID
这里function 你需要看pcie规范文档

[root@aozhejin ~]$cat /usr/share/hwdata/pci.ids | grep 07a0
07a0 Sun Expert3D-Lite Graphics Accelerator
07a0 PCI Express Root Port


显示domain number

[root@aozhejin ~]$lspci -D
0000:00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
0000:00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
0000:00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
0000:00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
0000:00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
0000:00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
0000:00:0f.0 VGA compatible controller: VMware SVGA II Adapter
0000:00:11.0 PCI bridge: VMware PCI bridge (rev 02)
0000:00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)
0000:00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)
0000:00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)
0000:00:15.3 PCI bridge: VMware PCI Express Root Port (rev 01)
0000:00:15.4 PCI bridge: VMware PCI Express Root Port (rev 01)
0000:00:15.5 PCI bridge: VMware PCI Express Root Port (rev 01)
....
0000:03:00.0 Serial Attached SCSI controller: Broadcom / LSI SAS1068 PCI-X Fusion-MPT SAS (rev 01)
0000:0b:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)
0000:13:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)

显示Show both textual and numeric ID's (names & numbers)

[root@aozhejin ~]$lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge [8086:7190] (rev 01)
00:01.0 PCI bridge [0604]: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge [8086:7191] (rev 01)
00:07.0 ISA bridge [0601]: Intel Corporation 82371AB/EB/MB PIIX4 ISA [8086:7110] (rev 08)
00:07.1 IDE interface [0101]: Intel Corporation 82371AB/EB/MB PIIX4 IDE [8086:7111] (rev 01)
00:07.3 Bridge [0680]: Intel Corporation 82371AB/EB/MB PIIX4 ACPI [8086:7113] (rev 08)
00:07.7 System peripheral [0880]: VMware Virtual Machine Communication Interface [15ad:0740] (rev 10)
00:0f.0 VGA compatible controller [0300]: VMware SVGA II Adapter [15ad:0405]
00:11.0 PCI bridge [0604]: VMware PCI bridge [15ad:0790] (rev 02)
00:15.0 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:15.1 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:15.2 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:15.3 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:15.4 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:15.5 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:15.6 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:15.7 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:16.0 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:16.1 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:16.2 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:16.3 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:16.4 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:16.5 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
00:16.6 PCI bridge [0604]: VMware PCI Express Root Port [15ad:07a0] (rev 01)
....
03:00.0 Serial Attached SCSI controller [0107]: Broadcom / LSI SAS1068 PCI-X Fusion-MPT SAS [1000:0054] (rev 01)
0b:00.0 Ethernet controller [0200]: VMware VMXNET3 Ethernet Controller [15ad:07b0] (rev 01)
13:00.0 Ethernet controller [0200]: VMware VMXNET3 Ethernet Controller [15ad:07b0] (rev 01)
"Selection of devices:\n"
  "-s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]\tShow only devices in selected slots\n"
  "-d [<vendor>]:[<device>][:<class>]\t\tShow only devices with specified ID's\n"


SMBIOS 一般是type=41

SMBIOS(System Management BIOS , SMBIOS) 是主板或系统制造者以标准格式显示产品管理信息所需遵循的统一规范。 DMI(Desktop Management Interface, DMI) 就是帮助收集电脑系统信息的管理系统, DMI 信息的收集必须在严格遵照 SMBIOS 规范的前提下进行。 SMBIOS 和 DMI 是由行业指导机构 Desktop Management Task Force (DMTF) 起草的开放性的技术标准,其中, DMI 设计适用于任何的平台和操作系统。 DMI 充当了管理工具和系统层之间接口的角色。它建立了标准的可管理系统更加方便了厂商和用户对系统的了解。

[root@aozhejin ~]$dmidecode -t 41 
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.4 present.

 

lspci 查询pci设备信息,这些PCI设备名字文件保存在哪里呢?

实际linux系统从
[root@aozhejin ~]$cat /usr/share/hwdata/pci.ids或
[root@aozhejin ~]$cat /usr/share/misc/pci.ids 文件中可以获取硬件设备详细厂商信息




芯片和内核模块相应负责的内容

芯片或其他     kernel driver kernel module
intel 440BX 82443BX Host bridge 82443BX/ZX/DX Host bridge agpgart-intel  
intel 440BX 82443BX PCI bridge 82443BX/ZX/DX AGP bridge    
82371AB ISA bridge 82371AB/EB/MB PIIX4 ISA    
82371AB IDE interface 82371AB/EB/MB PIIX4 IDE ata_piix ata_piix, pata_acpi, ata_generic
82371AB Bridge 82371AB/EB/MB PIIX4 ACPI   i2c_piix4
vmware System peripheral       vmw_vmci

 


类似下面的布局 https://tldp.org/LDP/tlk/dd/pci.html



Intel 82443BX Simplified Block Diagram(内部)

 

 

 
我们看下整体: 

 

 

 


三、相关芯片 datasheet 的地址:

INTEL 430HX INTEL 430HX PCISET 82439HX SYSTEM CONTROLLER (TXC)
  https://theretroweb.com/chipset/documentation/29055102-intel-430hx-pciset-61f865e808367323253227.pdf
82443BX Intel® 440BX AGPset: 82443BX Host Bridge/Controller 
  https://datasheet.octopart.com/FW82443BX-Intel-datasheet-5334749.pdf
Intel® 82371AB PIIX4 Intel® 82371AB PIIX4,
  https://www.intel.com/Assets/PDF/specupdate/297738.pdf
   


四、lspci源码
   https://github.com/pciutils/pciutils/blob/master/lspci.c

五、bios

[root@aozhejin ~]$dmidecode -t 0
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.4 present.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
    Vendor: Phoenix Technologies LTD
    Version: 6.00
    Release Date: 09/21/2015
    Address: 0xE99E0
    Runtime Size: 91680 bytes
    ROM Size: 64 kB
    Characteristics:
        ISA is supported
        PCI is supported
        PC Card (PCMCIA) is supported
        PNP is supported
        APM is supported
        BIOS is upgradeable
        BIOS shadowing is allowed
        ESCD support is available
        Boot from CD is supported
        Selectable boot is supported
        EDD is supported
        Print screen service is supported (int 5h)
        8042 keyboard services are supported (int 9h)
        Serial services are supported (int 14h)
        Printer services are supported (int 17h)
        CGA/mono video services are supported (int 10h)
        ACPI is supported
        Smart battery is supported
        BIOS boot specification is supported
        Function key-initiated network boot is supported
        Targeted content distribution is supported
    BIOS Revision: 4.6
    Firmware Revision: 0.0

得到主板的相关信息

[root@aozhejin ~]$dmidecode --type 2
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.4 present.

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
    Manufacturer: Intel Corporation
    Product Name: 440BX Desktop Reference Platform
    Version: None
    Serial Number: None
    Asset Tag: Not Specified
    Features: None
    Location In Chassis: Not Specified
    Chassis Handle: 0x0000
    Type: Unknown
    Contained Object Handles: 0

 


参考:
https://www.ibm.com/docs/en/linux-on-systems?topic=vfio-pass-through-pci

posted @ 2023-04-14 23:14  jinzi  阅读(119)  评论(0编辑  收藏  举报