mirror of https://github.com/acidanthera/audk.git
Sync the branch changes to trunk.
Update the FCE tool to remove “runtime access” . and recovery "Setup" variable in case of “Setup” variable size is incorrect somehow. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tim He <tim.he@intel.com> Reviewed-by: David Wei <david.wei@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17620 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2a697cb579
commit
620f289162
|
@ -697,7 +697,18 @@ OnReadyToBoot (
|
|||
&VariableSize,
|
||||
&SetupVarBuffer
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status) || VariableSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VariableSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&mSystemConfigurationGuid,
|
||||
NULL,
|
||||
&VariableSize,
|
||||
&SetupVarBuffer
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
//
|
||||
// Find the AcpiSupport protocol.
|
||||
|
@ -817,7 +828,18 @@ AcpiPlatformEntryPoint (
|
|||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&mSystemConfigurationGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
//
|
||||
// Find the AcpiSupport protocol.
|
||||
|
@ -842,6 +864,19 @@ AcpiPlatformEntryPoint (
|
|||
&SysCfgSize,
|
||||
&mSystemConfig
|
||||
);
|
||||
if (EFI_ERROR (Status) || SysCfgSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
SysCfgSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&SysCfgSize,
|
||||
&mSystemConfig
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
Instance = 0;
|
||||
|
|
Binary file not shown.
|
@ -346,7 +346,18 @@ ConfigurePlatformClocks (
|
|||
NULL,
|
||||
&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);
|
||||
}
|
||||
if(!EFI_ERROR (Status)){
|
||||
EnableSpreadSpectrum = SystemConfiguration.EnableClockSpreadSpec;
|
||||
}
|
||||
|
|
|
@ -322,7 +322,18 @@ GetGopDevicePath (
|
|||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
if(mSystemConfiguration.BootDisplayDevice != 0x0)
|
||||
{
|
||||
|
@ -624,7 +635,18 @@ PlatformBdsForceActiveVga (
|
|||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
|
||||
if ((PlugInPciVgaDevicePath == NULL && OnboardPciVgaDevicePath != NULL) ) {
|
||||
|
@ -680,7 +702,18 @@ UpdateConsoleResolution(
|
|||
&VarSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
switch (SystemConfiguration.IgdFlatPanel) {
|
||||
|
||||
|
@ -1576,6 +1609,11 @@ PlatformBdsPolicyBehavior (
|
|||
UINTN BootOrderSize;
|
||||
|
||||
Timeout = PcdGet16 (PcdPlatformBootTimeOut);
|
||||
if (Timeout > 10 ) {
|
||||
//we think the Timeout variable is corrupted
|
||||
Timeout = 10;
|
||||
}
|
||||
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
NORMAL_SETUP_NAME,
|
||||
|
@ -1584,9 +1622,19 @@ PlatformBdsPolicyBehavior (
|
|||
&VarSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
//
|
||||
// Load the driver option as the driver option list
|
||||
|
|
|
@ -343,7 +343,18 @@ PciPlatformDriverEntry (
|
|||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
//
|
||||
// Install on a new handle
|
||||
|
|
|
@ -73,7 +73,18 @@ InitExI (
|
|||
&SystemConfiguration
|
||||
);
|
||||
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
if (SystemConfiguration.ExISupport == 1) {
|
||||
MmioOr32 ((UINTN) (GetPmcBase() + R_PCH_PMC_MTPMC1), (UINT32) BIT0+BIT1+BIT2);
|
||||
|
|
|
@ -49,6 +49,8 @@ Abstract:
|
|||
#include <Protocol/GlobalNvsArea.h>
|
||||
#include <Protocol/IgdOpRegion.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Protocol/VariableLock.h>
|
||||
|
||||
|
||||
//
|
||||
// VLV2 GPIO GROUP OFFSET
|
||||
|
@ -200,6 +202,82 @@ InitRC6Policy(
|
|||
);
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SaveSetupRecoveryVar(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status = EFI_SUCCESS;
|
||||
UINTN SizeOfNvStore = 0;
|
||||
UINTN SizeOfSetupVar = 0;
|
||||
SYSTEM_CONFIGURATION *SetupData = NULL;
|
||||
SYSTEM_CONFIGURATION *RecoveryNvData = NULL;
|
||||
EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock = NULL;
|
||||
|
||||
|
||||
DEBUG ((EFI_D_INFO, "SaveSetupRecoveryVar() Entry \n"));
|
||||
SizeOfNvStore = sizeof(SYSTEM_CONFIGURATION);
|
||||
RecoveryNvData = AllocateZeroPool (sizeof(SYSTEM_CONFIGURATION));
|
||||
if (NULL == RecoveryNvData) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&SizeOfNvStore,
|
||||
RecoveryNvData
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
// Don't find the "SetupRecovery" variable.
|
||||
// have to copy "Setup" variable to "SetupRecovery" variable.
|
||||
SetupData = AllocateZeroPool (sizeof(SYSTEM_CONFIGURATION));
|
||||
if (NULL == SetupData) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto Exit;
|
||||
}
|
||||
SizeOfSetupVar = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
NORMAL_SETUP_NAME,
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&SizeOfSetupVar,
|
||||
SetupData
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
Status = gRT->SetVariable (
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof(SYSTEM_CONFIGURATION),
|
||||
SetupData
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = VariableLock->RequestToLock (VariableLock, L"SetupRecovery", &gEfiNormalSetupGuid);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Exit:
|
||||
if (RecoveryNvData)
|
||||
FreePool (RecoveryNvData);
|
||||
if (SetupData)
|
||||
FreePool (SetupData);
|
||||
|
||||
return Status;
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
TristateLpcGpioConfig (
|
||||
IN UINT32 Gpio_Mmio_Offset,
|
||||
|
@ -692,6 +770,10 @@ InitializePlatform (
|
|||
//
|
||||
InitializeObservableProtocol();
|
||||
|
||||
Status = SaveSetupRecoveryVar();
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "InitializePlatform() Save SetupRecovery variable failed \n"));
|
||||
}
|
||||
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
|
@ -701,8 +783,26 @@ InitializePlatform (
|
|||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
Status = gRT->SetVariable (
|
||||
NORMAL_SETUP_NAME,
|
||||
&gEfiNormalSetupGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof(SYSTEM_CONFIGURATION),
|
||||
&mSystemConfiguration
|
||||
);
|
||||
}
|
||||
|
||||
Status = EfiCreateEventReadyToBootEx (
|
||||
TPL_CALLBACK,
|
||||
ReadyToBootFunction,
|
||||
|
@ -1394,12 +1494,7 @@ InitMfgAndConfigModeStateVar()
|
|||
{
|
||||
EFI_PLATFORM_SETUP_ID *BootModeBuffer;
|
||||
VOID *HobList;
|
||||
UINT16 State;
|
||||
|
||||
//
|
||||
// Variable initialization
|
||||
//
|
||||
State = FALSE;
|
||||
|
||||
HobList = GetFirstGuidHob(&gEfiPlatformBootModeGuid);
|
||||
if (HobList != NULL) {
|
||||
|
@ -1416,16 +1511,8 @@ InitMfgAndConfigModeStateVar()
|
|||
mMfgMode = TRUE;
|
||||
}
|
||||
|
||||
//
|
||||
// Check if in safe mode
|
||||
//
|
||||
if ( !CompareMem (
|
||||
&BootModeBuffer->SetupName,
|
||||
SAFE_SETUP_NAME,
|
||||
StrSize (SAFE_SETUP_NAME)
|
||||
) ) {
|
||||
State = TRUE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1588,6 +1675,19 @@ UpdateDVMTSetup(
|
|||
&SystemConfiguration
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
if((SystemConfiguration.GraphicsDriverMemorySize < 4) && !EFI_ERROR(Status) ) {
|
||||
switch (SystemConfiguration.GraphicsDriverMemorySize){
|
||||
case 1:
|
||||
|
|
|
@ -128,6 +128,7 @@
|
|||
gEfiCpuIo2ProtocolGuid
|
||||
gIgdOpRegionProtocolGuid
|
||||
gExitPmAuthProtocolGuid
|
||||
gEdkiiVariableLockProtocolGuid
|
||||
|
||||
[Pcd.common]
|
||||
gPlatformModuleTokenSpaceGuid.PcdPBTNDisableInterval
|
||||
|
|
|
@ -181,7 +181,19 @@ PlatformGOPPolicyEntryPoint (
|
|||
&VarSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
if (SystemConfiguration.GOPEnable == 1)
|
||||
{
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
|
|
|
@ -62,6 +62,19 @@ PlatformInfoInit (
|
|||
&VarSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
VarSize = sizeof(Selection);
|
||||
Status = gRT->GetVariable(
|
||||
|
@ -113,7 +126,7 @@ PlatformInfoInit (
|
|||
Status = gRT->SetVariable (
|
||||
NORMAL_SETUP_NAME,
|
||||
&gEfiNormalSetupGuid,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||
sizeof(SYSTEM_CONFIGURATION),
|
||||
&SystemConfiguration
|
||||
);
|
||||
|
@ -146,7 +159,7 @@ PlatformInfoInit (
|
|||
Status = gRT->SetVariable(
|
||||
L"PlatformInfo",
|
||||
&gEfiVlv2VariableGuid,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||
sizeof(EFI_PLATFORM_INFO_HOB),
|
||||
PlatformInfoHobPtr
|
||||
);
|
||||
|
|
|
@ -202,6 +202,19 @@ UpdateBootMode (
|
|||
&VarSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = Variable->GetVariable(
|
||||
Variable,
|
||||
L"SetupRecovery",
|
||||
&gEfiSetupVariableGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
if (SystemConfiguration.FastBoot == 1) {
|
||||
BootMode = BOOT_WITH_MINIMAL_CONFIGURATION;
|
||||
|
@ -386,16 +399,16 @@ SetPlatformBootMode (
|
|||
// Recovery mode
|
||||
//
|
||||
CopyMem (&PlatformSetupId.SetupName,
|
||||
SAFE_SETUP_NAME,
|
||||
StrSize (SAFE_SETUP_NAME));
|
||||
&NORMAL_SETUP_NAME,
|
||||
StrSize (NORMAL_SETUP_NAME));
|
||||
PlatformSetupId.PlatformBootMode = PLATFORM_RECOVERY_MODE;
|
||||
} else if (CheckIfSafeMode(PeiServices, PlatformInfoHob)) {
|
||||
//
|
||||
// Safe mode also called config mode or maintenace mode.
|
||||
//
|
||||
CopyMem (&PlatformSetupId.SetupName,
|
||||
SAFE_SETUP_NAME,
|
||||
StrSize (SAFE_SETUP_NAME));
|
||||
&NORMAL_SETUP_NAME,
|
||||
StrSize (NORMAL_SETUP_NAME));
|
||||
PlatformSetupId.PlatformBootMode = PLATFORM_SAFE_MODE;
|
||||
|
||||
} else if(0) { // else if (CheckIfManufacturingMode(PeiServices)) {
|
||||
|
|
|
@ -196,7 +196,19 @@ GetSetupVariable (
|
|||
&VariableSize,
|
||||
SystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -716,7 +716,20 @@ PeiInitPlatform (
|
|||
&VariableSize,
|
||||
&SystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
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);
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
GGC = ((2 << 3) | 0x200);
|
||||
PciCfg16Write(EC_BASE, 0, 2, 0, 0x50, GGC);
|
||||
|
|
|
@ -17,6 +17,8 @@ Module Name:
|
|||
|
||||
#include "PlatformSetupDxe.h"
|
||||
#include "Guid/SetupVariable.h"
|
||||
#include <Protocol/FormBrowserEx2.h>
|
||||
|
||||
|
||||
#define EFI_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('C', 'l', 'b', 'k')
|
||||
#define EFI_CALLBACK_INFO_FROM_THIS(a) CR (a, EFI_CALLBACK_INFO, ConfigAccess, EFI_CALLBACK_INFO_SIGNATURE)
|
||||
|
@ -306,7 +308,7 @@ SystemConfigRouteConfig (
|
|||
gRT->SetVariable(
|
||||
mSetupName,
|
||||
&mNormalSetupGuid,
|
||||
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof(SYSTEM_CONFIGURATION),
|
||||
&Private->FakeNvData
|
||||
);
|
||||
|
@ -358,6 +360,7 @@ SystemConfigCallback (
|
|||
EFI_STATUS Status;
|
||||
UINTN DataSize;
|
||||
UINT8 OsSelection;
|
||||
EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL *FormBrowserEx2;
|
||||
|
||||
StringBuffer1 = AllocateZeroPool (200 * sizeof (CHAR16));
|
||||
ASSERT (StringBuffer1 != NULL);
|
||||
|
@ -474,7 +477,7 @@ SystemConfigCallback (
|
|||
Status = gRT->SetVariable (
|
||||
L"Setup",
|
||||
&mNormalSetupGuid,
|
||||
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof(SYSTEM_CONFIGURATION),
|
||||
&Private->FakeNvData
|
||||
);
|
||||
|
@ -525,7 +528,7 @@ SystemConfigCallback (
|
|||
Status = gRT->SetVariable (
|
||||
L"Setup",
|
||||
&mNormalSetupGuid,
|
||||
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof(SYSTEM_CONFIGURATION),
|
||||
&Private->FakeNvData
|
||||
);
|
||||
|
@ -596,33 +599,31 @@ SystemConfigCallback (
|
|||
// If the user hits the YES Response key
|
||||
//
|
||||
if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
|
||||
//
|
||||
// Load default
|
||||
//
|
||||
|
||||
Status = gBS->LocateProtocol (&gEdkiiFormBrowserEx2ProtocolGuid, NULL, (VOID **) &FormBrowserEx2);
|
||||
FormBrowserEx2->ExecuteAction(BROWSER_ACTION_DEFAULT, EFI_HII_DEFAULT_CLASS_STANDARD);
|
||||
|
||||
FakeNvData = AllocateZeroPool (sizeof(SYSTEM_CONFIGURATION));
|
||||
|
||||
if (FakeNvData == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
SizeOfNvStore = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupDefault",
|
||||
&mNormalSetupGuid,
|
||||
NULL,
|
||||
&SizeOfNvStore,
|
||||
FakeNvData
|
||||
);
|
||||
|
||||
Status = HiiGetBrowserData (
|
||||
&mSystemConfigGuid,
|
||||
mVariableName,
|
||||
sizeof (SYSTEM_CONFIGURATION),
|
||||
(UINT8 *) FakeNvData
|
||||
);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
if(SizeOfNvStore >= sizeof(SYSTEM_CONFIGURATION)) {
|
||||
Status = gRT->SetVariable (
|
||||
L"Setup",
|
||||
&mNormalSetupGuid,
|
||||
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof(SYSTEM_CONFIGURATION),
|
||||
FakeNvData
|
||||
);
|
||||
}
|
||||
Status = gRT->SetVariable (
|
||||
L"Setup",
|
||||
&mNormalSetupGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof(SYSTEM_CONFIGURATION),
|
||||
FakeNvData
|
||||
);
|
||||
}
|
||||
|
||||
FreePool (FakeNvData);
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
gEfiHiiConfigRoutingProtocolGuid ## CONSUMED
|
||||
gEfiHiiConfigAccessProtocolGuid ## PRODUCED
|
||||
gEfiDevicePathToTextProtocolGuid ## CONSUMED
|
||||
gEdkiiFormBrowserEx2ProtocolGuid
|
||||
|
||||
gEfiDataHubProtocolGuid
|
||||
gEfiLegacyBiosProtocolGuid
|
||||
|
|
|
@ -1750,7 +1750,18 @@ SetupInfo (void)
|
|||
&mSystemConfiguration
|
||||
);
|
||||
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = gRT->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiNormalSetupGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
//
|
||||
// Update HOB variable for PCI resource information
|
||||
|
|
|
@ -170,6 +170,18 @@ InitializePlatformSmm (
|
|||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = SystemTable->RuntimeServices->GetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiSetupVariableGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
if (!EFI_ERROR(Status)) {
|
||||
mAcLossVariable = mSystemConfiguration.StateAfterG3;
|
||||
|
||||
|
@ -848,7 +860,20 @@ EnableS5WakeOnRtc()
|
|||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
if (EFI_ERROR(Status) || (!mSystemConfiguration.WakeOnRtcS5)) {
|
||||
if (EFI_ERROR(Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
|
||||
//The setup variable is corrupted
|
||||
VarSize = sizeof(SYSTEM_CONFIGURATION);
|
||||
Status = mSmmVariable->SmmGetVariable(
|
||||
L"SetupRecovery",
|
||||
&gEfiSetupVariableGuid,
|
||||
NULL,
|
||||
&VarSize,
|
||||
&mSystemConfiguration
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
if (!mSystemConfiguration.WakeOnRtcS5) {
|
||||
return;
|
||||
}
|
||||
mWakeupDay = HexToBcd((UINT8)mSystemConfiguration.RTCWakeupDate);
|
||||
|
|
|
@ -217,10 +217,10 @@ echo Running fce...
|
|||
|
||||
pushd %PLATFORM_PACKAGE%
|
||||
:: Extract Hii data from build and store in HiiDefaultData.txt
|
||||
fce read -i ..\%BUILD_PATH%\FV\Vlv.fd > ..\%BUILD_PATH%\FV\HiiDefaultData.txt 1>>EDK2.log 2>&1
|
||||
fce read -i ..\%BUILD_PATH%\FV\Vlv.fd > ..\%BUILD_PATH%\FV\HiiDefaultData.txt
|
||||
|
||||
:: copy the Setup variable to the SetupDefault variable and save changes to VlvXXX.fd
|
||||
fce mirror -i ..\%BUILD_PATH%\FV\Vlv.fd -o ..\%BUILD_PATH%\FV\Vlv%Arch%.fd Setup SetupDefault 1>>EDK2.log 2>&1
|
||||
:: save changes to VlvXXX.fd
|
||||
fce update -i ..\%BUILD_PATH%\FV\Vlv.fd -s ..\%BUILD_PATH%\FV\HiiDefaultData.txt -o ..\%BUILD_PATH%\FV\Vlv%Arch%.fd
|
||||
|
||||
popd
|
||||
|
||||
|
|
Loading…
Reference in New Issue