summaryrefslogtreecommitdiff
path: root/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei
diff options
context:
space:
mode:
Diffstat (limited to 'ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei')
-rw-r--r--ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.c437
-rw-r--r--ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.cif13
-rw-r--r--ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.dxs29
-rw-r--r--ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.h204
-rw-r--r--ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.inf93
-rw-r--r--ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.mak50
-rw-r--r--ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.sdl25
7 files changed, 851 insertions, 0 deletions
diff --git a/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.c b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.c
new file mode 100644
index 0000000..10afe73
--- /dev/null
+++ b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.c
@@ -0,0 +1,437 @@
+/** @file
+ Processes ASF messages
+
+@copyright
+ Copyright (c) 2010 - 2012 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.
+
+ This file contains an 'Intel Peripheral Driver' and uniquely
+ identified as "Intel Reference Module" and is
+ licensed for Intel CPUs and chipsets under the terms of your
+ license agreement with Intel or your vendor. This file may
+ be modified by the user, subject to additional terms of the
+ license agreement
+
+**/
+
+//
+// External include files do NOT need to be explicitly specified in real EDKII
+// environment
+//
+#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000)
+#include "EdkIIGluePeim.h"
+#include "AlertStandardFormatPei.h"
+#include "MeLibPei.h"
+#endif
+
+#define ASF_PEI
+#include "AlertStandardFormatCommon.c"
+
+static PEI_AMT_STATUS_CODE_PPI mPeiAmtStatusCodePpi = { PeiAmtReportStatusCode };
+
+static EFI_PEI_PPI_DESCRIPTOR mInstallPeiAmtStatusCodePpi = {
+ EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
+ &gPeiAmtStatusCodePpiGuid,
+ &mPeiAmtStatusCodePpi
+};
+
+/**
+ Perform AMT PET message sending
+
+ @param[in] FfsHeader FFS file header pointer of this driver.
+ @param[in] PeiServices General purpose services available to every PEIM.
+
+ @retval EFI_SUCCESS if the AMT StatusCode PPI is successfully installed.
+ @exception EFI_UNSUPPORTED ASF is not enabled or ManageabilityMode is zero.
+**/
+EFI_STATUS
+EFIAPI
+AlertStandardFormatDriverPeiEntryPoint (
+ IN EFI_FFS_FILE_HEADER *FfsHeader,
+ IN EFI_PEI_SERVICES **PeiServices
+ )
+{
+ EFI_STATUS Status;
+
+ ///
+ /// First check if ASF support is enabled in Setup.
+ ///
+ if (!PeiAsfSupported (PeiServices)) {
+ return EFI_UNSUPPORTED;
+ }
+ ///
+ /// Sending ASF Messaging if ManageabilityMode is not zero
+ ///
+ if (ManageabilityModeSetting (PeiServices) == MNT_OFF) {
+ return EFI_UNSUPPORTED;
+ }
+ ///
+ /// Install AMT report status code PPI
+ ///
+ Status = (**PeiServices).InstallPpi (PeiServices, &mInstallPeiAmtStatusCodePpi);
+ ASSERT_EFI_ERROR (Status);
+
+ ///
+ /// Try to send PET message
+ ///
+ SendPETMessageInQueue (PeiServices);
+
+ return EFI_SUCCESS;
+}
+
+/**
+ Send ASF Message.
+
+ @param[in] PeiServices General purpose services available to every PEIM.
+ @param[in] AsfMessage Pointer to ASF message
+
+ @retval EFI_SUCCESS Boot options copied
+ @retval EFI_INVALID_PARAMETER Invalid pointer
+ @retval EFI_NOT_READY No controller
+ @retval EFI_DEVICE_ERROR The function should not be completed due to a device error
+**/
+EFI_STATUS
+SendAsfMessage (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_ASF_MESSAGE *AsfMessage
+ )
+{
+ EFI_STATUS Status;
+ PEI_HECI_PPI *Heci;
+ UINT32 HeciMemBar;
+ UINT32 HeciLength;
+ HECI_ASF_PUSH_PROGRESS_CODE HeciAsfPushProgressCode;
+ UINT32 MeStatus;
+
+ Status = (*PeiServices)->LocatePpi (
+ PeiServices,
+ &gPeiHeciPpiGuid, // GUID
+ 0, // INSTANCE
+ NULL, // EFI_PEI_PPI_DESCRIPTOR
+ (VOID **) &Heci // PPI
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Status = Heci->InitializeHeci (PeiServices, Heci, &HeciMemBar);
+ if (EFI_ERROR (Status)) {
+ return EFI_NOT_READY;
+ }
+
+ Status = Heci->GetMeStatus (PeiServices, &MeStatus);
+ ASSERT_EFI_ERROR (Status);
+
+ ///
+ /// Only send ASF Push Progress code when ME is ready. Ignore FW Init Status.
+ ///
+ if (ME_STATUS_ME_STATE_ONLY (MeStatus) != ME_READY) {
+ return EFI_NOT_READY;
+ }
+
+ ZeroMem ((VOID *) &HeciAsfPushProgressCode, sizeof (HECI_ASF_PUSH_PROGRESS_CODE));
+ HeciAsfPushProgressCode.Command = EFI_ASF_MESSAGE_COMMAND_MESSAGE;
+ HeciAsfPushProgressCode.ByteCount = 0x10;
+ HeciLength = HECI_ASF_PUSH_PROGRESS_CODE_LENGTH;
+ CopyMem ((VOID *) &(HeciAsfPushProgressCode.AsfMessage), (VOID *) AsfMessage, sizeof (EFI_ASF_MESSAGE));
+
+ Status = Heci->SendMsg (
+ PeiServices,
+ Heci,
+ (UINT32 *) &HeciAsfPushProgressCode,
+ HeciMemBar,
+ HeciLength,
+ BIOS_ASF_HOST_ADDR,
+ HECI_ASF_MESSAGE_ADDR
+ );
+ if (EFI_ERROR (Status)) {
+ return EFI_DEVICE_ERROR;
+ }
+
+ return EFI_SUCCESS;
+}
+
+/**
+ This routine checks whethre current message is ForcePush message.
+
+ @param[in] PeiServices PeiServices pointer.
+ @param[in] MessageType AMT PET Message Type.
+
+ @retval TRUE It is ForcePush message.
+ @retval FALSE It is not ForcePush message.
+**/
+BOOLEAN
+IsForcePushErrorEvent (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_FRAMEWORK_MESSAGE_TYPE MessageType
+ )
+{
+ AMT_FORCE_PUSH_PET_POLICY_HOB *AmtForcePushPETPolicyHob;
+ UINTN Index;
+ UINTN Number;
+ EFI_STATUS Status;
+
+ Status = (*PeiServices)->GetHobList (PeiServices, (VOID **) &AmtForcePushPETPolicyHob);
+ ASSERT_EFI_ERROR (Status);
+
+ AmtForcePushPETPolicyHob = GetNextGuidHob (&gAmtForcePushPetPolicyGuid, AmtForcePushPETPolicyHob);
+ if (AmtForcePushPETPolicyHob == NULL) {
+ return FALSE;
+ }
+
+ Number = (AmtForcePushPETPolicyHob->EfiHobGuidType.Header.HobLength - sizeof (EFI_HOB_GUID_TYPE)) /
+ sizeof (EFI_FRAMEWORK_MESSAGE_TYPE);
+ for (Index = 0; Index < Number; Index++) {
+ if (AmtForcePushPETPolicyHob->MessageType[Index] == MessageType) {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+/**
+ Provides an interface that a software module can call to report an ASF PEI status code.
+
+ @param[in] PeiServices PeiServices pointer.
+ @param[in] This This interface.
+ @param[in] Type Indicates the type of status code being reported.
+ @param[in] Value Describes the current status of a hardware or software entity.
+ This included information about the class and subclass that is
+ used to classify the entity as well as an operation.
+ @param[in] Instance The enumeration of a hardware or software entity within
+ the system. Valid instance numbers start with 1.
+ @param[in] CallerId This optional parameter may be used to identify the caller.
+ This parameter allows the status code driver to apply different
+ rules to different callers.
+ @param[in] Data This optional parameter may be used to pass additional data.
+
+ @retval EFI_SUCCESS The function completed successfully
+ @retval EFI_DEVICE_ERROR The function should not be completed due to a device error.
+**/
+EFI_STATUS
+EFIAPI
+PeiAmtReportStatusCode (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_AMT_STATUS_CODE_PPI * This,
+ IN EFI_STATUS_CODE_TYPE Type,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN EFI_GUID * CallerId OPTIONAL,
+ IN EFI_STATUS_CODE_DATA * Data OPTIONAL
+ )
+{
+ UINTN Index;
+ EFI_STATUS Status;
+
+ Status = EFI_SUCCESS;
+
+ if (PeiFwProgressSupport (PeiServices)) {
+ if ((Type & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
+ for (Index = 0; Index < sizeof (mAsfProgressDataHubMap) / sizeof (EFI_ASF_DATA_HUB_MAP); Index++) {
+ if (mAsfProgressDataHubMap[Index].StatusCodeValue == Value) {
+ ///
+ /// Queue Progress Code and send PET after checking Boot Options
+ ///
+ QueuePetMessage (PeiServices, Type, Value);
+ }
+ }
+ }
+ }
+
+ if ((Type & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {
+ for (Index = 0; Index < sizeof (mAsfErrorDataHubMap) / sizeof (EFI_ASF_DATA_HUB_MAP); Index++) {
+ if (mAsfErrorDataHubMap[Index].StatusCodeValue == Value) {
+ Status = SendPostPacket (PeiServices, mAsfErrorDataHubMap[Index].MessageType);
+ if ((Status == EFI_DEVICE_ERROR) && IsForcePushErrorEvent (PeiServices, mAsfErrorDataHubMap[Index].MessageType)) {
+ SaveForcePushErrorEvent (PeiServices, mAsfErrorDataHubMap[Index].MessageType);
+ }
+
+ if (Status == EFI_NOT_READY) {
+ QueuePetMessage (PeiServices, Type, Value);
+ }
+ }
+ }
+ }
+
+ return Status;
+}
+
+/**
+ Sends a POST packet across ASF
+
+ @param[in] PeiServices General purpose services available to every PEIM.
+ @param[in] MessageType POST Status Code
+
+ @retval EFI_SUCCESS The function completed successfully
+**/
+EFI_STATUS
+SendPostPacket (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_FRAMEWORK_MESSAGE_TYPE MessageType
+ )
+{
+ UINTN Index;
+
+ ///
+ /// Find the message to send across the wire
+ ///
+ for (Index = 0; Index < sizeof (mAsfFrameworkMessage) / sizeof (EFI_ASF_FRAMEWORK_MESSAGE); Index++) {
+ if (mAsfFrameworkMessage[Index].MessageType == MessageType) {
+ return SendAsfMessage (PeiServices, &mAsfFrameworkMessage[Index].Message);
+ }
+ }
+
+ return EFI_SUCCESS;
+}
+
+/**
+ This routine saves current ForcePush ErrorEvent to Hob, which will be sent again.
+
+ @param[in] PeiServices PeiServices pointer.
+ @param[in] MessageType ASF PET message type.
+
+ @retval EFI_SUCCESS The function completed successfully
+**/
+EFI_STATUS
+SaveForcePushErrorEvent (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_FRAMEWORK_MESSAGE_TYPE MessageType
+ )
+{
+ AMT_FORCE_PUSH_PET_HOB *ForcePushPETHob;
+ EFI_STATUS Status;
+
+ ///
+ /// Create PET queue hob
+ ///
+ Status = (**PeiServices).CreateHob (
+ PeiServices,
+ EFI_HOB_TYPE_GUID_EXTENSION,
+ sizeof (AMT_FORCE_PUSH_PET_HOB),
+ (VOID **) &ForcePushPETHob
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ ForcePushPETHob->EfiHobGuidType.Name = gAmtForcePushPetHobGuid;
+ ForcePushPETHob->MessageType = MessageType;
+
+ return EFI_SUCCESS;
+}
+
+/**
+ This routine puts PET message to MessageQueue, which will be sent later.
+
+ @param[in] PeiServices PeiServices pointer.
+ @param[in] Type StatusCode message type.
+ @param[in] Value StatusCode message value.
+
+ @retval EFI_SUCCESS The function completed successfully
+**/
+EFI_STATUS
+QueuePetMessage (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_STATUS_CODE_TYPE Type,
+ IN EFI_STATUS_CODE_VALUE Value
+ )
+{
+ AMT_PET_QUEUE_HOB *PETQueueHob;
+ EFI_STATUS Status;
+
+ ///
+ /// Create PET queue hob
+ ///
+ Status = (**PeiServices).CreateHob (
+ PeiServices,
+ EFI_HOB_TYPE_GUID_EXTENSION,
+ sizeof (AMT_PET_QUEUE_HOB),
+ (VOID **) &PETQueueHob
+ );
+ ASSERT_EFI_ERROR (Status);
+ PETQueueHob->EfiHobGuidType.Name = gAmtPetQueueHobGuid;
+ PETQueueHob->Value = Value;
+
+ return EFI_SUCCESS;
+}
+
+/**
+ This routine sends PET message in MessageQueue.
+
+ @param[in] PeiServices PeiServices pointer.
+
+ @retval EFI_SUCCESS The function completed successfully
+ @retval EFI_NOT_READY No controller
+**/
+EFI_STATUS
+SendPETMessageInQueue (
+ IN EFI_PEI_SERVICES **PeiServices
+ )
+{
+ EFI_STATUS Status;
+ AMT_PET_QUEUE_HOB *PETQueueHob;
+ EFI_PEI_HOB_POINTERS Hob;
+
+ PEI_HECI_PPI *Heci;
+ UINT32 HeciMemBar;
+ UINT32 MeStatus;
+
+ ///
+ /// Try HECI state
+ ///
+ Status = (*PeiServices)->LocatePpi (
+ PeiServices,
+ &gPeiHeciPpiGuid, // GUID
+ 0, // INSTANCE
+ NULL, // EFI_PEI_PPI_DESCRIPTOR
+ (VOID **) &Heci // PPI
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Status = Heci->InitializeHeci (PeiServices, Heci, &HeciMemBar);
+ if (EFI_ERROR (Status)) {
+ return EFI_NOT_READY;
+ }
+
+ Status = Heci->GetMeStatus (PeiServices, &MeStatus);
+ ASSERT_EFI_ERROR (Status);
+
+ ///
+ /// Only send ASF Push Progress code when ME is ready. Ignore FW Init Status.
+ ///
+ if (ME_STATUS_ME_STATE_ONLY (MeStatus) != ME_READY) {
+ return EFI_NOT_READY;
+ }
+ ///
+ /// Get PETQueueHob
+ ///
+ Status = (*PeiServices)->GetHobList (PeiServices, (VOID **) &PETQueueHob);
+ ASSERT_EFI_ERROR (Status);
+
+ while (TRUE) {
+ PETQueueHob = GetNextGuidHob (&gAmtPetQueueHobGuid, PETQueueHob);
+ if (PETQueueHob == NULL) {
+ break;
+ }
+ ///
+ /// Send message
+ ///
+ PeiAmtReportStatusCode (PeiServices, NULL, PETQueueHob->Type, PETQueueHob->Value, 0, NULL, NULL);
+
+ ///
+ /// Mark it as sent
+ ///
+ PETQueueHob->Type = (UINT32) -1;
+
+ ///
+ /// Need find next one
+ ///
+ Hob.Raw = (VOID *) PETQueueHob;
+ PETQueueHob = (AMT_PET_QUEUE_HOB *) GET_NEXT_HOB (Hob);
+ }
+
+ return EFI_SUCCESS;
+}
diff --git a/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.cif b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.cif
new file mode 100644
index 0000000..ee123bf
--- /dev/null
+++ b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.cif
@@ -0,0 +1,13 @@
+<component>
+ name = "AlertStandardFormatPei"
+ category = ModulePart
+ LocalRoot = "ReferenceCode\ME\ActiveManagement\AlertStandardFormat\Heci\Pei\"
+ RefName = "AlertStandardFormatPei"
+[files]
+"AlertStandardFormatPei.sdl"
+"AlertStandardFormatPei.mak"
+"AlertStandardFormatPei.c"
+"AlertStandardFormatPei.dxs"
+"AlertStandardFormatPei.h"
+"AlertStandardFormatPei.inf"
+<endComponent>
diff --git a/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.dxs b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.dxs
new file mode 100644
index 0000000..236c6ec
--- /dev/null
+++ b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.dxs
@@ -0,0 +1,29 @@
+/** @file
+ Dependency expression source file.
+
+@copyright
+ Copyright (c) 2010 - 2012 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.
+
+ 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
+
+**/
+
+#include "EfiDepex.h"
+
+#include EFI_PPI_DEFINITION (Heci)
+#include EFI_PPI_DEFINITION (AmtPlatformPolicyPei)
+
+DEPENDENCY_START
+ PEI_HECI_PPI_GUID AND
+ PEI_AMT_PLATFORM_POLICY_PPI_GUID
+DEPENDENCY_END
diff --git a/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.h b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.h
new file mode 100644
index 0000000..b24dd69
--- /dev/null
+++ b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.h
@@ -0,0 +1,204 @@
+/** @file
+ Processes ASF messages
+
+@copyright
+ Copyright (c) 2010 - 2012 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.
+
+ This file contains an 'Intel Peripheral Driver' and uniquely
+ identified as "Intel Reference Module" and is
+ licensed for Intel CPUs and chipsets under the terms of your
+ license agreement with Intel or your vendor. This file may
+ be modified by the user, subject to additional terms of the
+ license agreement
+**/
+#ifndef _ALERT_STANDARD_FORMAT_PEI_H
+#define _ALERT_STANDARD_FORMAT_PEI_H
+
+#include "AmtLibPei.h"
+#include "MkhiMsgs.h"
+#include "AlertStandardFormatCommon.h"
+
+//
+// Driver Consumed Protocol Prototypes
+//
+#include EFI_PPI_CONSUMER (HECI)
+#include EFI_PPI_PRODUCER (AmtStatusCode)
+#include EFI_GUID_DEFINITION (MeBiosExtensionSetup)
+#include EFI_GUID_DEFINITION (AmtForcePushPetPolicy)
+
+///
+/// ASF Over HECI
+///
+#pragma pack(1)
+typedef struct {
+ UINT8 SubCommand;
+ UINT8 Version;
+ UINT8 EventSensorType;
+ UINT8 EventType;
+ UINT8 EventOffset;
+ UINT8 EventSourceType;
+ UINT8 EventSeverity;
+ UINT8 SensorDevice;
+ UINT8 SensorNumber;
+ UINT8 Entity;
+ UINT8 EntityInstance;
+ UINT8 Data0;
+ UINT8 Data1;
+} EFI_ASF_MESSAGE;
+#pragma pack()
+
+typedef struct _HECI_ASF_PUSH_PROGRESS_CODE {
+ UINT8 Command;
+ UINT8 ByteCount;
+ EFI_ASF_MESSAGE AsfMessage;
+ UINT8 EventData[3];
+ UINT8 Reserved[2];
+} HECI_ASF_PUSH_PROGRESS_CODE;
+
+#define HECI_ASF_PUSH_PROGRESS_CODE_LENGTH 0x12
+
+typedef enum _HASFM_COMMAND_CODE
+{
+ ASF_MESSAGING_CMD = 0x04,
+ ASF_PUSH_PROGESS_CODE_SUBCMD = 0x12,
+ ASF_MENAGEMENT_CONTROL = 0x02,
+ ASF_WDT_START_SUBCMD = 0x13,
+ ASF_WDT_STOP_SUBCMD = 0x14,
+ ASF_CONFIGURATION_CMD = 0x03,
+ ASF_CLEAR_BOOT_OPTION_SUBCMD = 0x15,
+ ASF_RETURN_BOOT_OPTION_SUBCMD = 0x16,
+ ASF_NO_BOOT_OPTION_SUBCMD = 0x17
+} HASFM_COMMAND_CODE;
+
+typedef struct {
+ EFI_FRAMEWORK_MESSAGE_TYPE MessageType;
+ EFI_ASF_MESSAGE Message;
+} EFI_ASF_FRAMEWORK_MESSAGE;
+
+typedef struct {
+ EFI_FRAMEWORK_MESSAGE_TYPE MessageType;
+ EFI_STATUS_CODE_VALUE StatusCodeValue;
+} EFI_ASF_DATA_HUB_MAP;
+
+//
+// Prototypes
+//
+
+/**
+ Send ASF Message.
+
+ @param[in] PeiServices General purpose services available to every PEIM.
+ @param[in] AsfMessage Pointer to ASF message
+
+ @retval EFI_SUCCESS Boot options copied
+ @retval EFI_INVALID_PARAMETER Invalid pointer
+ @retval EFI_NOT_READY No controller
+ @retval EFI_DEVICE_ERROR The function should not be completed due to a device error
+**/
+EFI_STATUS
+SendAsfMessage (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_ASF_MESSAGE *AsfMessage
+ )
+;
+
+/**
+ Provides an interface that a software module can call to report an ASF PEI status code.
+
+ @param[in] PeiServices PeiServices pointer.
+ @param[in] This This interface.
+ @param[in] Type Indicates the type of status code being reported.
+ @param[in] Value Describes the current status of a hardware or software entity.
+ This included information about the class and subclass that is
+ used to classify the entity as well as an operation.
+ @param[in] Instance The enumeration of a hardware or software entity within
+ the system. Valid instance numbers start with 1.
+ @param[in] CallerId This optional parameter may be used to identify the caller.
+ This parameter allows the status code driver to apply different
+ rules to different callers.
+ @param[in] Data This optional parameter may be used to pass additional data.
+
+ @retval EFI_SUCCESS The function completed successfully
+ @retval EFI_DEVICE_ERROR The function should not be completed due to a device error.
+**/
+EFI_STATUS
+EFIAPI
+PeiAmtReportStatusCode (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_AMT_STATUS_CODE_PPI * This,
+ IN EFI_STATUS_CODE_TYPE Type,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN EFI_GUID * CallerId OPTIONAL,
+ IN EFI_STATUS_CODE_DATA * Data OPTIONAL
+ )
+;
+
+/**
+ Sends a POST packet across ASF
+
+ @param[in] PeiServices General purpose services available to every PEIM.
+ @param[in] MessageType POST Status Code
+
+ @retval EFI_SUCCESS The function completed successfully
+**/
+EFI_STATUS
+SendPostPacket (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_FRAMEWORK_MESSAGE_TYPE MessageType
+ )
+;
+
+/**
+ This routine saves current ForcePush ErrorEvent to Hob, which will be sent again.
+
+ @param[in] PeiServices PeiServices pointer.
+ @param[in] MessageType ASF PET message type.
+
+ @retval EFI_SUCCESS The function completed successfully
+**/
+EFI_STATUS
+SaveForcePushErrorEvent (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_FRAMEWORK_MESSAGE_TYPE MessageType
+ )
+;
+
+/**
+ This routine puts PET message to MessageQueue, which will be sent later.
+
+ @param[in] PeiServices PeiServices pointer.
+ @param[in] Type StatusCode message type.
+ @param[in] Value StatusCode message value.
+
+ @retval EFI_SUCCESS The function completed successfully
+**/
+EFI_STATUS
+QueuePetMessage (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_STATUS_CODE_TYPE Type,
+ IN EFI_STATUS_CODE_VALUE Value
+ )
+;
+
+/**
+ This routine sends PET message in MessageQueue.
+
+ @param[in] PeiServices PeiServices pointer.
+
+ @retval EFI_SUCCESS The function completed successfully
+ @retval EFI_NOT_READY No controller
+**/
+EFI_STATUS
+SendPETMessageInQueue (
+ IN EFI_PEI_SERVICES **PeiServices
+ )
+;
+#endif
diff --git a/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.inf b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.inf
new file mode 100644
index 0000000..8bd8d0f
--- /dev/null
+++ b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.inf
@@ -0,0 +1,93 @@
+## @file
+# Component description file for Alert Standard Format driver.
+#
+#@copyright
+# Copyright (c) 2005 - 2013 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.
+#
+# 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
+#
+
+[defines]
+BASE_NAME = AlertStandardFormatPei
+FILE_GUID = 3e4817fd-2742-4351-b59f-91493280329c
+COMPONENT_TYPE = PE32_PEIM
+
+[sources.common]
+ AlertStandardFormatPei.c
+ AlertStandardFormatPei.h
+
+#
+# Edk II Glue Driver Entry Point
+#
+ EdkIIGluePeimEntryPoint.c
+
+[libraries.common]
+ PeiLib
+ AmtLibPei
+ MeGuidLib
+ MeLibPpi
+ EdkIIGlueBaseIoLibIntrinsic
+ EdkIIGluePeiDebugLibReportStatusCode
+ EdkIIGluePeiReportStatusCodeLib
+ EdkIIGluePeiServicesLib
+ EdkIIGlueBasePciLibPciExpress
+ EdkIIGlueBasePciExpressLib
+ EdkIIGluePeiHobLib
+
+[includes.common]
+ $(EDK_SOURCE)/Foundation/library/Pei/Include
+ $(EDK_SOURCE)/Foundation
+ $(EDK_SOURCE)/Foundation/Framework
+ $(EDK_SOURCE)/Foundation/Efi
+ $(EDK_SOURCE)/Foundation/Include
+ $(EDK_SOURCE)/Foundation/Efi/Include
+ $(EDK_SOURCE)/Foundation/Framework/Include
+ $(EDK_SOURCE)/Foundation/Library/Pei
+ $(EFI_SOURCE)/$(PROJECT_ME_ROOT)
+ $(EFI_SOURCE)/$(PROJECT_ME_ROOT)/ActiveManagement/AlertStandardFormat/Heci/Common
+ $(EFI_SOURCE)/$(PROJECT_ME_ROOT)/Library/AMT/Pei
+ $(EFI_SOURCE)/$(PROJECT_ME_ROOT)/Library/MeKernel/Pei
+ $(EFI_SOURCE)/$(PROJECT_ME_ROOT)/Library/MeKernel/Include
+
+#
+# Typically the sample code referenced will be available in the code base already
+# So keep this include at the end to defer to the source base definition
+# and only use the sample code definition if source base does not include these files.
+#
+ $(EFI_SOURCE)/$(PROJECT_ME_ROOT)/SampleCode/Include
+
+#
+# Edk II Glue Library, some hearder are included by R9 header so have to include
+#
+ $(EFI_SOURCE)
+ $(EFI_SOURCE)/Framework
+ $(EDK_SOURCE)/Foundation
+ $(EDK_SOURCE)/Foundation/Framework
+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
+ $(EDK_SOURCE)/Foundation/Core/Dxe
+ $(EDK_SOURCE)/Foundation/Include/Pei
+ $(EDK_SOURCE)/Foundation/Library/Dxe/Include
+ $(EDK_SOURCE)/Foundation/Library/EdkIIGlueLib/Include
+
+[nmake.common]
+ IMAGE_ENTRY_POINT = _ModuleEntryPoint
+ DPX_SOURCE = AlertStandardFormatPei.dxs
+#
+# Module Entry Point
+#
+ C_FLAGS = $(C_FLAGS) -D __EDKII_GLUE_MODULE_ENTRY_POINT__=AlertStandardFormatDriverPeiEntryPoint
+ C_FLAGS = $(C_FLAGS) -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__
diff --git a/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.mak b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.mak
new file mode 100644
index 0000000..8ff971a
--- /dev/null
+++ b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.mak
@@ -0,0 +1,50 @@
+# MAK file for the ModulePart:AlertStandardFormat
+all : AlertStandardFormatPei
+
+AlertStandardFormatPei : $(BUILD_DIR)\AlertStandardFormatPei.mak AlertStandardFormatPeiBin
+
+$(BUILD_DIR)\AlertStandardFormatPei.mak : $(AlertStandardFormatPei_DIR)\$(@B).cif $(AlertStandardFormatPei_DIR)\$(@B).mak $(BUILD_RULES)
+ $(CIF2MAK) $(AlertStandardFormatPei_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS)
+
+AlertStandardFormatPei_INCLUDES=\
+ $(EDK_INCLUDES)\
+ $(EdkIIGlueLib_INCLUDES)\
+ $(ME_INCLUDES)\
+ $(AlertStandardFormat_INCLUDES)\
+ $(IndustryStandard_INCLUDES)\
+
+AlertStandardFormatPei_LIBS=\
+ $(EDKPROTOCOLLIB)\
+ $(MeGuidLib_LIB)\
+ $(MeLibPpi_LIB)\
+ $(AmtLibPei_LIB)\
+ $(EdkIIGlueBaseLib_LIB)\
+ $(EdkIIGlueBaseMemoryLib_LIB)\
+ $(EdkIIGlueBaseLibIA32_LIB)\
+ $(EdkIIGlueBaseMemoryLib_LIB)\
+ $(EdkIIGluePeiDebugLibReportStatusCode_LIB)\
+ $(EdkIIGluePeiReportStatusCodeLib_LIB)\
+ $(EdkIIGluePeiServicesLib_LIB)\
+ $(EdkIIGluePeiHobLib_LIB)\
+
+AlertStandardFormatPei_DEFINES=\
+ $(MY_DEFINES)\
+ /D"__EDKII_GLUE_MODULE_ENTRY_POINT__=AlertStandardFormatDriverPeiEntryPoint"\
+ /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__ \
+
+AlertStandardFormatPeiBin : $(AlertStandardFormatPei_LIBS)
+ $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\
+ /f $(BUILD_DIR)\AlertStandardFormatPei.mak all\
+ "MY_INCLUDES=$(AlertStandardFormatPei_INCLUDES)"\
+ "MY_DEFINES=$(AlertStandardFormatPei_DEFINES)"\
+ GUID=3e4817fd-2742-4351-b59f-91493280329c \
+ ENTRY_POINT=_ModuleEntryPoint \
+ EDKIIModule=PEIM\
+ TYPE=PEIM \
+ DEPEX1=$(AlertStandardFormatPei_DIR)\AlertStandardFormatPei.dxs \
+ DEPEX1_TYPE=EFI_SECTION_PEI_DEPEX \
+ COMPRESS=0
diff --git a/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.sdl b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.sdl
new file mode 100644
index 0000000..ec7b2cd
--- /dev/null
+++ b/ReferenceCode/ME/ActiveManagement/AlertStandardFormat/Heci/Pei/AlertStandardFormatPei.sdl
@@ -0,0 +1,25 @@
+TOKEN
+ Name = AlertStandardFormatPei_SUPPORT
+ Value = 1
+ TokenType = Boolean
+ TargetEQU = Yes
+ TargetMAK = Yes
+ Master = Yes
+ Help = "Main switch to enable AlertStandardFormat support in Project"
+End
+
+MODULE
+ Help = "Includes AlertStandardFormat.mak to Project"
+ File = "AlertStandardFormatPei.mak"
+End
+
+PATH
+ Name = "AlertStandardFormatPei_DIR"
+ Help = "AlertStandardFormatPei files source directory"
+End
+
+ELINK
+ Name = "$(BUILD_DIR)\AlertStandardFormatPei.ffs"
+ Parent = "FV_BB"
+ InvokeOrder = AfterParent
+End