Remove SecureBoot setup option.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: David Wei <david....@intel.com>
CC: Mike Wu  <mike...@intel.com>
CC: Mang Guo <mang....@intel.com>
CC: Steele Kelly <kelly.ste...@intel.com>
---
 .../Smbios/SmBiosMiscDxe/MiscOemType0x94Function.c | 11 +++++-
 .../Smbios/SmBiosMiscDxe/SmBiosMiscDxe.inf         |  1 +
 .../Common/Include/Guid/SetupVariable.h            |  2 +-
 .../PeiPlatformConfigUpdateLib.c                   |  3 +-
 .../PlatformSettings/PlatformSetupDxe/Boot.vfi     |  7 ----
 .../PlatformSetupDxe/PlatformSetupDxe.c            |  1 -
 .../PlatformSetupDxe/SetupInfoRecords.c            | 45 ----------------------
 7 files changed, 13 insertions(+), 57 deletions(-)

diff --git 
a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94Function.c
 
b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94Function.c
index b399a5f81b..e96e3fb5a0 100644
--- 
a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94Function.c
+++ 
b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94Function.c
@@ -548,6 +548,7 @@ UpdatePlatformInformation (
   MRC_PARAMS_SAVE_RESTORE  *MemInfoHob = NULL;
   UINT32                   MrcVersion;
   UINTN                    Index;
+  UINT8                    SecureBoot;
 
   DEBUG ((EFI_D_INFO, "Executing SMBIOS T0x94 Update.\n"));
   //
@@ -666,10 +667,18 @@ UpdatePlatformInformation (
                   );
   ASSERT_EFI_ERROR (Status);
 
+  DataSize = sizeof (SecureBoot);
+  Status = gRT->GetVariable (
+                  EFI_SECURE_BOOT_MODE_NAME,
+                  &gEfiGlobalVariableGuid,
+                  NULL,
+                  &DataSize,
+                  &SecureBoot
+                  );
   //
   // Secure boot
   //
-  Data8 = SystemConfiguration.SecureBoot;
+  Data8 = SecureBoot;
   UnicodeSPrint (Buffer, sizeof(Buffer), L"%x", Data8);
   HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SECURE_BOOT_VALUE), Buffer, 
NULL);
 
diff --git 
a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/SmBiosMiscDxe.inf
 
b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/SmBiosMiscDxe.inf
index 31fd8406b2..6de2d68b57 100644
--- 
a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/SmBiosMiscDxe.inf
+++ 
b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/SmBiosMiscDxe.inf
@@ -120,6 +120,7 @@
   gIFWIVersionHobGuid
   gEfiPlatformInfoGuid
   gFspNonVolatileStorageHobGuid  ##CONSUMES
+  gEfiGlobalVariableGuid
 
 [Protocols]
   gEfiSmbiosProtocolGuid                        # PROTOCOL ALWAYS_CONSUMED
