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.115; helo=mga14.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 5524122631461 for ; Thu, 15 Mar 2018 18:09:33 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2018 18:15:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,313,1517904000"; d="scan'208";a="28363695" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 15 Mar 2018 18:15:57 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 15 Mar 2018 18:15:57 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 15 Mar 2018 18:15:57 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.226]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.235]) with mapi id 14.03.0319.002; Fri, 16 Mar 2018 09:15:53 +0800 From: "Gao, Liming" To: Vladimir Olovyannikov , "edk2-devel@lists.01.org" Thread-Topic: [edk2] Using PcdSet32S for gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize Thread-Index: AdO8w+PMp2F7NoS+SSaY0/bCnEzojQAAC1Rg Date: Fri, 16 Mar 2018 01:15:53 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1E78A2@SHSMSX104.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: Using PcdSet32S for gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 01:09:33 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable You need to configure PCD in [PcdsDynamicDefault.common.DEFAULT] of platfor= m DSC file, and remove it from platform FDF file.=20 You can refer to Nt32Pkg\Nt32Pkg.dsc, it configure gEfiMdeModulePkgTokenSpa= ceGuid.PcdFlashNvStorageVariableBase as Dynamic, and set it at boot time.=20 Thanks Liming > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Vl= adimir Olovyannikov > Sent: Friday, March 16, 2018 9:13 AM > To: edk2-devel@lists.01.org > Subject: [edk2] Using PcdSet32S for gEfiMdeModulePkgTokenSpaceGuid.PcdFla= shNvStorageVariableSize >=20 > Hi, >=20 > I would like to overwrite > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize > From an Fvb runtime driver. > For that purpose I try to do it like this: > PcdStatus =3D PcdSet32S(PcdFlashNvStorageVariableBase, > (UINT32)(UINTN)Instance->VariableBase); >=20 > My .inf file for the driver contains > [Packages] > MdePkg/MdePkg.dec > MdeModulePkg/MdeModulePkg.dec > MyTestPlatformPkg/MytestPlatformPkg.dec >=20 > and > [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize >=20 > When I build the image, I am getting > /uefi/MdePkg/Include/Library/PcdLib.h:630:45: error: implicit declaration= of > function `_PCD_SET_MODE_32_S_PcdFlashNvStorageVariableBase` > [-Werror=3Dimplicit-function-declaration] > #define PcdSet32S(TokenName, Value) _PCD_SET_MODE_32_S_##TokenNam= e > ((Value)) > ^ > /uefi/BroadcomPlatformPkg/Drivers/FvbDxe/FvbImpl.c:1090:19: note: in > expansion of macro `PcdSet32S` > PcdStatus =3D PcdSet32S(PcdFlashNvStorageVariableBase, > (UINT32)(UINTN)Instance->VariableBase); > ^~~~~~~~~ > in Autogen.h for the driver: > extern const UINT32 _gPcd_FixedAtBuild_PcdFlashNvStorageVariableBase; > #define _PCD_GET_MODE_SIZE_PcdFlashNvStorageVariableBase > _PCD_SIZE_PcdFlashNvStorageVariableBase > //#define _PCD_SET_MODE_32_PcdFlashNvStorageVariableBase ASSERT(FALSE) = // > It is not allowed to set value for a FIXED_AT_BUILD PCD >=20 > Similarly there are no definitions for other Pcds for PcdSet32 (for insta= nce > PcdFlashNvStorageFtwWorkingBase); > they are all set as "FixedAtBuild". >=20 > I can see the PcdFlashNvStorageVariableBase is declared in MdeModulePkg a= s > [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] > ... > ## Base address of the NV variable range in flash device. > # @Prompt Base address of flash NV variable range. > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x0|UINT32= |0x30000001 >=20 > Why is it set as "FixedAtBuild", and how can I change it to be writable? > I can see that some platforms (for instance, OvmfPkg) overwrite these > variables via PcdSet32S/PcdSet64S. >=20 > What am I missing here? >=20 > Thank you, > Vladimir > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel