dmidecode
and lshw
together provide a reasonable picture. dmidecode
, on a correctly-configured system (i.e. one with correctly-populated DMI tables), will list physical slots and their characteristics. For example, on my system, I see information such as
Handle 0x001C, DMI type 9, 17 bytes
System Slot Information
Designation: SLOT7 PCI-E 2.0 X 1
Type: x1 PCI Express
Current Usage: In Use
Length: Short
ID: 0
Characteristics:
3.3 V is provided
Opening is shared
PME signal is supported
Bus Address: 0000:07:00.0
and
Handle 0x0021, DMI type 9, 17 bytes
System Slot Information
Designation: SLOT1 PCI 33MHz
Type: 32-bit PCI
Current Usage: In Use
Length: Short
ID: 5
Characteristics:
3.3 V is provided
Opening is shared
PME signal is supported
Bus Address: 0000:09:00.0
The designations can be quite detailed; on this particular board the physical slots and electrical capabilities are correctly identified (e.g. PCI-E 3.0 X8 (IN X16)
).
lshw
indicates the bridge connections, and its information can be matched with dmidecode
's using the bus addresses. This allows motherboard-hosted bridges to be distinguished from adapter-hosted bridges. (For example, one of my systems has two PCI slots on a C226 motherboard, using a PCI bridge on the motherboard; it also has an ATTO SCSI PCI Express HBA which uses two PCI-hosted chips behind another PCI bridge, on the card itself. lshw
's output doesn't make it easy to distinguish the two cases, but combined with dmidecode
's output it's obvious which is which.)
lspci -t
is a bit more structured. – meuh May 26 '16 at 17:48/sys/bus/pci/devices
gives all the information you want? – Gilles 'SO- stop being evil' May 26 '16 at 23:00