Variable PEIM use to PCD entry to get the base address of NV Storegae region.

This patch changes:

1) make the PcdFlashNvStorageVariableBase PCD entry type in Variable PEIM to be "DYNAMIC", which means it can be flexible to be FIX_AT_BUILD, DYNAMIC or PATCH_IN_MODULE.
2) make FlashMap depends on PCD_PPI
3) make FlashMap PEIM to the value of PcdFlashNvStorageVariableBase according NT emulator's FwhPPI installed by NT32 emulator's SEC.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1223 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12 2006-08-09 05:09:30 +00:00
parent 19d66cd590
commit dd70a8c4e6
5 changed files with 70 additions and 29 deletions

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!--Copyright (c) 2006, Intel Corporation <!--Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0"> <ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">
<MsaHeader> <MsaHeader>
@ -16,11 +16,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
<Abstract>Component description file for PeiVariable module.</Abstract> <Abstract>Component description file for PeiVariable module.</Abstract>
<Description>Framework PEIM to provide the Variable functionality.</Description> <Description>Framework PEIM to provide the Variable functionality.</Description>
<Copyright>Copyright (c) 2006, Intel Corporation</Copyright> <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
<License>All rights reserved. This program and the accompanying materials <License>All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License> WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification> <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader> </MsaHeader>
@ -78,7 +78,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
</Extern> </Extern>
</Externs> </Externs>
<PcdCoded> <PcdCoded>
<PcdEntry PcdItemType="FIXED_AT_BUILD"> <PcdEntry PcdItemType="DYNAMIC">
<C_Name>PcdFlashNvStorageVariableBase</C_Name> <C_Name>PcdFlashNvStorageVariableBase</C_Name>
<TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName> <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
<HelpText> <HelpText>

View File

@ -711,8 +711,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Instance ModuleGuid="8c690838-7a22-45c4-aa58-a33e3e515cd4" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="8c690838-7a22-45c4-aa58-a33e3e515cd4" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
<Instance ModuleGuid="bda39d3a-451b-4350-8266-81ab10fa0523" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="bda39d3a-451b-4350-8266-81ab10fa0523" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
<Instance ModuleGuid="27d67720-ea68-48ae-93da-a3a074c90e30" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="27d67720-ea68-48ae-93da-a3a074c90e30" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
<Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
</Libraries> </Libraries>
<PcdBuildDefinition> <PcdBuildDefinition>
<PcdData ItemType="DYNAMIC">
<C_Name>PcdFlashNvStorageVariableBase</C_Name>
<Token>0x30000001</Token>
<TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>UINT32</DatumType>
<MaxDatumSize>4</MaxDatumSize>
<Value>0</Value>
</PcdData>
<PcdData ItemType="FIXED_AT_BUILD"> <PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdMaximumUnicodeStringLength</C_Name> <C_Name>PcdMaximumUnicodeStringLength</C_Name>
<Token>0x00000001</Token> <Token>0x00000001</Token>
@ -877,13 +886,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
</Libraries> </Libraries>
<PcdBuildDefinition> <PcdBuildDefinition>
<PcdData ItemType="FIXED_AT_BUILD"> <PcdData ItemType="DYNAMIC">
<C_Name>PcdFlashNvStorageVariableBase</C_Name> <C_Name>PcdFlashNvStorageVariableBase</C_Name>
<Token>0x30000001</Token> <Token>0x30000001</Token>
<TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName> <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
<DatumType>UINT32</DatumType> <DatumType>UINT32</DatumType>
<MaxDatumSize>4</MaxDatumSize> <MaxDatumSize>4</MaxDatumSize>
<Value>0x00280000</Value> <Value>0</Value>
</PcdData> </PcdData>
<PcdData ItemType="FIXED_AT_BUILD"> <PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdMaximumUnicodeStringLength</C_Name> <C_Name>PcdMaximumUnicodeStringLength</C_Name>
@ -6809,6 +6818,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</ModuleSA> </ModuleSA>
</FrameworkModules> </FrameworkModules>
<DynamicPcdBuildDefinitions> <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>0</Value>
</SkuInfo>
</PcdBuildData>
<PcdBuildData ItemType="DYNAMIC"> <PcdBuildData ItemType="DYNAMIC">
<C_Name>PcdWinNtMemorySize</C_Name> <C_Name>PcdWinNtMemorySize</C_Name>
<Token>0x00001005</Token> <Token>0x00001005</Token>

View File

@ -202,6 +202,12 @@ Returns:
&gEfiFirmwareVolumeBlockProtocolGuid, &gEfiFirmwareVolumeBlockProtocolGuid,
sizeof (EFI_GUID) 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; break;
default: default:

View File

@ -23,6 +23,6 @@ Abstract:
#include <PeimDepex.h> #include <PeimDepex.h>
DEPENDENCY_START DEPENDENCY_START
TRUE PCD_PPI_GUID
DEPENDENCY_END DEPENDENCY_END

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!--Copyright (c) 2006, Intel Corporation <!--Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0"> <ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">
<MsaHeader> <MsaHeader>
@ -16,11 +16,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
<Abstract>Component description file for FlashMap PEI module</Abstract> <Abstract>Component description file for FlashMap PEI module</Abstract>
<Description>This module installs FlashMap PPI which is used to get flash layout information.</Description> <Description>This module installs FlashMap PPI which is used to get flash layout information.</Description>
<Copyright>Copyright (c) 2006, Intel Corporation</Copyright> <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
<License>All rights reserved. This program and the accompanying materials <License>All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License> WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification> <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader> </MsaHeader>
@ -48,6 +48,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>BaseMemoryLib</Keyword> <Keyword>BaseMemoryLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>PcdLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>FlashMap.c</Filename> <Filename>FlashMap.c</Filename>
@ -89,4 +92,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
<ModuleEntryPoint>PeimInitializeFlashMap</ModuleEntryPoint> <ModuleEntryPoint>PeimInitializeFlashMap</ModuleEntryPoint>
</Extern> </Extern>
</Externs> </Externs>
</ModuleSurfaceArea> <PcdCoded>
<PcdEntry PcdItemType="DYNAMIC">
<C_Name>PcdFlashNvStorageVariableBase</C_Name>
<TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
<HelpText>The driver sets the NV Storage FV base address defined by this PCD.
This base address point to an EFI_FIRMWARE_VOLUMN_HEADER struct. Variable PEIM
will get the base address from this PCD. In NT emulator, this PCD is a DYNAMIC
type, as FD is mapped to process space by WinNT OS. On real platform, it is
normally a FIXED_AT_BUILD type as system memory map is fixed to BIOS.
</HelpText>
</PcdEntry>
</PcdCoded>
</ModuleSurfaceArea>