[edk2-devel] Read SPI BAR offset 0x10 throwing processor exception

Michael Brown mcb30 at ipxe.org
Fri Jan 28 12:59:24 UTC 2022


On 28/01/2022 12:47, Rao G wrote:
> Attempting to Read SPIBAR 0x10 from BUS 0 Dev 1F Func 5
> 
>  >>
> ScSpiBar0 = MmioRead32 (SpiInstance->PchSpiBase + 
> PCI_BASE_ADDRESSREG_OFFSET) & 0xFFFFF000;
>  >>
> 
> The above code is throwing exception
> 
> PchSpiBase at 0xC00FD000
> !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID - 00000000 !!!!
> ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
> RIP  - 00000000771903D0, CS  - 0000000000000038, RFLAGS - 0000000000010046
> 
>  From the shell the value at offset 0x10 is 0xFE010000
> 
> Any clues on why the processor is throwing exception while accessing the 
> value PchSpiBase+0x10 ?

PCI_BASE_ADDRESSREG_OFFSET is an offset within PCI configuration space. 
  It looks as though you are trying to use an MMIO access to read from 
PCI configuration space, which is not a valid thing to do.

I suspect you may want to use EFI_PCI_IO_PROTOCOL.Pci.Read() instead.

HTH,

Michael


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#86160): https://edk2.groups.io/g/devel/message/86160
Mute This Topic: https://groups.io/mt/88743518/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list