Skip to content

Commit

Permalink
Initialize the FRB2 watchdog timer in DXE phase if PEI is not support…
Browse files Browse the repository at this point in the history
…ed. (#257)
  • Loading branch information
ScottieKuo authored Sep 20, 2024
1 parent cbd7225 commit 9768b85
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion IpmiFeaturePkg/IpmiWatchdog/Dxe/WatchdogDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,34 @@ IpmiWatchdogDxeEntryPoint (
}

//
// Report the current status of the watchdog timer.
// Retrieve the current status of the watchdog timer.
//
Status = IpmiGetWatchdogTimer (&WatchdogTimer);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: Failed to get Watchdog Timer.\n", __FUNCTION__));
return Status;
}

DEBUG ((
DEBUG_VERBOSE,
"IPMI Watchdog timer status: %a\n",
WatchdogTimer.TimerUse.Bits.TimerRunning ? "Running" : "Stopped"
));

//
// For BIOS not having PEI phase, enable IPMI FRB2 watchdog timer here.
//
if ((mWatchdogPolicy.Frb2Enabled) && (WatchdogTimer.TimerUse.Bits.TimerRunning == 0)) {
IpmiEnableWatchdogTimer (
IPMI_WATCHDOG_TIMER_BIOS_FRB2,
mWatchdogPolicy.Frb2TimeoutAction,
IPMI_WATCHDOG_TIMER_EXPIRATION_FLAG_BIOS_FRB2,
mWatchdogPolicy.Frb2TimeoutSeconds
);
}

//
// Retrieve the current status of the watchdog timer again.
//
Status = IpmiGetWatchdogTimer (&WatchdogTimer);
if (EFI_ERROR (Status)) {
Expand Down

0 comments on commit 9768b85

Please sign in to comment.