diff options
author | Liming Gao <liming.gao@intel.com> | 2017-12-22 20:19:20 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2017-12-25 11:05:50 +0800 |
commit | 626bece451db2e2a19fa7696889ad4d4c441b16e (patch) | |
tree | a7901f30dd6d8a7df7357a46e65723da457e825e /BaseTools/Source/Python/Common/VpdInfoFile.py | |
parent | 7e6e459a3d91c07db1f97258aec323a982375e19 (diff) | |
download | edk2-626bece451db2e2a19fa7696889ad4d4c441b16e.tar.gz edk2-626bece451db2e2a19fa7696889ad4d4c441b16e.tar.bz2 edk2-626bece451db2e2a19fa7696889ad4d4c441b16e.zip |
BaseTools: Optimize VPD PCD value for the different SKUs
If VPD PCD value is same in the different SKUs, the different SKUs will
save the same offset for this PCD in VPD region. That means there is only
one PCD value copy in VPD region to save VPD space.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Common/VpdInfoFile.py')
-rw-r--r-- | BaseTools/Source/Python/Common/VpdInfoFile.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py b/BaseTools/Source/Python/Common/VpdInfoFile.py index 56161efe6a..130d5c7e0c 100644 --- a/BaseTools/Source/Python/Common/VpdInfoFile.py +++ b/BaseTools/Source/Python/Common/VpdInfoFile.py @@ -79,6 +79,7 @@ class VpdInfoFile: # @see BuildClassObject.PcdClassObject
# Value : offset in different SKU such as [sku1_offset, sku2_offset]
self._VpdArray = {}
+ self._VpdInfo = {}
## Add a VPD PCD collected from platform's autogen when building.
#
@@ -179,6 +180,9 @@ class VpdInfoFile: Found = False
+ if (TokenSpaceName, PcdTokenName) not in self._VpdInfo:
+ self._VpdInfo[(TokenSpaceName, PcdTokenName)] = []
+ self._VpdInfo[(TokenSpaceName, PcdTokenName)].append((SkuId,Offset, Value))
for VpdObject in self._VpdArray.keys():
VpdObjectTokenCName = VpdObject.TokenCName
for PcdItem in GlobalData.MixedPcd:
@@ -217,6 +221,8 @@ class VpdInfoFile: return None
return self._VpdArray[vpd]
+ def GetVpdInfo(self,(PcdTokenName,TokenSpaceName)):
+ return self._VpdInfo.get((TokenSpaceName, PcdTokenName))
## Call external BPDG tool to process VPD file
#
|