From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C93B0211BA45F for ; Thu, 24 Jan 2019 21:05:06 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jan 2019 21:05:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,519,1539673200"; d="scan'208";a="294272546" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga005.jf.intel.com with ESMTP; 24 Jan 2019 21:05:05 -0800 From: "Feng, Bob C" To: edk2-devel@lists.01.org Cc: Zhijux Fan , Bob Feng , Liming Gao Date: Fri, 25 Jan 2019 12:56:09 +0800 Message-Id: <20190125045626.14700-17-bob.c.feng@intel.com> X-Mailer: git-send-email 2.20.1.windows.1 In-Reply-To: <20190125045626.14700-1-bob.c.feng@intel.com> References: <20190125045626.14700-1-bob.c.feng@intel.com> MIME-Version: 1.0 Subject: [Patch 16/33] BaseTools:Fv BaseAddress must set If it not set X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 05:05:07 -0000 Content-Transfer-Encoding: 8bit From: Zhijux Fan If ForceRebase is not set, and FV is specified in FD region, it should have FvBaseAddress Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/GenFds/FvImageSection.py | 2 ++ BaseTools/Source/Python/GenFds/GenFds.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/BaseTools/Source/Python/GenFds/FvImageSection.py b/BaseTools/Source/Python/GenFds/FvImageSection.py index d6e1f3315b..7f277ddef2 100644 --- a/BaseTools/Source/Python/GenFds/FvImageSection.py +++ b/BaseTools/Source/Python/GenFds/FvImageSection.py @@ -101,10 +101,12 @@ class FvImageSection(FvImageSectionClassObject): if self.FvName is not None: Buffer = BytesIO('') Fv = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(self.FvName) if Fv is not None: self.Fv = Fv + if not self.FvAddr and self.Fv.BaseAddress: + self.FvAddr = self.Fv.BaseAddress FvFileName = Fv.AddToBuffer(Buffer, self.FvAddr, MacroDict = Dict, Flag=IsMakefile) if Fv.FvAlignment is not None: if self.Alignment is None: self.Alignment = Fv.FvAlignment else: diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py index ae5d7fd26d..f1ce527f88 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -360,10 +360,12 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None): for RegionObj in FdObj.RegionList: if RegionObj.RegionType != BINARY_FILE_TYPE_FV: continue for RegionData in RegionObj.RegionDataList: if FvObj.UiFvName.upper() == RegionData.upper(): + if not FvObj.BaseAddress: + FvObj.BaseAddress = '0x%x' % (int(FdObj.BaseAddress, 0) + RegionObj.Offset) if FvObj.FvRegionInFD: if FvObj.FvRegionInFD != RegionObj.Size: EdkLogger.error("GenFds", FORMAT_INVALID, "The FV %s's region is specified in multiple FD with different value." %FvObj.UiFvName) else: FvObj.FvRegionInFD = RegionObj.Size @@ -674,20 +676,23 @@ class GenFds(object): GuidXRefFile = BytesIO('') PkgGuidDict = {} GuidDict = {} ModuleList = [] FileGuidList = [] + VariableGuidSet = set() for Arch in ArchList: PlatformDataBase = BuildDb.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] PkgList = GenFdsGlobalVariable.WorkSpace.GetPackageList(GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag) for P in PkgList: PkgGuidDict.update(P.Guids) for Name, Guid in PlatformDataBase.Pcds: Pcd = PlatformDataBase.Pcds[Name, Guid] if Pcd.Type in [TAB_PCDS_DYNAMIC_HII, TAB_PCDS_DYNAMIC_EX_HII]: for SkuId in Pcd.SkuInfoList: Sku = Pcd.SkuInfoList[SkuId] + if Sku.VariableGuid in VariableGuidSet:continue + VariableGuidSet.add(Sku.VariableGuid) if Sku.VariableGuid and Sku.VariableGuid in PkgGuidDict.keys(): GuidDict[Sku.VariableGuid] = PkgGuidDict[Sku.VariableGuid] for ModuleFile in PlatformDataBase.Modules: Module = BuildDb.BuildObject[ModuleFile, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] if Module in ModuleList: -- 2.20.1.windows.1