From 8f6b77e43d4c7168f7d44030cc57dfff1f5bb91e Mon Sep 17 00:00:00 2001 From: Nhi Pham Date: Fri, 27 Sep 2024 14:28:15 +0700 Subject: [PATCH] AmpereAltraPkg/FlashPei: Erase user setting NVPARAM when UUID changed 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 --- .../Ampere/AmpereAltraPkg/Drivers/FlashPei/FlashPei.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/FlashPei/FlashPei.c b/Silicon/Ampere/AmpereAltraPkg/Drivers/FlashPei/FlashPei.c index 40ff617cc0..f96958bfc2 100644 --- a/Silicon/Ampere/AmpereAltraPkg/Drivers/FlashPei/FlashPei.c +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/FlashPei/FlashPei.c @@ -18,6 +18,7 @@ #include #include #include +#include #include /** @@ -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"));