Add platform name (#1540)
* Generate platform build name definition Same code could be shared by different platforms. At same time, some platform might need do minor change to the shared code. In order to support this case, this patch updated the build tool to generate a macro definition for current build platform name in a header file. so the shared code could have platform specific code change with this macro definition. e.g. add "#define #define PLATFORM_ADLS 1" for ADLS. Signed-off-by: Guo Dong <guo.dong@intel.com> * [ADLS] update FspsUpdUpdateLib could be shared by different platform, use ADLS macro definition instead of PcdAdlLpSupport for ADLS specific change. Signed-off-by: Guo Dong <guo.dong@intel.com>
This commit is contained in:
parent
cee9341f6b
commit
977450bae8
|
@ -535,7 +535,7 @@ def gen_flash_map_bin (flash_map_file, comp_list):
|
|||
def copy_expanded_file (src, dst):
|
||||
gen_cfg_data ("GENDLT", src, dst)
|
||||
|
||||
def gen_config_file (fv_dir, brd_name_override, brd_name, platform_id, pri_key, cfg_db_size, cfg_size, cfg_int, cfg_ext, sign_scheme, hash_type, svn):
|
||||
def gen_config_file (fv_dir, brd_name_override, brd_name, platform_id, pri_key, cfg_db_size, cfg_size, cfg_int, cfg_ext, sign_scheme, hash_type, svn, brd_build_name):
|
||||
# Remove previous generated files
|
||||
for file in glob.glob(os.path.join(fv_dir, "CfgData*.*")):
|
||||
os.remove(file)
|
||||
|
@ -575,6 +575,21 @@ def gen_config_file (fv_dir, brd_name_override, brd_name, platform_id, pri_key,
|
|||
gen_cfg_data ("GENHDR", cfg_pkl_file, ';'.join([cfg_hdr_file, cfg_com_hdr_file]))
|
||||
gen_cfg_data ("GENBIN", cfg_pkl_file, cfg_bin_file)
|
||||
|
||||
# Update cfg_hdr_file to add a new #define for platform name
|
||||
if brd_build_name != "":
|
||||
with open(cfg_hdr_file, "r") as in_file:
|
||||
lines = in_file.readlines()
|
||||
|
||||
with open(cfg_hdr_file, "w") as out_file:
|
||||
line_added = False
|
||||
for line in lines:
|
||||
out_file.write (line)
|
||||
if not line_added:
|
||||
match = re.match('^#define ', line)
|
||||
if match:
|
||||
out_file.write ("\n#define PLATFORM_%s 1" % brd_build_name.upper())
|
||||
line_added = True
|
||||
|
||||
cfg_base_file = None
|
||||
for cfg_file_list in [cfg_int, cfg_ext]:
|
||||
if cfg_file_list is cfg_int:
|
||||
|
|
|
@ -1249,7 +1249,7 @@ class Build(object):
|
|||
gen_config_file (self._fv_dir, board_override_name, self._board.BOARD_PKG_NAME, self._board._PLATFORM_ID,
|
||||
self._board._CFGDATA_PRIVATE_KEY, self._board.CFG_DATABASE_SIZE, self._board.CFGDATA_SIZE,
|
||||
self._board._CFGDATA_INT_FILE, self._board._CFGDATA_EXT_FILE,
|
||||
self._board._SIGNING_SCHEME, HASH_VAL_STRING[self._board.SIGN_HASH_TYPE], svn)
|
||||
self._board._SIGNING_SCHEME, HASH_VAL_STRING[self._board.SIGN_HASH_TYPE], svn, self._board.BOARD_NAME)
|
||||
|
||||
# rebuild reset vector
|
||||
vtf_dir = os.path.join('BootloaderCorePkg', 'Stage1A', 'Ia32', 'Vtf0')
|
||||
|
|
|
@ -390,7 +390,7 @@ TccModePostMemConfig (
|
|||
|
||||
if (IsPchS ()) {
|
||||
FspsUpd->FspsConfig.TccMode = 1;
|
||||
#if FixedPcdGetBool(PcdAdlLpSupport) == 0
|
||||
#ifdef PLATFORM_ADLS
|
||||
FspsUpd->FspsConfig.L2QosEnumerationEn = 1;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue