MdeModulePkg PCD: Add DynamicEx PcdVpdBaseAddress64 for non SPI platform
https://bugzilla.tianocore.org/show_bug.cgi?id=1356 Current PcdVpdBaseAddress is 32bit static Pcd. NON SPI platform needs to configure it as Dynamic PCD. Emulator platform (such as NT32) may set its value to 64bit address. To meet with this usage, 64bit DynamicEx PcdVpdBaseAddress64 is introduced. If its value is not zero, it will be used. If its value is zero, static PcdVpdBaseAddress will be used. When NON SPI platform enables VPD PCD, they need to set PcdVpdBaseAddress64. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Dandan Bi <dandan.bi@intel.com>
This commit is contained in:
@@ -109,6 +109,7 @@ EFI_GET_PCD_INFO_PROTOCOL mEfiGetPcdInfoInstance = {
|
||||
};
|
||||
|
||||
EFI_HANDLE mPcdHandle = NULL;
|
||||
UINTN mVpdBaseAddress = 0;
|
||||
|
||||
/**
|
||||
Main entry for PCD DXE driver.
|
||||
@@ -175,6 +176,21 @@ PcdDxeInit (
|
||||
&Registration
|
||||
);
|
||||
|
||||
//
|
||||
// Cache VpdBaseAddress in entry point for the following usage.
|
||||
//
|
||||
|
||||
//
|
||||
// PcdVpdBaseAddress64 is DynamicEx PCD only. So, DxePcdGet64Ex() is used to get its value.
|
||||
//
|
||||
mVpdBaseAddress = (UINTN) DxePcdGet64Ex (&gEfiMdeModulePkgTokenSpaceGuid, PcdToken (PcdVpdBaseAddress64));
|
||||
if (mVpdBaseAddress == 0) {
|
||||
//
|
||||
// PcdVpdBaseAddress64 is not set, get value from PcdVpdBaseAddress.
|
||||
//
|
||||
mVpdBaseAddress = (UINTN) PcdGet32 (PcdVpdBaseAddress);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@@ -73,7 +73,7 @@
|
||||
#
|
||||
# c) OEM specificed storage area:
|
||||
# - The PCD value is stored in OEM specified area which base address is
|
||||
# specified by a FixedAtBuild PCD setting - PcdVpdBaseAddress.
|
||||
# specified by PCD setting - PcdVpdBaseAddress64 or PcdVpdBaseAddress.
|
||||
# - The area is read only for PEI and DXE phase.
|
||||
# - [PcdsDynamicVpd] is used as section name for this type PCD in platform
|
||||
# DSC file. [PcdsDynamicExVpd] is for dynamicex type PCD.
|
||||
@@ -344,6 +344,7 @@
|
||||
|
||||
[Pcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress ## SOMETIMES_CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress64 ## SOMETIMES_CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSetNvStoreDefaultId ## SOMETIMES_CONSUMES
|
||||
|
||||
[Depex]
|
||||
|
@@ -435,7 +435,8 @@ GetWorker (
|
||||
switch (LocalTokenNumber & PCD_TYPE_ALL_SET) {
|
||||
case PCD_TYPE_VPD:
|
||||
VpdHead = (VPD_HEAD *) ((UINT8 *) PcdDb + Offset);
|
||||
RetPtr = (VOID *) ((UINTN) PcdGet32 (PcdVpdBaseAddress) + VpdHead->Offset);
|
||||
ASSERT (mVpdBaseAddress != 0);
|
||||
RetPtr = (VOID *) (mVpdBaseAddress + VpdHead->Offset);
|
||||
|
||||
break;
|
||||
|
||||
|
@@ -48,6 +48,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#error "Please make sure the version of PCD DXE Service and the generated PCD DXE Database match."
|
||||
#endif
|
||||
|
||||
extern UINTN mVpdBaseAddress;
|
||||
|
||||
/**
|
||||
Retrieve additional information associated with a PCD token in the default token space.
|
||||
|
||||
|
Reference in New Issue
Block a user