GlobalData.gFdfParser = Fdf\r
GlobalData.gAutoGenPhase = False\r
PcdSet = Fdf.Profile.PcdDict\r
+ FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName]\r
+ for FdRegion in FdDict.RegionList:\r
+ if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):\r
+ if int(FdRegion.Offset) % 8 != 0:\r
+ EdkLogger.error("build", FORMAT_INVALID, 'The VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset))\r
ModuleList = Fdf.Profile.InfList\r
self.FdfProfile = Fdf.Profile\r
for fvname in self.FvTargetList:\r
Pcd = VpdPcdDict[PcdKey]\r
for (SkuName,Sku) in Pcd.SkuInfoList.items():\r
Sku.VpdOffset = Sku.VpdOffset.strip()\r
+ PcdValue = Sku.DefaultValue\r
+ if PcdValue == "":\r
+ PcdValue = Pcd.DefaultValue\r
+ if Sku.VpdOffset != '*':\r
+ if PcdValue.startswith("{"):\r
+ Alignment = 8\r
+ elif PcdValue.startswith("L"):\r
+ Alignment = 2\r
+ else:\r
+ Alignment = 1\r
+ if int(Sku.VpdOffset) % Alignment != 0:\r
+ EdkLogger.error("build", FORMAT_INVALID, 'The offset value of PCD %s.%s should be %s-byte aligned.' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Alignment))\r
VpdFile.Add(Pcd, Sku.VpdOffset)\r
# if the offset of a VPD is *, then it need to be fixed up by third party tool.\r
if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":\r
# Sku = DscPcdEntry.SkuInfoList[DscPcdEntry.SkuInfoList.keys()[0]]\r
Sku.VpdOffset = Sku.VpdOffset.strip()\r
PcdValue = Sku.DefaultValue\r
+ if PcdValue == "":\r
+ PcdValue = DscPcdEntry.DefaultValue\r
+ if Sku.VpdOffset != '*':\r
+ if PcdValue.startswith("{"):\r
+ Alignment = 8\r
+ elif PcdValue.startswith("L"):\r
+ Alignment = 2\r
+ else:\r
+ Alignment = 1\r
+ if int(Sku.VpdOffset) % Alignment != 0:\r
+ EdkLogger.error("build", FORMAT_INVALID, 'The offset value of PCD %s.%s should be %s-byte aligned.' % (DscPcdEntry.TokenSpaceGuidCName, DscPcdEntry.TokenCName, Alignment))\r
VpdFile.Add(DscPcdEntry, Sku.VpdOffset)\r
if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":\r
NeedProcessVpdMapFile = True \r