summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuo Mang <mang.guo@intel.com>2017-04-05 10:47:22 +0800
committerzwei4 <david.wei@intel.com>2017-04-05 13:28:23 +0800
commitf039b8ad45670a266bb06a9a480a2a8cdeb4a9d1 (patch)
treeb97d90f7c3de0fea9b10cbd1a5ab68b6167c6e9d
parent2490f90b5c8908a776e15db75a646c705464be4e (diff)
downloadedk2-platforms-f039b8ad45670a266bb06a9a480a2a8cdeb4a9d1.tar.xz
Fix several issues of S3
1. Fix "AcpiGlobalVariable" couldn't be get issue. S3 memory info was saved in this variable. 2. Override PiSmmCpuDxeSmm to fix S3 failure issue. This override can be removed after upgrading core. 3. Fix set variable failure issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang <mang.guo@intel.com>
-rw-r--r--Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/Platform.c2
-rw-r--r--Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c15
-rw-r--r--Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc2
-rw-r--r--Platform/BroxtonPlatformPkg/PlatformPkg.fdf2
-rw-r--r--Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c9
-rw-r--r--Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf4
-rw-r--r--Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c8
-rw-r--r--Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf4
8 files changed, 32 insertions, 14 deletions
diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/Platform.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/Platform.c
index 187eb2179e..de503a372a 100644
--- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/Platform.c
+++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/Platform.c
@@ -596,7 +596,7 @@ InitSeC (
Status = gRT->SetVariable (
L"Setup",
&gEfiSetupVariableGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
+ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS,
sizeof (SYSTEM_CONFIGURATION),
&mSystemConfiguration
);
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/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc b/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc
index d39ec6d4bf..fd45e33377 100644
--- a/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc
+++ b/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc
@@ -259,7 +259,7 @@
MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf
+ $(PLATFORM_PACKAGE_COMMON)/SampleCode/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf
UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.inf
diff --git a/Platform/BroxtonPlatformPkg/PlatformPkg.fdf b/Platform/BroxtonPlatformPkg/PlatformPkg.fdf
index 81ca4cb054..0c3482be3c 100644
--- a/Platform/BroxtonPlatformPkg/PlatformPkg.fdf
+++ b/Platform/BroxtonPlatformPkg/PlatformPkg.fdf
@@ -586,7 +586,7 @@ APRIORI DXE {
#
INF MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
INF MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
- INF UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf
+ INF $(PLATFORM_PACKAGE_COMMON)/SampleCode/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf
INF UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
INF MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
INF UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.inf
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