BIOS Architecture 学习笔记07 - Accessing PCIe Config Registers

Type 0: End Point

Type 1: Virtual Devices

Legacy PCI: 每个Funciton包括256 Byte空间

PCI3e: 每个Funciton包括4K Byte空间

首先需要写3:2:5:40(Bus number = 3; Device number = 2; Function number = 5,Register = 40 )到0xCF8

从0xCFC读取数据

寄存器256 Byte = 2^8 B,对应bit 0 ~ bit 7

Device + Function,对应下一个Byte:32x Device + 8x Function,对应bit 8 ~ bit15

Bus Number(256),对应下一个Byte: bit16 ~ bit23

余下的8bit,bit31置1,bit30 ~ bit24 置0

对于3:2:5:40, Register = 40

Device Number = 2 = 010b

Function = 5 = 101b

Device + Function = 00010101 高位补0 = 15

Bust Number = 3 = 02

高位 bit31 ~ bit24 = 80

因此,整个配置空间 = 80031540

从0xCFC读数据

MOV DX

猜你喜欢

转载自blog.csdn.net/f2157120/article/details/107288718