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:
Liming Gao
2018-11-22 22:10:29 +08:00
parent 277a3958d9
commit 534efca06f
8 changed files with 54 additions and 4 deletions

View File

@ -861,6 +861,7 @@ GetWorker (
UINT32 LocalTokenNumber;
UINT32 LocalTokenCount;
UINT8 *VaraiableDefaultBuffer;
UINTN VpdBaseAddress;
//
// TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER.
@ -889,7 +890,19 @@ GetWorker (
{
VPD_HEAD *VpdHead;
VpdHead = (VPD_HEAD *) ((UINT8 *)PeiPcdDb + Offset);
return (VOID *) ((UINTN) PcdGet32 (PcdVpdBaseAddress) + VpdHead->Offset);
//
// PcdVpdBaseAddress64 is DynamicEx PCD only. So, PeiPcdGet64Ex() is used to get its value.
//
VpdBaseAddress = (UINTN) PeiPcdGet64Ex (&gEfiMdeModulePkgTokenSpaceGuid, PcdToken (PcdVpdBaseAddress64));
if (VpdBaseAddress == 0) {
//
// PcdVpdBaseAddress64 is not set, get value from PcdVpdBaseAddress.
//
VpdBaseAddress = (UINTN) PcdGet32 (PcdVpdBaseAddress);
}
ASSERT (VpdBaseAddress != 0);
return (VOID *)(VpdBaseAddress + VpdHead->Offset);
}
case PCD_TYPE_HII|PCD_TYPE_STRING: