summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal/FirmwareVolume
diff options
context:
space:
mode:
authorxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-10 12:28:02 +0000
committerxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-10 12:28:02 +0000
commit202c5d55e5a5a1f065038cda8316ad36293aa6bb (patch)
treebb5348825b30ebfd14566d2d87fc639a9e928c49 /EdkModulePkg/Universal/FirmwareVolume
parent382aab1c37276a1274e62469301ee27374cbd047 (diff)
downloadedk2-platforms-202c5d55e5a5a1f065038cda8316ad36293aa6bb.tar.xz
Modify FtwLite and Variable DXE driver to use PCD instead of FlashMap HOB
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1236 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal/FirmwareVolume')
-rw-r--r--EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c28
-rw-r--r--EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.msa25
2 files changed, 29 insertions, 24 deletions
diff --git a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c
index 0d20e88058..f4c7e9199c 100644
--- a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c
+++ b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c
@@ -632,10 +632,8 @@ InitializeFtwLite (
UINTN Length;
EFI_STATUS Status;
UINTN Offset;
- EFI_FLASH_MAP_ENTRY_DATA *FlashMapEntry;
EFI_FV_BLOCK_MAP_ENTRY *FvbMapEntry;
UINT32 LbaIndex;
- EFI_PEI_HOB_POINTERS GuidHob;
//
// Allocate Private data of this driver,
@@ -668,29 +666,11 @@ InitializeFtwLite (
FtwLiteDevice->FtwLastRecord = NULL;
- FtwLiteDevice->SpareAreaLength = 0;
- FtwLiteDevice->WorkSpaceLength = 0;
+ FtwLiteDevice->WorkSpaceAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwWorkingBase);
+ FtwLiteDevice->WorkSpaceLength = (UINTN) PcdGet32 (PcdFlashNvStorageFtwWorkingSize);
- GuidHob.Raw = GetHobList ();
- while (NULL != (GuidHob.Raw = GetNextGuidHob (&gEfiFlashMapHobGuid, GuidHob.Raw))) {
- FlashMapEntry = (EFI_FLASH_MAP_ENTRY_DATA *) GET_GUID_HOB_DATA (GuidHob.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;
- }
-
- GuidHob.Raw = GET_NEXT_HOB (GuidHob);
- }
+ FtwLiteDevice->SpareAreaAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwSpareBase);
+ FtwLiteDevice->SpareAreaLength = (UINTN) PcdGet32 (PcdFlashNvStorageFtwSpareSize);
ASSERT ((FtwLiteDevice->WorkSpaceLength != 0) && (FtwLiteDevice->SpareAreaLength != 0));
diff --git a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.msa b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.msa
index 90f6ad8482..3505b5eef3 100644
--- a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.msa
+++ b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.msa
@@ -31,6 +31,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
</ModuleDefinitions>
<LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>PcdLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>DebugLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
@@ -96,4 +99,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
<ModuleEntryPoint>InitializeFtwLite</ModuleEntryPoint>
</Extern>
</Externs>
+ <PcdCoded>
+ <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">
+ <C_Name>PcdFlashNvStorageFtwSpareBase</C_Name>
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>To get base address of the FTW spare block section in NV firmware volume.</HelpText>
+ </PcdEntry>
+ <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">
+ <C_Name>PcdFlashNvStorageFtwSpareSize</C_Name>
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>To get size of the FTW spare block section in NV firmware volume.</HelpText>
+ </PcdEntry>
+ <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">
+ <C_Name>PcdFlashNvStorageFtwWorkingBase</C_Name>
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>To get base address of the FTW working block section in NV firmware volume.</HelpText>
+ </PcdEntry>
+ <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">
+ <C_Name>PcdFlashNvStorageFtwWorkingSize</C_Name>
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>To get size of the FTW working block section in NV firmware volume.</HelpText>
+ </PcdEntry>
+ </PcdCoded>
</ModuleSurfaceArea> \ No newline at end of file