From: "Wei, David" <david.wei@intel.com>
To: "Guo, Mang" <mang.guo@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>
Subject: Re: [Patch][edk2-platforms/devel-MinnowBoard3 1/3] Fix get variable issue
Date: Thu, 6 Apr 2017 01:30:03 +0000 [thread overview]
Message-ID: <89954A0B46707A448411A627AD4EEE3468F2416D@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <22D2C85ED001C54AA20BFE3B0E4751D1524FCF05@SHSMSX103.ccr.corp.intel.com>
Reviewed-by: zwei4 <david.wei@intel.com>
Thanks,
David Wei
-----Original Message-----
From: Guo, Mang
Sent: Wednesday, April 05, 2017 2:57 PM
To: edk2-devel@lists.01.org
Cc: Wei, David <david.wei@intel.com>; Lu, ShifeiX A <shifeix.a.lu@intel.com>
Subject: [Patch][edk2-platforms/devel-MinnowBoard3 1/3] 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>
---
.../PlatformPreMemPei/PlatformInitPreMem.c | 15 ++++++++-------
.../CseVariableStorageSelectorLib.c | 9 ++++++++-
.../SmmCseVariableStorageSelectorLib.inf | 4 +++-
.../PeiCseVariableStorageSelectorLib.c | 8 +++++++-
.../PeiCseVariableStorageSelectorLib.inf | 4 +++-
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 a002bef..854d737 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 09e6d68..1087196 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 5956383..bbbde90 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 cee10ea..a9d93fe 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 bd6cce0..474a9b7 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
--
2.10.1.windows.1
prev parent reply other threads:[~2017-04-06 1:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-05 6:57 [Patch][edk2-platforms/devel-MinnowBoard3 1/3] Fix get variable issue Guo, Mang
2017-04-06 1:30 ` Wei, David [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=89954A0B46707A448411A627AD4EEE3468F2416D@SHSMSX101.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox