BaseTools/Build: Add all support skuid to the Pcd DB system skuid table

Update PcdDataBase System SkuIdTable. The system SkuId Table should have all the platform supported skuid.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Bob Feng" <bob.c.feng@intel.com>
Reviewed-by: "Chen, Hesheng" <hesheng.chen@intel.com>
Reviewed-by: "Liu, Yingke D" <yingke.d.liu@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17159 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Bob Feng 2015-04-10 07:06:13 +00:00 committed by bobfeng
parent 82a6a9605c
commit 1ae469b9ed
3 changed files with 25 additions and 6 deletions

View File

@ -1046,7 +1046,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
} }
SkuObj = SkuClass(Platform.Platform.SkuName,Platform.Platform.SkuIds) SkuObj = SkuClass(Platform.Platform.AvilableSkuIds, Platform.Platform.SkuIds)
Dict['SYSTEM_SKU_ID_VALUE'] = Platform.Platform.SkuIds[SkuObj.SystemSkuId] Dict['SYSTEM_SKU_ID_VALUE'] = Platform.Platform.SkuIds[SkuObj.SystemSkuId]
Dict['PCD_INFO_FLAG'] = Platform.Platform.PcdInfoFlag Dict['PCD_INFO_FLAG'] = Platform.Platform.PcdInfoFlag
@ -1592,6 +1592,9 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
if NumberOfSkuEnabledPcd != 0: if NumberOfSkuEnabledPcd != 0:
Dict['SKU_HEAD_SIZE'] = str(NumberOfSkuEnabledPcd) + 'U' Dict['SKU_HEAD_SIZE'] = str(NumberOfSkuEnabledPcd) + 'U'
for AvailableSkuNumber in SkuObj.SkuIdNumberSet:
if AvailableSkuNumber not in Dict['SKUID_VALUE']:
Dict['SKUID_VALUE'].append(AvailableSkuNumber)
Dict['SKUID_VALUE'][0] = len(Dict['SKUID_VALUE']) - 1 Dict['SKUID_VALUE'][0] = len(Dict['SKUID_VALUE']) - 1
AutoGenH.Append(gPcdDatabaseAutoGenH.Replace(Dict)) AutoGenH.Append(gPcdDatabaseAutoGenH.Replace(Dict))

View File

@ -1955,17 +1955,26 @@ class SkuClass():
self.AvailableSkuIds = sdict() self.AvailableSkuIds = sdict()
self.SkuIdSet = [] self.SkuIdSet = []
self.SkuIdNumberSet = []
if SkuIdentifier == '' or SkuIdentifier is None: if SkuIdentifier == '' or SkuIdentifier is None:
self.SkuIdSet = ['DEFAULT'] self.SkuIdSet = ['DEFAULT']
self.SkuIdNumberSet = ['0U']
elif SkuIdentifier == 'ALL': elif SkuIdentifier == 'ALL':
self.SkuIdSet = SkuIds.keys() self.SkuIdSet = SkuIds.keys()
self.SkuIdNumberSet = [num.strip() + 'U' for num in SkuIds.values()]
else: else:
r = SkuIdentifier.split('|') r = SkuIdentifier.split('|')
self.SkuIdSet=[r[k].strip() for k in range(len(r))] self.SkuIdSet=[r[k].strip() for k in range(len(r))]
k = None
try:
self.SkuIdNumberSet = [SkuIds[k].strip() + 'U' for k in self.SkuIdSet]
except Exception:
EdkLogger.error("build", PARAMETER_INVALID,
ExtraData = "SKU-ID [%s] is not supported by the platform. [Valid SKU-ID: %s]"
% (k, " ".join(SkuIds.keys())))
if len(self.SkuIdSet) == 2 and 'DEFAULT' in self.SkuIdSet and SkuIdentifier != 'ALL': if len(self.SkuIdSet) == 2 and 'DEFAULT' in self.SkuIdSet and SkuIdentifier != 'ALL':
self.SkuIdSet.remove('DEFAULT') self.SkuIdSet.remove('DEFAULT')
self.SkuIdNumberSet.remove('0U')
for each in self.SkuIdSet: for each in self.SkuIdSet:
if each in SkuIds: if each in SkuIds:
self.AvailableSkuIds[each] = SkuIds[each] self.AvailableSkuIds[each] = SkuIds[each]
@ -1992,11 +2001,12 @@ class SkuClass():
return self.SkuIdSet[0] return self.SkuIdSet[0]
else: else:
return 'DEFAULT' return 'DEFAULT'
def __GetAvailableSkuIdNumber(self):
return self.SkuIdNumberSet
SystemSkuId = property(__GetSystemSkuID) SystemSkuId = property(__GetSystemSkuID)
AvailableSkuIdSet = property(__GetAvailableSkuIds) AvailableSkuIdSet = property(__GetAvailableSkuIds)
SkuUsageType = property(__SkuUsageType) SkuUsageType = property(__SkuUsageType)
AvailableSkuIdNumSet = property(__GetAvailableSkuIdNumber)
## ##
# #
# This acts like the main() function for the script, unless it is 'import'ed into another # This acts like the main() function for the script, unless it is 'import'ed into another

View File

@ -132,6 +132,7 @@ class DscBuildData(PlatformBuildClassObject):
self._BuildTargets = None self._BuildTargets = None
self._SkuName = None self._SkuName = None
self._SkuIdentifier = None self._SkuIdentifier = None
self._AvilableSkuIds = None
self._PcdInfoFlag = None self._PcdInfoFlag = None
self._VarCheckFlag = None self._VarCheckFlag = None
self._FlashDefinition = None self._FlashDefinition = None
@ -232,6 +233,7 @@ class DscBuildData(PlatformBuildClassObject):
if self._SkuName == None: if self._SkuName == None:
self._SkuName = Record[2] self._SkuName = Record[2]
self._SkuIdentifier = Record[2] self._SkuIdentifier = Record[2]
self._AvilableSkuIds = Record[2]
elif Name == TAB_DSC_DEFINES_PCD_INFO_GENERATION: elif Name == TAB_DSC_DEFINES_PCD_INFO_GENERATION:
self._PcdInfoFlag = Record[2] self._PcdInfoFlag = Record[2]
elif Name == TAB_DSC_DEFINES_PCD_VAR_CHECK_GENERATION: elif Name == TAB_DSC_DEFINES_PCD_VAR_CHECK_GENERATION:
@ -362,7 +364,10 @@ class DscBuildData(PlatformBuildClassObject):
return True return True
else: else:
return False return False
def _GetAviableSkuIds(self):
if self._AvilableSkuIds:
return self._AvilableSkuIds
return self.SkuIdentifier
def _GetSkuIdentifier(self): def _GetSkuIdentifier(self):
if self._SkuName: if self._SkuName:
return self._SkuName return self._SkuName
@ -1177,6 +1182,7 @@ class DscBuildData(PlatformBuildClassObject):
BuildTargets = property(_GetBuildTarget) BuildTargets = property(_GetBuildTarget)
SkuName = property(_GetSkuName, _SetSkuName) SkuName = property(_GetSkuName, _SetSkuName)
SkuIdentifier = property(_GetSkuIdentifier) SkuIdentifier = property(_GetSkuIdentifier)
AvilableSkuIds = property(_GetAviableSkuIds)
PcdInfoFlag = property(_GetPcdInfoFlag) PcdInfoFlag = property(_GetPcdInfoFlag)
VarCheckFlag = property(_GetVarCheckFlag) VarCheckFlag = property(_GetVarCheckFlag)
FlashDefinition = property(_GetFdfFile) FlashDefinition = property(_GetFdfFile)