public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
To: "Gao, Liming" <liming.gao@intel.com>, edk2-devel@lists.01.org
Subject: Re: Using PcdSet32S for gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
Date: Thu, 15 Mar 2018 18:25:18 -0700	[thread overview]
Message-ID: <c7001bdfe85b595482a360b6e9803d26@mail.gmail.com> (raw)
In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1E78A2@SHSMSX104.ccr.corp.intel.com>

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


      reply	other threads:[~2018-03-16  1:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16  1:12 Using PcdSet32S for gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize Vladimir Olovyannikov
2018-03-16  1:15 ` Gao, Liming
2018-03-16  1:25   ` Vladimir Olovyannikov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c7001bdfe85b595482a360b6e9803d26@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox