public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
To: edk2-devel@lists.01.org
Subject: Using PcdSet32S for gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
Date: Thu, 15 Mar 2018 18:12:48 -0700	[thread overview]
Message-ID: <b9ffdc19d2687e9b0af34fe922eedf48@mail.gmail.com> (raw)

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|UINT32|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


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

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

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=b9ffdc19d2687e9b0af34fe922eedf48@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