PCI & PCIE Configuration Register Space

本文详细解析了PCI标准下的配置地址格式及其使用方法。包括传统PCI配置空间中的位定义及作用,PCI Express增强型配置地址的构成,以及PCI Express配置寄存器空间的访问方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、PCI-Compatible Configuration
bits [1:0] are hard-wired, read-only and must return zeros when read.
bits [7:2] identify the target dword
bits [10:8] identify the target function number (1-of-8) within the target device.
bits [15:11] identify the target device number (1-of-32).
bits [23:16] identifies the target bus number (1-of-256).
bits [30:24] are reserved and must be zero.
bit 31 must be set to a one, enabling the translation of a subsequent processor IO access to the Configuration Data Port into a configuration access. If bit 31 is zero and the processor initiates an IO read from or IO write to the Configuration Data Port, the transaction is treated as an IO transaction request.

 

2、PCI Express Enhanced Configuration
Address bits 63:28 indicates the 256MB-aligned base address of the overall Enhanced Configuration address range.
Address bits 27:20 select the target bus (1-of-256).
Address bits 19:15 select the target device (1-of-32) on the bus.
Address bits 14:12 select the target function (1-of-8) within the device.
Address bits 11:2 selects the target dword (1-of-1024) within the selected function's configuration space.
Address bits 1:0 define the start byte location within the selected dword.

 

3、PCIE Configuration Register Space访问方式

memory-mapped physical address = PCI Express* Config Space Base Address Bus Number * 100000h Device Number * 8000h Function Number * 1000h Register Offset.
其中PCI Express* Config Space Base Address 保存在某一PCI Device Register中,查看對應CPU EDS 中的 MMCFG_Rule,獲得此PCI Device 并從相應offset讀取PCI Express* Config Space Base Address.
PS:其中0--FF部份既可用上述方法訪問,也可通過I/O Map(cf8、cfc端口) 訪問。

转载:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值