summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2007-07-06 08:08:57 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2007-07-06 08:08:57 +0000
commite15fbaf473f1b7fda7a34d0158e4f6455660bee7 (patch)
tree8bae29fc859e526302a1808c311063c7dba60a61 /MdeModulePkg
parent9c8403b3f81be91287f87eb9fee767488c9e9c3a (diff)
downloadedk2-platforms-e15fbaf473f1b7fda7a34d0158e4f6455660bee7.tar.xz
1) PcdFlashNvStorageFtwWorkingSize, PcdFlashNvStorageFtwWorkingBase, PcdFlashNvStorageFtwSpareSize, PcdFlashNvStorageFtwSpareBase, PcdFlashNvStorageVariableSize PcdFlashNvStorageVariableBase should in gEfiMdeModulePkgTokenSpaceGuid.
2) Use FlashMapHob to get the address and length of FV instead of using PCD. 3) Use hard code environment in WinNtBusDriver but not dynamic PCD. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3106 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/MdeModulePkg.dec36
-rw-r--r--MdeModulePkg/MdeModulePkg.dsc12
-rw-r--r--MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c35
-rw-r--r--MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.h3
-rw-r--r--MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.inf12
-rw-r--r--MdeModulePkg/Universal/VariablePei/Variable.inf2
-rw-r--r--MdeModulePkg/Universal/VariableRuntimeDxe/Variable.inf4
7 files changed, 65 insertions, 39 deletions
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index fa6dbe1129..f8015fb0b5 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -139,29 +139,29 @@
PcdMaxSizePopulateCapsule|0x0001001e|gEfiEdkModulePkgTokenSpaceGuid|UINT32|0x0
PcdMaxSizeNonPopulateCapsule|0x0001001f|gEfiEdkModulePkgTokenSpaceGuid|UINT32|0x0
PcdMaxPeiPerformanceLogEntries|0x0001002f|gEfiEdkModulePkgTokenSpaceGuid|UINT8|28
- PcdFlashNvStorageVariableBase|0x30000001|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageVariableSize|0x30000002|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageFtwSpareBase|0x30000013|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageFtwSpareSize|0x30000014|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageFtwWorkingBase|0x30000010|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageFtwWorkingSize|0x30000011|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageVariableBase|0x30000001|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageVariableSize|0x30000002|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageFtwSpareBase|0x30000013|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageFtwSpareSize|0x30000014|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageFtwWorkingBase|0x30000010|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageFtwWorkingSize|0x30000011|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
[PcdsDynamic.common]
- PcdFlashNvStorageVariableBase|0x30000001|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageVariableSize|0x30000002|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageFtwSpareBase|0x30000013|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageFtwSpareSize|0x30000014|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageFtwWorkingBase|0x30000010|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageFtwWorkingSize|0x30000011|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageVariableBase|0x30000001|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageVariableSize|0x30000002|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageFtwSpareBase|0x30000013|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageFtwSpareSize|0x30000014|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageFtwWorkingBase|0x30000010|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageFtwWorkingSize|0x30000011|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
[PcdsPatchableInModule.common]
PcdMaxPeiPerformanceLogEntries|0x0001002f|gEfiEdkModulePkgTokenSpaceGuid|UINT8|28
- PcdFlashNvStorageVariableBase|0x30000001|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageVariableSize|0x30000002|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageFtwSpareBase|0x30000013|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageFtwSpareSize|0x30000014|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageFtwWorkingBase|0x30000010|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
- PcdFlashNvStorageFtwWorkingSize|0x30000011|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageVariableBase|0x30000001|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageVariableSize|0x30000002|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageFtwSpareBase|0x30000013|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageFtwSpareSize|0x30000014|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageFtwWorkingBase|0x30000010|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
+ PcdFlashNvStorageFtwWorkingSize|0x30000011|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0
[PcdsFeatureFlag.IA32]
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index 649918140d..9e50c54f43 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -339,12 +339,12 @@
PcdUefiLibMaxPrintBufferSize|gEfiMdePkgTokenSpaceGuid|320
PcdMaxSizeNonPopulateCapsule|gEfiEdkModulePkgTokenSpaceGuid|0x0
PcdMaxSizePopulateCapsule|gEfiEdkModulePkgTokenSpaceGuid|0x0
- PcdFlashNvStorageFtwSpareBase|gEfiGenericPlatformTokenSpaceGuid|0x0
- PcdFlashNvStorageFtwSpareSize|gEfiGenericPlatformTokenSpaceGuid|0x0
- PcdFlashNvStorageFtwWorkingBase|gEfiGenericPlatformTokenSpaceGuid|0x0
- PcdFlashNvStorageFtwWorkingSize|gEfiGenericPlatformTokenSpaceGuid|0x0
- PcdFlashNvStorageVariableBase|gEfiGenericPlatformTokenSpaceGuid|0x0
- PcdFlashNvStorageVariableSize|gEfiGenericPlatformTokenSpaceGuid|0x0
+ PcdFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid|0x0
+ PcdFlashNvStorageFtwSpareSize|gEfiMdeModulePkgTokenSpaceGuid|0x0
+ PcdFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid|0x0
+ PcdFlashNvStorageFtwWorkingSize|gEfiMdeModulePkgTokenSpaceGuid|0x0
+ PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid|0x0
+ PcdFlashNvStorageVariableSize|gEfiMdeModulePkgTokenSpaceGuid|0x0
PcdMaxPeiPerformanceLogEntries|gEfiEdkModulePkgTokenSpaceGuid|28
PcdVpdBaseAddress|gEfiEdkModulePkgTokenSpaceGuid|0x0
PcdMaxPeiPcdCallBackNumberPerPcdEntry|gEfiMdeModulePkgTokenSpaceGuid|0x08
diff --git a/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c b/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c
index 38fe11d80b..a2ba2b4306 100644
--- a/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c
+++ b/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c
@@ -634,7 +634,8 @@ 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].
@@ -665,12 +666,34 @@ 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) {
- FtwLiteDevice->WorkSpaceAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwWorkingBase);
- FtwLiteDevice->WorkSpaceLength = (UINTN) PcdGet32 (PcdFlashNvStorageFtwWorkingSize);
-
- FtwLiteDevice->SpareAreaAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwSpareBase);
- FtwLiteDevice->SpareAreaLength = (UINTN) PcdGet32 (PcdFlashNvStorageFtwSpareSize);
+ 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);
+ }
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 8bc122dbd3..0701532f90 100644
--- a/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.h
+++ b/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.h
@@ -38,6 +38,7 @@ Abstract:
//
#include <Protocol/PciRootBridgeIo.h>
#include <Guid/SystemNvDataGuid.h>
+#include <Guid/FlashMapHob.h>
#include <Protocol/FaultTolerantWriteLite.h>
#include <Protocol/FirmwareVolumeBlock.h>
//
@@ -49,8 +50,10 @@ 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
diff --git a/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.inf b/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.inf
index 155b4e21b6..4f47d60247 100644
--- a/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.inf
+++ b/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.inf
@@ -88,7 +88,7 @@
UefiDriverEntryPoint
DebugLib
PcdLib
-
+ HobLib
################################################################################
#
@@ -98,7 +98,7 @@
[Guids]
gEfiSystemNvDataFvGuid # ALWAYS_CONSUMED
-
+ gEfiFlashMapHobGuid
################################################################################
#
@@ -125,10 +125,10 @@
################################################################################
[PcdsDynamic.common]
- PcdFlashNvStorageFtwWorkingSize|gEfiGenericPlatformTokenSpaceGuid
- PcdFlashNvStorageFtwWorkingBase|gEfiGenericPlatformTokenSpaceGuid
- PcdFlashNvStorageFtwSpareSize|gEfiGenericPlatformTokenSpaceGuid
- PcdFlashNvStorageFtwSpareBase|gEfiGenericPlatformTokenSpaceGuid
+ PcdFlashNvStorageFtwWorkingSize|gEfiMdeModulePkgTokenSpaceGuid
+ PcdFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid
+ PcdFlashNvStorageFtwSpareSize|gEfiMdeModulePkgTokenSpaceGuid
+ PcdFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid
################################################################################
#
diff --git a/MdeModulePkg/Universal/VariablePei/Variable.inf b/MdeModulePkg/Universal/VariablePei/Variable.inf
index 434c2991c8..72a6b796fe 100644
--- a/MdeModulePkg/Universal/VariablePei/Variable.inf
+++ b/MdeModulePkg/Universal/VariablePei/Variable.inf
@@ -63,7 +63,7 @@
gEfiPeiReadOnlyVariable2PpiGuid # PPI ALWAYS_CONSUMED
[PcdsDynamic.common]
- PcdFlashNvStorageVariableBase|gEfiGenericPlatformTokenSpaceGuid
+ PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid
[Depex]
TRUE
diff --git a/MdeModulePkg/Universal/VariableRuntimeDxe/Variable.inf b/MdeModulePkg/Universal/VariableRuntimeDxe/Variable.inf
index bdddbe148d..8236cd9cd8 100644
--- a/MdeModulePkg/Universal/VariableRuntimeDxe/Variable.inf
+++ b/MdeModulePkg/Universal/VariableRuntimeDxe/Variable.inf
@@ -105,8 +105,8 @@
################################################################################
[PcdsDynamic.common]
- PcdFlashNvStorageVariableSize|gEfiGenericPlatformTokenSpaceGuid
- PcdFlashNvStorageVariableBase|gEfiGenericPlatformTokenSpaceGuid
+ PcdFlashNvStorageVariableSize|gEfiMdeModulePkgTokenSpaceGuid
+ PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid
################################################################################