summaryrefslogtreecommitdiff
path: root/Board/EM/MeWrapper/MdesStatusCode
diff options
context:
space:
mode:
authorraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
committerraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
commitb7c51c9cf4864df6aabb99a1ae843becd577237c (patch)
treeeebe9b0d0ca03062955223097e57da84dd618b9a /Board/EM/MeWrapper/MdesStatusCode
downloadzprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'Board/EM/MeWrapper/MdesStatusCode')
-rw-r--r--Board/EM/MeWrapper/MdesStatusCode/MdesStatusCode.cif10
-rw-r--r--Board/EM/MeWrapper/MdesStatusCode/MdesStatusCode.mak89
-rw-r--r--Board/EM/MeWrapper/MdesStatusCode/MdesStatusCode.sdl31
-rw-r--r--Board/EM/MeWrapper/MdesStatusCode/MdesStatusCodeDxe.c206
4 files changed, 336 insertions, 0 deletions
diff --git a/Board/EM/MeWrapper/MdesStatusCode/MdesStatusCode.cif b/Board/EM/MeWrapper/MdesStatusCode/MdesStatusCode.cif
new file mode 100644
index 0000000..8acdb06
--- /dev/null
+++ b/Board/EM/MeWrapper/MdesStatusCode/MdesStatusCode.cif
@@ -0,0 +1,10 @@
+<component>
+ name = "MdesStatusCode"
+ category = ModulePart
+ LocalRoot = "Board\EM\MeWrapper\MdesStatusCode"
+ RefName = "MdesStatusCode"
+[files]
+"MdesStatusCode.sdl"
+"MdesStatusCode.mak"
+"MdesStatusCodeDxe.c"
+<endComponent>
diff --git a/Board/EM/MeWrapper/MdesStatusCode/MdesStatusCode.mak b/Board/EM/MeWrapper/MdesStatusCode/MdesStatusCode.mak
new file mode 100644
index 0000000..ed2a77b
--- /dev/null
+++ b/Board/EM/MeWrapper/MdesStatusCode/MdesStatusCode.mak
@@ -0,0 +1,89 @@
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (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/MdesStatusCode/MdesStatusCode.mak 1 7/27/12 5:12a Klzhan $
+#
+# $Revision: 1 $
+#
+# $Date: 7/27/12 5:12a $
+#**********************************************************************
+# Revision History
+# ----------------
+# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/MdesStatusCode/MdesStatusCode.mak $
+#
+# 1 7/27/12 5:12a Klzhan
+# [TAG] EIPNone
+# [Category] New Feature
+# [Description] Add support MDES
+# [Files] MdesStatusCode.cif
+# MdesStatusCode.sdl
+# MdesStatusCode.mak
+# MdesStatusCodeDxe.c
+#
+# 2 12/08/11 3:29a Klzhan
+# [TAG] EIPNone
+# [Category] Improvement
+# [Description] Fix build error when AMT disabled.
+#
+# 1 10/19/11 9:06a Calvinchen
+# [TAG] EIPNone
+# [Category] New Feature
+# [Description] Added MDES BIOS Status Code Support.
+# [Files] MdesStatusCode.cif
+# MdesStatusCode.sdl
+# MdesStatusCode.mak
+# MdesStatusCodeDxe.c
+#
+#
+#**********************************************************************
+#
+#<AMI_FHDR_START>
+#---------------------------------------------------------------------------
+# Name: MeStatusCode.mak
+#
+# Description: AMT Status Code Makfile.
+#
+#---------------------------------------------------------------------------
+#<AMI_FHDR_END>
+
+#---------------------------------------------------------------------------
+# AMT StatusCode for DXE
+#---------------------------------------------------------------------------
+MdesStatusCodeIncludes =\
+ /I$(MeProtocolLib_DIR)\MePlatformPolicy \
+ $(ME_INCLUDES)\
+ /I$(MdesStatusCodeDrv_DIR)
+
+CORE_DXEBin : $(BUILD_DIR)\$(STATUS_CODE_DIR)\MdesStatusCodeDxe.obj
+
+$(BUILD_DIR)\$(STATUS_CODE_DIR)\MdesStatusCodeDxe.obj : $(MdesStatusCode_DIR)\MdesStatusCodeDxe.c
+ $(CC) $(CFLAGS:/W4=/W3) /DTIANO_RELEASE_VERSION=0x00080006 $(MdesStatusCodeIncludes) /DDXE_STATUS_CODE $(AlertStandardFormatDxe_INCLUDES) $(EDK_INCLUDES) $(STATUS_CODE_INCLUDES) /Fo$(BUILD_DIR)\$(STATUS_CODE_DIR)\MdesStatusCodeDxe.obj $(MdesStatusCode_DIR)\MdesStatusCodeDxe.c
+
+RUNTIMEBin : $(BUILD_DIR)\$(STATUS_CODE_DIR)\MdesStatusCodeRuntime.obj
+$(BUILD_DIR)\$(STATUS_CODE_DIR)\MdesStatusCodeRuntime.obj : $(MdesStatusCode_DIR)\MdesStatusCodeDxe.c
+ $(CC) $(CFLAGS:/W4=/W3) /DTIANO_RELEASE_VERSION=0x00080006 $(EDK_INCLUDES) $(STATUS_CODE_INCLUDES) /Fo$(BUILD_DIR)\$(STATUS_CODE_DIR)\MdesStatusCodeRuntime.obj $(MdesStatusCode_DIR)\MdesStatusCodeDxe.c
+
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2011, 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/MdesStatusCode/MdesStatusCode.sdl b/Board/EM/MeWrapper/MdesStatusCode/MdesStatusCode.sdl
new file mode 100644
index 0000000..d936706
--- /dev/null
+++ b/Board/EM/MeWrapper/MdesStatusCode/MdesStatusCode.sdl
@@ -0,0 +1,31 @@
+TOKEN
+ Name = "MdesStatusCode_SUPPORT"
+ Value = "1"
+ Help = "Main switch to enable MeStatusCode support in Project"
+ TokenType = Boolean
+ TargetH = Yes
+ TargetMAK = Yes
+ Master = Yes
+End
+
+PATH
+ Name = "MdesStatusCode_DIR"
+End
+
+MODULE
+ Help = "Includes MdesStatusCode.mak to Project"
+ File = "MdesStatusCode.mak"
+End
+
+ELINK
+ Name = "DXE(MdesBiosStatusCode),"
+ Parent = "ReportMiscStatus"
+ InvokeOrder = AfterParent
+End
+
+ELINK
+ Name = "DXE(MdesBiosStatusCodeInit),"
+ Parent = "StatusCodeInitialize"
+ InvokeOrder = AfterParent
+End
+
diff --git a/Board/EM/MeWrapper/MdesStatusCode/MdesStatusCodeDxe.c b/Board/EM/MeWrapper/MdesStatusCode/MdesStatusCodeDxe.c
new file mode 100644
index 0000000..3f46c3e
--- /dev/null
+++ b/Board/EM/MeWrapper/MdesStatusCode/MdesStatusCodeDxe.c
@@ -0,0 +1,206 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, 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/MdesStatusCode/MdesStatusCodeDxe.c 1 7/27/12 5:12a Klzhan $
+//
+// $Revision: 1 $
+//
+// $Date: 7/27/12 5:12a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ME/MeWrapper/MdesStatusCode/MdesStatusCodeDxe.c $
+//
+// 1 7/27/12 5:12a Klzhan
+// [TAG] EIPNone
+// [Category] New Feature
+// [Description] Add support MDES
+// [Files] MdesStatusCode.cif
+// MdesStatusCode.sdl
+// MdesStatusCode.mak
+// MdesStatusCodeDxe.c
+//
+// 1 10/19/11 9:06a Calvinchen
+// [TAG] EIPNone
+// [Category] New Feature
+// [Description] Added MDES BIOS Status Code Support.
+// [Files] MdesStatusCode.cif
+// MdesStatusCode.sdl
+// MdesStatusCode.mak
+// MdesStatusCodeDxe.c
+//
+//
+//**********************************************************************
+//
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+// Name: MdesStatusCodeDxe.c
+//
+// Description: Processes ASF messages for DXE.
+//
+//---------------------------------------------------------------------------
+//<AMI_FHDR_END>
+/*++
+
+Copyright (c) 2009 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:
+
+ AmtStatusCodeDxe.c
+
+Abstract:
+ Processes ASF messages
+
+--*/
+
+//#include "Tiano.h"
+#include <AmiDxeLib.h>
+#ifdef DXE_STATUS_CODE
+#include <AmiDxeLib.h>
+#include <token.h>
+#include <Setup.h>
+#include "MePlatformPolicy.h"
+#include "MdesStatusCodeDxe.h"
+EFI_GUID gSetupGuid = SETUP_GUID;
+EFI_GUID gMdesStatusCodeProtocolGuid = MDES_STATUS_CODE_PROTOCOL_GUID;
+EFI_GUID gDxePlatformMePolicyGuid = DXE_PLATFORM_ME_POLICY_GUID;
+extern EFI_BOOT_SERVICES *pBS;
+#endif
+
+VOID MdesBiosStatusCode(
+ IN VOID **Dummy,
+ 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
+)
+/*++
+Routine Description:
+
+ Provides an interface that a software module can call to report an ASF DXE status code.
+
+Arguments:
+
+ PeiServices - PeiServices pointer.
+
+ Type - Indicates the type of status code being reported.
+
+ 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.
+
+ Instance - The enumeration of a hardware or software entity within
+ the system. Valid instance numbers start with 1.
+
+ 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.
+
+ Data - This optional parameter may be used to pass additional data.
+
+Returns:
+
+ None
+
+--*/
+{
+#ifdef DXE_STATUS_CODE
+ //
+ // Do nothing, because AMT ASF driver will handle that.
+ //
+ EFI_STATUS Status;
+ MDES_STATUS_CODE_PROTOCOL *MdesStatusCodeProtocol;
+ static UINTN MdesEnable = 0;
+ static UINTN MdesEnableChecked = 0;
+ DXE_ME_POLICY_PROTOCOL *MePlatformPolicy;
+
+ if (MdesEnableChecked == 0) {
+ Status = pBS->LocateProtocol (&gDxePlatformMePolicyGuid, NULL, &MePlatformPolicy);
+ if (EFI_ERROR(Status)) {
+ //
+ // Check if GetVariable function has been initialized
+ //
+ return;
+ } else {
+ MdesEnableChecked = 1;
+ //
+ // set gfMDESCheck to 1 to lock geting variable next time
+ //
+ if (!(EFI_ERROR (Status))) {
+ if (MePlatformPolicy->MeConfig.MdesForBiosState == 1) {
+ //
+ // check if function is set in BIOS Menu
+ //
+ MdesEnable = 1;
+ }
+ }
+ }
+ }
+ if (MdesEnable == 1) {
+ Status = pBS->LocateProtocol (&gMdesStatusCodeProtocolGuid, NULL, &MdesStatusCodeProtocol);
+ if (EFI_ERROR (Status)) {
+ return;
+ }
+
+ MdesStatusCodeProtocol->SendMdesStatusCode (Type, Value, Instance, CallerId, Data);
+ }
+#endif
+ return ;
+}
+
+EFI_STATUS
+MdesBiosStatusCodeInit(
+ IN EFI_HANDLE *ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+)
+/*++
+Routine Description:
+
+ Init routine for DXE ASF StatusCode.
+
+Arguments:
+
+ FfsHeader - FfsHeader pointer.
+ PeiServices - PeiServices pointer.
+
+Returns:
+
+ EFI_SUCCESS - The function completed successfully
+
+--*/
+{
+ return EFI_SUCCESS;
+}
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************