Linux PCI Bus Subsystem
简介
本文介绍下linux pci总线子系统知识及相关文档,PCIe总线已发展了好几代,从PCIe 1.0 2.5GT/s、PCIe 2.0 5GT/s、PCIe 3.0 8GT/s 、PCIe 4.0 16GT/s、PCIe 5.0 32GT/s, 速率是越来越快,已广泛应用于计算、网络、存储、显卡、安全等各个领域。熟悉linux pci子系统对底层软件非常重要的,本文重点介绍linux中pci子系统的知识。
PCIe软件架构介绍

- PCI/PCIe Hardware

- ACPI PCI/ARCH PCI driver
主要位于drivers/acpi/pci*.c 如pci_root.c
arch pci driver架构相关的pci代码,arm64: arch/arm64/kernel/pci.c
- PCI subsystem driver
代码位于drivers/pci目录, 提供pci枚举,资源分配,初始化功能,并为设备提供pci通用接口。
- PCIe port bus/PCIe port driver
此部分代码位于drivers/pci/pcie目录,提供PCIe高级功能服务,如Hotplug、AER、 DPC、 PME等功能。
- PCIe device driver
这部分主要是PCIe设备驱动,如PCIe 网卡设备( drivers/net/ethernet/),
PCIe NVME存储设备(drivers/nvme)等
PCI子系统文档介绍
PCI子系统文档结合上述PCI软件架构的介绍,能够助力上手PCI子系统知识学习
- 如何写一个linux PCI drviers
主要介绍了pci drviers结构, pci_register_driver注册流程,如何获取pci设备接口,
pci设备初始化流程,配置访问等。
1. How To Write Linux PCI Drivers
1.1. Structure of PCI drivers
1.2. pci_register_driver() call
1.3. How to find PCI devices manually
1.4. Device Initialization Steps
1.5. PCI device shutdown
1.6. How to access PCI config space
1.7. Other interesting functions
1.8. Miscellaneous hints
1.9. Vendor and device identifications
1.10. Obsolete functions
1.11. MMIO Space and “Write Posting”
- PCIe port bus驱动指导
2. The PCI Express Port Bus Driver Guide HOWTO
2.1. About this guide
2.2. What is the PCI Express Port Bus Driver
2.3. Why use the PCI Express Port Bus Driver?
2.4. Configuring the PCI Express Port Bus Driver vs. Service Drivers
2.5. Possible Resource Conflicts
- PCIe I/O虚拟化
针对PCIe虚拟化,主要涉及PCIe SR-IOV知识
3. PCI Express I/O Virtualization Howto
3.1. Overview
3.2. User Guide
3.3. Developer Guide
- PCIe MSI中断
这部分主要涉及MSI中断知识点,并指导pci设备如何使用MSI中断申请接口。
4. The MSI Driver Guide HOWTO
4.1. About this guide
4.2. What are MSIs?
4.3. Why use MSIs?
4.4. How to use MSIs
4.5. MSI quirks
- PCI sysfs文件
这部分涉及PCI sysfs文件接口,提供了remove,rescan,reset,resource等等文件提供给用户使用
5. Accessing PCI device resources through sysfs
5.1. Accessing legacy resources through sysfs
5.2. Supporting PCI access on new platforms
- PCI ACPI
PCI ACPI知识点及注意事项介绍
6. ACPI considerations for PCI host bridges
- PCI错误恢复
7. PCI Error Recovery
7.1. Detailed Design
- PCIe AER
PCIe 高级错误处理
8. The PCI Express Advanced Error Reporting Driver Guide HOWTO
8.1. Overview
8.2. User Guide
8.3. Developer Guide
8.4. Software error injection
- PCIe EP模式框架处理
9. PCI Endpoint Framework
9.1. Introduction
9.2. PCI Endpoint Core
9.3. Configuring PCI Endpoint Using CONFIGFS
9.4. PCI Test Function
9.5. PCI Test User Guide
9.6. PCI NTB Function
9.7. PCI Non-Transparent Bridge (NTB) Endpoint Function (EPF) User Guide
9.8. PCI Test Endpoint Function
9.9. PCI NTB Endpoint Function
- Boot Interrupts
10. Boot Interrupts
10.1. Overview
10.2. Issue
10.3. Conditions
10.4. Affected Chipsets
10.5. Mitigations
10.6. More Documentation
小结
linux pci子系统是linux重要基础子系统之一,如何掌握pci子系统知识,需要理解掌握PCIe 规范, linux pci 文档以及pci代码实现。本文对pci子系统做一个整体的概述,提供下学习指引。
相关推荐
-
nginx检查提示“unknown directive "stream" in /etc/*/nginx.conf”
nginx检查提示“unknown directive "stream" in /etc/*/nginx.conf”2025-02-26 00:38:21 -
php之多级目录下查找文件中是否含有某个字符串功能实现2025-02-26 00:36:35
-
mysql 启动不了1067错误如何解决?2025-02-26 00:33:31
-
MySQL简单INSERT超慢原因排查2025-02-26 00:22:42
-
mysql分布式数据库的主要构架是什么?2025-02-26 00:06:23