diff options
author | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
---|---|---|
committer | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
commit | b7c51c9cf4864df6aabb99a1ae843becd577237c (patch) | |
tree | eebe9b0d0ca03062955223097e57da84dd618b9a /ReferenceCode/ME/Protocol | |
download | zprj-master.tar.xz |
Diffstat (limited to 'ReferenceCode/ME/Protocol')
37 files changed, 2817 insertions, 0 deletions
diff --git a/ReferenceCode/ME/Protocol/ActiveManagement/ActiveManagement.c b/ReferenceCode/ME/Protocol/ActiveManagement/ActiveManagement.c new file mode 100644 index 0000000..521426b --- /dev/null +++ b/ReferenceCode/ME/Protocol/ActiveManagement/ActiveManagement.c @@ -0,0 +1,46 @@ +/** @file + Defines and prototypes for the ActiveManagement driver. + This driver implements the ActiveManagement protocol for iAMT. + It provides some functions to get Boot Options from ASF. + +@copyright + Copyright (c) 2004 - 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 +**/ + +// +// Statements that include other files +// +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +// +// Include the protocol header file +// +#include EFI_PROTOCOL_DEFINITION (ActiveManagement) +#endif +// +// Protocol GUID definition +// +EFI_GUID gEfiActiveManagementProtocolGuid = EFI_ACTIVE_MANAGEMENT_PROTOCOL_GUID; + +// +// Protocol description +// +EFI_GUID_STRING( + &gEfiActiveManagementProtocolGuid, "Active Management Protocol", "The active management protocol provides services." + ); diff --git a/ReferenceCode/ME/Protocol/ActiveManagement/ActiveManagement.h b/ReferenceCode/ME/Protocol/ActiveManagement/ActiveManagement.h new file mode 100644 index 0000000..17a5045 --- /dev/null +++ b/ReferenceCode/ME/Protocol/ActiveManagement/ActiveManagement.h @@ -0,0 +1,140 @@ +/** @file + Active Management Technology Protocol to return the state of ASF Boot Options + related to Active Management Technology. + +@copyright + Copyright (c) 2005 - 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 +**/ +#ifndef _EFI_ACTIVE_MANAGEMENT_PROTOCOL_H_ +#define _EFI_ACTIVE_MANAGEMENT_PROTOCOL_H_ + +#include EFI_PROTOCOL_DEFINITION (AlertStandardFormat) + +/// +/// Intel Active Management Technology Protocol +/// This protocol provides interface to get ASF boot options status +/// +#define EFI_ACTIVE_MANAGEMENT_PROTOCOL_GUID \ + { \ + 0x8555fd40, 0x140b, 0x4f3c, 0x90, 0x5e, 0x3b, 0xf3, 0x78, 0xa0, 0x99, 0xfa \ + } + +// +// Extern the GUID for protocol users. +// +extern EFI_GUID gEfiActiveManagementProtocolGuid; + +// +// Forward reference for ANSI C compatibility +// +EFI_FORWARD_DECLARATION (EFI_ACTIVE_MANAGEMENT_PROTOCOL); + +// +// Protocol definitions +// + +/** + Return current state of Boot Options + @param[in] This Pointer to the EFI_ACTIVE_MANAGEMENT_PROTOCOL instance. + @param[in] CurrentState TRUE when the boot options is enabled + + @retval EFI_SUCCESS Command succeed. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ACTIVE_MANAGEMENT_BOOT_OPTIONS_STATE) ( + IN EFI_ACTIVE_MANAGEMENT_PROTOCOL *This, + IN OUT BOOLEAN *CurrentState + ) +; + +/** + This will return IDE Redirection boot device to boot + + @param[in] IdeBootDevice Return the boot device number to boot + Bits 0-1: If IDER boot is selected in Perimeter 1 then + Bits 1,2 define the drive on the IDER controller to be used as the + boot driver. + Bit 1 Bit0 + 0 0 Primary Master Drive + 0 1 Primary Slave Drive + 1 0 Secondary Master Drive + 1 1 Secondary Slave Drive + Bits 2-7: Reserved set to 0 + + @retval EFI_SUCCESS The function completed successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ACTIVE_MANAGEMENT_IDER_BOOT_DEVICE_SELECTED) ( + IN EFI_ACTIVE_MANAGEMENT_PROTOCOL *This, + IN OUT UINT8 *IdeBootDevice + ) +; + +/** + Return current ASF Boot Options + + @param[in] This Pointer to the EFI_ACTIVE_MANAGEMENT_PROTOCOL instance. + @param[in] AsfBootOptions ASF Boot Options + + @retval EFI_SUCCESS Command succeed. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ACTIVE_MANAGEMENT_ASF_BOOT_OPTIONS_GET) ( + IN EFI_ACTIVE_MANAGEMENT_PROTOCOL *This, + IN OUT EFI_ASF_BOOT_OPTIONS **AsfBootOptions + ) +; + +/** + This will return verbosity request option + + @param[in] CurrentState Return the state of verbosity option + + @retval EFI_SUCCESS The function completed successfully. + @retval CurrentState 00 - No BootOption available + 01 - Non-Verbosity request + 02 - Verbosity request +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ACTIVE_MANAGEMENT_VERBOSITY_REQUESTED) ( + IN EFI_ACTIVE_MANAGEMENT_PROTOCOL *This, + IN OUT UINT8 *CurrentState + ) +; + +/// +/// Intel Active Management Technology Protocol +/// It provides abstract level function of ASF boot options defined in ASF 2.0 specification for +/// other modules to get ASF boot options status. +/// +struct _EFI_ACTIVE_MANAGEMENT_PROTOCOL { + EFI_ACTIVE_MANAGEMENT_BOOT_OPTIONS_STATE GetIderState; + EFI_ACTIVE_MANAGEMENT_BOOT_OPTIONS_STATE GetEnforceSecureBootState; + EFI_ACTIVE_MANAGEMENT_BOOT_OPTIONS_STATE GetSolState; + EFI_ACTIVE_MANAGEMENT_BOOT_OPTIONS_STATE GetRemoteFlashState; + EFI_ACTIVE_MANAGEMENT_BOOT_OPTIONS_STATE GetBiosSetupState; + EFI_ACTIVE_MANAGEMENT_BOOT_OPTIONS_STATE GetBiosPauseState; + EFI_ACTIVE_MANAGEMENT_BOOT_OPTIONS_STATE GetConsoleLockState; + EFI_ACTIVE_MANAGEMENT_BOOT_OPTIONS_STATE GetKvmState; + EFI_ACTIVE_MANAGEMENT_IDER_BOOT_DEVICE_SELECTED GetIderBootDeviceSelectd; + EFI_ACTIVE_MANAGEMENT_ASF_BOOT_OPTIONS_GET GetAsfBootOptions; + EFI_ACTIVE_MANAGEMENT_BOOT_OPTIONS_STATE GetProgressMsgRequest; +}; + +#endif diff --git a/ReferenceCode/ME/Protocol/AlertStandardFormat/AlertStandardFormat.c b/ReferenceCode/ME/Protocol/AlertStandardFormat/AlertStandardFormat.c new file mode 100644 index 0000000..256fed5 --- /dev/null +++ b/ReferenceCode/ME/Protocol/AlertStandardFormat/AlertStandardFormat.c @@ -0,0 +1,32 @@ +/** @file + Definition of Alert Standard Format (ASF) 2.0 + +@copyright + Copyright (c) 2005 - 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 +**/ + +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +#include EFI_PROTOCOL_DEFINITION (AlertStandardFormat) +#endif + +EFI_GUID gEfiAlertStandardFormatProtocolGuid = EFI_ALERT_STANDARD_FORMAT_PROTOCOL_GUID; + +EFI_GUID_STRING + (&gEfiAlertStandardFormatProtocolGuid, "Alert Standard Format Protocol", "Alert Standard Format Protocol"); diff --git a/ReferenceCode/ME/Protocol/AlertStandardFormat/AlertStandardFormat.h b/ReferenceCode/ME/Protocol/AlertStandardFormat/AlertStandardFormat.h new file mode 100644 index 0000000..3d4bf3b --- /dev/null +++ b/ReferenceCode/ME/Protocol/AlertStandardFormat/AlertStandardFormat.h @@ -0,0 +1,185 @@ +/** @file + Definition of Alert Standard Format (ASF) 2.0 + +@copyright + Copyright (c) 2005 - 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 +**/ +#ifndef __ALERT_STANDARD_FORMAT_PROTOCOL_H__ +#define __ALERT_STANDARD_FORMAT_PROTOCOL_H__ + +/// +/// Alert Standard Format Protocol +/// This protocol provides interfaces to get ASF Boot Options and send ASF messages +/// +#define EFI_ALERT_STANDARD_FORMAT_PROTOCOL_GUID \ + { \ + 0xcc93a70b, 0xec27, 0x49c5, 0x8b, 0x34, 0x13, 0x93, 0x1e, 0xfe, 0xd6, 0xe2 \ + } + +typedef struct _EFI_ALERT_STANDARD_FORMAT_PROTOCOL EFI_ALERT_STANDARD_FORMAT_PROTOCOL; + +#pragma pack(1) +typedef struct { + UINT8 SubCommand; + UINT8 Version; + UINT32 IanaId; + UINT8 SpecialCommand; + UINT16 SpecialCommandParam; + UINT16 BootOptions; + UINT16 OemParameters; +} EFI_ASF_BOOT_OPTIONS; + +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; + +typedef struct { + UINT8 SubCommand; + UINT8 Version; +} EFI_ASF_CLEAR_BOOT_OPTIONS; +#pragma pack() +// +// Special Command Attributes +// +#define NOP 0x00 +#define FORCE_PXE 0x01 +#define FORCE_HARDDRIVE 0x02 +#define FORCE_SAFEMODE 0x03 +#define FORCE_DIAGNOSTICS 0x04 +#define FORCE_CDDVD 0x05 + +// +// Boot Options Mask +// +#define LOCK_POWER_BUTTON 0x0002 ///< 0000 0000 0000 0010 - bit 1 +#define LOCK_RESET_BUTTON 0x0004 ///< 0000 0000 0000 0200 - bit 2 +#define LOCK_KEYBOARD 0x0020 ///< 0000 0000 0010 0000 - bit 5 +#define LOCK_SLEEP_BUTTON 0x0040 ///< 0000 0000 0100 0000 - bit 6 +#define USER_PASSWORD_BYPASS 0x0800 ///< 0000 1000 0000 0000 - bit 3 +#define FORCE_PROGRESS_EVENTS 0x1000 ///< 0001 0000 0000 0000 - bit 4 +#define FIRMWARE_VERBOSITY_DEFAULT 0x0000 ///< 0000 0000 0000 0000 - bit 6:5 +#define FIRMWARE_VERBOSITY_QUIET 0x2000 ///< 0010 0000 0000 0000 - bit 6:5 +#define FIRMWARE_VERBOSITY_VERBOSE 0x4000 ///< 0100 0000 0000 0000 - bit 6:5 +#define FIRMWARE_VERBOSITY_BLANK 0x6000 ///< 0110 0000 0000 0000 - bit 6:5 +#define CONFIG_DATA_RESET 0x8000 ///< 1000 0000 0000 0000 - bit 7 +#define ASF_BOOT_OPTIONS_PRESENT 0x16 +#define ASF_BOOT_OPTIONS_NOT_PRESENT 0x17 + +#define USE_KVM 0x0020 ///< 0000 0000 0010 0000 - bit 5 +/// +/// ASF Internet Assigned Numbers Authority Manufacturer ID +/// (The firmware sends 0XBE110000 for decimal value 4542) +/// +#define INDUSTRY_IANA_SWAP32(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) | \ + (((x) & 0xff0000) >> 8) | (((x) & 0xff000000) >> 24)) +#define ASF_INDUSTRY_IANA 0x000011BE +#define ASF_INDUSTRY_CONVERTED_IANA INDUSTRY_IANA_SWAP32 (ASF_INDUSTRY_IANA) ///< 0XBE110000, received from ME FW + +/** + Return the SMBus address used by the ASF driver. + Not applicable in Intel ME/HECI system, need to return EFI_UNSUPPORTED. + + @retval EFI_SUCCESS Address returned + @retval EFI_INVALID_PARAMETER Invalid SMBus address +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ALERT_STANDARD_FORMAT_PROTOCOL_GET_SMBUSADDR) ( + IN EFI_ALERT_STANDARD_FORMAT_PROTOCOL *This, + OUT UINTN *SmbusDeviceAddress + ) +; + +/** + Set the SMBus address used by the ASF driver. 0 is an invalid address. + Not applicable in Intel ME/HECI system, need to return EFI_UNSUPPORTED. + + @param[in] SmbusAddr SMBus address of the controller + + @retval EFI_SUCCESS Address set + @retval EFI_INVALID_PARAMETER Invalid SMBus address +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ALERT_STANDARD_FORMAT_PROTOCOL_SET_SMBUSADDR) ( + IN EFI_ALERT_STANDARD_FORMAT_PROTOCOL *This, + IN UINTN SmbusDeviceAddress + ) +; + +/** + Return the ASF Boot Options obtained from the controller. If the + Boot Options parameter is NULL and no boot options have been retrieved, + Query the ASF controller for its boot options. + Get ASF Boot Options through HECI. + + @param[in] AsfBootOptions Pointer to ASF boot options to copy current ASF Boot options + + @retval EFI_SUCCESS Boot options copied + @retval EFI_NOT_READY No boot options +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ALERT_STANDARD_FORMAT_PROTOCOL_GET_BOOT_OPTIONS) ( + IN EFI_ALERT_STANDARD_FORMAT_PROTOCOL *This, + IN OUT EFI_ASF_BOOT_OPTIONS **AsfBootOptions + ) +; + +/** + Send ASF Message. + Send ASF Message through HECI. + + @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 +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ALERT_STANDARD_FORMAT_PROTOCOL_SEND_ASF_MESSAGE) ( + IN EFI_ALERT_STANDARD_FORMAT_PROTOCOL *This, + IN EFI_ASF_MESSAGE *AsfMessage + ) +; + +/// +/// Alert Standard Format Protocol +/// This protocol provides interfaces to get ASF Boot Options and send ASF messages +/// HECI protocol is consumed and used to send ASF messages and receive ASF Boot Options +/// +struct _EFI_ALERT_STANDARD_FORMAT_PROTOCOL { + EFI_ALERT_STANDARD_FORMAT_PROTOCOL_GET_SMBUSADDR GetSmbusAddr; + EFI_ALERT_STANDARD_FORMAT_PROTOCOL_SET_SMBUSADDR SetSmbusAddr; + EFI_ALERT_STANDARD_FORMAT_PROTOCOL_GET_BOOT_OPTIONS GetBootOptions; + EFI_ALERT_STANDARD_FORMAT_PROTOCOL_SEND_ASF_MESSAGE SendAsfMessage; +}; + +extern EFI_GUID gEfiAlertStandardFormatProtocolGuid; + +#endif diff --git a/ReferenceCode/ME/Protocol/AmtPlatformPolicy/AmtPlatformPolicy.c b/ReferenceCode/ME/Protocol/AmtPlatformPolicy/AmtPlatformPolicy.c new file mode 100644 index 0000000..f947dfc --- /dev/null +++ b/ReferenceCode/ME/Protocol/AmtPlatformPolicy/AmtPlatformPolicy.c @@ -0,0 +1,44 @@ +/** @file + This file defines the EFI AMT policy Protocol which implements the + Intel(R) Active Management Technology + +@copyright + Copyright (c) 2006 - 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 +**/ + +// +// Statements that include other files +// +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +// +// Include the protocol header file +// +#include EFI_PROTOCOL_DEFINITION (AmtPlatformPolicy) +#endif +// +// Protocol GUID definition +// +EFI_GUID gDxePlatformAmtPolicyGuid = DXE_PLATFORM_AMT_POLICY_GUID; + +// +// Protocol description +// +EFI_GUID_STRING + (&gDxePlatformAmtPolicyGuid, "AmtPlatformPolicy Protocol", "Intel(R) DXE Phase AMT Platform Policy Protocol"); diff --git a/ReferenceCode/ME/Protocol/AmtPlatformPolicy/AmtPlatformPolicy.h b/ReferenceCode/ME/Protocol/AmtPlatformPolicy/AmtPlatformPolicy.h new file mode 100644 index 0000000..bfc98ff --- /dev/null +++ b/ReferenceCode/ME/Protocol/AmtPlatformPolicy/AmtPlatformPolicy.h @@ -0,0 +1,111 @@ +/** @file + Interface definition details between AMT and platform drivers during DXE phase. + +@copyright + Copyright (c) 2006 - 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 +**/ +#ifndef _AMT_PLATFORM_POLICY_H_ +#define _AMT_PLATFORM_POLICY_H_ + +/// +/// AMT policy provided by platform for DXE phase +/// This protocol provides the information about Intel AMT platform configuration settings. +/// +#define DXE_PLATFORM_AMT_POLICY_GUID \ + { \ + 0x6725e645, 0x4a7f, 0x9969, 0x82, 0xec, 0xd1, 0x87, 0x21, 0xde, 0x5a, 0x57 \ + } + +/// +/// Protocol revision number +/// Any backwards compatible changes to this protocol will result in an update in the revision number +/// Major changes will require publication of a new protocol +/// +#define DXE_PLATFORM_AMT_POLICY_PROTOCOL_REVISION_1 1 ///< Initial Revision + +extern EFI_GUID gDxePlatformAmtPolicyGuid; +#pragma pack(1) +typedef struct { + // + // Byte 0, bit definition for functionality enable/disable + // + UINT8 AsfEnabled : 1; ///< 0: Disabled; 1: Enabled + UINT8 iAmtEnabled : 1; ///< 0: Disabled; 1: Enabled + UINT8 iAmtbxPasswordWrite : 1; ///< 0: Disabled; 1: Enabled + UINT8 WatchDog : 1; ///< 0: Disabled; 1: Enabled + UINT8 CiraRequest : 1; ///< 0: No CIRA request; 1: Trigger CIRA request + UINT8 ManageabilityMode : 1; ///< 0: Disabled; 1:AMT + UINT8 UnConfigureMe : 1; ///< 0: No; 1: Un-configure ME without password + UINT8 MebxDebugMsg : 1; ///< 0: Disabled; 1: Enabled + // + // Byte 1, bit definition for functionality enable/disable + // + UINT8 ForcMebxSyncUp : 1; ///< 0: No; 1: Force MEBX execution + UINT8 UsbrEnabled : 1; ///< 0: Disabled; 1: Enabled + UINT8 UsbLockingEnabled : 1; ///< 0: Disabled; 1: Enabled + UINT8 HideUnConfigureMeConfirm : 1; ///< 0: Don't hide; 1: Hide Un-configure ME Confirmation Prompt + UINT8 USBProvision : 1; ///< 0: Disabled; 1: Enabled + UINT8 FWProgress : 1; ///< 0: Disabled; 1: Enabled + UINT8 iAmtbxHotkeyPressed : 1; ///< 0: Disabled; 1: Enabled + UINT8 iAmtbxSelectionScreen : 1; ///< 0: Disabled; 1: Enabled + // + // Byte 2, bit definition for functionality enable/disable + // + UINT8 AtEnabled : 1; ///< 0: Disabled; 1: Enabled + UINT8 Byte2Reserved : 7; + UINT16 WatchDogTimerOs; ///< Byte 3-4 OS WatchDog Timer + UINT16 WatchDogTimerBios; ///< Byte 5-6 BIOS WatchDog Timer + /// + /// Byte 7 CIRA Timeout: Client Initiated Remote Access Timeout + /// OEM defined timeout for MPS connection to be established. + /// 0: 60 seconds by default, 0xFF: Wait until the connection succeeds. + /// 1~0xFE: Values in seconds + /// + UINT8 CiraTimeout; + + /// + /// Byte 8 CPU Replacement Timeout + /// 0: 10 seconds; 1: 30 seconds; 2~5: Reserved; 6: No delay; 7: Unlimited delay + /// + UINT8 CpuReplacementTimeout; + // + // Byte 9-10 OemResolutionSettings + // + UINT16 MebxNonUiTextMode : 4; ///< 0: Auto; 1: 80x25; 2: 100x31 + UINT16 MebxUiTextMode : 4; ///< 0: Auto; 1: 80x25; 2: 100x31 + UINT16 MebxGraphicsMode : 4; ///< 0: Auto; 1: 640x480; 2: 800x600; 3: 1024x768 + UINT16 OemResolutionSettingsRsvd : 4; + // + // Byte 11-14 Pointer to a list which contain on-board devices bus/device/fun number + // + UINT32 PciDeviceFilterOutTable; + // + // Byte 15-23 Reserved and make AMT_CONFIG as 32 bit alignment + // + UINT8 ByteReserved[9]; +} AMT_CONFIG; + +#pragma pack() +/// +/// AMT DXE Platform Policy +/// This protocol is initialized by platform Policy driver. Other modules can locate this protocol +/// to retrieve Intel AMT related setup options setting +/// +typedef struct _DXE_AMT_POLICY_PROTOCOL { + UINT8 Revision; ///< Revision for the protocol structure + AMT_CONFIG AmtConfig; ///< AMT policy for platform code to pass to Reference Code +} DXE_AMT_POLICY_PROTOCOL; + +#endif diff --git a/ReferenceCode/ME/Protocol/AmtReadyToBoot/AmtReadyToBoot.c b/ReferenceCode/ME/Protocol/AmtReadyToBoot/AmtReadyToBoot.c new file mode 100644 index 0000000..d23795c --- /dev/null +++ b/ReferenceCode/ME/Protocol/AmtReadyToBoot/AmtReadyToBoot.c @@ -0,0 +1,31 @@ +/** @file + AmtReadyToBoot Protocol definitions + +@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 +**/ + +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +#include EFI_PROTOCOL_DEFINITION (AmtReadyToBoot) +#endif + +EFI_GUID gAmtReadyToBootProtocolGuid = AMT_READY_TO_BOOT_PROTOCOL_GUID; + +EFI_GUID_STRING(&gAmtReadyToBootProtocolGuid, "AMT ReadyToBoot Protocol", "AMT ReadyToBoot Protocol") diff --git a/ReferenceCode/ME/Protocol/AmtReadyToBoot/AmtReadyToBoot.h b/ReferenceCode/ME/Protocol/AmtReadyToBoot/AmtReadyToBoot.h new file mode 100644 index 0000000..93e784f --- /dev/null +++ b/ReferenceCode/ME/Protocol/AmtReadyToBoot/AmtReadyToBoot.h @@ -0,0 +1,56 @@ +/** @file + AmtReadyToBoot Protocol definitions + +@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 +**/ +#ifndef _AMT_READY_TO_BOOT_PROTOCOL_H_ +#define _AMT_READY_TO_BOOT_PROTOCOL_H_ + +/// +/// AMT Readt to Boot Protocol +/// This protocol performs all Management Engine task +/// +#define AMT_READY_TO_BOOT_PROTOCOL_GUID \ + { \ + 0x40b09b5a, 0xf0ef, 0x4627, 0x93, 0xd5, 0x27, 0xf0, 0x4b, 0x75, 0x4d, 0x5 \ + } + +EFI_FORWARD_DECLARATION (AMT_READY_TO_BOOT_PROTOCOL); + +/** + Signal an event for Amt ready to boot. + + @param[in] None + + @retval EFI_SUCCESS Mebx launched or no controller +**/ +typedef +EFI_STATUS +(EFIAPI *AMT_READY_TO_BOOT_PROTOCOL_SIGNAL) ( + VOID + ); + +/// +/// AMT Readt to Boot Protocol +/// The interface functions are for Performing all Management Engine task +/// +struct _AMT_READY_TO_BOOT_PROTOCOL { + AMT_READY_TO_BOOT_PROTOCOL_SIGNAL Signal; ///< Performs all Management Engine task +}; + +extern EFI_GUID gAmtReadyToBootProtocolGuid; + +#endif diff --git a/ReferenceCode/ME/Protocol/At/At.c b/ReferenceCode/ME/Protocol/At/At.c new file mode 100644 index 0000000..60a4c2c --- /dev/null +++ b/ReferenceCode/ME/Protocol/At/At.c @@ -0,0 +1,39 @@ +/** @file + Defines and prototypes for the At driver. + This driver implements the At protocol. + +@copyright + Copyright (c) 2004 - 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 +**/ + +// +// Statements that include other files +// +#include "EdkIIGlueDxe.h" + +// +// Include the protocol header file +// +#include EFI_PROTOCOL_DEFINITION (At) + +// +// Protocol GUID definition +// +EFI_GUID gEfiAtProtocolGuid = EFI_AT_PROTOCOL_GUID; + +// +// Protocol description +// +EFI_GUID_STRING(&gEfiAtProtocolGuid, "AT Protocol", "Intel (R) AT Protocol Services."); diff --git a/ReferenceCode/ME/Protocol/At/At.h b/ReferenceCode/ME/Protocol/At/At.h new file mode 100644 index 0000000..39a8dbd --- /dev/null +++ b/ReferenceCode/ME/Protocol/At/At.h @@ -0,0 +1,247 @@ +/** @file + Defines and prototypes for the AT driver. + This driver implements the AT protocol. + +@copyright + Copyright (c) 2004 - 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 _DXE_AT_PROTOCOL_H_ +#define _DXE_AT_PROTOCOL_H_ +#include "MkhiMsgs.h" +/// +/// Define the protocol GUID +/// +#define EFI_AT_PROTOCOL_GUID \ + { \ + 0x2df8cdbe, 0x79ce, 0x48a0, 0x8c, 0x59, 0x50, 0xf7, 0x1d, 0xe1, 0xad, 0xd1 \ + } + +/// +/// Protocol revision number +/// Any backwards compatible changes to this protocol will result in an update in the revision number +/// Major changes will require publication of a new protocol +/// +#define AT_PROTOCOL_REVISION 1 + +// +// Extern the GUID for protocol users. +// +extern EFI_GUID gEfiAtProtocolGuid; + +// +// Forward reference for ANSI C compatibility +// +EFI_FORWARD_DECLARATION (EFI_AT_PROTOCOL); + +// +// Protocol definitions +// + +/** + This function sends a request to ME AT Services to validate AT + recovery credentials. The user input is captured in UTF-16 + format and then passed to this funtion. This function converts + the User recovery password into a HASH by using Salt & Nonce + and then send the password HASH to ME AT Services for + validation. ME AT Service compares the Password HASH and + returns either pass or fail. + + @param[in] This The address of protocol + @param[in] PassPhrase Passphrase that needs to be authenticated sent to ME + @param[in] PassType Password type user or server generated + @param[in][out] IsAuthenticated The return of the password match 1 for success and 0 for fail + + @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures + @retval EFI_SUCCESS The function completed successfully +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_AT_AUTHETICATE_CREDENTIAL) ( + IN EFI_AT_PROTOCOL *This, + IN UINT8 *PassPhrase, + IN UINT32 *PassType, + IN OUT UINT8 *IsAuthenticated + ); + +/** + This API compute the SHA1 hash of the user enterted password + + @param[in] This The address of protocol + @param[in] PassPhrase The passphrase for which SHA1 hash to be computed + @param[in][out] Hash The return value of the SHA1 hash + + @retval EFI_SUCCESS The function completed successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_AT_COMPUTE_HASH) ( + IN EFI_AT_PROTOCOL *This, + IN UINT8 *PassPhrase, + IN OUT UINT8 *Hash + ); + +/** + This gets the ME nonce + @param[in] This The address of protocol + @param[in][out] Nonce The return value of the 16 Byte nonce received from ME + + @retval EFI_SUCCESS The function completed successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_AT_GET_NONCE) ( + IN EFI_AT_PROTOCOL *This, + IN OUT UINT8 *Nonce + ); + +/** + This API get the AT Unlock Timer values + + @param[in] This The address of protocol + @param[in] Interval The return value of the Unlock Time Interval that was set by AT Server + @param[in] TimeLeft The Timeleft in the Unlock Timer + + @retval EFI_SUCCESS The function completed successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_AT_GET_TIMER_INFO) ( + IN EFI_AT_PROTOCOL *This, + IN OUT UINT32 *Interval, + IN OUT UINT32 *TimeLeft + ); + +/** + This retrives the ISV String stored by AT Server that BIOS will display during Platform lock state + + @param[in] This The address of protocol + @param[in] StringId The String buffer ID to retrive the ISV String + @param[out] IsvString 256 Bytes of ISV string array, the + @param[out] IsvStringLength The String length + + @retval EFI_SUCCESS The function completed successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_AT_GET_RECOVERY_STRING) ( + IN EFI_AT_PROTOCOL *This, + IN UINT32 *StringId, + IN OUT UINT8 *IsvString, + IN OUT UINT32 *IsvStringLength + ); + +/** + This receives the ISV ID from ME and display the ID, when the platform is in stolen state + + @param[in] This The address of protocol + @param[out] IsvId The pointer to 4 byte ISV ID + + @retval EFI_SUCCESS The function completed successfully. +**/typedef +EFI_STATUS +(EFIAPI *EFI_AT_GET_ISV_ID) ( + IN EFI_AT_PROTOCOL *This, + IN OUT UINT32 *IsvId + ); + +/** + This instructs FW that a WWAN recovery is desired and thus the Radio needs to be initialized. + + This command in not supported. + + @param[in] This The address of protocol +**/typedef +EFI_STATUS +(EFIAPI *EFI_AT_SET_SUSPEND_STATE) ( + IN EFI_AT_PROTOCOL *This, + IN UINT32 TransitionState, + IN UINT8 *Token + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_AT_INIT_WWAN_RECOV) ( + IN EFI_AT_PROTOCOL *This + ); + +/** + This queries FW of the NIC Radio Status + + This command in not supported. + + @param[in] This The address of protocol + @param[in] RadioStatus Radio status + @param[in] NetworkStatus Network status +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_AT_GET_WWAN_NIC_STATUS) ( + IN EFI_AT_PROTOCOL *This, + IN OUT UINT8 *RadioStatus, + IN OUT UINT8 *NetworkStatus + ); + +/** + This send an AssertStolen Message to ME when OEM has set the AllowAssertStolen bit to be accepted by BIOS. + + @param[in] This The address of protocol + @param[out] CompletionCode The return ME Firmware return code for this request + + @retval EFI_SUCCESS The function completed successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_AT_SEND_ASSERT_STOLEN) ( + IN EFI_AT_PROTOCOL *This, + IN OUT UINT8 *CompletionCode + ); + +/** + This queries FW of the AT Status in Unsigned mode + + @param[in] This The address of protocol + @param[out] StateUnsigned Structure retrieved from ME describing current AT state + + @retval EFI_SUCCESS The function completed successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_AT_GET_STATE_UNSIGNED) ( + IN EFI_AT_PROTOCOL *This, + IN OUT AT_STATE_INFO *StateUnsigned + ); + +/// +/// Protocol definition +/// +struct _EFI_AT_PROTOCOL { + UINT8 Revision; + EFI_AT_AUTHETICATE_CREDENTIAL AuthenticateCredential; + EFI_AT_COMPUTE_HASH ComputeHash; + EFI_AT_GET_NONCE GetNonce; + EFI_AT_GET_TIMER_INFO GetTimerInfo; + EFI_AT_GET_RECOVERY_STRING GetRecoveryString; + EFI_AT_GET_ISV_ID GetIsvId; + EFI_AT_SEND_ASSERT_STOLEN SendAssertStolen; + EFI_AT_SET_SUSPEND_STATE SetSuspendState; + EFI_AT_INIT_WWAN_RECOV InitWWAN; + EFI_AT_GET_WWAN_NIC_STATUS GetWWANNicStatus; + EFI_AT_GET_STATE_UNSIGNED GetStateUnsigned; +}; + +#endif diff --git a/ReferenceCode/ME/Protocol/AtAm/ATAM.c b/ReferenceCode/ME/Protocol/AtAm/ATAM.c new file mode 100644 index 0000000..04d86ee --- /dev/null +++ b/ReferenceCode/ME/Protocol/AtAm/ATAM.c @@ -0,0 +1,40 @@ +/** @file + Defines AtAm protocol. + +@copyright + Copyright (c) 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 +**/ + +// +// Statements that include other files +// +#include "EdkIIGlueDxe.h" + +// +// Include the protocol header file +// +#include EFI_PROTOCOL_DEFINITION (AtAm) + +// +// Protocol GUID definition +// +EFI_GUID gEfiAtAmProtocolGuid = EFI_ATAM_PROTOCOL_GUID; + +// +// Protocol description +// +EFI_GUID_STRING(&gEfiAtAmProtocolGuid, "AtAm Protocol", "Intel (R) AtAm Protocol Services."); diff --git a/ReferenceCode/ME/Protocol/AtAm/ATAM.h b/ReferenceCode/ME/Protocol/AtAm/ATAM.h new file mode 100644 index 0000000..5d75f33 --- /dev/null +++ b/ReferenceCode/ME/Protocol/AtAm/ATAM.h @@ -0,0 +1,249 @@ +/** @file + Header file for ATAM + +@copyright + Copyright (c) 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 _DXE_ATAM_PROTOCOL_H_ +#define _DXE_ATAM_PROTOCOL_H_ + +#include "MkhiMsgs.h" + +/// +/// Define the protocol GUID +/// +#define EFI_ATAM_PROTOCOL_GUID \ + { \ + 0x8aebaa5a, 0x556f, 0x404b, 0x96, 0x05, 0x38, 0xe0, 0xde, 0x29, 0x76, 0x2f \ + } + +// +// Extern the GUID for protocol users. +// +extern EFI_GUID gEfiAtProtocolGuid; + +#define ATAM_PROTOCOL_REVISION 3 + +// +// Forward reference for ANSI C compatibility +// + +#define ISV_PLATFORM_ID_LENGTH 16 +#define SERVER_SHORTCODE_LENGTH 16 +#define DEFAULT_LANGUAGE_STRING 4 + +// +// Forward reference for ANSI C compatibility +// +EFI_FORWARD_DECLARATION (EFI_ATAM_PROTOCOL); + +#pragma pack(1) +typedef struct { + + UINT8 BiosLanguageSupport[DEFAULT_LANGUAGE_STRING]; + UINT8 Reserved[2]; + + /// + /// Defines the number which will be used by BIOS before making BIOS AM as a + /// default recovery mechanism + /// + UINT16 PbaOverRideThreshold; + + /// + /// The value used by BIOS to try sending GPS location when AT stolen + /// + UINT8 BiosLocationBeconing; + + /// + /// This will be used for Notebook transfer authorization request + /// + UINT8 PlatformAuthReq; + + /// + /// This will be used for Notebook transfer authorization acknowledgement + /// + UINT8 PlatformAuthAck; + + /// + /// This will be used for AT Server short code + /// + UINT8 ServerShortCode[SERVER_SHORTCODE_LENGTH]; + + /// + /// This allow ISV to set unique platform ID and will be used for displayed on need basis + /// + UINT16 IsvPlatformId[ISV_PLATFORM_ID_LENGTH]; + +} AT_BIOS_RECOVERY_CONFIG; +#pragma pack() + +/// +/// Protocol definitions +/// + +/** + This function gets the ISV Strings stored by AT Server that BIOS will display. + + @param[in] This The address of protocol + @param[out] IsvString Isv string pointer + @param[out] IsvId Intel(R) Anti-Theft service provider Id + + @retval EFI_SUCCESS The function completed successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ATAM_GET_ISV_ID) ( + IN EFI_ATAM_PROTOCOL *This, + OUT UINT8 *IsvString, + OUT UINT32 *IsvId + ); + +/** + This function gets recovery config. + + @param[in] This The address of protocol + @param[out] RecoveryConfig Pointer to structure + + @retval EFI_SUCCESS The function completed successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ATAM_GET_RECOVERY_CONFIG) ( + IN EFI_ATAM_PROTOCOL *This, + OUT AT_BIOS_RECOVERY_CONFIG *RecoveryConfig + ); + +/** + This function returns time left to enter password. + + @param[in] This The address of protocol + @param[out] TimeLeft Time + @param[out] TimeInterval Time interval + + @retval EFI_SUCCESS The function completed + successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ATAM_GET_TIMER) ( + IN EFI_ATAM_PROTOCOL *This, + OUT UINT32 *TimeLeft, + OUT UINT32 *TimeInterval + ); + +/** + This function gets 16 bytes nonce from firmware and also converts it to string according to format "XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX". + + @param[in] This The address of protocol + @param[out] NonceStr Pointer to Nonce string + + @retval EFI_SUCCESS The function completed + successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ATAM_GET_NONCE) ( + IN EFI_ATAM_PROTOCOL *This, + OUT UINT8 *NonceStr + ); + +/** + This routine receives the data (passphrase or SRTK) from UI and verifies it if the password (either passphrase or SRTK) is acceptable. + + @param[in] This The address of protocol + @param[in] PasswordEntered Pointer to string + @param[in] PassType Password type + @param[out] IsAuthenticated Pointer to result of verification + + @retval EFI_SUCCESS The function completed successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ATAM_VERIFY_PASSWORD) ( + IN EFI_ATAM_PROTOCOL *This, + IN UINT8 *PasswordEntered, + IN UINT32 PassType, + OUT UINT8 *IsAuthenticated + ); + +/** + This routine receives the SRTK from UI and verifies it if the password is acceptable. This requests FW to enter or exit Suspend mode based on user input. + + @param[in] This The address of protocol + @param[in] TransitionState 1- enter suspend state, 0 - exit suspend state + @param[in] Token Pointer to token + + @retval EFI_SUCCESS The function completed successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ATAM_SET_SUSPEND_STATE) ( + IN EFI_ATAM_PROTOCOL *This, + IN UINT32 TransitionState, + IN UINT8 *Token + ); + +/** + This routine gets AT state. + + @param[in] This The address of protocol + @param[out] AtStateInfo State of AT + + @retval EFI_SUCCESS The function completed + successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ATAM_GET_AT_STATE_INFO) ( + IN EFI_ATAM_PROTOCOL *This, + OUT AT_STATE_INFO *AtStateInfo + ); + +/** + This routine gets PBA failed count value. + + @param[out] PbaFailedExceeded TRUE when the PbaOverrideThreshold is exceeded + @param[out] PbaFailedAttempts Number of failed attempts + @param[out] PbaFailedThreshold Pba failed count treshold + + @retval EFI_SUCCESS The function completed + successfully. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ATAM_GET_PBA_COUNTER) ( + OUT UINT8* PbaFailedExceeded, + OUT UINT16* PbaFailedAttempts, + OUT UINT16* PbaFailedThreshold + ); + +/// +/// Protocol definition +/// +struct _EFI_ATAM_PROTOCOL { + UINT8 Revision; + EFI_ATAM_GET_ISV_ID AtAmGetIsvId; + EFI_ATAM_GET_RECOVERY_CONFIG AtAmGetRecoveryConfig; + EFI_ATAM_GET_TIMER AtAmGetTimer; + EFI_ATAM_GET_NONCE AtAmGetNonce; + EFI_ATAM_VERIFY_PASSWORD AtAmVerifyPassword; + EFI_ATAM_SET_SUSPEND_STATE AtAmSetSuspendState; + EFI_ATAM_GET_AT_STATE_INFO AtAmGetAtStateInfo; + EFI_ATAM_GET_PBA_COUNTER AtAmGetPbaCounter; +}; + +#endif diff --git a/ReferenceCode/ME/Protocol/AtAm/AtAm.cif b/ReferenceCode/ME/Protocol/AtAm/AtAm.cif new file mode 100644 index 0000000..bd47708 --- /dev/null +++ b/ReferenceCode/ME/Protocol/AtAm/AtAm.cif @@ -0,0 +1,9 @@ +<component> + name = "ATAM Protocol" + category = ModulePart + LocalRoot = "ReferenceCode\Me\Protocol\AtAm" + RefName = "ATAMProtocols" +[files] +"ATAM.h" +"ATAM.c" +<endComponent> diff --git a/ReferenceCode/ME/Protocol/AtPlatformPolicy/AtPlatformPolicy.c b/ReferenceCode/ME/Protocol/AtPlatformPolicy/AtPlatformPolicy.c new file mode 100644 index 0000000..98e0c9d --- /dev/null +++ b/ReferenceCode/ME/Protocol/AtPlatformPolicy/AtPlatformPolicy.c @@ -0,0 +1,43 @@ +/** @file + This driver implements the AT Platform Policy protocol. + +@copyright + Copyright (c) 2004 - 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 +**/ + +// +// Statements that include other files +// +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +// +// Include the protocol header file +// +#include EFI_PROTOCOL_DEFINITION (AtPlatformPolicy) +#endif +// +// Protocol GUID definition +// +EFI_GUID gDxePlatformAtPolicyGuid = DXE_PLATFORM_AT_POLICY_GUID; + +// +// Protocol description +// +EFI_GUID_STRING + (&gDxePlatformAtPolicyGuid, "AtPlatformPolicy Protocol", "Intel(R) DXE Phase At Platform Policy Protocol"); diff --git a/ReferenceCode/ME/Protocol/AtPlatformPolicy/AtPlatformPolicy.h b/ReferenceCode/ME/Protocol/AtPlatformPolicy/AtPlatformPolicy.h new file mode 100644 index 0000000..9cf00d7 --- /dev/null +++ b/ReferenceCode/ME/Protocol/AtPlatformPolicy/AtPlatformPolicy.h @@ -0,0 +1,57 @@ +/** @file + This driver implements the AT Platform Policy protocol. + +@copyright + Copyright (c) 2004 - 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 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 _DXE_AT_PLATFORM_POLICY_H_ +#define _DXE_AT_PLATFORM_POLICY_H_ + +/// +/// AT policy provided by platform for DXE phase +/// +#define DXE_PLATFORM_AT_POLICY_GUID \ + { \ + 0x3f4ea4d4, 0xb465, 0x4f3f, 0x9c, 0x92, 0xb3, 0x40, 0xab, 0x58, 0x96, 0xb5 \ + } + +/// +/// Protocol revision number +/// Any backwards compatible changes to this protocol will result in an update in the revision number +/// Major changes will require publication of a new protocol +/// +#define DXE_PLATFORM_AT_POLICY_PROTOCOL_REVISION_1 1 +#define DXE_PLATFORM_AT_POLICY_PROTOCOL_REVISION_2 2 + +extern EFI_GUID gDxePlatformAtPolicyGuid; +#pragma pack(1) +typedef struct { + UINT8 AtAmBypass; ///< Byte 0, bit definition for functionality enable/disable + UINT8 AtEnterSuspendState; + UINT8 AtSupported; + UINT8 AtPba; + UINT8 ByteReserved[28]; ///< Bytes 4-31 Reserved and make AT_CONFIG as 32 bit alignment +} AT_CONFIG; +#pragma pack() +/// +/// AMT DXE Platform Policy +/// +typedef struct _DXE_AT_POLICY_PROTOCOL { + UINT8 Revision; + AT_CONFIG At; +} DXE_AT_POLICY_PROTOCOL; +#endif diff --git a/ReferenceCode/ME/Protocol/Heci/Heci.c b/ReferenceCode/ME/Protocol/Heci/Heci.c new file mode 100644 index 0000000..64ac0f4 --- /dev/null +++ b/ReferenceCode/ME/Protocol/Heci/Heci.c @@ -0,0 +1,31 @@ +/** @file + EFI Heci Protocol + +@copyright + Copyright (c) 1999 - 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 +**/ + +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +#include EFI_PROTOCOL_DEFINITION (Heci) +#endif + +EFI_GUID gEfiHeciProtocolGuid = HECI_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiHeciProtocolGuid, "HECI Protocol", "EFI 2.0 HECI Protocol"); diff --git a/ReferenceCode/ME/Protocol/Heci/Heci.h b/ReferenceCode/ME/Protocol/Heci/Heci.h new file mode 100644 index 0000000..fcb14a1 --- /dev/null +++ b/ReferenceCode/ME/Protocol/Heci/Heci.h @@ -0,0 +1,243 @@ +/** @file + EFI HECI Protocol + +@copyright + Copyright (c) 1999 - 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 + +**/ +#ifndef _EFI_HECI_H +#define _EFI_HECI_H + +#include "MeState.h" + +/// +/// HECI protocol provided for DXE phase +/// This protocol provides an interface to communicate with Intel ME subsystem via HECI +/// +#define HECI_PROTOCOL_GUID \ + { \ + 0xcfb33810, 0x6e87, 0x4284, 0xb2, 0x3, 0xa6, 0x6a, 0xbe, 0x7, 0xf6, 0xe8 \ + } + +#define EFI_HECI_PROTOCOL_GUID HECI_PROTOCOL_GUID + +EFI_FORWARD_DECLARATION (EFI_HECI_PROTOCOL); + +/** + Function sends one messsage through the HECI circular buffer and waits + for the corresponding ACK message. + + @param[in][out] Message Pointer to the message buffer. + @param[in] SendLength Length of the message in bytes. + @param[in][out] RecLength Length of the message response in bytes. + @param[in] HostAddress Address of the sending entity. + @param[in] MeAddress Address of the ME entity that should receive the message. + + @exception EFI_SUCCESS Command succeeded + @exception EFI_DEVICE_ERROR HECI Device error, command aborts abnormally + @exception EFI_TIMEOUT HECI does not return the buffer before timeout + @exception EFI_BUFFER_TOO_SMALL Message Buffer is too small for the Acknowledge + @exception EFI_UNSUPPORTED Current ME mode doesn't support send message through HECI +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_SENDWACK) ( + IN OUT UINT32 *Message, + IN OUT UINT32 Length, + IN OUT UINT32 *RecLength, + IN UINT8 HostAddress, + IN UINT8 MEAddress + ) +; + +/** + Read the HECI Message from Intel ME with size in Length into + buffer MessageBody. Set Blocking to BLOCKING and code will + wait until one message packet is received. When set to + NON_BLOCKING, if the circular buffer is empty at the time, the + code will not wait for the message packet. + + @param[in] Blocking Used to determine if the read is BLOCKING or NON_BLOCKING. + @param[in][out] MessageBody Pointer to a buffer used to receive a message. + @param[in][out] Length Pointer to the length of the buffer on input and the length + of the message on return. (in bytes) + + @retval EFI_SUCCESS One message packet read. + @retval EFI_DEVICE_ERROR Failed to initialize HECI or zero-length message packet read + @retval EFI_TIMEOUT HECI is not ready for communication + @retval EFI_BUFFER_TOO_SMALL The caller's buffer was not large enough +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_READ_MESSAGE) ( + IN UINT32 Blocking, + IN UINT32 *MessageBody, + IN OUT UINT32 *Length + ) +; + +/** + Function sends one messsage (of any length) through the HECI circular buffer. + + @param[in] Message Pointer to the message data to be sent. + @param[in] Length Length of the message in bytes. + @param[in] HostAddress The address of the host processor. + @param[in] MeAddress Address of the ME subsystem the message is being sent to. + + @retval EFI_SUCCESS One message packet sent. + @retval EFI_DEVICE_ERROR Failed to initialize HECI + @retval EFI_TIMEOUT HECI is not ready for communication + @exception EFI_UNSUPPORTED Current ME mode doesn't support send message through HECI +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_SEND_MESSAGE) ( + IN UINT32 *Message, + IN UINT32 Length, + IN UINT8 HostAddress, + IN UINT8 MEAddress + ) +; + +/** + Reset the HECI Controller with algorithm defined in the RS - + Intel(R) Management Engine - Host Embedded Controller + Interface Hardware Programming Specification (HPS) + @param[in] none + + @retval EFI_TIMEOUT HECI does not return the buffer before timeout + @retval EFI_SUCCESS Interface reset +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_RESET) ( + VOID + ) +; + +/** + Initialize the HECI Controller with algorithm defined in the + RS - Intel(R) Management Engine - Host Embedded Controller + Interface Hardware Programming Specification (HPS). + Determines if the HECI device is present and, if present, + initializes it for use by the BIOS. + + @param[in] None. + + @retval EFI_SUCCESS HECI device is present and initialized + @retval EFI_TIMEOUT HECI does not return the buffer before timeout +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_INIT) ( + VOID + ) +; + +/** + Re-initialize the HECI Controller with algorithm defined in the RS - Intel(R) Management Engine + - Host Embedded Controller Interface Hardware Programming Specification (HPS). + Heci Re-initializes it for Host + + @param[in] None. + + @retval EFI_TIMEOUT HECI does not return the buffer before timeout + @retval EFI_STATUS Status code returned by ResetHeciInterface +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_REINIT) ( + VOID + ) +; + +/** + Reset Intel ME and timeout if Ready is not set after Delay timeout + + @param[in] Delay Timeout value in microseconds + + @retval EFI_TIMEOUT HECI does not return the buffer before timeout + @retval EFI_SUCCESS Me is ready +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_RESET_WAIT) ( + IN UINT32 Delay + ) +; + +/** + Get an abstract Intel ME State from Firmware Status Register. + This is used to control BIOS flow for different Intel ME + functions. + The ME status information is obtained by sending HECI messages + to Intel ME and is used both by the platform code and + reference code. This will optimize boot time because system + BIOS only sends each HECI message once. It is recommended to + send the HECI messages to Intel ME only when ME mode is normal + (Except for HMRFPO Disable Message) and ME State is NORMAL or + RECOVERY (Suitable for AT and Kernel Messaging only). + + @param[out] MeStatus Pointer for abstract status report, + see MeState.h - Abstract ME status definitions. + + @retval EFI_SUCCESS MeStatus copied + @retval EFI_INVALID_PARAMETER Pointer of MeStatus is invalid +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_GET_ME_STATUS) ( + OUT UINT32 *Status + ) +; + +/** + Get an abstract ME operation mode from firmware status + register. This is used to control BIOS flow for different + Intel ME functions. + + @param[out] MeMode Pointer for ME Mode report, + see MeState.h - Abstract ME Mode definitions. + + @retval EFI_SUCCESS MeMode copied + @retval EFI_INVALID_PARAMETER Pointer of MeMode is invalid +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_GET_ME_MODE) ( + OUT UINT32 *Mode + ) +; + +/// +/// HECI protocol provided for DXE phase +/// The interface functions are for sending/receiving HECI messages between host and Intel ME subsystem. +/// There is also support to control HECI Initialization and get Intel ME status. +/// +struct _EFI_HECI_PROTOCOL { + EFI_HECI_SENDWACK SendwACK; ///< Send HECI message and wait for respond + EFI_HECI_READ_MESSAGE ReadMsg; ///< Receive HECI message + EFI_HECI_SEND_MESSAGE SendMsg; ///< Send HECI message + EFI_HECI_RESET ResetHeci; ///< Reset HECI device + EFI_HECI_INIT InitHeci; ///< Initialize HECI device + EFI_HECI_RESET_WAIT MeResetWait; ///< Intel ME Reset Wait Timer + EFI_HECI_REINIT ReInitHeci; ///< Re-initialize HECI + EFI_HECI_GET_ME_STATUS GetMeStatus; ///< Get Intel ME Status register + EFI_HECI_GET_ME_MODE GetMeMode; ///< Get Intel ME mode +}; + +extern EFI_GUID gEfiHeciProtocolGuid; + +#endif // _EFI_HECI_H diff --git a/ReferenceCode/ME/Protocol/HeciSmm/HeciSmm.c b/ReferenceCode/ME/Protocol/HeciSmm/HeciSmm.c new file mode 100644 index 0000000..cd28c0e --- /dev/null +++ b/ReferenceCode/ME/Protocol/HeciSmm/HeciSmm.c @@ -0,0 +1,40 @@ +/*++ + 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: + + HeciSmm.c + +Abstract: + + SMM Heci Protocol +Revision History + +--*/ + +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +#include EFI_PROTOCOL_DEFINITION (HeciSmm) +#endif + +EFI_GUID gSmmHeciProtocolGuid = SMM_HECI_PROTOCOL_GUID; + +EFI_GUID_STRING(&gSmmHeciProtocolGuid, "SMM HECI Protocol", "EFI 2.0 SMM HECI Protocol"); diff --git a/ReferenceCode/ME/Protocol/HeciSmm/HeciSmm.h b/ReferenceCode/ME/Protocol/HeciSmm/HeciSmm.h new file mode 100644 index 0000000..667a1fb --- /dev/null +++ b/ReferenceCode/ME/Protocol/HeciSmm/HeciSmm.h @@ -0,0 +1,122 @@ +/*++ + 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) 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: + + HeciSmm.h + +Abstract: + + SMM HECI Protocol + +--*/ +#ifndef _SMM_HECI_H +#define _SMM_HECI_H + +#include "MeState.h" + +#define SMM_HECI_PROTOCOL_GUID \ + { \ + 0xFC9A50C1, 0x8B3D, 0x40D0, 0x99, 0x12, 0x6E, 0x26, 0xD7, 0x89, 0x6C, 0xBA \ + } +//- 0x826824b6, 0xcc9b, 0x4d62, 0x8e, 0x7a, 0xf, 0xfb, 0xf6, 0x1, 0x3c, 0xbe +#define AMI_HECI_SMM_GUID \ + { \ + 0xFC9A50C1, 0x8B3D, 0x40D0, 0x99, 0x12, 0x6E, 0x26, 0xD7, 0x89, 0x6C, 0xBA \ + } + + +EFI_FORWARD_DECLARATION (SMM_HECI_PROTOCOL); + +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_SENDWACK) ( + IN OUT UINT32 *Message, + IN OUT UINT32 Length, + IN OUT UINT32 *RecLength, + IN UINT8 HostAddress, + IN UINT8 MEAddress + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_READ_MESSAGE) ( + IN UINT32 Blocking, + IN UINT32 *MessageBody, + IN OUT UINT32 *Length + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_SEND_MESSAGE) ( + IN UINT32 *Message, + IN UINT32 Length, + IN UINT8 HostAddress, + IN UINT8 MEAddress + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_RESET) ( + VOID + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_INIT) ( + VOID + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_REINIT) ( + VOID + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_RESET_WAIT) ( + IN UINT32 Delay + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_GET_ME_STATUS) ( + IN UINT32 *Status + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HECI_GET_ME_MODE) ( + IN UINT32 *Mode + ); + +typedef struct _SMM_HECI_PROTOCOL { + EFI_HECI_SENDWACK SendwACK; + EFI_HECI_READ_MESSAGE ReadMsg; + EFI_HECI_SEND_MESSAGE SendMsg; + EFI_HECI_RESET ResetHeci; + EFI_HECI_INIT InitHeci; + EFI_HECI_RESET_WAIT MeResetWait; + EFI_HECI_REINIT ReInitHeci; + EFI_HECI_GET_ME_STATUS GetMeStatus; + EFI_HECI_GET_ME_MODE GetMeMode; +} SMM_HECI_PROTOCOL; + +extern EFI_GUID gSmmHeciProtocolGuid; + +#endif // _SMM_HECI_H diff --git a/ReferenceCode/ME/Protocol/IderControllerDriver/IderControllerDriver.c b/ReferenceCode/ME/Protocol/IderControllerDriver/IderControllerDriver.c new file mode 100644 index 0000000..f68b7f4 --- /dev/null +++ b/ReferenceCode/ME/Protocol/IderControllerDriver/IderControllerDriver.c @@ -0,0 +1,31 @@ +/** @file + Protocol used for IDE-R Controller Driver. + +@copyright + Copyright (c) 2005 - 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 +**/ + +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +#include EFI_PROTOCOL_DEFINITION (IderControllerDriver) +#endif + +EFI_GUID gEfiIderControllerDriverProtocolGuid = EFI_IDER_CONTROLLER_DRIVER_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiIderControllerDriverProtocolGuid, "IDE-R Controller Driver", "EFI IDE-R Controller Driver GUID") diff --git a/ReferenceCode/ME/Protocol/IderControllerDriver/IderControllerDriver.h b/ReferenceCode/ME/Protocol/IderControllerDriver/IderControllerDriver.h new file mode 100644 index 0000000..05ccf4e --- /dev/null +++ b/ReferenceCode/ME/Protocol/IderControllerDriver/IderControllerDriver.h @@ -0,0 +1,34 @@ +/** @file + IDE-R Controller Driver Protocol definitions. + We can specify normal IDE contorller driver and IDE-R controller by checking this GUID + +@copyright + Copyright (c) 2005 - 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 +**/ +#ifndef _EFI_IDER_CONTROLLER_DRIVER_PROTOCOL_H_ +#define _EFI_IDER_CONTROLLER_DRIVER_PROTOCOL_H_ + +/// +/// IDER Controller Driver Protocol +/// This protocol is used in Platform BDS phase to identify IDE-R boot devices. +/// +#define EFI_IDER_CONTROLLER_DRIVER_PROTOCOL_GUID \ + { \ + 0x956a2ed0, 0xa6cf, 0x409a, 0xb8, 0xf5, 0x35, 0xf1, 0x4c, 0x3e, 0x3c, 0x2 \ + } + +extern EFI_GUID gEfiIderControllerDriverProtocolGuid; + +#endif diff --git a/ReferenceCode/ME/Protocol/MeBiosPayloadData/MeBiosPayloadData.c b/ReferenceCode/ME/Protocol/MeBiosPayloadData/MeBiosPayloadData.c new file mode 100644 index 0000000..c52ff21 --- /dev/null +++ b/ReferenceCode/ME/Protocol/MeBiosPayloadData/MeBiosPayloadData.c @@ -0,0 +1,43 @@ +/** @file + This file defines the Me Bios Payload Data Protocol which implements the + Intel(R) Management Engine + +@copyright + Copyright (c) 2006 - 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 +**/ + +// +// Statements that include other files +// +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +// +// Include the protocol header file +// +#include EFI_PROTOCOL_DEFINITION (MeBiosPayloadData) +#endif +// +// Protocol GUID definition +// +EFI_GUID gMeBiosPayloadDataProtocolGuid = ME_BIOS_PAYLOAD_DATA_PROTOCOL_GUID; + +// +// Protocol description +// +EFI_GUID_STRING(&gMeBiosPayloadDataProtocolGuid, "MeBiosPayloadData Protocol", "Intel(R) DXE Phase MBP Protocol"); diff --git a/ReferenceCode/ME/Protocol/MeBiosPayloadData/MeBiosPayloadData.h b/ReferenceCode/ME/Protocol/MeBiosPayloadData/MeBiosPayloadData.h new file mode 100644 index 0000000..4a90ebb --- /dev/null +++ b/ReferenceCode/ME/Protocol/MeBiosPayloadData/MeBiosPayloadData.h @@ -0,0 +1,138 @@ +/** @file + Interface definition details for MBP during DXE phase. + +@copyright + Copyright (c) 2006 - 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 +**/ +#ifndef _MBP_DATA_PROTOCOL_H_ +#define _MBP_DATA_PROTOCOL_H_ +#include "CoreBiosMsg.h" + +/// +/// MBP Protocol for DXE phase +/// +#define ME_BIOS_PAYLOAD_DATA_PROTOCOL_GUID \ + { \ + 0x71a19494, 0x2ab6, 0x4e96, 0x85, 0x81, 0xcf, 0x34, 0x25, 0x42, 0x73, 0xfe \ + } + +/// +/// Revision 1: Original version +/// +#define DXE_MBP_DATA_PROTOCOL_REVISION_1 1 +#define DXE_MBP_DATA_PROTOCOL_REVISION_2 2 +extern EFI_GUID gMeBiosPayloadDataProtocolGuid; + +#pragma pack(push, 1) +typedef struct _MBP_FW_VERSION_NAME { + UINT32 MajorVersion : 16; + UINT32 MinorVersion : 16; + UINT32 HotfixVersion : 16; + UINT32 BuildVersion : 16; +} MBP_FW_VERSION_NAME; + +typedef struct _MBP_ICC_PROFILE { + UINT8 NumIccProfiles; + UINT8 IccProfileSoftStrap; + UINT8 IccProfileIndex; + UINT8 Reserved; + ICC_LOCK_REGS_INFO IccLockRegInfo; +} MBP_ICC_PROFILE; + +typedef struct _MBP_FW_CAPS_SKU { + MEFWCAPS_SKU FwCapabilities; + BOOLEAN Available; +} MBP_FW_CAPS_SKU; + +typedef struct _MBP_FW_FEATURES_STATE { + MEFWCAPS_SKU FwFeatures; + BOOLEAN Available; +} MBP_FW_FEATURES_STATE; + +typedef struct _MBP_ROM_BIST_DATA { + UINT16 DeviceId; + UINT16 FuseTestFlags; + UINT32 UMCHID[4]; +} MBP_ROM_BIST_DATA; + +typedef struct _MBP_PLATFORM_KEY { + UINT32 Key[8]; +} MBP_PLATFORM_KEY; + +typedef struct _MBP_PLAT_TYPE { + PLATFORM_TYPE_RULE_DATA RuleData; + BOOLEAN Available; +} MBP_PLAT_TYPE; + +typedef union _HWA_DATA { + UINT32 Raw; + struct { + UINT32 MediaTablePush : 1; + UINT32 Reserved : 31; + } Fields; +} HWA_DATA; + +typedef struct _MBP_HWA_REQ { + HWA_DATA Data; + BOOLEAN Available; +} MBP_HWA_REQ; + +typedef struct _MBP_PERF_DATA { + UINT32 PwrbtnMrst; + UINT32 MrstPltrst; + UINT32 PltrstCpurst; +} MBP_PERF_DATA; + +typedef struct _PLAT_BOOT_PERF_DATA { + MBP_PERF_DATA MbpPerfData; + BOOLEAN Available; +} PLAT_BOOT_PERF_DATA; + +typedef struct _MBP_NFC_DATA { + UINT32 DeviceType :2; + UINT32 Reserved : 29; + UINT32 Hide :1; +} MBP_NFC_DATA; + +typedef struct _MBP_NFC_SUPPORT { + MBP_NFC_DATA NfcData; + BOOLEAN Available; +} MBP_NFC_SUPPORT; + +typedef struct { + MBP_FW_VERSION_NAME FwVersionName; + MBP_FW_CAPS_SKU FwCapsSku; + MBP_FW_FEATURES_STATE FwFeaturesState; + MBP_ROM_BIST_DATA RomBistData; + MBP_PLATFORM_KEY PlatformKey; + MBP_PLAT_TYPE FwPlatType; + MBP_ICC_PROFILE IccProfile; + AT_STATE_INFO AtState; + UINT32 MFSIntegrity; + MBP_HWA_REQ HwaRequest; + PLAT_BOOT_PERF_DATA PlatBootPerfData; + MBP_NFC_SUPPORT NfcSupport; +} ME_BIOS_PAYLOAD; +#pragma pack(pop) +/// +/// MBP DXE Protocol +/// +typedef struct _DXE_MBP_DATA_PROTOCOL { + EFI_HANDLE Handle; + UINT8 Revision; + ME_BIOS_PAYLOAD MeBiosPayload; +} DXE_MBP_DATA_PROTOCOL; + +#endif diff --git a/ReferenceCode/ME/Protocol/MeGlobalNvsArea/MeGlobalNvsArea.c b/ReferenceCode/ME/Protocol/MeGlobalNvsArea/MeGlobalNvsArea.c new file mode 100644 index 0000000..351c98e --- /dev/null +++ b/ReferenceCode/ME/Protocol/MeGlobalNvsArea/MeGlobalNvsArea.c @@ -0,0 +1,31 @@ +/** @file + ME FW Global NVS Area description protocol implementation. + +@copyright + Copyright (c) 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 Mobile Silicon Support Module" and is + licensed for Intel Mobile 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 +**/ +#include "EdkIIGlueDxe.h" + +#include "MeGlobalNvsArea.h" + +EFI_GUID gMeGlobalNvsAreaProtocolGuid = ME_GLOBAL_NVS_AREA_PROTOCOL_GUID; + +EFI_GUID_STRING + ( + &gMeGlobalNvsAreaProtocolGuid, "ME Global NVS Area Protocol", + "Protocol describing MEFW ACPI NVS memory region used by ACPI subsystem." + ); diff --git a/ReferenceCode/ME/Protocol/MeGlobalNvsArea/MeGlobalNvsArea.h b/ReferenceCode/ME/Protocol/MeGlobalNvsArea/MeGlobalNvsArea.h new file mode 100644 index 0000000..ce037a1 --- /dev/null +++ b/ReferenceCode/ME/Protocol/MeGlobalNvsArea/MeGlobalNvsArea.h @@ -0,0 +1,72 @@ +/** @file + Definition of the MEFW global NVS area protocol. This protocol + publishes the address and format of a global ACPI NVS buffer used as a communications + buffer between SMM/DXE/PEI code and ASL code. + @todo The format is derived from the ACPI reference code, version 0.95. + + Note: Data structures defined in this protocol are not naturally aligned. + +@copyright + Copyright (c) 2012 - 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 +**/ +#ifndef _ME_GLOBAL_NVS_AREA_H_ +#define _ME_GLOBAL_NVS_AREA_H_ + +/// +/// Includes +/// +/// +/// Forward reference for pure ANSI compatability +/// +EFI_FORWARD_DECLARATION (ME_GLOBAL_NVS_AREA_PROTOCOL); + +/// +/// ME Global NVS Area Protocol GUID +/// +#define ME_GLOBAL_NVS_AREA_PROTOCOL_GUID \ + { \ + 0x3bffecfd, 0xd75f, 0x4975, 0xb8, 0x88, 0x39, 0x02, 0xbd, 0x69, 0x00, 0x2b \ + } + +/// +/// Extern the GUID for protocol users. +/// +extern EFI_GUID gMeGlobalNvsAreaProtocolGuid; + +/// +/// Global NVS Area definition +/// +#pragma pack(1) +typedef struct { + UINT32 MeNvsRevision; ///< 000 Me NVS Protocol Revision + /// + /// PTT Solution + /// + UINT8 FTpmSwitch; /// (004) fTPM Solution Method Selection + /// + /// PTT Allocated Buffer Address + /// + UINT64 PTTAddress; /// (005) PTT Allocated Buffer Address + +} ME_GLOBAL_NVS_AREA; +#pragma pack() +/// +/// ME Global NVS Area Protocol +/// +typedef struct _ME_GLOBAL_NVS_AREA_PROTOCOL { + ME_GLOBAL_NVS_AREA *Area; +} ME_GLOBAL_NVS_AREA_PROTOCOL; + +#endif diff --git a/ReferenceCode/ME/Protocol/MePlatformPolicy/MePlatformPolicy.c b/ReferenceCode/ME/Protocol/MePlatformPolicy/MePlatformPolicy.c new file mode 100644 index 0000000..8679604 --- /dev/null +++ b/ReferenceCode/ME/Protocol/MePlatformPolicy/MePlatformPolicy.c @@ -0,0 +1,44 @@ +/** @file + This file defines the EFI ME policy Protocol which implements the + Intel(R) Management Engine + +@copyright + Copyright (c) 2006 - 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 +**/ + +// +// Statements that include other files +// +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +// +// Include the protocol header file +// +#include EFI_PROTOCOL_DEFINITION (MePlatformPolicy) +#endif +// +// Protocol GUID definition +// +EFI_GUID gDxePlatformMePolicyGuid = DXE_PLATFORM_ME_POLICY_GUID; + +// +// Protocol description +// +EFI_GUID_STRING + (&gDxePlatformMePolicyGuid, "MePlatformPolicy Protocol", "Intel(R) DXE Phase ME Platform Policy Protocol"); diff --git a/ReferenceCode/ME/Protocol/MePlatformPolicy/MePlatformPolicy.h b/ReferenceCode/ME/Protocol/MePlatformPolicy/MePlatformPolicy.h new file mode 100644 index 0000000..ee3ef25 --- /dev/null +++ b/ReferenceCode/ME/Protocol/MePlatformPolicy/MePlatformPolicy.h @@ -0,0 +1,134 @@ +/** @file + Interface definition details between ME and platform drivers during DXE phase. + +@copyright + Copyright (c) 2006 - 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 +**/ +#ifndef _ME_PLATFORM_POLICY_H_ +#define _ME_PLATFORM_POLICY_H_ + +/// +/// ME policy provided by platform for DXE phase +/// This protocol provides an interface to get Intel ME Configuration information +/// +#define DXE_PLATFORM_ME_POLICY_GUID \ + { \ + 0x69bf9e8a, 0x4ad6, 0x9a28, 0x87, 0xf3, 0x09, 0xa0, 0x71, 0x29, 0x2a, 0x00 \ + } + +/// +/// Initial Revision +/// +#define DXE_PLATFORM_ME_POLICY_PROTOCOL_REVISION_1 1 +/// +/// Remove MbpSecurity +/// +#define DXE_PLATFORM_ME_POLICY_PROTOCOL_REVISION_2 2 +extern EFI_GUID gDxePlatformMePolicyGuid; + +#pragma pack(1) + +typedef struct { + // + // Byte 0, bit definition for functionality enable/disable + // + UINT8 MeFwDownGrade : 1; ///< 0: Disabled; 1: Enabled + UINT8 MeLocalFwUpdEnabled : 1; ///< 0: Disabled; 1: Enabled + UINT8 Byte0ReservedBit2 : 1; + UINT8 EndOfPostEnabled : 1; ///< 0: Disabled; 1: Enabled + UINT8 EndOfPostDone : 1; ///< 0: Not yet; 1: Done + UINT8 MdesCapability : 1; ///< 0: Disabled; 1: Enabled + UINT8 SvtForPchCap: 1; ///< 0: Disabled; 1: Enabled + UINT8 MdesForBiosState : 1; ///< 0: Disabled; 1: Enabled + UINT8 ByteReserved[15]; ///< Byte 1-15 Reserved for other bit definitions in future +} ME_CONFIG; + +/// +/// ME ERROR Message ID +/// +typedef enum { + MSG_EOP_ERROR = 0, + MSG_ME_FW_UPDATE_FAILED, + MSG_ASF_BOOT_DISK_MISSING, + MSG_KVM_TIMES_UP, + MSG_KVM_REJECTED, + MSG_HMRFPO_LOCK_FAILURE, + MSG_HMRFPO_UNLOCK_FAILURE, + MSG_ME_FW_UPDATE_WAIT, + MSG_ILLEGAL_CPU_PLUGGED_IN, + MSG_KVM_WAIT, + MSG_PLAT_DISABLE_WAIT, + MAX_ERROR_ENUM +} ME_ERROR_MSG_ID; + +/** + Show Me Error message. This is to display localized message in + the console. This is used to display message strings in local + language. To display the message, the routine will check the + message ID and ConOut the message strings. For example, the + End of Post error displayed in English will be: + gST->ConOut->OutputString (gST->ConOut, L"Error sending End Of + Post message to ME\n"); It is recommended to clear the screen + before displaying the error message and keep the message on + the screen for several seconds. + A sample is provided, see ShowMeReportError () to retrieve + details. + + @param[in] MsgId Me error message ID for displaying on screen message + + @retval None +**/ +typedef +VOID +(EFIAPI *ME_REPORT_ERROR) ( + IN ME_ERROR_MSG_ID MsgId + ); + +typedef struct { + /// + /// This member determines the SMBIOS OEM type (0x80 to 0xFF) defined in SMBIOS + /// Type 14 - Group Associations structure - item type. FVI structure uses it as + /// SMBIOS OEM type to provide MEBx, ME FW and reference code version information + /// + UINT8 FviSmbiosType; +} ME_MISC_CONFIG; + +#pragma pack() +/// +/// ME DXE Platform Policy +/// This protocol provides information of the current Intel ME feature selection. Information is +/// passed from the platform code to the Intel ME Reference code using this structure. There are +/// 2 types of information, BIOS setup option and ME status information. +/// +typedef struct _DXE_ME_POLICY_PROTOCOL { + /// + /// Revision for the protocol structure + /// + UINT8 Revision; + /// + /// Intel ME feature selection enable/disable and firmware configuration information + /// + ME_CONFIG MeConfig; + /// + /// Support Localization for displaying on screen message + /// + ME_REPORT_ERROR MeReportError; + /// + /// Miscellaneous items + /// + ME_MISC_CONFIG MeMiscConfig; +} DXE_ME_POLICY_PROTOCOL; + +#endif diff --git a/ReferenceCode/ME/Protocol/MeProtocolLib.cif b/ReferenceCode/ME/Protocol/MeProtocolLib.cif new file mode 100644 index 0000000..b256f15 --- /dev/null +++ b/ReferenceCode/ME/Protocol/MeProtocolLib.cif @@ -0,0 +1,40 @@ +<component> + name = "MeProtocolLib" + category = ModulePart + LocalRoot = "ReferenceCode\ME\Protocol\" + RefName = "MeProtocolLib" +[files] +"MeProtocolLib.sdl" +"MeProtocolLib.mak" +"MeProtocolLib.inf" +"ActiveManagement\ActiveManagement.c" +"ActiveManagement\ActiveManagement.h" +"AlertStandardFormat\AlertStandardFormat.c" +"AlertStandardFormat\AlertStandardFormat.h" +"AmtPlatformPolicy\AmtPlatformPolicy.c" +"AmtPlatformPolicy\AmtPlatformPolicy.h" +"AmtReadyToBoot\AmtReadyToBoot.c" +"AmtReadyToBoot\AmtReadyToBoot.h" +"At\At.c" +"At\At.h" +"AtPlatformPolicy\AtPlatformPolicy.c" +"AtPlatformPolicy\AtPlatformPolicy.h" +"Heci\Heci.c" +"Heci\Heci.h" +"IderControllerDriver\IderControllerDriver.c" +"IderControllerDriver\IderControllerDriver.h" +"MeBiosPayloadData\MeBiosPayloadData.c" +"MeBiosPayloadData\MeBiosPayloadData.h" +"MebxProtocol\MebxProtocol.c" +"MebxProtocol\MebxProtocol.h" +"MePlatformPolicy\MePlatformPolicy.c" +"MePlatformPolicy\MePlatformPolicy.h" +"MeRcInfo\MeRcInfo.c" +"MeRcInfo\MeRcInfo.h" +"PlatformMeHook\PlatformMeHook.c" +"PlatformMeHook\PlatformMeHook.h" +"HeciSmm\HeciSmm.c" +"HeciSmm\HeciSmm.h" +"MeGlobalNvsArea\MeGlobalNvsArea.c" +"MeGlobalNvsArea\MeGlobalNvsArea.h" +<endComponent> diff --git a/ReferenceCode/ME/Protocol/MeProtocolLib.inf b/ReferenceCode/ME/Protocol/MeProtocolLib.inf new file mode 100644 index 0000000..f6b6590 --- /dev/null +++ b/ReferenceCode/ME/Protocol/MeProtocolLib.inf @@ -0,0 +1,73 @@ +## @file +# Component description file for the Me protocol library +# +#@copyright +# Copyright (c) 2004 - 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 +# + +[defines] +BASE_NAME = MeProtocolLib +COMPONENT_TYPE = LIBRARY + +[sources.common] + ActiveManagement/ActiveManagement.h + ActiveManagement/ActiveManagement.c + AlertStandardFormat/AlertStandardFormat.h + AlertStandardFormat/AlertStandardFormat.c + AmtPlatformPolicy/AmtPlatformPolicy.h + AmtPlatformPolicy/AmtPlatformPolicy.c + Heci/Heci.h + Heci/Heci.c + IderControllerDriver/IderControllerDriver.h + IderControllerDriver/IderControllerDriver.c + MePlatformPolicy/MePlatformPolicy.h + MePlatformPolicy/MePlatformPolicy.c + PlatformMeHook/PlatformMeHook.h + PlatformMeHook/PlatformMeHook.c + MeRcInfo/MeRcInfo.h + MeRcInfo/MeRcInfo.c + MebxProtocol/MebxProtocol.c + MebxProtocol/MebxProtocol.h + AmtReadyToBoot/AmtReadyToBoot.h + AmtReadyToBoot/AmtReadyToBoot.c + MeBiosPayloadData/MeBiosPayloadData.h + MeBiosPayloadData/MeBiosPayloadData.c + AtPlatformPolicy/AtPlatformPolicy.h + AtPlatformPolicy/AtPlatformPolicy.c + At/At.c + At/At.h + MeGlobalNvsArea/MeGlobalNvsArea.h + MeGlobalNvsArea/MeGlobalNvsArea.c + +[includes.common] + $(EFI_SOURCE)/$(PROJECT_ME_ROOT) + $(EFI_SOURCE)/$(PROJECT_ME_ROOT)/Library/MeKernel/Include + +# +# 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/Library/Dxe/Include + $(EDK_SOURCE)/Foundation/Library/EdkIIGlueLib/Include + +[nmake.common] +C_STD_INCLUDE= diff --git a/ReferenceCode/ME/Protocol/MeProtocolLib.mak b/ReferenceCode/ME/Protocol/MeProtocolLib.mak new file mode 100644 index 0000000..c8ebec3 --- /dev/null +++ b/ReferenceCode/ME/Protocol/MeProtocolLib.mak @@ -0,0 +1,43 @@ +# /*++ +# 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. +# --*/ +# MAK file for the ModulePart:MeProtocolLib +all : MeProtocolLib + +$(MeProtocolLib_LIB): MeProtocolLib + +MeProtocolLib : $(BUILD_DIR)\MeProtocolLib.mak MeProtocolLibBin + +$(BUILD_DIR)\MeProtocolLib.mak : $(MeProtocolLib_DIR)\$(@B).cif $(MeProtocolLib_DIR)\$(@B).mak $(BUILD_RULES) + $(CIF2MAK) $(MeProtocolLib_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS) + +MeProtocolLib_INCLUDES=\ + $(EDK_INCLUDES) \ + $(EdkIIGlueLib_INCLUDES) \ + $(ME_INCLUDES) + +MeProtocolLibBin : + $(MAKE) /$(MAKEFLAGS) $(EDKIIGLUE_DEFAULTS)\ + /f $(BUILD_DIR)\MeProtocolLib.mak all\ + "MY_INCLUDES=$(MeProtocolLib_INCLUDES)" \ + TYPE=LIBRARY \ +#********************************************************************** +#********************************************************************** +#** ** +#** (C)Copyright 1985-2006, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#********************************************************************** +#**********************************************************************
\ No newline at end of file diff --git a/ReferenceCode/ME/Protocol/MeProtocolLib.sdl b/ReferenceCode/ME/Protocol/MeProtocolLib.sdl new file mode 100644 index 0000000..ca3d3c3 --- /dev/null +++ b/ReferenceCode/ME/Protocol/MeProtocolLib.sdl @@ -0,0 +1,28 @@ +TOKEN + Name = "MeProtocolLib_SUPPORT" + Value = "1" + Help = "Main switch to enable MeProtocolLib support in Project" + TokenType = Boolean + TargetMAK = Yes + Master = Yes +End + +PATH + Name = "MeProtocolLib_DIR" +End + +MODULE + Help = "Includes MeProtocolLib.mak to Project" + File = "MeProtocolLib.mak" +End + +ELINK + Name = "MeProtocolLib_LIB" + InvokeOrder = ReplaceParent +End + +ELINK + Name = "$(BUILD_DIR)\MeProtocolLib.lib" + Parent = "MeProtocolLib_LIB" + InvokeOrder = AfterParent +End diff --git a/ReferenceCode/ME/Protocol/MeRcInfo/MeRcInfo.c b/ReferenceCode/ME/Protocol/MeRcInfo/MeRcInfo.c new file mode 100644 index 0000000..0dedc85 --- /dev/null +++ b/ReferenceCode/ME/Protocol/MeRcInfo/MeRcInfo.c @@ -0,0 +1,43 @@ +/** @file + +@brief + This file defines the Me Info Protocol. + +@copyright + Copyright (c) 2011 - 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 +**/ + +// +// Statements that include other files +// +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +#endif + +#include "MeRcInfo.h" + +// +// Protocol GUID definition +// +EFI_GUID gEfiMeRcInfoProtocolGuid = EFI_ME_RC_INFO_PROTOCOL_GUID; + +// +// Protocol description +// +EFI_GUID_STRING(&gEfiMeRcInfoProtocolGuid, "ME RC Info Protocol", "ME Reference Code Information Protocol"); diff --git a/ReferenceCode/ME/Protocol/MeRcInfo/MeRcInfo.h b/ReferenceCode/ME/Protocol/MeRcInfo/MeRcInfo.h new file mode 100644 index 0000000..1862f0d --- /dev/null +++ b/ReferenceCode/ME/Protocol/MeRcInfo/MeRcInfo.h @@ -0,0 +1,88 @@ +/** @file + This file defines the ME RC Info Protocol. + +@copyright + Copyright (c) 2011 - 2014 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 +**/ +#ifndef _ME_RC_INFO_H_ +#define _ME_RC_INFO_H_ + +/// +/// ME RC INFO protocol GUID +/// This protocol provides the version information for Me RC. +/// +#define EFI_ME_RC_INFO_PROTOCOL_GUID \ + { \ + 0x11fbfdfb, 0x10d2, 0x43e6, 0xb5, 0xb1, 0xb4, 0x38, 0x6e, 0xdc, 0xcb, 0x9a \ + } + +// +// Extern the GUID for protocol users. +// +extern EFI_GUID gEfiMeRcInfoProtocolGuid; + +/// +/// Revision 1: Original version +/// +#define ME_RC_INFO_PROTOCOL_REVISION_1 1 + +/** + Me Reference Code formats 0xAABBCCDD + DD - Build Number + CC - Reference Code Revision + BB - Reference Code Minor Version + AA - Reference Code Major Version + Example: Me Reference Code 0.7.1 should be 00 07 01 00 (0x00070100) +**/ +#define ME_RC_VERSION 0x01090000 +#define ME_FVI_STRING "Reference Code - ME 9.0" +#define ME_FVI_SMBIOS_TYPE 0xDD ///< Default value +#define ME_FVI_SMBIOS_INSTANCE 0x03 +#define MEBX_RC_VERSION 0xFFFFFFFF +#define MEBX_FVI_STRING "MEBx version" + +#define MEFW_VERSION \ + { \ + 0xFF, 0xFF, 0xFF, 0xFFFF \ + } +#define MEFW_FVI_STRING "ME Firmware Version" +#define MEFW_1_5M_STRING "1.5MB SKU" +#define MEFW_5M_STRING "5MB SKU " + +enum { + EnumMeRc = 0, ///< ME Reference Code Version + EnumMebx, ///< MEBx Version + EnumMeFw ///< ME FW Version +} ME_FVI_INDEX; + +/// +/// ME RC INFO protocol +/// This protocol provides the version information for Me RC. +/// +typedef struct _EFI_ME_RC_INFO_PROTOCOL { + /// + /// Revision for the protocol structure + /// + UINT8 Revision; + /** + Me Reference Code formats 0xAABBCCDD + DD - Build Number + CC - Reference Code Revision + BB - Reference Code Minor Version + AA - Reference Code Major Version + **/ + UINT32 RCVersion; +} EFI_ME_RC_INFO_PROTOCOL; +#endif diff --git a/ReferenceCode/ME/Protocol/MebxProtocol/MebxProtocol.c b/ReferenceCode/ME/Protocol/MebxProtocol/MebxProtocol.c new file mode 100644 index 0000000..1d81195 --- /dev/null +++ b/ReferenceCode/ME/Protocol/MebxProtocol/MebxProtocol.c @@ -0,0 +1,31 @@ +/** @file + EFI MEBx Protocol + +@copyright + Copyright (c) 1999 - 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 +**/ + +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +#include EFI_PROTOCOL_DEFINITION (MebxProtocol) +#endif + +EFI_GUID gEfiMebxProtocolGuid = INTEL_MEBX_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiMebxProtocolGuid, "EFI MEBx Protocol", "EFI 2.1 MEBx Protocol"); diff --git a/ReferenceCode/ME/Protocol/MebxProtocol/MebxProtocol.h b/ReferenceCode/ME/Protocol/MebxProtocol/MebxProtocol.h new file mode 100644 index 0000000..3ad33e8 --- /dev/null +++ b/ReferenceCode/ME/Protocol/MebxProtocol/MebxProtocol.h @@ -0,0 +1,72 @@ +/** @file + EFI MEBx Protocol + +@copyright + Copyright (c) 1999 - 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 +**/ +#ifndef _MEBX_PROTOCOL_H +#define _MEBX_PROTOCOL_H + +#define MEBX_CALLBACK_INFO_SIGNATURE EFI_SIGNATURE_32 ('m', 'e', 'b', 'x') + +#define MEBX_CALLBACK_INFO_FROM_THIS(a) CR (a, MEBX_CALLBACK_INFO, DriverCallback, MEBX_CALLBACK_INFO_SIGNATURE) + +#ifndef INTEL_MEBX_PROTOCOL_GUID +#define INTEL_MEBX_PROTOCOL_GUID \ + { \ + 0x01ab1829, 0xcecd, 0x4cfa, 0xa1, 0x8c, 0xea, 0x75, 0xd6, 0x6f, 0x3e, 0x74 \ + } +#endif + +typedef +EFI_STATUS +(EFIAPI *EFI_MEBX_API_ENTRY_POINT) ( + IN UINT32 BiosParams, + OUT UINT32 *MebxReturnValue + ); + +typedef struct _MEBX_VER { + UINT16 Major; + UINT16 Minor; + UINT16 Hotfix; + UINT16 Build; +} MEBX_VER; + +typedef enum { + MEBX_GRAPHICS_AUTO = 0, + MEBX_GRAPHICS_640X480, + MEBX_GRAPHICS_800X600, + MEBX_GRAPHICS_1024X768 +} MEBX_GRAPHICS_MODE; + +typedef enum { + MEBX_TEXT_AUTO = 0, + MEBX_TEXT_80X25, + MEBX_TEXT_100X31 +} MEBX_TEXT_MODE; + +typedef struct _EFI_MEBX_PROTOCOL { + MEBX_VER MebxVersion; + EFI_MEBX_API_ENTRY_POINT CoreMebxEntry; +} EFI_MEBX_PROTOCOL; + +typedef struct _MEBX_INSTANCE { + EFI_HANDLE Handle; + EFI_MEBX_PROTOCOL MebxProtocol; +} MEBX_INSTANCE; + +extern EFI_GUID gEfiMebxProtocolGuid; + +#endif diff --git a/ReferenceCode/ME/Protocol/PlatformMeHook/PlatformMeHook.c b/ReferenceCode/ME/Protocol/PlatformMeHook/PlatformMeHook.c new file mode 100644 index 0000000..c34ce99 --- /dev/null +++ b/ReferenceCode/ME/Protocol/PlatformMeHook/PlatformMeHook.c @@ -0,0 +1,43 @@ +/** @file + This file defines the Platform ME Hook function + +@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 +**/ + +// +// Statements that include other files +// +// +// External include files do NOT need to be explicitly specified in real EDKII +// environment +// +#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000) +#include "EdkIIGlueDxe.h" +// +// Include the protocol header file +// +#include EFI_PROTOCOL_DEFINITION (PlatformMeHook) +#endif +// +// Protocol GUID definition +// +EFI_GUID gPlatformMeHookProtocolGuid = PLATFORM_ME_HOOK_PROTOCOL_GUID; + +// +// Protocol description +// +EFI_GUID_STRING + (&gPlatformMeHookProtocolGuid, "PlatformMeHook Protocol", "Intel(R) DXE Phase ME Platform Hook Protocol"); diff --git a/ReferenceCode/ME/Protocol/PlatformMeHook/PlatformMeHook.h b/ReferenceCode/ME/Protocol/PlatformMeHook/PlatformMeHook.h new file mode 100644 index 0000000..eef2c47 --- /dev/null +++ b/ReferenceCode/ME/Protocol/PlatformMeHook/PlatformMeHook.h @@ -0,0 +1,64 @@ +/** @file + Interface definition details for platform hook support to ME module during DXE phase. + +@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 +**/ +#ifndef _PLATFORM_ME_HOOK_H_ +#define _PLATFORM_ME_HOOK_H_ + +/// +/// ME Hook provided by platform for DXE phase +/// This protocol provides an interface to hook reference code by OEM. +/// +#define PLATFORM_ME_HOOK_PROTOCOL_GUID \ + { \ + 0xbc52476e, 0xf67e, 0x4301, 0xb2, 0x62, 0x36, 0x9c, 0x48, 0x78, 0xaa, 0xc2 \ + } + +#define PLATFORM_ME_HOOK_PROTOCOL_REVISION 1 + +/** + Platform hook before BIOS sends Global Reset Heci Message to ME + + @param[in] None + + @retval EFI Status Code +**/ +typedef +EFI_STATUS +(EFIAPI *PLATFORM_ME_HOOK_PRE_GLOBAL_RESET) ( + VOID + ) +; + +/// +/// Platform Intel ME Hook Protocol +/// This protocol provides an interface to hook reference code by OEM. +/// +typedef struct _PLATFORM_ME_HOOK_PROTOCOL { + /// + /// Revision for the protocol structure + /// + UINT8 Revision; + /// + /// Function pointer for the hook called before BIOS sends Global Reset Heci Message to ME + /// + PLATFORM_ME_HOOK_PRE_GLOBAL_RESET PreGlobalReset; +} PLATFORM_ME_HOOK_PROTOCOL; + +extern EFI_GUID gPlatformMeHookProtocolGuid; + +#endif |