linux驱动 – PCI访问硬件分析与SD express调试记录
系统侧调试PCI设备
PCI tree结构
关于PCIe tree的bus/device的详细architecture,参考LDD3和Mastering Linux Device Driver Development - John Madieu


Root complex (RC): This refers to the PCIe host controller in the SoC. It can access the main memory without CPU intervening, which is a feature used by other devices to access the main memory. They are also known as Host-to-PCI bridges.
Bridges: These provide an interface to other buses, such as PCI or PCI X, or even another PCIe bus. A bridge can also provide an interface to the same bus
Endpoint (EP): Endpoints are PCIe devices, and are represented by type 00h configuration space headers. They never appear on a switch’s internal bus and have no downstream port
lspci使用示例
下面介绍如何找到一个PCI(e)设备的信息,及其上游端口信息,以及设备的register space内容
(1)查看所有pci设备: