vieyahn2017 / iBlog

44 stars 0 forks source link

PCI - 【Peripheral Component Interconnect】(外设部件互连标准) #393

Open vieyahn2017 opened 1 month ago

vieyahn2017 commented 1 month ago

PCI是Peripheral Component Interconnect(外设部件互连标准)的缩写,它是目前个人电脑中使用最为广泛的接口,几乎所有的主板产品上都带有这种插槽。

vieyahn2017 commented 1 month ago

lspci lspci -v | grep " driver" | sort | uniq -c 只显示单个,使用-s lspci -s 8d:00.0 -x -v ll /sys/bus/pci/drivers cat /proc/bus/pci/devices | awk '{print $1, $2, $3, $18}' | sort -k 4

vieyahn2017 commented 1 month ago

参考链接 【原创】Linux PCI驱动框架分析(一) - LoyenWang 【原创】Linux PCI驱动框架分析(二) - LoyenWang 【原创】Linux PCI驱动框架分析(三) - LoyenWang

vieyahn2017 commented 1 month ago

PCIe总线学习笔记(一、PCI基础知识简介)(转载) https://www.cnblogs.com/jixp/articles/9776912.html

vieyahn2017 commented 1 month ago

https://zhuanlan.zhihu.com/p/661887811 PCIe学习笔记——1.基本概念及拓扑结构

vieyahn2017 commented 1 month ago

PCIe学习笔记之MSI/MSI-x中断及代码分析 https://blog.csdn.net/yhb1047818384/article/details/106676560

vieyahn2017 commented 1 month ago

PCI的quirk方法

摘要:在阅读linux的PCI的源码的过程中,有个文件quirks.c让阅读组感觉很奇诡。PCI的设备枚举的实现很流畅,但在不经意就会出插入函数pci_fixup_device()。让阅读者感觉多余,不知其意。quirks.c,PCI设备的定制化实现 "quirk",n. 怪癖;(尤指偶发的)怪事,奇事;怪异的性格(或行为); 在阅读quirks.c的文件头的说明,再结合quirk的本身的含义,阅读者就能很清楚的理解quirks.c就是PCI设备的定制化实现。

vieyahn2017 commented 1 month ago

lspci -s 83:00.0 -x 83:00.0 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5] 00: b3 15 17 10 46 05 10 00 00 00 00 02 08 00 80 00 10: 0c 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 20: 00 00 00 00 00 00 00 00 00 00 00 00 e5 19 35 d1 30: 00 00 f0 ff 60 00 00 00 00 00 00 00 ff 01 00 00

vieyahn2017 commented 1 month ago

lspci -x | grep "00: " -B1 筛选类型

lspci -x | grep "00: " | awk '{print $13 $12}' | sort | uniq -c 2 0106 4 0107 14 0200 1 0300 24 0604 2 0880 6 0c03 2 0c04 2 1000 1 1180

vieyahn2017 commented 1 month ago

setpci 修改

vieyahn2017 commented 1 month ago

[root@localhost ~]# lspci 00:00.0 Host bridge: Intel Corporation Sky Lake-E DMI3 Registers (rev 04) 00:04.0 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 00:04.1 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 00:04.2 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 00:04.3 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 00:04.4 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 00:04.5 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 00:04.6 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 00:04.7 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 00:05.0 System peripheral: Intel Corporation Sky Lake-E MM/Vt-d Configuration Registers (rev 04) 00:05.2 System peripheral: Intel Corporation Sky Lake-E RAS (rev 04) 00:05.4 PIC: Intel Corporation Sky Lake-E IOAPIC (rev 04) 00:08.0 System peripheral: Intel Corporation Sky Lake-E Ubox Registers (rev 04) 00:08.1 Performance counters: Intel Corporation Sky Lake-E Ubox Registers (rev 04) 00:08.2 System peripheral: Intel Corporation Sky Lake-E Ubox Registers (rev 04) 00:11.0 Unassigned class [ff00]: Intel Corporation C620 Series Chipset Family MROM 0 (rev 09) 00:11.1 Unassigned class [ff00]: Intel Corporation C620 Series Chipset Family MROM 1 (rev 09) 00:11.5 SATA controller: Intel Corporation C620 Series Chipset Family SSATA Controller [AHCI mode] (rev 09) 00:14.0 USB controller: Intel Corporation C620 Series Chipset Family USB 3.0 xHCI Controller (rev 09) 00:14.2 Signal processing controller: Intel Corporation C620 Series Chipset Family Thermal Subsystem (rev 09) 00:16.0 Communication controller: Intel Corporation C620 Series Chipset Family MEI Controller #1 (rev 09) 00:16.1 Communication controller: Intel Corporation C620 Series Chipset Family MEI Controller #2 (rev 09) 00:16.4 Communication controller: Intel Corporation C620 Series Chipset Family MEI Controller #3 (rev 09) 00:17.0 SATA controller: Intel Corporation C620 Series Chipset Family SATA Controller [AHCI mode] (rev 09) 00:1c.0 PCI bridge: Intel Corporation C620 Series Chipset Family PCI Express Root Port #1 (rev f9) 00:1c.4 PCI bridge: Intel Corporation C620 Series Chipset Family PCI Express Root Port #5 (rev f9) 00:1c.5 PCI bridge: Intel Corporation C620 Series Chipset Family PCI Express Root Port #6 (rev f9) 00:1f.0 ISA bridge: Intel Corporation C622 Series Chipset LPC/eSPI Controller (rev 09) 00:1f.2 Memory controller: Intel Corporation C620 Series Chipset Family Power Management Controller (rev 09) 00:1f.4 SMBus: Intel Corporation C620 Series Chipset Family SMBus (rev 09) 00:1f.5 Serial bus controller [0c80]: Intel Corporation C620 Series Chipset Family SPI Controller (rev 09) 02:00.0 VGA compatible controller: Huawei Technologies Co., Ltd. Hi1710 [iBMC Intelligent Management system chip w/VGA support] (rev 01) 03:00.0 Signal processing controller: Huawei Technologies Co., Ltd. iBMA Virtual Network Adapter (rev 01) 17:00.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port A (rev 04) 17:02.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port C (rev 04) 17:05.0 System peripheral: Intel Corporation Sky Lake-E VT-d (rev 04) 17:05.2 System peripheral: Intel Corporation Sky Lake-E RAS Configuration Registers (rev 04) 17:05.4 PIC: Intel Corporation Sky Lake-E IOxAPIC Configuration Registers (rev 04) 17:08.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:08.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:08.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:08.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:08.4 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:08.5 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:08.6 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:08.7 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:09.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:09.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:09.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:09.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:09.4 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:09.5 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:09.6 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:09.7 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0a.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0a.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0a.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0a.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0a.4 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0a.5 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0a.6 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0a.7 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0b.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0b.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0b.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0b.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0e.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0e.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0e.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0e.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0e.4 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0e.5 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0e.6 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0e.7 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0f.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0f.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0f.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0f.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0f.4 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0f.5 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0f.6 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:0f.7 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:10.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:10.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:10.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:10.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:10.4 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:10.5 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:10.6 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:10.7 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:11.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:11.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:11.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:11.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:1d.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:1d.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:1d.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:1d.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 17:1e.0 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 17:1e.1 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 17:1e.2 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 17:1e.3 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 17:1e.4 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 17:1e.5 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 17:1e.6 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 18:00.0 PCI bridge: Intel Corporation Device 37c0 (rev 09) 19:03.0 PCI bridge: Intel Corporation Device 37c5 (rev 09) 1a:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09) 1a:00.1 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09) 1a:00.2 Ethernet controller: Intel Corporation Ethernet Connection X722 for 1GbE (rev 09) 1a:00.3 Ethernet controller: Intel Corporation Ethernet Connection X722 for 1GbE (rev 09) 1c:00.0 RAID bus controller: Broadcom / LSI MegaRAID SAS-3 3108 [Invader] (rev 02) 3a:05.0 System peripheral: Intel Corporation Sky Lake-E VT-d (rev 04) 3a:05.2 System peripheral: Intel Corporation Sky Lake-E RAS Configuration Registers (rev 04) 3a:05.4 PIC: Intel Corporation Sky Lake-E IOxAPIC Configuration Registers (rev 04) 3a:08.0 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) 3a:09.0 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) 3a:0a.0 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) 3a:0a.1 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) 3a:0a.2 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) 3a:0a.3 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) 3a:0a.4 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) 3a:0a.5 System peripheral: Intel Corporation Sky Lake-E LM Channel 1 (rev 04) 3a:0a.6 System peripheral: Intel Corporation Sky Lake-E LMS Channel 1 (rev 04) 3a:0a.7 System peripheral: Intel Corporation Sky Lake-E LMDP Channel 1 (rev 04) 3a:0b.0 System peripheral: Intel Corporation Sky Lake-E DECS Channel 2 (rev 04) 3a:0b.1 System peripheral: Intel Corporation Sky Lake-E LM Channel 2 (rev 04) 3a:0b.2 System peripheral: Intel Corporation Sky Lake-E LMS Channel 2 (rev 04) 3a:0b.3 System peripheral: Intel Corporation Sky Lake-E LMDP Channel 2 (rev 04) 3a:0c.0 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) 3a:0c.1 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) 3a:0c.2 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) 3a:0c.3 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) 3a:0c.4 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) 3a:0c.5 System peripheral: Intel Corporation Sky Lake-E LM Channel 1 (rev 04) 3a:0c.6 System peripheral: Intel Corporation Sky Lake-E LMS Channel 1 (rev 04) 3a:0c.7 System peripheral: Intel Corporation Sky Lake-E LMDP Channel 1 (rev 04) 3a:0d.0 System peripheral: Intel Corporation Sky Lake-E DECS Channel 2 (rev 04) 3a:0d.1 System peripheral: Intel Corporation Sky Lake-E LM Channel 2 (rev 04) 3a:0d.2 System peripheral: Intel Corporation Sky Lake-E LMS Channel 2 (rev 04) 3a:0d.3 System peripheral: Intel Corporation Sky Lake-E LMDP Channel 2 (rev 04) 5d:02.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port C (rev 04) 5d:03.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port D (rev 04) 5d:05.0 System peripheral: Intel Corporation Sky Lake-E VT-d (rev 04) 5d:05.2 System peripheral: Intel Corporation Sky Lake-E RAS Configuration Registers (rev 04) 5d:05.4 PIC: Intel Corporation Sky Lake-E IOxAPIC Configuration Registers (rev 04) 5d:0e.0 Performance counters: Intel Corporation Sky Lake-E KTI 0 (rev 04) 5d:0e.1 System peripheral: Intel Corporation Sky Lake-E UPI Registers (rev 04) 5d:0f.0 Performance counters: Intel Corporation Sky Lake-E KTI 0 (rev 04) 5d:0f.1 System peripheral: Intel Corporation Sky Lake-E UPI Registers (rev 04) 5d:10.0 Performance counters: Intel Corporation Sky Lake-E KTI 0 (rev 04) 5d:10.1 System peripheral: Intel Corporation Sky Lake-E UPI Registers (rev 04) 5d:12.0 Performance counters: Intel Corporation Sky Lake-E M3KTI Registers (rev 04) 5d:12.1 Performance counters: Intel Corporation Sky Lake-E M3KTI Registers (rev 04) 5d:12.2 System peripheral: Intel Corporation Sky Lake-E M3KTI Registers (rev 04) 5d:12.4 Performance counters: Intel Corporation Sky Lake-E M3KTI Registers (rev 04) 5d:12.5 Performance counters: Intel Corporation Sky Lake-E M3KTI Registers (rev 04) 5d:15.0 System peripheral: Intel Corporation Sky Lake-E M2PCI Registers (rev 04) 5d:16.0 System peripheral: Intel Corporation Sky Lake-E M2PCI Registers (rev 04) 5d:16.4 System peripheral: Intel Corporation Sky Lake-E M2PCI Registers (rev 04) 5d:17.0 System peripheral: Intel Corporation Sky Lake-E M2PCI Registers (rev 04) 80:04.0 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 80:04.1 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 80:04.2 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 80:04.3 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 80:04.4 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 80:04.5 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 80:04.6 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 80:04.7 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04) 80:05.0 System peripheral: Intel Corporation Sky Lake-E MM/Vt-d Configuration Registers (rev 04) 80:05.2 System peripheral: Intel Corporation Sky Lake-E RAS (rev 04) 80:05.4 PIC: Intel Corporation Sky Lake-E IOAPIC (rev 04) 80:08.0 System peripheral: Intel Corporation Sky Lake-E Ubox Registers (rev 04) 80:08.1 Performance counters: Intel Corporation Sky Lake-E Ubox Registers (rev 04) 80:08.2 System peripheral: Intel Corporation Sky Lake-E Ubox Registers (rev 04) 85:00.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port A (rev 04) 85:05.0 System peripheral: Intel Corporation Sky Lake-E VT-d (rev 04) 85:05.2 System peripheral: Intel Corporation Sky Lake-E RAS Configuration Registers (rev 04) 85:05.4 PIC: Intel Corporation Sky Lake-E IOxAPIC Configuration Registers (rev 04) 85:08.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:08.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:08.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:08.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:08.4 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:08.5 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:08.6 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:08.7 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:09.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:09.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:09.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:09.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:09.4 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:09.5 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:09.6 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:09.7 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0a.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0a.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0a.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0a.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0a.4 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0a.5 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0a.6 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0a.7 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0b.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0b.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0b.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0b.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0e.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0e.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0e.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0e.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0e.4 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0e.5 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0e.6 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0e.7 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0f.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0f.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0f.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0f.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0f.4 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0f.5 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0f.6 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:0f.7 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:10.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:10.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:10.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:10.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:10.4 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:10.5 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:10.6 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:10.7 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:11.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:11.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:11.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:11.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:1d.0 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:1d.1 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:1d.2 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:1d.3 System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04) 85:1e.0 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 85:1e.1 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 85:1e.2 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 85:1e.3 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 85:1e.4 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 85:1e.5 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 85:1e.6 System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04) 86:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01) 86:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01) ae:02.0 PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port C (rev 04) ae:05.0 System peripheral: Intel Corporation Sky Lake-E VT-d (rev 04) ae:05.2 System peripheral: Intel Corporation Sky Lake-E RAS Configuration Registers (rev 04) ae:05.4 PIC: Intel Corporation Sky Lake-E IOxAPIC Configuration Registers (rev 04) ae:08.0 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) ae:09.0 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) ae:0a.0 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) ae:0a.1 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) ae:0a.2 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) ae:0a.3 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) ae:0a.4 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) ae:0a.5 System peripheral: Intel Corporation Sky Lake-E LM Channel 1 (rev 04) ae:0a.6 System peripheral: Intel Corporation Sky Lake-E LMS Channel 1 (rev 04) ae:0a.7 System peripheral: Intel Corporation Sky Lake-E LMDP Channel 1 (rev 04) ae:0b.0 System peripheral: Intel Corporation Sky Lake-E DECS Channel 2 (rev 04) ae:0b.1 System peripheral: Intel Corporation Sky Lake-E LM Channel 2 (rev 04) ae:0b.2 System peripheral: Intel Corporation Sky Lake-E LMS Channel 2 (rev 04) ae:0b.3 System peripheral: Intel Corporation Sky Lake-E LMDP Channel 2 (rev 04) ae:0c.0 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) ae:0c.1 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) ae:0c.2 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) ae:0c.3 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) ae:0c.4 System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller (rev 04) ae:0c.5 System peripheral: Intel Corporation Sky Lake-E LM Channel 1 (rev 04) ae:0c.6 System peripheral: Intel Corporation Sky Lake-E LMS Channel 1 (rev 04) ae:0c.7 System peripheral: Intel Corporation Sky Lake-E LMDP Channel 1 (rev 04) ae:0d.0 System peripheral: Intel Corporation Sky Lake-E DECS Channel 2 (rev 04) ae:0d.1 System peripheral: Intel Corporation Sky Lake-E LM Channel 2 (rev 04) ae:0d.2 System peripheral: Intel Corporation Sky Lake-E LMS Channel 2 (rev 04) ae:0d.3 System peripheral: Intel Corporation Sky Lake-E LMDP Channel 2 (rev 04) af:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01) af:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01) d7:05.0 System peripheral: Intel Corporation Sky Lake-E VT-d (rev 04) d7:05.2 System peripheral: Intel Corporation Sky Lake-E RAS Configuration Registers (rev 04) d7:05.4 PIC: Intel Corporation Sky Lake-E IOxAPIC Configuration Registers (rev 04) d7:0e.0 Performance counters: Intel Corporation Sky Lake-E KTI 0 (rev 04) d7:0e.1 System peripheral: Intel Corporation Sky Lake-E UPI Registers (rev 04) d7:0f.0 Performance counters: Intel Corporation Sky Lake-E KTI 0 (rev 04) d7:0f.1 System peripheral: Intel Corporation Sky Lake-E UPI Registers (rev 04) d7:10.0 Performance counters: Intel Corporation Sky Lake-E KTI 0 (rev 04) d7:10.1 System peripheral: Intel Corporation Sky Lake-E UPI Registers (rev 04) d7:12.0 Performance counters: Intel Corporation Sky Lake-E M3KTI Registers (rev 04) d7:12.1 Performance counters: Intel Corporation Sky Lake-E M3KTI Registers (rev 04) d7:12.2 System peripheral: Intel Corporation Sky Lake-E M3KTI Registers (rev 04) d7:12.4 Performance counters: Intel Corporation Sky Lake-E M3KTI Registers (rev 04) d7:12.5 Performance counters: Intel Corporation Sky Lake-E M3KTI Registers (rev 04) d7:15.0 System peripheral: Intel Corporation Sky Lake-E M2PCI Registers (rev 04) d7:16.0 System peripheral: Intel Corporation Sky Lake-E M2PCI Registers (rev 04) d7:16.4 System peripheral: Intel Corporation Sky Lake-E M2PCI Registers (rev 04) d7:17.0 System peripheral: Intel Corporation Sky Lake-E M2PCI Registers (rev 04)

vieyahn2017 commented 1 month ago

https://blog.csdn.net/juS3Ve/article/details/93426669 原来PCIe这么简单,一定要看!

PCIe协议支持256个Bus, 每条Bus最多支持32个Device,每个Device最多支持8个Function, 所以由BDF(Bus,device,function)构成了每个PCIe设备节点的身份证号。

里面有 lspci -v 的字段解释框图 还有 lspci -v -t

我们可以通过lspci –v -t命令来查询系统上电阶段扫描到的PCIe设备,执行结果会以一个树的形式列出系统中所有的pcie设备。

还有 下面以NVMe命令下发为例简单描述PCIe设备的memory访问。

vieyahn2017 commented 1 month ago

PCI有三个相互独立的物理地址空间:设备存储器地址空间、I/O地址空间和配置空间。配置空间是PCI所特有的一个物理空间。由于PCI支持设备即插即用,所以PCI设备不占用固定的内存地址空间或I/O地址空间,而是由操作系统决定其映射的基址。

PCI总线规范定义的配置空间总长度为256个字节,配置信息按一定的顺序和大小依次存放。前64个字节的配置空间称为配置头,对于所有的设备都一样,配置头的主要功能是用来识别设备、定义主机访问PCI卡的方式(I/O访问或者存储器访问,还有中断信息)。其余的192个字节称为本地配置空间,主要定义卡上局部总线的特性、本地空间基地址及范围等。

vieyahn2017 commented 1 month ago

参考1

PCI配置空间简介

https://blog.csdn.net/chenliujiang1989/article/details/8567182

一、PCI配置空间 PCI设备有三个空间——内存地址空间、IO地址空间和配置空间。由于PCI支持即插即用, 所以PCI设备不是占用固定的内存地址空间或I/O地址空间,而是可以由操作系统决定其映射的基址。 怎么配置呢?这就是配置空间的作用。

DW | Byte3 | Byte2 | Byte1 | Byte0 | Addr
---+---------------------------------------------------------+-----
0 | Device ID | Vendor ID | 00
---+---------------------------------------------------------+-----
1 | Status | Command | 04
---+---------------------------------------------------------+-----
2 | Class Code | Revision ID | 08
---+---------------------------------------------------------+-----
3 | BIST | Header Type | Latency Timer | Cache Line | 0C
---+---------------------------------------------------------+-----
4 | Base Address 0 | 10
---+---------------------------------------------------------+-----
5 | Base Address 1 | 14
---+---------------------------------------------------------+-----
6 | Base Address 2 | 18
---+---------------------------------------------------------+-----
7 | Base Address 3 | 1C
---+---------------------------------------------------------+-----
8 | Base Address 4 | 20
---+---------------------------------------------------------+-----
9 | Base Address 5 | 24
---+---------------------------------------------------------+-----
10 | CardBus CIS pointer | 28
---+---------------------------------------------------------+-----
11 | Subsystem Device ID | Subsystem Vendor ID | 2C
---+---------------------------------------------------------+-----
12 | Expansion ROM Base Address | 30
---+---------------------------------------------------------+-----
13 | Reserved(Capability List) | 34
---+---------------------------------------------------------+-----
14 | Reserved | 38
---+---------------------------------------------------------+-----
15 | Max_Lat | Min_Gnt | IRQ Pin | IRQ Line | 3C
-------------------------------------------------------------------

配置空间中最重要的有: Vendor ID:厂商ID。知名的设备厂商的ID。FFFFh是一个非法厂商ID,可它来判断PCI设备是否存在。 Device ID:设备ID。某厂商生产的设备的ID。操作系统就是凭着 Vendor ID和Device ID 找到对应驱动程序的。 Class Code:类代码。共三字节,分别是 类代码、子类代码、编程接口。类代码不仅用于区分设备类型,还是编程接口的规范,这就是为什么会有通用驱动程序。 IRQ Line:IRQ编号。PC机以前是靠两片8259芯片来管理16个硬件中断。现在为了支持对称多处理器,有了APIC(高级可编程中断控制器),它支持管理24个中断。 IRQ Pin:中断引脚。PCI有4个中断引脚,该寄存器表明该设备连接的是哪个引脚。关于配置空间的详细说明请参考《PCI Local Bus Specification》的第六章。

vieyahn2017 commented 1 month ago

参考2 https://blog.csdn.net/yhb1047818384/article/details/106676528

PCIe学习笔记之pcie结构和配置空间

1.PCI标准配置空间头(0 ~ 64 bytes)PCI标准配置空间分type0和type1两种。 type0主要是针对PCI的endpoint设备,type1主要是针对PCI bridge, switch。 https://img-blog.csdnimg.cn/20200617200452873.png#pic_center