diff options
author | zwei4 <david.wei@intel.com> | 2017-02-13 16:44:02 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-05-09 13:03:10 +0800 |
commit | 399efb82eb2677e88647ad1e93541e7b871d1928 (patch) | |
tree | 61b6a7c63bf09dc8da7a7aa3563ce000e777683f /Platform/BroxtonPlatformPkg/Common/Library | |
parent | 80462ca33583a017fc44aa5b212441d8b35d456a (diff) | |
download | edk2-platforms-399efb82eb2677e88647ad1e93541e7b871d1928.tar.xz |
SPI Flash Lock.
Cleanup code about locking SPI Flash; Change the default value of BIOS Lock setup option to FALSE.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Wei <david.wei@intel.com>
Diffstat (limited to 'Platform/BroxtonPlatformPkg/Common/Library')
-rw-r--r-- | Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspScPolicyInitLib.c | 4 | ||||
-rw-r--r-- | Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiScPolicyUpdate.c | 39 |
2 files changed, 3 insertions, 40 deletions
diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspScPolicyInitLib.c b/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspScPolicyInitLib.c index 47ec706006..640900688d 100644 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspScPolicyInitLib.c +++ b/Platform/BroxtonPlatformPkg/Common/Library/PeiFspPolicyInitLib/PeiFspScPolicyInitLib.c @@ -1,7 +1,7 @@ /** @file
Implementation of Fsp SC Policy Initialization.
- Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -601,7 +601,7 @@ PeiFspScPolicyInit ( // Flash Protection Range Register initialization
//
for (Index = 0; Index < SC_FLASH_PROTECTED_RANGES; Index++) {
- FspsUpd->FspsConfig.WriteProtectionEnable[Index] = TRUE;
+ FspsUpd->FspsConfig.WriteProtectionEnable[Index] = SystemConfiguration->ScBiosLock == TRUE ? TRUE : FALSE;
FspsUpd->FspsConfig.ReadProtectionEnable[Index] = FALSE;
}
diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiScPolicyUpdate.c b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiScPolicyUpdate.c index 6d9fc52de5..c98a8df657 100644 --- a/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiScPolicyUpdate.c +++ b/Platform/BroxtonPlatformPkg/Common/Library/PeiPolicyUpdateLib/PeiScPolicyUpdate.c @@ -1,7 +1,7 @@ /** @file
This file is SampleCode of the library for Intel PCH PEI Policy initialization.
- Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -277,13 +277,11 @@ UpdatePeiScPolicy ( UINT16 BoardId;
UINTN VariableSize;
SYSTEM_CONFIGURATION SystemConfiguration;
- UINT8 Index;
UINT8 PortIndex;
UINT32 SpiHsfsReg;
UINT32 SpiFdodReg;
UINT8 DevIndex;
UINT8 HdaIndex;
- BOOLEAN FlashProtectionEnabled;
SC_GENERAL_CONFIG *GeneralConfig;
SC_SATA_CONFIG *SataConfig;
SC_PCIE_CONFIG *PcieConfig;
@@ -729,41 +727,6 @@ UpdatePeiScPolicy ( }
PmConfig->PowerButterDebounceMode = SystemConfiguration.PowerButterDebounceMode;
- if ((GetBxtSeries() == BxtP) && (IsSpiBoot ())) {
- //
- // Configure Flash Protection Range Registers
- //
- FlashProtectionEnabled = SystemConfiguration.FprrEnable == TRUE ? TRUE : FALSE;
-
- //
- // Enabling Flash Protection Range Registers
- // Enable FPRR policy and set up ranges on non-Capsule Update flow with Flash Wear-Out Protection enabled
- // PrintFlashProtectionConfig() dumps FPRR information during ScPrintPolicyPpi()
- // FPRR bit is enabled by default as per Platform policy, except that when system is in recovery mode or FDO is enabled. In this case this will be disabled as part of Firmware Update / Recovery update
- //
- if (FlashProtectionEnabled && (FdoEnabledGuidHob == NULL)) {
- //
- // Flash Protection Range Register initialization
- //
- for (Index = 0; Index < SC_FLASH_PROTECTED_RANGES; Index++) {
- FlashProtectionConfig->ProtectRange[Index].WriteProtectionEnable = TRUE;
- FlashProtectionConfig->ProtectRange[Index].ReadProtectionEnable = FALSE;
- }
-
- DEBUG ((EFI_D_INFO, "IbbOffset = %x , IbbSize = %x\n", FixedPcdGet32 (PcdFlashIbbRegionMappedBase), FixedPcdGet32 (PcdFlashIbbRegionSize)));
- DEBUG ((EFI_D_INFO, "ObbOffset = %x , ObbSize = %x\n", FixedPcdGet32 (PcdFlashObbRegionMappedBase), FixedPcdGet32 (PcdFlashObbRegionSize)));
-
- //
- // Assign FPRR ranges
- //
- FlashProtectionConfig->ProtectRange[0].ProtectedRangeBase = (UINT16) ((FixedPcdGet32 (PcdFlashIbbRegionMappedBase) - FixedPcdGet32 (PcdFlashAreaBaseAddress)) >> 12);
- FlashProtectionConfig->ProtectRange[0].ProtectedRangeLimit = (UINT16) ((FixedPcdGet32 (PcdFlashIbbRegionMappedBase) - FixedPcdGet32 (PcdFlashAreaBaseAddress) + FixedPcdGet32 (PcdFlashIbbRegionSize) - 1) >> 12);
- FlashProtectionConfig->ProtectRange[1].ProtectedRangeBase = (UINT16) ((FixedPcdGet32 (PcdFlashObbRegionMappedBase) - FixedPcdGet32 (PcdFlashAreaBaseAddress)) >> 12);
- FlashProtectionConfig->ProtectRange[1].ProtectedRangeLimit = (UINT16) ((FixedPcdGet32 (PcdFlashObbRegionMappedBase) - FixedPcdGet32 (PcdFlashAreaBaseAddress) + FixedPcdGet32 (PcdFlashObbRegionSize) - 1) >> 12);
- } else {
- DEBUG ((DEBUG_INFO, " BIOS FPRR is not done -FDO ASSERT Status "));
- }
- }
DciConfig->DciEn = SystemConfiguration.DciEn;
DciConfig->DciAutoDetect = SystemConfiguration.DciAutoDetect;
|