From 599f54866cf77ed21fb0dbfb7ca027434f5764b2 Mon Sep 17 00:00:00 2001 From: Guo Mang Date: Thu, 6 Jul 2017 14:28:28 +0800 Subject: Enable GCC Yocto S3 Enable GCC build BIOS image Yocto S3 support. Replace CPU drivers with drivers from core packages. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang --- .../Common/Acpi/AcpiPlatformDxe/AcpiPlatform.c | 34 ++++++++++++++++++++++ .../Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf | 4 ++- .../PlatformPostMemPei/PlatformInit.c | 30 ------------------- .../PlatformPostMemPei/PlatformPostMemPei.inf | 1 - 4 files changed, 37 insertions(+), 32 deletions(-) (limited to 'Platform/BroxtonPlatformPkg/Common') diff --git a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatform.c b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatform.c index b5cd9f7fea..30071325aa 100644 --- a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatform.c +++ b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatform.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include "PlatformBaseAddresses.h" #if (ENBDT_PF_ENABLE == 0) @@ -66,6 +68,8 @@ CHAR16 gACPIOSFRMfgStringVariableName[] = ACPI_OSFR_MFG_STRING_VARIABLE_NA EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea; EFI_CPU_IO2_PROTOCOL *mCpuIo; +CPU_INIT_DATA_HOB *mCpuInitDataHob = NULL; +CPU_GLOBAL_NVS_AREA_PROTOCOL CpuGlobalNvsAreaProtocol; BOOLEAN mFirstNotify; EFI_PLATFORM_INFO_HOB *mPlatformInfo; @@ -1317,6 +1321,7 @@ AcpiPlatformEntryPoint ( CHAR16 LocalGuidString[GUID_CHARS_NUMBER]; UINTN Data32; UINT32 VariableAttributes; + VOID *Hob; mFirstNotify = FALSE; TableVersion = EFI_ACPI_TABLE_VERSION_2_0; @@ -1999,6 +2004,35 @@ AcpiPlatformEntryPoint ( NULL ); + + + // + // Get CPU Init Data Hob + // + Hob = GetFirstGuidHob (&gCpuInitDataHobGuid); + if (Hob == NULL) { + DEBUG ((DEBUG_ERROR, "CPU Data HOB not available\n")); + ASSERT_EFI_ERROR (EFI_NOT_FOUND); + } + mCpuInitDataHob = (CPU_INIT_DATA_HOB *) ((UINTN) Hob + sizeof (EFI_HOB_GUID_TYPE)); + + // + // Get CPU Global NVS protocol pointer + // + CpuGlobalNvsAreaProtocol.Area = (CPU_GLOBAL_NVS_AREA *) (UINTN) mCpuInitDataHob->CpuGnvsPointer; + CpuGlobalNvsAreaProtocol.Area->DtsAcpiEnable = 0; + + // + // Install Cpu Power management GlobalNVS Area protocol + // + Status = gBS->InstallMultipleProtocolInterfaces ( + &Handle, + &gCpuGlobalNvsAreaProtocolGuid, + &CpuGlobalNvsAreaProtocol, + NULL + ); + ASSERT_EFI_ERROR (Status); + // // Read tables from the storage file. // diff --git a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf index cf862fc88d..31c2a77532 100644 --- a/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/Platform/BroxtonPlatformPkg/Common/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -1,7 +1,7 @@ ## @file # ACPI Platform Driver. # -# Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 1999 - 2017, 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 @@ -62,6 +62,7 @@ gEfiBxtVariableGuid gEfiPramConfGuid gPlatformSsdtImageGuid + gCpuInitDataHobGuid [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED @@ -77,6 +78,7 @@ gEfiTcgProtocolGuid gEfiFirmwareVolume2ProtocolGuid gEfiSeCOperationProtocolGuid + gCpuGlobalNvsAreaProtocolGuid [Pcd] gEfiBxtTokenSpaceGuid.PcdScAcpiIoPortBaseAddress diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c index 7d84e26b76..bfed3bf1ac 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -30,13 +29,6 @@ #pragma optimize ("", off) #endif -EFI_STATUS -EFIAPI -CpuS3SmmAccessNotifyCallback ( - IN EFI_PEI_SERVICES **PeiServices, - IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, - IN VOID *Ppi - ); static EFI_PEI_RESET_PPI mResetPpi = { IchReset }; @@ -68,11 +60,6 @@ static EFI_PEI_PPI_DESCRIPTOR mPpiList[] = { }; static EFI_PEI_NOTIFY_DESCRIPTOR mNotifyList[] = { - { - EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK, - &gPeiSmmAccessPpiGuid, - CpuS3SmmAccessNotifyCallback - }, { (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), &gEfiEndOfPeiSignalPpiGuid, @@ -545,23 +532,6 @@ PeiGetSectionFromFv ( } -EFI_STATUS -EFIAPI -CpuS3SmmAccessNotifyCallback ( - IN EFI_PEI_SERVICES **PeiServices, - IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, - IN VOID *Ppi - ) -{ - // - // Restore Cpu settings only during S3 resume - // - S3InitializeCpu (PeiServices); - - return EFI_SUCCESS; -} - - /** Install Firmware Volume Hob's once there is main memory diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformPostMemPei.inf b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformPostMemPei.inf index 762eff2a2b..2fb7fb6a6f 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformPostMemPei.inf +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformPostMemPei.inf @@ -55,7 +55,6 @@ CpuPolicyLib TimerLib ScPlatformLib - CpuS3Lib SeCUmaLib [Ppis] -- cgit v1.2.3