diff options
author | Liming Gao <liming.gao@intel.com> | 2017-12-19 16:26:16 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2017-12-25 11:05:54 +0800 |
commit | 8ac167890f2a8ef4918586e7e94190c52d59a4cc (patch) | |
tree | 230bea616f2c0f9357417f6cb172a190e2bfc639 /BaseTools/Source/Python/AutoGen | |
parent | a09395932d997d41f59ae3ee2f7f77f91f5caa02 (diff) | |
download | edk2-8ac167890f2a8ef4918586e7e94190c52d59a4cc.tar.gz edk2-8ac167890f2a8ef4918586e7e94190c52d59a4cc.tar.bz2 edk2-8ac167890f2a8ef4918586e7e94190c52d59a4cc.zip |
BaseTools: Fix VPD data optimization issue
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/AutoGen')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 67de17320b..cacd00922b 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1401,7 +1401,7 @@ class PlatformAutoGen(AutoGen): if os.path.exists(VpdMapFilePath):
OrgVpdFile.Read(VpdMapFilePath)
PcdItems = OrgVpdFile.GetOffset(PcdNvStoreDfBuffer[0])
- NvStoreOffset = PcdItems[0].strip() if PcdItems else '0'
+ NvStoreOffset = PcdItems.values()[0].strip() if PcdItems else '0'
else:
EdkLogger.error("build", FILE_READ_FAILURE, "Can not find VPD map file %s to fix up VPD offset." % VpdMapFilePath)
@@ -1665,6 +1665,14 @@ class PlatformAutoGen(AutoGen): PcdKey in VpdPcdDict:
Pcd = VpdPcdDict[PcdKey]
SkuValueMap = {}
+ DefaultSku = Pcd.SkuInfoList.get('DEFAULT')
+ if DefaultSku:
+ PcdValue = DefaultSku.DefaultValue
+ if PcdValue not in SkuValueMap:
+ SkuValueMap[PcdValue] = []
+ VpdFile.Add(Pcd, 'DEFAULT',DefaultSku.VpdOffset)
+ SkuValueMap[PcdValue].append(DefaultSku)
+
for (SkuName,Sku) in Pcd.SkuInfoList.items():
Sku.VpdOffset = Sku.VpdOffset.strip()
PcdValue = Sku.DefaultValue
@@ -1691,7 +1699,7 @@ class PlatformAutoGen(AutoGen): EdkLogger.error("build", FORMAT_INVALID, 'The offset value of PCD %s.%s should be %s-byte aligned.' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Alignment))
if PcdValue not in SkuValueMap:
SkuValueMap[PcdValue] = []
- VpdFile.Add(Pcd, Sku.VpdOffset)
+ VpdFile.Add(Pcd, SkuName,Sku.VpdOffset)
SkuValueMap[PcdValue].append(Sku)
# if the offset of a VPD is *, then it need to be fixed up by third party tool.
if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":
@@ -1720,6 +1728,13 @@ class PlatformAutoGen(AutoGen): if not FoundFlag :
# just pick the a value to determine whether is unicode string type
SkuValueMap = {}
+ DefaultSku = DscPcdEntry.SkuInfoList.get('DEFAULT')
+ if DefaultSku:
+ PcdValue = DefaultSku.DefaultValue
+ if PcdValue not in SkuValueMap:
+ SkuValueMap[PcdValue] = []
+ VpdFile.Add(DscPcdEntry, 'DEFAULT',Sku.VpdOffset)
+ SkuValueMap[PcdValue].append(Sku)
for (SkuName,Sku) in DscPcdEntry.SkuInfoList.items():
Sku.VpdOffset = Sku.VpdOffset.strip()
@@ -1770,7 +1785,7 @@ class PlatformAutoGen(AutoGen): EdkLogger.error("build", FORMAT_INVALID, 'The offset value of PCD %s.%s should be %s-byte aligned.' % (DscPcdEntry.TokenSpaceGuidCName, DscPcdEntry.TokenCName, Alignment))
if PcdValue not in SkuValueMap:
SkuValueMap[PcdValue] = []
- VpdFile.Add(DscPcdEntry, Sku.VpdOffset)
+ VpdFile.Add(DscPcdEntry, SkuName,Sku.VpdOffset)
SkuValueMap[PcdValue].append(Sku)
if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":
NeedProcessVpdMapFile = True
|