Skip to content

Commit

Permalink
ResetSystemLib: Fix Cold Reset
Browse files Browse the repository at this point in the history
The ColdReset was actually doing a WarmReset.
Hardcode the correct settings for Cold and Warm reset instead of using
some wrong defined value from FADT.

Signed-off-by: Patrick Rudolph <[email protected]>
  • Loading branch information
PatrickRudolph authored and benjamindoron committed Jun 14, 2024
1 parent 37b4fdc commit 06f1483
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ ResetCold (
VOID
)
{
IoWrite8 ((UINTN)mAcpiBoardInfo.ResetRegAddress, mAcpiBoardInfo.ResetValue);
if ((UINTN)mAcpiBoardInfo.ResetRegAddress == 0xcf9) {
IoWrite8 (0xcf9, 0xe);
} else {
IoWrite8 ((UINTN)mAcpiBoardInfo.ResetRegAddress, mAcpiBoardInfo.ResetValue);
}
CpuDeadLoop ();
}

Expand All @@ -75,7 +79,11 @@ ResetWarm (
VOID
)
{
IoWrite8 ((UINTN)mAcpiBoardInfo.ResetRegAddress, mAcpiBoardInfo.ResetValue);
if ((UINTN)mAcpiBoardInfo.ResetRegAddress == 0xcf9) {
IoWrite8 (0xcf9, 0x6);
} else {
IoWrite8 ((UINTN)mAcpiBoardInfo.ResetRegAddress, mAcpiBoardInfo.ResetValue);
}
CpuDeadLoop ();
}

Expand Down

0 comments on commit 06f1483

Please sign in to comment.