diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-07-10 14:51:34 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-07-10 14:51:34 +0000 |
commit | 276be2de38a6149d190553d706ab9809192c9b66 (patch) | |
tree | 9a7d8f6bb64872bffac379c370db926c684f7628 /MdeModulePkg/Universal/FirmwareVolume | |
parent | 0a30ba0f560fb63eb411174298209dc9108e9ef1 (diff) | |
download | edk2-276be2de38a6149d190553d706ab9809192c9b66.zip edk2-276be2de38a6149d190553d706ab9809192c9b66.tar.gz edk2-276be2de38a6149d190553d706ab9809192c9b66.tar.bz2 |
1) Use Dynamic Pcd for hold the base address and length of Flash-related block.
2) Remove flash map hob for Nt32Pkg platform
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3178 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/FirmwareVolume')
-rw-r--r-- | MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c | 35 | ||||
-rw-r--r-- | MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.h | 3 |
2 files changed, 6 insertions, 32 deletions
diff --git a/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c b/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c index a2ba2b4..38fe11d 100644 --- a/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c +++ b/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c @@ -634,8 +634,7 @@ InitializeFtwLite ( UINTN Offset;
EFI_FV_BLOCK_MAP_ENTRY *FvbMapEntry;
UINT32 LbaIndex;
- EFI_PEI_HOB_POINTERS FvHob;
- EFI_FLASH_MAP_ENTRY_DATA *FlashMapEntry;
+
//
// Allocate Private data of this driver,
// INCLUDING THE FtwWorkSpace[FTW_WORK_SPACE_SIZE].
@@ -666,34 +665,12 @@ InitializeFtwLite ( FtwLiteDevice->FtwWorkSpaceHeader = (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *) FtwLiteDevice->FtwWorkSpace;
FtwLiteDevice->FtwLastRecord = NULL;
-
- //
- // BUGBUG: Here should use Pcd after build tool support dynamic PCD
- //
- FtwLiteDevice->SpareAreaLength = 0;
- FtwLiteDevice->WorkSpaceLength = 0;
- FvHob.Raw = GetHobList ();
- while ((FvHob.Raw = GetNextGuidHob (&gEfiFlashMapHobGuid, FvHob.Raw)) != NULL) {
- FlashMapEntry = (EFI_FLASH_MAP_ENTRY_DATA *) GET_GUID_HOB_DATA (FvHob.Guid);
-
- //
- // Get the FTW work space Flash Map SUB area
- //
- if ((FlashMapEntry->AreaType == EFI_FLASH_AREA_FTW_STATE) && (FlashMapEntry->NumEntries == 1)) {
- FtwLiteDevice->WorkSpaceAddress = FlashMapEntry->Entries[0].Base;
- FtwLiteDevice->WorkSpaceLength = (UINTN) FlashMapEntry->Entries[0].Length;
- }
- //
- // Get the FTW backup SUB area
- //
- if ((FlashMapEntry->AreaType == EFI_FLASH_AREA_FTW_BACKUP) && (FlashMapEntry->NumEntries == 1)) {
- FtwLiteDevice->SpareAreaAddress = FlashMapEntry->Entries[0].Base;
- FtwLiteDevice->SpareAreaLength = (UINTN) FlashMapEntry->Entries[0].Length;
- }
-
- FvHob.Raw = GET_NEXT_HOB (FvHob);
- }
+ FtwLiteDevice->WorkSpaceAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwWorkingBase);
+ FtwLiteDevice->WorkSpaceLength = (UINTN) PcdGet32 (PcdFlashNvStorageFtwWorkingSize);
+
+ FtwLiteDevice->SpareAreaAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwSpareBase);
+ FtwLiteDevice->SpareAreaLength = (UINTN) PcdGet32 (PcdFlashNvStorageFtwSpareSize);
ASSERT ((FtwLiteDevice->WorkSpaceLength != 0) && (FtwLiteDevice->SpareAreaLength != 0));
diff --git a/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.h b/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.h index 0701532..8bc122d 100644 --- a/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.h +++ b/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.h @@ -38,7 +38,6 @@ Abstract: //
#include <Protocol/PciRootBridgeIo.h>
#include <Guid/SystemNvDataGuid.h>
-#include <Guid/FlashMapHob.h>
#include <Protocol/FaultTolerantWriteLite.h>
#include <Protocol/FirmwareVolumeBlock.h>
//
@@ -50,10 +49,8 @@ Abstract: #include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
-#include <Library/HobLib.h>
#include <Common/WorkingBlockHeader.h>
-#include <Common/FlashMap.h>
#define EFI_D_FTW_LITE EFI_D_ERROR
#define EFI_D_FTW_INFO EFI_D_INFO
|