Access/query devices behind PCIe switch
If there's a PCIe switch in the system, how do I (easily) find out the details about devices behind such a switch? I've used setpci and lspci for similar purpose without a switch.
Do I use the Config Space for the switch, and program its BARs and Command registers to spit out individual read/write for those devices? Here's the output of lspci for reference. The device I'm interested in is a Ethernet switch connected to one of the ports of this 4-port PCIe switch.
/scw/rels # lspci -v
01:00.0 PCI bridge: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch (rev ab) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0
Memory at 11b00f6300000 (32-bit, non-prefetchable) [size=16K]
Bus: primary=01, secondary=02, subordinate=05, sec-latency=0
I/O behind bridge: 00001000-00002fff
Memory behind bridge: f6000000-f62fffff
Prefetchable memory behind bridge: 00000000f0000000-00000000f5ffffff
Capabilities: [40] Power Management version 3
Capabilities: [48] Message Signalled Interrupts: Mask+ 64bit+ Queue=0/2 Enable-
Capabilities: [68] Express Upstream Port, MSI 00
Capabilities: [a4] Subsystem: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch
Capabilities: [100] Device Serial Number 00-0e-df-b5-10-02-86-ab
Capabilities: [fb4] Advanced Error Reporting <?>
Capabilities: [138] Power Budgeting <?>
Capabilities: [148] Virtual Channel <?>
Capabilities: [950] Vendor Specific Information <?>
02:01.0 PCI bridge: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch (rev ab) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=02, secondary=03, subordinate=03, sec-latency=0
I/O behind bridge: 00001000-00001fff
Memory behind bridge: f6000000-f61fffff
Prefetchable memory behind bridge: 00000000f0000000-00000000f5ffffff
Capabilities: [40] Power Management version 3
Capabilities: [48] Message Signalled Interrupts: Mask+ 64bit+ Queue=0/2 Enable-
Capabilities: [68] Express Downstream Port (Slot+), MSI 00
Capabilities: [a4] Subsystem: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch
Capabilities: [100] Device Serial Number 00-0e-df-b5-10-02-86-ab
Capabilities: [fb4] Advanced Error Reporting <?>
Capabilities: [148] Virtual Channel <?>
Capabilities: [520] Access Controls <?>
Capabilities: [950] Vendor Specific Information <?>
02:02.0 PCI bridge: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch (rev ab) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=02, secondary=04, subordinate=04, sec-latency=0
I/O behind bridge: 00002000-00002fff
Memory behind bridge: f6200000-f62fffff
Capabilities: [40] Power Management version 3
Capabilities: [48] Message Signalled Interrupts: Mask+ 64bit+ Queue=0/2 Enable-
Capabilities: [68] Express Downstream Port (Slot+), MSI 00
Capabilities: [a4] Subsystem: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch
Capabilities: [100] Device Serial Number 00-0e-df-b5-10-02-86-ab
Capabilities: [fb4] Advanced Error Reporting <?>
Capabilities: [148] Virtual Channel <?>
Capabilities: [520] Access Controls <?>
Capabilities: [950] Vendor Specific Information <?>
02:03.0 PCI bridge: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch (rev ab) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=02, secondary=05, subordinate=05, sec-latency=0
Capabilities: [40] Power Management version 3
Capabilities: [48] Message Signalled Interrupts: Mask+ 64bit+ Queue=0/2 Enable-
Capabilities: [68] Express Downstream Port (Slot+), MSI 00
Capabilities: [a4] Subsystem: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch
Capabilities: [100] Device Serial Number 00-0e-df-b5-10-02-86-ab
Capabilities: [fb4] Advanced Error Reporting <?>
Capabilities: [148] Virtual Channel <?>
Capabilities: [520] Access Controls <?>
Capabilities: [950] Vendor Specific Information <?>
03:00.0 Memory controller: Marvell Technology Group Ltd. Device db60 (rev 01)
Subsystem: Marvell Technology Group Ltd. Device 11ab
Flags: fast devsel, IRQ 129
Memory at 11b00f4000000 (64-bit, prefetchable) [size=1M]
Memory at 11b00f0000000 (64-bit, prefetchable) [size=64M]
Capabilities: [40] Power Management version 2
Capabilities: [50] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [60] Express Legacy Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting <?>
04:00.0 IDE interface: Marvell Technology Group Ltd. 88SE6111/6121 SATA II / PATA Controller (rev b2) (prog-if 8f [Master SecP SecO PriP PriO])
Subsystem: Marvell Technology Group Ltd. 88SE6111/6121 SATA II / PATA Controller
Flags: bus master, fast devsel, latency 0, IRQ 130
I/O ports at 2010 [size=8]
I/O ports at 2020 [size=4]
I/O ports at 2018 [size=8]
I/O ports at 2024 [size=4]
I/O ports at 2000 [size=16]
Memory at 11b00f6200000 (32-bit, non-prefetchable) [size=1K]
Capabilities: [48] Power Management version 2
Capabilities: [50] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable-
Capabilities: [e0] Express Legacy Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting <?>
Kernel driver in use: ahci
|