diff options
author | xgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-08-10 12:28:02 +0000 |
---|---|---|
committer | xgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-08-10 12:28:02 +0000 |
commit | 202c5d55e5a5a1f065038cda8316ad36293aa6bb (patch) | |
tree | bb5348825b30ebfd14566d2d87fc639a9e928c49 /EdkNt32Pkg | |
parent | 382aab1c37276a1274e62469301ee27374cbd047 (diff) | |
download | edk2-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 'EdkNt32Pkg')
-rw-r--r-- | EdkNt32Pkg/Include/FlashLayout.h | 4 | ||||
-rw-r--r-- | EdkNt32Pkg/Nt32.fpd | 153 | ||||
-rw-r--r-- | EdkNt32Pkg/Pei/FlashMap/FlashMap.c | 25 | ||||
-rw-r--r-- | EdkNt32Pkg/Pei/FlashMap/FlashMap.msa | 22 |
4 files changed, 192 insertions, 12 deletions
diff --git a/EdkNt32Pkg/Include/FlashLayout.h b/EdkNt32Pkg/Include/FlashLayout.h index 5a95961709..1a13f16c50 100644 --- a/EdkNt32Pkg/Include/FlashLayout.h +++ b/EdkNt32Pkg/Include/FlashLayout.h @@ -48,9 +48,9 @@ Abstract: #define EFI_WINNT_RUNTIME_UPDATABLE_FV_HEADER_LENGTH 0x48
-#define EFI_VARIABLE_STORE_OFFSET (EFI_WINNT_RUNTIME_UPDATABLE_OFFSET + EFI_WINNT_RUNTIME_UPDATABLE_FV_HEADER_LENGTH)
+#define EFI_VARIABLE_STORE_OFFSET EFI_WINNT_RUNTIME_UPDATABLE_OFFSET
-#define EFI_VARIABLE_STORE_LENGTH (0x00C000 - EFI_WINNT_RUNTIME_UPDATABLE_FV_HEADER_LENGTH)
+#define EFI_VARIABLE_STORE_LENGTH 0x00C000
#define EFI_EVENT_LOG_OFFSET (EFI_VARIABLE_STORE_OFFSET + EFI_VARIABLE_STORE_LENGTH)
diff --git a/EdkNt32Pkg/Nt32.fpd b/EdkNt32Pkg/Nt32.fpd index 64ed3aaa80..4e9ceb19a1 100644 --- a/EdkNt32Pkg/Nt32.fpd +++ b/EdkNt32Pkg/Nt32.fpd @@ -715,12 +715,52 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. </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"> diff --git a/EdkNt32Pkg/Pei/FlashMap/FlashMap.c b/EdkNt32Pkg/Pei/FlashMap/FlashMap.c index 54dc137a76..af8e13c9ff 100644 --- a/EdkNt32Pkg/Pei/FlashMap/FlashMap.c +++ b/EdkNt32Pkg/Pei/FlashMap/FlashMap.c @@ -176,6 +176,25 @@ Returns: FlashHobData.SubAreaData.Base = FdBase + (EFI_PHYSICAL_ADDRESS) (UINTN) mFlashAreaData[Index].Base;
FlashHobData.SubAreaData.Length = (EFI_PHYSICAL_ADDRESS) (UINTN) mFlashAreaData[Index].Length;
+ //
+ // We also update a PCD entry so that any driver that depend on
+ // PCD entry will get the information.
+ //
+ if (FlashHobData.AreaType == EFI_FLASH_AREA_EFI_VARIABLES) {
+ PcdSet32 (PcdFlashNvStorageVariableBase, (UINT32) FlashHobData.SubAreaData.Base);
+ PcdSet32 (PcdFlashNvStorageVariableSize, (UINT32) FlashHobData.SubAreaData.Length);
+ }
+
+ if (FlashHobData.AreaType == EFI_FLASH_AREA_FTW_STATE) {
+ PcdSet32 (PcdFlashNvStorageFtwWorkingBase, (UINT32) FlashHobData.SubAreaData.Base);
+ PcdSet32 (PcdFlashNvStorageFtwWorkingSize, (UINT32) FlashHobData.SubAreaData.Length);
+ }
+
+ if (FlashHobData.AreaType == EFI_FLASH_AREA_FTW_BACKUP) {
+ PcdSet32 (PcdFlashNvStorageFtwSpareBase, (UINT32) FlashHobData.SubAreaData.Base);
+ PcdSet32 (PcdFlashNvStorageFtwSpareSize, (UINT32) FlashHobData.SubAreaData.Length);
+ }
+
switch (FlashHobData.AreaType) {
case EFI_FLASH_AREA_RECOVERY_BIOS:
case EFI_FLASH_AREA_MAIN_BIOS:
@@ -202,12 +221,6 @@ Returns: &gEfiFirmwareVolumeBlockProtocolGuid,
sizeof (EFI_GUID)
);
-
- //
- // We also update a PCD entry so that any driver that depend on
- // PCD entry PcdFlashNvStorageVariableBase will get the information.
- //
- PcdSet32 (PcdFlashNvStorageVariableBase, (UINT32) FlashHobData.SubAreaData.Base);
break;
default:
diff --git a/EdkNt32Pkg/Pei/FlashMap/FlashMap.msa b/EdkNt32Pkg/Pei/FlashMap/FlashMap.msa index 2dba783f02..1a098cf057 100644 --- a/EdkNt32Pkg/Pei/FlashMap/FlashMap.msa +++ b/EdkNt32Pkg/Pei/FlashMap/FlashMap.msa @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -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.
</HelpText>
</PcdEntry>
+ <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>
|