From 626bece451db2e2a19fa7696889ad4d4c441b16e Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Fri, 22 Dec 2017 20:19:20 +0800 Subject: 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 Reviewed-by: Liming Gao --- BaseTools/Source/Python/Common/VpdInfoFile.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'BaseTools/Source/Python/Common/VpdInfoFile.py') 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 # -- cgit v1.2.3