From dd70a8c4e6c8c439dfcc7c94c478c76ab8fda1ec Mon Sep 17 00:00:00 2001 From: qwang12 Date: Wed, 9 Aug 2006 05:09:30 +0000 Subject: [PATCH] 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 --- .../Universal/Variable/Pei/Variable.msa | 26 ++++++------ EdkNt32Pkg/Nt32.fpd | 24 ++++++++++- EdkNt32Pkg/Pei/FlashMap/FlashMap.c | 6 +++ EdkNt32Pkg/Pei/FlashMap/FlashMap.dxs | 2 +- EdkNt32Pkg/Pei/FlashMap/FlashMap.msa | 41 +++++++++++++------ 5 files changed, 70 insertions(+), 29 deletions(-) diff --git a/EdkModulePkg/Universal/Variable/Pei/Variable.msa b/EdkModulePkg/Universal/Variable/Pei/Variable.msa index 5fa1028d41..4dcffcfacc 100644 --- a/EdkModulePkg/Universal/Variable/Pei/Variable.msa +++ b/EdkModulePkg/Universal/Variable/Pei/Variable.msa @@ -1,11 +1,11 @@  - @@ -16,11 +16,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> Component description file for PeiVariable module. Framework PEIM to provide the Variable functionality. 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 - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + All rights reserved. This program and the accompanying materials + 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 + http://opensource.org/licenses/bsd-license.php + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052 @@ -78,7 +78,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> - + PcdFlashNvStorageVariableBase gEfiGenericPlatformTokenSpaceGuid diff --git a/EdkNt32Pkg/Nt32.fpd b/EdkNt32Pkg/Nt32.fpd index d9cb3d2014..64ed3aaa80 100644 --- a/EdkNt32Pkg/Nt32.fpd +++ b/EdkNt32Pkg/Nt32.fpd @@ -711,8 +711,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + + + PcdFlashNvStorageVariableBase + 0x30000001 + gEfiGenericPlatformTokenSpaceGuid + UINT32 + 4 + 0 + PcdMaximumUnicodeStringLength 0x00000001 @@ -877,13 +886,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - + PcdFlashNvStorageVariableBase 0x30000001 gEfiGenericPlatformTokenSpaceGuid UINT32 4 - 0x00280000 + 0 PcdMaximumUnicodeStringLength @@ -6809,6 +6818,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + + PcdFlashNvStorageVariableBase + 0x30000001 + gEfiGenericPlatformTokenSpaceGuid + UINT32 + 4 + + 0 + 0 + + PcdWinNtMemorySize 0x00001005 diff --git a/EdkNt32Pkg/Pei/FlashMap/FlashMap.c b/EdkNt32Pkg/Pei/FlashMap/FlashMap.c index b459257285..54dc137a76 100644 --- a/EdkNt32Pkg/Pei/FlashMap/FlashMap.c +++ b/EdkNt32Pkg/Pei/FlashMap/FlashMap.c @@ -202,6 +202,12 @@ 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.dxs b/EdkNt32Pkg/Pei/FlashMap/FlashMap.dxs index 0c197de817..f75e7aa31e 100644 --- a/EdkNt32Pkg/Pei/FlashMap/FlashMap.dxs +++ b/EdkNt32Pkg/Pei/FlashMap/FlashMap.dxs @@ -23,6 +23,6 @@ Abstract: #include DEPENDENCY_START - TRUE + PCD_PPI_GUID DEPENDENCY_END diff --git a/EdkNt32Pkg/Pei/FlashMap/FlashMap.msa b/EdkNt32Pkg/Pei/FlashMap/FlashMap.msa index 1b662c6c61..2dba783f02 100644 --- a/EdkNt32Pkg/Pei/FlashMap/FlashMap.msa +++ b/EdkNt32Pkg/Pei/FlashMap/FlashMap.msa @@ -1,11 +1,11 @@  - @@ -16,11 +16,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> Component description file for FlashMap PEI module This module installs FlashMap PPI which is used to get flash layout information. 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 - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + All rights reserved. This program and the accompanying materials + 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 + http://opensource.org/licenses/bsd-license.php + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052 @@ -48,6 +48,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> BaseMemoryLib + + PcdLib + FlashMap.c @@ -89,4 +92,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> PeimInitializeFlashMap - \ No newline at end of file + + + PcdFlashNvStorageVariableBase + gEfiGenericPlatformTokenSpaceGuid + 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. + + + + -- 2.39.2