From f039b8ad45670a266bb06a9a480a2a8cdeb4a9d1 Mon Sep 17 00:00:00 2001 From: Guo Mang Date: Wed, 5 Apr 2017 10:47:22 +0800 Subject: 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 --- .../Common/PlatformSettings/PlatformDxe/Platform.c | 2 +- .../PlatformPreMemPei/PlatformInitPreMem.c | 15 ++++++++------- Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc | 2 +- Platform/BroxtonPlatformPkg/PlatformPkg.fdf | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) (limited to 'Platform') 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 -- cgit v1.2.3