public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Using PcdSet32S for gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
@ 2018-03-16  1:12 Vladimir Olovyannikov
  2018-03-16  1:15 ` Gao, Liming
  0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Olovyannikov @ 2018-03-16  1:12 UTC (permalink / raw)
  To: edk2-devel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-16  1:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox