summaryrefslogtreecommitdiff
path: root/Nt32Pkg/WinNtFirmwareVolumePei
diff options
context:
space:
mode:
authoryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2007-08-03 08:52:48 +0000
committeryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2007-08-03 08:52:48 +0000
commit6d3aa33ed03ca6d9d1af2e5425e8c5adec3f5f5d (patch)
tree530b8cacfa82a599c62375ad936ccbc21bb8c1d6 /Nt32Pkg/WinNtFirmwareVolumePei
parentc8db3056ecfec7d4c0c6dd20cfc23c9daa4fb196 (diff)
downloadedk2-6d3aa33ed03ca6d9d1af2e5425e8c5adec3f5f5d.zip
edk2-6d3aa33ed03ca6d9d1af2e5425e8c5adec3f5f5d.tar.gz
edk2-6d3aa33ed03ca6d9d1af2e5425e8c5adec3f5f5d.tar.bz2
Replace the FlashMapHob with PCD defined in FDF on Nt32 platform. Currently, the tool can not generate correct PCD value in FDF, so in the patch, we still define the flash layout PCDs in DSC for short term.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3544 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Nt32Pkg/WinNtFirmwareVolumePei')
-rw-r--r--Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf13
-rw-r--r--Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c22
2 files changed, 28 insertions, 7 deletions
diff --git a/Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf b/Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf
index c29d400..a15bdbb 100644
--- a/Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf
+++ b/Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf
@@ -44,9 +44,22 @@
HobLib
PeimEntryPoint
DebugLib
+ PcdLib
[Ppis]
gNtFwhPpiGuid # PPI ALWAYS_CONSUMED
+
+[PcdsFixedAtBuild.common]
+ PcdWinNtFlashFvRecoveryBase|gEfiNt32PkgTokenSpaceGuid
+ PcdWinNtFlashFvRecoverySize|gEfiNt32PkgTokenSpaceGuid
+ PcdWinNtFlashNvStorageEventLogBase|gEfiNt32PkgTokenSpaceGuid
+ PcdWinNtFlashNvStorageEventLogSize|gEfiNt32PkgTokenSpaceGuid
+ PcdWinNtFlashNvStorageVariableBase|gEfiNt32PkgTokenSpaceGuid
+
+ PcdFlashNvStorageFtwWorkingSize|gEfiMdeModulePkgTokenSpaceGuid
+ PcdFlashNvStorageFtwSpareSize|gEfiMdeModulePkgTokenSpaceGuid
+ PcdFlashNvStorageVariableSize|gEfiMdeModulePkgTokenSpaceGuid
+
[depex]
gNtFwhPpiGuid AND gEfiPeiMemoryDiscoveredPpiGuid \ No newline at end of file
diff --git a/Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c b/Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c
index 2431133..643b92c 100644
--- a/Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c
+++ b/Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c
@@ -34,9 +34,7 @@ Revision History
#include <Library/DebugLib.h>
#include <Library/PeimEntryPoint.h>
#include <Library/HobLib.h>
-
-#include <FlashLayout.h>
-
+#include <Library/PcdLib.h>
EFI_STATUS
EFIAPI
@@ -68,6 +66,7 @@ Returns:
DEBUG ((EFI_D_ERROR, "NT 32 Firmware Volume PEIM Loaded\n"));
+ __asm int 3;
//
// Get the Fwh Information PPI
//
@@ -107,15 +106,24 @@ Returns:
EFI_RESOURCE_FIRMWARE_DEVICE,
(EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
FdBase,
- (FvHeader->FvLength + EFI_WINNT_RUNTIME_UPDATABLE_LENGTH + EFI_WINNT_FTW_SPARE_BLOCK_LENGTH)
+ (
+ FvHeader->FvLength +
+ PcdGet32 (PcdFlashNvStorageVariableSize) +
+ PcdGet32 (PcdFlashNvStorageFtwWorkingSize) +
+ PcdGet32 (PcdFlashNvStorageFtwSpareSize) +
+ PcdGet32 (PcdWinNtFlashNvStorageEventLogSize)
+ )
);
-
//
// Hard code the address of the spare block and variable services.
// Assume it's a hard coded offset from FV0 in FD0.
//
- FdBase = FdBase + EFI_WINNT_RUNTIME_UPDATABLE_OFFSET;
- FdSize = EFI_WINNT_RUNTIME_UPDATABLE_LENGTH + EFI_WINNT_FTW_SPARE_BLOCK_LENGTH;
+ FdBase = FdBase + PcdGet32 (PcdWinNtFlashNvStorageVariableBase);
+ FdSize =
+ PcdGet32 (PcdFlashNvStorageVariableSize) +
+ PcdGet32 (PcdFlashNvStorageFtwWorkingSize) +
+ PcdGet32 (PcdFlashNvStorageFtwSpareSize) +
+ PcdGet32 (PcdWinNtFlashNvStorageEventLogSize);
BuildFvHob (FdBase, FdSize);
} else {