From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::22c; helo=mail-io0-x22c.google.com; envelope-from=vladimir.olovyannikov@broadcom.com; receiver=edk2-devel@lists.01.org Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 38A8E22631461 for ; Thu, 15 Mar 2018 18:18:55 -0700 (PDT) Received: by mail-io0-x22c.google.com with SMTP id g14so1907164iob.13 for ; Thu, 15 Mar 2018 18:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to; bh=yORTp58Wdaa5+BaW/4jeNTyANkWKUHeLG+/GTs6GyMI=; b=bKF5bqIgVlqYb40w25EkF7kUfktEHFjU5W/4mcaSDrwpt+cEJ69SbQwHxGdpwIFMM4 dD8vQ1YoVejNh80MCftgKxBqH/vZdqB7x7q559Bbx/I8L+RlBUAGeqYn4Xuj0XQa9KiZ ZQPfY/MxIrTt06JhsbXAbQXGJYvb3bxdXi4RE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to; bh=yORTp58Wdaa5+BaW/4jeNTyANkWKUHeLG+/GTs6GyMI=; b=aiqe7AxgW0WTWWM3hdYtGra0EpZUT0knqv+wvOQ4FcZ05Wu8+n4b/d8+cPq73vkk/k fED8xz+0Gbw7kZO3aCGWpCqFhKuRz1mRKtn+fgQemuL59FxQkxuvKAQZ0T6hEuyqxc8N qX9gbwvl9epY8MXSTzYJncL1CqWTnBTA/1spg3CBjaKs07GTAUheHpKwEwg27sjfGnQV bWQt/B3Tr2vrVpp8BkC8XWsZKWF3wJMXrf05mGXlr+9mqUDhVKajYxKAgr1Qo9dtkeG0 5Sza6vCtqAzA1dIORe7ITH2g30PVS7sa+TeHTRJF7h385x0vvIIjmaaln7mUHPI7Oxq7 RgKg== X-Gm-Message-State: AElRT7G4YZ7tD/bXfgYno0L52wii5Z9+Z7GDRc2VqXBC1dyoGEx4yAsG XPxwwCCww5kzy42zZz5X3x6i2b9NvwlLumzmxiU7Mg== X-Google-Smtp-Source: AG47ELuDsrykZ8p5HS4I66pbqc2FsBrRkd8yBNzuRd1Xske70JUgm5xu/vzHADx2GbxushcFZWjw4ltgfke20ZEDwBU= X-Received: by 10.107.20.131 with SMTP id 125mr11657469iou.239.1521163519432; Thu, 15 Mar 2018 18:25:19 -0700 (PDT) From: Vladimir Olovyannikov References: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1E78A2@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1E78A2@SHSMSX104.ccr.corp.intel.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQF36tN8OeqtCs4fTt6UTc8YvwpS1gHqiAMHpHphJJA= Date: Thu, 15 Mar 2018 18:25:18 -0700 Message-ID: To: "Gao, Liming" , edk2-devel@lists.01.org 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:18:56 -0000 Content-Type: text/plain; charset="UTF-8" Thanks a lot Liming, This works. Vladimir -----Original Message----- From: Gao, Liming [mailto:liming.gao@intel.com] Sent: Thursday, March 15, 2018 6:16 PM To: Vladimir Olovyannikov; edk2-devel@lists.01.org Subject: RE: [edk2] Using PcdSet32S for gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize You need to configure PCD in [PcdsDynamicDefault.common.DEFAULT] of platform DSC file, and remove it from platform FDF file. You can refer to Nt32Pkg\Nt32Pkg.dsc, it configure gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase as Dynamic, and set it at boot time. Thanks Liming > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Vladimir Olovyannikov > Sent: Friday, March 16, 2018 9:13 AM > To: edk2-devel@lists.01.org > Subject: [edk2] Using PcdSet32S for > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize > > Hi, > > I would like to overwrite > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize > From an Fvb runtime driver. > For that purpose I try to do it like this: > PcdStatus = PcdSet32S(PcdFlashNvStorageVariableBase, > (UINT32)(UINTN)Instance->VariableBase); > > My .inf file for the driver contains > [Packages] > MdePkg/MdePkg.dec > MdeModulePkg/MdeModulePkg.dec > MyTestPlatformPkg/MytestPlatformPkg.dec > > and > [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize > > 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=implicit-function-declaration] > #define PcdSet32S(TokenName, Value) _PCD_SET_MODE_32_S_##TokenName > ((Value)) > ^ > /uefi/BroadcomPlatformPkg/Drivers/FvbDxe/FvbImpl.c:1090:19: note: in > expansion of macro `PcdSet32S` > PcdStatus = 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 > > Similarly there are no definitions for other Pcds for PcdSet32 (for > instance PcdFlashNvStorageFtwWorkingBase); they are all set as > "FixedAtBuild". > > I can see the PcdFlashNvStorageVariableBase is declared in > MdeModulePkg as [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|UINT3 > 2|0x30000001 > > 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. > > What am I missing here? > > Thank you, > Vladimir > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel