summaryrefslogtreecommitdiff
path: root/OvmfPkg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2013-07-03 09:26:49 +0000
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2013-07-03 09:26:49 +0000
commitc30f1e09745c64bb8b4b7bb3ae4cb032b3603ce6 (patch)
treed477ad6d938083025a272bd5708651c995552cab /OvmfPkg
parent94c4575cd0ea35607f774dc3533e579542a32f72 (diff)
downloadedk2-platforms-c30f1e09745c64bb8b4b7bb3ae4cb032b3603ce6.tar.xz
OvmfPkg EmuVariableFvbRuntimeDxe: Let FaultTolerantWriteDxe to init working block header.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14458 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg')
-rw-r--r--OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c51
1 files changed, 1 insertions, 50 deletions
diff --git a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c b/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c
index 72efba0910..c7c3fcb36f 100644
--- a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c
+++ b/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c
@@ -2,7 +2,7 @@
Firmware Block Services to support emulating non-volatile variables
by pretending that a memory buffer is storage for the NV variables.
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, 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
which accompanies this distribution. The full text of the license may be found at
@@ -781,52 +781,6 @@ InitializeFvAndVariableStoreHeaders (
Fv->Checksum = CalculateCheckSum16 (Ptr, Fv->HeaderLength);
}
-
-/**
- Initializes the Fault Tolerant Write data structure
-
- This data structure is used by the Fault Tolerant Write driver.
-
- @param[in] Buffer - Location for the FTW data structure
-
-**/
-VOID
-InitializeFtwState (
- IN VOID *Buffer
- )
-{
- EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *Hdr;
- UINT32 TempCrc;
- STATIC EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER DefaultFtw = {
- EFI_SYSTEM_NV_DATA_FV_GUID, // EFI_GUID Signature;
- ERASED_UINT32, // UINT32 Crc;
- ERASED_BIT, // UINT8 WorkingBlockValid : 1;
- ERASED_BIT, // UINT8 WorkingBlockInvalid : 1;
- 0, // UINT8 Reserved : 6;
- { 0, 0, 0 }, // UINT8 Reserved3[3];
- FTW_WRITE_QUEUE_SIZE // UINT64 WriteQueueSize;
- };
-
- CopyMem (Buffer, (VOID*) &DefaultFtw, sizeof (DefaultFtw));
-
- Hdr = (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER*) Buffer;
-
- //
- // Calculate checksum.
- //
- // The Crc, WorkingBlockValid and WorkingBlockInvalid bits should
- // be set to the erased state before computing the checksum.
- //
- gBS->CalculateCrc32 (Buffer, sizeof (DefaultFtw), &TempCrc);
- Hdr->Crc = TempCrc;
-
- //
- // Mark as valid.
- //
- Hdr->WorkingBlockValid = NOT_ERASED_BIT;
-}
-
-
/**
Main entry point.
@@ -908,9 +862,6 @@ FvbInitialize (
// Initialize the Fault Tolerant Write data area
//
SubPtr = (VOID*) ((UINT8*) Ptr + PcdGet32 (PcdVariableStoreSize));
- if (Initialize) {
- InitializeFtwState (SubPtr);
- }
PcdSet32 (PcdFlashNvStorageFtwWorkingBase, (UINT32)(UINTN) SubPtr);
//