1) PcdFlashNvStorageFtwWorkingSize, PcdFlashNvStorageFtwWorkingBase, PcdFlashNvStorag...
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 6 Jul 2007 08:08:57 +0000 (08:08 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 6 Jul 2007 08:08:57 +0000 (08:08 +0000)
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

MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/MdeModulePkg.dsc
MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c
MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.h
MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.inf
MdeModulePkg/Universal/VariablePei/Variable.inf
MdeModulePkg/Universal/VariableRuntimeDxe/Variable.inf
Nt32Pkg/Nt32Pkg.dsc
Nt32Pkg/Nt32Pkg.fdf
Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c
Nt32Pkg/WinNtFlashMapPei/FlashMap.inf

index fa6dbe1..f8015fb 100644 (file)
   PcdMaxSizePopulateCapsule|0x0001001e|gEfiEdkModulePkgTokenSpaceGuid|UINT32|0x0\r
   PcdMaxSizeNonPopulateCapsule|0x0001001f|gEfiEdkModulePkgTokenSpaceGuid|UINT32|0x0\r
   PcdMaxPeiPerformanceLogEntries|0x0001002f|gEfiEdkModulePkgTokenSpaceGuid|UINT8|28\r
-  PcdFlashNvStorageVariableBase|0x30000001|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageVariableSize|0x30000002|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageFtwSpareBase|0x30000013|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageFtwSpareSize|0x30000014|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageFtwWorkingBase|0x30000010|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageFtwWorkingSize|0x30000011|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageVariableBase|0x30000001|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageVariableSize|0x30000002|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageFtwSpareBase|0x30000013|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageFtwSpareSize|0x30000014|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageFtwWorkingBase|0x30000010|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageFtwWorkingSize|0x30000011|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
 \r
 [PcdsDynamic.common]\r
-  PcdFlashNvStorageVariableBase|0x30000001|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageVariableSize|0x30000002|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageFtwSpareBase|0x30000013|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageFtwSpareSize|0x30000014|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageFtwWorkingBase|0x30000010|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageFtwWorkingSize|0x30000011|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageVariableBase|0x30000001|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageVariableSize|0x30000002|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageFtwSpareBase|0x30000013|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageFtwSpareSize|0x30000014|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageFtwWorkingBase|0x30000010|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageFtwWorkingSize|0x30000011|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
 \r
 [PcdsPatchableInModule.common]\r
   PcdMaxPeiPerformanceLogEntries|0x0001002f|gEfiEdkModulePkgTokenSpaceGuid|UINT8|28\r
-  PcdFlashNvStorageVariableBase|0x30000001|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageVariableSize|0x30000002|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageFtwSpareBase|0x30000013|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageFtwSpareSize|0x30000014|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageFtwWorkingBase|0x30000010|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
-  PcdFlashNvStorageFtwWorkingSize|0x30000011|gEfiGenericPlatformTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageVariableBase|0x30000001|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageVariableSize|0x30000002|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageFtwSpareBase|0x30000013|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageFtwSpareSize|0x30000014|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageFtwWorkingBase|0x30000010|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
+  PcdFlashNvStorageFtwWorkingSize|0x30000011|gEfiMdeModulePkgTokenSpaceGuid|UINT32|0x0\r
 \r
 \r
 [PcdsFeatureFlag.IA32]\r
index 6499181..9e50c54 100644 (file)
   PcdUefiLibMaxPrintBufferSize|gEfiMdePkgTokenSpaceGuid|320\r
   PcdMaxSizeNonPopulateCapsule|gEfiEdkModulePkgTokenSpaceGuid|0x0\r
   PcdMaxSizePopulateCapsule|gEfiEdkModulePkgTokenSpaceGuid|0x0\r
-  PcdFlashNvStorageFtwSpareBase|gEfiGenericPlatformTokenSpaceGuid|0x0\r
-  PcdFlashNvStorageFtwSpareSize|gEfiGenericPlatformTokenSpaceGuid|0x0\r
-  PcdFlashNvStorageFtwWorkingBase|gEfiGenericPlatformTokenSpaceGuid|0x0\r
-  PcdFlashNvStorageFtwWorkingSize|gEfiGenericPlatformTokenSpaceGuid|0x0\r
-  PcdFlashNvStorageVariableBase|gEfiGenericPlatformTokenSpaceGuid|0x0\r
-  PcdFlashNvStorageVariableSize|gEfiGenericPlatformTokenSpaceGuid|0x0\r
+  PcdFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid|0x0\r
+  PcdFlashNvStorageFtwSpareSize|gEfiMdeModulePkgTokenSpaceGuid|0x0\r
+  PcdFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid|0x0\r
+  PcdFlashNvStorageFtwWorkingSize|gEfiMdeModulePkgTokenSpaceGuid|0x0\r
+  PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid|0x0\r
+  PcdFlashNvStorageVariableSize|gEfiMdeModulePkgTokenSpaceGuid|0x0\r
   PcdMaxPeiPerformanceLogEntries|gEfiEdkModulePkgTokenSpaceGuid|28\r
   PcdVpdBaseAddress|gEfiEdkModulePkgTokenSpaceGuid|0x0\r
   PcdMaxPeiPcdCallBackNumberPerPcdEntry|gEfiMdeModulePkgTokenSpaceGuid|0x08\r
index 38fe11d..a2ba2b4 100644 (file)
@@ -634,7 +634,8 @@ InitializeFtwLite (
   UINTN                               Offset;\r
   EFI_FV_BLOCK_MAP_ENTRY              *FvbMapEntry;\r
   UINT32                              LbaIndex;\r
-\r
+  EFI_PEI_HOB_POINTERS                FvHob;\r
+  EFI_FLASH_MAP_ENTRY_DATA            *FlashMapEntry;\r
   //\r
   // Allocate Private data of this driver,\r
   // INCLUDING THE FtwWorkSpace[FTW_WORK_SPACE_SIZE].\r
@@ -665,12 +666,34 @@ InitializeFtwLite (
   FtwLiteDevice->FtwWorkSpaceHeader = (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *) FtwLiteDevice->FtwWorkSpace;\r
 \r
   FtwLiteDevice->FtwLastRecord      = NULL;\r
+        \r
+  //\r
+  // BUGBUG: Here should use Pcd after build tool support dynamic PCD\r
+  //        \r
+  FtwLiteDevice->SpareAreaLength  = 0;\r
+  FtwLiteDevice->WorkSpaceLength  = 0;\r
+  FvHob.Raw = GetHobList ();\r
+  while ((FvHob.Raw = GetNextGuidHob (&gEfiFlashMapHobGuid, FvHob.Raw)) != NULL) {\r
 \r
-  FtwLiteDevice->WorkSpaceAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwWorkingBase);\r
-  FtwLiteDevice->WorkSpaceLength  = (UINTN) PcdGet32 (PcdFlashNvStorageFtwWorkingSize);\r
-\r
-  FtwLiteDevice->SpareAreaAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwSpareBase);\r
-  FtwLiteDevice->SpareAreaLength  = (UINTN) PcdGet32 (PcdFlashNvStorageFtwSpareSize);\r
+    FlashMapEntry = (EFI_FLASH_MAP_ENTRY_DATA *) GET_GUID_HOB_DATA (FvHob.Guid);\r
+      \r
+    //\r
+    // Get the FTW work space Flash Map SUB area\r
+    //\r
+    if ((FlashMapEntry->AreaType == EFI_FLASH_AREA_FTW_STATE) && (FlashMapEntry->NumEntries == 1)) {\r
+      FtwLiteDevice->WorkSpaceAddress = FlashMapEntry->Entries[0].Base;\r
+      FtwLiteDevice->WorkSpaceLength  = (UINTN) FlashMapEntry->Entries[0].Length;\r
+    }\r
+    //\r
+    // Get the FTW backup SUB area\r
+    //\r
+    if ((FlashMapEntry->AreaType == EFI_FLASH_AREA_FTW_BACKUP) && (FlashMapEntry->NumEntries == 1)) {\r
+      FtwLiteDevice->SpareAreaAddress = FlashMapEntry->Entries[0].Base;\r
+      FtwLiteDevice->SpareAreaLength  = (UINTN) FlashMapEntry->Entries[0].Length;\r
+    }\r
+    \r
+    FvHob.Raw = GET_NEXT_HOB (FvHob);\r
+  }\r
 \r
   ASSERT ((FtwLiteDevice->WorkSpaceLength != 0) && (FtwLiteDevice->SpareAreaLength != 0));\r
 \r
index 8bc122d..0701532 100644 (file)
@@ -38,6 +38,7 @@ Abstract:
 //\r
 #include <Protocol/PciRootBridgeIo.h>\r
 #include <Guid/SystemNvDataGuid.h>\r
+#include <Guid/FlashMapHob.h>\r
 #include <Protocol/FaultTolerantWriteLite.h>\r
 #include <Protocol/FirmwareVolumeBlock.h>\r
 //\r
@@ -49,8 +50,10 @@ Abstract:
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/HobLib.h>\r
 \r
 #include <Common/WorkingBlockHeader.h>\r
+#include <Common/FlashMap.h>\r
 \r
 #define EFI_D_FTW_LITE  EFI_D_ERROR\r
 #define EFI_D_FTW_INFO  EFI_D_INFO\r
index 155b4e2..4f47d60 100644 (file)
@@ -88,7 +88,7 @@
   UefiDriverEntryPoint\r
   DebugLib\r
   PcdLib\r
-\r
+  HobLib\r
 \r
 ################################################################################\r
 #\r
@@ -98,7 +98,7 @@
 \r
 [Guids]\r
   gEfiSystemNvDataFvGuid                        # ALWAYS_CONSUMED\r
-\r
+  gEfiFlashMapHobGuid\r
 \r
 ################################################################################\r
 #\r
 ################################################################################\r
 \r
 [PcdsDynamic.common]\r
-  PcdFlashNvStorageFtwWorkingSize|gEfiGenericPlatformTokenSpaceGuid\r
-  PcdFlashNvStorageFtwWorkingBase|gEfiGenericPlatformTokenSpaceGuid\r
-  PcdFlashNvStorageFtwSpareSize|gEfiGenericPlatformTokenSpaceGuid\r
-  PcdFlashNvStorageFtwSpareBase|gEfiGenericPlatformTokenSpaceGuid\r
+  PcdFlashNvStorageFtwWorkingSize|gEfiMdeModulePkgTokenSpaceGuid\r
+  PcdFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid\r
+  PcdFlashNvStorageFtwSpareSize|gEfiMdeModulePkgTokenSpaceGuid\r
+  PcdFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid\r
 \r
 ################################################################################\r
 #\r
index 434c299..72a6b79 100644 (file)
@@ -63,7 +63,7 @@
   gEfiPeiReadOnlyVariable2PpiGuid                # PPI ALWAYS_CONSUMED\r
 \r
 [PcdsDynamic.common]\r
-  PcdFlashNvStorageVariableBase|gEfiGenericPlatformTokenSpaceGuid\r
+  PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid\r
 \r
 [Depex]\r
   TRUE\r
index bdddbe1..8236cd9 100644 (file)
 ################################################################################\r
 \r
 [PcdsDynamic.common]\r
-  PcdFlashNvStorageVariableSize|gEfiGenericPlatformTokenSpaceGuid\r
-  PcdFlashNvStorageVariableBase|gEfiGenericPlatformTokenSpaceGuid\r
+  PcdFlashNvStorageVariableSize|gEfiMdeModulePkgTokenSpaceGuid\r
+  PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid\r
 \r
 \r
 ################################################################################\r
index 6dcdd6b..3d42131 100644 (file)
   UefiBootServicesTableLib|$(WORKSPACE)/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   HobLib|$(WORKSPACE)/MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DevicePathLib|$(WORKSPACE)/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
-  PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
+  #PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   MemoryAllocationLib|$(WORKSPACE)/MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf\r
   UefiLib|$(WORKSPACE)/MdePkg/Library/UefiLib/UefiLib.inf\r
   ReportStatusCodeLib|$(WORKSPACE)/IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   UefiRuntimeServicesTableLib|$(WORKSPACE)/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   WinNtLib|$(WORKSPACE)/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf\r
   OemHookStatusCodeLib|$(WORKSPACE)/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf\r
-  PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
+  #PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   DebugLib|$(WORKSPACE)/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
 \r
 [LibraryClasses.common.PEIM]\r
   HobLib|$(WORKSPACE)/MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
-  PcdLib|$(WORKSPACE)/MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
+  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
+  #PcdLib|$(WORKSPACE)/MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
   IoLib|$(WORKSPACE)/MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf\r
   PeimEntryPoint|$(WORKSPACE)/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf\r
   PeiServicesLib|$(WORKSPACE)/MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
   OldPeiCoreEntryPoint|$(WORKSPACE)/MdePkg/Library/OldPeiCoreEntryPoint/OldPeiCoreEntryPoint.inf\r
   ReportStatusCodeLib|$(WORKSPACE)/IntelFrameworkPkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf\r
   PeCoffGetEntryPointLib|$(WORKSPACE)/Nt32Pkg/Library/EdkNt32PeiPeCoffGetEntryPointLib/EdkNt32PeiPeCoffGetEntryPointLib.inf\r
-  PcdLib|$(WORKSPACE)/MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
+  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
+  #PcdLib|$(WORKSPACE)/MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
   DebugLib|$(WORKSPACE)/IntelFrameworkPkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
 \r
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]\r
   UefiRuntimeServicesTableLib|$(WORKSPACE)/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   HobLib|$(WORKSPACE)/MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
+  #PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   MemoryAllocationLib|$(WORKSPACE)/MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf\r
   UefiLib|$(WORKSPACE)/MdePkg/Library/UefiLib/UefiLib.inf\r
   UefiDriverEntryPoint|$(WORKSPACE)/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
 [LibraryClasses.common.UEFI_DRIVER]\r
   UefiRuntimeServicesTableLib|$(WORKSPACE)/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   HobLib|$(WORKSPACE)/MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
+  #PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   MemoryAllocationLib|$(WORKSPACE)/MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf\r
   UefiLib|$(WORKSPACE)/MdePkg/Library/UefiLib/UefiLib.inf\r
   UefiDriverEntryPoint|$(WORKSPACE)/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
 [LibraryClasses.common.DXE_DRIVER]\r
   UefiRuntimeServicesTableLib|$(WORKSPACE)/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   HobLib|$(WORKSPACE)/MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
+  #PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   MemoryAllocationLib|$(WORKSPACE)/MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf\r
   UefiLib|$(WORKSPACE)/MdePkg/Library/UefiLib/UefiLib.inf\r
   UefiDriverEntryPoint|$(WORKSPACE)/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
   HobLib|$(WORKSPACE)/MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DevicePathLib|$(WORKSPACE)/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
   EdkIfrSupportLib|$(WORKSPACE)/MdeModulePkg/Library/EdkIfrSupportLib/EdkIfrSupportLib.inf\r
-  PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  # After tools enable the dynamic PCD, please uncomment follows library instances mapping.\r
+  #PcdLib|$(WORKSPACE)/MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   MemoryAllocationLib|$(WORKSPACE)/MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf\r
   UefiLib|$(WORKSPACE)/MdePkg/Library/UefiLib/UefiLib.inf\r
   ReportStatusCodeLib|$(WORKSPACE)/IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   PcdMaxSizeNonPopulateCapsule|gEfiEdkModulePkgTokenSpaceGuid|0x0\r
   PcdMaxSizePopulateCapsule|gEfiEdkModulePkgTokenSpaceGuid|0x0\r
   PcdPciIncompatibleDeviceSupportMask|gEfiIntelFrameworkModulePkgTokenSpaceGuid|0\r
+  PcdFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid|0x0\r
+  PcdFlashNvStorageFtwSpareSize|gEfiMdeModulePkgTokenSpaceGuid|0x280000\r
+  PcdFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid|0x28e000\r
+  PcdFlashNvStorageFtwWorkingSize|gEfiMdeModulePkgTokenSpaceGuid|0x2000\r
+  PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid|0x280000\r
+  PcdFlashNvStorageVariableSize|gEfiMdeModulePkgTokenSpaceGuid|0x00c000\r
 \r
 [PcdsFeatureFlag.IA32]\r
   PcdPeiPcdDatabaseTraverseEnabled|gEfiEdkModulePkgTokenSpaceGuid|TRUE\r
 ################################################################################\r
 \r
 [PcdsDynamicDefault.common.DEFAULT]\r
-  PcdFlashNvStorageFtwSpareBase|gEfiGenericPlatformTokenSpaceGuid|0x0\r
-  PcdFlashNvStorageVariableSize|gEfiGenericPlatformTokenSpaceGuid|0x0\r
   PcdWinNtCpuSpeed|gEfiNt32PkgTokenSpaceGuid|L"3000"|8\r
-  PcdFlashNvStorageVariableBase|gEfiGenericPlatformTokenSpaceGuid|0x0\r
   PcdWinNtSerialPort|gEfiNt32PkgTokenSpaceGuid|L"COM1!COM2"|18\r
   PcdWinNtFileSystem|gEfiNt32PkgTokenSpaceGuid|L".!..\\..\\..\\..\\EdkShellBinPkg\\bin\\ia32\\Apps"|106\r
-  PcdFlashNvStorageFtwWorkingSize|gEfiGenericPlatformTokenSpaceGuid|0x0\r
   PcdWinNtGop|gEfiNt32PkgTokenSpaceGuid|L"UGA Window 1!UGA Window 2"|50\r
   PcdWinNtConsole|gEfiNt32PkgTokenSpaceGuid|L"Bus Driver Console Window"|50\r
-  PcdFlashNvStorageFtwWorkingBase|gEfiGenericPlatformTokenSpaceGuid|0x0\r
   PcdWinNtMemorySize|gEfiNt32PkgTokenSpaceGuid|L"64!64"|10\r
   PcdWinNtVirtualDisk|gEfiNt32PkgTokenSpaceGuid|L"FW;40960;512"|24\r
   PcdWinNtCpuModel|gEfiNt32PkgTokenSpaceGuid|L"Intel(R) Processor Model"|48\r
   PcdWinNtPhysicalDisk|gEfiNt32PkgTokenSpaceGuid|L"E:RW;245760;512"|30\r
-  PcdFlashNvStorageFtwSpareSize|gEfiGenericPlatformTokenSpaceGuid|0x0\r
   PcdWinNtUga|gEfiNt32PkgTokenSpaceGuid|L"UGA Window 1!UGA Window 2"|50\r
 \r
 ################################################################################\r
   $(WORKSPACE)/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleRuntime.inf\r
   $(WORKSPACE)/MdeModulePkg/Universal/Ebc/Dxe/Ebc.inf\r
   $(WORKSPACE)/MdeModulePkg/Universal/GenericMemoryTest/Dxe/NullMemoryTest.inf\r
+  $(WORKSPACE)/MdeModulePkg/Universal/RuntimeDxe/Runtime.inf\r
   $(WORKSPACE)/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.inf\r
   $(WORKSPACE)/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.inf\r
   $(WORKSPACE)/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.inf\r
   $(WORKSPACE)/MdeModulePkg/Universal/VariableRuntimeDxe/Variable.inf\r
-  $(WORKSPACE)/MdeModulePkg/Universal/RuntimeDxe/Runtime.inf\r
   $(WORKSPACE)/MdeModulePkg/Bus/Pci/AtapiPassThruDxe/AtapiPassThru.inf\r
   $(WORKSPACE)/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.inf\r
   $(WORKSPACE)/MdeModulePkg/Universal/VariablePei/Variable.inf\r
index 7784575..09e9ce8 100644 (file)
@@ -137,11 +137,11 @@ INF  $(WORKSPACE)/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.inf
 INF  $(WORKSPACE)/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleRuntime.inf\r
 INF  $(WORKSPACE)/MdeModulePkg/Universal/Ebc/Dxe/Ebc.inf\r
 INF  $(WORKSPACE)/MdeModulePkg/Universal/GenericMemoryTest/Dxe/NullMemoryTest.inf\r
+INF  $(WORKSPACE)/MdeModulePkg/Universal/RuntimeDxe/Runtime.inf\r
 INF  $(WORKSPACE)/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.inf\r
 INF  $(WORKSPACE)/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.inf\r
 INF  $(WORKSPACE)/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.inf\r
 INF  $(WORKSPACE)/MdeModulePkg/Universal/VariableRuntimeDxe/Variable.inf\r
-INF  $(WORKSPACE)/MdeModulePkg/Universal/RuntimeDxe/Runtime.inf\r
 INF  $(WORKSPACE)/MdeModulePkg/Bus/Pci/AtapiPassThruDxe/AtapiPassThru.inf\r
 INF  $(WORKSPACE)/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.inf\r
 INF  $(WORKSPACE)/MdeModulePkg/Universal/VariablePei/Variable.inf\r
index 999fb0c..a0baa75 100644 (file)
@@ -138,22 +138,44 @@ EFI_DRIVER_BINDING_PROTOCOL           gWinNtBusDriverBinding = {
   NULL\r
 };\r
 \r
-#define NT_PCD_ARRAY_SIZE (sizeof(mPcdEnvironment)/sizeof(NT_PCD_ENTRY))\r
+#define NT_PCD_ARRAY_SIZE (sizeof(mPcdEnvironment)/sizeof(NT_ENVIRONMENT_VARIABLE_ENTRY))\r
+\r
+//\r
+// BUGBUG: Because currently the new build tools does not support dynamic PCD \r
+//         following dynamic PCd will be hard code. After tools ready, we should\r
+//         use dynmanic PCD AQAP.\r
+//\r
 \r
 //\r
 // Table to map NT Environment variable to the GUID that should be in\r
 // device path.\r
 //\r
-static NT_PCD_ENTRY  mPcdEnvironment[] = {\r
-  PcdToken(PcdWinNtConsole),       &gEfiWinNtConsoleGuid,\r
-  PcdToken(PcdWinNtGop),           &gEfiWinNtGopGuid,\r
-  PcdToken(PcdWinNtSerialPort),    &gEfiWinNtSerialPortGuid,\r
-  PcdToken(PcdWinNtFileSystem),    &gEfiWinNtFileSystemGuid,\r
-  PcdToken(PcdWinNtVirtualDisk),   &gEfiWinNtVirtualDisksGuid,\r
-  PcdToken(PcdWinNtPhysicalDisk),  &gEfiWinNtPhysicalDisksGuid,\r
-  PcdToken(PcdWinNtCpuModel),      &gEfiWinNtCPUModelGuid,\r
-  PcdToken(PcdWinNtCpuSpeed),      &gEfiWinNtCPUSpeedGuid,\r
-  PcdToken(PcdWinNtMemorySize),    &gEfiWinNtMemoryGuid\r
+//static NT_PCD_ENTRY  mPcdEnvironment[] = {\r
+//  PcdToken(PcdWinNtConsole),       &gEfiWinNtConsoleGuid,\r
+//  PcdToken(PcdWinNtGop),           &gEfiWinNtGopGuid,\r
+//  PcdToken(PcdWinNtSerialPort),    &gEfiWinNtSerialPortGuid,\r
+//  PcdToken(PcdWinNtFileSystem),    &gEfiWinNtFileSystemGuid,\r
+//  PcdToken(PcdWinNtVirtualDisk),   &gEfiWinNtVirtualDisksGuid,\r
+//  PcdToken(PcdWinNtPhysicalDisk),  &gEfiWinNtPhysicalDisksGuid,\r
+//  PcdToken(PcdWinNtCpuModel),      &gEfiWinNtCPUModelGuid,\r
+//  PcdToken(PcdWinNtCpuSpeed),      &gEfiWinNtCPUSpeedGuid,\r
+//  PcdToken(PcdWinNtMemorySize),    &gEfiWinNtMemoryGuid\r
+//};\r
+typedef struct {\r
+  CHAR16    *Variable;\r
+  EFI_GUID  *DevicePathGuid;\r
+} NT_ENVIRONMENT_VARIABLE_ENTRY;\r
+\r
+static NT_ENVIRONMENT_VARIABLE_ENTRY  mPcdEnvironment[] = {\r
+  L"Bus Driver Console Window",         &gEfiWinNtConsoleGuid,\r
+  L"UGA Window 1!UGA Window 2",         &gEfiWinNtGopGuid,\r
+  L"COM1!COM2",                        &gEfiWinNtSerialPortGuid,\r
+  L".!..\\..\\..\\..\\EdkShellBinPkg\\bin\\ia32\\Apps",      &gEfiWinNtFileSystemGuid,\r
+  L"FW;40960;512",                     &gEfiWinNtVirtualDisksGuid,\r
+  L"E:RW;245760;512",                  &gEfiWinNtPhysicalDisksGuid,\r
+  L"Intel(R) Processor Model",         &gEfiWinNtCPUModelGuid,\r
+  L"3000",                             &gEfiWinNtCPUSpeedGuid,\r
+  L"64!64",                             &gEfiWinNtMemoryGuid\r
 };\r
 \r
 /**\r
@@ -430,7 +452,8 @@ Returns:
   //\r
   InstallStatus   = EFI_NOT_FOUND;\r
   for (Index = 0; Index < NT_PCD_ARRAY_SIZE; Index++) {\r
-    PcdTempStr = (VOID *)LibPcdGetPtr (mPcdEnvironment[Index].Token);\r
+    //PcdTempStr = (VOID *)LibPcdGetPtr (mPcdEnvironment[Index].Token);\r
+    PcdTempStr = mPcdEnvironment[Index].Variable;\r
     ASSERT (PcdTempStr != NULL);\r
 \r
     TempStrSize = StrLen (PcdTempStr);\r
index bcd1367..bd96ed7 100644 (file)
 ################################################################################\r
 \r
 [PcdsDynamic.common]\r
-  PcdFlashNvStorageFtwWorkingSize|gEfiGenericPlatformTokenSpaceGuid\r
-  PcdFlashNvStorageFtwWorkingBase|gEfiGenericPlatformTokenSpaceGuid\r
-  PcdFlashNvStorageFtwSpareSize|gEfiGenericPlatformTokenSpaceGuid\r
-  PcdFlashNvStorageFtwSpareBase|gEfiGenericPlatformTokenSpaceGuid\r
-  PcdFlashNvStorageVariableSize|gEfiGenericPlatformTokenSpaceGuid\r
-  PcdFlashNvStorageVariableBase|gEfiGenericPlatformTokenSpaceGuid\r
+  PcdFlashNvStorageFtwWorkingSize|gEfiMdeModulePkgTokenSpaceGuid\r
+  PcdFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid\r
+  PcdFlashNvStorageFtwSpareSize|gEfiMdeModulePkgTokenSpaceGuid\r
+  PcdFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid\r
+  PcdFlashNvStorageVariableSize|gEfiMdeModulePkgTokenSpaceGuid\r
+  PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid\r
 \r