diff options
author | Liming Gao <liming.gao@intel.com> | 2018-11-22 22:10:29 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-11-27 11:29:21 +0800 |
commit | 534efca06f029433f07edc49e68d9c474902648d (patch) | |
tree | 73c170409e32c73ed5533a09768161517fd68223 /MdeModulePkg/Universal/PCD/Dxe/Pcd.c | |
parent | 277a3958d93ab8cc70ccfa29766fb711322bbd92 (diff) | |
download | edk2-534efca06f029433f07edc49e68d9c474902648d.zip edk2-534efca06f029433f07edc49e68d9c474902648d.tar.gz edk2-534efca06f029433f07edc49e68d9c474902648d.tar.bz2 |
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>
Diffstat (limited to 'MdeModulePkg/Universal/PCD/Dxe/Pcd.c')
-rw-r--r-- | MdeModulePkg/Universal/PCD/Dxe/Pcd.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c index f977c7f..4e38a38 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c @@ -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;
}
|