Modify FtwLite and Variable DXE driver to use PCD instead of FlashMap HOB
authorxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 10 Aug 2006 12:28:02 +0000 (12:28 +0000)
committerxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 10 Aug 2006 12:28:02 +0000 (12:28 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1236 6f19259b-4bc3-4df7-8a09-765794883524

EdkModulePkg/EdkModulePkg.fpd
EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c
EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.msa
EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c
EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.msa
EdkNt32Pkg/Include/FlashLayout.h
EdkNt32Pkg/Nt32.fpd
EdkNt32Pkg/Pei/FlashMap/FlashMap.c
EdkNt32Pkg/Pei/FlashMap/FlashMap.msa

index deedec8..719b135 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
 <PlatformSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
   <PlatformHeader>\r
     <PlatformName>EdkModuleAll</PlatformName>\r
         <Instance ModuleGuid="f12b59c9-76d0-4661-ad7c-f04d1bef0558" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="bd4d540e-04b0-4b10-8fd5-4a7bb533cf67" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
+        <!--Pkg: MdePkg Mod: DxePcdLib Path: MdePkg\Library\DxePcdLib\DxePcdLib.msa-->\r
+        <Instance ModuleGuid="af97eb89-4cc6-45f8-a514-ca025b346480" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>\r
       </Libraries>\r
       <PcdBuildDefinition>\r
+        <PcdData ItemType="DYNAMIC">\r
+          <C_Name>PcdFlashNvStorageVariableBase</C_Name>\r
+          <Token>0x30000001</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x0</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="DYNAMIC">\r
+          <C_Name>PcdFlashNvStorageVariableSize</C_Name>\r
+          <Token>0x30000002</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x0</Value>\r
+        </PcdData>\r
         <PcdData ItemType="FIXED_AT_BUILD">\r
           <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           <Token>0x00000001</Token>\r
         <Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
       </Libraries>\r
       <PcdBuildDefinition>\r
-        <PcdData ItemType="FIXED_AT_BUILD">\r
+        <PcdData ItemType="DYNAMIC">\r
           <C_Name>PcdFlashNvStorageVariableBase</C_Name>\r
           <Token>0x30000001</Token>\r
           <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
         <Instance ModuleGuid="bda39d3a-451b-4350-8266-81ab10fa0523" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="50bcb105-6634-441d-b403-659110a03ad2" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
         <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+        <!--Pkg: MdePkg Mod: DxePcdLib Path: MdePkg\Library\DxePcdLib\DxePcdLib.msa-->\r
+        <Instance ModuleGuid="af97eb89-4cc6-45f8-a514-ca025b346480" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>\r
       </Libraries>\r
       <PcdBuildDefinition>\r
         <PcdData ItemType="FIXED_AT_BUILD">\r
           <MaxDatumSize>1</MaxDatumSize>\r
           <Value>0xAF</Value>\r
         </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwSpareBase</C_Name>\r
+          <Token>0x30000013</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0xFFFC0000</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwSpareSize</C_Name>\r
+          <Token>0x30000014</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x00010000</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwWorkingBase</C_Name>\r
+          <Token>0x30000010</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0xFFFBE000</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwWorkingSize</C_Name>\r
+          <Token>0x30000011</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x00002000</Value>\r
+        </PcdData>\r
       </PcdBuildDefinition>\r
       <ModuleSaBuildOptions>\r
         <FvBinding>NULL</FvBinding>\r
         <Instance ModuleGuid="f12b59c9-76d0-4661-ad7c-f04d1bef0558" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="bd4d540e-04b0-4b10-8fd5-4a7bb533cf67" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
+        <!--Pkg: MdePkg Mod: DxePcdLib Path: MdePkg\Library\DxePcdLib\DxePcdLib.msa-->\r
+        <Instance ModuleGuid="af97eb89-4cc6-45f8-a514-ca025b346480" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>\r
       </Libraries>\r
       <PcdBuildDefinition>\r
         <PcdData ItemType="FIXED_AT_BUILD">\r
           <MaxDatumSize>1</MaxDatumSize>\r
           <Value>0xAF</Value>\r
         </PcdData>\r
+        <PcdData ItemType="DYNAMIC">\r
+          <C_Name>PcdFlashNvStorageVariableBase</C_Name>\r
+          <Token>0x30000001</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x0</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="DYNAMIC">\r
+          <C_Name>PcdFlashNvStorageVariableSize</C_Name>\r
+          <Token>0x30000002</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x0</Value>\r
+        </PcdData>\r
       </PcdBuildDefinition>\r
       <ModuleSaBuildOptions>\r
         <FvBinding>NULL</FvBinding>\r
         <Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
       </Libraries>\r
       <PcdBuildDefinition>\r
-        <PcdData ItemType="FIXED_AT_BUILD">\r
+        <PcdData ItemType="DYNAMIC">\r
           <C_Name>PcdFlashNvStorageVariableBase</C_Name>\r
           <Token>0x30000001</Token>\r
           <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
         <Instance ModuleGuid="bda39d3a-451b-4350-8266-81ab10fa0523" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="50bcb105-6634-441d-b403-659110a03ad2" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
         <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+        <!--Pkg: MdePkg Mod: DxePcdLib Path: MdePkg\Library\DxePcdLib\DxePcdLib.msa-->\r
+        <Instance ModuleGuid="af97eb89-4cc6-45f8-a514-ca025b346480" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>\r
       </Libraries>\r
       <PcdBuildDefinition>\r
         <PcdData ItemType="FIXED_AT_BUILD">\r
           <MaxDatumSize>1</MaxDatumSize>\r
           <Value>0xAF</Value>\r
         </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwSpareBase</C_Name>\r
+          <Token>0x30000013</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0xFFFC0000</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwSpareSize</C_Name>\r
+          <Token>0x30000014</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x00010000</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwWorkingBase</C_Name>\r
+          <Token>0x30000010</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0xFFFBE000</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwWorkingSize</C_Name>\r
+          <Token>0x30000011</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x00002000</Value>\r
+        </PcdData>\r
       </PcdBuildDefinition>\r
       <ModuleSaBuildOptions>\r
         <FvBinding>NULL</FvBinding>\r
         <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="bd4d540e-04b0-4b10-8fd5-4a7bb533cf67" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
         <Instance ModuleGuid="61999c3c-72a5-4506-a4ff-4271d18a1d14" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
+        <!--Pkg: MdePkg Mod: DxePcdLib Path: MdePkg\Library\DxePcdLib\DxePcdLib.msa-->\r
+        <Instance ModuleGuid="af97eb89-4cc6-45f8-a514-ca025b346480" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>\r
       </Libraries>\r
       <PcdBuildDefinition>\r
         <PcdData ItemType="FIXED_AT_BUILD">\r
           <MaxDatumSize>1</MaxDatumSize>\r
           <Value>0xAF</Value>\r
         </PcdData>\r
+        <PcdData ItemType="DYNAMIC">\r
+          <C_Name>PcdFlashNvStorageVariableBase</C_Name>\r
+          <Token>0x30000001</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x0</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="DYNAMIC">\r
+          <C_Name>PcdFlashNvStorageVariableSize</C_Name>\r
+          <Token>0x30000002</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x0</Value>\r
+        </PcdData>\r
       </PcdBuildDefinition>\r
       <ModuleSaBuildOptions>\r
         <FvBinding>NULL</FvBinding>\r
         <Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
       </Libraries>\r
       <PcdBuildDefinition>\r
-        <PcdData ItemType="FIXED_AT_BUILD">\r
+        <PcdData ItemType="DYNAMIC">\r
           <C_Name>PcdFlashNvStorageVariableBase</C_Name>\r
           <Token>0x30000001</Token>\r
           <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
         <Instance ModuleGuid="bda39d3a-451b-4350-8266-81ab10fa0523" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="50bcb105-6634-441d-b403-659110a03ad2" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
         <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+        <!--Pkg: MdePkg Mod: DxePcdLib Path: MdePkg\Library\DxePcdLib\DxePcdLib.msa-->\r
+        <Instance ModuleGuid="af97eb89-4cc6-45f8-a514-ca025b346480" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>\r
       </Libraries>\r
       <PcdBuildDefinition>\r
         <PcdData ItemType="FIXED_AT_BUILD">\r
           <MaxDatumSize>1</MaxDatumSize>\r
           <Value>0xAF</Value>\r
         </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwSpareBase</C_Name>\r
+          <Token>0x30000013</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0xFFFC0000</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwSpareSize</C_Name>\r
+          <Token>0x30000014</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x00010000</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwWorkingBase</C_Name>\r
+          <Token>0x30000010</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0xFFFBE000</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwWorkingSize</C_Name>\r
+          <Token>0x30000011</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x00002000</Value>\r
+        </PcdData>\r
       </PcdBuildDefinition>\r
       <ModuleSaBuildOptions>\r
         <FvBinding>NULL</FvBinding>\r
         <Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
       </Libraries>\r
       <PcdBuildDefinition>\r
-        <PcdData ItemType="FIXED_AT_BUILD">\r
+        <PcdData ItemType="DYNAMIC">\r
           <C_Name>PcdFlashNvStorageVariableBase</C_Name>\r
           <Token>0x30000001</Token>\r
           <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
         <Instance ModuleGuid="bda39d3a-451b-4350-8266-81ab10fa0523" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="50bcb105-6634-441d-b403-659110a03ad2" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
         <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+        <!--Pkg: MdePkg Mod: DxePcdLib Path: MdePkg\Library\DxePcdLib\DxePcdLib.msa-->\r
+        <Instance ModuleGuid="af97eb89-4cc6-45f8-a514-ca025b346480" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>\r
       </Libraries>\r
       <PcdBuildDefinition>\r
         <PcdData ItemType="FIXED_AT_BUILD">\r
           <MaxDatumSize>1</MaxDatumSize>\r
           <Value>0xAF</Value>\r
         </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwSpareBase</C_Name>\r
+          <Token>0x30000013</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0xFFFC0000</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwSpareSize</C_Name>\r
+          <Token>0x30000014</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x00010000</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwWorkingBase</C_Name>\r
+          <Token>0x30000010</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0xFFFBE000</Value>\r
+        </PcdData>\r
+        <PcdData ItemType="FIXED_AT_BUILD">\r
+          <C_Name>PcdFlashNvStorageFtwWorkingSize</C_Name>\r
+          <Token>0x30000011</Token>\r
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+          <DatumType>UINT32</DatumType>\r
+          <MaxDatumSize>4</MaxDatumSize>\r
+          <Value>0x00002000</Value>\r
+        </PcdData>\r
       </PcdBuildDefinition>\r
       <ModuleSaBuildOptions>\r
         <FvBinding>NULL</FvBinding>\r
       </ModuleSaBuildOptions>\r
     </ModuleSA>\r
   </FrameworkModules>\r
+  <DynamicPcdBuildDefinitions>
+    <PcdBuildData ItemType="DYNAMIC">
+      <C_Name>PcdFlashNvStorageVariableBase</C_Name>
+      <Token>0x30000001</Token>
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+      <DatumType>UINT32</DatumType>
+      <MaxDatumSize>4</MaxDatumSize>
+      <SkuInfo>
+        <SkuId>0</SkuId>
+        <Value>0x0</Value>
+      </SkuInfo>
+    </PcdBuildData>
+    <PcdBuildData ItemType="DYNAMIC">
+      <C_Name>PcdFlashNvStorageVariableSize</C_Name>
+      <Token>0x30000002</Token>
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+      <DatumType>UINT32</DatumType>
+      <MaxDatumSize>4</MaxDatumSize>
+      <SkuInfo>
+        <SkuId>0</SkuId>
+        <Value>0x0</Value>
+      </SkuInfo>
+    </PcdBuildData>
+    <PcdBuildData ItemType="DYNAMIC">
+      <C_Name>PcdFlashNvStorageFtwWorkingBase</C_Name>
+      <Token>0x30000010</Token>
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+      <DatumType>UINT32</DatumType>
+      <MaxDatumSize>4</MaxDatumSize>
+      <SkuInfo>
+        <SkuId>0</SkuId>
+        <Value>0x0</Value>
+      </SkuInfo>
+    </PcdBuildData>
+    <PcdBuildData ItemType="DYNAMIC">
+      <C_Name>PcdFlashNvStorageFtwWorkingSize</C_Name>
+      <Token>0x30000011</Token>
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+      <DatumType>UINT32</DatumType>
+      <MaxDatumSize>4</MaxDatumSize>
+      <SkuInfo>
+        <SkuId>0</SkuId>
+        <Value>0x0</Value>
+      </SkuInfo>
+    </PcdBuildData>
+    <PcdBuildData ItemType="DYNAMIC">
+      <C_Name>PcdFlashNvStorageFtwSpareBase</C_Name>
+      <Token>0x30000013</Token>
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+      <DatumType>UINT32</DatumType>
+      <MaxDatumSize>4</MaxDatumSize>
+      <SkuInfo>
+        <SkuId>0</SkuId>
+        <Value>0x0</Value>
+      </SkuInfo>
+    </PcdBuildData>
+    <PcdBuildData ItemType="DYNAMIC">
+      <C_Name>PcdFlashNvStorageFtwSpareSize</C_Name>
+      <Token>0x30000014</Token>
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+      <DatumType>UINT32</DatumType>
+      <MaxDatumSize>4</MaxDatumSize>
+      <SkuInfo>
+        <SkuId>0</SkuId>
+        <Value>0x0</Value>
+      </SkuInfo>
+    </PcdBuildData>\r
+  </DynamicPcdBuildDefinitions>      \r
   <BuildOptions>\r
     <Options>\r
       <!--MSFT tool chain options definition : IA32-->\r
index 0d20e88..f4c7e91 100644 (file)
@@ -632,10 +632,8 @@ InitializeFtwLite (
   UINTN                               Length;\r
   EFI_STATUS                          Status;\r
   UINTN                               Offset;\r
-  EFI_FLASH_MAP_ENTRY_DATA            *FlashMapEntry;\r
   EFI_FV_BLOCK_MAP_ENTRY              *FvbMapEntry;\r
   UINT32                              LbaIndex;\r
-  EFI_PEI_HOB_POINTERS                GuidHob;                  \r
 \r
   //\r
   // Allocate Private data of this driver,\r
@@ -668,29 +666,11 @@ InitializeFtwLite (
 \r
   FtwLiteDevice->FtwLastRecord      = NULL;\r
 \r
-  FtwLiteDevice->SpareAreaLength  = 0;\r
-  FtwLiteDevice->WorkSpaceLength  = 0;\r
+  FtwLiteDevice->WorkSpaceAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwWorkingBase);\r
+  FtwLiteDevice->WorkSpaceLength  = (UINTN) PcdGet32 (PcdFlashNvStorageFtwWorkingSize);\r
 \r
-  GuidHob.Raw = GetHobList ();\r
-  while (NULL != (GuidHob.Raw = GetNextGuidHob (&gEfiFlashMapHobGuid, GuidHob.Raw))) {\r
-    FlashMapEntry = (EFI_FLASH_MAP_ENTRY_DATA *) GET_GUID_HOB_DATA (GuidHob.Guid);\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
-    GuidHob.Raw = GET_NEXT_HOB (GuidHob);\r
-  }\r
+  FtwLiteDevice->SpareAreaAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwSpareBase);\r
+  FtwLiteDevice->SpareAreaLength  = (UINTN) PcdGet32 (PcdFlashNvStorageFtwSpareSize);\r
 \r
   ASSERT ((FtwLiteDevice->WorkSpaceLength != 0) && (FtwLiteDevice->SpareAreaLength != 0));\r
 \r
index 90f6ad8..3505b5e 100644 (file)
@@ -30,6 +30,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
     <OutputFileBasename>FtwLite</OutputFileBasename>\r
   </ModuleDefinitions>\r
   <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>PcdLib</Keyword>\r
+    </LibraryClass>  \r
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>DebugLib</Keyword>\r
     </LibraryClass>\r
@@ -96,4 +99,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
       <ModuleEntryPoint>InitializeFtwLite</ModuleEntryPoint>\r
     </Extern>\r
   </Externs>\r
+  <PcdCoded>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">\r
+      <C_Name>PcdFlashNvStorageFtwSpareBase</C_Name>\r
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>To get base address of the FTW spare block section in NV firmware volume.</HelpText>\r
+    </PcdEntry>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">\r
+      <C_Name>PcdFlashNvStorageFtwSpareSize</C_Name>\r
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>To get size of the FTW spare block section in NV firmware volume.</HelpText>\r
+    </PcdEntry>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">\r
+      <C_Name>PcdFlashNvStorageFtwWorkingBase</C_Name>\r
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>To get base address of the FTW working block section in NV firmware volume.</HelpText>\r
+    </PcdEntry>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">\r
+      <C_Name>PcdFlashNvStorageFtwWorkingSize</C_Name>\r
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>To get size of the FTW working block section in NV firmware volume.</HelpText>\r
+    </PcdEntry>\r
+  </PcdCoded>\r
 </ModuleSurfaceArea>
\ No newline at end of file
index cfd3183..3fa1617 100644 (file)
@@ -1254,14 +1254,14 @@ Returns:
   UINT32                          Instance;\r
   EFI_PHYSICAL_ADDRESS            FvVolHdr;\r
 \r
-  EFI_FLASH_MAP_ENTRY_DATA        *FlashMapEntryData;\r
+  UINT64                          TempVariableStoreHeader;\r
+\r
   EFI_GCD_MEMORY_SPACE_DESCRIPTOR GcdDescriptor;\r
   EFI_FLASH_SUBAREA_ENTRY         VariableStoreEntry;\r
   UINT64                          BaseAddress;\r
   UINT64                          Length;\r
   UINTN                           Index;\r
   UINT8                           Data;\r
-  EFI_PEI_HOB_POINTERS            GuidHob;\r
 \r
   Status = gBS->AllocatePool (\r
                   EfiRuntimeServicesData,\r
@@ -1305,35 +1305,13 @@ Returns:
   // Get non volatile varaible store\r
   //\r
 \r
-  FlashMapEntryData = NULL;\r
-\r
-  GuidHob.Raw = GetHobList ();\r
-  while (NULL != (GuidHob.Raw = GetNextGuidHob (&gEfiFlashMapHobGuid, GuidHob.Raw))) {\r
-    FlashMapEntryData = (EFI_FLASH_MAP_ENTRY_DATA *) GET_GUID_HOB_DATA (GuidHob.Guid);\r
-\r
-    if (FlashMapEntryData->AreaType == EFI_FLASH_AREA_EFI_VARIABLES) {\r
-      break;\r
-    }\r
-    GuidHob.Raw = GET_NEXT_HOB (GuidHob);\r
-  }\r
-\r
-  if (NULL == GuidHob.Raw || FlashMapEntryData == NULL) {\r
-    gBS->FreePool (mVariableModuleGlobal);\r
-    gBS->FreePool (VolatileVariableStore);\r
-    return EFI_NOT_FOUND;\r
-  }\r
-\r
-  //\r
-  // Currently only one non-volatile variable store is supported\r
-  //\r
-  if (FlashMapEntryData->NumEntries != 1) {\r
-    gBS->FreePool (mVariableModuleGlobal);\r
-    gBS->FreePool (VolatileVariableStore);\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  CopyMem (&VariableStoreEntry, &FlashMapEntryData->Entries[0], sizeof (VariableStoreEntry));\r
+  TempVariableStoreHeader = (UINT64) PcdGet32 (PcdFlashNvStorageVariableBase);\r
+  VariableStoreEntry.Base = TempVariableStoreHeader + \\r
+                              (((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) (TempVariableStoreHeader)) -> HeaderLength);\r
+  VariableStoreEntry.Length = (UINT64) PcdGet32 (PcdFlashNvStorageVariableSize) - \\r
+                                (((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) (TempVariableStoreHeader)) -> HeaderLength);\r
 \r
+  VariableStoreEntry.Length = (UINT64) PcdGet32 (PcdFlashNvStorageVariableSize);\r
   //\r
   // Mark the variable storage region of the FLASH as RUNTIME\r
   //\r
index c3f538a..049ee37 100644 (file)
@@ -30,6 +30,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
     <OutputFileBasename>Variable</OutputFileBasename>\r
   </ModuleDefinitions>\r
   <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>PcdLib</Keyword>\r
+    </LibraryClass>  \r
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>BaseLib</Keyword>\r
     </LibraryClass>\r
@@ -150,4 +153,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
       <SetVirtualAddressMapCallBack>VariableClassAddressChangeEvent</SetVirtualAddressMapCallBack>\r
     </Extern>\r
   </Externs>\r
+  <PcdCoded>\r
+    <PcdEntry PcdItemType="DYNAMIC">\r
+      <C_Name>PcdFlashNvStorageVariableBase</C_Name>\r
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>\r
+        The driver gets the Variable store base address from this PCD.  This base address point to\r
+        an EFI_FIRMWARE_VOLUMN_HEADER struct.\r
+      </HelpText>\r
+    </PcdEntry>      \r
+    <PcdEntry PcdItemType="DYNAMIC">\r
+      <C_Name>PcdFlashNvStorageVariableSize</C_Name>\r
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>\r
+        The driver gets the Variable store base address from this PCD.  This base address point to\r
+        an EFI_FIRMWARE_VOLUMN_HEADER struct.\r
+      </HelpText>      \r
+    </PcdEntry>     \r
+  </PcdCoded>  \r
 </ModuleSurfaceArea>
\ No newline at end of file
index 5a95961..1a13f16 100644 (file)
@@ -48,9 +48,9 @@ Abstract:
 \r
 #define EFI_WINNT_RUNTIME_UPDATABLE_FV_HEADER_LENGTH  0x48\r
 \r
-#define EFI_VARIABLE_STORE_OFFSET                     (EFI_WINNT_RUNTIME_UPDATABLE_OFFSET + EFI_WINNT_RUNTIME_UPDATABLE_FV_HEADER_LENGTH)\r
+#define EFI_VARIABLE_STORE_OFFSET                     EFI_WINNT_RUNTIME_UPDATABLE_OFFSET\r
 \r
-#define EFI_VARIABLE_STORE_LENGTH                     (0x00C000 - EFI_WINNT_RUNTIME_UPDATABLE_FV_HEADER_LENGTH)\r
+#define EFI_VARIABLE_STORE_LENGTH                     0x00C000\r
 \r
 #define EFI_EVENT_LOG_OFFSET                          (EFI_VARIABLE_STORE_OFFSET + EFI_VARIABLE_STORE_LENGTH)\r
 \r
index 64ed3aa..4e9ceb1 100644 (file)
@@ -714,13 +714,53 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         <Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
       </Libraries>
       <PcdBuildDefinition>
+        <PcdData ItemType="DYNAMIC">
+          <C_Name>PcdFlashNvStorageFtwSpareBase</C_Name>
+          <Token>0x30000013</Token>
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+          <DatumType>UINT32</DatumType>
+          <MaxDatumSize>4</MaxDatumSize>
+          <Value>0x0</Value>
+        </PcdData>
+        <PcdData ItemType="DYNAMIC">
+          <C_Name>PcdFlashNvStorageFtwSpareSize</C_Name>
+          <Token>0x30000014</Token>
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+          <DatumType>UINT32</DatumType>
+          <MaxDatumSize>4</MaxDatumSize>
+          <Value>0x0</Value>
+        </PcdData>
+        <PcdData ItemType="DYNAMIC">
+          <C_Name>PcdFlashNvStorageFtwWorkingBase</C_Name>
+          <Token>0x30000010</Token>
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+          <DatumType>UINT32</DatumType>
+          <MaxDatumSize>4</MaxDatumSize>
+          <Value>0x0</Value>
+        </PcdData>
+        <PcdData ItemType="DYNAMIC">
+          <C_Name>PcdFlashNvStorageFtwWorkingSize</C_Name>
+          <Token>0x30000011</Token>
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+          <DatumType>UINT32</DatumType>
+          <MaxDatumSize>4</MaxDatumSize>
+          <Value>0x0</Value>
+        </PcdData>
         <PcdData ItemType="DYNAMIC">
           <C_Name>PcdFlashNvStorageVariableBase</C_Name>
           <Token>0x30000001</Token>
           <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
           <DatumType>UINT32</DatumType>
           <MaxDatumSize>4</MaxDatumSize>
-          <Value>0</Value>
+          <Value>0x0</Value>
+        </PcdData>
+        <PcdData ItemType="DYNAMIC">
+          <C_Name>PcdFlashNvStorageVariableSize</C_Name>
+          <Token>0x30000002</Token>
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+          <DatumType>UINT32</DatumType>
+          <MaxDatumSize>4</MaxDatumSize>
+          <Value>0x0</Value>
         </PcdData>      
         <PcdData ItemType="FIXED_AT_BUILD">
           <C_Name>PcdMaximumUnicodeStringLength</C_Name>
@@ -892,7 +932,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
           <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
           <DatumType>UINT32</DatumType>
           <MaxDatumSize>4</MaxDatumSize>
-          <Value>0</Value>
+          <Value>0x0</Value>
         </PcdData>      
         <PcdData ItemType="FIXED_AT_BUILD">
           <C_Name>PcdMaximumUnicodeStringLength</C_Name>
@@ -2672,6 +2712,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         <Instance ModuleGuid="bda39d3a-451b-4350-8266-81ab10fa0523" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
         <Instance ModuleGuid="50bcb105-6634-441d-b403-659110a03ad2" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>
         <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+        <!--Pkg: MdePkg Mod: DxePcdLib Path: MdePkg\Library\DxePcdLib\DxePcdLib.msa-->
+        <Instance ModuleGuid="af97eb89-4cc6-45f8-a514-ca025b346480" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
       </Libraries>
       <PcdBuildDefinition>
         <PcdData ItemType="FIXED_AT_BUILD">
@@ -2738,6 +2780,38 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
           <MaxDatumSize>1</MaxDatumSize>
           <Value>0xAF</Value>
         </PcdData>
+        <PcdData ItemType="DYNAMIC">
+          <C_Name>PcdFlashNvStorageFtwSpareBase</C_Name>
+          <Token>0x30000013</Token>
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+          <DatumType>UINT32</DatumType>
+          <MaxDatumSize>4</MaxDatumSize>
+          <Value>0x0</Value>
+        </PcdData>
+        <PcdData ItemType="DYNAMIC">
+          <C_Name>PcdFlashNvStorageFtwSpareSize</C_Name>
+          <Token>0x30000014</Token>
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+          <DatumType>UINT32</DatumType>
+          <MaxDatumSize>4</MaxDatumSize>
+          <Value>0x0</Value>
+        </PcdData>
+        <PcdData ItemType="DYNAMIC">
+          <C_Name>PcdFlashNvStorageFtwWorkingBase</C_Name>
+          <Token>0x30000010</Token>
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+          <DatumType>UINT32</DatumType>
+          <MaxDatumSize>4</MaxDatumSize>
+          <Value>0x0</Value>
+        </PcdData>
+        <PcdData ItemType="DYNAMIC">
+          <C_Name>PcdFlashNvStorageFtwWorkingSize</C_Name>
+          <Token>0x30000011</Token>
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+          <DatumType>UINT32</DatumType>
+          <MaxDatumSize>4</MaxDatumSize>
+          <Value>0x0</Value>
+        </PcdData>
       </PcdBuildDefinition>
       <ModuleSaBuildOptions>
         <FvBinding>FV_RECOVERY</FvBinding>
@@ -2758,6 +2832,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         <Instance ModuleGuid="f12b59c9-76d0-4661-ad7c-f04d1bef0558" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
         <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
         <Instance ModuleGuid="bd4d540e-04b0-4b10-8fd5-4a7bb533cf67" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>
+        <!--Pkg: MdePkg Mod: DxePcdLib Path: MdePkg\Library\DxePcdLib\DxePcdLib.msa-->
+        <Instance ModuleGuid="af97eb89-4cc6-45f8-a514-ca025b346480" ModuleVersion="1.0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec" PackageVersion="0.3"/>
       </Libraries>
       <PcdBuildDefinition>
         <PcdData ItemType="FIXED_AT_BUILD">
@@ -2824,6 +2900,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
           <MaxDatumSize>1</MaxDatumSize>
           <Value>0xAF</Value>
         </PcdData>
+        <PcdData ItemType="DYNAMIC">
+          <C_Name>PcdFlashNvStorageVariableBase</C_Name>
+          <Token>0x30000001</Token>
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+          <DatumType>UINT32</DatumType>
+          <MaxDatumSize>4</MaxDatumSize>
+          <Value>0x0</Value>
+        </PcdData>
+        <PcdData ItemType="DYNAMIC">
+          <C_Name>PcdFlashNvStorageVariableSize</C_Name>
+          <Token>0x30000002</Token>
+          <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+          <DatumType>UINT32</DatumType>
+          <MaxDatumSize>4</MaxDatumSize>
+          <Value>0x0</Value>
+        </PcdData>
       </PcdBuildDefinition>
       <ModuleSaBuildOptions>
         <FvBinding>FV_RECOVERY</FvBinding>
@@ -6826,7 +6918,62 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       <MaxDatumSize>4</MaxDatumSize>
       <SkuInfo>
         <SkuId>0</SkuId>
-        <Value>0</Value>
+        <Value>0x0</Value>
+      </SkuInfo>
+    </PcdBuildData>
+    <PcdBuildData ItemType="DYNAMIC">
+      <C_Name>PcdFlashNvStorageVariableSize</C_Name>
+      <Token>0x30000002</Token>
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+      <DatumType>UINT32</DatumType>
+      <MaxDatumSize>4</MaxDatumSize>
+      <SkuInfo>
+        <SkuId>0</SkuId>
+        <Value>0x0</Value>
+      </SkuInfo>
+    </PcdBuildData>
+    <PcdBuildData ItemType="DYNAMIC">
+      <C_Name>PcdFlashNvStorageFtwWorkingBase</C_Name>
+      <Token>0x30000010</Token>
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+      <DatumType>UINT32</DatumType>
+      <MaxDatumSize>4</MaxDatumSize>
+      <SkuInfo>
+        <SkuId>0</SkuId>
+        <Value>0x0</Value>
+      </SkuInfo>
+    </PcdBuildData>
+    <PcdBuildData ItemType="DYNAMIC">
+      <C_Name>PcdFlashNvStorageFtwWorkingSize</C_Name>
+      <Token>0x30000011</Token>
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+      <DatumType>UINT32</DatumType>
+      <MaxDatumSize>4</MaxDatumSize>
+      <SkuInfo>
+        <SkuId>0</SkuId>
+        <Value>0x0</Value>
+      </SkuInfo>
+    </PcdBuildData>
+    <PcdBuildData ItemType="DYNAMIC">
+      <C_Name>PcdFlashNvStorageFtwSpareBase</C_Name>
+      <Token>0x30000013</Token>
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+      <DatumType>UINT32</DatumType>
+      <MaxDatumSize>4</MaxDatumSize>
+      <SkuInfo>
+        <SkuId>0</SkuId>
+        <Value>0x0</Value>
+      </SkuInfo>
+    </PcdBuildData>
+    <PcdBuildData ItemType="DYNAMIC">
+      <C_Name>PcdFlashNvStorageFtwSpareSize</C_Name>
+      <Token>0x30000014</Token>
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+      <DatumType>UINT32</DatumType>
+      <MaxDatumSize>4</MaxDatumSize>
+      <SkuInfo>
+        <SkuId>0</SkuId>
+        <Value>0x0</Value>
       </SkuInfo>
     </PcdBuildData>
     <PcdBuildData ItemType="DYNAMIC">
index 54dc137..af8e13c 100644 (file)
@@ -176,6 +176,25 @@ Returns:
     FlashHobData.SubAreaData.Base       = FdBase + (EFI_PHYSICAL_ADDRESS) (UINTN) mFlashAreaData[Index].Base;\r
     FlashHobData.SubAreaData.Length     = (EFI_PHYSICAL_ADDRESS) (UINTN) mFlashAreaData[Index].Length;\r
 \r
+    //\r
+    // We also update a PCD entry so that any driver that depend on\r
+    // PCD entry will get the information.\r
+    //\r
+    if (FlashHobData.AreaType == EFI_FLASH_AREA_EFI_VARIABLES) {\r
+      PcdSet32 (PcdFlashNvStorageVariableBase, (UINT32) FlashHobData.SubAreaData.Base);\r
+      PcdSet32 (PcdFlashNvStorageVariableSize, (UINT32) FlashHobData.SubAreaData.Length);\r
+    }\r
+\r
+    if (FlashHobData.AreaType == EFI_FLASH_AREA_FTW_STATE) {\r
+      PcdSet32 (PcdFlashNvStorageFtwWorkingBase, (UINT32) FlashHobData.SubAreaData.Base);\r
+      PcdSet32 (PcdFlashNvStorageFtwWorkingSize, (UINT32) FlashHobData.SubAreaData.Length);\r
+    }\r
+\r
+    if (FlashHobData.AreaType == EFI_FLASH_AREA_FTW_BACKUP) {\r
+      PcdSet32 (PcdFlashNvStorageFtwSpareBase, (UINT32) FlashHobData.SubAreaData.Base);\r
+      PcdSet32 (PcdFlashNvStorageFtwSpareSize, (UINT32) FlashHobData.SubAreaData.Length);\r
+    }\r
+\r
     switch (FlashHobData.AreaType) {\r
     case EFI_FLASH_AREA_RECOVERY_BIOS:\r
     case EFI_FLASH_AREA_MAIN_BIOS:\r
@@ -202,12 +221,6 @@ Returns:
                         &gEfiFirmwareVolumeBlockProtocolGuid,\r
                         sizeof (EFI_GUID)\r
                         );\r
-\r
-      //\r
-      // We also update a PCD entry so that any driver that depend on\r
-      // PCD entry PcdFlashNvStorageVariableBase will get the information.\r
-      //\r
-      PcdSet32 (PcdFlashNvStorageVariableBase, (UINT32) FlashHobData.SubAreaData.Base);\r
       break;\r
 \r
     default:\r
index 2dba783..1a098cf 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
 <!--Copyright (c) 2006, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -103,5 +103,25 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
         normally a FIXED_AT_BUILD type as system memory map is fixed to BIOS.\r
       </HelpText>\r
     </PcdEntry>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">\r
+      <C_Name>PcdFlashNvStorageFtwSpareBase</C_Name>\r
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>To get base address of the FTW spare block section in NV firmware volume.</HelpText>\r
+    </PcdEntry>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">\r
+      <C_Name>PcdFlashNvStorageFtwSpareSize</C_Name>\r
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>To get size of the FTW spare block section in NV firmware volume.</HelpText>\r
+    </PcdEntry>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">\r
+      <C_Name>PcdFlashNvStorageFtwWorkingBase</C_Name>\r
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>To get base address of the FTW working block section in NV firmware volume.</HelpText>\r
+    </PcdEntry>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">\r
+      <C_Name>PcdFlashNvStorageFtwWorkingSize</C_Name>\r
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>To get size of the FTW working block section in NV firmware volume.</HelpText>\r
+    </PcdEntry>    \r
   </PcdCoded>\r
 </ModuleSurfaceArea>\r