Stop TCO Timer in Beginning of FWU PLD

Stop TCO timer in beginning of FWU PLD
to ensure it is started without error

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
This commit is contained in:
Sean McGinn
2022-08-30 16:49:14 -07:00
committed by Guo Dong
parent 22cfbc8803
commit 6013284753
3 changed files with 16 additions and 4 deletions

View File

@@ -289,8 +289,9 @@ NormalBootPath (
PrintStackHeapInfo ();
DEBUG_CODE_END ();
// Stop timer so boot retries stop
if (PcdGetBool (PcdSblResiliencyEnabled)) {
// FWU payload is the only payload in SBL scope, so stop TCO
// timer if another payload is set to be launched
if (PcdGetBool (PcdSblResiliencyEnabled) && GetBootMode () != BOOT_ON_FLASH_UPDATE) {
StopTcoTimer ();
ClearFailedBootCount ();
}
@@ -362,8 +363,9 @@ S3ResumePath (
AddMeasurePoint (0x31F0);
// Stop timer so boot retries stop
if (PcdGetBool (PcdSblResiliencyEnabled)) {
// FWU payload is the only payload in SBL scope, so stop TCO
// timer if another payload is set to be launched
if (PcdGetBool (PcdSblResiliencyEnabled) && GetBootMode () != BOOT_ON_FLASH_UPDATE) {
StopTcoTimer ();
ClearFailedBootCount ();
}

View File

@@ -31,6 +31,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Guid/OsBootOptionGuid.h>
#include <Library/BootGuardLib.h>
#include <Library/WatchDogTimerLib.h>
#include <Library/TcoTimerLib.h>
#include "FirmwareUpdateHelper.h"
UINT32 mSblImageBiosRgnOffset;
@@ -1769,6 +1770,14 @@ PayloadMain (
//
(VOID) PcdSet32S (PcdFwUpdStatusBase, mSblImageBiosRgnOffset + (FlashMap->RomSize - (~RsvdBase + 1)));
//
// Stop TCO timer here as SPI read/write timings are highly variable
//
if (PcdGetBool (PcdSblResiliencyEnabled)) {
StopTcoTimer ();
ClearFailedBootCount ();
}
//
// Perform firmware recovery/update
//

View File

@@ -55,6 +55,7 @@
TimerLib
BootGuardLib
WatchDogTimerLib
TcoTimerLib
[Guids]
gLoaderMemoryMapInfoGuid