diff options
Diffstat (limited to 'Vlv2TbltDevicePkg/PlatformInitPei')
-rw-r--r-- | Vlv2TbltDevicePkg/PlatformInitPei/BootMode.c | 6 | ||||
-rw-r--r-- | Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Vlv2TbltDevicePkg/PlatformInitPei/BootMode.c b/Vlv2TbltDevicePkg/PlatformInitPei/BootMode.c index 3b94e3b54f..d0e9f3d772 100644 --- a/Vlv2TbltDevicePkg/PlatformInitPei/BootMode.c +++ b/Vlv2TbltDevicePkg/PlatformInitPei/BootMode.c @@ -148,6 +148,7 @@ UpdateBootMode ( volatile UINT32 GpioValue;
BOOLEAN IsFirstBoot;
UINT32 Data32;
+ UINT32 PeiGpioValue;
Status = (*PeiServices)->GetBootMode(
PeiServices,
@@ -168,6 +169,7 @@ UpdateBootMode ( // When this boot is WDT reset, the system needs booting with CrashDump function eanbled.
//
Data32 = IoRead32 (ACPI_BASE_ADDRESS + R_PCH_TCO_STS);
+ PeiGpioValue = DetectGpioPinValue();
//
// Check Power Button, click the power button, the system will boot in fast boot mode,
@@ -202,8 +204,8 @@ UpdateBootMode ( &VarSize,
&SystemConfiguration
);
- if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
- //The setup variable is corrupted
+ if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION) || PeiGpioValue == 0) {
+ //The setup variable is corrupted or detect GPIO_S5_17 Pin is low
VarSize = sizeof(SYSTEM_CONFIGURATION);
Status = Variable->GetVariable(
Variable,
diff --git a/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c b/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c index 6e2d592f5f..27a6b078fc 100644 --- a/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c +++ b/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c @@ -170,6 +170,9 @@ GetSetupVariable ( UINTN VariableSize;
EFI_STATUS Status;
EFI_PEI_READ_ONLY_VARIABLE2_PPI *Variable;
+ UINT32 PeiGpioValue;
+
+ PeiGpioValue = DetectGpioPinValue();
VariableSize = sizeof (SYSTEM_CONFIGURATION);
ZeroMem (SystemConfiguration, sizeof (SYSTEM_CONFIGURATION));
@@ -196,8 +199,8 @@ GetSetupVariable ( &VariableSize,
SystemConfiguration
);
- if (EFI_ERROR (Status) || VariableSize != sizeof(SYSTEM_CONFIGURATION)) {
- //The setup variable is corrupted
+ if (EFI_ERROR (Status) || VariableSize != sizeof(SYSTEM_CONFIGURATION) || PeiGpioValue == 0) {
+ //The setup variable is corrupted or detect GPIO_S5_17 Pin is low
VariableSize = sizeof(SYSTEM_CONFIGURATION);
Status = Variable->GetVariable(
Variable,
|