Skip to content

Commit

Permalink
AmpereAltraPkg/FlashPei: Erase user setting NVPARAM when UUID changed
Browse files Browse the repository at this point in the history
Both the NVRAM and NVPARAM should be expected to be clear to prevent
unbehavior issues when switching between UEFI firmware versions.

Also, a reboot is required after clearing the user setting.

Signed-off-by: Nhi Pham <[email protected]>
  • Loading branch information
nhivp committed Oct 11, 2024
1 parent 698288f commit 8f6b77e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Silicon/Ampere/AmpereAltraPkg/Drivers/FlashPei/FlashPei.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <Library/NVParamLib.h>
#include <Library/PcdLib.h>
#include <Library/PeimEntryPoint.h>
#include <Library/ResetSystemLib.h>
#include <IndustryStandard/Ipmi.h>

/**
Expand Down Expand Up @@ -190,6 +191,14 @@ FlashPeiEntryPoint (
if (EFI_ERROR (Status)) {
return Status;
}

Status = NVParamClrAll ();
if (!EFI_ERROR (Status)) {
//
// Trigger reset to use default NVPARAM
//
ResetCold ();
}
} else {
DEBUG ((DEBUG_INFO, "Identical UUID, copy stored NVRAM to RAM\n"));

Expand Down

0 comments on commit 8f6b77e

Please sign in to comment.