diff options
Diffstat (limited to 'Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy')
13 files changed, 1553 insertions, 0 deletions
diff --git a/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.c b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.c new file mode 100644 index 0000000..bdc8193 --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.c @@ -0,0 +1,558 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (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/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.c 11 9/21/15 10:12p Tristinchou $ +// +// $Revision: 11 $ +// +// $Date: 9/21/15 10:12p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.c $ +// +// 11 9/21/15 10:12p Tristinchou +// [TAG] EIP238392 +// [Category] Improvement +// [Description] Disable USB provision while Intel AMT is disabled in +// setup +// +// 10 5/14/14 9:45p Tristinchou +// [TAG] EIP160730 +// [Category] Improvement +// [Description] Remove the variable runtime attribute and keep original +// attributes. +// +// 9 12/16/13 9:55p Tristinchou +// [TAG] EIPNone +// [Category] Improvement +// [Description] Free memory while error occur in InstallDiskInfo() +// +// 8 8/27/13 4:21a Tristinchou +// [TAG] EIPNone +// [Category] Improvement +// [Description] Fix system hangs while boot with ME 1.5MB firmware. +// [Files] AmtPlatformPolicy.c +// +// 7 8/22/13 8:51a Tristinchou +// [TAG] EIP131034 +// [Category] Improvement +// [Description] The system will hang after create/ reset/delete raid +// mode +// [Files] AmtPlatformPolicy.c +// +// 6 11/07/12 8:47a Klzhan +// Clear Cira request item after loaded. +// +// 5 9/19/12 6:56a Klzhan +// Fix Windows capsule update fail. +// +// 4 7/02/12 11:39p Klzhan +// [TAG] EIP94113 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME RC0.6 +// +// 3 5/14/12 4:50a Klzhan +// [TAG] EIP89952 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME RC 0.56 +// [Files] AmtPlatformPolicy.c +// AmtPlatformPolicy.h +// AmtPlatformPolicy.sdl +// AmtPlatformPolicy.mak +// AmtPlatformPolicy.dxs +// AmtPlatformPolicy.cif +// +// 2 4/24/12 12:41a Klzhan +// +// 1 2/08/12 1:08a Klzhan +// Initial Check in +// +// 8 9/29/11 11:47p Klzhan +// Fill Amt Wrapper protocol with setup data. +// +// 7 9/26/11 6:19a Klzhan +// [TAG] EIP70516 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME 8.0 RC 0.8 +// [Files] AmtPlatformPolicy.c +// AmtPlatformPolicy.h +// AmtPlatformPolicy.sdl +// AmtPlatformPolicy.mak +// AmtPlatformPolicy.dxs +// AmtPlatformPolicy.cif +// +// 6 7/08/11 4:23a Klzhan +// [TAG] EIP64189 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME RC to 0.7 +// +// 5 5/24/11 5:01a Klzhan +// Add support ME RC 0.60 +// +// 4 4/18/11 9:45a Klzhan +// [TAG] EIP58005 +// [Category] Spec Update +// [Severity] Important +// [Description] Move ME FW downgrade related code to ME platform +// policy. +// +// 3 4/18/11 9:17a Klzhan +// Improvement : Update DXE_PLATFORM_AMT_POLICY_PROTOCOL_REVISION from 7 +// to A. +// +// 2 3/29/11 3:48a Klzhan +// A token to keep ME always in Disable Mode. +// +// 1 2/25/11 1:44a Klzhan +// Initial Check-in +// +// 1 12/03/10 5:11a Klzhan +// Initial Check-in. +// +//********************************************************************** +// +//<AMI_FHDR_START> +//--------------------------------------------------------------------------- +// Name: AmtPlatformPolicy.c +// +// Description: +// +//--------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#include "AmtPlatformPolicy.h" +#include "token.h" +#include <SetupDataDefinition.h> +DXE_AMT_POLICY_PROTOCOL mDxePlatformAmtPolicy = { 0 }; +INSTALL_DISK_INFO_PROTOCOL mInstallDiskInfo = { InstallDiskInfo }; +UINT64 mPciDeviceFilterOutTable[] = { EFI_MAX_ADDRESS, }; +#define SETUP_GUID { 0xEC87D643, 0xEBA4, 0x4BB5, 0xA1, 0xE5, 0x3F, 0x3E, 0x36, 0xB2, 0x0D, 0xA9 } + +#define AMT_READY_TO_BOOT_PROTOCOL_GUID \ + { \ + 0x40b09b5a, 0xf0ef, 0x4627, 0x93, 0xd5, 0x27, 0xf0, 0x4b, 0x75, 0x4d, 0x5 \ + } + +#define END_DEVICE_PATH 0x7F +#define END_DEVICE_PATH1 0xFF +#define NODE_LENGTH(pPath) (*(UINT16*)&(pPath)->Length[0]) +#define NEXT_NODE(pPath) ((EFI_DEVICE_PATH_PROTOCOL*)((UINT8*)(pPath)+NODE_LENGTH(pPath))) +#define isEndNode(pDp) ((pDp)->Type==END_DEVICE_PATH||(pDp)->Type==END_DEVICE_PATH1) +EFI_GUID gAmtReadyToBootProtocolGuid = AMT_READY_TO_BOOT_PROTOCOL_GUID; +EFI_GUID gEfiDiskInfoProtocolGuid = EFI_DISK_INFO_PROTOCOL_GUID; +EFI_GUID gDevicePathProtocolGuid = EFI_DEVICE_PATH_PROTOCOL_GUID; +UINT8 GetDevicePathSubtype(EFI_DEVICE_PATH_PROTOCOL *Dp, UINT8 Type); + +// +// Driver entry point +// +EFI_DRIVER_ENTRY_POINT (AmtPlatformPolicyEntryPoint) +EFI_STATUS +EFIAPI +InstallDiskInfo ( + VOID + ) +{ + EFI_STATUS Status; + UINTN BlockIoHandleCount = 0; + UINTN DiskInfoHandleCount = 0; + EFI_HANDLE *BlockIoHandleBuffer = NULL; + EFI_HANDLE *DiskInfoHandleBuffer = NULL; + UINTN UsedBlockIoHandle = 0; + UINTN UsedDiskInfoHandle = 0; + EFI_DISK_INFO_PROTOCOL *DiskInfoProtocol; + EFI_DISK_INFO_PROTOCOL *DiskInfoProtocolBuffer; + EFI_BLOCK_IO_PROTOCOL *BlockIoProtocol; + EFI_DEVICE_PATH_PROTOCOL *DevicePathProtocol; + UINT8 DevicePathSubtype = 0; + IDENTIFY_DATA *IdentifyData = NULL; + UINT32 BufferSize = sizeof (IDENTIFY_DATA); + UINT8 ThisDiskInfoHandleIsHdd = 0; // 1 is HDD, 0 is ODD + UINT8 ThisBlockIoHandleIsHdd = 0; // 1 is HDD, 0 is ODD + + //Locate all handle which have BlockIo + Status = gBS->LocateHandleBuffer( + ByProtocol, + &gEfiBlockIoProtocolGuid, + NULL, + &BlockIoHandleCount, + &BlockIoHandleBuffer ); + if(EFI_ERROR(Status)) + goto ErrorExit; + + //Locate all handle which have DiskInfo + Status = gBS->LocateHandleBuffer( + ByProtocol, + &gEfiDiskInfoProtocolGuid, + NULL, + &DiskInfoHandleCount, + &DiskInfoHandleBuffer ); + if(EFI_ERROR(Status)) + goto ErrorExit; + + if( DiskInfoHandleCount != 0 ) + { + for( UsedBlockIoHandle = 0 ; UsedBlockIoHandle < BlockIoHandleCount ; UsedBlockIoHandle++ ) + { + ThisBlockIoHandleIsHdd = 0; + //Block to install DiskInfoProtocol to USB + Status = gBS->HandleProtocol( + BlockIoHandleBuffer[UsedBlockIoHandle], + &gDevicePathProtocolGuid, + &DevicePathProtocol); + if( !EFI_ERROR(Status) ) + { + DevicePathSubtype = GetDevicePathSubtype( DevicePathProtocol, MESSAGING_DEVICE_PATH ); + } + if( DevicePathSubtype == MSG_USB_DP || + DevicePathSubtype == MSG_USB_CLASS_DP ) + { + continue; + } + //Block to install DiskInfoProtocol to Partition + Status = gBS->HandleProtocol( + BlockIoHandleBuffer[UsedBlockIoHandle], + &gEfiBlockIoProtocolGuid, + &BlockIoProtocol); + if(EFI_ERROR(Status)) + goto ErrorExit; + + if( BlockIoProtocol->Media->LogicalPartition ) + { + continue; + } + + //Handle is HDD or ODD + if( BlockIoProtocol->Media->RemovableMedia == 0 ) + { + ThisBlockIoHandleIsHdd = 1; + } + + for( UsedDiskInfoHandle = 0 ; UsedDiskInfoHandle < DiskInfoHandleCount ; UsedDiskInfoHandle++ ) + { + ThisDiskInfoHandleIsHdd = 0; + if( DiskInfoHandleBuffer[UsedDiskInfoHandle] == NULL ) + { + continue; + } + + //Handle is HDD or ODD + Status = gBS->HandleProtocol( + DiskInfoHandleBuffer[UsedDiskInfoHandle], + &gEfiDiskInfoProtocolGuid, + &DiskInfoProtocol); + if(EFI_ERROR(Status)) + goto ErrorExit; + + IdentifyData = AllocatePool(BufferSize); + if( IdentifyData == NULL ) + goto ErrorExit; + + Status = DiskInfoProtocol->Identify( DiskInfoProtocol, IdentifyData, &BufferSize ); + if(EFI_ERROR(Status)) + goto ErrorExit; + + if( IdentifyData->LBA_48 !=0 ) + { + ThisDiskInfoHandleIsHdd = 1; + } + + //If handles the same type( HDD or ODD) + if( ThisDiskInfoHandleIsHdd == ThisBlockIoHandleIsHdd ) + { + Status = gBS->HandleProtocol( + BlockIoHandleBuffer[UsedBlockIoHandle], + &gEfiDiskInfoProtocolGuid, + &DiskInfoProtocolBuffer ); + //If this BlockIoHandle isn't installed DiskInfoProtocol + if(EFI_ERROR(Status)) + { + Status = gBS->InstallMultipleProtocolInterfaces( + &BlockIoHandleBuffer[UsedBlockIoHandle], + &gEfiDiskInfoProtocolGuid, + DiskInfoProtocol, + NULL ); + if( !EFI_ERROR(Status) ) + { + FreePool(IdentifyData); + //Release used handle pointer + DiskInfoHandleBuffer[UsedDiskInfoHandle] = NULL; + break; + } + } + } + FreePool(IdentifyData); + } + } + } + FreePool(BlockIoHandleBuffer); + FreePool(DiskInfoHandleBuffer); + + return EFI_SUCCESS; + +ErrorExit: + if( BlockIoHandleBuffer != NULL ) + FreePool(BlockIoHandleBuffer); + if( DiskInfoHandleBuffer != NULL ) + FreePool(DiskInfoHandleBuffer); + if( IdentifyData != NULL ) + FreePool(IdentifyData); + + return EFI_NOT_FOUND; +} + +UINT8 GetDevicePathSubtype(EFI_DEVICE_PATH_PROTOCOL *Dp, UINT8 Type) +{ + UINT8 SubType; + + if (Dp == NULL) return 0; + SubType = 0; + + for( ; !(isEndNode(Dp)); Dp=NEXT_NODE(Dp)) + if (Dp->Type == Type) SubType = Dp->SubType; + return SubType; +} + +// +// Function implementations +// +EFI_STATUS +EFIAPI +AmtPlatformPolicyEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable +) +/*++ + +Routine Description: + + Initilize Intel AMT DXE Platform Policy + +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; + UINT32 SetupVarAttr; + UINTN VariableSize; + UINT32 MebxVarAttr; + ME_BIOS_EXTENSION_SETUP MeBiosExtensionSetupData; + SETUP_DATA SetupData; + EFI_GUID gSetupGuid = SETUP_GUID; + DXE_MBP_DATA_PROTOCOL *mBIOSPayLoad; + EFI_HANDLE Handle; + + EfiInitializeDriverLib (ImageHandle, SystemTable); + + Handle = NULL; + + Status = gBS->LocateProtocol ( + &gMeBiosPayloadDataProtocolGuid, + NULL, + &mBIOSPayLoad + ); + if( EFI_ERROR(Status) ) { + // Install Dummy MeBios Payload Data Protocol for avoiding relating driver + // not run. (For EIP#96807 - EFI Capsule Update) + SetupVarAttr = 0; + VariableSize = sizeof(SETUP_DATA); + Status = gRT->GetVariable( L"Setup", &gSetupGuid, \ + &SetupVarAttr, &VariableSize, &SetupData ); + if( EFI_ERROR(Status) ) return Status; + { + DXE_MBP_DATA_PROTOCOL mMbpData; + ZeroMem (&mMbpData, sizeof (DXE_MBP_DATA_PROTOCOL)); + mMbpData.Revision = DXE_MBP_DATA_PROTOCOL_REVISION_2; + mMbpData.MeBiosPayload.FwPlatType.RuleData.Fields.IntelMeFwImageType = SetupData.MeImageType; + mMbpData.Handle = NULL; + Status = gBS->InstallMultipleProtocolInterfaces ( + &mMbpData.Handle, + &gMeBiosPayloadDataProtocolGuid, + &mMbpData, + NULL + ); + if (!EFI_ERROR(Status)) mBIOSPayLoad = &mMbpData; + } + } + if (mBIOSPayLoad->MeBiosPayload.FwPlatType.RuleData.Fields.IntelMeFwImageType != INTEL_ME_5MB_FW) { + return EFI_UNSUPPORTED; + } + + Status = gBS->InstallProtocolInterface ( + &Handle, + &gAmtReadyToBootProtocolGuid, + EFI_NATIVE_INTERFACE, + &mInstallDiskInfo + ); + + SetupVarAttr = 0; + VariableSize = sizeof(SETUP_DATA); + // + // Get iAMT configuration from Setup Data + // + Status = gRT->GetVariable( + L"Setup", + &gSetupGuid, + &SetupVarAttr, + &VariableSize, + &SetupData ); + + // + // AMT DXE Policy Init + // + mDxePlatformAmtPolicy.Revision = DXE_PLATFORM_AMT_POLICY_PROTOCOL_REVISION_1; +/////////////////////////////////////////////////////////////////////////// + if (EFI_ERROR(Status)) // Default Setting for AMT + { + // + // Initialzie the Me Configuration + // + mDxePlatformAmtPolicy.AmtConfig.AsfEnabled = 1; + mDxePlatformAmtPolicy.AmtConfig.iAmtEnabled = 1; + mDxePlatformAmtPolicy.AmtConfig.WatchDog = 0; + mDxePlatformAmtPolicy.AmtConfig.WatchDogTimerOs = 0; + mDxePlatformAmtPolicy.AmtConfig.WatchDogTimerBios = 0; + mDxePlatformAmtPolicy.AmtConfig.CiraRequest = 0; + mDxePlatformAmtPolicy.AmtConfig.CiraTimeout = 0; + mDxePlatformAmtPolicy.AmtConfig.UnConfigureMe = 0; + mDxePlatformAmtPolicy.AmtConfig.HideUnConfigureMeConfirm = 0; + mDxePlatformAmtPolicy.AmtConfig.MebxDebugMsg = 0; + mDxePlatformAmtPolicy.AmtConfig.USBProvision = 0; + mDxePlatformAmtPolicy.AmtConfig.FWProgress = 1; + mDxePlatformAmtPolicy.AmtConfig.iAmtbxSelectionScreen = 0; + mDxePlatformAmtPolicy.AmtConfig.iAmtbxHotkeyPressed = 0; + mDxePlatformAmtPolicy.AmtConfig.AtEnabled = 1; + mDxePlatformAmtPolicy.AmtConfig.ManageabilityMode = 1; + // + // Oem Resolution Settings + // + mDxePlatformAmtPolicy.AmtConfig.MebxNonUiTextMode = 0; // MEBX_TEXT_AUTO + mDxePlatformAmtPolicy.AmtConfig.MebxUiTextMode = 0; // MEBX_TEXT_AUTO + mDxePlatformAmtPolicy.AmtConfig.MebxGraphicsMode = 0; // MEBX_GRAPHICS_AUTO + + } else { + mDxePlatformAmtPolicy.AmtConfig.AsfEnabled = SetupData.Asf; + mDxePlatformAmtPolicy.AmtConfig.iAmtEnabled = SetupData.Amt; + mDxePlatformAmtPolicy.AmtConfig.WatchDog = SetupData.WatchDog; + mDxePlatformAmtPolicy.AmtConfig.WatchDogTimerOs = SetupData.WatchDogTimerOs; + mDxePlatformAmtPolicy.AmtConfig.WatchDogTimerBios = SetupData.WatchDogTimerBios; + mDxePlatformAmtPolicy.AmtConfig.CiraRequest = SetupData.AmtCiraRequest; + mDxePlatformAmtPolicy.AmtConfig.CiraTimeout = SetupData.AmtCiraTimeout; + mDxePlatformAmtPolicy.AmtConfig.UnConfigureMe = SetupData.UnConfigureMe; + mDxePlatformAmtPolicy.AmtConfig.HideUnConfigureMeConfirm = SetupData.HideUnConfigureMeConfirm; + mDxePlatformAmtPolicy.AmtConfig.MebxDebugMsg = SetupData.MebxDebugMsg; + mDxePlatformAmtPolicy.AmtConfig.USBProvision = SetupData.USBProvision; + mDxePlatformAmtPolicy.AmtConfig.FWProgress = SetupData.FWProgress; + mDxePlatformAmtPolicy.AmtConfig.iAmtbxSelectionScreen = SetupData.AmtbxSelectionScreen; + mDxePlatformAmtPolicy.AmtConfig.iAmtbxHotkeyPressed = SetupData.AmtbxHotKeyPressed; + mDxePlatformAmtPolicy.AmtConfig.AtEnabled = 1; + mDxePlatformAmtPolicy.AmtConfig.ManageabilityMode = 1; + // + // Oem Resolution Settings + // + mDxePlatformAmtPolicy.AmtConfig.MebxNonUiTextMode = 0; // MEBX_TEXT_AUTO + mDxePlatformAmtPolicy.AmtConfig.MebxUiTextMode = 0; // MEBX_TEXT_AUTO + mDxePlatformAmtPolicy.AmtConfig.MebxGraphicsMode = 0; // MEBX_GRAPHICS_AUTO + + if(SetupData.AmtbxHotKeyPressed == 1) + SetupData.AmtbxHotKeyPressed = 0; + + if(SetupData.AmtCiraRequest == 1) + SetupData.AmtCiraRequest = 0; + + if(SetupData.UnConfigureMe == 1) + SetupData.UnConfigureMe = 0; + + if(SetupData.Amt == 0) + mDxePlatformAmtPolicy.AmtConfig.USBProvision = USB_PROVISION_DEFAULT_WITHOUT_AMT; + } + +/////////////////////////////////////////////////////////////////////////// + mDxePlatformAmtPolicy.AmtConfig.PciDeviceFilterOutTable = (UINT32) (UINTN) mPciDeviceFilterOutTable; + // + // Please don't change the default value of ForcMebxSyncUp and + // This let customer to force MEBX execution if they need and + // + mDxePlatformAmtPolicy.AmtConfig.ForcMebxSyncUp = 0; + + // + // Get BIOS Sync-up data from MEBx to AMT platform policy + // + MebxVarAttr = 0; + VariableSize = sizeof (MeBiosExtensionSetupData); + Status = gRT->GetVariable ( + gEfiMeBiosExtensionSetupName, + &gEfiMeBiosExtensionSetupGuid, + &MebxVarAttr, + &VariableSize, + &MeBiosExtensionSetupData + ); + if (EFI_ERROR (Status)) { + mDxePlatformAmtPolicy.AmtConfig.ManageabilityMode = 0; + } else { + mDxePlatformAmtPolicy.AmtConfig.ManageabilityMode = MeBiosExtensionSetupData.PlatformMngSel; + } + // + // Install protocol to to allow access to this Policy. + // + Status = gBS->InstallMultipleProtocolInterfaces ( + &ImageHandle, + &gDxePlatformAmtPolicyGuid, + &mDxePlatformAmtPolicy, + NULL + ); + ASSERT_EFI_ERROR (Status); + + // + // Get iAMT configuration from Setup Data + // + VariableSize = sizeof(SETUP_DATA); + Status = gRT->SetVariable ( + L"Setup", + &gSetupGuid, + SetupVarAttr, + VariableSize, + &SetupData ); + + return Status; +} + +//************************************************************************* +//************************************************************************* +//** ** +//** (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/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.cif b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.cif new file mode 100644 index 0000000..7cffe71 --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.cif @@ -0,0 +1,14 @@ +<component> + name = "AmtPlatformPolicy" + category = ModulePart + LocalRoot = "Board\EM\MeWrapper\AmtWrapper\AmtPlatformPolicy" + RefName = "AmtPlatformPolicy" +[files] +"AmtPlatformPolicy.c" +"AmtPlatformPolicy.h" +"AmtPlatformPolicy.sdl" +"AmtPlatformPolicy.mak" +"AmtPlatformPolicy.dxs" +[parts] +"AmtPeiPolicyInit" +<endComponent> diff --git a/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.dxs b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.dxs new file mode 100644 index 0000000..fe01967 --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.dxs @@ -0,0 +1,54 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (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/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.dxs 1 2/08/12 1:09a Klzhan $ +// +// $Revision: 1 $ +// +// $Date: 2/08/12 1:09a $ +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: AmtDPlatformPolicy.DXS +// +// Description: This file is the dependency file for the NB DXE +// driver +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#include "EfiDepex.h" +#include EFI_PROTOCOL_DEFINITION (MePlatformPolicy) + +DEPENDENCY_START + DXE_PLATFORM_ME_POLICY_GUID +DEPENDENCY_END + +//************************************************************************* +//************************************************************************* +//** ** +//** (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/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.h b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.h new file mode 100644 index 0000000..ea8f278 --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.h @@ -0,0 +1,209 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (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/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.h 4 8/22/13 8:52a Tristinchou $ +// +// $Revision: 4 $ +// +// $Date: 8/22/13 8:52a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.h $ +// +// 4 8/22/13 8:52a Tristinchou +// [TAG] EIP131034 +// [Category] Improvement +// [Description] The system will hang after create/ reset/delete raid +// mode +// [Files] AmtPlatformPolicy.h +// +// 3 5/14/12 4:50a Klzhan +// [TAG] EIP89952 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME RC 0.56 +// [Files] AmtPlatformPolicy.c +// AmtPlatformPolicy.h +// AmtPlatformPolicy.sdl +// AmtPlatformPolicy.mak +// AmtPlatformPolicy.dxs +// AmtPlatformPolicy.cif +// +// 2 4/24/12 12:41a Klzhan +// +// 1 2/08/12 1:08a Klzhan +// Initial Check in +// +// 2 9/26/11 6:19a Klzhan +// [TAG] EIP70516 +// [Category] Spec Update +// [Severity] Important +// [Description] Update ME 8.0 RC 0.8 +// [Files] AmtPlatformPolicy.c +// AmtPlatformPolicy.h +// AmtPlatformPolicy.sdl +// AmtPlatformPolicy.mak +// AmtPlatformPolicy.dxs +// AmtPlatformPolicy.cif +// +// 1 2/25/11 1:45a Klzhan +// Initial Check-in +// +// 1 12/03/10 5:11a Klzhan +// Initial Check-in. +// +//********************************************************************** +#ifndef _DXE_AMT_PLATFORM_POLICY_H_ +#define _DXE_AMT_PLATFORM_POLICY_H_ + +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +#endif + +#include EFI_PROTOCOL_DEFINITION (MeBiosPayloadData) +#include EFI_PROTOCOL_PRODUCER (AmtPlatformPolicy) +#include EFI_GUID_DEFINITION (MeBiosExtensionSetup) +#include "MeLib.h" +#include "Include\Protocol\PDiskInfo.h" +#include "Include\Protocol\PIDEController.h" +// Debug #include "AmtPlatformPolicyUpdateDxeLib.h" + +typedef +struct _INSTALL_DISK_INFO_PROTOCOL INSTALL_DISK_INFO_PROTOCOL; + +// Based on ATA/ATAPI-6 +#pragma pack (1) +typedef struct _IDENTIFY_DATA{ + + UINT16 General_Config_0; + UINT16 Reserved_1; + UINT16 Special_Config_2; + UINT16 Reserved_3; + UINT16 Reserved_4; + UINT16 Reserved_5; + UINT16 Reserved_6; + UINT16 Reserved_7; + UINT16 Reserved_8; + UINT16 Reserved_9; + UINT8 Serial_Number_10[20]; + UINT16 Reserved_20; + UINT16 Reserved_21; + UINT16 Reserved_22; + UINT8 Firmware_Revision_23[8]; + UINT8 Model_Number_27[40]; + UINT16 Maximum_Sector_Multiple_Command_47; + UINT16 Reserved_48; + UINT16 Capabilities_49; + UINT16 Capabilities_50; + UINT16 PIO_Mode_51; + UINT16 Reserved_52; + UINT16 Valid_Bits_53; + UINT16 Reserved_54_58[5]; + UINT16 Valid_Bits_59; + UINT32 Addressable_Sector_60; + UINT16 SingleWord_DMA_62; + UINT16 MultiWord_DMA_63; + UINT16 PIO_Mode_64; + UINT16 Min_Multiword_DMA_timing_65; + UINT16 Manuf_Multiword_DMA_timing_66; + UINT16 Min_PIO_Mode_timing_67; + UINT16 Min_PIO_Mode_timing_68; + UINT16 Reserved_69_74[6]; + UINT16 Queue_Depth_75; + UINT16 Reserved_76_79[4]; + UINT16 Major_Revision_80; + UINT16 Minor_Revision_81; + UINT16 Command_Set_Supported_82; + UINT16 Command_Set_Supported_83; + UINT16 Command_Set_Supported_84; + UINT16 Command_Set_Enabled_85; + UINT16 Command_Set_Enabled_86; + UINT16 Command_Set_Enabled_87; + UINT16 UDMA_Mode_88; + UINT16 Time_security_Earse_89; + UINT16 Time_Esecurity_Earse_90; + UINT16 Current_Power_Level_91; + UINT16 Master_Password_Rev_92; + UINT16 Hard_Reset_Value_93; + UINT16 Acoustic_Level_94; + UINT16 Reserved_95_99[5]; + UINT64 LBA_48; + UINT16 Reserved_104_126[23]; + UINT16 Status_Notification_127; + UINT16 Security_Status_128; + UINT16 Reserved_129_159[31]; + UINT16 CFA_Power_Mode_160; + UINT16 Reserved_161_175[15]; + UINT16 Media_Serial_Number_176_205[30]; + UINT16 Reserved_206_254[49]; + UINT16 Checksum_255; +} IDENTIFY_DATA; +#pragma pack () + +EFI_STATUS +AmtDxePolicyInitEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN OUT EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Initilize Intel AMT DXE Platform Policy + +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 +EFIAPI +InstallDiskInfo ( + VOID + ); + +typedef +EFI_STATUS +(EFIAPI *INSTALL_DISK_INFO) ( + VOID + ); + +typedef struct _INSTALL_DISK_INFO_PROTOCOL { + INSTALL_DISK_INFO Install; +}INSTALL_DISK_INFO_PROTOCOL; + +#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/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.mak b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.mak new file mode 100644 index 0000000..6cd33ff --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.mak @@ -0,0 +1,116 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (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/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.mak 3 4/24/12 12:41a Klzhan $ +# +# $Revision: 3 $ +# +# $Date: 4/24/12 12:41a $ +#********************************************************************** +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.mak $ +# +# 3 4/24/12 12:41a Klzhan +# +# 2 2/23/12 8:59a Klzhan +# Support New EDK +# +# 1 2/08/12 1:08a Klzhan +# Initial Check in +# +# 2 9/26/11 6:19a Klzhan +# [TAG] EIP70516 +# [Category] Spec Update +# [Severity] Important +# [Description] Update ME 8.0 RC 0.8 +# [Files] AmtPlatformPolicy.c +# AmtPlatformPolicy.h +# AmtPlatformPolicy.sdl +# AmtPlatformPolicy.mak +# AmtPlatformPolicy.dxs +# AmtPlatformPolicy.cif +# +# 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 : AmtPlatformPolicy + +AmtPlatformPolicy : $(BUILD_DIR)\AmtPlatformPolicy.mak AmtPlatformPolicyBin + +$(BUILD_DIR)\AmtPlatformPolicy.mak : $(AmtPlatformPolicy_DIR)\$(@B).cif $(AmtPlatformPolicy_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(AmtPlatformPolicy_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +AmtPlatformPolicy_INCLUDES=\ + $(EdkIIGlueLib_INCLUDES) \ + $(ME_INCLUDES) \ + $(MISCFRAMEWORK_INCLUDES) \ + $(NB_INCLUDES)\ + $(SB_INCLUDES)\ + /I$(PROJECT_DIR)\ + /IInclude\ + +AmtPlatformPolicy_LIBS=\ + $(EFIDRIVERLIB)\ + $(MeProtocolLib_LIB)\ + $(MeLibDxe_LIB)\ + $(MeGuidLib_LIB)\ +!IF "$(x64_BUILD)"=="1" + $(EdkIIGlueBaseLibX64_LIB)\ +!ELSE + $(EdkIIGlueBaseLibIA32_LIB)\ +!ENDIF + $(EdkIIGlueBaseLib_LIB)\ + $(EdkIIGlueDxeReportStatusCodeLib_LIB)\ + $(EdkIIGlueDxeDebugLibReportStatusCode_LIB)\ + $(EdkIIGlueUefiLib_LIB)\ + +AmtPlatformPolicyBin : $(AmtPlatformPolicy_LIBS) + $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\ + /f $(BUILD_DIR)\AmtPlatformPolicy.mak all\ + GUID=1be65202-9318-492d-a551-08df2bd60aee\ + "MY_INCLUDES = $(AmtPlatformPolicy_INCLUDES)" \ + ENTRY_POINT=AmtPlatformPolicyEntryPoint\ + DEPEX1=$(AmtPlatformPolicy_DIR)\AmtPlatformPolicy.dxs\ + DEPEX1_TYPE=EFI_SECTION_DXE_DEPEX\ + 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 ** +#** ** +#************************************************************************* +#************************************************************************* diff --git a/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.sdl b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.sdl new file mode 100644 index 0000000..bb2e57d --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/AmtPlatformPolicy.sdl @@ -0,0 +1,42 @@ +TOKEN + Name = "AmtPlatformPolicy_SUPPORT" + Value = "1" + Help = "Main switch to enable AmtPlatformPolicy support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "AmtPlatformPolicy_DIR" +End + +MODULE + Help = "Includes AmtPlatformPolicy.mak to Project" + File = "AmtPlatformPolicy.mak" +End + +ELINK + Name = "$(BUILD_DIR)\AmtPlatformPolicy.ffs" + Parent = "FV_MAIN" + InvokeOrder = AfterParent +End + +TOKEN + Name = "USB_PROVISION_DEFAULT_WITHOUT_AMT" + Value = "0" + Help = "If set to 1, usb provision is functional when AMT disable" + TokenType = Integer + TargetH = Yes +End + +TOKEN + Name = "SW_SMI_POST_COMPLETE" + Value = "0xBB" + Help = "Value to be written into SMI command register \to set POST Complete flag for indicating that the POST is complete" + TokenType = Integer + TargetH = Yes + Range = "0-0xff" +End + diff --git a/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.c b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.c new file mode 100644 index 0000000..0a3ecc2 --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.c @@ -0,0 +1,233 @@ +/*++ + 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: + + AmtPeiPolicyInit.c + +Abstract: + + This file is SampleCode for Intel AMT PEI Platform Policy initialzation. + +--*/ +#include "AmtPeiPolicyInit.h" + +#if EFI_SPECIFICATION_VERSION>0x20000 +#define __UEFI_HII__H__ +#define __HII_CONFIG_ACCESS__H__ +#include EFI_PROTOCOL_DEFINITION (HiiConfigAccess) +#else +#ifndef GUID_VARIABLE_DECLARATION +#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable +#endif +#define __UEFI_HII__H__ +#define __HII_PROTOCOL_H__ +#define _HII_H_ +#endif + +#include <Setup.h> + +#include EFI_PPI_DEFINITION (Variable) +#include EFI_GUID_DEFINITION (MeBiosExtensionSetup) +#include <ActiveManagement\AlertStandardFormat\Heci\Common\AlertStandardFormatCommon.h> +#include <Guid\AmtForcePushPetPolicy\AmtForcePushPetPolicy.h> + +EFI_GUID gSetupGuid = SETUP_GUID; +EFI_GUID gEfiMeBiosExtensionSetupGuid = EFI_ME_BIOS_EXTENSION_SETUP_GUID; +CHAR16 gEfiMeBiosExtensionSetupName[] = EFI_ME_BIOS_EXTENSION_SETUP_VARIABLE_NAME; +EFI_GUID gPeiReadOnlyVariablePpiGuid = PEI_READ_ONLY_VARIABLE_ACCESS_PPI_GUID; +EFI_GUID gAmtForcePushPetPolicyGuid = AMT_FORCE_PUSH_PET_POLICY_GUID; + +EFI_STATUS +CreateAmtForcePushPetPolicyHob( + IN EFI_PEI_SERVICES **PeiServices +); + +// +// Function implementations +// +EFI_STATUS +AmtPeiPolicyInitEntryPoint ( + IN EFI_FFS_FILE_HEADER *FfsHeader, + IN EFI_PEI_SERVICES **PeiServices + ) +/*++ + +Routine Description: + + Initilize Intel AMT 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_AMT_PLATFORM_POLICY_PPI *AmtPlatformPolicyPpi; + EFI_PEI_PPI_DESCRIPTOR *AmtPlatformPolicyPpiDesc; + EFI_PEI_READ_ONLY_VARIABLE_PPI *VariableServices; + UINTN VariableSize; + SETUP_DATA SetupData; + ME_BIOS_EXTENSION_SETUP MeBiosExtensionSetupData; + // + // Allocate descriptor and PPI structures + // + AmtPlatformPolicyPpi = (PEI_AMT_PLATFORM_POLICY_PPI *) AllocateZeroPool (sizeof (PEI_AMT_PLATFORM_POLICY_PPI)); + ASSERT (AmtPlatformPolicyPpi != NULL); + if (AmtPlatformPolicyPpi == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + AmtPlatformPolicyPpiDesc = (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (sizeof (EFI_PEI_PPI_DESCRIPTOR)); + ASSERT (AmtPlatformPolicyPpiDesc != NULL); + if (AmtPlatformPolicyPpiDesc == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + // + // Initialize the PPI + // + AmtPlatformPolicyPpiDesc->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST; + AmtPlatformPolicyPpiDesc->Guid = &gPeiAmtPlatformPolicyPpiGuid; + + // 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_SUCCESS; + } + // + // Get Setup Variable + // + + VariableSize = sizeof (SETUP_DATA); + Status = VariableServices->PeiGetVariable ( + PeiServices, + L"Setup", + &gSetupGuid, + NULL, + &VariableSize, + &SetupData + ); + // + // Update the REVISION number + // + AmtPlatformPolicyPpi->Revision = PEI_AMT_PLATFORM_POLICY_PPI_REVISION_5; + + // + // Initialize the Platform Configuration + // + if (Status != EFI_SUCCESS) { + AmtPlatformPolicyPpi->iAmtEnabled = 0; + AmtPlatformPolicyPpi->WatchDog = 0; + AmtPlatformPolicyPpi->WatchDogTimerBios = 0; + AmtPlatformPolicyPpi->WatchDogTimerOs = 0; + AmtPlatformPolicyPpi->AsfEnabled = 1; + AmtPlatformPolicyPpi->FWProgress = 1; + } else { + AmtPlatformPolicyPpi->iAmtEnabled = SetupData.Amt; + AmtPlatformPolicyPpi->WatchDog = SetupData.WatchDog; + AmtPlatformPolicyPpi->WatchDogTimerBios = SetupData.WatchDogTimerBios; + AmtPlatformPolicyPpi->WatchDogTimerOs = SetupData.WatchDogTimerOs; + AmtPlatformPolicyPpi->AsfEnabled = SetupData.Asf; + AmtPlatformPolicyPpi->FWProgress = SetupData.FWProgress; + } + + // + // Get BIOS Sync-up data from MEBx to AMT platform policy + // + VariableSize = sizeof (MeBiosExtensionSetupData); + Status = VariableServices->PeiGetVariable( + PeiServices, + gEfiMeBiosExtensionSetupName, + &gEfiMeBiosExtensionSetupGuid, + NULL, + &VariableSize, + &MeBiosExtensionSetupData + ); + if (Status != EFI_SUCCESS) { + AmtPlatformPolicyPpi->ManageabilityMode = 0; + } else { + AmtPlatformPolicyPpi->ManageabilityMode = MeBiosExtensionSetupData.PlatformMngSel; + } + +// Debug UpdatePeiAmtPlatformPolicy (PeiServices, AmtPlatformPolicyPpi); + + AmtPlatformPolicyPpiDesc->Ppi = AmtPlatformPolicyPpi; + // + // Install the ME PEI Platform Policy PPI + // + Status = (**PeiServices).InstallPpi (PeiServices, AmtPlatformPolicyPpiDesc); + ASSERT_PEI_ERROR (PeiServices, Status); + + CreateAmtForcePushPetPolicyHob(PeiServices); + + return Status; +} +EFI_FRAMEWORK_MESSAGE_TYPE mAmtForcePushPetPolicy[] = { + EfiAsfMessageChassisIntrusion, + EfiAsfMessageUserAuthenticationInvalid, + EfiAsfMessageHddAuthenticationInvalid, +}; + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// +// Procedure: CreateAmtForcePushPetPolicyHob +// +// Description: Create AMT force push pet policy HOB. +// +// Input: IN EFI_PEI_SERVICES **PeiServices, +// +// Output: EFI_STATUS +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> +EFI_STATUS +CreateAmtForcePushPetPolicyHob( +IN EFI_PEI_SERVICES **PeiServices +) +{ + EFI_STATUS Status; + EFI_HOB_GUID_TYPE *Hob; + + // Build the GUID'd HOB for DXE + Status = (*PeiServices)->CreateHob ( + PeiServices, + EFI_HOB_TYPE_GUID_EXTENSION, + (UINT16) (sizeof (EFI_HOB_GUID_TYPE) + sizeof(mAmtForcePushPetPolicy)), + &Hob + ); + if (EFI_ERROR (Status))return Status; + + ((EFI_HOB_GUID_TYPE *)(Hob))->Name = gAmtForcePushPetPolicyGuid; + + Hob++; + + GlueCopyMem (Hob, mAmtForcePushPetPolicy, sizeof(mAmtForcePushPetPolicy)); + + return EFI_SUCCESS; +} diff --git a/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.cif b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.cif new file mode 100644 index 0000000..c6c717e --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.cif @@ -0,0 +1,13 @@ +<component> + name = "AmtPeiPolicyInit" + category = ModulePart + LocalRoot = "Board\EM\MeWrapper\AmtWrapper\AmtPlatformPolicy\Pei" + RefName = "AmtPeiPolicyInit" +[files] +"AmtPeiPolicyInit.c" +"AmtPeiPolicyInit.h" +"AmtPeiPolicyInit.sdl" +"AmtPeiPolicyInit.mak" +"AmtPeiPolicyInit.dxs" +"AmtPeiPolicyInit.inf" +<endComponent> diff --git a/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.dxs b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.dxs new file mode 100644 index 0000000..abfebdd --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.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" + +DEPENDENCY_START + TRUE +DEPENDENCY_END + + diff --git a/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.h b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.h new file mode 100644 index 0000000..a4426bf --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.h @@ -0,0 +1,60 @@ +/*++ + 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: + + AmtPeiPolicyInit.h + +Abstract: + + Header file for the AmtPeiPolicyInit PEIM. + +--*/ +#ifndef _AMT_PEI_PLATFORM_POLICY_H_ +#define _AMT_PEI_PLATFORM_POLICY_H_ + +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGluePeim.h" +#endif + +#include EFI_PPI_DEFINITION (AmtPlatformPolicyPei) +// Debug #include "AmtPlatformPolicyUpdatePeiLib.h" + +EFI_STATUS +AmtPeiPolicyInitEntryPoint ( + IN EFI_FFS_FILE_HEADER *FfsHeader, + IN EFI_PEI_SERVICES **PeiServices + ) +/*++ + +Routine Description: + + Initilize Intel AMT 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/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.inf b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.inf new file mode 100644 index 0000000..f039471 --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.inf @@ -0,0 +1,81 @@ +# +#/*++ +# 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: +# +# AmtPeiPolicyInit.inf +# +# Abstract: +# +# Component description file for the AmtPeiPolicyInit PEIM. +# +#--*/ + + +[defines] +BASE_NAME = AmtPeiPolicyInit +FILE_GUID = A05ECE52-15A8-424e-BFD3-FCF3D566A09C +COMPONENT_TYPE = PE32_PEIM + +[sources.common] + AmtPeiPolicyInit.c + AmtPeiPolicyInit.h +# +# Edk II Glue Driver Entry Point +# + EdkIIGluePeimEntryPoint.c + +[includes.common] + $(EFI_SOURCE)\$(PROJECT_ME_ROOT) + +# +# EDK II Glue Library utilizes some standard headers from EDK +# + $(EDK_SOURCE)\Foundation + $(EDK_SOURCE)\Foundation\Core\Dxe + $(EDK_SOURCE)\Foundation\Efi + $(EDK_SOURCE)\Foundation\Efi\Include + $(EDK_SOURCE)\Foundation\Framework + $(EDK_SOURCE)\Foundation\Framework\Include + $(EDK_SOURCE)\Foundation\Include + $(EDK_SOURCE)\Foundation\Include\IndustryStandard + $(EDK_SOURCE)\Foundation\Include\Pei + $(EDK_SOURCE)\Foundation\Library\Dxe\Include + $(EDK_SOURCE)\Foundation\Library\EdkIIGlueLib\Include + +[libraries.common] + MeLibPpi + PeiLib + EdkIIGlueBaseLib + EdkIIGlueBaseMemoryLib + EdkIIGluePeiDebugLibReportStatusCode + EdkIIGluePeiReportStatusCodeLib + EdkIIGluePeiServicesLib + EdkIIGluePeiMemoryAllocationLib + +[nmake.common] + IMAGE_ENTRY_POINT= _ModuleEntryPoint + DPX_SOURCE=AmtPeiPolicyInit.dxs + C_FLAGS = $(C_FLAGS) /D "__EDKII_GLUE_MODULE_ENTRY_POINT__=AmtPeiPolicyInitEntryPoint" \ + /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__ \ diff --git a/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.mak b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.mak new file mode 100644 index 0000000..ee122c7 --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.mak @@ -0,0 +1,113 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (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/AmtWrapper/AmtPlatformPolicy/AmtPeiPolicyInit/AmtPeiPolicyInit.mak 2 2/23/12 8:59a Klzhan $ +# +# $Revision: 2 $ +# +# $Date: 2/23/12 8:59a $ +#********************************************************************** +# Revision History +# ---------------- +# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/AmtWrapper/AmtPlatformPolicy/AmtPeiPolicyInit/AmtPeiPolicyInit.mak $ +# +# 2 2/23/12 8:59a Klzhan +# Support New EDK +# +# 1 2/08/12 1:09a Klzhan +# +# 1 3/29/11 5:03a 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 : AmtPeiPolicyInit + +AmtPeiPolicyInit : $(BUILD_DIR)\AmtPeiPolicyInit.mak AmtPeiPolicyInitBin + +$(BUILD_DIR)\AmtPeiPolicyInit.mak : $(AmtPeiPlatformPolicy_DIR)\$(@B).cif $(AmtPeiPlatformPolicy_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(AmtPeiPlatformPolicy_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +AmtPeiPlatformPolicy_INCLUDES=\ + $(EDK_INCLUDES) \ + $(ME_INCLUDES) \ + $(MISCFRAMEWORK_INCLUDES) \ + $(NB_INCLUDES)\ + $(SB_INCLUDES)\ + /I$(PROJECT_DIR)\ + /IInclude\ + + +AmtPeiPlatformPolicy_DEFINES=$(MY_DEFINES)\ + /D"__EDKII_GLUE_MODULE_ENTRY_POINT__=AmtPeiPolicyInitEntryPoint"\ + /D __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__ \ + /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_BASE_PCI_LIB_PCI_EXPRESS__ \ + +AmtPeiPlatformPolicy_LIBS=\ + $(EDKPROTOCOLLIB)\ + $(MeLibPpi_LIB)\ + $(EdkIIGlueBaseLib_LIB)\ + $(EdkIIGlueBaseLibIA32_LIB)\ + $(EdkIIGluePeiServicesLib_LIB)\ + $(EdkIIGluePeiHobLib_LIB)\ + $(EdkIIGluePeiMemoryAllocationLib_LIB)\ + $(EdkIIGlueBaseIoLibIntrinsic_LIB)\ + $(EdkIIGluePeiDebugLibReportStatusCode_LIB)\ + $(EdkIIGluePeiReportStatusCodeLib_LIB)\ + $(PEILIB) + + +AmtPeiPolicyInitBin : $(AmtPeiPlatformPolicy_LIBS) + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + /f $(BUILD_DIR)\AmtPeiPolicyInit.mak all\ + GUID=A05ECE52-15A8-424e-BFD3-FCF3D566A09C\ + "MY_INCLUDES = $(AmtPeiPlatformPolicy_INCLUDES)" \ + "MY_DEFINES=$(AmtPeiPlatformPolicy_DEFINES)"\ + ENTRY_POINT=AmtPeiPolicyInitEntryPoint\ + TYPE=PEIM\ + EDKIIModule=PEIM\ + DEPEX1=$(AmtPeiPlatformPolicy_DIR)\AmtPeiPolicyInit.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/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.sdl b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.sdl new file mode 100644 index 0000000..15734dd --- /dev/null +++ b/Board/EM/MeWrapper/AmtWrapper/AmtPlatformPolicy/Pei/AmtPeiPolicyInit.sdl @@ -0,0 +1,25 @@ +TOKEN + Name = "AmtPeiPlatformPolicy_SUPPORT" + Value = "1" + Help = "Main switch to enable AmtPlatformPolicy support in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "AmtPeiPlatformPolicy_DIR" +End + +MODULE + Help = "Includes AmtPlatformPolicy.mak to Project" + File = "AmtPeiPolicyInit.mak" +End + +ELINK + Name = "$(BUILD_DIR)\AmtPeiPolicyInit.ffs" + Parent = "FV_BB" + InvokeOrder = AfterParent +End + |