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:c0b::22f; helo=mail-it0-x22f.google.com; envelope-from=vladimir.olovyannikov@broadcom.com; receiver=edk2-devel@lists.01.org Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (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 ECBCA223FCF5B for ; Thu, 15 Mar 2018 18:06:26 -0700 (PDT) Received: by mail-it0-x22f.google.com with SMTP id z143-v6so523307itc.0 for ; Thu, 15 Mar 2018 18:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:mime-version:thread-index:date:message-id:subject:to; bh=10/Kt9pX+DCZVpXrzIY8Fg5674Hk7PGy57CNOh3ALMA=; b=HZxcK4zeQpmyWOesRQu4+Vbu2kKztXvL/Sk34BP6gRU3to3rUPb6s8w5zVgdqrU4HT o511yPW4joJZ+0Alj29D67bUGClGrs5kBsSGxzzd724JL0Bu/R4Vrkn89wRbY4kGSmsu ObjNN/SQkrS9yv54bVU201iigrt/ZotprZiQM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:thread-index:date:message-id :subject:to; bh=10/Kt9pX+DCZVpXrzIY8Fg5674Hk7PGy57CNOh3ALMA=; b=VAvu3Zk/MHLaWKV3GdDyT+FnvKKES8QBDLS2ShVKQLQb10StgYZihbptcocNOMkmwu xz7KWVNCOglUuByCY/y5LPwIcQVVM4lFE8eL8bx7zxu1F3FQfmptOD9k0DMWGIcoIPVR /9L0s3k8kmsskB//NFTXNovzpH/ivRdfjQNH3ilUNp7QrNRlhBV+6rTcBEQa1FVpJbph a5fn+sI2/4xco+5nCOVLPa7yriWycyg2wukYc481ZVJLHG5n6kSdSrRd+wQoKvNP2yXl pj+DhIExPyayAIxgR06sOJZ+pvoUezqhDUgMSlRk5IaXcAYvn7p+Dcnv0OLBkkGD7oyC abcA== X-Gm-Message-State: AElRT7FtwyU6EW8W36Ous8AKb8qukcy0ZMvUj+gJdCq6iVAhDZXCJAIV MoRwz+2QNixRegCjOaTszuiuiyY7VD1RGSYKKdAjvg== X-Google-Smtp-Source: AG47ELtE7edRK5yDfdWtTDVL2toD4Q1YLxzI7TrEfNz7PVku7i7XSlgbzbHtdOSnUWiO+QxSsiYr5oha1sW8xwiWtfY= X-Received: by 2002:a24:7143:: with SMTP id n64-v6mr331472itc.4.1521162769541; Thu, 15 Mar 2018 18:12:49 -0700 (PDT) From: Vladimir Olovyannikov MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdO8w+PMp2F7NoS+SSaY0/bCnEzojQ== Date: Thu, 15 Mar 2018 18:12:48 -0700 Message-ID: To: edk2-devel@lists.01.org Subject: 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:06:27 -0000 Content-Type: text/plain; charset="UTF-8" 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