diff options
Diffstat (limited to 'Board/EM/MeWrapper/MePlatformPolicy')
11 files changed, 1543 insertions, 0 deletions
diff --git a/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.c b/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.c new file mode 100644 index 0000000..cdff1aa --- /dev/null +++ b/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.c @@ -0,0 +1,692 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* +//********************************************************************** +// +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/MePlatformPolicy/MePlatformPolicy.c 14 5/14/14 10:33p Tristinchou $ +// +// $Revision: 14 $ +// +// $Date: 5/14/14 10:33p $ +// +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/MePlatformPolicy/MePlatformPolicy.c $ +// +// 14 5/14/14 10:33p Tristinchou +// [TAG] EIPNone +// [Category] Improvement +// [Description] Load ICC library while using ME 9.1 +// +// 13 5/14/14 9:59p Tristinchou +// [TAG] EIP167030 +// [Category] Improvement +// [Description] Remove the variable runtime attribute and keep original +// attributes. +// +// 12 5/13/14 4:02a Tristinchou +// [TAG] EIPNone +// [Category] Improvement +// [Description] Fix BPF version check error while using MEBX 9.1 +// +// 11 7/11/13 5:50a Klzhan +// [TAG] EIP128534 +// [Category] Improvement +// [Description] Restore Logo after information shows +// +// 10 6/21/13 3:07a Klzhan +// [TAG] EIP127189 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME RC 1.60 +// +// 9 5/13/13 2:39a Klzhan +// [TAG] EIPNone +// [Category] Improvement +// [Description] Fix build error when ICC_OVERCLOCKING_SUPPORT disabled. +// +// 8 12/07/12 5:12a Klzhan +// [TAG] EIP107613 +// [Category] Improvement +// [Description] Skip Send HECI protocol when Boot on Flash Update +// +// 7 12/04/12 5:56a Klzhan +// [TAG] EIP107309 +// [Category] New Feature +// [Description] Support ICC library for ME 9.5 +// [Files] MePlatformPolicy.c +// MePlatformPolicy.h +// MePlatformPolicy.sdl +// MePlatformPolicy.mak +// MePlatformPolicy.cif +// +// 6 9/27/12 4:49a Klzhan +// [TAG] EIP102254 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME RC 0.7 +// +// 5 7/02/12 11:34p Klzhan +// [TAG] EIP94113 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME RC 0.6 +// +// 4 5/14/12 4:40a Klzhan +// [TAG] EIP89952 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME RC 0.56 +// [Files] MePlatformPolicy.c +// MePlatformPolicy.h +// MePlatformPolicy.sdl +// MePlatformPolicy.mak +// MePlatformPolicy.cif +// +// 3 4/23/12 11:13p Klzhan +// +// 2 4/03/12 8:11a Klzhan +// [TAG] EIP86914 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME RC. +// +// 1 2/08/12 1:04a Klzhan +// Initial Check in +// +// 10 9/26/11 5:46a Klzhan +// [TAG] EIP70516 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME 8.0 RC 0.8 +// +// 9 9/15/11 6:36a Klzhan +// [TAG] EIP65738 +// [Category] Improvement +// [Description] Disable SOL and IDER when AMT is disabled. +// +// 8 9/07/11 4:49a Klzhan +// Get thermal reporting data from HOB. +// +// 7 7/26/11 8:25a Klzhan +// [TAG] EIP64542 +// [Category] Improvement +// [Description] Replace Getvariable by GetSBSetupData +// +// 6 7/26/11 6:33a Klzhan +// Always_MeFwDowngrade +// +// 5 7/11/11 4:41a Klzhan +// Fix system can't boot on ME FW 1076. +// +// 4 7/08/11 9:14a Klzhan +// Restore to older ME Platform Policy module part. +// To fix system hangs with other modules. +// +// 3 7/08/11 4:20a Klzhan +// [TAG] EIP64189 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME RC to 0.7 +// [Files] MePlatformPolicy.c +// MePlatformPolicy.h +// MePlatformPolicy.sdl +// MePlatformPolicy.mak +// MePlatformPolicy.cif +// +// 2 4/18/11 9:47a Klzhan +// Improvement : Move ME FW downgrade related code to ME platform policy. +// Improvement : Update ME platform policy revision to 7. +// +// 1 2/25/11 1:41a Klzhan +// Initial Check-in +// +// 1 12/03/10 5:09a Klzhan +// Initial Check-in. +// +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: MePlatformPolicy.c +// +// Description: +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> +/*++ + +This file contains a 'Sample Driver' and is licensed as such +under the terms of your license agreement with Intel or your +vendor. This file may be modified by the user, subject to +the additional terms of the license agreement + +--*/ + +/*++ +Copyright (c) 2008 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + +Module Name: + + MePlatformPolicy.c + +Abstract: + + +--*/ +#include "EdkIIGlueDxe.h" +#include "MePlatformPolicy.h" +#include "MeSetup.h" +#include <SetupDataDefinition.h> +#include "MeChipsetLib.h" +#include <token.h> +#if IccOverClocking_SUPPORT +#include "IccProtocol.h" +#endif +DXE_ME_POLICY_PROTOCOL mDxePlatformMePolicy = { 0 }; +SETUP_DATA *gSetupData = NULL; +EFI_MEBX_API_ENTRY_POINT HookedMebxEntryPoint; + +#define ME_INFO_SETUP_GUID \ + {0x78259433, 0x7B6D, 0x4DB3, 0x9A, 0xE8, 0x36, 0xC4, 0xC2, 0xC3, 0xA1, 0x7D} + +EFI_GUID gSetupGuid = SETUP_GUID; +EFI_GUID gEfiFirmwareVolumeProtocolGuid = EFI_FIRMWARE_VOLUME_PROTOCOL_GUID; +EFI_GUID gMeSetupInfoGuid = ME_INFO_SETUP_GUID; +EFI_GUID gEfiMebxProtocolGuid = INTEL_MEBX_PROTOCOL_GUID; + +// +// Driver entry point +// +EFI_DRIVER_ENTRY_POINT (MePlatformPolicyEntryPoint) + +// +// Module Global Variable +// +//TR_CONFIG mTrConfig = { 0 }; + +// +// TS DIMM thermal polling Smbus Address. +// This is platform specific. +// +EFI_STATUS +HookMebxEntry ( + IN UINT32 BiosParams, + OUT UINT32 *MebxReturnValue +) +{ + MEBX_BPF *MebxBpf = NULL; + ME_BIOS_EXTENSION_SETUP *MebxSetup = NULL; + + MebxBpf = (MEBX_BPF*)BiosParams; + MebxSetup = (ME_BIOS_EXTENSION_SETUP*)MebxBpf->MeBiosSyncDataPtr; + + //Modify the BPF version before MEBX entry + MebxBpf->BpfVersion = 0xA000; + MebxSetup->InterfaceVersion = 0xA000; + + return HookedMebxEntryPoint( BiosParams, MebxReturnValue); +} + +VOID +MebxProtocolCallBack ( + IN EFI_EVENT Event, + IN VOID *Context +) +{ + EFI_STATUS Status; + EFI_MEBX_PROTOCOL *MebxProtocol = NULL; + + Status = gBS->LocateProtocol( + &gEfiMebxProtocolGuid, + NULL, + &MebxProtocol ); + if( EFI_ERROR(Status) ) + return; + + //If MEBX version is 10, hook the entry to modify the BPF version + if( (MebxProtocol->MebxVersion.Major == 10) ) + { + HookedMebxEntryPoint = MebxProtocol->CoreMebxEntry; + MebxProtocol->CoreMebxEntry = HookMebxEntry; + } + + gBS->CloseEvent( Event ); +} + +UINT8 mTsDimmSmbusAddress[] = { 0x30, 0x34 }; +EFI_STATUS +DummyHeciSendACK( + IN OUT UINT32 *Message, + IN OUT UINT32 Length, + IN OUT UINT32 *RecLength, + IN UINT8 HostAddress, + IN UINT8 MEAddress + ) +{ + return EFI_SUCCESS; +} +// +// Function implementations +// +EFI_STATUS +EFIAPI +MePlatformPolicyEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable +) +/*++ + +Routine Description: + + Entry point for the Management Engine Driver. + +Arguments: + + ImageHandle Image handle of this driver. + SystemTable Global system service table. + +Returns: + + EFI_SUCCESS Initialization complete. + EFI_UNSUPPORTED The chipset is unsupported by this driver. + EFI_OUT_OF_RESOURCES Do not have enough resources to initialize the driver. + EFI_DEVICE_ERROR Device error, driver exits abnormally. + +--*/ +{ + EFI_STATUS Status; + SETUP_DATA SetupData; + UINT32 SetupVarAttr; + UINTN SetupVariableSize; + EFI_HECI_PROTOCOL *Heci; + UINT32 MeMode = ME_MODE_FAILED; + ME_INFO_SETUP_DATA MeInfoSetupData; + UINT8 Index = 0; + DXE_MBP_DATA_PROTOCOL *mBIOSPayLoad; + EFI_GUID gEfiHeciProtocolGuid = HECI_PROTOCOL_GUID; + EFI_GUID gDimmTsInfoGuid = DIMM_TS_INFO_GUID; + EFI_BOOT_MODE BootMode; + EFI_PEI_HOB_POINTERS HobList; + EFI_EVENT MebxProtocolEvent; + VOID *MebxProtocolReg = NULL; + + EfiInitializeDriverLib (ImageHandle, SystemTable); + Status = gBS->LocateProtocol ( + &gEfiHeciProtocolGuid, + NULL, + &Heci + ); + + if (EFI_ERROR(Status)) return EFI_SUCCESS; + + EfiGetSystemConfigurationTable (&gEfiHobListGuid, &HobList.Raw); + if (HobList.Header->HobType != EFI_HOB_TYPE_HANDOFF) { + DEBUG ((EFI_D_ERROR, "(Wdt) Handoff Hob missing!\n")); + return EFI_NOT_FOUND; + } + + BootMode = HobList.HandoffInformationTable->BootMode; + + if((BootMode == BOOT_ON_FLASH_UPDATE) || + (BootMode == BOOT_ASSUMING_NO_CONFIGURATION_CHANGES)) + { + // Install Dummy HECI protocol. + Heci->SendwACK = DummyHeciSendACK; + } + + + Status = Heci->GetMeMode (&MeMode); + // + // Default ME information for SETUP + // + MeInfoSetupData.MeFirmwareInfo = MeMode; + MeInfoSetupData.MeMajor = 0; + MeInfoSetupData.MeMinor = 0; + MeInfoSetupData.MeHotFix = 0; + MeInfoSetupData.MeBuildNo = 0; + // + // ME DXE Policy Init + // + mDxePlatformMePolicy.Revision = DXE_PLATFORM_ME_POLICY_PROTOCOL_REVISION_2; + + SetupVarAttr = 0; + SetupVariableSize = sizeof(SETUP_DATA); + Status = gRT->GetVariable ( + L"Setup", + &gSetupGuid, + &SetupVarAttr, + &SetupVariableSize, + &SetupData + ); + if(EFI_ERROR(Status)) + { + mDxePlatformMePolicy.MeConfig.MeFwDownGrade = 0; + SetupVarAttr = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE; + } + + if(!EFI_ERROR(Status)) + { + // + // Initialzie the Me Configuration + // + mDxePlatformMePolicy.MeConfig.EndOfPostEnabled = 1; + mDxePlatformMePolicy.MeConfig.MeLocalFwUpdEnabled = 0; + mDxePlatformMePolicy.MeConfig.MdesForBiosState = SetupData.MDESForBiosState; + + // + // Please don't change the default value of EndOfPostDone, + // the value will be update to 1 after the moment EOP message should be sent + // + mDxePlatformMePolicy.MeConfig.EndOfPostDone = 0; + + + }else + { + // Default + mDxePlatformMePolicy.MeConfig.EndOfPostEnabled = 1; + mDxePlatformMePolicy.MeConfig.MeLocalFwUpdEnabled = 0; + } + + // + // Thermal reporting policy is based on strap settings + // + MmioAndThenOr32 ( + PCH_RCRB_BASE + R_PCH_SPI_FDOC, + (UINT32) (~(B_PCH_SPI_FDOC_FDSS_MASK | B_PCH_SPI_FDOC_FDSI_MASK)), + (UINT32) (V_PCH_SPI_FDOC_FDSS_PCHS | R_PCH_SPI_STRP15) + ); + mDxePlatformMePolicy.MeReportError = ShowMeReportError; + +// Debug UpdateDxeMePlatformPolicy (&mMeDxePlatformPolicy); + mDxePlatformMePolicy.MeConfig.MeFwDownGrade = SetupData.MeFwDowngrade; + // + // If Me Fw is in ME_MODE_SECOVER, we will clear "Simple Firmware Downgrade" BIOS setup options + // + if (MeMode == ME_MODE_SECOVER) { + SetupData.MeFwDowngrade = 0; + } + Status = gBS->LocateProtocol ( + &gMeBiosPayloadDataProtocolGuid, + NULL, + &mBIOSPayLoad + ); + if(!EFI_ERROR(Status)) + { + SetupData.MeImageType = (UINT8)mBIOSPayLoad->MeBiosPayload.FwPlatType.RuleData.Fields.IntelMeFwImageType; + SetupData.MeFirmwareInfo = MeMode; + + MeInfoSetupData.MeMajor = mBIOSPayLoad->MeBiosPayload.FwVersionName.MajorVersion; + MeInfoSetupData.MeMinor = mBIOSPayLoad->MeBiosPayload.FwVersionName.MinorVersion; + MeInfoSetupData.MeHotFix = mBIOSPayLoad->MeBiosPayload.FwVersionName.HotfixVersion; + MeInfoSetupData.MeBuildNo = mBIOSPayLoad->MeBiosPayload.FwVersionName.BuildVersion; + } +#if IccOverClocking_SUPPORT + if((MeInfoSetupData.MeMajor == 9) && (MeInfoSetupData.MeMinor == 5)) + { + EFI_GUID gIcc95Guid = ICC_9_5_GUID; + Status = gBS->InstallMultipleProtocolInterfaces ( + &ImageHandle, + &gIcc95Guid, + NULL, + NULL + ); + } + + if( (MeInfoSetupData.MeMajor == 9) && + ((MeInfoSetupData.MeMinor == 0) || (MeInfoSetupData.MeMinor == 1)) ) + { + EFI_GUID gIcc90Guid = ICC_9_0_GUID; + Status = gBS->InstallMultipleProtocolInterfaces ( + &ImageHandle, + &gIcc90Guid, + NULL, + NULL + ); + } +#endif + Status = gRT->SetVariable ( + L"MeInfoSetup", + &gMeSetupInfoGuid, + EFI_VARIABLE_BOOTSERVICE_ACCESS, + sizeof(MeInfoSetupData), + &MeInfoSetupData + ); + + Status = gRT->SetVariable ( + L"Setup", + &gSetupGuid, + SetupVarAttr, + sizeof(SETUP_DATA), + &SetupData + ); + + //Create the event for MEBX_PROTOCOL + Status = gBS->CreateEvent( + EFI_EVENT_NOTIFY_SIGNAL, + EFI_TPL_NOTIFY, + MebxProtocolCallBack, + NULL, + &MebxProtocolEvent ); + + Status = gBS->RegisterProtocolNotify( + &gEfiMebxProtocolGuid, + MebxProtocolEvent, + &MebxProtocolReg ); + + // + // Install protocol to to allow access to this Policy. + // + Status = gBS->InstallMultipleProtocolInterfaces ( + &ImageHandle, + &gDxePlatformMePolicyGuid, + &mDxePlatformMePolicy, + NULL + ); + ASSERT_EFI_ERROR (Status); + + return Status; +} +#include EFI_PROTOCOL_CONSUMER (ConsoleControl) +#include EFI_PROTOCOL_CONSUMER (GraphicsOutput) +EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl; +EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; +EFI_CONSOLE_CONTROL_SCREEN_MODE ScreenMode; +UINTN UgaBltSize = 0; +EFI_UGA_PIXEL *UgaBlt = NULL; +VOID +GraphicsSave +( + VOID +) +{ + EFI_STATUS + Status = gBS->LocateProtocol( &gEfiConsoleControlProtocolGuid, NULL, &ConsoleControl); + + if(EFI_ERROR(Status)) + { + ConsoleControl = NULL; + return; + } + + Status = ConsoleControl->GetMode(ConsoleControl, &ScreenMode, NULL, NULL); + if(ScreenMode == EfiConsoleControlScreenText) + { + ConsoleControl = NULL; + return; + } + + Status = gBS->LocateProtocol( &gEfiGraphicsOutputProtocolGuid, NULL, &GraphicsOutput); + if(EFI_ERROR(Status)) + { + GraphicsOutput = NULL; + return; + } + UgaBltSize = GraphicsOutput->Mode->Info[GraphicsOutput->Mode->Mode].HorizontalResolution * + GraphicsOutput->Mode->Info[GraphicsOutput->Mode->Mode].VerticalResolution * + sizeof(EFI_UGA_PIXEL); + + UgaBlt = AllocateZeroPool (UgaBltSize); + + Status = GraphicsOutput->Blt( + GraphicsOutput, + UgaBlt, + EfiBltVideoToBltBuffer, + 0, 0, + 0, 0, + GraphicsOutput->Mode->Info->HorizontalResolution, + GraphicsOutput->Mode->Info->VerticalResolution, + 0); + + Status = ConsoleControl->SetMode( ConsoleControl, EfiConsoleControlScreenText ); +} + +VOID +GraphicsRestore +( + VOID +) +{ + if(!ConsoleControl) + return; + + ConsoleControl->SetMode( ConsoleControl, EfiConsoleControlScreenGraphics ); + + if(!GraphicsOutput) + return; + + GraphicsOutput->Blt( + GraphicsOutput, + UgaBlt, + EfiBltBufferToVideo, + 0, 0, + 0, 0, + GraphicsOutput->Mode->Info->HorizontalResolution, + GraphicsOutput->Mode->Info->VerticalResolution, + 0); + +} +VOID +ShowMeReportError ( + IN ME_ERROR_MSG_ID MsgId + ) +/*++ + +Routine Description: + + Show Me Error message. + +Arguments: + + MsgId Me error message ID. + +Returns: + + None. + +--*/ +{ + UINTN MsgDelay; + + MsgDelay = HECI_MSG_DELAY; + GraphicsSave(); + gST->ConOut->ClearScreen (gST->ConOut); + + switch (MsgId) { + case MSG_EOP_ERROR: + gST->ConOut->OutputString (gST->ConOut, L"Error sending End Of Post message to ME, System HALT!\n"); + break; + + case MSG_ME_FW_UPDATE_FAILED: + gST->ConOut->OutputString (gST->ConOut, L"ME FW Update Failed, please try again!\n"); + break; + + case MSG_ASF_BOOT_DISK_MISSING: + gST->ConOut->OutputString (gST->ConOut, L"Boot disk missing, please insert boot disk and press ENTER\r\n"); + break; + + case MSG_KVM_TIMES_UP: + gST->ConOut->OutputString (gST->ConOut, L"Error!! Times up and the KVM session was cancelled!!"); + break; + + case MSG_KVM_REJECTED: + gST->ConOut->OutputString (gST->ConOut, L"Error!! The request has rejected and the KVM session was cancelled!!"); + break; + + case MSG_HMRFPO_LOCK_FAILURE: + gST->ConOut->OutputString (gST->ConOut, L"(A7) Me FW Downgrade - Request MeSpiLock Failed\n"); + break; + + case MSG_HMRFPO_UNLOCK_FAILURE: + gST->ConOut->OutputString (gST->ConOut, L"(A7) Me FW Downgrade - Request MeSpiEnable Failed\n"); + break; + + case MSG_ME_FW_UPDATE_WAIT: + gST->ConOut->OutputString ( + gST->ConOut, + L"Intel(R) Firmware Update is in progress. It may take up to 90 seconds. Please wait.\n" + ); + break; + + case MSG_ILLEGAL_CPU_PLUGGED_IN: + gST->ConOut->OutputString ( + gST->ConOut, + L"\n\n\rAn unsupported CPU/PCH configuration has been identified.\n" + ); + gST->ConOut->OutputString ( + gST->ConOut, + L"\rPlease refer to the Haswell Platform Validation Matrix\n\rfor supported CPU/PCH combinations." + ); + break; + + case MSG_KVM_WAIT: + gST->ConOut->OutputString (gST->ConOut, L"Waiting Up to 8 Minutes For KVM FW....."); + break; + + case MSG_PLAT_DISABLE_WAIT: + gST->ConOut->OutputString (gST->ConOut, L"WARNING! Firmware encountered errors and will reboot the platform in 30 minutes."); + MsgDelay = 5 * HECI_MSG_DELAY; + break; + + default: + DEBUG ((EFI_D_ERROR, "This Message Id hasn't been defined yet, MsgId = %x\n", MsgId)); + break; + } + + gBS->Stall (MsgDelay); + GraphicsRestore(); +} + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.cif b/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.cif new file mode 100644 index 0000000..8db83d4 --- /dev/null +++ b/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.cif @@ -0,0 +1,13 @@ +<component> + name = "MePlatformPolicy" + category = ModulePart + LocalRoot = "Board\EM\MeWrapper\MePlatformPolicy" + RefName = "MePlatformPolicy" +[files] +"MePlatformPolicy.c" +"MePlatformPolicy.h" +"MePlatformPolicy.sdl" +"MePlatformPolicy.mak" +[parts] +"MePeiPolicyInit" +<endComponent> diff --git a/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.h b/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.h new file mode 100644 index 0000000..f90a135 --- /dev/null +++ b/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.h @@ -0,0 +1,232 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* +//********************************************************************** +// +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/MePlatformPolicy/MePlatformPolicy.h 3 5/13/14 4:02a Tristinchou $ +// +// $Revision: 3 $ +// +// $Date: 5/13/14 4:02a $ +// +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/MePlatformPolicy/MePlatformPolicy.h $ +// +// 3 5/13/14 4:02a Tristinchou +// [TAG] EIPNone +// [Category] Improvement +// [Description] Fix BPF version check error while using MEBX 9.1 +// +// 2 5/14/12 4:40a Klzhan +// [TAG] EIP89952 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME RC 0.56 +// [Files] MePlatformPolicy.c +// MePlatformPolicy.h +// MePlatformPolicy.sdl +// MePlatformPolicy.mak +// MePlatformPolicy.cif +// +// 1 2/08/12 1:04a Klzhan +// Initial Check in +// +// 5 9/07/11 4:49a Klzhan +// Get thermal reporting data from HOB. +// +// 4 7/11/11 4:41a Klzhan +// Fix system can't boot on ME FW 1076. +// +// 3 7/08/11 9:14a Klzhan +// Restore to older ME Platform Policy module part. +// To fix system hangs with other modules. +// +// 2 7/08/11 4:20a Klzhan +// [TAG] EIP64189 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME RC to 0.7 +// [Files] MePlatformPolicy.c +// MePlatformPolicy.h +// MePlatformPolicy.sdl +// MePlatformPolicy.mak +// MePlatformPolicy.cif +// +// 1 2/25/11 1:41a Klzhan +// Initial Check-in +// +// 1 12/03/10 5:09a Klzhan +// Initial Check-in. +// +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: MePlatformPolicy.h +// +// Description: +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> +/*++ + +This file contains a 'Sample Driver' and is licensed as such +under the terms of your license agreement with Intel or your +vendor. This file may be modified by the user, subject to +the additional terms of the license agreement + +--*/ + +/*++ +Copyright (c) 2008 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + +Module Name: + + MePlatformPolicy.h + +Abstract: + + +--*/ +#ifndef _DXE_ME_PLATFORM_POLICY_H_ +#define _DXE_ME_PLATFORM_POLICY_H_ + +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +#endif + +#include EFI_PROTOCOL_PRODUCER (MEPlatformPolicy) +#include "PchAccess.h" +#include "token.h" +#include "MeLib.h" +#include "HeciRegs.h" +#include "MeChipset.h" +// Debug #include "MePlatformPolicyUpdateDxeLib.h" + +#include EFI_PROTOCOL_DEFINITION (PciRootBridgeIo) +#include EFI_PROTOCOL_CONSUMER (MePlatformPolicy) +#include EFI_PROTOCOL_CONSUMER (MebxProtocol) +#include EFI_GUID_DEFINITION (MeBiosExtensionSetup) +#if EFI_SPECIFICATION_VERSION<=0x20000 +#include EFI_PROTOCOL_DEFINITION (Hii) +#include EFI_PROTOCOL_DEFINITION (FormCallBack) +#endif +#define EFI_DRIVER_ENTRY_POINT(x) + +#define DIMM_TS_INFO_GUID \ + { \ + 0xce673a28, 0x800d, 0x4b4a, 0x83, 0x16, 0x26, 0x61, 0xf9, 0xb3, 0xd9, 0xc6 \ + } + +#define HECI_MSG_DELAY 2000000 // show warning msg and stay for 2 seconds. +#ifndef GUID_VARIABLE_DECLARATION +#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable +#endif +typedef struct{ + UINT8 MeFirmwareInfo; + UINT32 MeMajor; + UINT32 MeMinor; + UINT32 MeHotFix; + UINT32 MeBuildNo; +} ME_INFO_SETUP_DATA; +#ifndef TS_DIMM1_SMBUS_ADDRESS +#define TS_DIMM1_SMBUS_ADDRESS 0x30 +#endif + +#ifndef TS_DIMM2_SMBUS_ADDRESS +#define TS_DIMM2_SMBUS_ADDRESS 0x32 +#endif + +#ifndef TS_DIMM3_SMBUS_ADDRESS +#define TS_DIMM3_SMBUS_ADDRESS 0x34 +#endif + +#ifndef TS_DIMM4_SMBUS_ADDRESS +#define TS_DIMM4_SMBUS_ADDRESS 0x36 +#endif + +#define SETUP_GUID { 0xEC87D643, 0xEBA4, 0x4BB5, 0xA1, 0xE5, 0x3F, 0x3E, 0x36, 0xB2, 0x0D, 0xA9 } + +typedef struct _MEBX_DEBUG_FLAGS_ { + UINT16 Port80 : 1; ///< Port 80h + UINT16 Rsvd : 15; ///< Reserved +} MEBX_DEBUG_FLAGS; + +typedef struct _MEBX_OEM_RESOLUTION_SETTINGS_ { + UINT16 MebxNonUiTextMode : 4; + UINT16 MebxUiTextMode : 4; + UINT16 MebxGraphicsMode : 4; + UINT16 Rsvd : 4; +} MEBX_OEM_RESOLUTION_SETTINGS; + +typedef struct { + UINT16 BpfVersion; + UINT8 CpuReplacementTimeout; + UINT8 Reserved[7]; + UINT8 ActiveRemoteAssistanceProcess; + UINT8 CiraTimeout; + UINT16 OemFlags; + MEBX_DEBUG_FLAGS MebxDebugFlags; + UINT32 MeBiosSyncDataPtr; + UINT32 UsbKeyDataStructurePtr; + MEBX_OEM_RESOLUTION_SETTINGS OemResolutionSettings; + UINT8 Reserved3[0x2E]; +} MEBX_BPF; + +VOID +EFIAPI +ShowMeReportError ( + IN ME_ERROR_MSG_ID MsgId + ) +/*++ + +Routine Description: + + Show Me Error message. + +Arguments: + + MsgId Me error message ID. + +Returns: + + None. + +--*/ +; +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//*************************************************************************
\ No newline at end of file diff --git a/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.mak b/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.mak new file mode 100644 index 0000000..21937b0 --- /dev/null +++ b/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.mak @@ -0,0 +1,139 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2010, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* +#********************************************************************** +# +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/MePlatformPolicy/MePlatformPolicy.mak 4 12/04/12 5:57a Klzhan $ +# +# $Revision: 4 $ +# +# $Date: 12/04/12 5:57a $ +# +#********************************************************************** +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/MePlatformPolicy/MePlatformPolicy.mak $ +# +# 4 12/04/12 5:57a Klzhan +# [TAG] EIP107309 +# [Category] New Feature +# [Description] Support ICC library for ME 9.5 +# [Files] MePlatformPolicy.c +# MePlatformPolicy.h +# MePlatformPolicy.sdl +# MePlatformPolicy.mak +# MePlatformPolicy.cif +# +# 3 4/23/12 11:13p Klzhan +# +# 2 2/23/12 8:56a Klzhan +# Support New EDK +# +# 1 2/08/12 1:04a Klzhan +# Initial Check in +# +# 5 9/07/11 4:49a Klzhan +# Get thermal reporting data from HOB. +# +# 4 7/26/11 8:23a Klzhan +# [TAG] EIP64542 +# [Category] Improvement +# [Description] Replace GetSbSetupData. +# +# 3 7/11/11 4:41a Klzhan +# Fix system can't boot on ME FW 1076. +# +# 2 7/08/11 4:20a Klzhan +# [TAG] EIP64189 +# [Category] Spec Update +# [Severity] Important +# [Description] Update ME RC to 0.7 +# [Files] MePlatformPolicy.c +# MePlatformPolicy.h +# MePlatformPolicy.sdl +# MePlatformPolicy.mak +# MePlatformPolicy.cif +# +# 1 2/25/11 1:41a Klzhan +# Initial Check-in +# +# 1 12/03/10 5:09a Klzhan +# Initial Check-in. +# +# +#********************************************************************** +#<AMI_FHDR_START> +#---------------------------------------------------------------------------- +# +# Name: MePlatformPolicy.mak +# +# Description: +# +#---------------------------------------------------------------------------- +#<AMI_FHDR_END> +All : MePlatformPolicy + +MePlatformPolicy : $(BUILD_DIR)\MePlatformPolicy.mak MePlatformPolicyBin + +$(BUILD_DIR)\MePlatformPolicy.mak : $(MePlatformPolicy_DIR)\$(@B).cif $(MePlatformPolicy_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(MePlatformPolicy_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +MePlatformPolicy_INCLUDES=\ + $(EdkIIGlueLib_INCLUDES)\ + $(ME_INCLUDES) \ + $(MISCFRAMEWORK_INCLUDES) \ + $(NB_INCLUDES)\ + $(SB_INCLUDES)\ + /I$(PROJECT_DIR)\ + /IInclude\ + /I$(IccOverClocking_DIR)\ + /I$(INTEL_COUGAR_POINT_INCLUDE_DIR) + +MePlatformPolicy_LIBS=\ + $(EdkIIGlueBaseLib_LIB)\ + $(EFIDRIVERLIB)\ + $(MeProtocolLib_LIB)\ + $(MeLibDxe_LIB)\ + $(MeChipsetDxeLib_LIB)\ + $(EdkIIGlueDxeMemoryAllocationLib_LIB)\ + $(EdkIIGlueBaseLib_LIB)\ +!IF "$(x64_BUILD)"=="1" + $(EdkIIGlueBaseLibX64_LIB)\ +!ELSE + $(EdkIIGlueBaseLibIA32_LIB)\ +!ENDIF + $(EdkIIGlueDxeReportStatusCodeLib_LIB)\ + $(EdkIIGlueDxeDebugLibReportStatusCode_LIB)\ + +MePlatformPolicyBin : $(MePlatformPolicy_LIBS) + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\ + /f $(BUILD_DIR)\MePlatformPolicy.mak all\ + GUID=BA67550C-3628-4137-A53E-42660E081604\ + "MY_INCLUDES = $(MePlatformPolicy_INCLUDES)" \ + ENTRY_POINT=MePlatformPolicyEntryPoint\ + TYPE=BS_DRIVER\ + COMPRESS=1 + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2010, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#*************************************************************************
\ No newline at end of file diff --git a/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.sdl b/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.sdl new file mode 100644 index 0000000..4588fa3 --- /dev/null +++ b/Board/EM/MeWrapper/MePlatformPolicy/MePlatformPolicy.sdl @@ -0,0 +1,24 @@ +TOKEN + Name = "MePlatformPolicy_SUPPORT" + Value = "1" + Help = "Main switch to enable MePlatformPolicy support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "MePlatformPolicy_DIR" +End + +MODULE + Help = "Includes MePlatformPolicy.mak to Project" + File = "MePlatformPolicy.mak" +End + +ELINK + Name = "$(BUILD_DIR)\MePlatformPolicy.ffs" + Parent = "FV_MAIN" + InvokeOrder = AfterParent +End diff --git a/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.c b/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.c new file mode 100644 index 0000000..f534303 --- /dev/null +++ b/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.c @@ -0,0 +1,196 @@ +/*++ + This file contains a 'Sample Driver' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may be modified by the user, subject to + the additional terms of the license agreement +--*/ + +/*++ + +Copyright (c) 1999 - 2010 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + +Module Name: + + MePeiPolicyInit.c + +Abstract: + + This file is SampleCode for Intel ME PEI Platform Policy initialzation. + +--*/ +#include <Token.h> +#include "MePeiPolicyInit.h" +#include <Ppi\PchPlatformPolicy\PchPlatformPolicy.h> +#include <SetupDataDefinition.h> + +#define SETUP_GUID { 0xEC87D643, 0xEBA4, 0x4BB5, 0xA1, 0xE5, 0x3F, 0x3E, 0x36, 0xB2, 0x0D, 0xA9 } +static EFI_GUID gSetupGuid = SETUP_GUID; + + +// +// Function implementations +// +VOID +PrepareThermalHob ( + IN EFI_PEI_SERVICES **PeiServices +) +{ + EFI_STATUS Status; + EFI_HOB_GUID_TYPE *Hob; + UINT8 TsOnDimm[4]; + EFI_GUID gPchPolicyPpiGuid = PCH_PLATFORM_POLICY_PPI_GUID; + PCH_PLATFORM_POLICY_PPI *PchPlatformPolicy; + EFI_GUID gDimmTsInfoGuid = DIMM_TS_INFO_GUID; + + Status = (**PeiServices).LocatePpi (PeiServices, &gPchPolicyPpiGuid, 0, + NULL, (VOID **)&PchPlatformPolicy); + + if(EFI_ERROR(Status)) + { + return; + } + // Build the GUID'd HOB for DXE + Status = (*PeiServices)->CreateHob ( + PeiServices, + EFI_HOB_TYPE_GUID_EXTENSION, + (UINT16) (sizeof (EFI_HOB_GUID_TYPE) + 4), + &Hob + ); + + if (EFI_ERROR (Status))return; + + ((EFI_HOB_GUID_TYPE *)(Hob))->Name = gDimmTsInfoGuid; + + Hob++; + +//- TsOnDimm[0] = PchPlatformPolicy->ThermalReportConfig->ThermalReportControl->Dimm1TempReadEnable; +//- TsOnDimm[1] = PchPlatformPolicy->ThermalReportConfig->ThermalReportControl->Dimm2TempReadEnable; +//- TsOnDimm[2] = PchPlatformPolicy->ThermalReportConfig->ThermalReportControl->Dimm3TempReadEnable; +//- TsOnDimm[3] = PchPlatformPolicy->ThermalReportConfig->ThermalReportControl->Dimm4TempReadEnable; + + GlueCopyMem (Hob, TsOnDimm, sizeof(TsOnDimm)); + +} + +EFI_STATUS +MePeiPolicyInitEntryPoint ( + IN EFI_FFS_FILE_HEADER *FfsHeader, + IN EFI_PEI_SERVICES **PeiServices + ) +/*++ + +Routine Description: + + Initilize Intel ME PEI Platform Policy + +Arguments: + + FfsHeader Pointer to Firmware File System file header. + PeiServices General purpose services available to every PEIM. + +Returns: + + EFI_STATUS + +--*/ +{ + EFI_STATUS Status; + PEI_ME_PLATFORM_POLICY_PPI *MePlatformPolicyPpi; + EFI_PEI_PPI_DESCRIPTOR *MePlatformPolicyPpiDesc; + EFI_PEI_READ_ONLY_VARIABLE_PPI *VariableServices; + UINTN VariableSize; + SETUP_DATA SetupData; + + // + // Allocate descriptor and PPI structures + // + MePlatformPolicyPpi = (PEI_ME_PLATFORM_POLICY_PPI *) AllocateZeroPool (sizeof (PEI_ME_PLATFORM_POLICY_PPI)); + ASSERT (MePlatformPolicyPpi != NULL); + if (MePlatformPolicyPpi == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + MePlatformPolicyPpiDesc = (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (sizeof (EFI_PEI_PPI_DESCRIPTOR)); + ASSERT (MePlatformPolicyPpiDesc != NULL); + if (MePlatformPolicyPpiDesc == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + // + // Locate Variable Ppi + // + Status = (*PeiServices)->LocatePpi(PeiServices, + &gPeiReadOnlyVariablePpiGuid, + 0, + NULL, + &VariableServices); + + // + // Make sure we have a PPI, if not, just return. + // + if (!VariableServices) { + return EFI_UNSUPPORTED; + } + VariableSize = sizeof(SETUP_DATA); + // + // Get Setup Variable + // + Status = VariableServices->PeiGetVariable ( + PeiServices, + L"Setup", + &gSetupGuid, + NULL, + &VariableSize, + &SetupData); + + // + // Update Itnel PPT + // + if ( !EFI_ERROR(Status) ) { +#if IntelPTT_SUPPORT + MePlatformPolicyPpi->FTpmSwitch = SetupData.FTpmSwitch; +#else + MePlatformPolicyPpi->FTpmSwitch = 0; +#endif + } else { + MePlatformPolicyPpi->FTpmSwitch = 0; + } + + // + // Initialize the PPI + // + MePlatformPolicyPpiDesc->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST; + MePlatformPolicyPpiDesc->Guid = &gPeiMePlatformPolicyPpiGuid; + + // + // Update the REVISION number + // + MePlatformPolicyPpi->Revision = PEI_ME_PLATFORM_POLICY_PPI_REVISION_2; + + + // + // Initialize the Platform Configuration + // +// Debug UpdatePeiMePlatformPolicy (PeiServices, MePlatformPolicyPpi); + + MePlatformPolicyPpiDesc->Ppi = MePlatformPolicyPpi; + + /// + /// TBD put initialize codes in here if needs + /// + /// + /// Install the ME PEI Platform Policy PPI + /// + Status = (**PeiServices).InstallPpi (PeiServices, MePlatformPolicyPpiDesc); + ASSERT_PEI_ERROR (PeiServices, Status); + DEBUG ((EFI_D_INFO, "ME PEI Platform Policy PPI Installed\n")); + + return Status; +} diff --git a/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.cif b/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.cif new file mode 100644 index 0000000..2c5d34f --- /dev/null +++ b/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.cif @@ -0,0 +1,12 @@ +<component> + name = "MePeiPolicyInit" + category = ModulePart + LocalRoot = "Board\EM\MeWrapper\MePlatformPolicy\Pei" + RefName = "MePeiPolicyInit" +[files] +"MePeiPolicyInit.c" +"MePeiPolicyInit.h" +"MePeiPolicyInit.sdl" +"MePeiPolicyInit.mak" +"MePeiPolicyInit.dxs" +<endComponent> diff --git a/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.dxs b/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.dxs new file mode 100644 index 0000000..01778d0 --- /dev/null +++ b/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.dxs @@ -0,0 +1,35 @@ +/*++ + This file contains a 'Sample Driver' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may be modified by the user, subject to + the additional terms of the license agreement +--*/ + +/*++ + +Copyright (c) 1999 - 2010 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + +Module Name: + + MePeiPolicyInit.dxs + +Abstract: + + Dependency expression source file. + +--*/ + +#include "EfiDepex.h" +#include <Ppi\PchPlatformPolicy\PchPlatformPolicy.h> +DEPENDENCY_START + PCH_PLATFORM_POLICY_PPI_GUID +DEPENDENCY_END + + diff --git a/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.h b/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.h new file mode 100644 index 0000000..5d64667 --- /dev/null +++ b/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.h @@ -0,0 +1,64 @@ +/*++ + This file contains a 'Sample Driver' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may be modified by the user, subject to + the additional terms of the license agreement +--*/ + +/*++ + +Copyright (c) 1999 - 2010 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + +Module Name: + + MePeiPolicyInit.h + +Abstract: + + Header file for the MePeiPolicyInit PEIM. + +--*/ +#ifndef _ME_PEI_PLATFORM_POLICY_H_ +#define _ME_PEI_PLATFORM_POLICY_H_ + +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGluePeim.h" +#endif + +#include EFI_PPI_DEFINITION (MePlatformPolicyPei) +// Debug #include "MePlatformPolicyUpdatePeiLib.h" +#define DIMM_TS_INFO_GUID \ + { \ + 0xce673a28, 0x800d, 0x4b4a, 0x83, 0x16, 0x26, 0x61, 0xf9, 0xb3, 0xd9, 0xc6 \ + } + +EFI_STATUS +MePeiPolicyInitEntryPoint ( + IN EFI_FFS_FILE_HEADER *FfsHeader, + IN EFI_PEI_SERVICES **PeiServices + ) +/*++ + +Routine Description: + + Initilize Intel ME PEI Platform Policy + +Arguments: + + FfsHeader Pointer to Firmware File System file header. + PeiServices General purpose services available to every PEIM. + +Returns: + + EFI_STATUS + +--*/ +; +#endif diff --git a/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.mak b/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.mak new file mode 100644 index 0000000..4a097e0 --- /dev/null +++ b/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.mak @@ -0,0 +1,111 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2010, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#********************************************************************** +# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/MePlatformPolicy/MePeiPolicyInit/MePeiPolicyInit.mak 2 2/23/12 8:56a Klzhan $ +# +# $Revision: 2 $ +# +# $Date: 2/23/12 8:56a $ +#********************************************************************** +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/MePlatformPolicy/MePeiPolicyInit/MePeiPolicyInit.mak $ +# +# 2 2/23/12 8:56a Klzhan +# Support New EDK +# +# 1 2/08/12 1:05a Klzhan +# Initial Check in +# +# 1 3/29/11 4:53a Klzhan +# +# 1 2/25/11 1:45a Klzhan +# Initial Check-in +# +# 1 12/03/10 5:11a Klzhan +# Initial Check-in. +# +# +#********************************************************************** +#<AMI_FHDR_START> +# +# Name: AmtPlatformPolicy.mak +# +# Description: +# +#<AMI_FHDR_END> +#********************************************************************** +All : MEPeiPolicyInit + +MEPeiPolicyInit : $(BUILD_DIR)\MEPeiPolicyInit.mak MEPeiPolicyInitBin + +$(BUILD_DIR)\MEPeiPolicyInit.mak : $(MEPeiPlatformPolicy_DIR)\$(@B).cif $(MEPeiPlatformPolicy_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(MEPeiPlatformPolicy_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +MEPeiPlatformPolicy_INCLUDES=\ + $(EDK_INCLUDES)\ + $(EdkIIGlueLib_INCLUDES)\ + $(ME_INCLUDES)\ + $(INTEL_PCH_INCLUDES) + + +MEPeiPlatformPolicy_DEFINES=$(MY_DEFINES)\ + /D "__EDKII_GLUE_MODULE_ENTRY_POINT__=MePeiPolicyInitEntryPoint" \ + /D __EDKII_GLUE_BASE_LIB__ \ + /D __EDKII_GLUE_BASE_MEMORY_LIB__ \ + /D __EDKII_GLUE_PEI_DEBUG_LIB_REPORT_STATUS_CODE__ \ + /D __EDKII_GLUE_PEI_REPORT_STATUS_CODE_LIB__ \ + /D __EDKII_GLUE_PEI_SERVICES_LIB__ \ + /D __EDKII_GLUE_PEI_MEMORY_ALLOCATION_LIB__ \ + +MEPeiPlatformPolicy_LIBS=\ + $(EDKPROTOCOLLIB)\ + $(EdkIIGlueBaseLib_LIB)\ + $(EdkIIGlueBaseLibIA32_LIB)\ + $(EdkIIGlueBaseIoLibIntrinsic_LIB)\ + $(EdkIIGluePeiDebugLibReportStatusCode_LIB)\ + $(EdkIIGluePeiReportStatusCodeLib_LIB)\ + $(EdkIIGluePeiServicesLib_LIB)\ + $(MeLibPpi_LIB)\ + $(EdkIIGluePeiHobLib_LIB)\ + $(EdkIIGluePeiMemoryAllocationLib_LIB)\ + $(PEILIB) + +MEPeiPolicyInitBin : $(MEPeiPlatformPolicy_LIBS) + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + /f $(BUILD_DIR)\MEPeiPolicyInit.mak all\ + GUID=12C67BE1-AD2E-4f13-A95F-6EDC2C4392DE\ + "MY_INCLUDES = $(MEPeiPlatformPolicy_INCLUDES)" \ + "MY_DEFINES=$(MEPeiPlatformPolicy_DEFINES)"\ + ENTRY_POINT=MePeiPolicyInitEntryPoint\ + TYPE=PEIM\ + EDKIIModule=PEIM\ + DEPEX1=$(MEPeiPlatformPolicy_DIR)\MEPeiPolicyInit.dxs\ + DEPEX1_TYPE=EFI_SECTION_PEI_DEPEX\ + COMPRESS=0 + +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2010, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* diff --git a/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.sdl b/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.sdl new file mode 100644 index 0000000..ff7d692 --- /dev/null +++ b/Board/EM/MeWrapper/MePlatformPolicy/Pei/MePeiPolicyInit.sdl @@ -0,0 +1,25 @@ +TOKEN + Name = "MEPeiPlatformPolicy_SUPPORT" + Value = "1" + Help = "Main switch to enable AmtPlatformPolicy support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "MEPeiPlatformPolicy_DIR" +End + +MODULE + Help = "Includes AmtPlatformPolicy.mak to Project" + File = "MEPeiPolicyInit.mak" +End + +ELINK + Name = "$(BUILD_DIR)\MEPeiPolicyInit.ffs" + Parent = "FV_BB" + InvokeOrder = AfterParent +End + |