Please see the code below which follows 1 b) in Lazlo's detailed email
suggestion of a few days ago. The code is not seeing Bus 1. It's only seeing
Bus 0.Does this have something to do with passing gEfiPciIoProtocolGuid into
LocateHandleBuffer ?I noticed that there is also gEfiLegacyBiosGuid and
gEfiSimpleTextInProtocolGuid(in perusing "LegacyPci.c").
The PCI device in question is a proprietary Intel chip. I checked with the
design team and these registersare definitely visible to UEFI drivers. So I'm
wondering why the code is not seeing Bus 1. Any suggestions ?
EFI_PCI_IO_PROTOCOL *PciIo; EFI_STATUS Status = EFI_SUCCESS; UINTN
HandleCount; EFI_HANDLE *HandleBuffer; UINTN Index, Segment, Bus, Device,
Function; UINT64 Value;
Status = gBS->LocateHandleBuffer ( ByProtocol,
&gEfiPciIoProtocolGuid, NULL,
&HandleCount, &HandleBuffer );
if (EFI_ERROR (Status)) { Print(L"ERROR Status after
gBS->LocateHandleBuffer: %r\n", Status); return PTU_FAILURE; } for
(Index = 0; Index < HandleCount; Index++) { Status = gBS->HandleProtocol
( HandleBuffer[Index],
&gEfiPciIoProtocolGuid, (VOID **) &PciIo
);
if (EFI_ERROR (Status)) { continue; }
Status = PciIo->GetLocation(PciIo, &Segment, &Bus, &Device, &Function);
Print(L"Index = %d, Segment = %d, Bus = %d, Device = %d, Function %d, Status =
%r\n", Index, Segment, Bus, Device, Function, Status); if (Status ==
EFI_SUCCESS) { if ((Bus == 1) && (Device == 29) && (Function ==
0)) { Print(L"Congrats BFD Found !\n");
for (OffsetIdx = 0; OffsetIdx < 8; OffsetIdx++) {
Status = PciIo->Pci.Read( PciIo,
EfiPciIoWidthUint64, Slice0DramRuleOffset[OffsetIdx],
1, &Value );
if (Status == EFI_SUCCESS) {
Print(L"PciIo->Pci.Read SUCCESS for Offset: 0X%x Value: 0X%x\n",
Slice0DramRuleOffset[OffsetIdx], Value); }
}//for OffsetIdx
}//if BFD matches }//if EFI_SUCCESS }//for HandleCount
Shubha D. [email protected]
[email protected]
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel