Browse Source

Vlv2TbltDevicePkg: Convert use of FCE tool to Structured PCD

Update this platform to not use the FCE tool to init the
platform setup variable with default values from HII forms.
Instead, use a Structured PCD with field default values
extracted from the HII.  The default value for the Structured
PCD is stored in the VPD region of the FLASH, so it is always
available.  The platform setup variable is set to the value
from the VPD region if the variable does not exist or is the
wrong size.

This change also removes the need for Linux/GCC binary files
use to initialize the NV store.

* Update PlatformSetupoDxe VFR to declare the platform setup
  structure as an efivarstore instead of varstore.
* Update PlatformSetupDxe to return EFI_UNSUPPORTED from the
  HII_CONFIG_ACCESS_PROTOCOL RouteConfig() and ExtractConfig()
  services.
* Fix a use after free issue in PlatformSetupDxe that could
  store a random value into the "OsSelection" when the Load
  Default and Exit setup menu item is used.
* Add PlatformSetupDefault.dsc file that contains the default
  values for all setup questions.
* Update DSC files to declare VPD_TOOL_GUID which is required
  to generate the binary file used to populate the VPD region
* Update DSC files to declare Default Stores for both STANDARD
  and MANUFACTURING mode.  Only STANDARD mode is used right now.
* Update FDF files to add a VPD region
* Update GCC FDF file to initialize the NvStorageVariable regions
  the same as the non GCC FDF file.
* Update DEC file with platform setup Structured PCD called PcdSetup
  that is associated with the SYSTEM_CONFIGURATION C structure.
* Update PlatformEarlyInit module to detect if the platform setup
  variable exists or is corrupt.  If it does not exist or is corrupt,
  then set PcdSetNvStoreDefaultId to select STANDARD defaults.  This
  initializes a HOB that contains the platform setup defaults and
  this HOB is used by the Variable PEIM to return the platform setup
  variable value.
* Remove FCE.exe and BfmLib.exe files

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Cc: Gary Lin <glin@suse.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Tested-by: Gary Lin <glin@suse.com>
Michael D Kinney 4 years ago
parent
commit
6738c654c8

BIN
Platform/Intel/Vlv2TbltDevicePkg/BfmLib.exe


BIN
Platform/Intel/Vlv2TbltDevicePkg/FCE.exe


+ 25 - 15
Platform/Intel/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c

@@ -180,20 +180,16 @@ GetSetupVariable (
                        &VariableSize,
                        SystemConfiguration
                        );
-  if (EFI_ERROR (Status) || VariableSize != sizeof(SYSTEM_CONFIGURATION)) {
-    //The setup variable is corrupted
-    VariableSize = sizeof(SYSTEM_CONFIGURATION);
-    Status = Variable->GetVariable(
-              Variable,
-              L"SetupRecovery",
-              &gEfiSetupVariableGuid,
-              NULL,
-              &VariableSize,
-              SystemConfiguration
-              );
-    ASSERT_EFI_ERROR (Status);
-  }  
-  return Status;
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+  if (VariableSize != sizeof(SYSTEM_CONFIGURATION)) {
+    //
+    // The setup variable is corrupted
+    //
+    return EFI_NOT_FOUND;
+  }
+  return EFI_SUCCESS;
 }
 
 EFI_STATUS
@@ -856,7 +852,21 @@ PlatformEarlyInitEntry (
   //
   // Get setup variable. This can only be done after BootMode is updated
   //
-  GetSetupVariable (PeiServices, &SystemConfiguration);
+  Status = GetSetupVariable (PeiServices, &SystemConfiguration);
+  if (EFI_ERROR (Status)) {
+    DEBUG ((DEBUG_INFO, "PlatformEarlyInitEntry: Setup Variable does not exist.\n"));
+    DEBUG ((DEBUG_INFO, "PlatformEarlyInitEntry: Set PcdNvStoreDefaultId to STANDARD\n"));
+    //
+    // Set the default NV store to STANDARD defaults
+    //
+    PcdSet16S (PcdSetNvStoreDefaultId, 0x0000);
+
+    //
+    // Get setup variable. Must succeed at this point.
+    //
+    Status = GetSetupVariable (PeiServices, &SystemConfiguration);
+    ASSERT_EFI_ERROR (Status);
+  }
 
   CheckOsSelection(PeiServices, &SystemConfiguration);
 

+ 2 - 0
Platform/Intel/Vlv2TbltDevicePkg/PlatformInitPei/PlatformInitPei.inf

@@ -102,6 +102,8 @@ ENTRY_POINT               = PlatformEarlyInitEntry
 [Pcd]
   gEfiVLVTokenSpaceGuid.PcdMeasuredBootEnable
   gPlatformModuleTokenSpaceGuid.PcdBootState
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSetNvStoreDefaultId
+  gPlatformModuleTokenSpaceGuid.PcdSetup
 
 [Depex]
   gEfiPeiReadOnlyVariable2PpiGuid  AND gPeiCachePpiGuid

+ 12 - 0
Platform/Intel/Vlv2TbltDevicePkg/PlatformPkg.dec

@@ -168,6 +168,18 @@
   # @Prompt Boot State Flag
   gPlatformModuleTokenSpaceGuid.PcdBootState|TRUE|BOOLEAN|0x80000004
 
+[PcdsFixedAtBuild,PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
+  gPlatformModuleTokenSpaceGuid.PcdSetup|{0}|SYSTEM_CONFIGURATION|0x80000005 {
+    <HeaderFiles>
+      Include/Guid/SetupVariable.h
+    <Packages>
+      MdePkg/MdePkg.dec
+      MdeModulePkg/MdeModulePkg.dec
+      BoardModulePkg/BoardModulePkg.dec
+      Vlv2TbltDevicePkg/PlatformPkg.dec
+      Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec
+  }
+
 #
 #device firmware update support
 #

+ 13 - 7
Platform/Intel/Vlv2TbltDevicePkg/PlatformPkg.fdf

@@ -18,21 +18,23 @@ DEFINE FLASH_REGION_VLVMICROCODE_OFFSET                       = 0x00400000
 DEFINE FLASH_REGION_VLVMICROCODE_SIZE                         = 0x00040000
 DEFINE FLASH_REGION_VLVMICROCODE_BASE                         = 0xFFC00000
 
-DEFINE FLASH_REGION_VPD_OFFSET                                = 0x00440000
-DEFINE FLASH_REGION_VPD_SIZE                                  = 0x0003E000
+DEFINE FLASH_REGION_NV_STORAGE_VARIABLE_OFFSET                = 0x00440000
+DEFINE FLASH_REGION_NV_STORAGE_VARIABLE_SIZE                  = 0x0003E000
 
 DEFINE FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_WORKING_OFFSET = 0x0047E000
 DEFINE FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_WORKING_SIZE   = 0x00002000
 
-
 DEFINE FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_OFFSET   = 0x00480000
 DEFINE FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_SIZE     = 0x00040000
 
 DEFINE FLASH_REGION_FVMAIN_OFFSET                             = 0x00510000
 DEFINE FLASH_REGION_FVMAIN_SIZE                               = 0x00210000
 
-DEFINE FLASH_REGION_FV_RECOVERY2_OFFSET                       = 0x00720000
-DEFINE FLASH_REGION_FV_RECOVERY2_SIZE                         = 0x00070000
+DEFINE FLASH_REGION_VPD_OFFSET                                = 0x00720000
+DEFINE FLASH_REGION_VPD_SIZE                                  = 0x00010000
+
+DEFINE FLASH_REGION_FV_RECOVERY2_OFFSET                       = 0x00730000
+DEFINE FLASH_REGION_FV_RECOVERY2_SIZE                         = 0x00060000
 
 DEFINE FLASH_REGION_FV_RECOVERY_OFFSET                        = 0x00790000
 DEFINE FLASH_REGION_FV_RECOVERY_SIZE                          = 0x00070000
@@ -99,7 +101,7 @@ FILE=Vlv2TbltDevicePkg/Stitch/IFWIHeader/IFWI_HEADER.bin
 $(FLASH_REGION_VLVMICROCODE_OFFSET)|$(FLASH_REGION_VLVMICROCODE_SIZE)
 gPlatformModuleTokenSpaceGuid.PcdFlashMicroCodeAddress|gPlatformModuleTokenSpaceGuid.PcdFlashMicroCodeSize
 FV = MICROCODE_FV
-$(FLASH_REGION_VPD_OFFSET)|$(FLASH_REGION_VPD_SIZE)
+$(FLASH_REGION_NV_STORAGE_VARIABLE_OFFSET)|$(FLASH_REGION_NV_STORAGE_VARIABLE_SIZE)
 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
 #NV_VARIABLE_STORE
 DATA = {
@@ -166,6 +168,10 @@ $(FLASH_REGION_FVMAIN_OFFSET)|$(FLASH_REGION_FVMAIN_SIZE)
 gPlatformModuleTokenSpaceGuid.PcdFlashFvMainBase|gPlatformModuleTokenSpaceGuid.PcdFlashFvMainSize
 FV = FVMAIN_COMPACT
 
+$(FLASH_REGION_VPD_OFFSET)|$(FLASH_REGION_VPD_SIZE)
+gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress
+FILE = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/FV/8C3D856A-9BE6-468E-850A-24F7A8D38E08.bin
+
   #
   # FV Recovery#2
   #
@@ -742,7 +748,7 @@ READ_LOCK_STATUS   = TRUE
 [Rule.Common.SEC.BINARY]
   FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED {
     PE32  PE32    Align = 8       |.efi
-    RAW BIN       Align = 16      |.com
+    RAW   BIN     Align = 16      |.com
   }
 
 [Rule.Common.PEI_CORE]

+ 67 - 10
Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf

@@ -18,21 +18,23 @@ DEFINE FLASH_REGION_VLVMICROCODE_OFFSET                       = 0x00400000
 DEFINE FLASH_REGION_VLVMICROCODE_SIZE                         = 0x00040000
 DEFINE FLASH_REGION_VLVMICROCODE_BASE                         = 0xFFC00000
 
-DEFINE FLASH_REGION_VPD_OFFSET                                = 0x00440000
-DEFINE FLASH_REGION_VPD_SIZE                                  = 0x0003E000
+DEFINE FLASH_REGION_NV_STORAGE_VARIABLE_OFFSET                = 0x00440000
+DEFINE FLASH_REGION_NV_STORAGE_VARIABLE_SIZE                  = 0x0003E000
 
 DEFINE FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_WORKING_OFFSET = 0x0047E000
 DEFINE FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_WORKING_SIZE   = 0x00002000
 
-
 DEFINE FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_OFFSET   = 0x00480000
 DEFINE FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_SIZE     = 0x00040000
 
 DEFINE FLASH_REGION_FVMAIN_OFFSET                             = 0x00510000
 DEFINE FLASH_REGION_FVMAIN_SIZE                               = 0x00210000
 
-DEFINE FLASH_REGION_FV_RECOVERY2_OFFSET                       = 0x00720000
-DEFINE FLASH_REGION_FV_RECOVERY2_SIZE                         = 0x00070000
+DEFINE FLASH_REGION_VPD_OFFSET                                = 0x00720000
+DEFINE FLASH_REGION_VPD_SIZE                                  = 0x00010000
+
+DEFINE FLASH_REGION_FV_RECOVERY2_OFFSET                       = 0x00730000
+DEFINE FLASH_REGION_FV_RECOVERY2_SIZE                         = 0x00060000
 
 DEFINE FLASH_REGION_FV_RECOVERY_OFFSET                        = 0x00790000
 DEFINE FLASH_REGION_FV_RECOVERY_SIZE                          = 0x00070000
@@ -92,24 +94,72 @@ SET gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize = $(FLASH_REGION_VL
 0x0000|0x1000
 FILE=Vlv2TbltDevicePkg/Stitch/IFWIHeader/IFWI_HEADER.bin
 
-#
+  #
   # CPU Microcodes
   #
 
 $(FLASH_REGION_VLVMICROCODE_OFFSET)|$(FLASH_REGION_VLVMICROCODE_SIZE)
 gPlatformModuleTokenSpaceGuid.PcdFlashMicroCodeAddress|gPlatformModuleTokenSpaceGuid.PcdFlashMicroCodeSize
 FV = MICROCODE_FV
-$(FLASH_REGION_VPD_OFFSET)|$(FLASH_REGION_VPD_SIZE)
+$(FLASH_REGION_NV_STORAGE_VARIABLE_OFFSET)|$(FLASH_REGION_NV_STORAGE_VARIABLE_SIZE)
 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
-FILE = Vlv2TbltDevicePkg/Stitch/Gcc/NvStorageVariable.bin
+#NV_VARIABLE_STORE
+DATA = {
+  ## This is the EFI_FIRMWARE_VOLUME_HEADER
+  # ZeroVector []
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  # FileSystemGuid: gEfiSystemNvDataFvGuid         =
+  #  { 0xFFF12B8D, 0x7696, 0x4C8B, { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }}
+  0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C,
+  0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50,
+  # FvLength: 0x80000
+  0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+  #Signature "_FVH"       #Attributes
+  0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00,
+  #HeaderLength #CheckSum #ExtHeaderOffset #Reserved #Revision
+  0x48, 0x00, 0x2A, 0x09, 0x00, 0x00, 0x00, 0x02,
+  #Blockmap[0]: 7 Blocks * 0x10000 Bytes / Block
+  0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+  #Blockmap[1]: End
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  ## This is the VARIABLE_STORE_HEADER
+!if $(SECURE_BOOT_ENABLE) == TRUE
+  #Signature: gEfiAuthenticatedVariableGuid =
+  #  { 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 }}
+  0x78, 0x2c, 0xf3, 0xaa, 0x7b, 0x94, 0x9a, 0x43,
+  0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92,
+!else
+  #Signature: gEfiVariableGuid =
+  #  { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}
+  0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41,
+  0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d,
+!endif
+  #Size: 0x3E000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0x03DFB8
+  # This can speed up the Variable Dispatch a bit.
+  0xB8, 0xDF, 0x03, 0x00,
+  #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32
+  0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+}
+
 
 $(FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_WORKING_OFFSET)|$(FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_WORKING_SIZE)
 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
-FILE = Vlv2TbltDevicePkg/Stitch/Gcc/NvStorageFtwWorking.bin
+#NV_FTW_WORKING
+DATA = {
+  # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature = gEdkiiWorkingBlockSignatureGuid         =
+  #  { 0x9e58292b, 0x7c68, 0x497d, { 0xa0, 0xce, 0x65,  0x0, 0xfd, 0x9f, 0x1b, 0x95 }}
+  0x2B, 0x29, 0x58, 0x9E, 0x68, 0x7C, 0x7D, 0x49,
+  0xA0, 0xCE, 0x65, 0x0,  0xFD, 0x9F, 0x1B, 0x95,
+
+  # Crc:UINT32            #WorkingBlockValid:1, WorkingBlockInvalid:1, Reserved
+  0xE2, 0x33, 0xF2, 0x3,  0xFE, 0xFF, 0xFF, 0xFF,
+  # WriteQueueSize: UINT64 #Size: 0x2000 - 0x20 (FTW_WORKING_HEADER) = 0x1FE0
+  0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+}
 
 $(FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_OFFSET)|$(FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_SIZE)
 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
-FILE = Vlv2TbltDevicePkg/Stitch/Gcc/NvStorageFtwSpare.bin
 
   #
   # Main Block
@@ -118,6 +168,10 @@ $(FLASH_REGION_FVMAIN_OFFSET)|$(FLASH_REGION_FVMAIN_SIZE)
 gPlatformModuleTokenSpaceGuid.PcdFlashFvMainBase|gPlatformModuleTokenSpaceGuid.PcdFlashFvMainSize
 FV = FVMAIN_COMPACT
 
+$(FLASH_REGION_VPD_OFFSET)|$(FLASH_REGION_VPD_SIZE)
+gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress
+FILE = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/FV/8C3D856A-9BE6-468E-850A-24F7A8D38E08.bin
+
   #
   # FV Recovery#2
   #
@@ -223,7 +277,10 @@ READ_LOCK_CAP      = TRUE
 READ_LOCK_STATUS   = TRUE
 FvNameGuid         = B73FE497-B92E-416e-8326-45AD0D270092
 
+
+
 INF Vlv2TbltDevicePkg/PlatformInitPei/PlatformInitPei.inf
+
 INF RuleOverride = BINARY Vlv2SocBinPkg/$(DXE_ARCHITECTURE)$(TARGET)/IA32/PchSmbusArpDisabled.inf
 INF RuleOverride = BINARY Vlv2SocBinPkg/$(DXE_ARCHITECTURE)$(TARGET)/IA32/VlvInitPeim.inf
 INF RuleOverride = BINARY Vlv2SocBinPkg/$(DXE_ARCHITECTURE)$(TARGET)/IA32/PchInitPeim.inf

+ 15 - 1
Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGccIA32.dsc

@@ -22,6 +22,7 @@
   SUPPORTED_ARCHITECTURES             = IA32
   BUILD_TARGETS                       = DEBUG|RELEASE
   SKUID_IDENTIFIER                    = DEFAULT
+  VPD_TOOL_GUID                       = 8C3D856A-9BE6-468E-850A-24F7A8D38E08
 
   DEFINE RC_BINARY_RELEASE        = TRUE
   #
@@ -51,6 +52,10 @@
 [SkuIds]
   0|DEFAULT              # The entry: 0|DEFAULT is reserved and always required.
 
+[DefaultStores]
+  0|STANDARD             # UEFI Standard default  0|STANDARD is reserved.
+  1|MANUFACTURING        # UEFI Manufacturing default 1|MANUFACTURING is reserved.
+
 ################################################################################
 #
 # Library Class section - list of all Library Classes needed by this Platform.
@@ -720,6 +725,15 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdSystemFmpCapsuleImageTypeIdGuid|{GUID("4096267b-da0a-42eb-b5eb-fef31d207cb4")}|VOID*|0x10
 !endif
 
+[PcdsDynamicExVpd.common.DEFAULT]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdNvStoreDefaultValueBuffer|*
+
+[PcdsDynamicExHii.common.DEFAULT.STANDARD]
+  !include Vlv2TbltDevicePkg/PlatformSetupDefaults.dsc
+
+[PcdsDynamicExHii.common.DEFAULT.MANUFACTURING]
+  !include Vlv2TbltDevicePkg/PlatformSetupDefaults.dsc
+
 [Components.IA32]
 
   Vlv2SocBinPkg/$(DXE_ARCHITECTURE)$(TARGET)/IA32/SecCore.inf
@@ -772,7 +786,7 @@
   SecurityPkg/Tcg/TcgPei/TcgPei.inf {
     <LibraryClasses>
       PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
-}
+  }
 !endif
 
  Vlv2TbltDevicePkg/PlatformInitPei/PlatformInitPei.inf {

+ 14 - 2
Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc

@@ -22,6 +22,7 @@
   SUPPORTED_ARCHITECTURES             = IA32|X64
   BUILD_TARGETS                       = DEBUG|RELEASE
   SKUID_IDENTIFIER                    = DEFAULT
+  VPD_TOOL_GUID                       = 8C3D856A-9BE6-468E-850A-24F7A8D38E08
 
   DEFINE RC_BINARY_RELEASE        = TRUE
   #
@@ -53,6 +54,10 @@
 [SkuIds]
   0|DEFAULT              # The entry: 0|DEFAULT is reserved and always required.
 
+[DefaultStores]
+  0|STANDARD             # UEFI Standard default  0|STANDARD is reserved.
+  1|MANUFACTURING        # UEFI Manufacturing default 1|MANUFACTURING is reserved.
+
 ################################################################################
 #
 # Library Class section - list of all Library Classes needed by this Platform.
@@ -722,6 +727,15 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdSystemFmpCapsuleImageTypeIdGuid|{GUID("4096267b-da0a-42eb-b5eb-fef31d207cb4")}|VOID*|0x10
 !endif
 
+[PcdsDynamicExVpd.common.DEFAULT]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdNvStoreDefaultValueBuffer|*
+
+[PcdsDynamicExHii.common.DEFAULT.STANDARD]
+  !include Vlv2TbltDevicePkg/PlatformSetupDefaults.dsc
+
+[PcdsDynamicExHii.common.DEFAULT.MANUFACTURING]
+  !include Vlv2TbltDevicePkg/PlatformSetupDefaults.dsc
+
 [Components.IA32]
 
   Vlv2SocBinPkg/$(DXE_ARCHITECTURE)$(TARGET)/IA32/SecCore.inf
@@ -1239,8 +1253,6 @@
   DEFINE CLKGEN_CONFIG_EXTRA_BUILD_OPTION =
 !endif
 
-
-
 !if $(PCIESC_ENABLE) == TRUE
   DEFINE PCIESC_SUPPORT_BUILD_OPTION = -DPCIESC_SUPPORT=1
 !else

+ 12 - 3
Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc

@@ -22,6 +22,7 @@
   SUPPORTED_ARCHITECTURES             = IA32
   BUILD_TARGETS                       = DEBUG|RELEASE
   SKUID_IDENTIFIER                    = DEFAULT
+  VPD_TOOL_GUID                       = 8C3D856A-9BE6-468E-850A-24F7A8D38E08
 
   DEFINE RC_BINARY_RELEASE        = TRUE
   #
@@ -51,6 +52,10 @@
 [SkuIds]
   0|DEFAULT              # The entry: 0|DEFAULT is reserved and always required.
 
+[DefaultStores]
+  0|STANDARD             # UEFI Standard default  0|STANDARD is reserved.
+  1|MANUFACTURING        # UEFI Manufacturing default 1|MANUFACTURING is reserved.
+
 ################################################################################
 #
 # Library Class section - list of all Library Classes needed by this Platform.
@@ -720,6 +725,12 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdSystemFmpCapsuleImageTypeIdGuid|{GUID("4096267b-da0a-42eb-b5eb-fef31d207cb4")}|VOID*|0x10
 !endif
 
+[PcdsDynamicExVpd.common.DEFAULT]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdNvStoreDefaultValueBuffer|*
+
+[PcdsDynamicExHii.common.DEFAULT.STANDARD]
+  !include Vlv2TbltDevicePkg/PlatformSetupDefaults.dsc
+
 [Components.IA32]
 
   Vlv2SocBinPkg/$(DXE_ARCHITECTURE)$(TARGET)/IA32/SecCore.inf
@@ -772,7 +783,7 @@
   SecurityPkg/Tcg/TcgPei/TcgPei.inf {
     <LibraryClasses>
       PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
-}
+  }
 !endif
 
  Vlv2TbltDevicePkg/PlatformInitPei/PlatformInitPei.inf {
@@ -1224,8 +1235,6 @@
   DEFINE CLKGEN_CONFIG_EXTRA_BUILD_OPTION =
 !endif
 
-
-
 !if $(PCIESC_ENABLE) == TRUE
   DEFINE PCIESC_SUPPORT_BUILD_OPTION = /DPCIESC_SUPPORT=1
 !else

+ 11 - 0
Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc

@@ -22,6 +22,7 @@
   SUPPORTED_ARCHITECTURES             = IA32|X64
   BUILD_TARGETS                       = DEBUG|RELEASE
   SKUID_IDENTIFIER                    = DEFAULT
+  VPD_TOOL_GUID                       = 8C3D856A-9BE6-468E-850A-24F7A8D38E08
 
   DEFINE RC_BINARY_RELEASE        = TRUE
   #
@@ -53,6 +54,10 @@
 [SkuIds]
   0|DEFAULT              # The entry: 0|DEFAULT is reserved and always required.
 
+[DefaultStores]
+  0|STANDARD             # UEFI Standard default  0|STANDARD is reserved.
+  1|MANUFACTURING        # UEFI Manufacturing default 1|MANUFACTURING is reserved.
+
 ################################################################################
 #
 # Library Class section - list of all Library Classes needed by this Platform.
@@ -722,6 +727,12 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdSystemFmpCapsuleImageTypeIdGuid|{GUID("4096267b-da0a-42eb-b5eb-fef31d207cb4")}|VOID*|0x10
 !endif
 
+[PcdsDynamicExVpd.common.DEFAULT]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdNvStoreDefaultValueBuffer|*
+
+[PcdsDynamicExHii.common.DEFAULT.STANDARD]
+  !include Vlv2TbltDevicePkg/PlatformSetupDefaults.dsc
+
 [Components.IA32]
 
   Vlv2SocBinPkg/$(DXE_ARCHITECTURE)$(TARGET)/IA32/SecCore.inf

+ 130 - 0
Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDefaults.dsc

@@ -0,0 +1,130 @@
+#/** @file
+# Platform Setup Default Settings
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+#**/
+
+  gPlatformModuleTokenSpaceGuid.PcdSetup|L"Setup"|gEfiSetupVariableGuid|0x00|{0x00}|NV,BS
+  gPlatformModuleTokenSpaceGuid.PcdSetup.ACPIMemDbg|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.AlsEnable|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.AzaliaDs|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.AzaliaPme|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.AzaliaVCiEnable|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.BootDisplayDevice|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.BootNetwork|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.CfioPnpSettings|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.CriticalThermalTripPoint|0xc8
+  gPlatformModuleTokenSpaceGuid.PcdSetup.DisableActiveTripPoints|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.DisableCodec262|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.ENDBG2|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.ETpm|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.EhciPllCfgEnable|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.EnableClockSpreadSpec|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.EnableDigitalThermalSensor|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.ExISupport|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.FastBoot|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.GOPBrightnessLevel|0x5
+  gPlatformModuleTokenSpaceGuid.PcdSetup.GOPEnable|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.GTTSize|0x2
+  gPlatformModuleTokenSpaceGuid.PcdSetup.GpioWakeCapability|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.HdmiCodec|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.Hpet|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.Hsic0|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.I2CTouchAd|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.ISPDevSel|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.ISPEn|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.IchPciExp[0]|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.IchPciExp[1]|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.IchPciExp[2]|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.IchPciExp[3]|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.IgdApertureSize|0x2
+  gPlatformModuleTokenSpaceGuid.PcdSetup.IgdDvmt50PreAlloc|0x2
+  gPlatformModuleTokenSpaceGuid.PcdSetup.IgdDvmt50TotalAlloc|0x2
+  gPlatformModuleTokenSpaceGuid.PcdSetup.IgdFlatPanel|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.IgdLcdIBia|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.IgdLcdIGmchBlc|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.Igd|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.Lan|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LidStatus|0x2
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LmMemSize|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LogBootTime|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpeAudioReportedByDSDT|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.Lpe|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssDma0Enabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssDma1Enabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssHsuart0Enabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssHsuart0FlowControlEnabled|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssHsuart1Enabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssHsuart1FlowControlEnabled|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssI2C5Enabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssI2C6Enabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssPciModeEnabled|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssPwm0Enabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssPwm1Enabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssSdCardDDR50Enabled|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssSdCardSDR25Enabled|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssSdcardEnabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssSdioEnabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpssSpiEnabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpsseMMC45DDR50Enabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpsseMMC45Enabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpsseMMC45HS200Enabled|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.LpsseMMC45RetuneTimerValue|0x8
+  gPlatformModuleTokenSpaceGuid.PcdSetup.MeasuredBootEnable|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.MmioSize|0x4
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PDMConfig|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PanelScaling|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PassiveTc1Value|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PassiveTc2Value|0x5
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PassiveThermalTripPoint|0xb4
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PassiveTspValue|0x32
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PavpMode|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchAzalia|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchEhciDebug|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchFSAOn|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchUsb20|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchUsb30Mode|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchUsbOtg|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchUsbPerPortCtl|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchUsbPort[0]|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchUsbPort[1]|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchUsbPort[2]|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchUsbPort[3]|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchUsbRmh|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PchUsbVbusOn|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PcieDynamicGating|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PcieRootPortSpeed[0]|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PcieRootPortSpeed[1]|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PcieRootPortSpeed[2]|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PcieRootPortSpeed[3]|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PcuUart1|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PnpSettings|0x3
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PrimaryVideoAdaptor|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.PunitBIOSConfig|0x3
+  gPlatformModuleTokenSpaceGuid.PcdSetup.QuietBoot|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.RtcBattery|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.SAR1|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.Sata0HotPlugCap|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.Sata1HotPlugCap|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.SataTestMode|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.SataType|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.Sata|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.SdCardRemovable|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.SecureBoot|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.SecureErase|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.SlpLanLowDc|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.SpiRwProtect|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.StateAfterG3|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.TristateLpc|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.UartInterface|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.UsbAutoMode|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.UsbXhciLpmSupport|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.UsbXhciSupport|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.UtsEnable|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.WakeOnLanS5|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.WittEnable|0x0
+  gPlatformModuleTokenSpaceGuid.PcdSetup.eMMCBootMode|0x1
+  gPlatformModuleTokenSpaceGuid.PcdSetup.fTPM|0x0

+ 6 - 139
Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.c

@@ -1,12 +1,8 @@
 /** @file
 
-  Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>
-                                                                                   

-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-                                                                                   

+  Copyright (c) 2004  - 2019, Intel Corporation. All rights reserved.<BR>
 
-Module Name:
+  SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
@@ -154,95 +150,7 @@ SystemConfigExtractConfig (
   OUT EFI_STRING                             *Results
   )
 {
-  EFI_STATUS                       Status;
-  EFI_CALLBACK_INFO                *Private;
-  EFI_HII_CONFIG_ROUTING_PROTOCOL  *HiiConfigRouting;
-  EFI_STRING                       ConfigRequestHdr;
-  EFI_STRING                       ConfigRequest;
-  BOOLEAN                          AllocatedRequest;
-  UINTN                            Size;
-  UINTN                            BufferSize;
-  VOID                             *SystemConfigPtr;
-
-
-  if (Progress == NULL || Results == NULL) {
-    return EFI_INVALID_PARAMETER;
-  }
-
-  *Progress = Request;
-  if ((Request != NULL) && !HiiIsConfigHdrMatch (Request, &mSystemConfigGuid, mVariableName)) {
-    return EFI_NOT_FOUND;
-  }
-
-  ConfigRequestHdr = NULL;
-  ConfigRequest    = NULL;
-  Size             = 0;
-  AllocatedRequest = FALSE;
-
-  Private          = EFI_CALLBACK_INFO_FROM_THIS (This);
-
-  SetupInfo();
-
-  HiiConfigRouting = Private->HiiConfigRouting;
-  ConfigRequest = Request;
-  if ((Request == NULL) || (StrStr (Request, L"OFFSET") == NULL)) {
-    //
-    // Request has no request element, construct full request string.
-    // Allocate and fill a buffer large enough to hold the <ConfigHdr> template
-    // followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator
-    //
-    ConfigRequestHdr = HiiConstructConfigHdr (&mSystemConfigGuid, mVariableName, Private->DriverHandle);
-    Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);
-    ConfigRequest = AllocateZeroPool (Size);
-    ASSERT (ConfigRequest != NULL);
-    AllocatedRequest = TRUE;
-    BufferSize = sizeof (SYSTEM_CONFIGURATION);
-    UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize);
-    FreePool (ConfigRequestHdr);
-  }
-  SystemConfigPtr = GetVariable(mSetupName, &mNormalSetupGuid);
-
-
-  if (SystemConfigPtr == NULL) {
-    ZeroMem(&Private->FakeNvData, sizeof(SYSTEM_CONFIGURATION));
-    ZeroMem(&Private->BackupNvData, sizeof(SYSTEM_CONFIGURATION));
-  } else {
-    CheckSystemConfigLoad(SystemConfigPtr);
-    CopyMem(&Private->FakeNvData, SystemConfigPtr, sizeof(SYSTEM_CONFIGURATION));
-    CopyMem(&Private->BackupNvData, SystemConfigPtr, sizeof(SYSTEM_CONFIGURATION));
-    FreePool(SystemConfigPtr);
-  }
-
-  //
-  // Convert buffer data to <ConfigResp> by helper function BlockToConfig()
-  //
-  Status = HiiConfigRouting->BlockToConfig (
-                               HiiConfigRouting,
-                               ConfigRequest,
-                               (UINT8 *) &Private->FakeNvData,
-                               sizeof (SYSTEM_CONFIGURATION),
-                               Results,
-                               Progress
-                               );
-
-  //
-  // Free the allocated config request string.
-  //
-  if (AllocatedRequest) {
-    FreePool (ConfigRequest);
-    ConfigRequest = NULL;
-  }
-
-  //
-  // Set Progress string to the original request string.
-  //
-  if (Request == NULL) {
-    *Progress = NULL;
-  } else if (StrStr (Request, L"OFFSET") == NULL) {
-    *Progress = Request + StrLen (Request);
-  }
-
-  return Status;
+  return EFI_UNSUPPORTED;
 }
 
 /**
@@ -268,48 +176,7 @@ SystemConfigRouteConfig (
   OUT EFI_STRING                             *Progress
   )
 {
-  EFI_CALLBACK_INFO                         *Private;
-  SYSTEM_CONFIGURATION                       *FakeNvData;
-
-  if (Configuration == NULL || Progress == NULL) {
-    return EFI_INVALID_PARAMETER;
-  }
-  *Progress = Configuration;
-
-  if (!HiiIsConfigHdrMatch (Configuration, &mSystemConfigGuid, mVariableName)) {
-    return EFI_NOT_FOUND;
-  }
-
-  *Progress = Configuration + StrLen (Configuration);
-  Private    = EFI_CALLBACK_INFO_FROM_THIS (This);
-  FakeNvData = &Private->FakeNvData;
-  if (!HiiGetBrowserData (&mSystemConfigGuid, mVariableName, sizeof (SYSTEM_CONFIGURATION), (UINT8 *) FakeNvData)) {
-    //
-    // FakeNvData can't be got from SetupBrowser, which doesn't need to be set.
-    //
-    return EFI_SUCCESS;
-  }
-
-  if (Private->FakeNvData.ReservedO != Private->BackupNvData.ReservedO) {
-    Private->BackupNvData.ReservedO = Private->FakeNvData.ReservedO;
-    LoadLpssDefaultValues (Private);
-
-    //
-    // Pass changed uncommitted data back to Form Browser
-    //
-    HiiSetBrowserData (&mSystemConfigGuid, mVariableName, sizeof (SYSTEM_CONFIGURATION), (UINT8 *) FakeNvData, NULL);
-  }
-
-  gRT->SetVariable(
-         mSetupName,
-         &mNormalSetupGuid,
-         EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
-         sizeof(SYSTEM_CONFIGURATION),
-         &Private->FakeNvData
-         );
-
-  CheckSystemConfigSave(&Private->FakeNvData);
-  return EFI_SUCCESS;
+  return EFI_UNSUPPORTED;
 }
 
 /**
@@ -621,8 +488,6 @@ SystemConfigCallback (
                           );
         }
 
-        FreePool (FakeNvData);
-
         DataSize = sizeof(OsSelection);
         Status = gRT->GetVariable(
                         L"OsSelection",
@@ -643,6 +508,8 @@ SystemConfigCallback (
                           );
         }
 
+        FreePool (FakeNvData);
+
         //
         // Reset system
         //

+ 9 - 8
Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/Vfr.vfr

@@ -1,16 +1,13 @@
 //
+// Copyright (c) 2004  - 2019, Intel Corporation. All rights reserved.<BR>
 //
-//
-// Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>
-//                                                                                  

 // SPDX-License-Identifier: BSD-2-Clause-Patent
-
-//                                                                                  

-//
 //
+
+#include <Uefi/UefiMultiPhase.h>
+#include <Guid/SetupVariable.h>
 #include "Configuration.h"
 #include "PlatformSetupDxeStrDefs.h"
-#include "Guid/SetupVariable.h"
 
 formset
   guid     = SYSTEM_CONFIGURATION_GUID,
@@ -20,7 +17,11 @@ formset
   subclass = 0,
 
 
-  varstore SYSTEM_CONFIGURATION, name = Setup, guid = SYSTEM_CONFIGURATION_GUID;
+  efivarstore SYSTEM_CONFIGURATION,
+    attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
+    name = Setup,
+    guid = SYSTEM_CONFIGURATION_GUID;
+
   form formid = ROOT_FORM_ID,
     title    = STRING_TOKEN(STR_SYSTEM_SETUP_TITLE);
 

File diff suppressed because it is too large
+ 0 - 0
Platform/Intel/Vlv2TbltDevicePkg/Stitch/Gcc/NvStorageFtwSpare.bin


BIN
Platform/Intel/Vlv2TbltDevicePkg/Stitch/Gcc/NvStorageFtwWorking.bin


BIN
Platform/Intel/Vlv2TbltDevicePkg/Stitch/Gcc/NvStorageVariable.bin


+ 4 - 17
Platform/Intel/Vlv2TbltDevicePkg/bld_vlv.bat

@@ -229,7 +229,7 @@ if "%GenReport%"=="TRUE" (
 ::**********************************************************************
 
 echo BOARD_ID       = MNW2MAX >  %BUILD_PATH%/BiosId.env
-echo BOARD_REV      = 1       >> %BUILD_PATH%/BiosId.env
+echo BOARD_REV      = W       >> %BUILD_PATH%/BiosId.env
 if "%Arch%"=="IA32" (
   echo BOARD_EXT      = I32   >> %BUILD_PATH%/BiosId.env
 )
@@ -259,24 +259,11 @@ call build %Build_Flags%
 
 if %ERRORLEVEL% NEQ 0 goto BldFail
 
+copy %BUILD_PATH%\FV\VLV.fd %BUILD_PATH%\FV\Vlv.ROM
+
 ::**********************************************************************
-:: Post Build processing and cleanup
+:: Build Capsules
 ::**********************************************************************
-
-echo Running fce...
-
-pushd %PLATFORM_PACKAGE%
-:: Extract Hii data from build and store in HiiDefaultData.txt
-%PLATFORM_PACKAGE%\fce read -i %BUILD_PATH%\FV\Vlv.fd > %BUILD_PATH%\FV\HiiDefaultData.txt
-
-:: save changes to VlvXXX.fd
-%PLATFORM_PACKAGE%\fce update -i %BUILD_PATH%\FV\Vlv.fd -s %BUILD_PATH%\FV\HiiDefaultData.txt -o %BUILD_PATH%\FV\Vlv.ROM
-popd
-
-if %ERRORLEVEL% NEQ 0 goto BldFail
-::echo FD successfully updated with default Hii values.
-
-@REM build capsule here
 if "%Arch%"=="X64" (
   echo Invoking EDK2 build for capsules...
   echo build -t %TOOL_CHAIN_TAG% -p %PLATFORM_PACKAGE%\PlatformCapsule.dsc

+ 1 - 6
Platform/Intel/Vlv2TbltDevicePkg/bld_vlv.sh

@@ -189,7 +189,7 @@ fi
 ##**********************************************************************
 
 echo BOARD_ID       = MNW2MAX >  $BUILD_PATH/BiosId.env
-echo BOARD_REV      = 1       >> $BUILD_PATH/BiosId.env
+echo BOARD_REV      = L       >> $BUILD_PATH/BiosId.env
 if [ $Arch == "IA32" ]; then
   echo BOARD_EXT      = I32   >> $BUILD_PATH/BiosId.env
 fi
@@ -214,11 +214,6 @@ echo "Invoking EDK2 build..."
 echo build $Build_Flags
 build $Build_Flags
 
-##**********************************************************************
-## Post Build processing and cleanup
-##**********************************************************************
-echo Skip "Running fce..."
-
 cp -f $BUILD_PATH/FV/VLV.fd $BUILD_PATH/FV/Vlv.ROM
 
 ##**********************************************************************

Some files were not shown because too many files changed in this diff