回复: [edk2-devel] [PATCH v3 7/8] MdeModulePkg/Pci MdePkg: Create service to retrieve PCI base addresses


gaoliming
 

-----邮件原件-----
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Gerd
Hoffmann
发送时间: 2022年1月28日 18:53
收件人: devel@edk2.groups.io; ncoleon@amazon.com
抄送: atugup@amazon.com; Alexander Graf <graf@amazon.de>
主题: Re: [edk2-devel] [PATCH v3 7/8] MdeModulePkg/Pci MdePkg: Create
service to retrieve PCI base addresses

Hi,

--- a/MdePkg/Include/Protocol/PciHostBridgeResourceAllocation.h
+++ b/MdePkg/Include/Protocol/PciHostBridgeResourceAllocation.h
@@ -367,6 +367,33 @@ EFI_STATUS
IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE
Phase
);

+/**
+ Retrieves the base addresses of ost bridge resources.
+
+ @param This The pointer to the
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance.
+ @param RootBridgeHandle The PCI root bridge handle.
+ @param IoBase The pointer to PIO aperture base
address.
+ @param Mem32Base The pointer to 32-bit aperture base
address.
+ @param PMem32Base The pointer to 32-bit prefetchable
aperture base address.
+ @param Mem64Base The pointer to 64-bit aperture base
address.
+ @param PMem64Base The pointer to 64-bit prefetchable
aperture base address.
+
+ @retval EFI_SUCCESS Succeed.
+ @retval EFI_NOT_FOUND Root bridge was not found.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI
*EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_RESOU
RCES_BASES)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE
RootBridgeHandle,
+ OUT UINT64
*IoBase,
+ OUT UINT64
*Mem32Base,
+ OUT UINT64
*PMem32Base,
+ OUT UINT64
*Mem64Base,
+ OUT UINT64
*PMem64Base
+ );
+
///
/// Provides the basic interfaces to abstract a PCI host bridge
resource
allocation.
///
@@ -415,6 +442,12 @@ struct
_EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL {
/// before enumeration.
///
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_
CONTROLLER PreprocessController;
+
+ ///
+ /// Returns the aligned base addresses of the different resource
windows
+ /// of the host bridge. Intended for use before resources are
submitted.
+ ///
+
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_RESOUR
CES_BASES GetResourcesBases;
};
Hmm, not sure the protocol can be changed like that without risking
breakage, the uefi protocols are the binary interface between uefi
modules ...
This protocol is defined in PI spec. Its change needs to get UEFI org
approve.
If this service is required, one new protocol can be added into MdeModulePkg
as
edk2 implementation protocol.

Thanks
Liming
take care,
Gerd