diff options
author | Guo Mang <mang.guo@intel.com> | 2017-04-05 14:44:39 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-05-09 13:03:12 +0800 |
commit | 0e87145f67e7d86c7e251d8965148c21176a12e2 (patch) | |
tree | 66ad95db468a76c8277ad0c3cedaedd6ce6c95a7 | |
parent | 093a0002e52cc695ffe7bb4c36d471ead2916a4d (diff) | |
download | edk2-platforms-0e87145f67e7d86c7e251d8965148c21176a12e2.tar.xz |
Fix get variable issue
Fix "AcpiGlobalVariable" couldn't be get issue. S3 memory info was saved in this variable.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Mang <mang.guo@intel.com>
Reviewed-by: zwei4 <david.wei@intel.com>
5 files changed, 29 insertions, 11 deletions
diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c index a002bef041..854d737c21 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c @@ -907,6 +907,7 @@ PlatformInitPreMemEntryPoint ( #endif
PEI_BOARD_PRE_MEM_INIT_PPI *BoardPreMemInitPpi;
UINTN Instance;
+ UINT64 AcpiVariableSetCompatibility;
Status = (*PeiServices)->RegisterForShadow (FileHandle);
@@ -1070,25 +1071,25 @@ PlatformInitPreMemEntryPoint ( ASSERT_EFI_ERROR (Status);
return Status;
}
-
- VariableSize = sizeof (SystemConfiguration);
+
+ VariableSize = sizeof (AcpiVariableSetCompatibility);
Status = VariableServices->GetVariable (
VariableServices,
- PLATFORM_SETUP_VARIABLE_NAME,
- &gEfiSetupVariableGuid,
+ ACPI_GLOBAL_VARIABLE,
+ &gEfiAcpiVariableCompatiblityGuid,
NULL,
&VariableSize,
- &SystemConfiguration
+ &AcpiVariableSetCompatibility
);
AcpiVarHobSize = sizeof (UINT64);
BuildGuidDataHob (
&gEfiAcpiVariableCompatiblityGuid,
- &SystemConfiguration.AcpiVariableSetCompatibility,
+ &AcpiVariableSetCompatibility,
sizeof (AcpiVarHobSize)
);
- DEBUG ((DEBUG_INFO, "AcpiVariableAddr : 0x%08x\n", SystemConfiguration.AcpiVariableSetCompatibility));
+ DEBUG ((DEBUG_INFO, "AcpiVariableAddr : 0x%08x\n", AcpiVariableSetCompatibility));
PERF_START_EX (NULL, "RstVctr", "IBBL", 1, 0x1000);
Tick = CarMap->IbblPerfRecord0;
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c index 09e6d68423..1087196154 100644 --- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c +++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c @@ -1,7 +1,7 @@ /** @file
DXE SMM CSE Variable Storage Selector Library.
- Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -75,6 +75,13 @@ GetCseVariableStoreFileType ( CseVariableFileTypePreMemoryFile :
CseVariableFileTypePrimaryIndexFile
);
+ } else if ((StrCmp (VariableName, L"AcpiGlobalVariable") == 0) &&
+ CompareGuid (VendorGuid, &gEfiAcpiVariableCompatiblityGuid)) {
+ DEBUG ((EFI_D_INFO, "CseVariableStorageSelectorLib - Variable is AcpiGlobalVariable\n"));
+ return (CseVariableFileInfo[CseVariableFileTypePreMemoryFile]->FileEnabled ?
+ CseVariableFileTypePreMemoryFile :
+ CseVariableFileTypePrimaryIndexFile
+ );
} else {
//
// All other variables are stored in individual CSE files
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf index 5956383d43..bbbde90add 100644 --- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf +++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf @@ -4,7 +4,7 @@ # Determines which CSE resources to consume in SMM.
# Example: HECI1 or HECI2.
#
-# Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -37,6 +37,7 @@ MdePkg/MdePkg.dec
BroxtonSiPkg/BroxtonSiPkg.dec
BroxtonSiPkg/BroxtonSiPrivate.dec
+ IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
[Protocols]
gEfiHeciSmmProtocolGuid
@@ -52,3 +53,4 @@ [Guids]
gEfiMemoryConfigVariableGuid
gEfiSetupVariableGuid
+ gEfiAcpiVariableCompatiblityGuid
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c index cee10eae56..a9d93fe680 100644 --- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c +++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c @@ -1,7 +1,7 @@ /** @file
PEI CSE Variable Storage Selector Library.
- Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -73,6 +73,12 @@ GetCseVariableStoreFileType ( CseVariableFileTypePreMemoryFile :
CseVariableFileTypePrimaryIndexFile
);
+} else if ((StrCmp (VariableName, L"AcpiGlobalVariable") == 0) &&
+ CompareGuid (VendorGuid, &gEfiAcpiVariableCompatiblityGuid)) {
+ return (CseVariableFileInfo[CseVariableFileTypePreMemoryFile]->FileEnabled ?
+ CseVariableFileTypePreMemoryFile :
+ CseVariableFileTypePrimaryIndexFile
+ );
} else {
//
// All other variables are stored in individual CSE files
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf index bd6cce0924..474a9b7a58 100644 --- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf +++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf @@ -4,7 +4,7 @@ # Determines which CSE resources to consume in PEI.
# Example: HECI1 or HECI2.
#
-# Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -35,6 +35,7 @@ MdePkg/MdePkg.dec
BroxtonSiPkg/BroxtonSiPkg.dec
BroxtonSiPkg/BroxtonSiPrivate.dec
+ IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
[LibraryClasses]
BaseLib
@@ -45,3 +46,4 @@ [Guids]
gEfiMemoryConfigVariableGuid
gEfiSetupVariableGuid
+ gEfiAcpiVariableCompatiblityGuid
|