diff --git a/Platform/BroxtonPlatformPkg/Common/Include/Guid/SetupVariable.h 
b/Platform/BroxtonPlatformPkg/Common/Include/Guid/SetupVariable.h
index 4f5eeb1c0f..19b948c0ea 100644
--- a/Platform/BroxtonPlatformPkg/Common/Include/Guid/SetupVariable.h
+++ b/Platform/BroxtonPlatformPkg/Common/Include/Guid/SetupVariable.h
@@ -474,7 +474,7 @@ typedef struct {
   UINT8         CapOrVoltFlag;
   UINT8         BootOnInvalidBatt;
   UINT8         ScramblerSupport;
-  UINT8         SecureBoot;
+  UINT8         SecureBootReserved;
   UINT8         SecureBootCustomMode;
   UINT8         MaxPkgCState;
   UINT8         PanelScaling;
diff --git 
a/Platform/BroxtonPlatformPkg/Common/Library/PeiPlatformConfigUpdateLib/PeiPlatformConfigUpdateLib.c
 
b/Platform/BroxtonPlatformPkg/Common/Library/PeiPlatformConfigUpdateLib/PeiPlatformConfigUpdateLib.c
index f56097f3a7..a003b278b4 100644
--- 
a/Platform/BroxtonPlatformPkg/Common/Library/PeiPlatformConfigUpdateLib/PeiPlatformConfigUpdateLib.c
+++ 
b/Platform/BroxtonPlatformPkg/Common/Library/PeiPlatformConfigUpdateLib/PeiPlatformConfigUpdateLib.c
@@ -181,10 +181,9 @@ UpdateSetupDataValues (
   }
 
   if (FdoEnabledGuidHob != NULL) {
-    PreDefaultSetupData->SecureBoot = FALSE;
     PreDefaultSetupData->FprrEnable = FALSE;
     PreDefaultSetupData->ScBiosLock = FALSE;
-    DEBUG ((EFI_D_INFO, "SPI FDO mode is enabled. Disabling SecureBoot, 
FprrEnable, and ScBiosLock.\n"));
+    DEBUG ((EFI_D_INFO, "SPI FDO mode is enabled. Disabling FprrEnable, and 
ScBiosLock.\n"));
   }
 
   Status = GetSecureNfcInfo (PreDefaultSetupData);
diff --git 
a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/Boot.vfi 
b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/Boot.vfi
index 6b6f262efd..c04d8d6a2a 100644
--- 
a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/Boot.vfi
+++ 
b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/Boot.vfi
@@ -44,13 +44,6 @@ form formid = BOOT_CONFIGURATION_FORM_ID,
   endoneof;
   endif; // suppressif
 
-  oneof varid  = Setup.SecureBoot,
-    prompt   = STRING_TOKEN(STR_SECURITY_BOOT_PROMPT),
-    help     = STRING_TOKEN(STR_SECURITY_BOOT_HELP),
-    option text = STRING_TOKEN(STR_DISABLE), value=0, flags=DEFAULT | 
MANUFACTURING | RESET_REQUIRED;
-    option text = STRING_TOKEN(STR_ENABLE),  value=1, flags=0 | RESET_REQUIRED;
-  endoneof;
-
   oneof varid  = Setup.QuietBoot,
     prompt   = STRING_TOKEN(STR_QUIETBOOT_PROMPT),
     help     = STRING_TOKEN(STR_QUIETBOOT_HELP),
diff --git 
a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/PlatformSetupDxe.c
 
b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/PlatformSetupDxe.c
index b235306722..15d3a91fc0 100644
--- 
a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/PlatformSetupDxe.c
+++ 
b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/PlatformSetupDxe.c
@@ -107,7 +107,6 @@ LoadOsDefaultValues (
   )
 {
   Private->FakeNvData.GOPEnable                  = TRUE;
-  Private->FakeNvData.SecureBoot                 = FALSE;
   Private->FakeNvData.Cg8254                     = FALSE;
   Private->FakeNvData.LpssI2C7Enabled            = 1;
   Private->FakeNvData.LpssSpi1Enabled            = 1;
diff --git 
a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/SetupInfoRecords.c
 
b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/SetupInfoRecords.c
index 458131c559..4e921c2eaa 100644
--- 
a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/SetupInfoRecords.c
+++ 
b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/SetupInfoRecords.c
@@ -1723,23 +1723,6 @@ CheckSystemConfigLoad (
   EFI_STATUS              Status;
   SEC_OPERATION_PROTOCOL  *SeCOp;
   SEC_INFOMATION          SeCInfo;
-  UINT8                   SecureBoot;
-  UINTN                   DataSize;
-
-  DataSize = sizeof (SecureBoot);
-  Status = gRT->GetVariable (
-                  EFI_SECURE_BOOT_MODE_NAME,
-                  &gEfiGlobalVariableGuid,
-                  NULL,
-                  &DataSize,
-                  &SecureBoot
-                  );
-
-  if (EFI_ERROR (Status)) {
-    SystemConfigPtr->SecureBoot = 0;
-  } else {
-    SystemConfigPtr->SecureBoot = SecureBoot;
-  }
 
   Status = gBS->LocateProtocol (
                   &gEfiSeCOperationProtocolGuid,
@@ -1806,8 +1789,6 @@ CheckSystemConfigSave (
   EFI_STATUS              Status;
   SEC_OPERATION_PROTOCOL  *SeCOp;
   SEC_INFOMATION          SeCInfo;
-  UINT8                   SecureBootCfg;
-  UINTN                   DataSize;
 
   Status = gBS->LocateProtocol (
                   &gEfiSeCOperationProtocolGuid,
@@ -1826,32 +1807,6 @@ CheckSystemConfigSave (
 
   Status = SeCOp->SetPlatformSeCInfo (&SeCInfo);
 
-  //
-  // Secure Boot configuration changes
-  //
-  DataSize = sizeof (SecureBootCfg);
-  Status = gRT->GetVariable (
-                  EFI_SECURE_BOOT_ENABLE_NAME,
-                  &gEfiSecureBootEnableDisableGuid,
-                  NULL,
-                  &DataSize,
-                  &SecureBootCfg
-                  );
-
-  if (EFI_ERROR (Status)) {
-    SecureBootCfg = 0;
-  }
-
-  if ((SecureBootCfg) != SystemConfigPtr->SecureBoot) {
-    SecureBootCfg = !SecureBootCfg;
-    Status = gRT->SetVariable (
-                    EFI_SECURE_BOOT_ENABLE_NAME,
-                    &gEfiSecureBootEnableDisableGuid,
-                    EFI_VARIABLE_NON_VOLATILE | 
EFI_VARIABLE_BOOTSERVICE_ACCESS,
-                    sizeof (UINT8),
-                    &SecureBootCfg
-                    );
-  }
 
   CheckTPMActivePcrBanks (SystemConfigPtr->TPMSupportedBanks);
   //
-- 
2.14.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to