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 /Include/Protocol | |
download | zprj-master.tar.xz |
Diffstat (limited to 'Include/Protocol')
226 files changed, 38340 insertions, 0 deletions
diff --git a/Include/Protocol/AMIPostMgr.h b/Include/Protocol/AMIPostMgr.h new file mode 100644 index 0000000..b3e0974 --- /dev/null +++ b/Include/Protocol/AMIPostMgr.h @@ -0,0 +1,510 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 2013, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **// +//** **// +//** Phone (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +// $Archive: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Include/Protocol/AMIPostMgr.h $ +// +// $Author: Arunsb $ +// +// $Revision: 15 $ +// +// $Date: 5/02/14 6:16a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Include/Protocol/AMIPostMgr.h $ +// +// 15 5/02/14 6:16a Arunsb +// [TAG] EIP128665 +// [Category] Improvement +// [Description] Providing support to invalidate the BGRT status bit. +// [Files] protocol.c and amivfr.h +// +// 14 2/11/14 7:29p Arunsb +// Reverted the changes for 2.16.1243 label +// +// 13 9/13/13 2:04p Premkumara +// Uploaded back for EIP-128665 after TSEBootOnly 1240 release +// Files - Protocol.c, Protocol.h, AMIPostMgr.h +// +// 12 8/26/13 2:18a Premkumara +// Reverted back for BootOnly1240 release +// +// 10 10/18/12 5:44a Arunsb +// Updated for 2.16.1235 QA submission +// +// 11 10/10/12 12:24p Arunsb +// Synched the source for v2.16.1232 backup with Aptio +// +// 9 11/10/11 7:17p Blaines +// [TAG] - EIP 66860 +// [Category]- Function Request +// [Synopsis]- AmiPostManager interface for text entry. +// [Files] - LogoLib.h, AMIPostMgr.h, protocol.c, protocol.h, +// TseAdvanced.c, TseLitehelper.c, TseUefiHii.h, Uefi21Wapper.c +// +// Added new parameter to the function prototype DISPLAY_TEXT_KEY_VALIDATE +// +// 8 9/29/11 7:00p Blaines +// [TAG] - EIP 66860 +// [Category]- Function Request +// [Synopsis]- AmiPostManager interface for text entry. +// [Files] - LogoLib.h, AMIPostMgr.h, protocol.c, protocol.h, +// TseAdvanced.c, TseLitehelper.c, TseUefiHii.h, Uefi21Wapper.c +// +// 7 12/02/10 12:10p Madhans +// [TAG] - EIP 41838 +// [Category]- Enhancement +// [Severity]- Mordarate +// [Symptom]- Update AMI Post Manager Protocol witht he following. 2. +// Updating the interface PostManagerDisplayPostMessageEx to handle the +// cursor position properly. 2. Need to add new interface to GetAttribute +// To keep the GetAttribute to end of protocol. +// [Rootcause] - 1. Display string is over written by the next string if +// the interface PostManagerDisplayPostMessageEx used simultaneously. 2. +// Need to get the attribute info to use PostManagerDisplayPostMessage +// interfaces effectively +// [Solution]- Fix in string.c to handle cursor and line positions. The +// files Protocol.c, Protocol.h and AmiPostMgr.h have the new interface +// implementaion to get the attribute. +// [Files] - Protocol.c, Protocol.h, AmiPostMgr.h and string.c +// +// 6 11/23/10 5:14p Blaines +// [TAG] - EIP 45374 +// [Category]- Function Request +// [Synopsis]- Need method to configure Post Menu programmatically, Items +// requested +// - Exit Keys +// - Font Colors +// - Background Colors. +// [Solution] +// - Create hook to set window color, +// - Add AMI_POSTMENU_ATTRIB_EXIT_KEY attribute to POSTMENU_TEMPLATE to +// configure exit keys. +// [Files] - stylecommon.c, style.h, listbox.c, minisetupext.c, +// AMIPostMgr.h +// +// [TAG] - EIP 47962 +// [Category]- Defect +// [Symptom]- Post Manager's DisplayMsgBox displays a corrupted screen +// When the French or Japanese langues are selected and a call is made to +// DisplayMsgBox, the screen that is displayed is corrupted +// +// [Rootcause] +// The bounding box area of the message box is drawn, which may not span +// previous screen redraws. +// Therefore, artifacts from previous screen displays may appear. +// [Solution]- Clear the screen before drawing message box to clear +// artifacts from previous screen redraws. +// [Files] - TseAdvanced.c, AMIPostMgr.h, +// +// 5 11/16/10 9:00a Mallikarjunanv +// [TAG] - EIP 41838 +// [Category]- Enhancement +// [Severity]- Mordarate +// [Symptom]- Update AMI Post Manager Protocol witht he following. 2. +// Updating the interface PostManagerDisplayPostMessageEx to handle the +// cursor position properly. 2. Need to add new interface to GetAttribute +// [Rootcause] - 1. Display string is over written by the next string if +// the interface PostManagerDisplayPostMessageEx used simultaneously. 2. +// Need to get the attribute info to use PostManagerDisplayPostMessage +// interfaces effectively +// [Solution]- Fix in string.c to handle cursor and line positions. The +// files Protocol.c, Protocol.h and AmiPostMgr.h have the new interface +// implementaion to get the attribute. +// [Files] - Protocol.c, Protocol.h, AmiPostMgr.h and string.c +// +// 4 4/16/10 5:11p Madhans +// Changes for Tse 2.02. Please see Changelog.log for more details. +// +// 3 2/19/10 12:59p Madhans +// Updated for TSE 2.01. Refer Changelog.log for File change history. +// +// 4 2/19/10 8:03a Mallikarjunanv +// updated year in copyright message +// +// 3 2/04/10 12:01p Blaines +// EIP-28005 +// +// Added PostManagerSetAttribute to support display of text in color. +// Added support for handling string characters --- \n, \r. +// +// 2 6/24/09 6:33p Madhans +// Coding Standards. +// +// 2 6/24/09 11:55a Blaines +// Coding standard update +// +// 1 6/09/09 9:53a Madhans +// TSE 2.00.1201 +// +// 1 6/04/09 7:49p Madhans +// AMI TSE Advanced. +// +// 1 4/28/09 10:47p Madhans +// Tse 2.0 Code complete Checkin. +// +// 4 4/28/09 9:41p Madhans +// Tse 2.0 Code complete Checkin. +// +// 3 2/05/09 5:19p Madhans +// PostMgrStatus interface added. +// +// 2 1/30/09 6:06p Madhans +// Function headers added. +// +// +//*****************************************************************// +//*****************************************************************// +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: AMIPostMgr.h +// +// Description: AMI post manager protocol related code +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef _AMI_POSTMGR_H_ +#define _AMI_POSTMGR_H_ + +#define AMI_POST_MANAGER_PROTOCOL_GUID \ + { 0x8A91B1E1, 0x56C7, 0x4ADC, 0xAB, 0xEB, 0x1C, 0x2C, 0xA1, 0x72, 0x9E, 0xFF } + +#ifndef EFI_PROTOCOL_DEFINITION +#define TSE_STRINGIZE(a) #a +#define EFI_PROTOCOL_DEFINITION(a) TSE_STRINGIZE(Protocol/a.h) +#endif + +#include EFI_PROTOCOL_DEFINITION(GraphicsOutput) +#include EFI_PROTOCOL_DEFINITION(SimpleTextIn) + +#define AMI_POSTMENU_ATTRIB_FOCUS 0 +#define AMI_POSTMENU_ATTRIB_NON_FOCUS 1 +#define AMI_POSTMENU_ATTRIB_HIDDEN 2 +#define AMI_POSTMENU_ATTRIB_EXIT_KEY 3 + +#define TSE_WINDOW_TYPE_SETUP 0 +#define TSE_WINDOW_TYPE_POSTMENU 1 + +#define TSE_FILTER_KEY_NULL 0 +#define TSE_FILTER_KEY_NUMERIC 1 +#define TSE_FILTER_KEY_ALPHA 2 +#define TSE_FILTER_KEY_ALPHANUMERIC 3 +#define TSE_FILTER_KEY_CUSTOM 4 + + +typedef struct { + EFI_INPUT_KEY Key; + UINT32 KeyShiftState; +} AMI_POST_MGR_KEY; + +typedef struct _TEXT_INPUT_TEMPLATE +{ + UINT16 ItemToken; + UINT8 MaxSize; + UINT8 FilterKey; + BOOLEAN Hidden; + CHAR16 *Value; +} +TEXT_INPUT_TEMPLATE; + +typedef VOID (EFIAPI *POSTMENU_FUNCTION) (VOID *CallbackContext); + +typedef struct _POSTMENU_TEMPLATE +{ + UINT16 ItemToken; + AMI_POST_MGR_KEY Key; + POSTMENU_FUNCTION Callback; + VOID *CallbackContext; + UINT8 Attribute; +} +POSTMENU_TEMPLATE; + +typedef EFI_GRAPHICS_OUTPUT_BLT_PIXEL EFI_UGA_PIXEL; + +typedef enum _CO_ORD_ATTRIBUTE { +CA_AttributeLeftTop, +CA_AttributeCenterTop, +CA_AttributeRightTop, +CA_AttributeRightCenter, +CA_AttributeRightBottom, +CA_AttributeCenterBottom, +CA_AttributeLeftBottom, +CA_AttributeLeftCenter, +CA_AttributeCenter, +CA_AttributeCustomised +}CO_ORD_ATTRIBUTE; + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_HANDSHAKE) ( + VOID + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_DISPLAY_MESSAGE) ( + CHAR16 *Message + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_DISPLAY_MESSAGE_EX) ( + CHAR16 *Message, + UINTN Attribute + ); + +typedef +BOOLEAN +(EFIAPI *DISPLAY_TEXT_KEY_VALIDATE) ( + UINT16 ItemIndex, + UINT16 Unicode, + CHAR16 *Value +); + +//Post message ex attributes +#define PM_EX_DONT_ADVANCE_TO_NEXT_LINE 0x00000001 + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_DISPLAY_QUIETBOOT_MESSAGE) ( + CHAR16 *Message, + INTN CoOrdX, + INTN CoOrdY, + CO_ORD_ATTRIBUTE Attribute, + EFI_UGA_PIXEL Foreground, + EFI_UGA_PIXEL Background + ); + +//Message box types +#define MSGBOX_TYPE_NULL 0 +#define MSGBOX_TYPE_OK 1 +#define MSGBOX_TYPE_OKCANCEL 2 +#define MSGBOX_TYPE_YESNO 3 +#define MSGBOX_TYPE_CUSTOM 4 +//Message box result buttons +#define MSGBOX_OK 0 +#define MSGBOX_CANCEL 1 +#define MSGBOX_YES 0 +#define MSGBOX_NO 1 +typedef enum _MSGBOX_EX_CATAGORY { +MSGBOX_EX_CATAGORY_NORMAL, +MSGBOX_EX_CATAGORY_HELP, +MSGBOX_EX_CATAGORY_QUERY, +MSGBOX_EX_CATAGORY_SUCCESS, +MSGBOX_EX_CATAGORY_WARNING, +MSGBOX_EX_CATAGORY_ERROR, +MSGBOX_EX_CATAGORY_HALT, +MSGBOX_EX_CATAGORY_PROGRESS, +MSGBOX_EX_ATTRIB_CLEARSCREEN=0x1000, +} MSGBOX_EX_CATAGORY; + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_DISPLAY_MSG_BOX) ( + IN CHAR16 *MsgBoxTitle, + IN CHAR16 *Message, + IN UINT8 MsgBoxType, + OUT UINT8 *MsgBoxSel + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_DISPLAY_TEXT_BOX) ( + IN VOID *HiiHandle, + IN UINT16 TitleToken, + IN TEXT_INPUT_TEMPLATE *InputData, + IN UINT16 ItemCount, + IN DISPLAY_TEXT_KEY_VALIDATE DisplayTextKeyValidate + ); + + + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_SWITCH_TO_POST_SCREEN) (VOID); + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_SET_CURSOR_POSITION) ( + UINTN X, + UINTN Y + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_GET_CURSOR_POSITION) ( + UINTN *pX, + UINTN *pY + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_INIT_PROGRESSBAR) ( + UINTN x, + UINTN y, + UINTN w, + UINTN h, + UINTN delta + ); + + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_SET_PROGRESSBAR_POSITION) ( + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_SET_ATTRIBUTE) ( + UINT8 Attrib + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_GET_ATTRIBUTE) ( + UINT8 *Attrib + ); + + +typedef enum _TSE_POST_STATUS { +TSE_POST_STATUS_BEFORE_POST_SCREEN, // TSE Loaded and yet goto post screen +TSE_POST_STATUS_IN_POST_SCREEN, // In the post screen +TSE_POST_STATUS_IN_QUITE_BOOT_SCREEN, // In the quite boot screen +TSE_POST_STATUS_IN_BOOT_TIME_OUT, // Witing for Boot timeout +TSE_POST_STATUS_ENTERING_TSE, // Entering TSE +TSE_POST_STATUS_IN_TSE, // Inside TSE +TSE_POST_STATUS_IN_BBS_POPUP, // Inside BBS Poupup +TSE_POST_STATUS_PROCEED_TO_BOOT // Outside TSE and Booting or in Shell +}TSE_POST_STATUS; + +typedef +TSE_POST_STATUS +(EFIAPI *AMI_POST_MANAGER_POST_STATUS) ( + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_DISPLAY_INFO_BOX) ( + IN CHAR16 *InfoBoxTitle, + IN CHAR16 *InfoString, + IN UINTN Timeout, + OUT EFI_EVENT *Event + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_DISPLAY_MSG_BOX_EX) ( + IN CHAR16 *Title, + IN CHAR16 *Message, + IN CHAR16 *Legend, + IN MSGBOX_EX_CATAGORY MsgBoxExCatagory, + IN UINT8 MsgBoxType, + IN UINT16 *OptionPtrTokens, // Valid only with MSGBOX_TYPE_CUSTOM + IN UINT16 OptionCount, // Valid only with MSGBOX_TYPE_CUSTOM + IN AMI_POST_MGR_KEY *HotKeyList, // NULL - AnyKeyPress closes + IN UINT16 HotKeyListCount, + OUT UINT8 *MsgBoxSel, + OUT AMI_POST_MGR_KEY *OutKey +); + +// ProgressBoxState +#define AMI_PROGRESS_BOX_INIT 1 +#define AMI_PROGRESS_BOX_UPDATE 2 +#define AMI_PROGRESS_BOX_CLOSE 3 + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_DRAW_PROGRESS_BOX) ( +IN UINT8 ProgressBoxState, +IN CHAR16 *Title, +IN CHAR16 *Message, +IN CHAR16 *Legend, +IN UINTN Percent, // 0 - 100 +IN OUT VOID **Handle, //Out HANDLE. Valid Handle for update and close +OUT AMI_POST_MGR_KEY *OutKey //Out Key +); + + + +typedef +EFI_STATUS +(EFIAPI *AMI_POST_MANAGER_DISPLAY_MENU) ( + + IN VOID *HiiHandle, + IN UINT16 TitleToken, + IN UINT16 LegendToken, + IN POSTMENU_TEMPLATE *MenuData, + IN UINT16 MenuCount, + OUT UINT16 *pSelection +); + + +typedef struct _AMI_POST_MANAGER_PROTOCOL +{ + AMI_POST_MANAGER_HANDSHAKE Handshake; + AMI_POST_MANAGER_DISPLAY_MESSAGE DisplayPostMessage; + AMI_POST_MANAGER_DISPLAY_MESSAGE_EX DisplayPostMessageEx; + AMI_POST_MANAGER_DISPLAY_QUIETBOOT_MESSAGE DisplayQuietBootMessage; + AMI_POST_MANAGER_DISPLAY_MSG_BOX DisplayMsgBox; + AMI_POST_MANAGER_SWITCH_TO_POST_SCREEN SwitchToPostScreen; + AMI_POST_MANAGER_SET_CURSOR_POSITION SetCurPos; + AMI_POST_MANAGER_GET_CURSOR_POSITION GetCurPos; + AMI_POST_MANAGER_INIT_PROGRESSBAR InitProgressBar; + AMI_POST_MANAGER_SET_PROGRESSBAR_POSITION SetProgressBarPosition; + AMI_POST_MANAGER_POST_STATUS GetPostStatus; + AMI_POST_MANAGER_DISPLAY_INFO_BOX DisplayInfoBox; + AMI_POST_MANAGER_SET_ATTRIBUTE SetAttribute; + AMI_POST_MANAGER_DISPLAY_MENU DisplayPostMenu; + AMI_POST_MANAGER_DISPLAY_MSG_BOX_EX DisplayMsgBoxEx; + AMI_POST_MANAGER_DRAW_PROGRESS_BOX DisplayProgress; + AMI_POST_MANAGER_GET_ATTRIBUTE GetAttribute; //EIP-41838: New interface to get the attribute value + AMI_POST_MANAGER_DISPLAY_TEXT_BOX DisplayTextBox; +} +AMI_POST_MANAGER_PROTOCOL; + +extern EFI_GUID gAmiPostManagerProtocolGuid; + +//EIP 128665 starts +#define TSE_INVALIDATE_BGRT_STATUS_PROTOCOL_GUID \ + { 0x73905351, 0xeb4d, 0x4637, 0xa8, 0x3b, 0xd1, 0xbf, 0x6c, 0x1c, 0x48, 0xeb } + +typedef EFI_STATUS (EFIAPI *INVALIDATE_BGRT_STATUS) (void); +typedef struct _TSE_INVALIDATE_BGRT_STATUS_PROTOCOL +{ + INVALIDATE_BGRT_STATUS InvalidateBgrtStatusByProtocol; +}TSE_INVALIDATE_BGRT_STATUS_PROTOCOL; + +extern EFI_GUID gTSEInvalidateBgrtStatusProtocolGuid; +///EIP 128665 ends + +#endif /* _AMI_POSTMGR_H_ */ + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/AbsPointerProtocol.h b/Include/Protocol/AbsPointerProtocol.h new file mode 100644 index 0000000..d08ab4b --- /dev/null +++ b/Include/Protocol/AbsPointerProtocol.h @@ -0,0 +1,129 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/AbsPointerProtocol.h 1 4/15/10 3:58a Rameshr $ +// +// $Revision: 1 $ +// +// $Date: 4/15/10 3:58a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/AbsPointerProtocol.h $ +// +// 1 4/15/10 3:58a Rameshr +// Initial Check-in +// +// +//********************************************************************** + +//<AMI_FHDR_START> +//-------------------------------------------------------------------------- +// +// Name: AbsPointerProtocol.h +// +// Description: Absolute Pointer Protocol +// +//-------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __EFI_ABSOLUTE_POINTER_PROTOCOL_H__ +#define __EFI_ABSOLUTE_POINTER_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + +#define EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \ +{0x8D59D32B, 0xC655, 0x4AE9, 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43}; + +GUID_VARIABLE_DECLARATION(gEfiAbsolutePointerProtocolGuid,EFI_ABSOLUTE_POINTER_PROTOCOL_GUID); + +// Forward declaration +typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL EFI_ABSOLUTE_POINTER_PROTOCOL; + +#define EFI_ABSP_SupportsAltActive 0x00000001 +#define EFI_ABSP_SupportsPressureAsZ 0x00000002 + +// +//definitions of bits within ActiveButtons +// +#define EFI_ABSP_TouchActive 0x00000001 +#define EFI_ABS_AltActive 0x00000002 + +// +// EFI_ABSOLUTE_POINTER_STATE +// +typedef struct { + UINT64 CurrentX; + UINT64 CurrentY; + UINT64 CurrentZ; + UINT32 ActiveButtons; +} EFI_ABSOLUTE_POINTER_STATE; + +// +// EFI_ABSOLUTE_POINTER_MODE +// +typedef struct { + UINT64 AbsoluteMinX; + UINT64 AbsoluteMinY; + UINT64 AbsoluteMinZ; + UINT64 AbsoluteMaxX; + UINT64 AbsoluteMaxY; + UINT64 AbsoluteMaxZ; + UINT32 Attributes; +} EFI_ABSOLUTE_POINTER_MODE; + +typedef +EFI_STATUS +(EFIAPI *EFI_ABSOLUTE_POINTER_RESET) ( + IN EFI_ABSOLUTE_POINTER_PROTOCOL * This, + IN BOOLEAN ExtendedVerification + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_ABSOLUTE_POINTER_GET_STATE) ( + IN EFI_ABSOLUTE_POINTER_PROTOCOL * This, + IN OUT EFI_ABSOLUTE_POINTER_STATE * State + ); + +typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL { + EFI_ABSOLUTE_POINTER_RESET Reset; + EFI_ABSOLUTE_POINTER_GET_STATE GetState; + EFI_EVENT WaitForInput; + EFI_ABSOLUTE_POINTER_MODE *Mode; +} EFI_ABSOLUTE_POINTER_PROTOCOL; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + diff --git a/Include/Protocol/AcousticProtocol.cif b/Include/Protocol/AcousticProtocol.cif new file mode 100644 index 0000000..be40894 --- /dev/null +++ b/Include/Protocol/AcousticProtocol.cif @@ -0,0 +1,8 @@ +<component> + name = "AcousticProtocol" + category = ModulePart + LocalRoot = "Include\Protocol" + RefName = "AcousticProtocol" +[files] +"AcousticProtocol.h" +<endComponent> diff --git a/Include/Protocol/AcousticProtocol.h b/Include/Protocol/AcousticProtocol.h new file mode 100644 index 0000000..1ea3332 --- /dev/null +++ b/Include/Protocol/AcousticProtocol.h @@ -0,0 +1,101 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/HddAcoustic/AcousticProtocol.h 2 2/10/11 11:31a Pats $ +// +// $Revision: 2 $ +// +// $Date: 2/10/11 11:31a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/HddAcoustic/AcousticProtocol.h $ +// +// 2 2/10/11 11:31a Pats +// [TAG] - EIP 52920 +// [Category]- Function Request +// [Severity]- Minor +// [Symptom] - The Acoustic mode (Bypass/Quiet/Max Performance) of port 5 +// is invalid on AMD SB700. +// [RootCause] - Special case where 2nd controller counts by incrementing +// device number only not handled properly +// [Solution] - Added another item (ControllerNumber) to protocol. +// [Files] - Acoustic.c, AcousticBoard.c, AcousticSetup.c, +// AcousticProtocol.n +// +// 1 1/05/11 12:22a Rameshr +// Initial check-in for Hdd Acoustic Management Support. +// +//********************************************************************** + +//<AMI_FHDR_START> +//-------------------------------------------------------------------------- +// +// Name: AcousticProtocol.h +// +// Description: Header file that has protocol structure for Acoustic Module. +// +//-------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef _AcousticProtocol_H +#define _AcousticProtocol_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <Efi.h> + +#define ACOUSTIC_SETUP_PROTOCOL_GUID\ + { 0xc1d7859d, 0x5719, 0x46c3, 0xa2, 0x98, 0xd0, 0x71, 0xe3, 0x2, 0x64, 0xd1 } + +// Equates used for Acoustic Flags +#define ACOUSTIC_SUPPORT_DISABLE 0x00 +#define ACOUSTIC_SUPPORT_ENABLE 0x01 +#define ACOUSTIC_LEVEL_BYPASS 0xFF +#define ACOUSTIC_LEVEL_MAXIMUM_PERFORMANCE 0xFE +#define ACOUSTIC_LEVEL_QUIET 0x80 + +typedef struct { + UINT8 DeviceCount; // Should be updated by the Protocol installer + UINT8 ControllerNumber; + UINT8 AcousticPwrMgmt; + UINT8 AcousticLevel; + UINT8 *DeviceDetected; + UINT8 *AcousticLevelIndv; // Each byte is for a port. For IDE mode it is PM, PS, SM and SS. + // If there is any translation it has to be done at a later stage. + UINT8 *AcousticSupportIndv; +}ACOUSTIC_SETUP_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/AcpiSupport.h b/Include/Protocol/AcpiSupport.h new file mode 100644 index 0000000..ed25c33 --- /dev/null +++ b/Include/Protocol/AcpiSupport.h @@ -0,0 +1,124 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/AcpiSupport.h 9 6/16/11 3:26p Felixp $Revision: 6 $ +// +// $Date: 6/16/11 3:26p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/AcpiSupport.h $ +// +// 9 6/16/11 3:26p Felixp +// Surround backward compatibility definitions with #if +// BACKWARD_COMPATIBLE_MODE +// +// 8 5/27/11 5:53p Felixp +// Headers are updated to improve separation of the Framework and PI +// interfaces. +// The definitions that will be removed in the future versions are marked +// with the comments. +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: AcpiSupport.h +// +// Description: Definition of the ACPI Support protocol. +// This is defined in the Tiano ACPI External +// Product Specification, revision 0.5.1. +// +//********************************************************************** +#ifndef __ACPI_SUPPORT_PROTOCOL_H__ +#define __ACPI_SUPPORT_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +/****** DO NOT WRITE ABOVE THIS LINE *******/ +//********************************************************************** +#include <EFI.h> + +// ACPI Support Protocol GUID +#define EFI_ACPI_SUPPORT_GUID \ + {0xdbff9d55, 0x89b7, 0x46da, 0xbd, 0xdf, 0x67, 0x7d, 0x3d, 0xc0, 0x24, 0x1d } + +GUID_VARIABLE_DECLARATION(gEfiAcpiSupportGuid,EFI_ACPI_SUPPORT_GUID); + +#include <Protocol/AcpiSystemDescriptionTable.h> + +// Forward reference +typedef struct _EFI_ACPI_SUPPORT_PROTOCOL EFI_ACPI_SUPPORT_PROTOCOL; + +//********************************************************************** +// Protocol Data Definitions +#define EFI_ACPI_TABLE_VERSION_X (EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0 | EFI_ACPI_TABLE_VERSION_4_0) +#define EFI_ACPI_TABLE_VERSION_ALL (EFI_ACPI_TABLE_VERSION_1_0B|EFI_ACPI_TABLE_VERSION_X) + +//********************************************************************** +// Protocol Member Functions +//********************************************************************** + +// Retrieve a copy of an ACPI table and the handle of the table. +typedef EFI_STATUS (EFIAPI *EFI_ACPI_GET_ACPI_TABLE) ( + IN EFI_ACPI_SUPPORT_PROTOCOL *This, + IN INTN Index, + OUT VOID **Table, + OUT EFI_ACPI_TABLE_VERSION *Version, + OUT UINTN *Handle ); + +// Add, update, or remove a table. +typedef EFI_STATUS (EFIAPI *EFI_ACPI_SET_ACPI_TABLE) ( + IN EFI_ACPI_SUPPORT_PROTOCOL *This, + IN VOID *Table OPTIONAL, + IN BOOLEAN Checksum, + IN EFI_ACPI_TABLE_VERSION Version, + IN OUT UINTN *Handle ); + +// Publish tables to the outside world +typedef EFI_STATUS (EFIAPI *EFI_ACPI_PUBLISH_TABLES) ( + IN EFI_ACPI_SUPPORT_PROTOCOL *This, + IN EFI_ACPI_TABLE_VERSION Version ); + +// ACPI Support Protocol +typedef struct _EFI_ACPI_SUPPORT_PROTOCOL { + EFI_ACPI_GET_ACPI_TABLE GetAcpiTable; + EFI_ACPI_SET_ACPI_TABLE SetAcpiTable; + EFI_ACPI_PUBLISH_TABLES PublishTables; +} EFI_ACPI_SUPPORT_PROTOCOL; + +#if BACKWARD_COMPATIBLE_MODE +#include <Protocol/AcpiTable.h> +#endif + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif //_ACPI_SUPPORT_PROTOCOL_H +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + diff --git a/Include/Protocol/AcpiSystemDescriptionTable.h b/Include/Protocol/AcpiSystemDescriptionTable.h new file mode 100644 index 0000000..7af72e2 --- /dev/null +++ b/Include/Protocol/AcpiSystemDescriptionTable.h @@ -0,0 +1,209 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Include/Protocol/AcpiSystemDescriptionTable.h 1 5/27/11 5:52p Felixp $ +// +// $Revision: 1 $ +// +// $Date: 5/27/11 5:52p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/AcpiSystemDescriptionTable.h $ +// +// 1 5/27/11 5:52p Felixp +// +// 1 5/13/11 4:50p Yakovlevs +// [TAG] EIP 56526 +// [Category] New Feature +// [Description] ACPI Manipulation Protocol Initial Checkin + +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: AcpiSystemDescriptionTable.h +// +// Description: +// Definition of PI 1.2 Vol 5 ACPI System Description Table Protocol. +// +//<AMI_FHDR_END> +//************************************************************************* + +#ifndef __ACPI_SYSTEM_DESCRIPTION_TABLE_H___ +#define __ACPI_SYSTEM_DESCRIPTION_TABLE_H___ +#ifdef __cplusplus +extern "C" { +#endif + +#include <Efi.h> + +#define EFI_ACPI_SDT_PROTOCOL_GUID \ + { 0xeb97088e, 0xcfdf, 0x49c6, 0xbe, 0x4b, 0xd9, 0x6, 0xa5, 0xb2, 0xe, 0x86 } + +GUID_VARIABLE_DECLARATION(gEfiAcpiSdtProtocolGuid, EFI_ACPI_SDT_PROTOCOL_GUID); + +typedef UINT32 EFI_ACPI_TABLE_VERSION; +typedef VOID *EFI_ACPI_HANDLE; + +//********************************************************************** +// ACPI Version bitmap definition: +// +// EFI_ACPI_TABLE_VERSION_1_0B - ACPI Version 1.0b (not supported curently) +// EFI_ACPI_TABLE_VERSION_2_0 - ACPI Version 2.0 +// EFI_ACPI_TABLE_VERSION_NONE - No ACPI Versions. This might be used +// to create memory-based operation regions or other information +// that is not part of the ACPI "tree" but must still be found +// in ACPI memory space and/or managed by the core ACPI driver. +// +//********************************************************************** +#define EFI_ACPI_TABLE_VERSION_NONE (1 << 0) +#define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1) +#define EFI_ACPI_TABLE_VERSION_2_0 (1 << 2) +#define EFI_ACPI_TABLE_VERSION_3_0 (1 << 3) +#define EFI_ACPI_TABLE_VERSION_4_0 (1 << 4) + +typedef UINT32 EFI_ACPI_DATA_TYPE; +#define EFI_ACPI_DATA_TYPE_NONE 0 +#define EFI_ACPI_DATA_TYPE_OPCODE 1 +#define EFI_ACPI_DATA_TYPE_NAME_STRING 2 +#define EFI_ACPI_DATA_TYPE_OP 3 +#define EFI_ACPI_DATA_TYPE_UINT 4 +#define EFI_ACPI_DATA_TYPE_STRING 5 +#define EFI_ACPI_DATA_TYPE_CHILD 6 + +typedef struct { + UINT32 Signature; + UINT32 Length; + UINT8 Revision; + UINT8 Checksum; + CHAR8 OemId[6]; + CHAR8 OemTableId[8]; + UINT32 OemRevision; + UINT32 CreatorId; + UINT32 CreatorRevision; +} EFI_ACPI_SDT_HEADER; + +typedef +EFI_STATUS +(EFIAPI *EFI_ACPI_NOTIFICATION_FN)( + IN EFI_ACPI_SDT_HEADER *Table, ///< A pointer to the ACPI table header. + IN EFI_ACPI_TABLE_VERSION Version, ///< The ACPI table's version. + IN UINTN TableKey ///< The table key for this ACPI table. +); + +typedef +EFI_STATUS +(EFIAPI *EFI_ACPI_GET_ACPI_TABLE2)( + IN UINTN Index, + OUT EFI_ACPI_SDT_HEADER **Table, + OUT EFI_ACPI_TABLE_VERSION *Version, + OUT UINTN *TableKey +); + +typedef +EFI_STATUS +(EFIAPI *EFI_ACPI_REGISTER_NOTIFY)( + IN BOOLEAN Register, + IN EFI_ACPI_NOTIFICATION_FN Notification +); + +typedef +EFI_STATUS +(EFIAPI *EFI_ACPI_OPEN)( + IN VOID *Buffer, + OUT EFI_ACPI_HANDLE *Handle +); + +typedef +EFI_STATUS +(EFIAPI *EFI_ACPI_OPEN_SDT)( + IN UINTN TableKey, + OUT EFI_ACPI_HANDLE *Handle +); + +typedef +EFI_STATUS +(EFIAPI *EFI_ACPI_CLOSE)( + IN EFI_ACPI_HANDLE Handle +); + +typedef +EFI_STATUS +(EFIAPI *EFI_ACPI_GET_CHILD)( + IN EFI_ACPI_HANDLE ParentHandle, + IN OUT EFI_ACPI_HANDLE *Handle +); + +typedef +EFI_STATUS +(EFIAPI *EFI_ACPI_GET_OPTION)( + IN EFI_ACPI_HANDLE Handle, + IN UINTN Index, + OUT EFI_ACPI_DATA_TYPE *DataType, + OUT CONST VOID **Data, + OUT UINTN *DataSize +); + +typedef +EFI_STATUS +(EFIAPI *EFI_ACPI_SET_OPTION)( + IN EFI_ACPI_HANDLE Handle, + IN UINTN Index, + IN CONST VOID *Data, + IN UINTN DataSize +); + +typedef +EFI_STATUS +(EFIAPI *EFI_ACPI_FIND_PATH)( + IN EFI_ACPI_HANDLE HandleIn, + IN VOID *AcpiPath, + OUT EFI_ACPI_HANDLE *HandleOut +); + +typedef struct _EFI_ACPI_SDT_PROTOCOL { + // Specifies the ACPI version supported by this protocol. + EFI_ACPI_TABLE_VERSION AcpiVersion; + EFI_ACPI_GET_ACPI_TABLE2 GetAcpiTable; + EFI_ACPI_REGISTER_NOTIFY RegisterNotify; + EFI_ACPI_OPEN Open; + EFI_ACPI_OPEN_SDT OpenSdt; + EFI_ACPI_CLOSE Close; + EFI_ACPI_GET_CHILD GetChild; + EFI_ACPI_GET_OPTION GetOption; + EFI_ACPI_SET_OPTION SetOption; + EFI_ACPI_FIND_PATH FindPath; +} EFI_ACPI_SDT_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif // __ACPI_SYSTEM_DESCRIPTION_TABLE_H___ + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/AcpiTable.h b/Include/Protocol/AcpiTable.h new file mode 100644 index 0000000..8c0aaf0 --- /dev/null +++ b/Include/Protocol/AcpiTable.h @@ -0,0 +1,88 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/AcpiTable.h 1 5/27/11 5:52p Felixp $ +// +// $Revision: 1 $ +// +// $Date: 5/27/11 5:52p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/AcpiTable.h $ +// +// 1 5/27/11 5:52p Felixp +// +// 6 1/13/10 2:13p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: AcpiTable.h +// +// Description: AcpiTable Protocol +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __ACPI_TABLE_PROTOCOL__H__ +#define __ACPI_TABLE_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_ACPI_TABLE_PROTOCOL_GUID \ + { 0xffe06bdd, 0x6107, 0x46a6, 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c } + +GUID_VARIABLE_DECLARATION(gEfiAcpiTableProtocolGuid,EFI_ACPI_TABLE_PROTOCOL_GUID); + +// Forward reference +typedef struct _EFI_ACPI_TABLE_PROTOCOL EFI_ACPI_TABLE_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_ACPI_TABLE_INSTALL_ACPI_TABLE)( + IN CONST EFI_ACPI_TABLE_PROTOCOL *This, + IN CONST VOID *AcpiTableBuffer, + IN UINTN AcpiTableBufferSize, + OUT UINTN *TableKey +); + +typedef EFI_STATUS (EFIAPI *EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE)( + IN CONST EFI_ACPI_TABLE_PROTOCOL *This, + IN UINTN TableKey +); + +struct _EFI_ACPI_TABLE_PROTOCOL { + EFI_ACPI_TABLE_INSTALL_ACPI_TABLE InstallAcpiTable; + EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE UninstallAcpiTable; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif // __ACPI_TABLE_PROTOCOL__H__ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/AhciSmmProtocol.h b/Include/Protocol/AhciSmmProtocol.h new file mode 100644 index 0000000..a93aca0 --- /dev/null +++ b/Include/Protocol/AhciSmmProtocol.h @@ -0,0 +1,183 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/AHCI/AhciSmm/AhciSmmProtocol.h 7 11/24/14 11:57p Kapilporwal $ +// +// $Revision: 7 $ +// +// $Date: 11/24/14 11:57p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/AHCI/AhciSmm/AhciSmmProtocol.h $ +// +// 7 11/24/14 11:57p Kapilporwal +// [TAG] EIP191939 +// [Category] Improvement +// [Description] Issue about BIG_REAL_MODE_MMIO_ACCESS of AHCI module +// [Files] AI13.bin +// AHCIACC.ASM +// AhciInt13Dxe.c +// AhciInt13Dxe.dxs +// AhciInt13Smm.c +// AhciInt13Smm.cif +// AhciInt13Smm.dxs +// AhciInt13Smm.h +// AhciInt13Smm.mak +// AhciInt13Smm.sdl +// AInt13.c +// Aint13.cif +// AInt13.h +// AhciSmm.c +// AhciSmm.h +// AhciSmmProtocol.h +// +// 6 5/05/11 7:39a Rameshr +// [TAG] EIP51884 +// [Category] Bug Fix +// [Severity] Minor +// [Symptom] Build error in pervious EIP 51884 check-in +// [RootCause] Atapi structure was missing. +// [Solution] Added Atapi Structure into AHCI_BUS_SMM_PROTOCOL +// [Files] AhciSmmProtocol.h +// +// 5 3/15/11 4:13a Rameshr +// [TAG]- EIP 51884 +// [Category]- New Feature +// [Description]- Added packet command function in AhciSMM for sending +// command in SMM handler +// [Files]- AhciSmm.c, AhciSmm.h, AhciSmmProtocols.h +// +// 4 2/11/11 4:12a Rameshr +// [TAG] EIP53704 +// [Category] Improvement +// [Description] AMI headers update for Alaska Ahci Driver +// [Files] AhciSmmProtocol.h +// +// 3 5/07/10 2:31p Krishnakumarg +// Updated the date in AMI header +// +// 2 5/07/10 11:48a Krishnakumarg +// Updated the AMI Header +// +// 1 4/28/09 6:39p Rameshr +// Initial Check-in +// +// +//********************************************************************** + +//<AMI_FHDR_START> +//-------------------------------------------------------------------------- +// +// Name: AHCISmmProtocol.h +// +// Description: Protocol definition +// +//-------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef _EFI_AHCI_SMM_PROTOCOLS_H_ +#define _EFI_AHCI_SMM_PROTOCOLS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define AHCI_SMM_PROTOCOL_GUID \ + {0xB2FA5764, 0x3B6E, 0x43D3, 0x91, 0xDF, 0x87, 0xD1, 0x5A, 0x3E, 0x56, 0x68} + +GUID_VARIABLE_DECLARATION(gAhciSmmProtocolGuid,AHCI_SMM_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION + +#include <Protocol\PAhciBus.h> + +typedef struct _AHCI_BUS_SMM_PROTOCOL AHCI_BUS_SMM_PROTOCOL; + +typedef EFI_STATUS (*EFI_AHCI_SMM_SATA_DEV_PIO_DATA_IN) ( + IN AHCI_BUS_SMM_PROTOCOL *SataDevInterface, + IN OUT COMMAND_STRUCTURE *CommandStructure, + UINT8 PortNumber, + UINT8 PMPortNumber, + DEVICE_TYPE DeviceType, + IN BOOLEAN READWRITE + +); + +typedef EFI_STATUS (*EFI_AHCI_SMM_SATA_DEV_DMA_DATA_IN) ( + IN AHCI_BUS_SMM_PROTOCOL *SataDevInterface, + IN OUT COMMAND_STRUCTURE *CommandStructure, + UINT8 PortNumber, + UINT8 PMPortNumber, + DEVICE_TYPE DeviceType, + IN BOOLEAN READWRITE +); + +typedef EFI_STATUS (*EFI_AHCI_SMM_SATA_DEV_NON_DATA_CMD) ( + IN AHCI_BUS_SMM_PROTOCOL *SataDevInterface, + IN COMMAND_STRUCTURE CommandStructure, + UINT8 PortNumber, + UINT8 PMPortNumber, + DEVICE_TYPE DeviceType +); + +typedef EFI_STATUS (*EFI_AHCI_SMM_SATA_DEV_PACKET_CMD) ( + IN AHCI_BUS_SMM_PROTOCOL *SataDevInterface, + IN COMMAND_STRUCTURE *CommandStructure, + IN BOOLEAN READWRITE, + UINT8 PortNumber, + UINT8 PMPortNumber, + DEVICE_TYPE DeviceType +); + +typedef EFI_STATUS (*EFI_AHCI_SMM_INIT_ON_S3) ( + IN AHCI_BUS_SMM_PROTOCOL *SataDevInterface, + IN UINT8 Port +); + +typedef struct _AHCI_BUS_SMM_PROTOCOL{ + UINT64 AhciBaseAddress; + UINT32 PortCommandTableBaseAddr; + UINT32 PortCommandListBaseAddr; + UINT32 PortFISBaseAddr; + UINT8 PortNumber; + UINT8 PMPortNumber; + DEVICE_TYPE DeviceType; + ATAPI_DEVICE AtapiDevice; + EFI_AHCI_SMM_INIT_ON_S3 AhciSmmInitPortOnS3Resume; + EFI_AHCI_SMM_SATA_DEV_PIO_DATA_IN AhciSmmExecutePioDataCommand; + EFI_AHCI_SMM_SATA_DEV_DMA_DATA_IN AhciSmmExecuteDmaDataCommand; + EFI_AHCI_SMM_SATA_DEV_NON_DATA_CMD AhciSmmExecuteNonDataCommand; + EFI_AHCI_SMM_SATA_DEV_PACKET_CMD AhciSmmExecutePacketCommand; +}AHCI_BUS_SMM_PROTOCOL; + +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/AhciSmmProtocols.CIF b/Include/Protocol/AhciSmmProtocols.CIF new file mode 100644 index 0000000..0fc5c9c --- /dev/null +++ b/Include/Protocol/AhciSmmProtocols.CIF @@ -0,0 +1,8 @@ +<component> + name = "AhciSmmProtocols" + category = ModulePart + LocalRoot = "INCLUDE\Protocol" + RefName = "AhciSmmProtocols" +[files] +"AhciSmmProtocol.h" +<endComponent> diff --git a/Include/Protocol/AmiBoardInfo.h b/Include/Protocol/AmiBoardInfo.h new file mode 100644 index 0000000..883aadd --- /dev/null +++ b/Include/Protocol/AmiBoardInfo.h @@ -0,0 +1,362 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Modules/BoardInfo/Protocol/AmiBoardInfo.h 3 9/30/11 5:43p Yakovlevs $ +// +// $Revision: 3 $ +// +// $Date: 9/30/11 5:43p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Modules/BoardInfo/Protocol/AmiBoardInfo.h $ +// +// 3 9/30/11 5:43p Yakovlevs +// [TAG] EIP66222 +// [Category] New Feature +// [Description] Modify PCI bus driver to get board info from separate +// FFS section +// [Files] AmiBoaardInfo.mak; +// AmiBoaardInfo.sdl; +// PciBoard.c +// AmiBoaardInfo.h +// +// 2 3/01/10 5:06p Yakovlevs +// New separate Label with generic Multi-Root support. +// Uses new AMI SDL "C" sytle output for the former "ASM" style. +// +// 1 5/18/09 2:49p Yakovlevs +// +// 1 4/28/09 1:26p Yakovlevs +// +// 5 1/30/09 12:53p Yakovlevs +// Added Porting Function declaration EIP 8874 +// +// 4 11/14/08 1:37p Yakovlevs +// Declared NEW AMI Board Info Protocol +// +// 3 10/01/08 7:10p Yakovlevs +// Updated AMI FUNC HEADER information. +// +// 2 10/01/08 12:46p Yakovlevs +// Added missing constants associated with PCI BUS TOKENS +// +// 1 9/25/08 11:29a Yakovlevs + + +#ifndef AMI_BOARD_INFO_H_ +#define AMI_BOARD_INFO_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + +#include <Efi.h> +#include <Token.h> + +//Define AmiBoardInfo Protocol Intreface GUID +#define AMI_BOARD_INFO_PROTOCOL_GUID \ +{ 0x0273146c, 0x96c4, 0x45a1, 0xa7, 0xaf, 0x78, 0xe0, 0x52, 0x4a, 0x0a, 0xe2 } + +#define AMI_BOARD_INFO_SECTION_GUID \ +{ 0xE6F4F8F7, 0x4992, 0x47b2, 0x83, 0x02, 0x85, 0x08, 0x74, 0x5E, 0x4A, 0x23 } + +GUID_VARIABLE_DECLARATION(gAmiBoardInfoProtocolGuid,AMI_BOARD_INFO_PROTOCOL_GUID); + +GUID_VARIABLE_DECLARATION(gAmiBoardInfoSectionGuid, AMI_BOARD_INFO_SECTION_GUID); + +#ifndef GUID_VARIABLE_DEFINITION + +//------------------------------------------------- +//Forward Declarations +//------------------------------------------------- +typedef struct _AMI_BOARD_INFO_PROTOCOL AMI_BOARD_INFO_PROTOCOL; + + +//SDL Binary Signature Defifnition +#define AMI_PIR_SIGNATURE 0x52495024 //"$PIR" Legacy PCI IRQ Routing +#define AMI_AIR_SIGNATURE 0x52494124 //"$AIR" IO APIC IRQ Routing +#define AMI_APD_SIGNATURE 0x44504124 //"$APD" APIC Data Structure +#define AMI_XLT_SIGNATURE 0x544C5824 //"$XLT" APIC Data Structure + +///////////////////////////////////////////////////////////////////////////// +//--------------------------------------------------------------------------- +//Define Internal VeB Structures +//Use BYTE alignment since tis stuff comes from ASM file. +//--------------------------------------------------------------------------- +#pragma pack(push, 1) + +typedef struct _AMI_SDL_IRQR_HDR { + UINT32 Sugnature; //"$PIR" or "$AIR" + UINT16 Version; //Version 0x100 + UINT16 Size; //Size 0x142 data + header + UINT8 RouterBus; //bRouterBus 0 + UINT8 RouterDevFunc; //bRouterDevFunc 0 + UINT16 ExclusiveIRQ; // + UINT32 CompatibleRouter;// + UINT32 MiniPortData; // + UINT32 SlotCount; //Number of Non-hotplug devices + UINT32 HpSlotCount; //Number of Hotplug devices Total slots == SlotsCounrt+ HpSlotsCount + UINT8 Reserved [3]; //0,0,0 + UINT8 Checksum; //0 +} AMI_SDL_IRQR_HDR; + +typedef struct _AMI_SDL_INFO_HDR { + UINT32 Sugnature; //"$XLT" or "$APD" + UINT16 Size; +} AMI_SDL_INFO_HDR; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: PCI_DEV_FUN +// +// Description: UNION of UINT8 and a Structure used to describe AMISDL format +// for PCI Device Function Package. Packed PCI DEV/FUNCTION number. +// +// Fields: +// Name Type Description +// ------------------------------------------------------------------ +// DEV_FUN UINT8 Device / Function all together +// Fun UINT8 PCI Device's Function# +// Dev UINT8 PCI Device's Device# +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef union _PCI_DEV_FUN { + UINT8 DEV_FUN; + struct { + UINT8 Fun : 3; + UINT8 Dev : 5; + }; +} PCI_DEV_FUN; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: PCI_PIC_IRQ_DATA +// +// Description: Structure used to describe PCI IRQ Router Register and available +// IRQ MASK used by AMISDL output format. +// +// Fields: +// Name Type Description +// ------------------------------------------------------------------ +// ChipsetReg UINT8 Chipset register number +// IrqMask UINT16 IRQ MASK for legacy Interrupts +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _PCI_PIC_IRQ_DATA { + UINT8 ChipsetReg; + UINT16 IrqMask; +} PCI_PIC_IRQ_DATA; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: PCI_IRQ_PIC_ROUTE +// +// Description: Structure used to describe Legacy (PIC) IRQ Routing Information. +// AUTOGENERATED DATA. +// +// Fields: +// Name Type Description +// ------------------------------------------------------------------ +// PciBusNumber UINT8 PCI Bus # +// DevFun PCI_DEV_FUN PCI Device # \ Function # +// PciIrq[4] PCI_PIC_IRQ_DATA Register \ IRQ MASK +// SlotNum UINT8 Pci Slot # or 0 if embeded device +// Reserved UINT8 +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _PCI_IRQ_PIC_ROUTE { + UINT8 PciBusNumber; + PCI_DEV_FUN DevFun; + PCI_PIC_IRQ_DATA PciIrq[4]; + UINT8 SlotNum; + UINT8 Reserved; +} PCI_IRQ_PIC_ROUTE; + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: PCI_APIC_IRQ_DATA +// +// Description: Structure used to describe (APIC) IRQ Routing DATA. +// +// Fields: +// Name Type Description +// ------------------------------------------------------------------ +// IoApicItin UINT8 IO/APIC INTIN pin +// IoApicId UINT8 IO/APIC ID value +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _PCI_APIC_IRQ_DATA { + UINT8 IoApicItin; + UINT8 IoApicId; +} PCI_APIC_IRQ_DATA; + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: PCI_IRQ_APIC_ROUTE +// +// Description: Structure used to describe Extended (IO/APIC) IRQ Routing +// Information. AUTOGENERATED DATA. +// +// Fields: +// Name Type Description +// ------------------------------------------------------------------ +// PciBusNumber UINT8 PCI Bus # +// DeviceNumber UINT8 PCI Device # +// Intn[4] PCI_APIC_IRQ_DATA APIC IRQ Routing Info. +// Reserved UINT8 +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _PCI_IRQ_APIC_ROUTE { + UINT8 PciBusNumber; + UINT8 DeviceNumber; + PCI_APIC_IRQ_DATA Intn[4]; + UINT8 Reserved; +} PCI_IRQ_APIC_ROUTE; + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: PCI_BUS_XLAT_HDR +// +// Description: Structure used to describe Extended (IO/APIC) IRQ Routing +// Information. AUTOGENERATED DATA. +// +// Fields: +// Name Type Description +// ------------------------------------------------------------------ +// BusBuild UINT8 PCI Bus# Assigned at BIOS build time +// BusRun UINT8 PCI Bus# Assigned at run time +// Bridge[] PCI_DEV_FUN Describes bridges chain +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _PCI_BUS_XLAT_HDR { + UINT8 BusBuild; + UINT8 BusRun; +// PCI_DEV_FUN Bridge[]; +// UINT8 Terminator==0xFF; +// CAHR8 AslName[5]; //0 terminates ASL Name (4 Letters) +} PCI_BUS_XLAT_HDR; + + +typedef union _AMI_IOAPIC_ADDRESS{ + UINT32 ADDRESS; + struct { + UINT32 Func : 8; + UINT32 Dev : 8; + UINT32 Bus : 8; + UINT32 Seg : 8; + }; +}AMI_IOAPIC_ADDRESS; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: AMI_APIC_INFO +// +// Description: Structure used to describe IO/APIC Information +// +// Fields: +// Name Type Description +// ------------------------------------------------------------------ +// BusBuild UINT8 PCI Bus# Assigned at BIOS build time +// BusRun UINT8 PCI Bus# Assigned at run time +// Bridge[] PCI_DEV_FUN Describes bridges chain +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _AMI_APIC_INFO { + AMI_IOAPIC_ADDRESS ApicAddress; + UINT8 ApicIdBuild; + UINT8 ApicIdRun; + UINT8 VectorBase; +} AMI_APIC_INFO; + + +#pragma pack(pop) + +//---------------------------------------------------------------------------- +//Definition of AMI Board Info Protocol. +//All PCI related VeB configuration output files +//generated based on PCI Portibg using VeB Wizards +typedef struct _AMI_BOARD_INFO_PROTOCOL { + BOOLEAN DataValid; //Signifies if Board Specific IRQ data was updated. + UINT16 BusXlatEntries; + UINT16 SdlPciIrqMask; //rth_pci_dedicated_irqs_equ value from IQR_C output. + UINT8 Reserved[3]; + PCI_BUS_XLAT_HDR *BusXlatTable; + UINTN BusXlatLength; + PCI_IRQ_PIC_ROUTE *PicRoutTable; + UINTN PicRoutLength; + PCI_IRQ_PIC_ROUTE *HpSltTablePic; + UINTN HpSltPicLength; + PCI_IRQ_APIC_ROUTE *ApicRoutTable; + UINTN ApicRoutLength; + PCI_IRQ_APIC_ROUTE *HpSltTableApic; + UINTN HpSltApicLength; + AMI_APIC_INFO *ApicInfoTable; + UINTN ApicInfoLength; + VOID *BoardAcpiInfo; + VOID *BoardOemInfo; +} AMI_BOARD_INFO_PROTOCOL; + +/* +#define AMI_SDL_PICR_SIG 0x52495024 +#define AMI_SDL_APICR_SIG 0x52494124 +#define AMI_SDL_XLAT_SIG 0x52494124 + + + +typedef struct _AMI_BOARD_INFO_IRQ_HEADER + 0x24, 0x50, 0x49, 0x52, // $PIR + 0x00, 0x01, // Version 0x100 + 0xF0, 0x01, // Size 0x1F0 + 0x00, // bRouterBus 0 + 0x00, // bRouterDevFunc 0 + 0x00, 0x00, // wExclusiveIRQ 0 + 0x00, 0x00, 0x00, 0x00, // dCompatibleRouter 0 + 0x00, 0x00, 0x00, 0x00, // dMiniPortData 0 + 0x00, 0x00, 0x00, 0x12, //Number of Non-hotplug devices + 0x00, 0x00, 0x00, 0x00, //Number of Hotplug devices + 0x00, 0x00, 0x00, // Reserved [3] + 0x00 // Checksum 0??? +*/ + + +#endif //ifndef GUID_VARIABLE_DEFINITION + +/****** DO NOT WRITE BELOW THIS LINE *******/ + +#ifdef __cplusplus +} +#endif +#endif //AMI_BOARD_INFO_H_ + + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + diff --git a/Include/Protocol/AmiCpuInfo.h b/Include/Protocol/AmiCpuInfo.h new file mode 100644 index 0000000..46a6699 --- /dev/null +++ b/Include/Protocol/AmiCpuInfo.h @@ -0,0 +1,154 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2008, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuProtocols/AmiCpuInfo.h 2 6/16/14 4:51a Davidhsieh $ +// +// $Revision: 2 $ +// +// $Date: 6/16/14 4:51a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuProtocols/AmiCpuInfo.h $ +// +// 2 6/16/14 4:51a Davidhsieh +// [TAG] None +// [Category] Improvement +// [Description] Support the cache size which bigger than 0x8000MB +// [Files] AmiCpuInfo.h, CpuSmbios.c +// +// 1 2/07/12 3:59a Davidhsieh +// +// 1 5/06/11 6:08a Davidhsieh +// First release +// +// 2 3/04/09 10:45a Markw +// Update copyright header. +// +// 1 11/02/07 1:59p Markw +// +// 1 11/02/07 1:45p Markw +// +// 7 7/23/07 7:58p Markw +// +// 6 3/23/07 9:54a Markw +// Updated headers. +// +// 5 2/23/07 12:23p Markw +// Added comments. +// +// 4 1/31/07 3:03p Markw +// Added providing EMT64 CPU support. +// +// 3 7/21/05 10:12p Markw +// Fixed AmiCpuInfo. +// +// 2 7/20/05 3:54p Markw +// Updated CACHE_INFO. +// +// 1 7/19/05 10:18a Markw +// +//********************************************************************** + +//<AMI_FHDR_START> +//--------------------------------------------------------------------------- +// Name: AmiCpuInfo.h +// +// Description: AMI CPU INFO protocol header. +// +//<AMI_FHDR_END> +//--------------------------------------------------------------------------- + +#ifndef _AMI_CPU_INFO_H_ +#define _AMI_CPU_INFO_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + +//F109F361-370C-4d9c-B1AB-7CA2D4C8B3FF +#define AMI_CPU_INFO_PROTOCOL_GUID \ + {0xf109f361,0x370c,0x4d9c,0xb1,0xab,0x7c,0xa2,0xd4,0xc8,0xb3,0xff} + +typedef struct _AMI_CPU_INFO_PROTOCOL AMI_CPU_INFO_PROTOCOL; + +typedef struct { + UINT8 Desc; + UINT8 Level; + UINT8 Type; //0 - Data, 1 - Instruction, 3 - Unified + UINT32 Size; + UINT8 Associativity; +} CACHE_DESCRIPTOR_INFO; + + +typedef struct { + UINT32 Version; + UINT64 Features; + CHAR8 *BrandString; + BOOLEAN X64Supported; + UINT8 NumCores; //Number of Cores. Ex. If Dual core, 2 cores. + UINT8 NumHts; //Number of Hyper threading. This will be 0 or 2. + UINT32 FSBFreq; //MT/s + UINT32 IntendedFreq; //MHz + UINT32 ActualFreq; //MHz + UINT32 Voltage; // Volt / 10000. + UINT32 MicroCodeVers; + CACHE_DESCRIPTOR_INFO *CacheInfo; + BOOLEAN Ht0; //Set if core is hyper-threadding logical CPU. + //True, if not-hyperthreaded CPU. +} AMI_CPU_INFO; + + +//CPU = 0, 1, 2, ... +//CPU number is ordered by APIC ID. +//The CPUs are also ordered (because APIC ID) that +// for example if dual core hyper-threading then +// CPU 0 = CORE0, HT0 +// CPU 1 = CORE0, HT1 +// CPU 2 = CORE1, HT0 +// CPU 3 = CORE1, HT1 +typedef EFI_STATUS (*GET_CPU_INFO) ( + IN AMI_CPU_INFO_PROTOCOL *This, + IN UINTN Cpu, + OUT AMI_CPU_INFO **Info +); + +struct _AMI_CPU_INFO_PROTOCOL { + GET_CPU_INFO GetCpuInfo; +}; + + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2008, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/AmiCpuInfo2.h b/Include/Protocol/AmiCpuInfo2.h new file mode 100644 index 0000000..5ec045c --- /dev/null +++ b/Include/Protocol/AmiCpuInfo2.h @@ -0,0 +1,236 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2008, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuProtocols/AmiCpuInfo2.h 1 2/07/12 3:59a Davidhsieh $ +// +// $Revision: 1 $ +// +// $Date: 2/07/12 3:59a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuProtocols/AmiCpuInfo2.h $ +// +// 1 2/07/12 3:59a Davidhsieh +// +// 1 5/06/11 6:08a Davidhsieh +// First release +// +// 8 1/03/11 3:56p Markw +// [TAG] EIP47298 +// [Category] New Feature +// [Description] Add ability to get cache information using the AMI CPU +// INFO 2 Protocol for setup. +// [Files] AmiCpuInfo2.h, CpuDxeBoard.c +// +// 7 8/11/09 3:39p Markw +// EIP #24914 - Add early local x2APIC support. Add flag to AMI CPU INFO 2 +// Protocol. +// +// 6 5/21/09 11:31p Markw +// Add ASL Processor object path to ACPI_PROCESSOR_INFO. +// +// 5 5/04/09 5:00p Markw +// EIP #17903 Add to GetAcpiInfo to AmiCpuInfo2 Protocol. This updates +// fields for MP table. +// +// 4 4/30/09 5:48p Markw +// EIP #17903 Add to GetAcpiInfo to AmiCpuInfo2 Protocol. This is to +// provide correct ordering for Nehalem in APIC table. +// +// 3 3/04/09 10:45a Markw +// Update copyright header. +// +// 2 11/10/08 6:47p Markw +// Update Ami Cpu Info 2 Protocol. +// +// 1 11/05/08 11:11a Markw +// +//********************************************************************** + +//<AMI_FHDR_START> +//--------------------------------------------------------------------------- +// Name: AmiCpuInfo2.h +// +// Description: AMI CPU INFO 2 protocol header. +// +//<AMI_FHDR_END> +//--------------------------------------------------------------------------- + +#ifndef _AMI_CPU_INFO_2_H_ +#define _AMI_CPU_INFO_2_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// {AC9CF0A8-E551-4be2-AD0A-E1B564EEA273} +#define AMI_CPU_INFO_2_PROTOCOL_GUID \ + {0xac9cf0a8, 0xe551, 0x4be2, 0xad, 0xa, 0xe1, 0xb5, 0x64, 0xee, 0xa2, 0x73} + +/////////////// +//ACPI Data +////////////// + +//Table Type 0// +//The Local APIC in MADT and MP should be filled in order of table entries. +//The length may be increased, so to be compatible with earlier version, get the +// next entry by using length instead of sizeof(ACPI_PROCESSOR_INFO) or array. + +#define ACPI_PROCESSOR_INFO_TYPE 0 +#define ACPI_PROC_INFO_xAPIC 0 +#define ACPI_PROC_INFO_x2APIC 1 + +//When adding to structure, use only types with the same size for x32 and x64, +//so length can be used to determine supported features. +//This means no VOID* and no UINTN. + +typedef struct { + UINT32 Type; //0 + UINT32 Length; //Note: Find next structure by length. + UINT32 Enable; + UINT32 Bsp; //0 or 1 + UINT32 Package; + UINT32 Core; + UINT32 Thread; //Thread of processor 0 or 1. + UINT32 ApicId; //APIC ID of processor. + UINT32 ApicVer; + UINT32 CpuSignature; //Used by MPS table. + UINT32 FeatureFlags; //Used by MPS table. + UINT32 ProcId; //ASL processor object ID. + EFI_PHYSICAL_ADDRESS ProcObjPath; //ASL Processor Object Path. + //Only if Length >= 60. + UINT32 LocalApicType; //0 - xApic, 1 - x2Apic +} ACPI_PROCESSOR_INFO; + + +typedef struct _AMI_CPU_INFO_2_PROTOCOL AMI_CPU_INFO_2_PROTOCOL; + +#define AMI_CPU_INFO_2_FLAGS_NUM_DIS_CORES_VALID 1 +#define AMI_CPU_INFO_2_FLAGS_NUM_DIS_THRDS_VALID 2 + +typedef EFI_STATUS (*GET_NUM_PACKAGES) ( + IN AMI_CPU_INFO_2_PROTOCOL *This, + OUT UINT32 *NumPopulatedPackages, + OUT UINT32 *NumBoardSockets OPTIONAL +); + + +typedef EFI_STATUS (*GET_NUM_CORES_THREADS) ( + IN AMI_CPU_INFO_2_PROTOCOL *This, + IN UINT32 Package, + OUT UINT32 *NumEnabledCores, + OUT UINT32 *NumEnabledThreads, + OUT UINT32 *NumDisabledCores OPTIONAL, + OUT UINT32 *NumDisabledThreads OPTIONAL +); + +typedef EFI_STATUS (*GET_NUM_THREADS) ( + IN AMI_CPU_INFO_2_PROTOCOL *This, + IN UINT32 Package, + IN UINT32 Core, + OUT UINT32 *NumEnabledThreads, + OUT UINT32 *NumDisabledThreads OPTIONAL +); + +typedef EFI_STATUS (*GET_SBSP) ( + IN AMI_CPU_INFO_2_PROTOCOL *This, + OUT UINT32 *Package, + OUT UINT32 *Core, + OUT UINT32 *Thread +); + +typedef EFI_STATUS (*GET_APIC_INFO) ( + IN AMI_CPU_INFO_2_PROTOCOL *This, + IN UINT32 Package, + IN UINT32 Core, + IN UINT32 Thread, + OUT UINT32 *ApicId, + OUT UINT32 *ApicVer OPTIONAL +); + +typedef EFI_STATUS (*GET_ACPI_INFO) ( + IN AMI_CPU_INFO_2_PROTOCOL *This, + OUT VOID **AcpiData, + OUT UINT32 *NumEntries +); + +#define AMI_CPU_INFO_2_CACHE_TYPE_DATA 0 +#define AMI_CPU_INFO_2_CACHE_TYPE_CODE 1 +#define AMI_CPU_INFO_2_CACHE_TYPE_UNIFIED 2 + +#define AMI_CPU_INFO_2_CACHE_SHARED_CORE 1 +#define AMI_CPU_INFO_2_CACHE_SHARED_PACKAGE 2 + +typedef struct { + UINT32 LengthDesc; //Later updates may increase this. + UINT32 Level; + UINT32 Size; + UINT32 Type; + UINT32 Associativity; + UINT32 Shared; +} AMI_CPU_INFO_2_CACHE_DESCR; + +typedef EFI_STATUS (*GET_PACKAGE_CACHE_DESCR) ( + IN AMI_CPU_INFO_2_PROTOCOL *This, + IN UINT32 Package, + OUT AMI_CPU_INFO_2_CACHE_DESCR **Description, + OUT UINT32 *NumEntries +); + +typedef EFI_STATUS (*GET_CORE_CACHE_DESCR) ( + IN AMI_CPU_INFO_2_PROTOCOL *This, + IN UINT32 Package, + IN UINT32 Core, + OUT AMI_CPU_INFO_2_CACHE_DESCR **Description, + OUT UINT32 *NumEntries +); + +struct _AMI_CPU_INFO_2_PROTOCOL { + //Protocol Ver 0 + UINT32 ProtocolVer; + UINT64 Flags; + GET_NUM_PACKAGES GetNumPackages; + GET_NUM_CORES_THREADS GetNumCoresThreads; + GET_NUM_THREADS GetNumThreads; + GET_SBSP GetSbsp; + GET_APIC_INFO GetApicInfo; + //Protocol Ver 1 + GET_ACPI_INFO GetAcpiInfo; + //Protocol Ver 2 + GET_PACKAGE_CACHE_DESCR GetPackageCacheDesc; + GET_CORE_CACHE_DESCR GetCoreCacheDesc; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2008, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/AmiDigitalSignature.h b/Include/Protocol/AmiDigitalSignature.h new file mode 100644 index 0000000..d8cdeff --- /dev/null +++ b/Include/Protocol/AmiDigitalSignature.h @@ -0,0 +1,316 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Modules/CryptoPkg/Protocol/AmiDigitalSignature.h 11 8/15/13 9:44a Alexp $ +// +// $Revision: 11 $ +// +// $Date: 8/15/13 9:44a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/CryptoPkg/Protocol/AmiDigitalSignature.h $ +// +// 11 8/15/13 9:44a Alexp +// Add UEFI TimeStamp certificate definitions; add new Pkcs7 operation +// code-Pkcs7TimeStampCertVerifyGet +// +// 10 8/02/13 4:27p Alexp +// Add temporary defines for new Hash types with noPad +// +// 9 8/01/13 6:45p Alexp +// temp add TIME STAMP type definitions per UEFI ECR#1009 +// +// 8 7/11/13 4:06p Alexp +// EIP#118850:Develop functionality per UEFI Mantis ticket (ECR)#1009 +// add new Pkcs7 operator: Pkcs7TimeStampCertValidate +// +// 7 8/22/12 4:38p Alexp +// Added new Pkcs7Parse operations: +// Pkcs7CertValidateGetSignerKey, +// Pkcs7CertGetMatchInCertChain, +// Pkcs7CertValidateGetCAKey, +// Pkcs7GetCAKey, Pkcs7GetSignerKey +// +// 5 4/09/12 4:49p Alexp +// Add new Pkcs7Verify operand::Pkcs7CertValidateGetMatchInCertChain +// +// 4 2/29/12 3:59p Alexp +// Add VerifyKey Protocol function to match to Crypto PEI API. +// +// 3 6/10/11 6:21p Alexp +// added new Pkcs7 parse Operation: Pkcs7CertValidateGetSignerKeyHash +// +// 2 5/10/11 6:57p Alexp +// include all Crypto related Guid Variable declarations +// +// 1 5/06/11 6:11p Alexp +// initial module release +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: AmiDigitalSignature.h +// +// Description: AMI Digital Signature Protocol Definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __AMI_DIGITAL_SIGNATURE_DXE__H__ +#define __AMI_DIGITAL_SIGNATURE_DXE__H__ +#ifdef __cplusplus +extern "C" { +#endif + +// All are EDKII defined headers +#include <Protocol/Hash.h> +#include <ImageAuthentication.h> + +// Flags to define type of signature to process +#define EFI_CRYPT_RSASSA_PKCS1V15 1 +#define EFI_CRYPT_RSASSA_PSS 2 + +/// +/// SHA-1 digest size in bytes. +/// +#define SHA1_DIGEST_SIZE 20 +/// +/// SHA-256 digest size in bytes +/// +#define SHA256_DIGEST_SIZE 32 + +#define DEFAULT_RSA_KEY_MODULUS_LEN 256 // 2048 bits +#define DEFAULT_RSA_SIG_LEN DEFAULT_RSA_KEY_MODULUS_LEN // This is true as long as > data + +#define AMI_DIGITAL_SIGNATURE_PROTOCOL_GUID \ + { 0x5f87ba17, 0x957d, 0x433d, 0x9e, 0x15, 0xc0, 0xe7, 0xc8, 0x79, 0x88, 0x99 } + +#define AMI_SMM_DIGITAL_SIGNATURE_PROTOCOL_GUID \ + { 0x91ABC830, 0x16FC, 0x4D9E, 0xA1, 0x89, 0x5F, 0xC8, 0xBB, 0x41, 0x14, 0x02 } + +GUID_VARIABLE_DECLARATION(gAmiDigitalSignatureProtocolGuid, AMI_DIGITAL_SIGNATURE_PROTOCOL_GUID); +GUID_VARIABLE_DECLARATION(gAmiSmmDigitalSignatureProtocolGuid, AMI_SMM_DIGITAL_SIGNATURE_PROTOCOL_GUID); + +// Common Crypt construction type: ASN1 PubKey, Hash sha256, etc. +typedef struct{ + EFI_GUID AlgGuid; + UINT32 BlobSize; + UINT8 *Blob; +} CRYPT_HANDLE; + +//********************************************************************** +//<AMI_THDR_START> +// +// Name: PKCS7_OPERATIONS +// +// Description: Enumerated Pkcs7 Operations. +// List of different Pkcs7 verify tasks to perform: +// +// Fields: Name Number Description +// ------------------------------------------------------------ +// Pkcs7Arg0 0 Function presence check. Must return EFI_SUCCESS +// Pkcs7CertValidate 1 Validate Certificate +// Pkcs7GetSignerCert 2 Return Signer Certificate in *Data. Performs cert chaining and time based validity tests +// Pkcs7GetCACert 3 Return Root CA certificate referenced by Signer. Used to compare with Trusted Cert in FW +// Pkcs7ValidateRootCert 4 Validate Root Certificate +// x509ValidateCertChain 5 Validate Signer Certificate Chain +// Pkcs7GetDigestAlgorithm 6 Return Signature Digest Algorithm +// Pkcs7CertValidateGetCACert 7 Validate Pkcs7 Cert, return Root CA Certificate +// Pkcs7CertValidateGetSignerCert 8 Validate Pkcs7 Cert, return Signer Certificate +// Pkcs7CertValidateGetSignerKeyHash 9 Validate Pkcs7 Cert, return Signer Key Hash (SHA256) +// Pkcs7CertValidateGetMatchInCertChain 10 Validate Pkcs7 Cert and return Success if match is found between Trust and any leaf certificates in the Pkcs7 Signer chain +// Pkcs7CertValidateGetSignerKey 11 Validate Pkcs7 Cert, return ptr in *Data to n-modulus of a Signer Key +// Pkcs7CertGetMatchInCertChain 12 Return Success if match is found between Trust and any leaf certificates in the Signer chain +// Pkcs7CertValidateGetCAKey 13 Validate Pkcs7 Cert, return ptr in *Data to n-modulus of a Root CA Key +// Pkcs7GetCAKey 14 Return ptr in *Data to n-modulus of a Root CA Key +// Pkcs7GetSignerKey 15 Return ptr in *Data to n-modulus of a Signer Key +// Pkcs7TimeStampCertValidateGet 16 Validate TimeStamp certificate chain in Pkcs7 Certificate. Return TimeOfSigning +//<AMI_THDR_END> +//********************************************************************** +typedef enum { + Pkcs7Arg0, + Pkcs7CertValidate, + Pkcs7GetSignerCert, + Pkcs7GetCACert, + Pkcs7ValidateRootCert, + x509ValidateCertChain, + Pkcs7GetDigestAlgorithm, + Pkcs7CertValidateGetCACert, + Pkcs7CertValidateGetSignerCert, + Pkcs7CertValidateGetSignerKeyHash, + Pkcs7CertValidateGetMatchInCertChain, // obsolete + Pkcs7CertValidateGetSignerKey, + Pkcs7CertGetMatchInCertChain, + Pkcs7CertValidateGetCAKey, + Pkcs7GetCAKey, + Pkcs7GetSignerKey, + Pkcs7TimeStampCertValidateGet +} PKCS7_OP; + +typedef enum { SHA1, SHA256, SHA384, SHA512} HASH_ALG; + +typedef struct _AMI_DIGITAL_SIGNATURE_PROTOCOL AMI_DIGITAL_SIGNATURE_PROTOCOL; + +typedef +EFI_STATUS +(EFIAPI *AMI_DIGITAL_SIGNATURE_PKCS1_VERIFY) ( + IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, + IN CRYPT_HANDLE *PublicKey, + IN CRYPT_HANDLE *Hash, + IN VOID *Signature, + IN UINTN SignatureSize, + IN UINT32 Flags +); + +typedef +EFI_STATUS +(EFIAPI *AMI_DIGITAL_SIGNATURE_PKCS7_VERIFY) ( + IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, + IN CONST UINT8 *P7Data, + IN UINTN P7Size, + IN CONST UINT8 *TrustedCert, + IN UINTN CertSize, + IN OUT UINT8 **Data, + IN OUT UINTN *DataSize, + IN UINT8 Operation, + IN UINT32 Flags +); + +typedef +EFI_STATUS +(EFIAPI *AMI_DIGITAL_SIGNATURE_HASH) ( + IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, + IN CONST EFI_GUID *HashAlgorithm, + IN UINTN Num_elem, + IN CONST UINT8 *Addr[], + IN CONST UINTN *Len, + OUT UINT8 *Hash +); + +typedef +EFI_STATUS +(EFIAPI *AMI_DIGITAL_SIGNATURE_GET_KEY) ( + IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, + OUT CRYPT_HANDLE *Key, + IN EFI_GUID *AlgId, + IN UINTN KeyLen, + IN UINT32 Flags + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_DIGITAL_SIGNATURE_VERIFY_KEY) ( + IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This, + IN EFI_GUID *AlgId, + IN CRYPT_HANDLE *Key + ); +/* +Structure mutex +Mutual exclusion (mutex) semaphore locking mechanism used to serialise interthread intraprocess activities. + +Usage example: + mutex = identifier + +LOCK: + Lock the given mutex. Only one function owner can have the mutex locked at any time. + A caller that attempts to lock a mutex already locked by another caller will receive ACCESS_DENIED untill mutex owner unlocks the mutex. + +UNLOCK: + Unlock the given mutex. Other callers trying to lock the mutex/use the function will succeed. + +RELEASE + Releases Lock on exit from the function: + +CHECK: + Does not change the state of Mutex Lock state +*/ +typedef enum { RESET, LOCK, RELEASE, KEEP} RESET_MMGR; + +typedef struct _AMI_DIGITAL_SIGNATURE_PROTOCOL { + AMI_DIGITAL_SIGNATURE_PKCS1_VERIFY Pkcs1Verify; + AMI_DIGITAL_SIGNATURE_PKCS7_VERIFY Pkcs7Verify; + AMI_DIGITAL_SIGNATURE_HASH Hash; + AMI_DIGITAL_SIGNATURE_GET_KEY GetKey; + AMI_DIGITAL_SIGNATURE_VERIFY_KEY VerifyKey; +}; + +//********************************************************************** +// NEW UEFI 2.3.1c hash types +//********************************************************************** +#ifndef EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID +#define EFI_HASH_ALGORITHM_SHA1_NOPAD_GUID \ + { \ + 0x24c5dc2f, 0x53e2,0x40ca,{0x9e, 0xd6, 0xa5, 0xd9,0xa4, 0x9f, 0x46, 0x3b} \ + } +#define EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID \ + { \ + 0x8628752a, 0x6cb7, 0x4814, {0x96, 0xfc, 0x24, 0xa8,0x15, 0xac, 0x22, 0x26} \ + } +GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha1NoPadGuid,EFI_HASH_ALGORITHM_SHA1_NOPAD_GUID); +GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha256NoPadGuid,EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID); +#endif +//********************************************************************** +// NEW TIME STAMP definitions ECR#1009 +//********************************************************************** +#ifndef EFI_CERT_X509_SHA256_GUID +#define EFI_CERT_X509_SHA256_GUID \ + { 0x3bd2a492, 0x96c0, 0x4079, 0xb4, 0x20, 0xfc, 0xf9, 0x8e, 0xf1, 0x03, 0xed } +#define EFI_CERT_X509_SHA384_GUID \ + { 0x7076876e, 0x80c2, 0x4ee6, 0xaa, 0xd2, 0x28, 0xb3, 0x49, 0xa6, 0x86, 0x5b } +#define EFI_CERT_X509_SHA512_GUID \ + { 0x446dbf63, 0x2502, 0x4cda, 0xbc, 0xfa, 0x24, 0x65, 0xd2, 0xb0, 0xfe, 0x9d } + +GUID_VARIABLE_DECLARATION(gEfiCertX509Sha256Guid, EFI_CERT_X509_SHA256_GUID); +GUID_VARIABLE_DECLARATION(gEfiCertX509Sha384Guid, EFI_CERT_X509_SHA384_GUID); +GUID_VARIABLE_DECLARATION(gEfiCertX509Sha512Guid, EFI_CERT_X509_SHA512_GUID); + +typedef struct _EFI_CERT_X509_SHA256 { + EFI_SHA256_HASH ToBeSignedHash; + EFI_TIME TimeOfRevocation; +} EFI_CERT_X509_SHA256; + +typedef struct _EFI_CERT_X509_SHA384 { + EFI_SHA384_HASH ToBeSignedHash; + EFI_TIME TimeOfRevocation; +} EFI_CERT_X509_SHA384; + +typedef struct _EFI_CERT_X509_SHA512 { + EFI_SHA512_HASH ToBeSignedHash; + EFI_TIME TimeOfRevocation; +} EFI_CERT_X509_SHA512; + +#endif +//********************************************************************** +// NEW TIME STAMP definitions ECR#1009 +//********************************************************************** + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif // __AMI_DIGITAL_SIGNATURE_DXE__H__ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//*********************************************************************** diff --git a/Include/Protocol/AmiInternalSmmComm.h b/Include/Protocol/AmiInternalSmmComm.h new file mode 100644 index 0000000..fad3128 --- /dev/null +++ b/Include/Protocol/AmiInternalSmmComm.h @@ -0,0 +1,84 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/AmiInternalSmmComm.h 1 4/15/11 4:43p Markw $ +// +// $Revision: 1 $ +// +// $Date: 4/15/11 4:43p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/AmiInternalSmmComm.h $ +// +// 1 4/15/11 4:43p Markw +// [TAG] EIP57440 +// [Category] New Feature +// [Description] Add PI 1.1 SMM Communicate support. +// [Files] Smm.cif, SmmCommunicate.cif, SmmCommunicate.sdl, +// SmmCommunicate.c, SmmCommunicate.dxs, SmmDxeCommunicate.dxs, +// SmmCommunicate.mak, SmmPiProtocols.cif, SmmCommunication.h, +// AmiInternalSmmComm.h +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: AmiInternalSmmComm.h +// +// Description: Protocol used by SmmCommunication to Communication DXE driver know SMM has been installed. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __AMI_INT_SMM_COMM_H__ +#define __AMI_INT_SMM_COMM_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// {B27DAB38-9814-4e06-A5A2-65AE9A14258F} +#define AMI_INT_SMM_COMM_PROTOCOL_GUID \ + {0xb27dab38, 0x9814, 0x4e06, 0xa5, 0xa2, 0x65, 0xae, 0x9a, 0x14, 0x25, 0x8f} + +GUID_VARIABLE_DECLARATION(gAmiIntSmmCommProtocolGuid,AMI_INT_SMM_COMM_PROTOCOL_GUID); + +//Currently this is a NULL protocol. + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/AmiKeycode.h b/Include/Protocol/AmiKeycode.h new file mode 100644 index 0000000..3d53d03 --- /dev/null +++ b/Include/Protocol/AmiKeycode.h @@ -0,0 +1,152 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/AmiKeycode.h 1 6/04/13 1:51a Thomaschen $ +// +// $Revision: 1 $ +// +// $Date: 6/04/13 1:51a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/AmiKeycode.h $ +// +// 1 6/04/13 1:51a Thomaschen +// Fixed for EIP118202. +// +// 10 10/25/12 2:36a Deepthins +// [TAG] EIP99475 +// [Category] Improvement +// [Description] Multi language module Support in the console splitter +// [Files] ConSplit.c, ConSplit.h , In.c and AmiKeycode.h +// +// 9 7/21/11 3:57p Artems +// EIP 64356: Combine common keyboard definitions in one file +// +// 8 10/13/09 6:06p Felixp +// Hii.h renamed to UefiHii.h +// +// 7 10/09/09 3:53p Felixp +// UEFI 2.1 related changes (new protocols added; existing protocols +// updated; one protocol deleted). +// +// 6 8/21/09 10:19a Felixp +// define GUID_VARIABLE_DECLARATION macro only if it has not been already +// defined. +// +// 5 10/23/07 4:37p Olegi +// Added PS2ScanCode field to the protocol. +// +// 4 9/18/07 11:52a Olegi +// +// 3 9/18/07 11:43a Olegi +// +// 2 9/17/07 3:53p Olegi +// Removed EFI.H inclusion so that this header file can be also used in +// EDK drivers. +// +// 1 9/07/07 4:35p Olegi +// +// 2 8/24/07 3:03p Olegi +// +// 1 8/23/07 2:44p Olegi +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: AmiKeycode.h +// +// Description: AMI_EFIKEYCODE_PROTOCOL definition +// +// Note: Currently this file is used both in Aptio and EDK files (MiniSetup.h) +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __AMI_KEYCODE_PROTOCOL_H__ +#define __AMI_KEYCODE_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> +#include <KeyboardCommonDefinitions.h> + +#ifndef GUID_VARIABLE_DECLARATION +#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable +#endif + +#define AMI_EFIKEYCODE_PROTOCOL_GUID \ + {0x0adfb62d, 0xff74, 0x484c, 0x89, 0x44, 0xf8, 0x5c, 0x4b, 0xea, 0x87, 0xa8} + +#define AMI_MULTI_LANG_SUPPORT_PROTOCOL_GUID \ + {0xb295bd1c, 0x63e3, 0x48e3, 0xb2, 0x65, 0xf7, 0xdf, 0xa2, 0x7, 0x1, 0x23} +GUID_VARIABLE_DECLARATION(gAmiEfiKeycodeProtocolGuid,AMI_EFIKEYCODE_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION + +#include <Protocol/SimpleTextInEx.h> + +typedef struct _AMI_EFIKEYCODE_PROTOCOL AMI_EFIKEYCODE_PROTOCOL; +typedef struct _AMI_MULTI_LANG_SUPPORT_PROTOCOL AMI_MULTI_LANG_SUPPORT_PROTOCOL; + +typedef struct { + EFI_INPUT_KEY Key; + EFI_KEY_STATE KeyState; + EFI_KEY EfiKey; + UINT8 EfiKeyIsValid; + UINT8 PS2ScanCode; + UINT8 PS2ScanCodeIsValid; +} AMI_EFI_KEY_DATA; + +typedef EFI_STATUS (EFIAPI *AMI_READ_EFI_KEY) ( + IN AMI_EFIKEYCODE_PROTOCOL *This, + OUT AMI_EFI_KEY_DATA *KeyData +); + +typedef struct _AMI_EFIKEYCODE_PROTOCOL { + EFI_INPUT_RESET_EX Reset; + AMI_READ_EFI_KEY ReadEfikey; + EFI_EVENT WaitForKeyEx; + EFI_SET_STATE SetState; + EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify; + EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify; +} AMI_EFIKEYCODE_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_KEYBOARD_LAYOUT_MAP)( + IN AMI_MULTI_LANG_SUPPORT_PROTOCOL *This, + IN OUT AMI_EFI_KEY_DATA *Keydata ); + +typedef struct _AMI_MULTI_LANG_SUPPORT_PROTOCOL { + EFI_KEYBOARD_LAYOUT_MAP KeyboardLayoutMap; +} AMI_MULTI_LANG_SUPPORT_PROTOCOL; +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/AmiNvmeController.h b/Include/Protocol/AmiNvmeController.h new file mode 100644 index 0000000..9e25525 --- /dev/null +++ b/Include/Protocol/AmiNvmeController.h @@ -0,0 +1,369 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2015, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/AmiNvmeController.h 3 5/19/15 8:01a Deepthins $ +// +// $Revision: 3 $ +// +// $Date: 5/19/15 8:01a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/AmiNvmeController.h $ +// +// 3 5/19/15 8:01a Deepthins +// [TAG] EIP218059 +// [Category] Improvement +// [Description] Update Aptio4 NVME module to spec v1.2 +// [Files] AmiNvmeController.h, NvmeController.h +// +// 2 4/08/15 10:24a Anbuprakashp +// [TAG] EIP212320 +// [Category] Bug Fix +// [Severity] Critical +// [Symptom] CPU exception in Nvme Driver if +// PcdCpuSmmCodeAccessCheckEnable is enabled +// [RootCause] BootService call shouldn't be used inside SMM function. +// if PcdCpuSmmCodeAccessCheckEnable is enabled, It causes CPU exception. +// [Solution] Changes made to avoid BootService call inside SMM function +// [Files] NvmeSmm.c +// NvmeBus.c +// AmiNvmeController.h +// +// 1 9/04/14 8:02a Anandakrishnanl +// [TAG] EIP180861 +// [Category] Improvement +// [Description] Legacy Boot support in Aptio 4.x Nvme driver +// [Files] AmiNvmeProtocol.cif +// AmiNvmeController.h +// AmiNvmePassThru.h +// AmiNvmeLegacy.h +// +//********************************************************************** +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: AmiNvmeController.h +// +// Description: Protocol Header file for the Nvme Controller +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef _NVME_CONTROLLER_PROTOCOL_H_ +#define _NVME_CONTROLLER_PROTOCOL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + +#include <Protocol/PciIo.h> + +#define NVME_MANUFACTUREID_LENGTH 30 + +#ifndef EFI_LIST_ENTRY_DEFINED +#define EFI_LIST_ENTRY_DEFINED +typedef struct _EFI_LIST_ENTRY { + struct _EFI_LIST_ENTRY *ForwardLink; + struct _EFI_LIST_ENTRY *BackLink; +} EFI_LIST_ENTRY; +#endif + +typedef struct { + UINT64 ControllerCapabilities; + UINT32 Version; + UINT32 InterruptMaskSet; + UINT32 InterruptMaskClear; + UINT32 ControllerConfiguration; + UINT32 Reserved1; + UINT32 ControllerStatus; + UINT32 NVMSubSystemReset; + UINT32 AdminQueueAttributes; + UINT64 AdminSubmissionQueueBaseAddress; + UINT64 AdminCompletionQueueBaseAddress; + // Variable offsets follow +} NVME_CONTROLLER_REGISTER; + +// Figure 10 NVM Express 1.2 + +typedef struct { + UINT8 Opcode; + UINT8 FusedOperation : 2; + UINT8 RESERVED1 : 4; + UINT8 PSDT : 2; + UINT16 CommandIdentifier; +} STRUC_CMD0; + +typedef struct { + STRUC_CMD0 CMD0; + UINT32 NSID; + UINT64 RESERVED1; + UINT64 MPTR; + UINT64 PRP1; + UINT64 PRP2; + UINT32 CDW10; + UINT32 CDW11; + UINT32 CDW12; + UINT32 CDW13; + UINT32 CDW14; + UINT32 CDW15; +} NVME_ADMIN_COMMAND; + +//Figure 25 NVM Express 1.2 Spec +typedef struct { + UINT32 DW0; + UINT32 DW1; + UINT16 SQHeadPointer; + UINT16 SQIdentifier; + UINT16 CommandIdentifier; + UINT16 PhaseTag : 1; + UINT16 StatusCode : 8; + UINT16 StatusCodeType : 3; + UINT16 Reservered1 : 2; + UINT16 More : 1; + UINT16 DoNotRetry : 1; +} COMPLETION_QUEUE_ENTRY; + +// Figure 91 NVM Express 1.2 Spec +typedef struct { + + UINT16 MP; // Bits 15:0 + UINT8 Reserved1; // Bits 23:16 + UINT8 MPS : 1; // Bits 24 + UINT8 NOPS : 1; // Bits 25 + UINT8 Reserved2 : 6; // Bits 31:26 + UINT32 ENLAT; // Bits 63:32 + UINT32 EXLAT; // Bits 95:64 + UINT8 RRT : 5; // Bits 100:96 + UINT8 Reserved3 : 3; // Bits 103:101 + UINT8 RRL : 5; // Bits 108:104 + UINT8 Reserved4 : 3; // Bits 111:109 + UINT8 RWT : 5; // Bits 116:112 + UINT8 Reserved5 : 3; // Bits 119:117 + UINT8 RWL : 5; // Bits 124:120 + UINT8 Reserved6 : 3; // Bits 127:125 + UINT16 IDLP; // Bits 143:128 + UINT8 Reserved7 : 6; // Bits 149:144 + UINT8 IPS :2; // Bits 151:150 + UINT8 Reserved8; // Bits 159:152 + UINT16 ACTP; // Bits 175:160 + UINT8 APW : 3; // Bits 178:176 + UINT8 Reserved9 : 3; // Bits 181:179 + UINT8 APS : 2; // Bits 183:182 + UINT8 Reserved10[9]; // Bits 255:184 +} POWER_STATE_DESCRIPTOR; + +// Figure 90 NVM Express 1.2 spec +typedef struct { + UINT16 VID; // Offset 01:00 + UINT16 SSVID; // Offset 03:02 + UINT8 SerialNumber[20]; // Offset 23:04 + UINT8 ModelNumber[40]; // Offset 63:24 + UINT8 FirmwareRevision[8]; // Offset 71:64 + UINT8 ArbitrationBurst; // Offset 72 + UINT8 IEEEOUIIdentifier[3]; // Offset 75:73 + UINT8 CMIC; // Offset 76 + UINT8 MDTS; // Offset 77 + UINT16 ControllerID; // Offset 79:78 + UINT32 VER; // Offset 83:80 + UINT32 RTD3R; // Offset 87:84 + UINT32 RTD3E; // Offset 91:88 + UINT32 OAES; // Offset 95:92 + UINT8 Reserved1[144]; // Offset 239:96 + UINT8 MTCP[16]; // Offset 255:240 + UINT16 OACS; // Offset 257:256 + UINT8 ACL; // Offset 258 + UINT8 AERL; // Offset 259 + UINT8 FRMW; // Offset 260 + UINT8 LPA; // Offset 261 + UINT8 ELPE; // Offset 262 + UINT8 NPSS; // Offset 263 + UINT8 AVSCC; // Offset 264 + UINT8 APSTA; // Offset 265 + UINT16 WCTEMP; // Offset 267:266 + UINT16 CCTEMP; // Offset 269:268 + UINT16 MTFA; // Offset 271:270 + UINT32 HMPRE; // Offset 275:272 + UINT32 HMMIN; // Offset 279:276 + UINT8 TNVMCAP[16]; // Offset 295:280 + UINT8 UNVMCAP[16]; // Offset 311:296 + UINT32 RPMBS; // Offset 315:312 + UINT8 Reserved2[196]; // Offset 511:316 + UINT8 SQES; // Offset 512 + UINT8 CQES; // Offset 513 + UINT16 Reserved3; // Offset 515:514 + UINT32 NN; // Offset 519:516 + UINT16 ONCS; // Offset 521:520 + UINT16 FUSES; // Offset 523:522 + UINT8 FNA; // Offset 524 + UINT8 VWC; // Offset 525 + UINT16 AWUN; // Offset 527:526 + UINT16 AWUPF; // Offset 529:528 + UINT8 NVSCC; // Offset 530 + UINT8 Reserved4; // Offset 531 + UINT16 ACWU; // Offset 533:532 + UINT16 Reserved5; // Offset 535:536 + UINT32 SGLS; // Offset 539:536 + UINT8 Reserved6[164]; // Offset 703:540 + UINT8 Reserved7[1344]; // Offset 2047:704 + POWER_STATE_DESCRIPTOR psdd[32]; // Offset 3071:2048 + UINT8 VS[1024]; // Offset 4095:3072 +} IDENTIFY_CONTROLLER_DATA; + +// Figure 93 NVM Express 1.2 Spec +typedef struct { + + UINT16 MS; // Bits 15:0 + UINT8 LBADS; // Bits 23:16 + UINT8 RP : 2; // Bits 25:24 + UINT8 Reserved1 :6; // Bits 31:26 + +} LBA_FORMAT_DATA; + + +// Figure 92 NVM Express 1.2 Spec +typedef struct { + + UINT64 NSIZE; // Offset 7:0 + UINT64 NCAP; // Offset 15:8 + UINT64 NUSE; // Offset 23:16 + UINT8 NSFEAT; // Offset 24 + UINT8 NLBAF; // Offset 25 + UINT8 FLBAS; // Offset 26 + UINT8 MC; // Offset 27 + UINT8 DPC; // Offset 28 + UINT8 DPS; // Offset 29 + UINT8 NMIC; // Offset 30 + UINT8 RESCAP; // Offset 31 + UINT8 FPI; // Offset 32 + UINT8 Reserved1; // Offset 33 + UINT16 NAWUN; // Offset 35:34 + UINT16 NAWUPF; // Offset 37:36 + UINT16 NACWU; // Offset 39:38 + UINT16 NABSN; // Offset 41:40 + UINT16 NABO; // Offset 43:42 + UINT16 NABSPF; // Offset 45:44 + UINT8 Reserved2[2]; // Offset 46:47 + UINT8 NVMCAP[16]; // Offset 63:48 + UINT8 Reserved3[40]; // Offset 103:64 + UINT8 NGUID[16]; // Offset 119:104 + UINT64 EUI64; // Offset 127:120 + LBA_FORMAT_DATA LBAF[16]; // Offset 191:128 + UINT8 Reserved4[192]; // Offset 383:192 + UINT8 VS[3712]; // Offset 4095:384 + +} IDENTIFY_NAMESPACE_DATA; + +typedef struct { + NVME_ADMIN_COMMAND NvmCmd; + BOOLEAN AdminOrNVMCmdSet; // TRUE for Admin + UINT16 SQIdentifier; // Queue 0 for Admin cmds and 1 for NVM cmds + UINT32 CmdTimeOut; // In msec. + UINT8 RetryCount; +} NVME_COMMAND_WRAPPER; + +typedef struct { + + UINT64 NvmeBarOffset; + EFI_PCI_IO_PROTOCOL *PciIO; + EFI_HANDLE ControllerHandle; + UINT16 CommandIdentifierAdmin; + UINT16 CommandIdentifierQueue1; + UINT64 RawControllerCapabilities; + UINT32 MaxQueueEntrySupported; + BOOLEAN ContiguousQueueRequired; + UINT8 ArbitrationMechanismSupport; + UINT8 TimeOut; + UINT8 DoorBellStride; + BOOLEAN NVMResetSupport; + UINT8 CmdSetsSupported; + UINT32 MemoryPageSizeMin; + UINT32 MemoryPageSizeMax; + UINT32 MemoryPageSize; // In Bytes + NVME_COMMAND_WRAPPER *NvmeCmdWrapper; // Will be used by internal routines + +//----------------------------Admin Queue-------------------------------------------------------------- + UINT64 AdminSubmissionUnAligned; // Points to the start of the buffer + UINT64 AdminSubmissionQueue; // Points to the start of the buffer Aligned + UINT64 AdminSubmissionQueueMappedAddr; // Mapped address for the controller to use + VOID *AdminSubmissionQueueUnMap; // + UINTN AdminSubmissionUnAlignedSize; // in Pages + UINT64 AdminCompletionUnAligned; + UINT64 AdminCompletionQueue; + UINT64 AdminCompletionQueueMappedAddr; + VOID *AdminCompletionQueueUnMap; + UINTN AdminCompletionUnAlignedSize; + UINT16 AdminSubmissionQueueSize; // Max is 4KB + UINT16 AdminCompletionQueueSize; // Max is 4KB + UINT16 AdminCompletionQueueHeadPtr; + UINT16 AdminCompletionQueueTailPtr; + UINT16 AdminSubmissionQueueHeadPtr; // Updated from Completion queue entry + UINT16 AdminSubmissionQueueTailPtr; // Updated when new cmds are issued + UINT8 AdminPhaseTag : 1; + UINT8 RESERVED : 7; + +//----------------------------Queue1 for Nvme Cmds------------------------------------------------------ + UINT16 NVMQueueNumber; + UINT64 Queue1SubmissionUnAligned; // Points to the start of the buffer + UINTN Queue1SubmissionUnAlignedSize; // Original size + UINT64 Queue1SubmissionQueue; // Aligned address + UINT64 Queue1SubmissionQueueMappedAddr; // Address for controller to use + VOID *Queue1SubmissionQueueUnMap; + UINT64 Queue1CompletionUnAligned; + UINTN Queue1CompletionUnAlignedSize; + UINT64 Queue1CompletionQueue; + UINT64 Queue1CompletionQueueMappedAddr; + VOID *Queue1CompletionQueueUnMap; + UINT32 Queue1SubmissionQueueSize; + UINT32 Queue1CompletionQueueSize; + UINT16 Queue1CompletionQueueHeadPtr; + UINT16 Queue1CompletionQueueTailPtr; + UINT16 Queue1SubmissionQueueHeadPtr; // Updated from Completion queue entry + UINT16 Queue1SubmissionQueueTailPtr; // Updated when new cmds are issued + UINT8 Queue1PhaseTag : 1; + UINT8 RESERVED1 : 7; + BOOLEAN ReInitializingQueue1; // Flag used to prevent initializing Queue1 in an infinite loop + + //----------------------------------------------------------------------------------------------------- + VOID *LegacyNvmeBuffer; + BOOLEAN NvmeInSmm; + IDENTIFY_CONTROLLER_DATA *IdentifyControllerData; + UINT32 *ActiveNameSpaceIDs; + EFI_LIST_ENTRY ActiveNameSpaceList; // Linked list of Active Name space found in this controller +} AMI_NVME_CONTROLLER_PROTOCOL; + + +extern EFI_GUID gAmiNvmeControllerProtocolGuid; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2015, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/AmiNvmeLegacy.h b/Include/Protocol/AmiNvmeLegacy.h new file mode 100644 index 0000000..b47f14b --- /dev/null +++ b/Include/Protocol/AmiNvmeLegacy.h @@ -0,0 +1,86 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2014, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/AmiNvmeLegacy.h 1 9/04/14 8:02a Anandakrishnanl $ +// +// $Revision: 1 $ +// +// $Date: 9/04/14 8:02a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/AmiNvmeLegacy.h $ +// +// 1 9/04/14 8:02a Anandakrishnanl +// [TAG] EIP180861 +// [Category] Improvement +// [Description] Legacy Boot support in Aptio 4.x Nvme driver +// [Files] AmiNvmeProtocol.cif +// AmiNvmeController.h +// AmiNvmePassThru.h +// AmiNvmeLegacy.h +// +//********************************************************************** +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: AmiNvmeLegacy.h +// +// Description: Protocol header file the Ami Nvme Legacy interface +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef __NVME_LEGACY_PROTOCOL_H__ +#define __NVME_LEGACY_PROTOCOL_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _NVME_LEGACY_MASS_DEVICE NVME_LEGACY_MASS_DEVICE; + +typedef EFI_STATUS +(EFIAPI *AMI_NVME_LEGACY_DEVICE_INSTALL)( + IN OUT NVME_LEGACY_MASS_DEVICE *AddNvmeLegacyDevice +); + +typedef struct { + AMI_NVME_LEGACY_DEVICE_INSTALL AddNvmeLegacyDevice; +} AMI_NVME_LEGACY_PROTOCOL; + + +extern EFI_GUID gAmiNvmeLegacyProtocolGuid; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2014, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/AmiNvmePassThru.h b/Include/Protocol/AmiNvmePassThru.h new file mode 100644 index 0000000..074a3d2 --- /dev/null +++ b/Include/Protocol/AmiNvmePassThru.h @@ -0,0 +1,88 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2014, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/AmiNvmePassThru.h 1 9/04/14 8:02a Anandakrishnanl $ +// +// $Revision: 1 $ +// +// $Date: 9/04/14 8:02a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/AmiNvmePassThru.h $ +// +// 1 9/04/14 8:02a Anandakrishnanl +// [TAG] EIP180861 +// [Category] Improvement +// [Description] Legacy Boot support in Aptio 4.x Nvme driver +// [Files] AmiNvmeProtocol.cif +// AmiNvmeController.h +// AmiNvmePassThru.h +// AmiNvmeLegacy.h +// +//********************************************************************** +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: AmiNvmePassThru.h +// +// Description: Protocol Header file for the Nvme PassThru Protocol +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef _NVME_PASSTHRU_PROTOCOL_H_ +#define _NVME_PASSTHRU_PROTOCOL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <Protocol/AmiNvmeController.h> + +typedef struct _AMI_NVME_PASS_THRU_PROTOCOL AMI_NVME_PASS_THRU_PROTOCOL; + +typedef EFI_STATUS +(EFIAPI *AMI_NVME_PASS_THRU_EXECUTECMD)( + IN AMI_NVME_CONTROLLER_PROTOCOL *NvmeController, + IN NVME_COMMAND_WRAPPER *NvmeCmdWrapper, + OUT COMPLETION_QUEUE_ENTRY *CmdCompletionData +); + +typedef struct _AMI_NVME_PASS_THRU_PROTOCOL { + AMI_NVME_PASS_THRU_EXECUTECMD ExecuteNvmeCmd; +} AMI_NVME_PASS_THRU_PROTOCOL; + +extern EFI_GUID gAmiNvmePassThruProtocolGuid; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2014, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/AmiNvmeProtocol.cif b/Include/Protocol/AmiNvmeProtocol.cif new file mode 100644 index 0000000..3687a8c --- /dev/null +++ b/Include/Protocol/AmiNvmeProtocol.cif @@ -0,0 +1,11 @@ +<component> + name = "Nvme Protocol" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "NvmeProtocol" +[files] +"AmiNvmeController.h" +"AmiNvmePassThru.h" +"AmiNvmeLegacy.h" +"NvmExpressPassThru.h" +<endComponent> diff --git a/Include/Protocol/AmiReflashProtocol.h b/Include/Protocol/AmiReflashProtocol.h new file mode 100644 index 0000000..1fe8127 --- /dev/null +++ b/Include/Protocol/AmiReflashProtocol.h @@ -0,0 +1,102 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 2012, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **// +//** **// +//** Phone (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +// $Archive: /Alaska/BIN/Core/Include/Protocol/AmiReflashProtocol.h $ +// +// $Author: Artems $ +// +// $Revision: 1 $ +// +// $Date: 7/20/12 10:09a $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/AmiReflashProtocol.h $ +// +// 1 7/20/12 10:09a Artems +// [TAG] EIP93520 +// [Category] New Feature +// [Description] Added AmiReflashProtocol definition file +// [Files] AmiReflashProtocol.h +// +//*****************************************************************// +//*****************************************************************// +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: AMIReflashProtocol.h +// +// Description: Header file for ESRT. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __REFLASH_PROTOCOL__H__ +#define __REFLASH_PROTOCOL__H__ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define EFI_REFLASH_PROTOCOL_GUID \ + {0x8fe545e5, 0xdca9, 0x4d52, 0xbf, 0xcd, 0x8f, 0x13, 0xe7, 0x17, 0x1, 0x5f} + +GUID_VARIABLE_DECLARATION(gAmiReflashProtocolGuid, EFI_REFLASH_PROTOCOL_GUID); + +typedef struct _EFI_REFLASH_PROTOCOL EFI_REFLASH_PROTOCOL; + +typedef EFI_STATUS +(EFIAPI *EFI_REFLASH_PROGRESS)( + IN EFI_REFLASH_PROTOCOL *This +); + +typedef EFI_STATUS +(EFIAPI *EFI_REFLASH_GET_DISPLAY_IMAGE)( + IN EFI_REFLASH_PROTOCOL *This, + OUT UINTN *CoordinateX, + OUT UINTN *CoordinateY, + OUT VOID **ImageAddress +); + +struct _EFI_REFLASH_PROTOCOL { + EFI_REFLASH_PROGRESS CapUpdProgress; + EFI_REFLASH_GET_DISPLAY_IMAGE GetDisplayImage; +}; + + + /****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 2012, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **// +//** **// +//** Phone (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// +//*****************************************************************//
\ No newline at end of file diff --git a/Include/Protocol/AmiSetupProtocol.cif b/Include/Protocol/AmiSetupProtocol.cif new file mode 100644 index 0000000..1c916f9 --- /dev/null +++ b/Include/Protocol/AmiSetupProtocol.cif @@ -0,0 +1,8 @@ +<component> + name = "AmiSetup Protocol" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "AmiSetupProtocol" +[files] +"AmiSetupProtocol.h" +<endComponent> diff --git a/Include/Protocol/AmiSetupProtocol.h b/Include/Protocol/AmiSetupProtocol.h new file mode 100644 index 0000000..9a16881 --- /dev/null +++ b/Include/Protocol/AmiSetupProtocol.h @@ -0,0 +1,115 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Board/Setup/AmiSetupProtocol.h 1 8/28/12 4:18p Artems $ +// +// $Revision: 1 $ +// +// $Date: 8/28/12 4:18p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Board/Setup/AmiSetupProtocol.h $ +// +// 1 8/28/12 4:18p Artems +// [TAG] EIP N/A +// [Category] New Feature +// [Description] Add infrastructure to support runtime registration of +// setup controls callbacks +// [Files] Setup.c Setup.h Setup.cif AmiSetupProtocol.c +// AmiSetupProtocol.h +// +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: AmiSetupProtocol.h +// +// Description: +// AMI Setup protocol definitions +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __AMI_SETUP_PROTOCOL__H__ +#define __AMI_SETUP_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <Setup.h> + +// {C528AA1C-4011-42ee-A551-5238B8FB5A9F} +#define AMI_SETUP_PROTOCOL_GUID \ + { 0xc528aa1c, 0x4011, 0x42ee, 0xa5, 0x51, 0x52, 0x38, 0xb8, 0xfb, 0x5a, 0x9f } + + +GUID_VARIABLE_DECLARATION(AmiSetupProtocolGuid, AMI_SETUP_PROTOCOL_GUID); + +typedef +EFI_STATUS +(EFIAPI *AMI_SETUP_REGISTER_CALLBACK) ( + IN UINT16 Class, + IN UINT16 Subclass, + IN UINT16 Key, + IN SETUP_ITEM_CALLBACK_HANDLER *Handler, + OUT EFI_HANDLE *Handle + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_SETUP_UNREGISTER_CALLBACK) ( + IN EFI_HANDLE Handle + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_SETUP_GET_CALLBACKS) ( + IN OUT UINTN *BufferSize, + OUT SETUP_ITEM_CALLBACK *Buffer + ); + +typedef +EFI_STATUS +(EFIAPI *AMI_SETUP_GET_CALLBACK_PARAMETERS) ( + OUT CALLBACK_PARAMETERS **Parameters + ); + +typedef struct _AMI_SETUP_PROTOCOL +{ + AMI_SETUP_REGISTER_CALLBACK RegisterCallback; + AMI_SETUP_UNREGISTER_CALLBACK UnregisterCallback; + AMI_SETUP_GET_CALLBACKS GetCallbacks; + AMI_SETUP_GET_CALLBACK_PARAMETERS GetCallbackParameters; +} AMI_SETUP_PROTOCOL; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/AmiSio.h b/Include/Protocol/AmiSio.h new file mode 100644 index 0000000..f807300 --- /dev/null +++ b/Include/Protocol/AmiSio.h @@ -0,0 +1,131 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/AmiSio.h 4 4/03/06 5:01p Felixp $Revision: $ +// +// $Date: 4/03/06 5:01p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: +// + +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: AmiSio.h +// +// Description: AMI Sio Protocol Definitions. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SIO_PROTOCOL_H__ +#define __SIO_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// 51E9B4F9-555D-476c-8BB5-BD18D9A68878 +#define EFI_AMI_SIO_PROTOCOL_GUID \ + {0x51e9b4f9,0x555d,0x476c,0x8b, 0xb5, 0xbd, 0x18, 0xd9, 0xa6, 0x88, 0x78} + +GUID_VARIABLE_DECLARATION(gEfiAmiSioProtocolGuid,EFI_AMI_SIO_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <AmiDxeLib.h> + +typedef struct _AMI_SIO_PROTOCOL AMI_SIO_PROTOCOL; + +typedef struct _EFI_EISAID { + UINT32 HID; + UINT32 UID; +} EFI_EISAID; + +//This list migt be extended if some devices +//not mention here present in SIO +typedef enum { + dsNone=0, + dsFDC, + dsPS2K, //PS2 Keyboard Controller if KBC on separate from MS Logical Device + dsPS2M, //PS2 Mouse Controller if MS on separate from KBC Logical Device + dsPS2CK,//PS2 Keyboard Controller where KBC and MS on same Logical Device + dsPS2CM,//PS2 Mouse Controller where KBC and MS on same Logical Device + dsUART, + dsLPT, + dsGAME, + dsSB16, + dsMPU401, + dsFmSynth, + dsCIR, + dsGPIO, + dsHwMon, + dsPME, + dsACPI, +} SIO_DEV_TYPE; + + +typedef EFI_STATUS (*SIO_REGISTER) ( + IN AMI_SIO_PROTOCOL *This, + IN BOOLEAN Write, + IN BOOLEAN ExitCfgMode, + IN UINT8 Register, + IN OUT UINT8 *Value +); + +typedef EFI_STATUS (*SIO_RESOURCES)( + IN AMI_SIO_PROTOCOL *This, + IN BOOLEAN Set, + IN OUT T_ITEM_LIST **Resources +); + +//********************************************************************** +//<AMI_SHDR_START> +// +// Name: AMI_SIO_PROTOCOL +// +// Description: Functions to access the SIO. +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// +//<AMI_SHDR_END> +//********************************************************************** +typedef struct _AMI_SIO_PROTOCOL { + SIO_REGISTER Access; + SIO_RESOURCES CurrentRes; + SIO_RESOURCES PossibleRes; +} AMI_SIO_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif + +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/AmiSmmInfo.h b/Include/Protocol/AmiSmmInfo.h new file mode 100644 index 0000000..5debe9f --- /dev/null +++ b/Include/Protocol/AmiSmmInfo.h @@ -0,0 +1,90 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/AmiSmmInfo.h 1 2/25/10 5:17p Markw $ +// +// $Revision: 1 $ +// +// $Date: 2/25/10 5:17p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/AmiSmmInfo.h $ +// +// 1 2/25/10 5:17p Markw +// Initial version +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: AmiSmmInfo.h +// +// Description: Provide AMI Smm Info +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __AMI_SMM_INFO_H__ +#define __AMI_SMM_INFO_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <Efi.h> + +// {EB5198EB-E7F5-45a1-9CCB-E53364BB4992} +#define AMI_SMM_INFO_PROTOCOL_GUID \ + {0xeb5198eb, 0xe7f5, 0x45a1, 0x9c, 0xcb, 0xe5, 0x33, 0x64, 0xbb, 0x49, 0x92} + +GUID_VARIABLE_DECLARATION(gAmiSmmInfoProtcolGuid, AMI_SMM_INFO_PROTOCOL_GUID); + +typedef struct _AMI_SMM_INFO_PROTOCOL AMI_SMM_INFO_PROTOCOL; + + +typedef EFI_STATUS (EFIAPI *GET_NUM_OF_CPUS_INSIDE_SMM) ( + IN AMI_SMM_INFO_PROTOCOL *This, + OUT UINT32 *Cpus +); + + +struct _AMI_SMM_INFO_PROTOCOL { + UINT32 ProtocolVer; + GET_NUM_OF_CPUS_INSIDE_SMM GetNumOfCpusInsideSmm; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + + + diff --git a/Include/Protocol/AmiTcgPlatformProtocol.cif b/Include/Protocol/AmiTcgPlatformProtocol.cif new file mode 100644 index 0000000..d716354 --- /dev/null +++ b/Include/Protocol/AmiTcgPlatformProtocol.cif @@ -0,0 +1,8 @@ +<component> + name = "AmiTcgPlatformProtocol" + category = ModulePart + LocalRoot = "Include\Protocol" + RefName = "AmiTcgPlatformProtocol" +[files] +"AmiTcgPlatformProtocol.h" +<endComponent> diff --git a/Include/Protocol/AmiTcgPlatformProtocol.h b/Include/Protocol/AmiTcgPlatformProtocol.h new file mode 100644 index 0000000..ffbfed2 --- /dev/null +++ b/Include/Protocol/AmiTcgPlatformProtocol.h @@ -0,0 +1,92 @@ +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2012, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// +//**********************************************************************// +// $Header: /Alaska/SOURCE/Modules/TCG2/CommonHeaders/AmiTcgPlatformProtocol/AmiTcgPlatformProtocol.h 1 4/21/14 2:15p Fredericko $ +// +// $Revision: 1 $ +// +// $Date: 4/21/14 2:15p $ +//**********************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/TCG2/CommonHeaders/AmiTcgPlatformProtocol/AmiTcgPlatformProtocol.h $ +// +// 1 4/21/14 2:15p Fredericko +// +// 1 10/08/13 12:01p Fredericko +// Initial Check-In for Tpm-Next module +// +// 1 7/10/13 5:59p Fredericko +// [TAG] EIP120969 +// [Category] New Feature +// [Description] TCG (TPM20) +// +// 1 12/12/11 3:03p Fredericko +// [TAG] EIP76865 +// [Category] Improvement +// [Description] Dual Support for TCM and TPM. System could hang in TXT +// if txt is enabled in setup +// [Files] AmiTcgPlatfompeilib.c, AmiTcgPlatformPpi.cif, +// AmiTcgPlatformPpi.h, AmiTcgPlatformProtocol.cif, +// AmiTcgPlatformProtocol.h, +// EMpTcmPei.c, TcgDxe.cif, TcgPei.cif, TcgPeiAfterMem.cif, +// TcgPeiAfterMem.mak, TcgTcmPeiAfterMem.c, xTcgDxe.c, xTcgPei.c, +// xTcgPeiAfterMem.c +// +// 1 12/12/11 2:59p Fredericko +// [TAG] EIP76865 +// [Category] Improvement +// [Description] Dual Support for TCM and TPM. System could hang in TXT +// if txt is enabled in setup +// [Files] AmiTcgPlatfompeilib.c, AmiTcgPlatformPpi.cif, +// AmiTcgPlatformPpi.h, AmiTcgPlatformProtocol.cif, +// AmiTcgPlatformProtocol.h, +// EMpTcmPei.c, TcgDxe.cif, TcgPei.cif, TcgPeiAfterMem.cif, +// TcgPeiAfterMem.mak, TcgTcmPeiAfterMem.c, xTcgDxe.c, xTcgPei.c, +// xTcgPeiAfterMem.c +// +//**********************************************************************// + +#ifndef _AMI_TCG_PLATFORM_PROTOCOL_H_ +#define _AMI_TCG_PLATFORM_PROTOCOL_H_ + +#include <token.h> + +#define AMI_TCG_PLATFORM_PROTOCOL_GUID \ + {0x320bdc39, 0x3fa0, 0x4ba9, 0xbf, 0x2d, 0xb3, 0x3f, 0x72, 0xba, 0x9c, 0xa1} + +typedef struct _AMI_TCG_PLATFORM_PROTOCOL AMI_TCG_PLATFORM_PROTOCOL; + +// for now all it does is return the platform security support type +typedef UINT8 (*GET_TCG_SUPPORT_TYPE)(); + +struct _AMI_TCG_PLATFORM_PROTOCOL { + GET_TCG_SUPPORT_TYPE GetPlatformSecurityType; +}; + +#endif + +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2012, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// diff --git a/Include/Protocol/AmiTpmClearOnRollbackProtocol.cif b/Include/Protocol/AmiTpmClearOnRollbackProtocol.cif new file mode 100644 index 0000000..06507c8 --- /dev/null +++ b/Include/Protocol/AmiTpmClearOnRollbackProtocol.cif @@ -0,0 +1,8 @@ +<component> + name = "AmiTpmClearOnRollbackProtocol" + category = ModulePart + LocalRoot = "Include\Protocol" + RefName = "AmiTpmClearOnRollbackProtocol" +[files] +"AmiTpmClearOnRollbackProtocol.h" +<endComponent> diff --git a/Include/Protocol/AmiTpmClearOnRollbackProtocol.h b/Include/Protocol/AmiTpmClearOnRollbackProtocol.h new file mode 100644 index 0000000..9002010 --- /dev/null +++ b/Include/Protocol/AmiTpmClearOnRollbackProtocol.h @@ -0,0 +1,79 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/TCG2/CommonHeaders/AmiTpmClearOnRollbackProtocol/AmiTpmClearOnRollbackProtocol.h 1 4/21/14 2:16p Fredericko $ +// +// $Revision: 1 $ +// +// $Date: 4/21/14 2:16p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/TCG2/CommonHeaders/AmiTpmClearOnRollbackProtocol/AmiTpmClearOnRollbackProtocol.h $ +// +// 1 4/21/14 2:16p Fredericko +// +// 1 10/08/13 12:01p Fredericko +// Initial Check-In for Tpm-Next module +// +// 1 7/10/13 5:57p Fredericko +// [TAG] EIP120969 +// [Category] New Feature +// [Description] TCG (TPM20) +// +// +//********************************************************************** +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: +// +// Description: +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> +#ifndef _AMI_TPM_CLEAR_ON_ROLLBACK_H +#define _AMI_TPM_CLEAR_ON_ROLLBACK_H + +#define AMI_TPM_ROLLBACK_SMM_PROTOCOL_GUID \ + {0x79fbad19, 0xf9e1, 0x4d08, 0xb7, 0xbc, 0x35, 0x84, 0x53, 0x19, 0x5e, 0x41} + +#define TPM_CLEAR_SUCCESSFUL 0x0 +#define TPM_CLEAR_RESET_REQUIRED 0x01 +#define TPM_FATAL_CONTINUE_FLASH 0x02 +#define TPM_FATAL_DISCONTINUE_FLASH 0x03 + +typedef +UINT8 +(EFIAPI * CLEAR_TPM_ON_ROLLBACK)(VOID); + +typedef struct _CLEAR_TPM_ROLLBACK_PROTOCOL +{ + CLEAR_TPM_ON_ROLLBACK ClearTpmOnRollBack; +} CLEAR_TPM_ROLLBACK_PROTOCOL; + +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//*************************************************************************
\ No newline at end of file diff --git a/Include/Protocol/AmiUsbCCID.h b/Include/Protocol/AmiUsbCCID.h new file mode 100644 index 0000000..dfb81ee --- /dev/null +++ b/Include/Protocol/AmiUsbCCID.h @@ -0,0 +1,185 @@ +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** + +//**************************************************************************** +// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/AmiUsbCCID.h 3 5/02/12 2:02a Rajeshms $ +// +// $Revision: 3 $ +// +// $Date: 5/02/12 2:02a $ +// +//**************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/AmiUsbCCID.h $ +// +// 3 5/02/12 2:02a Rajeshms +// [TAG] EIP83117 +// [Category] Improvement +// [Description] Extend the Support to different smart card Readers and +// smart Cards. +// [Files] usbCCID.c, amiusbrtCCID.h, usbdef.h, efiusbccid.c, +// AmiusbCCID.h +// +// 2 10/14/11 4:58a Rajeshms +// [TAG] EIP70315 +// [Category] Improvement +// [Description] Remove Slot number in the USB CCID API's +// [Files] efiusbccid.c, AmiUsbCCID.h +// +// 1 7/12/11 8:19a Ryanchou +// [TAG] EIP56918 +// [Category] New Feature +// [Description] Added CCID device support. +// [Files] amiusb.c, amiusb.h, amiusbrtCCID.h, ehci.c, ohci.c, uhci.c, +// usb.c, UsbCCID.c, usbdef.h, usbrt.cif, usbsetup.c, efiusbccid.c, +// framework.cif, uhcd.c, uhcd.cif, uhcd.h, usbsrc.sdl, AmiusbCCID.h, +// AmiUsbController.h, AmiUSBProtocols.cif +// +//**************************************************************************** + +//<AMI_FHDR_START> +//----------------------------------------------------------------------------- +// +// Name: AmiUsbCCID.h +// +// Description: AMI USB CCID Protocol definition +// +//----------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef _USB_CCID_H +#define _USB_CCID_H + +#include <EFI.h> + +#ifndef GUID_VARIABLE_DEFINITION + +// CCID definitions/Structures +typedef struct _AMI_CCID_IO_PROTOCOL AMI_CCID_IO_PROTOCOL; + +#define AMI_CCID_IO_PROTOCOL_GUID \ + { 0xB167C2F5, 0xE26A, 0x4DFF, 0x8E, 0x1C, 0x08, 0x07, 0xC7, 0xF0, 0x2A, 0x88} + +#define AMI_CCID_PRESENCE_GUID \ + { 0x5FDEE00D, 0xDA40, 0x405A, 0xB9, 0x2E, 0xCF, 0x4A, 0x80, 0xEA, 0x8F, 0x76} + +typedef enum { + I_BLOCK, + S_IFS_REQUEST = 0xC1, + S_ABORT_REQUEST, + S_WTX_REQUEST +} ISBlock; + +typedef +EFI_STATUS +(*AMI_CCID_SMARTCLASSDESCRIPTOR) ( + IN AMI_CCID_IO_PROTOCOL *This, + OUT UINT8 *ResponseBuffer +); + +typedef +EFI_STATUS +(*AMI_CCID_GET_ATR) ( + IN AMI_CCID_IO_PROTOCOL *This, + IN UINT8 Slot, + OUT UINT8 *ATRData +); + +typedef +EFI_STATUS +(*AMI_CCID_POWERUP_SLOT) ( + IN AMI_CCID_IO_PROTOCOL *This, + OUT UINT8 *bStatus, + OUT UINT8 *bError, + OUT UINT8 *ATRData +); + +typedef +EFI_STATUS +(*AMI_CCID_POWERDOWN_SLOT) ( + IN AMI_CCID_IO_PROTOCOL *This, + OUT UINT8 *bStatus, + OUT UINT8 *bError +); + +typedef +EFI_STATUS +(*AMI_CCID_GET_SLOT_STATUS) ( + IN AMI_CCID_IO_PROTOCOL *This, + OUT UINT8 *bStatus, + OUT UINT8 *bError, + OUT UINT8 *bClockStatus +); + +typedef +EFI_STATUS +(*AMI_CCID_XFR_BLOCK) ( + IN AMI_CCID_IO_PROTOCOL *This, + IN UINTN CmdLength, + IN UINT8 *CmdBuffer, + IN UINT8 ISBlock, + OUT UINT8 *bStatus, + OUT UINT8 *bError, + IN OUT UINTN *ResponseLength, + OUT UINT8 *ResponseBuffer +); + +typedef +EFI_STATUS +(*AMI_CCID_GET_PARAMETERS) ( + IN AMI_CCID_IO_PROTOCOL *This, + OUT UINT8 *bStatus, + OUT UINT8 *bError, + OUT UINTN *ResponseLength, + OUT UINT8 *ResponseBuffer +); + +typedef struct _AMI_CCID_IO_PROTOCOL { + + AMI_CCID_SMARTCLASSDESCRIPTOR USBCCIDAPISmartClassDescriptor; + AMI_CCID_GET_ATR USBCCIDAPIGetAtr; + AMI_CCID_POWERUP_SLOT USBCCIDAPIPowerupSlot; + AMI_CCID_POWERDOWN_SLOT USBCCIDAPIPowerDownSlot; + AMI_CCID_GET_SLOT_STATUS USBCCIDAPIGetSlotStatus; + AMI_CCID_XFR_BLOCK USBCCIDAPIXfrBlock; + AMI_CCID_GET_PARAMETERS USBCCIDAPIGetParameters; + +}AMI_CCID_IO_PROTOCOL; + +typedef struct { + AMI_CCID_IO_PROTOCOL CCIDIoProtocol; + VOID *DevInfo; + UINT8 Slot; + EFI_HANDLE ControllerHandle; + EFI_HANDLE ChildHandle; + +} USB_ICC_DEV; + +#endif +#endif // _USB_CCID_H + +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** diff --git a/Include/Protocol/AmiUsbController.h b/Include/Protocol/AmiUsbController.h new file mode 100644 index 0000000..39d8d46 --- /dev/null +++ b/Include/Protocol/AmiUsbController.h @@ -0,0 +1,1572 @@ +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2016, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** + +//**************************************************************************** +// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/AmiUsbController.h 36 10/16/16 10:24p Wilsonlee $ +// +// $Revision: 36 $ +// +// $Date: 10/16/16 10:24p $ +// +//**************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/AmiUsbController.h $ +// +// 36 10/16/16 10:24p Wilsonlee +// [TAG] EIP288158 +// [Category] Improvement +// [Description] Check if gUsbData is integrity. +// [Files] amiusb.cif, usbsb.c, AmiUsbLib.cif, AmiUsbLib.sdl, +// AmiUsbSmmGlobalDataValidationLib.c, +// AmiUsbSmmGlobalDataValidationLib.cif, +// AmiUsbSmmGlobalDataValidationLib.mak, Crc32.c, amiusb.c, amiusb.h, +// ehci.c, elib.c, ohci.c, syskbc.c, uhci.c, usb.c, usbCCID.c, usbdef.h, +// usbhid.c, usbhub.c, usbkbd.c, usbmass.c, usbms.c, usbrt.mak, xhci.c, +// amiusbhc.c, efiusbccid.c, efiusbmass.c, uhcd.c, usbmisc.c, +// AmiUsbController.h, AmiUsbLibInclude.cif, +// AmiUsbSmmGlobalDataValidationLib.h +// +// 35 3/02/16 9:43p Wilsonlee +// [TAG] EIP254309 +// [Category] Bug Fix +// [Severity] Normal +// [Symptom] GK-FORCE K83 USB KB function abnormal. +// [RootCause] This device has an interrupt out endpoint and doesn't +// support "Set Report" request. +// [Solution] Use the interrupt out endpoint instead of sending "Set +// Report" request. +// [Files] AmiUsbController.h, xhci.c, usbmass.c, usbkbd.h, usbkbd.c, +// usbhub.c, usbhid.c, usbdef.h, usbCCID.c, usb.c, uhci.c, ohci.c, ehci.c, +// amiusb.h, efiusbms,c, amiusbhc.c +// +// 34 11/04/15 9:54p Wilsonlee +// TAG] EIP241067 +// [Category] Improvement +// [Description] Add the device descriptor to the DEV_INFO structure. +// [Files] usb.c, usbdef.h, xhci.c, usbbus.c, AmiUsbController.h +// +// 33 4/10/15 3:07a Wilsonlee +// [TAG] EIP207413 +// [Category] Improvement +// [Description] Install UsbApiTable and UsbMassApitTable in +// AmiUsbSmmProtocol. +// [Files] amiusbhc.c, AmiUsbController.h, usbdef.h, usbCCID.c, uhci.c, +// ehci.c, amiusbrtCCID.h, amiusb.h, amiusb.c, uhcd.c +// +// 32 12/24/14 10:42p Wilsonlee +// [TAG] EIP196287 +// [Category] Improvement +// [Description] Display info of connected usb controllers and remove or +// grayed-out some item according the connected usb controller number. +// [Files] uhcd.c, usbport.c, usb.uni, usb.sd, usbsetup.c, +// AmiUsbController.h, UsbPolicy.h +// +// 31 6/11/14 8:23p Wilsonlee +// [TAG] EIP172625 +// [Category] Improvement +// [Description] Usb skip table function adds the flag +// "SKIP_FLAG_SKIP_MULTI_LEVEL" that skips usb ports include down stream +// ports. +// [Files] usbport.c, AmiUsbController.h +// +// 30 7/03/13 5:25a Ryanchou +// [TAG] EIP123988 +// [Category] Improvement +// [Description] Move the code creating BBS table to end of POST. +// [Files] UsbBbs.c, UsbInt13.c, UsbInt13.cif, UsbInt13.h, +// UsbInt13.mak, UsbInt13.sdl, efiusbmass.c, uhcd.c, uhcd.h, +// AmiUsbController.h +// +// 29 9/03/12 5:23a Roberthsu +// [TAG] EIP88776 +// [Category] Improvement +// [Description] Implement keep port function. +// [Files] usbport.c,AmiUsbController.h +// +// 28 8/29/12 8:42a Ryanchou +// [TAG] EIP77262 +// [Category] New Feature +// [Description] Remove SMM dependency of USB. +// [Files] usb.sdl, usbport.c, amiusb.c, amiusb.dxs, amiusb.h, ehci.c, +// elib.c, ohci.c, uhci.c, usb.c, usbdef.h, usbrt.mak, xhci.c, amiusbhc.c, +// efiusbccid.c, efiusbhid.c, efiusbkb.c, efiusbmass.c, uhcd.c, uhcd.dxs, +// uhcd.h, usbmisc.c, AmiUsbController.h +// +// 27 1/14/12 4:10a Ryanchou +// [TAG] EIP80609 +// [Category] Bug Fix +// [Severity] Important +// [Symptom] If to enable debug mode and set launch CSM is "Never" in +// setup, system will hang at 0xB1 +// [RootCause] The pointer AmiUsb is invalid if CSM is not launched, +// that may cause CPU exception. +// [Solution] Added USB smm protocol, and use SmmLocateProtocol to get +// the pointer. +// [Files] amiusb.c, AmiUsbController.h, usbrt.mak, usbsb.c +// +// 26 12/26/11 2:25a Roberthsu +// [TAG] EIP74609 +// [Category] Improvement +// [Description] Add check oemskiplist at check port change. +// [Files] usbport.c,usb.c,AmiUsbController.h +// +// 25 11/08/11 8:26a Wilsonlee +// [TAG] EIP74876 +// [Category] New Feature +// [Description] Add USB API for shutdown single USB controller. +// [Files] amiusb.c, amiusb.h, usb.c, usbdef.h, uhcd.c, uhcd.h, +// AmiUsbController.h +// +// 24 8/05/11 6:19a Ryanchou +// [TAG] EIP60706 +// [Category] Improvement +// [Description] Move gUsbBadDeviceTable into SMRAM. +// [Files] usbport.c, amiusb.c, usb.c, uhcd.c, AmiUsbController.h +// +// 23 7/15/11 6:31a Ryanchou +// [TAG] EIP38434 +// [Category] New Feature +// [Description] Added USB HID report protocol support. +// [Files] amiusb.c, AmiUsbController.h, amiusbhc.c, efiusbkb.c, +// efiusbkb.h, efiusbpoint.c, ehci.c, ohci.c, uhcd.c uhcd.cif, uhci.c, +// usb.c, usbdef.h, usbhid.c, usbkbd.c, usbkbd.h, usbms.c, usbpoint.c, +// usbrt.cif, usbsb.c, usbsetup.c, usbsrc.sdl, xhci.c +// +// 22 7/12/11 8:18a Ryanchou +// [TAG] EIP56918 +// [Category] New Feature +// [Description] Added CCID device support. +// [Files] amiusb.c, amiusb.h, amiusbrtCCID.h, ehci.c, ohci.c, uhci.c, +// usb.c, UsbCCID.c, usbdef.h, usbrt.cif, usbsetup.c, efiusbccid.c, +// framework.cif, uhcd.c, uhcd.cif, uhcd.h, usbsrc.sdl, AmiusbCCID.h, +// AmiUsbController.h, AmiUSBProtocols.cif +// +// 21 6/22/11 2:13a Ryanchou +// [TAG] EIP62695 +// [Improvement] Add new oemskiplist function +// [Description] Add skip function by controller or port.Skip by device +// type or port number. +// +// 20 4/06/11 3:28a Ryanchou +// [TAG] EIP55275 +// [Category] Bug Fix +// [Severity] Important +// [Symptom] EBDA:108 conflict +// [RootCause] The EIP48064 save EFI_USB_PROTOCOL pointer in EBDA:108, +// but Keymon filter driver used the same location. +// [Solution] Use the EBDA:32 to save EFI_USB_PROTOCOL pointer and add a +// signature in EFI_USB_PROTOCOL. +// [Files] amidef.h, AmiUsbController.h, uhcd.c, usbsb.c +// +// 19 4/06/11 12:45a Ryanchou +// [TAG] EIP51653 +// [Category] New Feature +// [Description] Added an interface that skips specific port +// enumeration. +// [Files] AmiUsbController.h, uhcd.c, uhcd.h, usb.c, usbdef.h, +// usbport.c +// +// 18 3/30/11 9:07a Ryanchou +// [TAG] EIP41483 +// [Category] Improvement +// [Description] Stop timer SMI after legacy shutdown. +// [Files] amiusb.c, AmiUsbController.h, ohci.c +// +// 17 2/22/11 5:11a Tonylo +// [TAG] EIP52339 +// [Category] New Feature +// [Description] USB changes of USB host safe disabling solution. +// [Files] USB.C +// UHCD.C +// UHCD.H +// AmiUsbController.h +// +// 16 11/22/10 8:46a Ryanchou +// [TAG] EIP48064 +// [Category] Improvement +// [Description] The SB template implemented elink +// AcpiEnableCallbackList, the XHCI/EHCI hand off function should be +// invoked via the elink AcpiEnableCallbackList. +// [Files] amidef.h, amiusb.c, amiusb.dxs, amiusb.h, +// AmiUsbController.h, usb.sdl, usbrt.mak, usbsb.c +// +// 15 7/15/10 4:45a Tonylo +// EIP15489 - Add USB HandOff function for shurdown/init USB legacy +// through USB API function. +// +// 14 4/02/10 9:00a Olegi +// +// 13 10/02/09 10:51a Olegi +// Code cleanup. +// +// 12 11/25/08 6:04p Olegi +// Support for OEM USB Boot Override feature. EIP#17052. +// +// 11 6/27/08 6:00p Olegi +// - USB_MASS_DEV structure has been updated +// - Several equates moved from USBDEF.H +// +// 10 5/16/08 12:07p Olegi +// Compliance with AMI coding standard. +// +// 9 8/09/07 3:50p Artems +// Added new protocol function GetRuntimeRegion +// +// 8 6/03/07 11:26p Olegi +// Added UsbBbsRemoveMassStorage function. +// +// 7 5/29/07 6:14p Olegi +// Added UsbChangeEfiToLegacy function. +// +// 1 3/15/05 9:23a Olegi +// Initial VSS check-in. +// +//**************************************************************************** + +//<AMI_FHDR_START> +//----------------------------------------------------------------------------- +// +// Name: AmiUsbController.h +// +// Description: AMI USB Driver Protocol definition +// +//----------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef _USB_PROT_H +#define _USB_PROT_H + +#include <EFI.h> +#include <Protocol\AmiUsbCCID.h> + +#define EFI_USB_PROTOCOL_GUID \ + { 0x2ad8e2d2, 0x2e91, 0x4cd1, 0x95, 0xf5, 0xe7, 0x8f, 0xe5, 0xeb, 0xe3, 0x16 } + +#define AMI_USB_SMM_PROTOCOL_GUID \ + { 0x3ef7500e, 0xcf55, 0x474f, 0x8e, 0x7e, 0x0, 0x9e, 0xe, 0xac, 0xec, 0xd2 } + +GUID_VARIABLE_DECLARATION(gEfiUsbProtocolGuid,EFI_USB_PROTOCOL_GUID); + +GUID_VARIABLE_DECLARATION(gAmiUsbSmmProtocolGuid,AMI_USB_SMM_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <Protocol/BlockIo.h> +#include <AmiDxeLib.h> + +typedef union { + VOID *fpUHCIDescPtrs; + VOID *fpOHCIDescPtrs; + VOID *fpEHCIDescPtrs; +} DESC_PTRS; + +typedef struct { + UINT8 Flag; + UINT8 ReportId; + UINT16 UsagePage; + UINT32 ReportCount; + UINT8 ReportSize; + UINT32 LogicalMin; + UINT32 LogicalMax; + UINT32 PhysicalMax; //(EIP127014) + UINT32 PhysicalMin; //(EIP127014) + UINT8 UnitExponent; //(EIP127014) + UINT16 UsageCount; + UINT16 *Usages; + UINT16 MaxUsages; + UINT16 UsageMin; + UINT16 UsageMax; +} HID_REPORT_FIELD; + +typedef struct { + UINT8 Flag; + UINT16 AbsMaxX; + UINT16 AbsMaxY; + UINT16 ReportDescLen; + UINT8 FieldCount; + HID_REPORT_FIELD **Fields; +} HID_REPORT; + +#pragma pack(push, 1) + +typedef struct { + UINT8 DescLength; + UINT8 DescType; + UINT16 BcdUsb; + UINT8 BaseClass; + UINT8 SubClass; + UINT8 Protocol; + UINT8 MaxPacketSize0; + UINT16 VendorId; + UINT16 DeviceId; + UINT16 BcdDevice; + UINT8 MfgStr; + UINT8 ProductStr; + UINT8 SerialStr; + UINT8 NumConfigs; +} DEV_DESC; + +#pragma pack(pop) + +typedef struct _HC_STRUC HC_STRUC; +typedef struct _DEV_INFO DEV_INFO; +typedef struct _DEV_DRIVER DEV_DRIVER; +typedef struct _URP_STRUC URP_STRUC; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: HC_STRUC +// +// Description: USB Host Controller structure +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bHCNumber UINT8 Host Controller number, 1-based +// bHCType UINT8 Host Controller Type, U/O/E HCI +// fpFrameList UINT32* Host Controller Frame List Address +// BaseAddress UINTN Host Controller Base Address, memory (EHCI,OHCI) or IO (UHCI) +// bNumPorts UINT8 Number of root ports, 1-based +// wBusDevFuncNum UINT16 PCI location, bus (Bits8..15), device (Bits3..7), function(bits0..2) +// fpIRQInfo IRQ_INFO IRQ information +// stDescPtrs DESC_PTRS Commonly used descriptor pointers, see definition of DESC_PTRS +// wAsyncListSize UINT16 Async. list size +// bOpRegOffset UINT8 Operation region offset +// dMaxBulkDataSize UINT32 Maximum Bulk Transfer data size +// dHCFlag UINT32 Host Controller flag +// bExtCapPtr UINT8 EHCI Extended Capabilities Pointer +// bRegOfs UINT8 EHCI Capabilities PCI register Offset +// DebugPort UINT8 Port number of EHCI debug port +// usbbus_data VOID* USB Bus data specific to this Host Controller +// Controller EFI_HANDLE EFI Handle of this controller +// pHCdp EFI_DEVICE_PATH_PROTOCOL* Pointer to this controller's device path +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +struct _HC_STRUC { + UINT8 bHCNumber; + UINT8 bHCType; + UINT32 *fpFrameList; + UINTN BaseAddress; + UINTN BaseAddressSize; + UINT8 bNumPorts; + UINT16 wBusDevFuncNum; + UINT8 Irq; + DESC_PTRS stDescPtrs; + UINT16 wAsyncListSize; + UINT8 bOpRegOffset; + UINT32 dMaxBulkDataSize; + UINT32 dHCSParams; + UINT32 dHCCParams; + UINT32 dHCFlag; + UINT8 bExtCapPtr; // EHCI Extended Capabilities Pointer + UINT8 DebugPort; + VOID* usbbus_data; + EFI_HANDLE Controller; + EFI_DEVICE_PATH_PROTOCOL *pHCdp; + UINT8 PwrCapPtr; //(EIP54018+) + VOID *PciIo; + UINT16 Vid; + UINT16 Did; + EFI_HANDLE HwSmiHandle; + UINT16 SplitPeriodicIndex; +#if !USB_RUNTIME_DRIVER_IN_SMM + UINT32 MemPoolPages; + UINT8 *MemPool; + UINT32 MemBlkStsBytes; + UINT32 *MemBlkSts; +#endif +}; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: DEV_INFO +// +// Description: USB Device Information Structure +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bFlag UINT8 Device Information flags +// bDeviceType UINT8 Device Type +// wVendorId UINT16 Device VID +// wDeviceId UINT16 Device DID +// bDeviceAddress UINT8 Device USB Address +// bHCNumber UINT8 Host Controller Number this device is attached to +// bHubDeviceNumber UINT8 USB Hub Device Number this device is attached to +// bHubPortNumber UINT8 USB Hub Port Number this device is attached to +// bEndpointNum UINT8 Endpoint number +// bEndpointSpeed UINT8 Endpoint speed +// bLUN UINT8 Device Logical Unit number +// wEndp0MaxPacket UINT16 Endpoint0 max packet size, in Bytes +// bNumConfigs UINT8 Number of configurations +// bConfigNum UINT8 Active configuration number (0-based) +// bInterfaceNum UINT8 Active interface number +// bAltSettingNum UINT8 Alternate setting number (0-based) +// bCallBackIndex UINT8 Callback function index +// fpPollTDPtr UINT8* Polling TD pointer +// fpPollTEPtr UINT8* Polling ED pointer +// bHubNumPorts UINT8 Hub # of ports (USB hubs only) +// bHubPowerOnDelay UINT8 Hub power-on delay (USB hubs only) +// fpLUN0DevInfoPtr DEV_INFO* Pointer to Lun0 device (for multiple-LUN devices) +// wDataIn/OutSync UINT16 toggle tracking information +// bStorageType UINT8 USB_MASS_DEV_ARMD, USB_MASS_DEV_HDD, etc. +// wIntMaxPkt UINT16 Interrupt Max Packet size, in Bytes +// bPresent UINT8 Device presence indicator +// bIntEndpoint UINT8 Interrupt endpoint number +// bBulkInEndpoint UINT8 Bulk-In endpoint number +// bBulkOutEndpoint UINT8 Bulk-Out endpoint number +// bProtocol UINT8 Protocol +// wEmulationOption UINT16 USB Mass Storage Drive Emulation Option, from Setup +// bHiddenSectors UINT8 Number of hidden sectors, for USB mass storage devices only +// bSubClass UINT8 Device sub-class +// wBlockSize UINT16 USB Mass Storage Device block size, in Bytes +// dMaxLba UINT32 USB Mass Storage Device Maximum LBA number +// bHeads UINT8 USB Mass Storage Device # of heads +// bSectors UINT8 USB Mass Storage Device # of sectors +// wCylinders UINT16 USB Mass Storage Device # of cylinders +// bNonLBAHeads UINT8 USB Mass Storage Device # of heads reported in Non-LBA (CHS) functions +// bNonLBASectors UINT8 USB Mass Storage Device # of sectors reported in Non-LBA (CHS) functions +// wNonLBACylinders UINT16 USB Mass Storage Device # of cylinders reported in Non-LBA (CHS) functions +// bEmuType UINT8 USB Mass Storage Device emulation type +// bPhyDevType UINT8 USB Mass Storage Device physical type +// bMediaType UINT8 USB Mass Storage Device media type +// bDriveNumber UINT8 USB Mass Storage Device INT13 drive number +// wBulkInMaxPkt UINT16 USB Mass Storage Device Bulk-In max packet size, in Bytes +// wBulkOutMaxPkt UINT16 USB Mass Storage Device Bulk-Out max packet size, in Bytes +// wIncompatFlags UINT16 USB Mass Storage Device Incompatibility flags +// MassDev VOID* USB Mass Storage Device EFI handle +// fpDeviceDriver DEV_DRIVER* Device driver pointer +// bLastStatus UINT8 Last transaction status +// pExtra UINT8* Pointer to extra device specific data +// UINT32 UINT8 USB Mass Storage Device # of heads +// Handle UINT32[2] USB Device Handle +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +struct _DEV_INFO { + UINT32 Flag; //00 + UINT8 bDeviceType; //01 + UINT16 wVendorId; //02 + UINT16 wDeviceId; //04 + UINT8 bDeviceAddress; //06 + + UINT8 bHCNumber; //07 + UINT8 bHubDeviceNumber; //08 + UINT8 bHubPortNumber; //09 +// UINT8 bEndpointNum; //0A //(EIP70933-) + UINT8 bEndpointSpeed; //0B + UINT8 bLUN; //0C + UINT16 wEndp0MaxPacket;//0D +// UINT8 bNumConfigs; //0F + UINT8 bConfigNum; //10 + UINT8 bInterfaceNum; //11 + UINT8 bAltSettingNum; //12 + + UINT8 bCallBackIndex; //13 + UINT8 *fpPollTDPtr; //14 + UINT8 *fpPollEDPtr; //18 + + UINT8 bHubNumPorts; //1C + UINT8 bHubPowerOnDelay;//1D + + struct _DEV_INFO *fpLUN0DevInfoPtr; //1E +// UINT8 bDataSync; //22 + + UINT16 wDataInSync; // 22 + UINT16 wDataOutSync; // 24 + UINT8 bStorageType; // 26, USB_MASS_DEV_ARMD, USB_MASS_DEV_HDD, etc. + UINT16 IntInMaxPkt; //27 + UINT8 IntInEndpoint; //2A + UINT16 IntOutMaxPkt; + UINT8 IntOutEndpoint; + UINT8 bBulkInEndpoint; + UINT8 bBulkOutEndpoint; + + UINT8 bBaseClass; // BASE_CLASS_HID, BASE_CLASS_MASS_STORAGE or BASE_CLASS_HUB + UINT8 bSubClass; + UINT8 bProtocol; // + UINT16 wEmulationOption; // + UINT8 bHiddenSectors; // + + UINT16 wBlockSize; // + UINT64 MaxLba; // + UINT16 Heads; // + UINT8 bSectors; // + UINT16 wCylinders; // + UINT16 NonLBAHeads; // + UINT8 bNonLBASectors; // + UINT16 wNonLBACylinders; // + UINT8 bEmuType; // + UINT8 bPhyDevType; // + UINT8 bMediaType; // + UINT8 bDriveNumber; // + UINT16 wBulkInMaxPkt; // + UINT16 wBulkOutMaxPkt; // + UINT16 wIncompatFlags; // + VOID *MassDev; // + DEV_DRIVER *fpDeviceDriver; // + UINT8 bLastStatus; // + UINT8 *pExtra; // + UINT32 Handle[2]; + UINT8 DevNameString[64]; + VOID *DevMiscInfo; + UINT8 HubDepth; + UINT8 *fpPollDataBuffer; //Polling Data Buffer //(EIP54782+) + VOID *pCCIDDescriptor; // Ptr to CCID descriptor + UINT32 *DataRates; // List of DataRates supported by CCID + UINT32 *ClockFrequencies; // List of Frequencies suported by CCID + DLIST ICCDeviceList; // Linked list of ICC devices. :Linked to "ICCDeviceLink" + HID_REPORT HidReport; + UINT8 HidDevType; + UINT8 bPollInterval; //(EIP84455+) + UINT16 PollingLength; + UINT16 HubPortConnectMap; + UINT8 BpbMediaDesc; + DEV_DESC DevDesc; +}; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: DEV_DRIVER +// +// Description: USB Device Driver Structure +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevType UINT8 Device Type +// bBaseClass UINT8 Device Base Type +// bSubClass UINT8 Device Subclass +// bProtocol UINT8 Device Protocol +// pfnDeviceInit VOID Device Initialization Function +// pfnCheckDeviceType UINT8 Check Device Type Function +// pfnConfigureDevice DEV_INFO* Configure Device Function +// pfnDisconnectDevice UINT8 Disconnect Device Function +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +struct _DEV_DRIVER { + UINT8 bDevType; + UINT8 bBaseClass; + UINT8 bSubClass; + UINT8 bProtocol; + VOID (*pfnDeviceInit)(VOID); + UINT8 (*pfnCheckDeviceType)(DEV_INFO*, UINT8, UINT8, UINT8); + DEV_INFO* (*pfnConfigureDevice)(HC_STRUC*, DEV_INFO*, UINT8*, UINT16, UINT16); + UINT8 (*pfnDisconnectDevice)(DEV_INFO*); + VOID (*pfnDriverRequest)(DEV_INFO*, URP_STRUC*); +}; + +#pragma pack(push, 1) + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: CK_PRESENCE +// +// Description: This is a URP (USB Request Packet) structure for the BIOS +// API call CheckPresence (API #0) +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT16 wBiosRev; // USB BIOS Revision + UINT8 bBiosActive; // USB BIOS active/inactive + UINT8 bNumBootDev; // # of USB boot device + UINT16 wUsbDataArea; // USB Data area + UINT8 bNumKeyboards; // Number of USB keyboards present + UINT8 bNumMice; // Number of USB mice present + UINT8 bNumPoint; // Number of USB point present //<(EIP38434+) + UINT8 bNumHubs; // Number of USB hubs present + UINT8 bNumStorage; // Number of USB storage devices present +///////// DO NOT ADD ANY FIELD HERE. IF IT IS NECESSARY PLEASE UPDATE THE CODE +///////// IN THE FUNCTION USBWrap_GetDeviceCount in the file USBWRAP.ASM + UINT8 bNumHarddisk; // Number of hard disk emulated USB devices + UINT8 bNumCDROM; // Number of CDROM emulated USB devices + UINT8 bNumFloppy; // Number of floppy emulated USB devices +} CK_PRESENCE; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: START_HC +// +// Description: This is a URP (USB Request Packet) structure for the BIOS +// API call StartHC and MoveDataArea (API #20 & #24) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// wDataAreaFlag UINT16 Indicates which data area to use +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT16 wDataAreaFlag; // Data area to use +} START_HC; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: GET_DEV_INFO +// +// Description: This is a URP (USB Request Packet) structure for the BIOS +// API call GetDeviceInfo (API #25) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevNumber UINT8 Device # whose info is requested +// bHCNumber UINT8 HC # to which this device is connected (0 if no such device found) +// bDevType UINT8 Device type (0 if no such device found) +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevNumber; + UINT8 bHCNumber; + UINT8 bDevType; +} GET_DEV_INFO; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: CHK_DEV_PRSNC +// +// Description: This is a URP (USB Request Packet) structure for the BIOS +// API call CheckDevicePresence (API #26) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevType UINT8 Type of device to look for +// fpHCStruc FPHC_STRUC Pointer to HC being checked for device connection +// bNumber UINT8 Number of devices connected +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevType; + HC_STRUC *fpHCStruc; + UINT8 bNumber; +} CHK_DEV_PRSNC; + +typedef struct { + UINT8 ScrLock: 1; + UINT8 NumLock: 1; + UINT8 CapsLock: 1; + UINT8 Resrvd: 5; +} LED_MAP; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: KB_LEDS_DATA +// +// Description: This is a URP (USB Request Packet) structure for the BIOS +// API call LightenKeyboardLeds(API #2B) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// fpLedMap UINT32 32-bit Pointer to LED_MAP structure +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT32 fpLedMap; +} KB_LEDS_DATA; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SECURITY_IF +// +// Description: This is a URP (USB Request Packet) structure for the BIOS +// API call SecurityInterface (API #2Ah) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// fpBuffer FAR Buffer pointer to read/write data +// dLength UINT32 Length of the buffer +// dWaitTime UINT32 Wait time for the transaction in msec +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT32 fpBuffer; + UINT32 dLength; + UINT32 dWaitTime; +} SECURITY_IF; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_GET_DEV_INFO +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassGetDeviceInfo (API #27h, SubFunc 00h) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// bDevType UINT8 Device type byte (HDD, CD, Removable) +// bEmuType UINT8 Emulation type used +// fpDevId UINT32 Far pointer to the device ID +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; // (Return value) + UINT32 dSenseData; // USB Sense data + UINT8 bDevType; // Device type + UINT8 bEmuType; // Emulation type +// UINT8 bPhyDevType; // Physical device type + UINT32 fpDevId; // Far ptr to the device id +// DO NOT ADD OR DELETE ANY FIELD ABOVE - This should match the MASS_INQUIRY +// structure for proper working + UINT8 bTotalMassDev; // TotalNumber of devices + UINT8 bReserved; + UINT16 wPciInfo; // PCI Bus/Dev/Func number of HC the device is connected to + UINT32 Handle[2]; // Device handle +} MASS_GET_DEV_INFO; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_GET_DEV_STATUS +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MASS_GET_DEV_STATUS (API #27h, SubFunc XXh) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// bDeviceStatus UINT8 Connection status of the Mass device +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; + UINT8 bDeviceStatus; +} MASS_GET_DEV_STATUS; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_GET_DEV_GEO +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassGetDeviceGeometry (API #27h, +// SubFunc 01h) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// bNumHeads UINT8 Number of heads +// wNumCylinders UINT16 Number of cylinders +// bNumSectors UINT8 Number of sectors +// bLBANumHeads UINT8 Number of heads (for INT13h function 48h) +// wLBANumCyls UINT16 Number of cylinders (for INT13h function 48h) +// bLBANumSectors UINT8 Number of sectors (for INT13h function 48h) +// wUINT8sPerSector UINT16 Number of bytes per sector +// bMediaType UINT8 Media type +// dLastLBA UINT32 Last LBA address +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; // (Return value) + UINT32 dSenseData; // USB Sense data + UINT16 NumHeads; + UINT16 wNumCylinders; + UINT8 bNumSectors; + UINT16 LBANumHeads; + UINT16 wLBANumCyls; + UINT8 bLBANumSectors; + UINT16 wBytesPerSector; + UINT8 bMediaType; + UINT64 LastLBA; + UINT8 bInt13FuncNum; //(EIP13457+) + UINT8 BpbMediaDesc; +} MASS_GET_DEV_GEO; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_RESET +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassResetDevice (API #27h, SubFunc 02h) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; // USB Device Address + UINT32 dSenseData; // USB Sense data +} MASS_RESET; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_ASSIGN_DRIVE_NUM +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call USBMass_AssignDriveNumber +// (API #27h, SubFunc 0Eh) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// bLogDevNum UINT8 Logical Drive Number to assign to the device +// bHeads UINT8 Number of heads +// bSectors UINT8 Number of sectors/track +// wCylinders UINT16 Number of cylinders +// wBlockSize UINT16 Sector size in bytes +// bLUN UINT8 Maximum LUNs in the system +// bSpeed UINT8 <>0 if the device is hi-speed device +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; // USB Device Address + UINT8 bLogDevNum; // Logical Drive Number to assign to the device + UINT8 bHeads; + UINT8 bSectors; + UINT16 wCylinders; + UINT16 wBlockSize; + UINT8 bLUN; + UINT8 bSpeed; +} MASS_ASSIGN_DRIVE_NUM; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_READ +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassReadDevice (API #27h, SubFunc 03h) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// dStartLBA UINT32 Starting LBA address +// wNumBlks UINT16 Number of blocks to read +// wPreSkipSize UINT16 Number of bytes to skip before +// wPostSkipSize UINT16 Number of bytes to skip after +// fpBufferPtr UINT32 Far buffer pointer +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 DevAddr; // USB Device Address + UINT32 SenseData; // USB Sense data + UINT64 StartLba; // Starting LBA address + UINT16 NumBlks; // Number of blocks to read + UINT16 PreSkipSize; // Number of bytes to skip before + UINT16 PostSkipSize; // Number of bytes to skip after + UINT32 BufferPtr; // Far buffer pointer +} MASS_READ; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_WRITE +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassWriteDevice (API #27h, SubFunc 04h) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// dStartLBA UINT32 Starting LBA address +// wNumBlks UINT16 Number of blocks to write +// wPreSkipSize UINT16 Number of bytes to skip before +// wPostSkipSize UINT16 Number of bytes to skip after +// fpBufferPtr UINT32 Far buffer pointer +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 DevAddr; // USB Device Address + UINT32 SenseData; // USB Sense data + UINT64 StartLba; // Starting LBA address + UINT16 NumBlks; // Number of blocks to write + UINT16 PreSkipSize; // Number of bytes to skip before + UINT16 PostSkipSize; // Number of bytes to skip after + UINT32 BufferPtr; // Far buffer pointer +} MASS_WRITE; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_VERIFY +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassVerifyDevice (API #27h, SubFunc 05h) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// dStartLBA UINT32 Starting LBA address +// wNumBlks UINT16 Number of blocks to verify +// wPreSkipSize UINT16 Number of bytes to skip before +// wPostSkipSize UINT16 Number of bytes to skip after +// fpBufferPtr UINT32 Far buffer pointer +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 DevAddr; // USB Device Address + UINT32 SenseData; // USB Sense data + UINT64 StartLba; // Starting LBA address + UINT16 NumBlks; // Number of blocks to verify + UINT16 PreSkipSize; // Number of bytes to skip before + UINT16 PostSkipSize; // Number of bytes to skip after + UINT32 BufferPtr; // Far buffer pointer +} MASS_VERIFY; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_FORMAT +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassFormatDevice (API #27h, SubFunc 06h) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// bHeadNumber UINT8 Head number to format +// bTrackNumber UINT8 Track number to format +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; // USB Device Address + UINT32 dSenseData; // USB Sense data + UINT8 bHeadNumber; // Head number to format + UINT8 bTrackNumber; // Track number to format +} MASS_FORMAT; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_REQ_SENSE +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassRequestSense (API #27h, SubFunc 07h) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; // USB Device Address + UINT32 dSenseData; // USB Sense data +} MASS_REQ_SENSE; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_TEST_UNIT_RDY +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassTestUnitReady (API #27h, SubFunc 08h) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; // USB Device Address + UINT32 dSenseData; // USB Sense data +} MASS_TEST_UNIT_RDY; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_START_STOP_UNIT +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassStartStopUnit (API #27h, SubFunc 09h) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// bCommand UINT8 0 - Stop, 1 - Start +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; // USB Device Address + UINT32 dSenseData; // USB Sense data + UINT8 bCommand; // 0 - Stop, 1 - Start +} MASS_START_STOP_UNIT; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_READ_CAPACITY +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassReadCapacity (API #27h, SubFunc 0Ah) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// dMaxLBA UINT32 Maximum LBA address +// dBlockSize UINT32 Block size +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; // USB Device Address + UINT32 dSenseData; // USB Sense data + UINT32 dMaxLBA; // Max LBA address + UINT32 dBlockSize; // Block size +} MASS_READ_CAPACITY; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_MODE_SENSE +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassModeSense (API #27h, SubFunc 0Bh) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// bNumHeads UINT8 Number of heads +// wNumCylinders UINT16 Number of cylinders +// bNumSectors UINT8 Number of sectors +// wBytesPerSector UINT16 Number of bytes per sector +// bMediaType UINT8 Media type +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; // USB Device Address + UINT32 dSenseData; // USB Sense data + UINT8 bNumHeads; // Number of heads + UINT16 wNumCylinders; // Number of cylinders + UINT8 bNumSectors; // Number of sectors + UINT16 wBytesPerSector;// Number of bytes per sector + UINT8 bMediaType; // Media type +} MASS_MODE_SENSE; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_INQUIRY +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassInquiry (API #27h, SubFunc 0Ch) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr UINT8 USB device address of the device +// dSenseData UINT32 Sense data of the last command +// bDevType UINT8 Device type byte (HDD, CD, Removable) +// bEmuType BYTE Emulation type used +// fpDevId UINT32 Far pointer to the device ID +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; // USB Device Address + UINT32 dSenseData; // USB Sense data + UINT8 bDevType; // Device type + UINT8 bEmuType; // Emulation type + UINT32 fpDevId; // Far ptr to the device id +// DO NOT ADD OR DELETE ANY FIELD ABOVE - This should match the +// MASS_GET_DEV_INFO structure for proper working +} MASS_INQUIRY; + +typedef struct { + DEV_INFO *fpDevInfo; + MASS_INQUIRY *fpInqData; +} MASS_GET_DEV_PARMS; + +typedef struct { + DEV_INFO* fpDevInfo; +} MASS_CHK_DEV_READY; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: MASS_CMD_PASS_THRU +// +// Description: This is a Mass URP (Mass USB Request Packet) structure for +// the BIOS API call MassCmdPassThru command (API #27h, +// SubFunc 0Dh) +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bDevAddr BYTE USB device address of the device +// dSenseData UINT32 Sense data of the last command +// fpCmdBuffer UINT32 Far pointer to the command buffer +// wCmdLength UINT16 Command length +// fpDataBuffer UINT32 Far pointer for data buffer +// wDataLength UINT16 Data length +// bXferDir BYTE Data transfer direction +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 bDevAddr; + UINT32 dSenseData; + UINT32 fpCmdBuffer; + UINT16 wCmdLength; + UINT32 fpDataBuffer; + UINT16 wDataLength; + UINT8 bXferDir; +} MASS_CMD_PASS_THRU; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: HCPROC_PARAM +// +// Description: N/A +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct _HCPROC_PARAM{ + VOID* paramBuffer; //parameters as they should apear in stack of + // of the corresponding function invocation + unsigned bHCType; + unsigned paramSize; + UINTN retVal; +} HCPROC_PARAM; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: COREPROC_PARAM +// +// Description: This is a Core Procedure URP structure for +// the BIOS API call core command (API #2eh ) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct _COREPROC_PARAM{ + VOID* paramBuffer; //parameters as they should apear in stack of + // of the corresponding function invocation + unsigned paramSize; + UINTN retVal; +} COREPROC_PARAM, * FPCOREPROC_PARAM; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: GET_DEV_ADDR +// +// Description: This is a URP structure for the BIOS API(API #32h) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT16 Vid; // Vendor Id + UINT16 Did; // Device Id + UINT8 DevAddr; // USB Device Address +} GET_DEV_ADDR; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: HC_START_STOP +// +// Description: This is a URP structure for the BIOS API(API #36) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + BOOLEAN Start; + HC_STRUC *HcStruc; +} HC_START_STOP; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: CCID_GETSMARTCLASSDESCRIPTOR +// +// Description: This is a Core Procedure URP structure for +// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh ) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _CCID_GETSMARTCLASSDESCRIPTOR{ + OUT UINTN fpResponseBuffer; + IN UINT8 Slot; + OUT UINTN fpDevInfo; +} CCID_GETSMARTCLASSDESCRIPTOR, * FPCCID_GETSMARTCLASSDESCRIPTOR; + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: CCID_ATR +// +// Description: This is a Core Procedure URP structure for +// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh ) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _CCID_ATR{ + IN UINT8 Slot; + IN OUT UINTN ATRData; + OUT UINTN fpDevInfo; +} CCID_ATR, * FPCCID_ATR; + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: CCID_POWERUP_SLOT +// +// Description: This is a Core Procedure URP structure for +// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh ) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _CCID_POWERUP_SLOT{ + IN UINT8 Slot; + OUT UINT8 bStatus; + OUT UINT8 bError; + IN OUT UINTN ATRData; + OUT UINTN fpDevInfo; +} CCID_POWERUP_SLOT, * FPCCID_POWERUP_SLOT; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: CCID_POWERDOWN_SLOT +// +// Description: This is a Core Procedure URP structure for +// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh ) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _CCID_POWERDOWN_SLOT{ + IN UINT8 Slot; + OUT UINT8 bStatus; + OUT UINT8 bError; + OUT UINTN fpDevInfo; +} CCID_POWERDOWN_SLOT, * FPCCID_POWERDOWN_SLOT; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: CCID_GETSLOT_STATUS +// +// Description: This is a Core Procedure URP structure for +// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh ) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _CCID_GETSLOT_STATUS{ + OUT UINT8 bStatus; + OUT UINT8 bError; + OUT UINT8 bClockStatus; + IN UINT8 Slot; + OUT UINTN fpDevInfo; +} CCID_GETSLOT_STATUS, * FPCCID_GETSLOT_STATUS; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: CCID_XFRBLOCK +// +// Description: This is a Core Procedure URP structure for +// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh ) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _CCID_CCID_XFRBLOCK{ + IN UINTN CmdLength; + IN UINTN fpCmdBuffer; + IN UINT8 ISBlock; + OUT UINT8 bStatus; + OUT UINT8 bError; + IN OUT UINTN ResponseLength; + OUT UINTN fpResponseBuffer; + IN UINT8 Slot; + OUT UINTN fpDevInfo; +} CCID_XFRBLOCK, * FPCCID_XFRBLOCK; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: CCID_GET_PARAMS +// +// Description: This is a Core Procedure URP structure for +// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh ) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _CCID_GET_PARAMS{ + OUT UINT8 bStatus; + OUT UINT8 bError; + IN OUT UINTN ResponseLength; + OUT UINTN fpResponseBuffer; + IN UINT8 Slot; + OUT UINTN fpDevInfo; +} CCID_GET_PARAMS, * FPCCID_GET_PARAMS; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: API_DATA +// +// Description: This is a union data type of all the API related data +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef union { + CK_PRESENCE CkPresence; + START_HC StartHc; + GET_DEV_INFO GetDevInfo; + CHK_DEV_PRSNC ChkDevPrsnc; + SECURITY_IF SecurityIf; + MASS_GET_DEV_INFO MassGetDevInfo; + MASS_GET_DEV_STATUS MassGetDevSts; + MASS_GET_DEV_GEO MassGetDevGeo; + MASS_RESET MassReset; + MASS_READ MassRead; + MASS_WRITE MassWrite; + MASS_VERIFY MassVerify; + MASS_FORMAT MassFormat; + MASS_REQ_SENSE MassReqSense; + MASS_TEST_UNIT_RDY MassTstUnitRdy; + MASS_START_STOP_UNIT MassStartStop; + MASS_READ_CAPACITY MassReadCap; + MASS_MODE_SENSE MassModeSense; + MASS_INQUIRY MassInquiry; + MASS_CMD_PASS_THRU MassCmdPassThru; + MASS_ASSIGN_DRIVE_NUM MassAssignNum; + MASS_CHK_DEV_READY MassChkDevReady; + MASS_GET_DEV_PARMS MassGetDevParms; + KB_LEDS_DATA KbLedsData; + UINT8 Owner; + HCPROC_PARAM HcProc; + COREPROC_PARAM CoreProc; + UINT8 KbcControlCode; //(EIP29733+) + GET_DEV_ADDR GetDevAddr; + UINT8 DevAddr; + // CCID APIs + CCID_GETSMARTCLASSDESCRIPTOR CCIDSmartClassDescriptor; + CCID_ATR CCIDAtr; + CCID_POWERUP_SLOT CCIDPowerupSlot; + CCID_POWERDOWN_SLOT CCIDPowerdownSlot; + CCID_GETSLOT_STATUS CCIDGetSlotStatus; + CCID_XFRBLOCK CCIDXfrBlock; + CCID_GET_PARAMS CCIDGetParameters; + UINT16 HcBusDevFuncNum; //(EIP74876+) + HC_START_STOP HcStartStop; +} U_API_DATA; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: URP_STRUC +// +// Description: This structure is the URP structure +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// bFuncNumber UINT8 Function number of the URP +// bSubFunc UINT8 Sub-func number of the URP +// bRetValue UINT8 Return value +// ApiData API_DATA Refer structure definition +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +struct _URP_STRUC { + UINT8 bFuncNumber; + UINT8 bSubFunc; + UINT8 bRetValue; + U_API_DATA ApiData; +}; + +#pragma pack(pop) + +typedef struct { + UINT8 NumUsbKbds; + UINT8 NumUsbMice; + UINT8 NumUsbPoint; //(EIP38434+) + UINT8 NumUsbMass; + UINT8 NumUsbHubs; + UINT8 NumUsbCcids; + UINT8 NumUhcis; + UINT8 NumOhcis; + UINT8 NumEhcis; + UINT8 NumXhcis; +} CONNECTED_USB_DEVICES_NUM; + +typedef VOID (EFIAPI *EFI_USB_REPORT_DEVICES ) ( + CONNECTED_USB_DEVICES_NUM *); + +typedef struct _EFI_USB_HOTPLUG_DEVS { + BOOLEAN cdrom; + BOOLEAN floppy; +} EFI_USB_HOTPLUG_DEVS; + +typedef EFI_STATUS (EFIAPI *EFI_USB_GET_HOTPLUG_DEVS ) ( + EFI_USB_HOTPLUG_DEVS *); + +typedef EFI_STATUS (EFIAPI *EFI_USB_GET_RUNTIME_REGION ) ( + EFI_PHYSICAL_ADDRESS *, + EFI_PHYSICAL_ADDRESS *); + +typedef UINT8 (EFIAPI *EFI_USB_GET_NEXT_MASS_DEVICE_NAME ) ( + UINT8*, UINT8, UINT8); + +typedef struct +{ + EFI_BLOCK_IO_PROTOCOL BlockIoProtocol; + EFI_BLOCK_IO_MEDIA *Media; + VOID *DevInfo; + UINT16 LogicalAddress; + EFI_HANDLE Handle; + UINT16 PciBDF; + UINT8 *DevString; + UINT8 StorageType; +} USB_MASS_DEV; + +//(EIP51653+)> +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: USB_SKIP_LIST +// +// +// Description: If your roothub port 4 insert a hub.You want to skip hub's port 2. +// Set bRootPort = 4, dRoutePath =2 +// If your roothub port 4 insert a hub1.And hub1 port 2 insert a hub2. +// You want to skip hub2's port 1. +// Set bRootPort = 4, dRoutePath =21 +// Fields: Name Type Description +// ------------------------------------------------------------ +// bSkipType BYTE Skip by which Type +// bSkipAll BYTE If this flag is 1 than skip all ports. +// wBDF WORD Bus Dev Function +// bRootPort BYTE Root port path +// dRoutePath DWORD Hub route path. See description. +// bBaseClass BYTE Device Type +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +#define SKIP_FOR_ALLCONTROLLER 0x1 //(EIP62695) + //(EIP88776+)> +#define SKIP_FLAG_SKIP_PORT 0x0 +#define SKIP_FLAG_KEEP_PORT 0x1 +#define SKIP_FLAG_SKIP_LEVEL 0x2 //Skip usb ports on the same level. +#define SKIP_FLAG_SKIP_MULTI_LEVEL 0x3 //Skip usb ports which include down stream ports. + //<(EIP88776+) +typedef struct _USB_SKIP_LIST{ + UINT8 bSkipType; + UINT8 bFlag; //(EIP88776) + UINT16 wBDF; + UINT8 bRootPort; + UINT32 dRoutePath; + UINT8 bBaseClass; +} USB_SKIP_LIST; +//<(EIP51653+) + +//---------------------------------------------------------------------------- +// USB Mass Storage Related Data Structures and Equates +//---------------------------------------------------------------------------- +#define USB_EMU_NONE 0 +#define USB_EMU_FLOPPY_ONLY 1 +#define USB_EMU_HDD_ONLY 2 +#define USB_EMU_HDD_OR_FDD 3 +#define USB_EMU_FORCED_FDD 4 + +#define BAID_TYPE_HDD 1 +#define BAID_TYPE_RMD_HDD 2 +#define BAID_TYPE_CDROM 3 +#define BAID_TYPE_RMD_FDD 4 +#define BAID_TYPE_FDD 5 + +// Values for Mass Storage Device type +//------------------------------------- +#define USB_MASS_DEV_UNKNOWN 0 +#define USB_MASS_DEV_HDD 1 +#define USB_MASS_DEV_CDROM 2 +#define USB_MASS_DEV_ARMD 3 +#define USB_MASS_DEV_FDD 4 +#define USB_MASS_DEV_MO 5 + + +#define STOP_USB_CONTROLLER 0 //(EIP43475+) +#define START_USB_CONTROLLER 1 //(EIP43475+) + +typedef VOID (*API_FUNC)(URP_STRUC*); +typedef VOID (EFIAPI *EFI_USB_CHANGE_EFI_TO_LEGACY) (UINT8); +//typedef EFI_STATUS (EFIAPI *EFI_USB_BBS_REMOVE_MASSSTORAGE) (); + +typedef EFI_STATUS (EFIAPI *EFI_INSTALL_USB_LEGACY_BOOT_DEVICES)(VOID); +typedef EFI_STATUS (EFIAPI *EFI_USB_INSTALL_LEGACY_DEVICE)(USB_MASS_DEV*); +typedef EFI_STATUS (EFIAPI *EFI_USB_UNINSTALL_LEGACY_DEVICE)(USB_MASS_DEV*); +typedef EFI_STATUS (EFIAPI *EFI_GET_ASSIGN_USB_BOOT_PORT)(UINT8*, UINT8*); +typedef VOID (EFIAPI *EFI_KBC_ACCESS_CONTROL)(UINT8); +typedef EFI_STATUS (EFIAPI *EFI_USB_RT_LEGACY_CONTROL)(VOID *); +typedef VOID (EFIAPI *EFI_USB_STOP_UNSUPPORTED_HC)(); +typedef VOID (EFIAPI *EFI_USB_SHUTDOWN_LEGACY)(); //<(EIP52339+) +typedef VOID (EFIAPI *EFI_USB_COPY_SKIP_TABLE)(USB_SKIP_LIST*, UINT8); //(EIP51653+) +typedef VOID (EFIAPI *EFI_USB_RT_STOP_CONTROLLER)(UINT16); //(EIP74876+) +typedef VOID (EFIAPI *EFI_USB_INVOKE_API)(VOID*); +typedef struct _EFI_USB_PROTOCOL { + UINT32 Signature; //(EIP55275+) + VOID *USBDataPtr; +// VOID *UsbBadDeviceTable; //(EIP60706-) + EFI_USB_REPORT_DEVICES UsbReportDevices; + EFI_USB_GET_NEXT_MASS_DEVICE_NAME UsbGetNextMassDeviceName; + EFI_USB_CHANGE_EFI_TO_LEGACY UsbChangeEfiToLegacy; +// EFI_USB_BBS_REMOVE_MASSSTORAGE UsbBbsRemoveMassStorage; + EFI_USB_GET_RUNTIME_REGION UsbGetRuntimeRegion; + EFI_INSTALL_USB_LEGACY_BOOT_DEVICES InstallUsbLegacyBootDevices; + EFI_USB_INSTALL_LEGACY_DEVICE UsbInstallLegacyDevice; + EFI_USB_UNINSTALL_LEGACY_DEVICE UsbUninstallLegacyDevice; + EFI_GET_ASSIGN_USB_BOOT_PORT UsbGetAssignBootPort; + EFI_KBC_ACCESS_CONTROL UsbRtKbcAccessControl; + EFI_USB_RT_LEGACY_CONTROL UsbLegacyControl; + EFI_USB_STOP_UNSUPPORTED_HC UsbStopUnsupportedHc; + EFI_USB_SHUTDOWN_LEGACY UsbRtShutDownLegacy; //EIP52339+ + EFI_USB_COPY_SKIP_TABLE UsbCopySkipTable; //(EIP51653+) + EFI_USB_RT_STOP_CONTROLLER UsbRtStopController; //(EIP74876+) + EFI_USB_INVOKE_API UsbInvokeApi; +} EFI_USB_PROTOCOL; + +typedef struct { + UINT32 ConstantDataCrc32; + UINT32 Crc32Hash; +} AMI_USB_GLOBAL_DATA_VALIDATION; + +typedef struct { + EFI_USB_STOP_UNSUPPORTED_HC UsbStopUnsupportedHc; + API_FUNC *UsbApiTable; + API_FUNC *UsbMassApiTable; + AMI_USB_GLOBAL_DATA_VALIDATION GlobalDataValidation; +} AMI_USB_SMM_PROTOCOL; + +#endif +#endif // _USB_PROT_H + +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2016, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** diff --git a/Include/Protocol/ArchProtocol.cif b/Include/Protocol/ArchProtocol.cif new file mode 100644 index 0000000..846a440 --- /dev/null +++ b/Include/Protocol/ArchProtocol.cif @@ -0,0 +1,21 @@ +<component> + name = "ArchProtocol" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "ArchProtocol" +[files] +"Timer.h" +"WatchdogTimer.h" +"Metronome.h" +"CPU.h" +"RealTimeClock.h" +"Reset.h" +"Variable.h" +"MonotonicCounter.h" +"BDS.h" +"StatusCode.h" +"Runtime.h" +"Capsule.h" +"Security.h" +"Security2.h" +<endComponent> diff --git a/Include/Protocol/AtaPassThru.h b/Include/Protocol/AtaPassThru.h new file mode 100644 index 0000000..0196ee4 --- /dev/null +++ b/Include/Protocol/AtaPassThru.h @@ -0,0 +1,208 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Include/Protocol/AtaPassThru.h 1 6/13/11 6:35p Artems $ +// +// $Revision: 1 $ +// +// $Date: 6/13/11 6:35p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/AtaPassThru.h $ +// +// 1 6/13/11 6:35p Artems +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: AtaPassThru.h +// +// Description: +// EFI_DRIVER_HEALTH_PROTOCOL definition file +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __ATA_PASS_THRU_PROTOCOL__H__ +#define __ATA_PASS_THRU_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> +#include <Protocol/DevicePath.h> + +#define EFI_ATA_PASS_THRU_PROTOCOL_GUID \ + { 0x1d3de7f0, 0x807, 0x424f, 0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f } + +GUID_VARIABLE_DECLARATION(gEfiAtaPassThruProtocolGuid, EFI_ATA_PASS_THRU_PROTOCOL_GUID); + +typedef struct _EFI_ATA_PASS_THRU_PROTOCOL EFI_ATA_PASS_THRU_PROTOCOL; + +typedef struct { + UINT32 Attributes; + UINT32 IoAlign; +} EFI_ATA_PASS_THRU_MODE; + +#define EFI_ATA_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001 +#define EFI_ATA_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002 +#define EFI_ATA_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004 + +typedef struct _EFI_ATA_COMMAND_BLOCK { + UINT8 Reserved1[2]; + UINT8 AtaCommand; + UINT8 AtaFeatures; + UINT8 AtaSectorNumber; + UINT8 AtaCylinderLow; + UINT8 AtaCylinderHigh; + UINT8 AtaDeviceHead; + UINT8 AtaSectorNumberExp; + UINT8 AtaCylinderLowExp; + UINT8 AtaCylinderHighExp; + UINT8 AtaFeaturesExp; + UINT8 AtaSectorCount; + UINT8 AtaSectorCountExp; + UINT8 Reserved2[6]; +} EFI_ATA_COMMAND_BLOCK; + +typedef struct _EFI_ATA_STATUS_BLOCK { + UINT8 Reserved1[2]; + UINT8 AtaStatus; + UINT8 AtaError; + UINT8 AtaSectorNumber; + UINT8 AtaCylinderLow; + UINT8 AtaCylinderHigh; + UINT8 AtaDeviceHead; + UINT8 AtaSectorNumberExp; + UINT8 AtaCylinderLowExp; + UINT8 AtaCylinderHighExp; + UINT8 Reserved2; + UINT8 AtaSectorCount; + UINT8 AtaSectorCountExp; + UINT8 Reserved3[6]; +} EFI_ATA_STATUS_BLOCK; + +typedef UINT8 EFI_ATA_PASS_THRU_CMD_PROTOCOL; + +#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_HARDWARE_RESET 0x00 +#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_SOFTWARE_RESET 0x01 +#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_NON_DATA 0x02 +#define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_IN 0x04 +#define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_OUT 0x05 +#define EFI_ATA_PASS_THRU_PROTOCOL_DMA 0x06 +#define EFI_ATA_PASS_THRU_PROTOCOL_DMA_QUEUED 0x07 +#define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_DIAGNOSTIC 0x08 +#define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_RESET 0x09 +#define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_IN 0x0A +#define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_OUT 0x0B +#define EFI_ATA_PASS_THRU_PROTOCOL_FPDMA 0x0C +#define EFI_ATA_PASS_THRU_PROTOCOL_RETURN_RESPONSE 0xFF + +typedef UINT8 EFI_ATA_PASS_THRU_LENGTH; + +#define EFI_ATA_PASS_THRU_LENGTH_BYTES 0x80 +#define EFI_ATA_PASS_THRU_LENGTH_MASK 0x70 +#define EFI_ATA_PASS_THRU_LENGTH_NO_DATA_TRANSFER 0x00 +#define EFI_ATA_PASS_THRU_LENGTH_FEATURES 0x10 +#define EFI_ATA_PASS_THRU_LENGTH_SECTOR_COUNT 0x20 +#define EFI_ATA_PASS_THRU_LENGTH_TPSIU 0x30 +#define EFI_ATA_PASS_THRU_LENGTH_COUNT 0x0F + +typedef struct { + EFI_ATA_STATUS_BLOCK *Asb; + EFI_ATA_COMMAND_BLOCK *Acb; + UINT64 Timeout; + VOID *InDataBuffer; + VOID *OutDataBuffer; + UINT32 InTransferLength; + UINT32 OutTransferLength; + EFI_ATA_PASS_THRU_CMD_PROTOCOL Protocol; + EFI_ATA_PASS_THRU_LENGTH Length; +} EFI_ATA_PASS_THRU_COMMAND_PACKET; + +typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_PASSTHRU) ( + IN EFI_ATA_PASS_THRU_PROTOCOL *This, + IN UINT16 Port, + IN UINT16 PortMultiplierPort, + IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *Packet, + IN EFI_EVENT Event OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_GET_NEXT_PORT) ( + IN EFI_ATA_PASS_THRU_PROTOCOL *This, + IN OUT UINT16 *Port +); + +typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_GET_NEXT_DEVICE) ( + IN EFI_ATA_PASS_THRU_PROTOCOL *This, + IN UINT16 Port, + IN OUT UINT16 *PortMultiplierPort +); + +typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_BUILD_DEVICE_PATH) ( + IN EFI_ATA_PASS_THRU_PROTOCOL *This, + IN UINT16 Port, + IN UINT16 PortMultiplierPort, + IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath +); + +typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_GET_DEVICE) ( + IN EFI_ATA_PASS_THRU_PROTOCOL *This, + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, + OUT UINT16 *Port, + OUT UINT16 *PortMultiplierPort +); + +typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_RESET_PORT) ( + IN EFI_ATA_PASS_THRU_PROTOCOL *This, + IN UINT16 Port +); + +typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_RESET_DEVICE) ( + IN EFI_ATA_PASS_THRU_PROTOCOL *This, + IN UINT16 Port, + IN UINT16 PortMultiplierPort +); + +struct _EFI_ATA_PASS_THRU_PROTOCOL { + EFI_ATA_PASS_THRU_MODE *Mode; + EFI_ATA_PASS_THRU_PASSTHRU PassThru; + EFI_ATA_PASS_THRU_GET_NEXT_PORT GetNextPort; + EFI_ATA_PASS_THRU_GET_NEXT_DEVICE GetNextDevice; + EFI_ATA_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath; + EFI_ATA_PASS_THRU_GET_DEVICE GetDevice; + EFI_ATA_PASS_THRU_RESET_PORT ResetPort; + EFI_ATA_PASS_THRU_RESET_DEVICE ResetDevice; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/AuthenticationInfo.h b/Include/Protocol/AuthenticationInfo.h new file mode 100644 index 0000000..99a10df --- /dev/null +++ b/Include/Protocol/AuthenticationInfo.h @@ -0,0 +1,93 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Include/Protocol/AuthenticationInfo.h 1 4/22/11 6:45p Artems $ +// +// $Revision: 1 $ +// +// $Date: 4/22/11 6:45p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/AuthenticationInfo.h $ +// +// 1 4/22/11 6:45p Artems +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: AuthenticationInfo.h +// +// Description: +// EFI_AUTHENTICATION_INFO_PROTOCOL definition file +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __AUTHENTICATION_INFO_PROTOCOL__H__ +#define __AUTHENTICATION_INFO_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + +#define EFI_AUTHENTICATION_INFO_PROTOCOL_GUID \ + { 0x7671d9d0, 0x53db, 0x4173, 0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0xb, 0xc7 } + +GUID_VARIABLE_DECLARATION(gEfiAuthenticationInfoProtocolGuid, EFI_AUTHENTICATION_INFO_PROTOCOL_GUID); + + +typedef struct _EFI_AUTHENTICATION_INFO_PROTOCOL EFI_AUTHENTICATION_INFO_PROTOCOL; + +typedef +EFI_STATUS +(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_GET) ( + IN EFI_AUTHENTICATION_INFO_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + OUT VOID **Buffer +); + +typedef +EFI_STATUS +(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_SET) ( + IN EFI_AUTHENTICATION_INFO_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN VOID *Buffer +); + +struct _EFI_AUTHENTICATION_INFO_PROTOCOL { + EFI_AUTHENTICATION_INFO_PROTOCOL_GET Get; + EFI_AUTHENTICATION_INFO_PROTOCOL_SET Set; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/BDS.h b/Include/Protocol/BDS.h new file mode 100644 index 0000000..16088a5 --- /dev/null +++ b/Include/Protocol/BDS.h @@ -0,0 +1,88 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/BDS.h 3 3/13/06 1:45a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 3/13/06 1:45a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/BDS.h $ +// +// 3 3/13/06 1:45a Felixp +// +// 2 3/04/05 10:30a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:42a Felixp +// +// 1 12/23/04 9:29a Felixp +// +// 1 3/30/04 2:24a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: BDS.h +// +// Description: BDS Architectural Protocol Definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __BDS_ARCH_PROTOCOL_H__ +#define __BDS_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_BDS_ARCH_PROTOCOL_GUID \ + {0x665E3FF6,0x46CC,0x11d4,0x9A,0x38,0x00,0x90,0x27,0x3F,0xC1,0x4D} + +GUID_VARIABLE_DECLARATION(gEfiBdsArchProtocolGuid, EFI_BDS_ARCH_PROTOCOL_GUID); + +typedef struct _EFI_BDS_ARCH_PROTOCOL EFI_BDS_ARCH_PROTOCOL; + +typedef VOID (EFIAPI *EFI_BDS_ENTRY) ( + IN EFI_BDS_ARCH_PROTOCOL *This +); + +struct _EFI_BDS_ARCH_PROTOCOL{ + EFI_BDS_ENTRY Entry; +} ; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/BlockIo.h b/Include/Protocol/BlockIo.h new file mode 100644 index 0000000..8a1d7d1 --- /dev/null +++ b/Include/Protocol/BlockIo.h @@ -0,0 +1,212 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/BlockIo.h 5 4/21/11 12:50p Artems $ +// +// $Revision: 5 $ +// +// $Date: 4/21/11 12:50p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/BlockIo.h $ +// +// 5 4/21/11 12:50p Artems +// EIP 58686: add new structure fields for UEFI 2.3.1 specification +// compliance +// +// 4 3/13/06 1:40a Felixp +// +// 3 3/04/05 10:31a Mandal +// +// 2 2/08/05 11:49a Felixp +// EFI_LBA definition removed since it's already defined in EFI.h +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 8/19/04 6:26p Robert +// +// 1 1/26/04 3:25p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: BlockIo.h +// +// Description: EFI_BLOCK_IO_PROTOCOL definition file +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __BLOCK_IO_PROTOCOL_H__ +#define __BLOCK_IO_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_BLOCK_IO_PROTOCOL_GUID \ + { 0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + +#define EFI_BLOCK_IO_PROTOCOL_REVISION2 0x00020001 +#define EFI_BLOCK_IO_PROTOCOL_REVISION3 ((2<<16) | (31)) + +GUID_VARIABLE_DECLARATION(gEfiBlockIoProtocolGuid,EFI_BLOCK_IO_PROTOCOL_GUID); + +// Forward reference for pure ANSI compatability +typedef struct _EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL; + +//============================================================================= +typedef struct { + UINT32 MediaId; + BOOLEAN RemovableMedia; + BOOLEAN MediaPresent; + BOOLEAN LogicalPartition; + BOOLEAN ReadOnly; + BOOLEAN WriteCaching; + UINT32 BlockSize; + UINT32 IoAlign; + EFI_LBA LastBlock; + EFI_LBA LowestAlignedLba; //added in Revision 2 + UINT32 LogicalBlocksPerPhysicalBlock; //added in Revision 2 + UINT32 OptimalTransferLengthGranularity; //added in Revision 3 +} EFI_BLOCK_IO_MEDIA; + +//============================================================================= +// Function: Reset +// +// Description: resets the block device hardware. +// +// Inputs: +// This - Indicates a pointer to the calling context. +// ExtendedVerification - Indicates that the driver may perform a more exhaustive +// verification operation of the device during reset. +// +// Outputs: Returns EFI_STATUS +// +// Notes: +// +//============================================================================= +typedef EFI_STATUS (EFIAPI *EFI_BLOCK_RESET) ( + IN EFI_BLOCK_IO_PROTOCOL *This, + IN BOOLEAN ExtendedVerification +); + +//============================================================================= +// Function: ReadBlocks +// +// Description: function reads the requested number of blocks from the device. All the +// blocks are read, or an error is returned. +// +// Inputs: +// This Indicates a pointer to the calling context. +// MediaId - The media ID that the read request is for. +// LBA - The starting logical block address to read from on the device. +// BufferSize - The size of the Buffer in bytes. This must be a multiple of the intrinsic +// block size of the device. +// +// Outputs: +// Buffer - A pointer to the destination buffer for the data. The caller is responsible +// for either having implicit or explicit ownership of the buffer. +// +// Notes: +// +//============================================================================= +typedef EFI_STATUS (EFIAPI *EFI_BLOCK_READ) ( + IN EFI_BLOCK_IO_PROTOCOL *This, + IN UINT32 MediaId, + IN EFI_LBA LBA, + IN UINTN BufferSize, + OUT VOID *Buffer +); + +//============================================================================= +// Function: WriteBlocks +// +// Description: writes the requested number of blocks to the device. All blocks +// are written, or an error is returned. +// +// Inputs: +// This - Indicates a pointer to the calling context. +// MediaId - The media ID that the write request is for. +// LBA - The starting logical block address to be written. +// BufferSize - The size in bytes of Buffer. This must be a multiple of the intrinsic +// block size of the device. +// Buffer - A pointer to the source buffer for the data. +// +// Outputs: returns EFI_STATUS +// +// Notes: +// +//============================================================================= +typedef EFI_STATUS (EFIAPI *EFI_BLOCK_WRITE) ( + IN EFI_BLOCK_IO_PROTOCOL *This, + IN UINT32 MediaId, + IN EFI_LBA LBA, + IN UINTN BufferSize, + IN VOID *Buffer +); + +//============================================================================= +// Function: FlushBlocks +// +// Description: flushes all modified data to the physical block device. +// +// Inputs: +// This - Indicates a pointer to the calling context. +// +// Outputs: returns EFI_STATUS +// +// Notes: +// +//============================================================================= +typedef EFI_STATUS (EFIAPI *EFI_BLOCK_FLUSH) ( + IN EFI_BLOCK_IO_PROTOCOL *This +); + +//============================================================================= +// Protocol Definition +struct _EFI_BLOCK_IO_PROTOCOL { + UINT64 Revision; + EFI_BLOCK_IO_MEDIA *Media; + EFI_BLOCK_RESET Reset; + EFI_BLOCK_READ ReadBlocks; + EFI_BLOCK_WRITE WriteBlocks; + EFI_BLOCK_FLUSH FlushBlocks; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/BootScriptSave.h b/Include/Protocol/BootScriptSave.h new file mode 100644 index 0000000..744ce64 --- /dev/null +++ b/Include/Protocol/BootScriptSave.h @@ -0,0 +1,193 @@ +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2007, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/BootScriptSave.h 12 6/16/11 9:48a Felixp $ +// +// $Revision: 12 $ +// +// $Date: 6/16/11 9:48a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/BootScriptSave.h $ +// +// 12 6/16/11 9:48a Felixp +// BOOT_SCRIPT_S3_... macros moved to AmiDxeLib.h from BootScripSave.h +// +// 11 5/13/11 3:29p Oleksiyy +// [TAG] EIP56650 +// [Category] New Feature +// [Description] S3 Save State Protocol and S3 Smm Save State Protocol +// functions added. Support for opcodes introduced in PI 1.2 added. +// [Files] BootScriptCommon.h, BootScriptExecuter.c, +// BootScriptPrivate.h, BootScriptSave.c and BootScriptSave.h +// +// 10 3/09/11 5:43p Artems +// EFI_BOOT_SCRIPT_WIDTH moved to BootScriptCommon.h +// +// 9 2/05/11 2:29p Artems +// Common definitions for PI 0.91 and PI 1.1 moved to BootScriptCommon.h +// +// 8 7/17/07 10:44a Markw +// Updated typecasts in macro where UINTN is needed. +// +// 7 2/12/07 11:20a Felixp +// Clean up +// +// 6 2/12/07 11:18a Felixp +// Revision field removed from EFI_BOOT_SCRIPT_SAVE_PROTOCOL structure +// to match BootScript spec (it was earlier their for Tiano compliance. +// Tiano header is fixed now). +// +// 5 12/26/06 2:57p Markw +// Add BootScript Polling. +// +// 4 3/13/06 1:40a Felixp +// +// 3 11/07/05 3:42p Sivagarn +// Removed SMBus related definitions. The Smbus definitions are moved to +// appropriate SMBUS.H file. +// +// 2 4/04/05 4:37p Markw +// Modified existing and added new macros. +// +// 1 1/28/05 12:44p Felixp +// +// 1 12/23/04 9:41a Felixp +// +// 5 4/22/04 2:32p Felixp +// +// 4 3/09/04 9:37a Markw +// Fixed Io RW Macro. +// +// 3 3/08/04 5:25p Markw +// Fixed the BootScriptSave macros. +// +// 2 3/02/04 4:44p Markw +// Added Boot Script Macros +// +// 1 2/26/04 2:36p Markw +// +//********************************************************************** + + +//<AMI_FHDR_START> +//--------------------------------------------------------------------------- +// Name: BootScriptSave.h +// +// Description: Boot Script Save Protocol header. +// +//--------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __BOOT_SCRIPT_SAVE_PROTOCOL__H__ +#define __BOOT_SCRIPT_SAVE_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> +#include <BootScriptCommon.h> + +#define EFI_BOOT_SCRIPT_SAVE_GUID \ + {0x470e1529,0xb79e,0x4e32,0xa0,0xfe,0x6a,0x15,0x6d,0x29,0xf9,0xb2} + +GUID_VARIABLE_DECLARATION(gEfiBootScriptSaveGuid,EFI_BOOT_SCRIPT_SAVE_GUID); + +//******************************************* +// EFI_ACPI_S3_RESUME_SCRIPT_TABLE +//******************************************* +#define EFI_ACPI_S3_RESUME_SCRIPT_TABLE 0x00 + +//***************** +// Generic macros. +//***************** + +#define BOOT_SCRIPT_IO_WRITE_MACRO(This, TableName, Width, Address, Count, Buffer) \ + This->Write(This,TableName,EFI_BOOT_SCRIPT_IO_WRITE_OPCODE,Width,(UINT64)Address,(UINTN)Count,Buffer) + +#define BOOT_SCRIPT_IO_READ_WRITE_MACRO(This,TableName,Width,Address,Data,DataMask) \ + This->Write(This,TableName,EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE,Width,(UINT64)Address,Data,DataMask) + +#define BOOT_SCRIPT_MEM_WRITE_MACRO(This,TableName,Width,Address,Count,Buffer) \ + This->Write(This,TableName,EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE,Width,(UINT64)Address,(UINTN)Count,Buffer) + +#define BOOT_SCRIPT_MEM_READ_WRITE_MACRO(This,TableName,Width,Address,Data,DataMask) \ + This->Write(This,TableName,EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE,Width,(UINT64)Address,Data,DataMask) + +#define BOOT_SCRIPT_PCI_CONFIG_WRITE_MACRO(This,TableName,Width,Address,Count,Buffer) \ + This->Write(This,TableName,EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE,Width,(UINT64)Address,(UINTN)Count,Buffer) + +#define BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_MACRO(This,TableName,Width,Address,Data,DataMask) \ + This->Write(This,TableName,EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE,Width,(UINT64)Address,Data,DataMask) + +#define BOOT_SCRIPT_SMBUS_EXECUTE_MACRO(This,TableName,SlaveAddress,Command,Operation,PecCheck,Length,Buffer) \ + This->Write(This,TableName,EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE,SlaveAddress,Command,Operation,PecCheck,Length,Buffer) + +#define BOOT_SCRIPT_STALL_MACRO(This,TableName,Duration) \ + This->Write(This,TableName,EFI_BOOT_SCRIPT_STALL_OPCODE,Duration) + +#define BOOT_SCRIPT_DISPATCH_MACRO(This,TableName,EntryPoint) \ + This->Write(This,TableName,EFI_BOOT_SCRIPT_DISPATCH_OPCODE,(EFI_PHYSICAL_ADDRESS)EntryPoint) + +//OEM + +#define BOOT_SCRIPT_IO_POLL_MACRO(This,TableName,Width,Address,Mask,Result) \ + This->Write(This,TableName,EFI_BOOT_SCRIPT_IO_POLL_OPCODE_OEM,Width,(UINT64)Address,Mask,Result) + +#define BOOT_SCRIPT_MEM_POLL_MACRO(This,TableName,Width,Address,Mask,Result) \ + This->Write(This,TableName,EFI_BOOT_SCRIPT_MEM_POLL_OPCODE_OEM,Width,(UINT64)Address,Mask,Result) + +#define BOOT_SCRIPT_PCI_POLL_MACRO(This,TableName,Width,Address,Mask,Result) \ + This->Write(This,TableName,EFI_BOOT_SCRIPT_PCI_POLL_OPCODE_OEM,Width,(UINT64)Address,Mask,Result) + +typedef struct _EFI_BOOT_SCRIPT_SAVE_PROTOCOL EFI_BOOT_SCRIPT_SAVE_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_BOOT_SCRIPT_WRITE) ( + IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This, + IN UINT16 TableName, + IN UINT16 OpCode, + ... +); + +typedef EFI_STATUS (EFIAPI *EFI_BOOT_SCRIPT_CLOSE_TABLE) ( + IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This, + IN UINT16 TableName, + OUT EFI_PHYSICAL_ADDRESS *Address +); + +struct _EFI_BOOT_SCRIPT_SAVE_PROTOCOL { + EFI_BOOT_SCRIPT_WRITE Write; + EFI_BOOT_SCRIPT_CLOSE_TABLE CloseTable; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2007, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// diff --git a/Include/Protocol/BusSpecificDriverOverride.h b/Include/Protocol/BusSpecificDriverOverride.h new file mode 100644 index 0000000..090202a --- /dev/null +++ b/Include/Protocol/BusSpecificDriverOverride.h @@ -0,0 +1,88 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/BusSpecificDriverOverride.h 3 3/13/06 1:40a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/BusSpecificDriverOverride.h $ +// +// 3 3/13/06 1:40a Felixp +// +// 2 3/04/05 10:32a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 2 3/13/04 5:13p Felixp +// +// 1 3/13/04 4:36p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: BusSpecificDriverOverride +// +// Description: EFI_BUS_SPECIFIC_DRIVER_OVERRIDE Protocol Definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL__H__ +#define __EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID \ + { 0x3bc1b285,0x8a15,0x4a82,0xaa,0xbf,0x4d,0x7d,0x13,0xfb,0x32,0x65 } + +GUID_VARIABLE_DECLARATION(gEfiBusSpecificDriverOverrideProtocolGuid,EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID); + +typedef struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER) ( + IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *This, + IN OUT EFI_HANDLE *DriverImageHandle +); + +struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL { + EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER GetDriver; +}; +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/CPU.h b/Include/Protocol/CPU.h new file mode 100644 index 0000000..8a32d81 --- /dev/null +++ b/Include/Protocol/CPU.h @@ -0,0 +1,174 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/CPU.h 2 3/13/06 1:45a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 3/13/06 1:45a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/CPU.h $ +// +// 2 3/13/06 1:45a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:42a Felixp +// +// 1 12/23/04 9:29a Felixp +// +// 1 1/05/04 4:07p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: Cpu.h +// +// Description: This header defines the CPU Architecture protocol. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __CPU_ARCH_PROTOCOL_H__ +#define __CPU_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_CPU_ARCH_PROTOCOL_GUID \ + {0x26baccb1,0x6f42,0x11d4,0xbc,0xe7,0x0,0x80,0xc7,0x3c,0x88,0x81} + +GUID_VARIABLE_DECLARATION(gEfiCpuArchProtocolGuid, EFI_CPU_ARCH_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <Protocol/DebugSupport.h> + +typedef struct _EFI_CPU_ARCH_PROTOCOL EFI_CPU_ARCH_PROTOCOL; + +typedef enum { + EfiCpuFlushTypeWriteBackInvalidate, + EfiCpuFlushTypeWriteBack, + EfiCpuFlushTypeInvalidate, + EfiCpuMaxFlushType +} EFI_CPU_FLUSH_TYPE; + +typedef EFI_STATUS (EFIAPI *EFI_CPU_FLUSH_DATA_CACHE) ( + IN EFI_CPU_ARCH_PROTOCOL *This, + IN EFI_PHYSICAL_ADDRESS Start, + IN UINT64 Length, + IN EFI_CPU_FLUSH_TYPE FlushType); + +typedef EFI_STATUS (EFIAPI *EFI_CPU_ENABLE_INTERRUPT) ( + IN EFI_CPU_ARCH_PROTOCOL *This); + +typedef EFI_STATUS (EFIAPI *EFI_CPU_DISABLE_INTERRUPT) ( + IN EFI_CPU_ARCH_PROTOCOL *This); + +typedef EFI_STATUS (EFIAPI *EFI_CPU_GET_INTERRUPT_STATE) ( + IN EFI_CPU_ARCH_PROTOCOL *This, + OUT BOOLEAN *State); + + typedef enum { + EfiCpuInit, + EfiCpuMaxInitType + } EFI_CPU_INIT_TYPE; + +typedef EFI_STATUS (EFIAPI *EFI_CPU_INIT) ( + IN EFI_CPU_ARCH_PROTOCOL *This, + IN EFI_CPU_INIT_TYPE InitType); + + + typedef VOID (*EFI_CPU_INTERRUPT_HANDLER) ( + IN EFI_EXCEPTION_TYPE InterruptType, + IN EFI_SYSTEM_CONTEXT SystemContext); + +typedef EFI_STATUS (EFIAPI *EFI_CPU_REGISTER_INTERRUPT_HANDLER) ( + IN EFI_CPU_ARCH_PROTOCOL *This, + IN EFI_EXCEPTION_TYPE InterruptType, + IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler); + +typedef EFI_STATUS (EFIAPI *EFI_CPU_GET_TIMER_VALUE) ( + IN EFI_CPU_ARCH_PROTOCOL *This, + IN UINT32 TimerIndex, + OUT UINT64 *TimerValue, + OUT UINT64 *TimerPeriod OPTIONAL); + +typedef EFI_STATUS (EFIAPI *EFI_CPU_SET_MEMORY_ATTRIBUTES) ( + IN EFI_CPU_ARCH_PROTOCOL *This, + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN UINT64 Attributes); + + +//********************************************************************** +//<AMI_SHDR_START> +// +// Name: EFI_CPU_ARCH_PROTOCOL +// +// Description: CPU Architecture Protocol for modifing the Interrupt state, +// Interrupt Handles, INIT CPU, Reading CPU timers, flush data +// cache if needed for DMA, and setting Cache Attributes. +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// FlushDataCache EFI_CPU_FLUSH_DATA_CACHE +// EnableInterrupt EFI_CPU_ENABLE_INTERRUPT +// DisableInterrupt EFI_CPU_DISABLE_INTERRUPT +// GetInterruptState EFI_CPU_GET_INTERRUPT_STATE +// Init EFI_CPU_INIT +// RegisterInterruptHandler EFI_CPU_REGISTER_INTERRUPT_HANDLER +// GetTimerValue EFI_CPU_GET_TIMER_VALUE +// SetMemoryAttributes EFI_CPU_SET_MEMORY_ATTRIBUTES +// NumberOfTimers UINT32 +// DmaBufferAlignment UINT32 +// +//<AMI_SHDR_END> +//********************************************************************** +typedef struct _EFI_CPU_ARCH_PROTOCOL { + EFI_CPU_FLUSH_DATA_CACHE FlushDataCache; + EFI_CPU_ENABLE_INTERRUPT EnableInterrupt; + EFI_CPU_DISABLE_INTERRUPT DisableInterrupt; + EFI_CPU_GET_INTERRUPT_STATE GetInterruptState; + EFI_CPU_INIT Init; + EFI_CPU_REGISTER_INTERRUPT_HANDLER RegisterInterruptHandler; + EFI_CPU_GET_TIMER_VALUE GetTimerValue; + EFI_CPU_SET_MEMORY_ATTRIBUTES SetMemoryAttributes; + UINT32 NumberOfTimers; + UINT32 DmaBufferAlignment; +} EFI_CPU_ARCH_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/Capsule.h b/Include/Protocol/Capsule.h new file mode 100644 index 0000000..80aab12 --- /dev/null +++ b/Include/Protocol/Capsule.h @@ -0,0 +1,66 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2006, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Capsule.h 1 10/07/06 10:17a Felixp $ +// +// $Revision: 1 $ +// +// $Date: 10/07/06 10:17a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Capsule.h $ +// +// 1 10/07/06 10:17a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: Capsule.h +// +// Description: Defines Capsule Architectural Protocol +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __CAPSULE_ARCH_PROTOCOL_H__ +#define __CAPSULE_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_CAPSULE_ARCH_PROTOCOL_GUID \ + { 0x5053697e, 0x2cbc, 0x4819, 0x90, 0xd9, 0x5, 0x80, 0xde, 0xee, 0x57, 0x54 } + +GUID_VARIABLE_DECLARATION(gEfiCapsuleArchProtocolGuid, EFI_CAPSULE_ARCH_PROTOCOL_GUID); + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (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/Include/Protocol/ComponentName.h b/Include/Protocol/ComponentName.h new file mode 100644 index 0000000..26d6d85 --- /dev/null +++ b/Include/Protocol/ComponentName.h @@ -0,0 +1,117 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/ComponentName.h 6 6/16/11 3:22p Felixp $ +// +// $Revision: 6 $ +// +// $Date: 6/16/11 3:22p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/ComponentName.h $ +// +// 6 6/16/11 3:22p Felixp +// Surround backward compatibility definitions with #if +// BACKWARD_COMPATIBLE_MODE +// +// 5 5/27/11 5:53p Felixp +// Headers are updated to improve separation of the Framework and PI +// interfaces. +// The definitions that will be removed in the future versions are marked +// with the comments. +// +// 4 8/21/09 3:05p Felixp +// Definition of the ComponentName2 protocol is added. +// +// 1 9/20/04 1:24p Olegi +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: ComponentName.h +// +// Description: Component Name protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __COMPONENT_NAME_PROTOCOL__H__ +#define __COMPONENT_NAME_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +//*********************** Component Name Protocol ******************/ +#define EFI_COMPONENT_NAME_PROTOCOL_GUID \ + {0x107a772c,0xd5e1,0x11d4,0x9a,0x46,0x0,0x90,0x27,0x3f,0xc1,0x4d} + +GUID_VARIABLE_DECLARATION(gEfiComponentNameProtocolGuid, EFI_COMPONENT_NAME_PROTOCOL_GUID); + +// Forward declaration +typedef struct _EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME) ( + IN EFI_COMPONENT_NAME_PROTOCOL *This, + IN CHAR8 *Language, + OUT CHAR16 **DriverName +); + +typedef EFI_STATUS (EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) ( + EFI_COMPONENT_NAME_PROTOCOL *This, + EFI_HANDLE ControllerHandle, + EFI_HANDLE ChildHandle OPTIONAL, + CHAR8 *Language, + CHAR16 **ControllerName +); + +struct _EFI_COMPONENT_NAME_PROTOCOL { + EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName; + EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName; + CHAR8 *SupportedLanguages; +}; + +#if BACKWARD_COMPATIBLE_MODE +#include <Protocol/ComponentName2.h> +#else +#ifndef EFI_COMPONENT_NAME2_PROTOCOL_GUID +#if EFI_SPECIFICATION_VERSION<=0x20000 +#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \ + {0x107a772c,0xd5e1,0x11d4,0x9a,0x46,0x0,0x90,0x27,0x3f,0xc1,0x4d} +#else //if EFI_SPECIFICATION_VERSION +#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \ + { 0x6a7a5cff, 0xe8d9, 0x4f70, 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 } +#endif //if EFI_SPECIFICATION_VERSION +#endif // EFI_COMPONENT_NAME2_PROTOCOL_GUID +#endif //if BACKWARD_COMPATIBLE_MODE + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/ComponentName2.h b/Include/Protocol/ComponentName2.h new file mode 100644 index 0000000..fa9be3f --- /dev/null +++ b/Include/Protocol/ComponentName2.h @@ -0,0 +1,94 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/ComponentName2.h 1 5/27/11 5:52p Felixp $ +// +// $Revision: 1 $ +// +// $Date: 5/27/11 5:52p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/ComponentName2.h $ +// +// 1 5/27/11 5:52p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: ComponentName2.h +// +// Description: Component Name 2 Protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __COMPONENT_NAME2_PROTOCOL__H__ +#define __COMPONENT_NAME2_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#ifndef EFI_COMPONENT_NAME2_PROTOCOL_GUID +#if EFI_SPECIFICATION_VERSION<=0x20000 +#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \ + {0x107a772c,0xd5e1,0x11d4,0x9a,0x46,0x0,0x90,0x27,0x3f,0xc1,0x4d} +#else //if EFI_SPECIFICATION_VERSION +#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \ + { 0x6a7a5cff, 0xe8d9, 0x4f70, 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 } +#endif //if EFI_SPECIFICATION_VERSION +#endif // EFI_COMPONENT_NAME2_PROTOCOL_GUID + +GUID_VARIABLE_DECLARATION(gEfiComponentName2ProtocolGuid, EFI_COMPONENT_NAME2_PROTOCOL_GUID); + +typedef struct _EFI_COMPONENT_NAME2_PROTOCOL EFI_COMPONENT_NAME2_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_COMPONENT_NAME2_GET_DRIVER_NAME) ( + IN EFI_COMPONENT_NAME2_PROTOCOL *This, + IN CHAR8 *Language, + OUT CHAR16 **DriverName +); + +typedef EFI_STATUS (EFIAPI *EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) ( + IN EFI_COMPONENT_NAME2_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_HANDLE ChildHandle OPTIONAL, + IN CHAR8 *Language, + OUT CHAR16 **ControllerName +); + +struct _EFI_COMPONENT_NAME2_PROTOCOL { + EFI_COMPONENT_NAME2_GET_DRIVER_NAME GetDriverName; + EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME GetControllerName; + CHAR8 *SupportedLanguages; +}; +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/ConsoleControl.h b/Include/Protocol/ConsoleControl.h new file mode 100644 index 0000000..b095b2c --- /dev/null +++ b/Include/Protocol/ConsoleControl.h @@ -0,0 +1,120 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/ConsoleControl.h 7 12/29/06 2:57p Felixp $ +// +// $Revision: 7 $ +// +// $Date: 12/29/06 2:57p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/ConsoleControl.h $ +// +// 7 12/29/06 2:57p Felixp +// +// 6 3/13/06 1:40a Felixp +// +// 5 8/23/05 11:43a Felixp +// +// 4 7/15/05 7:16p Felixp +// CONSOLE_DEVICES_STARTED_PROTOCOL_GUID added. +// BDS uses it to notify Splitter that Console Devices have been started. +// Once Splitter receives notification, it will install ConIn and ConOut +// in System Table +// +// 3 5/27/05 12:19a Felixp +// +// 2 5/27/05 12:00a Felixp +// +// 1 5/26/05 11:59p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: ConsoleControl.h +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __CONSOLE_CONTROL_PROTOCOL_H__ +#define __CONSOLE_CONTROL_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \ + { 0xf42f7782, 0x12e, 0x4c12, 0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21 } + +GUID_VARIABLE_DECLARATION(gEfiConsoleControlProtocolGuid,EFI_CONSOLE_CONTROL_PROTOCOL_GUID); + +// {EF9A3971-C1A0-4a93-BD40-5AA165F2DC3A} +#define CONSOLE_OUT_DEVICES_STARTED_PROTOCOL_GUID \ + { 0xef9a3971, 0xc1a0, 0x4a93, 0xbd, 0x40, 0x5a, 0xa1, 0x65, 0xf2, 0xdc, 0x3a } + +// {2DF1E051-906D-4eff-869D-24E65378FB9E} +#define CONSOLE_IN_DEVICES_STARTED_PROTOCOL_GUID \ + { 0x2df1e051, 0x906d, 0x4eff, 0x86, 0x9d, 0x24, 0xe6, 0x53, 0x78, 0xfb, 0x9e } + +typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL; + +typedef enum { + EfiConsoleControlScreenText, + EfiConsoleControlScreenGraphics, + EfiConsoleControlScreenMaxValue +} EFI_CONSOLE_CONTROL_SCREEN_MODE; + +typedef EFI_STATUS (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE)( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode, + OUT BOOLEAN *UgaExists OPTIONAL, + OUT BOOLEAN *StdInLocked OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE)( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + OUT EFI_CONSOLE_CONTROL_SCREEN_MODE Mode +); + +typedef EFI_STATUS (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN)( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, IN CHAR16 *Password +); + +struct _EFI_CONSOLE_CONTROL_PROTOCOL { + EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE GetMode; + EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE SetMode; + EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN LockStdIn; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/CpuIo.h b/Include/Protocol/CpuIo.h new file mode 100644 index 0000000..44372d2 --- /dev/null +++ b/Include/Protocol/CpuIo.h @@ -0,0 +1,87 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/CpuIo.h 3 4/15/11 2:37p Artems $ +// +// $Revision: 3 $ +// +// $Date: 4/15/11 2:37p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/CpuIo.h $ +// +// 3 4/15/11 2:37p Artems +// EIP 56523: Added support for PI specification v 1.2 +// +// 2 3/13/06 1:40a Felixp +// +// 1 6/01/05 4:58p Markw +// +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/CpuIo.h 3 4/15/11 2:37p Artems $Revision: $ +// +// $Date: 4/15/11 2:37p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: +// +//********************************************************************** + +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: CpuIo.h +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __EFI_CPU_IO_PROTOCOL_H__ +#define __EFI_CPU_IO_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> +#include <Protocol/CpuIo2.h> + +#define EFI_CPU_IO_PROTOCOL_GUID \ + { 0xB0732526, 0x38C8, 0x4b40, 0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 } + +GUID_VARIABLE_DECLARATION(gEfiCpuIoProtocolGuid, EFI_CPU_IO_PROTOCOL_GUID); + +typedef EFI_CPU_IO2_PROTOCOL EFI_CPU_IO_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/CpuIo2.h b/Include/Protocol/CpuIo2.h new file mode 100644 index 0000000..e328ea2 --- /dev/null +++ b/Include/Protocol/CpuIo2.h @@ -0,0 +1,124 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/CpuIo2.h 2 5/27/11 5:53p Felixp $ +// +// $Revision: 2 $ +// +// $Date: 5/27/11 5:53p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/CpuIo2.h $ +// +// 2 5/27/11 5:53p Felixp +// Headers are updated to improve separation of the Framework and PI +// interfaces. +// The definitions that will be removed in the future versions are marked +// with the comments. +// +// 1 4/15/11 2:38p Artems +// EIP 56523: Added protocol definition as per PI spec v 1.2 +// +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: CpuIo2.h +// +// Description: EFI_CPU_IO2_PROTOCOL definition file +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __EFI_CPU_IO2_PROTOCOL_H__ +#define __EFI_CPU_IO2_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + +#if PI_SPECIFICATION_VERSION < 0x10014 +#define EFI_CPU_IO2_PROTOCOL_GUID \ + { 0xB0732526, 0x38C8, 0x4b40, 0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 } +#else +#define EFI_CPU_IO2_PROTOCOL_GUID \ + { 0xad61f191, 0xae5f, 0x4c0e, 0xb9, 0xfa, 0xe8, 0x69, 0xd2, 0x88, 0xc6, 0x4f } +#endif + +GUID_VARIABLE_DECLARATION(gEfiCpuIo2ProtocolGuid, EFI_CPU_IO2_PROTOCOL_GUID); + + +//******************************************************* +// EFI_CPU_IO_PROTOCOL_WIDTH +//******************************************************* +typedef enum { + EfiCpuIoWidthUint8, + EfiCpuIoWidthUint16, + EfiCpuIoWidthUint32, + EfiCpuIoWidthUint64, + EfiCpuIoWidthFifoUint8, + EfiCpuIoWidthFifoUint16, + EfiCpuIoWidthFifoUint32, + EfiCpuIoWidthFifoUint64, + EfiCpuIoWidthFillUint8, + EfiCpuIoWidthFillUint16, + EfiCpuIoWidthFillUint32, + EfiCpuIoWidthFillUint64, + EfiCpuIoWidthMaximum +} EFI_CPU_IO_PROTOCOL_WIDTH; + +typedef struct _EFI_CPU_IO2_PROTOCOL EFI_CPU_IO2_PROTOCOL; + +typedef EFI_STATUS +(EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM) ( + IN EFI_CPU_IO2_PROTOCOL *This, + IN EFI_CPU_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer +); + +typedef struct { + EFI_CPU_IO_PROTOCOL_IO_MEM Read; + EFI_CPU_IO_PROTOCOL_IO_MEM Write; +} EFI_CPU_IO_PROTOCOL_ACCESS; + + +struct _EFI_CPU_IO2_PROTOCOL { + EFI_CPU_IO_PROTOCOL_ACCESS Mem; + EFI_CPU_IO_PROTOCOL_ACCESS Io; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/CpuProtocols.cif b/Include/Protocol/CpuProtocols.cif new file mode 100644 index 0000000..9ae76a7 --- /dev/null +++ b/Include/Protocol/CpuProtocols.cif @@ -0,0 +1,10 @@ +<component> + name = "CpuProtocols" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "CpuProtocols" +[files] +"AmiCpuInfo.h" +"AmiCpuInfo2.h" +"MpService\MpService.h" +<endComponent> diff --git a/Include/Protocol/CsmPlatform.h b/Include/Protocol/CsmPlatform.h new file mode 100644 index 0000000..9b487a5 --- /dev/null +++ b/Include/Protocol/CsmPlatform.h @@ -0,0 +1,161 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/CsmPlatform.h 13 1/27/14 12:59p Olegi $ +// +// $Revision: 13 $ +// +// $Date: 1/27/14 12:59p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/CsmPlatform.h $ +// +// 13 1/27/14 12:59p Olegi +// EIP151588: added Rom field to CSM_PLATFORM_POLICY_DATA +// +// 12 11/14/11 12:05p Olegi +// +// 11 11/10/11 7:31p Olegi +// Added thunk GUID protocol definition. +// +// 10 10/03/11 3:19p Olegi +// [TAG] EIP71591 +// [Category] Improvement +// [Description] CSM opt-out changes +// +// 9 8/19/11 4:30p Olegi +// [TAG] EIP65477 +// [Category] Improvement +// [Description] CSM Opt-out mechanism +// [Files] csmplatform.h, csm.dxs +// +// 8 3/01/10 3:57p Olegi +// Changed the prototypes of Pre/PostOptionRom functions; requires the +// update of AMI Board component. EIP34085. +// +// 7 1/12/10 11:51a Olegi +// Copyright message updated. +// +// 6 6/18/09 10:06a Olegi +// Added definition of CSM OpROM policy related data. +// +// 5 4/27/07 5:17p Olegi +// CSM.CHM file preparation. +// +// 4 4/13/07 9:51a Olegi +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: CsmPlatform.h +// +// Description: CsmPlatform protocol declaration +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef __CSM_PLATFORM_PROTOCOL_H__ +#define __CSM_PLATFORM_PROTOCOL_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + +// {91FA9DFD-DBD4-44ae-97A4-BD1837D5B462} +#define CSM_PLATFORM_PROTOCOL_GUID \ + {0x91fa9dfd,0xdbd4,0x44ae,0x97,0xa4,0xbd,0x18,0x37,0xd5,0xb4,0x62} + +GUID_VARIABLE_DECLARATION(gCsmPlatformProtocolGuid,CSM_PLATFORM_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <Protocol/PciIo.h> +#include <Protocol/LegacyBios.h> + +typedef struct _CSM_PLATFORM_PROTOCOL CSM_PLATFORM_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *CSM_PLATFORM_PROTOCOL_PRE_PROCESS_OPROM) ( + IN CSM_PLATFORM_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL *PciIo, + IN VOID **RomImage +); + +typedef EFI_STATUS (EFIAPI *CSM_PLATFORM_PROTOCOL_POST_PROCESS_OPROM) ( + IN CSM_PLATFORM_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL *PciIo, + IN VOID **RomImage +); + +typedef EFI_STATUS (EFIAPI *CSM_PLATFORM_PROTOCOL_GET_ATAPI_DEVICE_TYPE) ( + IN CSM_PLATFORM_PROTOCOL *This, + IN struct _ATAPI_IDENTIFY *IdentifyDriveData, + OUT UINT16 *DevType +); + +typedef struct _CSM_PLATFORM_PROTOCOL { + CSM_PLATFORM_PROTOCOL_PRE_PROCESS_OPROM PreProcessOpRom; + CSM_PLATFORM_PROTOCOL_POST_PROCESS_OPROM PostProcessOpRom; + CSM_PLATFORM_PROTOCOL_GET_ATAPI_DEVICE_TYPE GetAtapiDeviceType; +} CSM_PLATFORM_PROTOCOL; + +#define CSM_OPRROM_POLICY_GUID \ + {0xf2a128ff,0x257b,0x456e,0x9d,0xe8,0x63,0xe7,0xc7,0xdc,0xdf,0xac} + +typedef struct _CSM_PLATFORM_POLICY_DATA { + EFI_PCI_IO_PROTOCOL *PciIo; + BOOLEAN ExecuteThisRom; + VOID **Rom; +} CSM_PLATFORM_POLICY_DATA; + +// The following GUID is used in DXS; it can be installed by the driver that +// has minimum or no dependencies so that it is launched earlier than CSM. +// +#ifndef AMI_LOAD_CSM_GUID +#define AMI_LOAD_CSM_GUID \ + { 0x16287ba4, 0x5b9d, 0x4d98, 0x91, 0x9f, 0x7b, 0x7b, 0x78, 0xcb, 0x2b, 0xe0 } +#endif + +#ifndef AMI_CSM_DRIVER_STARTED_GUID +#define AMI_CSM_DRIVER_STARTED_GUID \ + { 0x3EA824D1, 0x81E3, 0x4FF5, 0xBD, 0x43, 0xBB, 0x9C, 0x65, 0xDF, 0x7C, 0x46} +#endif + +#ifndef AMI_CSM_THUNK_PROTOCOL_GUID +#define AMI_CSM_THUNK_PROTOCOL_GUID \ + { 0x2362ea9c, 0x84e5, 0x4dff, 0x83, 0xbc, 0xb5, 0xac, 0xec, 0xb5, 0x7c, 0xbb } +#endif + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/CsmVideoPolicy.h b/Include/Protocol/CsmVideoPolicy.h new file mode 100644 index 0000000..fe24c5d --- /dev/null +++ b/Include/Protocol/CsmVideoPolicy.h @@ -0,0 +1,84 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/CsmVideoPolicy.h 1 4/26/10 11:08a Felixp $ +// +// $Revision: 1 $ +// +// $Date: 4/26/10 11:08a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/CsmVideoPolicy.h $ +// +// 1 4/26/10 11:08a Felixp +// +// 6 1/13/10 2:13p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: CsmVideoPolicy.h +// +// Description: CSM Video Policy Protocol Declaration +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __CSM_VIDEO_POLICY_PROTOCOL__H__ +#define __CSM_VIDEO_POLICY_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <Efi.h> + +// {3A4E4376-4871-4b0e-A02F-ED36F2AECD00} +#define CSM_VIDEO_POLICY_PROTOCOL_GUID\ + { 0x3a4e4376, 0x4871, 0x4b0e, 0xa0, 0x2f, 0xed, 0x36, 0xf2, 0xae, 0xcd, 0x0 } + +GUID_VARIABLE_DECLARATION(gCsmVideoPolicyProtocolGuid, CSM_VIDEO_POLICY_PROTOCOL_GUID); + +typedef struct _CSM_VIDEO_POLICY_PROTOCOL CSM_VIDEO_POLICY_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *CSM_VIDEO_POLICY_GET_MODE)( + IN CSM_VIDEO_POLICY_PROTOCOL *This, IN BOOLEAN *IsTextMode +); + +typedef EFI_STATUS (EFIAPI *CSM_VIDEO_POLICY_SET_MODE)( + IN CSM_VIDEO_POLICY_PROTOCOL *This, + IN BOOLEAN TextMode, IN BOOLEAN ForceModeChange +); + +struct _CSM_VIDEO_POLICY_PROTOCOL{ + CSM_VIDEO_POLICY_GET_MODE GetMode; + CSM_VIDEO_POLICY_SET_MODE SetMode; +}; +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/CspLibProtocols.CIF b/Include/Protocol/CspLibProtocols.CIF new file mode 100644 index 0000000..1f09ca9 --- /dev/null +++ b/Include/Protocol/CspLibProtocols.CIF @@ -0,0 +1,8 @@ +<component> + name = "CSP Library Protocols" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "CSP Library Protocols" +[files] +"\CspLibProtocols.h" +<endComponent> diff --git a/Include/Protocol/CspLibProtocols.h b/Include/Protocol/CspLibProtocols.h new file mode 100644 index 0000000..0c486a8 --- /dev/null +++ b/Include/Protocol/CspLibProtocols.h @@ -0,0 +1,75 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2008, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/BIN/Chipset/Template/CSPLibrary/CspLibProtocols.h 3 2/22/11 4:33p Artems $ +// +// $Revision: 3 $ +// +// $Date: 2/22/11 4:33p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Template/CSPLibrary/CspLibProtocols.h $ +// +// 3 2/22/11 4:33p Artems +// EIP 51548 - Added AMI copyright headers, replaced TABs with spaces +// +// 2 6/11/09 5:58p Robert +// CHM and coding standard updates +// +// 1 1/21/05 12:46p Sivagarn +// Initial Checkin - Version 0.05 +// +// +//********************************************************************** +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: CspLibProtocols.h +// +// Description: +// This file contains Protocol definitions that are defined in the CSP Library +// +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef _CSP_LIBRARY_PROTOCOLS_ +#define _CSP_LIBRARY_PROTOCOLS_ + +#ifdef __cplusplus +extern "C" { +#endif + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2008, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/DataHub.h b/Include/Protocol/DataHub.h new file mode 100644 index 0000000..02a9436 --- /dev/null +++ b/Include/Protocol/DataHub.h @@ -0,0 +1,144 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/DataHub.h 2 3/13/06 1:40a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 3/13/06 1:40a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DataHub.h $ +// +// 2 3/13/06 1:40a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 3/12/04 5:30p Markw +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: DataHub_h +// +// Description: +// +//<AMI_FHDR_END> +//***************************************************************************** +#ifndef _DATA_HUB_PROTOCOL_H_ +#define _DATA_HUB_PROTOCOL_H_ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_DATA_HUB_PROTOCOL_GUID \ + {0xae80d021,0x618e,0x11d4,0xbc,0xd7,0x0,0x80,0xc7,0x3c,0x88,0x81} + +GUID_VARIABLE_DECLARATION(gEfiDataHubProtocolGuid,EFI_DATA_HUB_PROTOCOL_GUID); + +typedef struct _EFI_DATA_HUB_PROTOCOL EFI_DATA_HUB_PROTOCOL; + +typedef struct { + UINT16 Version; + UINT16 HeaderSize; + UINT32 RecordSize; + EFI_GUID DataRecordGuid; + EFI_GUID ProducerName; + UINT64 DataRecordClass; + EFI_TIME LogTime; + UINT64 LogMonotonicCount; +} EFI_DATA_RECORD_HEADER; + + +//************************************************************ +// Version value +//************************************************************ +#define EFI_DATA_RECORD_HEADER_VERSION 0x0100 + +//************************************************************ +// DataRecordClass values +//************************************************************ +// +// Definition of DataRecordClass. These are used to filter +// out data types at a very high level. The +// DataRecord. DataRecordGuid still defines the format +// of the data. +// +#define EFI_DATA_CLASS_DEBUG 0x0000000000000001 +#define EFI_DATA_CLASS_ERROR 0x0000000000000002 +#define EFI_DATA_CLASS_DATA 0x0000000000000004 +#define EFI_DATA_CLASS_PROGRESS_CODE 0x0000000000000008 + +typedef EFI_STATUS (EFIAPI *EFI_DATA_HUB_LOG_DATA) ( + IN EFI_DATA_HUB_PROTOCOL *This, + IN EFI_GUID *DataRecordGuid, + IN EFI_GUID *ProducerName, + IN UINT64 DataRecordClass, + IN VOID *RawData, + IN UINT32 RawDataSize +); + +typedef EFI_STATUS (EFIAPI *EFI_DATA_HUB_GET_NEXT_DATA_RECORD) ( + IN EFI_DATA_HUB_PROTOCOL *This, + IN OUT UINT64 *MonotonicCount, + IN EFI_EVENT *FilterDriver OPTIONAL, + OUT EFI_DATA_RECORD_HEADER **Record +); + +typedef EFI_STATUS (EFIAPI *EFI_DATA_HUB_REGISTER_DATA_FILTER_DRIVER) ( + IN EFI_DATA_HUB_PROTOCOL *This, + IN EFI_EVENT FilterEvent, + IN EFI_TPL FilterTpl, + IN UINT64 FilterClass, + IN EFI_GUID *FilterDataRecordGuid OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_DATA_HUB_UNREGISTER_DATA_FILTER_DRIVER) ( + IN EFI_DATA_HUB_PROTOCOL *This, + IN EFI_EVENT FilterEvent +); + +struct _EFI_DATA_HUB_PROTOCOL { + EFI_DATA_HUB_LOG_DATA LogData; + EFI_DATA_HUB_GET_NEXT_DATA_RECORD GetNextDataRecord; + EFI_DATA_HUB_REGISTER_DATA_FILTER_DRIVER RegisterFilterDriver; + EFI_DATA_HUB_UNREGISTER_DATA_FILTER_DRIVER UnregisterFilterDriver; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/DebugSupport.h b/Include/Protocol/DebugSupport.h new file mode 100644 index 0000000..39d2b23 --- /dev/null +++ b/Include/Protocol/DebugSupport.h @@ -0,0 +1,495 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2006, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/DebugSupport.h 4 5/13/11 6:35p Oleksiyy $ +// +// $Revision: 4 $ +// +// $Date: 5/13/11 6:35p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DebugSupport.h $ +// +// 4 5/13/11 6:35p Oleksiyy +// [TAG] EIP56645 +// [Category] Improvement +// [Description] Status Code PI 1.2 Specification Update +// [Files] DebugSupport.h, StatusCodeDataTypeId.h and StatusCodes.h +// +// 3 12/27/06 7:34a Felixp +// Updated to be complient with UEFI 2.0 Specification. +// +// 2 3/13/06 1:40a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 2 3/21/04 1:42p Felixp +// +// 1 1/02/04 3:00p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: DebugSupport.h +// +// Description: DebugSupport protocol is for providing functions to +// support source level debugging. Some of these difinitions +// are used by other protocols, such as the EFI_CPU_ARCH_PROTOCOL. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __EFI_DEBUG_SUPPORT_PROTOCOL__H__ +#define __EFI_DEBUG_SUPPORT_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \ + {0x2755590C,0x6F3C,0x42FA,0x9E,0xA4,0xA3,0xBA,0x54,0x3C,0xDA,0x25} + +GUID_VARIABLE_DECLARATION(gEfiDebugSupportProtocolGuid,EFI_DEBUG_SUPPORT_PROTOCOL_GUID); + +typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL; + +//At the time of publication of this specification, the latest revision of the PE/COFF specification +//was 6.2. The definition of IMAGE_FILE_MACHINE_EBC is not included in revision 6.2 of the +//PE/COFF specification. It will be added in a future revision of the PE/COFF specification + +#define IMAGE_FILE_MACHINE_I386 0x014C +#define IMAGE_FILE_MACHINE_IA64 0x0200 +#define IMAGE_FILE_MACHINE_EBC 0x0EBC +#define EFI_IMAGE_MACHINE_X64 0x8664 + + typedef enum { + IsaIa32 = IMAGE_FILE_MACHINE_I386, // 0x014C + IsaIpf = IMAGE_FILE_MACHINE_IA64, // 0x0200 + IsaEbc = IMAGE_FILE_MACHINE_EBC, // 0x0EBC + IsaX64 = EFI_IMAGE_MACHINE_X64 // 0x8664 + } EFI_INSTRUCTION_SET_ARCHITECTURE; + +typedef EFI_STATUS (EFIAPI *EFI_GET_MAXIMUM_PROCESSOR_INDEX) ( + IN EFI_DEBUG_SUPPORT_PROTOCOL *This, + OUT UINTN *MaxProcessorIndex); + + + + // System context for virtual EBC processors + typedef struct { + UINT64 R0, R1, R2, R3, R4, R5, R6, R7; + UINT64 Flags; + UINT64 ControlFlags; + UINT64 Ip; + } EFI_SYSTEM_CONTEXT_EBC; + + + // FXSAVE_STATE - FP / MMX / XMM registers + typedef struct { + UINT16 Fcw; + UINT16 Fsw; + UINT16 Ftw; + UINT16 Opcode; + UINT32 Eip; + UINT16 Cs; + UINT16 Reserved1; + UINT32 DataOffset; + UINT16 Ds; + UINT8 Reserved2[10]; +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) + UINT8 St0Mm0[10], Reserved3[6]; + UINT8 St1Mm1[10], Reserved4[6]; + UINT8 St2Mm2[10], Reserved5[6]; + UINT8 St3Mm3[10], Reserved6[6]; + UINT8 St4Mm4[10], Reserved7[6]; + UINT8 St5Mm5[10], Reserved8[6]; + UINT8 St6Mm6[10], Reserved9[6]; + UINT8 St7Mm7[10], Reserved10[6]; + UINT8 Xmm0[16]; + UINT8 Xmm1[16]; + UINT8 Xmm2[16]; + UINT8 Xmm3[16]; + UINT8 Xmm4[16]; + UINT8 Xmm5[16]; + UINT8 Xmm6[16]; + UINT8 Xmm7[16]; + UINT8 Reserved11[14 * 16]; + } EFI_FX_SAVE_STATE_IA32; +#else + UINT8 St0Mm0[10], Reserved3[6]; + UINT8 St0Mm1[10], Reserved4[6]; + UINT8 St0Mm2[10], Reserved5[6]; + UINT8 St0Mm3[10], Reserved6[6]; + UINT8 St0Mm4[10], Reserved7[6]; + UINT8 St0Mm5[10], Reserved8[6]; + UINT8 St0Mm6[10], Reserved9[6]; + UINT8 St0Mm7[10], Reserved10[6]; + UINT8 Reserved11[22 * 16]; + } EFI_FXSAVE_STATE; +#endif + + // System context for IA-32 processors + typedef struct { + UINT32 ExceptionData; // ExceptionData is + // additional data pushed + // on the stack by some + // types of IA-32 + // exceptions +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) + EFI_FX_SAVE_STATE_IA32 FxSaveState; +#else + EFI_FXSAVE_STATE FxSaveState; +#endif + UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7; + UINT32 Cr0, Cr1 /* Reserved */, Cr2, Cr3, Cr4; + UINT32 Eflags; + UINT32 Ldtr, Tr; + UINT32 Gdtr[2], Idtr[2]; + UINT32 Eip; + UINT32 Gs, Fs, Es, Ds, Cs, Ss; + UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; + } EFI_SYSTEM_CONTEXT_IA32; + + +// +// X64 processor exception types +// +#define EXCEPT_X64_DIVIDE_ERROR 0 +#define EXCEPT_X64_DEBUG 1 +#define EXCEPT_X64_NMI 2 +#define EXCEPT_X64_BREAKPOINT 3 +#define EXCEPT_X64_OVERFLOW 4 +#define EXCEPT_X64_BOUND 5 +#define EXCEPT_X64_INVALID_OPCODE 6 +#define EXCEPT_X64_DOUBLE_FAULT 8 +#define EXCEPT_X64_INVALID_TSS 10 +#define EXCEPT_X64_SEG_NOT_PRESENT 11 +#define EXCEPT_X64_STACK_FAULT 12 +#define EXCEPT_X64_GP_FAULT 13 +#define EXCEPT_X64_PAGE_FAULT 14 +#define EXCEPT_X64_FP_ERROR 16 +#define EXCEPT_X64_ALIGNMENT_CHECK 17 +#define EXCEPT_X64_MACHINE_CHECK 18 +#define EXCEPT_X64_SIMD 19 + +// +// X64 processor context definition +// +// FXSAVE_STATE +// FP / MMX / XMM registers (see fxrstor instruction definition) +// + typedef struct { + UINT16 Fcw; + UINT16 Fsw; + UINT16 Ftw; + UINT16 Opcode; + UINT64 Rip; + UINT64 DataOffset; + UINT8 Reserved1[8]; + UINT8 St0Mm0[10], Reserved2[6]; + UINT8 St1Mm1[10], Reserved3[6]; + UINT8 St2Mm2[10], Reserved4[6]; + UINT8 St3Mm3[10], Reserved5[6]; + UINT8 St4Mm4[10], Reserved6[6]; + UINT8 St5Mm5[10], Reserved7[6]; + UINT8 St6Mm6[10], Reserved8[6]; + UINT8 St7Mm7[10], Reserved9[6]; + UINT8 Xmm0[16]; + UINT8 Xmm1[16]; + UINT8 Xmm2[16]; + UINT8 Xmm3[16]; + UINT8 Xmm4[16]; + UINT8 Xmm5[16]; + UINT8 Xmm6[16]; + UINT8 Xmm7[16]; +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) + // + // NOTE: UEFI 2.0 spec definition as follows. It should be updated + // after spec update. + // + UINT8 Reserved11[14 * 16]; +#else + UINT8 Xmm8[16]; + UINT8 Xmm9[16]; + UINT8 Xmm10[16]; + UINT8 Xmm11[16]; + UINT8 Xmm12[16]; + UINT8 Xmm13[16]; + UINT8 Xmm14[16]; + UINT8 Xmm15[16]; + UINT8 Reserved10[6 * 16]; +#endif + } EFI_FX_SAVE_STATE_X64; + + typedef struct { + UINT64 ExceptionData; + EFI_FX_SAVE_STATE_X64 FxSaveState; + UINT64 Dr0; + UINT64 Dr1; + UINT64 Dr2; + UINT64 Dr3; + UINT64 Dr6; + UINT64 Dr7; + UINT64 Cr0; + UINT64 Cr1; /* Reserved */ + UINT64 Cr2; + UINT64 Cr3; + UINT64 Cr4; + UINT64 Cr8; + UINT64 Rflags; + UINT64 Ldtr; + UINT64 Tr; + UINT64 Gdtr[2]; + UINT64 Idtr[2]; + UINT64 Rip; + UINT64 Gs; + UINT64 Fs; + UINT64 Es; + UINT64 Ds; + UINT64 Cs; + UINT64 Ss; + UINT64 Rdi; + UINT64 Rsi; + UINT64 Rbp; + UINT64 Rsp; + UINT64 Rbx; + UINT64 Rdx; + UINT64 Rcx; + UINT64 Rax; + UINT64 R8; + UINT64 R9; + UINT64 R10; + UINT64 R11; + UINT64 R12; + UINT64 R13; + UINT64 R14; + UINT64 R15; + } EFI_SYSTEM_CONTEXT_X64; + + + // System context for Itanium processor family + typedef struct { + UINT64 Reserved; + UINT64 R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, + R11, R12, R13, R14, R15, R16, R17, R18, R19, R20, + R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, + R31; + UINT64 F2[2], F3[2], F4[2], F5[2], F6[2], + F7[2], F8[2], F9[2], F10[2], F11[2], + F12[2], F13[2], F14[2], F15[2], F16[2], + F17[2], F18[2], F19[2], F20[2], F21[2], + F22[2], F23[2], F24[2], F25[2], F26[2], + F27[2], F28[2], F29[2], F30[2], F31[2]; + UINT64 Pr; + UINT64 B0, B1, B2, B3, B4, B5, B6, B7; + // application registers + UINT64 ArRsc, ArBsp, ArBspstore, ArRnat; + UINT64 ArFcr; + UINT64 ArEflag, ArCsd, ArSsd, ArCflg; + UINT64 ArFsr, ArFir, ArFdr; + UINT64 ArCcv; + UINT64 ArUnat; + UINT64 ArFpsr; + UINT64 ArPfs, ArLc, ArEc; + // control registers + UINT64 CrDcr, CrItm, CrIva, CrPta, CrIpsr, CrIsr; + UINT64 CrIip, CrIfa, CrItir, CrIipa, CrIfs, CrIim; + UINT64 CrIha; + // debug registers + UINT64 Dbr0, Dbr1, Dbr2, Dbr3, Dbr4, Dbr5, Dbr6, Dbr7; + UINT64 Ibr0, Ibr1, Ibr2, Ibr3, Ibr4, Ibr5, Ibr6, Ibr7; + // virtual registers + UINT64 IntNat; // nat bits for R1-R31 + } EFI_SYSTEM_CONTEXT_IPF; + + // + // ARM processor context definition + // + typedef struct { + UINT32 R0; + UINT32 R1; + UINT32 R2; + UINT32 R3; + UINT32 R4; + UINT32 R5; + UINT32 R6; + UINT32 R7; + UINT32 R8; + UINT32 R9; + UINT32 R10; + UINT32 R11; + UINT32 R12; + UINT32 SP; + UINT32 LR; + UINT32 PC; + UINT32 CPSR; + UINT32 DFSR; + UINT32 DFAR; + UINT32 IFSR; + } EFI_SYSTEM_CONTEXT_ARM; + + + typedef union { + EFI_SYSTEM_CONTEXT_EBC *SystemContextEbc; + EFI_SYSTEM_CONTEXT_IA32 *SystemContextIa32; + EFI_SYSTEM_CONTEXT_X64 *SystemContextX64; + EFI_SYSTEM_CONTEXT_IPF *SystemContextIpf; + } EFI_SYSTEM_CONTEXT; + +typedef VOID (*EFI_PERIODIC_CALLBACK) ( + IN OUT EFI_SYSTEM_CONTEXT SystemContext); + +typedef EFI_STATUS (EFIAPI *EFI_REGISTER_PERIODIC_CALLBACK) ( + IN EFI_DEBUG_SUPPORT_PROTOCOL *This, + IN UINTN ProcessorIndex, + IN EFI_PERIODIC_CALLBACK PeriodicCallback); + + typedef INTN EFI_EXCEPTION_TYPE; + + // EBC Exception types + #define EXCEPT_EBC_UNDEFINED 0 + #define EXCEPT_EBC_DIVIDE_ERROR 1 + #define EXCEPT_EBC_DEBUG 2 + #define EXCEPT_EBC_BREAKPOINT 3 + #define EXCEPT_EBC_OVERFLOW 4 + #define EXCEPT_EBC_INVALID_OPCODE 5 + #define EXCEPT_EBC_STACK_FAULT 6 + #define EXCEPT_EBC_ALIGNMENT_CHECK 7 + #define EXCEPT_EBC_INSTRUCTION_ENCODING 8 + #define EXCEPT_EBC_BAD_BREAK 9 + #define EXCEPT_EBC_SINGLE_STEP 10 + + // IA-32 Exception types + #define EXCEPT_IA32_DIVIDE_ERROR 0 + #define EXCEPT_IA32_DEBUG 1 + #define EXCEPT_IA32_NMI 2 + #define EXCEPT_IA32_BREAKPOINT 3 + #define EXCEPT_IA32_OVERFLOW 4 + #define EXCEPT_IA32_BOUND 5 + #define EXCEPT_IA32_INVALID_OPCODE 6 + #define EXCEPT_IA32_DOUBLE_FAULT 8 + #define EXCEPT_IA32_INVALID_TSS 10 + #define EXCEPT_IA32_SEG_NOT_PRESENT 11 + #define EXCEPT_IA32_STACK_FAULT 12 + #define EXCEPT_IA32_GP_FAULT 13 + #define EXCEPT_IA32_PAGE_FAULT 14 + #define EXCEPT_IA32_FP_ERROR 16 + #define EXCEPT_IA32_ALIGNMENT_CHECK 17 + #define EXCEPT_IA32_MACHINE_CHECK 18 + #define EXCEPT_IA32_SIMD 19 + + // Itanium Processor Family Exception types + #define EXCEPT_IPF_VHTP_TRANSLATION 0 + #define EXCEPT_IPF_INSTRUCTION_TLB 1 + #define EXCEPT_IPF_DATA_TLB 2 + #define EXCEPT_IPF_ALT_INSTRUCTION_TLB 3 + #define EXCEPT_IPF_ALT_DATA_TLB 4 + #define EXCEPT_IPF_DATA_NESTED_TLB 5 + #define EXCEPT_IPF_INSTRUCTION_KEY_MISSED 6 + #define EXCEPT_IPF_DATA_KEY_MISSED 7 + #define EXCEPT_IPF_DIRTY_BIT 8 + #define EXCEPT_IPF_INSTRUCTION_ACCESS_BIT 9 + #define EXCEPT_IPF_DATA_ACCESS_BIT 10 + #define EXCEPT_IPF_BREAKPOINT 11 + #define EXCEPT_IPF_EXTERNAL_INTERRUPT 12 + // 13 - 19 reserved + #define EXCEPT_IPF_PAGE_NOT_PRESENT 20 + #define EXCEPT_IPF_KEY_PERMISSION 21 + #define EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS 22 + #define EXCEPT_IPF_DATA_ACCESS_RIGHTS 23 + #define EXCEPT_IPF_GENERAL_EXCEPTION 24 + #define EXCEPT_IPF_DISABLED_FP_REGISTER 25 + #define EXCEPT_IPF_NAT_CONSUMPTION 26 + #define EXCEPT_IPF_SPECULATION 27 + // 28 reserved + #define EXCEPT_IPF_DEBUG 29 + #define EXCEPT_IPF_UNALIGNED_REFERENCE 30 + #define EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE 31 + #define EXCEPT_IPF_FP_FAULT 32 + #define EXCEPT_IPF_FP_TRAP 33 + #define EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP 34 + #define EXCEPT_IPF_TAKEN_BRANCH 35 + #define EXCEPT_IPF_SINGLE_STEP 36 + // 37 - 44 reserved + #define EXCEPT_IPF_IA32_EXCEPTION 45 + #define EXCEPT_IPF_IA32_INTERCEPT 46 + #define EXCEPT_IPF_IA32_INTERRUPT 47 + + // + // ARM processor exception types + // + #define EXCEPT_ARM_RESET 0 + #define EXCEPT_ARM_UNDEFINED_INSTRUCTION 1 + #define EXCEPT_ARM_SOFTWARE_INTERRUPT 2 + #define EXCEPT_ARM_PREFETCH_ABORT 3 + #define EXCEPT_ARM_DATA_ABORT 4 + #define EXCEPT_ARM_RESERVED 5 + #define EXCEPT_ARM_IRQ 6 + #define EXCEPT_ARM_FIQ 7 + // + // For coding convenience, define the maximum valid ARM + // exception. + // + #define MAX_ARM_EXCEPTION EXCEPT_ARM_FIQ + + typedef VOID (*EFI_EXCEPTION_CALLBACK) ( + IN EFI_EXCEPTION_TYPE ExceptionType, + IN OUT EFI_SYSTEM_CONTEXT SystemContext); + +typedef EFI_STATUS (EFIAPI *EFI_REGISTER_EXCEPTION_CALLBACK) ( + IN EFI_DEBUG_SUPPORT_PROTOCOL *This, + IN UINTN ProcessorIndex, + IN EFI_EXCEPTION_CALLBACK ExceptionCallback, + IN EFI_EXCEPTION_TYPE ExceptionType); + +typedef EFI_STATUS (EFIAPI *EFI_INVALIDATE_INSTRUCTION_CACHE) ( + IN EFI_DEBUG_SUPPORT_PROTOCOL *This, + IN UINTN ProcessorIndex, + IN VOID *Start, + IN UINT64 Length); + + +typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL { + EFI_INSTRUCTION_SET_ARCHITECTURE Isa; + EFI_GET_MAXIMUM_PROCESSOR_INDEX GetMaximumProcessorIndex; + EFI_REGISTER_PERIODIC_CALLBACK RegisterPeriodicCallback; + EFI_REGISTER_EXCEPTION_CALLBACK RegisterExceptionCallback; + EFI_INVALIDATE_INSTRUCTION_CACHE InvalidateInstructionCache; +} EFI_DEBUG_SUPPORT_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2006, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/Decompress.h b/Include/Protocol/Decompress.h new file mode 100644 index 0000000..37a1109 --- /dev/null +++ b/Include/Protocol/Decompress.h @@ -0,0 +1,95 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/Decompress.h 3 3/13/06 1:40a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/Decompress.h $ +// +// 3 3/13/06 1:40a Felixp +// +// 2 3/04/05 10:33a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 3/30/04 2:24a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: Decompress.h +// +// Description: Decompress Protocol Definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __DECOMPRESS_PROTOCOL__H__ +#define __DECOMPRESS_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_DECOMPRESS_PROTOCOL_GUID \ +{0xd8117cfe,0x94a6,0x11d4,0x9a,0x3a,0x0,0x90,0x27,0x3f,0xc1,0x4d} + +GUID_VARIABLE_DECLARATION(gEfiDecompressProtocolGuid, EFI_DECOMPRESS_PROTOCOL_GUID); + +typedef struct _EFI_DECOMPRESS_PROTOCOL EFI_DECOMPRESS_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_DECOMPRESS_GET_INFO) ( + IN EFI_DECOMPRESS_PROTOCOL *This, + IN VOID *Source, IN UINT32 SourceSize, + OUT UINT32 *DestinationSize, OUT UINT32 *ScratchSize +); + +typedef EFI_STATUS (EFIAPI *EFI_DECOMPRESS_DECOMPRESS) ( + IN EFI_DECOMPRESS_PROTOCOL *This, + IN VOID* Source, IN UINT32 SourceSize, + IN OUT VOID* Destination, IN UINT32 DestinationSize, + IN OUT VOID* Scratch, IN UINT32 ScratchSize +); + +struct _EFI_DECOMPRESS_PROTOCOL { + EFI_DECOMPRESS_GET_INFO GetInfo; + EFI_DECOMPRESS_DECOMPRESS Decompress; +} ; +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/DeferredImageLoad.h b/Include/Protocol/DeferredImageLoad.h new file mode 100644 index 0000000..8df3abd --- /dev/null +++ b/Include/Protocol/DeferredImageLoad.h @@ -0,0 +1,85 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/DeferredImageLoad.h 1 5/13/11 4:40p Artems $ +// +// $Revision: 1 $ +// +// $Date: 5/13/11 4:40p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DeferredImageLoad.h $ +// +// 1 5/13/11 4:40p Artems +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: <DeferredImageLoad.h> +// +// Description: Deferred image load protocol header file +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef __DEFERRED_IMAGE_LOAD_H__ +#define __DEFERRED_IMAGE_LOAD_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_DEFERRED_IMAGE_LOAD_PROTOCOL_GUID \ + { 0x15853d7c, 0x3ddf, 0x43e0, 0xa1, 0xcb, 0xeb, 0xf8, 0x5b, 0x8f, 0x87, 0x2c } + + +GUID_VARIABLE_DECLARATION(gEfiDeferredImageLoadProtocolGuid, EFI_DEFERRED_IMAGE_LOAD_PROTOCOL_GUID); + +typedef struct _EFI_DEFERRED_IMAGE_LOAD_PROTOCOL EFI_DEFERRED_IMAGE_LOAD_PROTOCOL; + +typedef +EFI_STATUS +(EFIAPI *EFI_DEFERRED_IMAGE_INFO)( + IN EFI_DEFERRED_IMAGE_LOAD_PROTOCOL *This, + IN UINTN ImageIndex, + OUT EFI_DEVICE_PATH_PROTOCOL **ImageDevicePath, + OUT VOID **Image, + OUT UINTN *ImageSize, + OUT BOOLEAN *BootOption +); + +struct _EFI_DEFERRED_IMAGE_LOAD_PROTOCOL { + EFI_DEFERRED_IMAGE_INFO GetImageInfo; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/DeviceIo.h b/Include/Protocol/DeviceIo.h new file mode 100644 index 0000000..e1d42e8 --- /dev/null +++ b/Include/Protocol/DeviceIo.h @@ -0,0 +1,169 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/DeviceIo.h 4 3/13/06 1:40a Felixp $ +// +// $Revision: 4 $ +// +// $Date: 3/13/06 1:40a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DeviceIo.h $ +// +// 4 3/13/06 1:40a Felixp +// +// 3 8/15/05 9:03a Andriyn +// +// 2 3/04/05 10:33a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 8/26/04 3:56p Markw +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: DeviceIo_h +// +// Description: This file is an include file used to define the Protocol for the +// DeviceIo Protocol. +// +//<AMI_FHDR_END> +//***************************************************************************** + +#ifndef __DEVICE_IO_PROTOCOL_H__ +#define __DEVICE_IO_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// af6ac311-84c3-11d2-8e3c-00a0c969723b } +#define DEVICE_IO_PROTOCOL \ + {0xaf6ac311,0x84c3,0x11d2,0x8e,0x3c,0x00,0xa0,0xc9,0x69,0x72,0x3b} + +typedef struct _EFI_DEVICE_IO_INTERFACE EFI_DEVICE_IO_INTERFACE; + +//******************************************************* +// EFI_IO_WIDTH +//******************************************************* +typedef enum { + IO_UINT8 = 0, + IO_UINT16 = 1, + IO_UINT32 = 2, + IO_UINT64 = 3 +} EFI_IO_WIDTH; + +//******************************************************* +// EFI_IO_OPERATION_TYPE +//******************************************************* +typedef enum { + EfiBusMasterRead, + EfiBusMasterWrite, + EfiBusMasterCommonBuffer +} EFI_IO_OPERATION_TYPE; + + +//******************************************************* +// EFI_DEVICE_IO +//******************************************************* +typedef EFI_STATUS (EFIAPI *EFI_DEVICE_IO) ( + IN EFI_DEVICE_IO_INTERFACE *This, + IN EFI_IO_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer +); +//******************************************************* +// EFI_IO_ACCESS +//******************************************************* +typedef struct { + EFI_DEVICE_IO Read; + EFI_DEVICE_IO Write; +} EFI_IO_ACCESS; + +typedef EFI_STATUS (EFIAPI *EFI_PCI_DEVICE_PATH) ( + IN EFI_DEVICE_IO_INTERFACE *This, + IN UINT64 PciAddress, + IN OUT EFI_DEVICE_PATH_PROTOCOL **PciDevicePath +); + +typedef EFI_STATUS (EFIAPI *EFI_IO_MAP) ( + IN EFI_DEVICE_IO_INTERFACE *This, + IN EFI_IO_OPERATION_TYPE Operation, + IN EFI_PHYSICAL_ADDRESS *HostAddress, + IN OUT UINTN *NumberOfBytes, + OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, + OUT VOID **Mapping +); + +typedef EFI_STATUS (EFIAPI *EFI_IO_UNMAP) ( + IN EFI_DEVICE_IO_INTERFACE *This, + IN VOID *Mapping +); + +typedef EFI_STATUS (EFIAPI *EFI_IO_ALLOCATE_BUFFER) ( + IN EFI_DEVICE_IO_INTERFACE *This, + IN EFI_ALLOCATE_TYPE Type, + IN EFI_MEMORY_TYPE MemoryType, + IN UINTN Pages, + IN OUT EFI_PHYSICAL_ADDRESS *HostAddress +); + +typedef EFI_STATUS (EFIAPI *EFI_IO_FLUSH) ( + IN EFI_DEVICE_IO_INTERFACE *This +); + +typedef EFI_STATUS (EFIAPI *EFI_IO_FREE_BUFFER) ( + IN EFI_DEVICE_IO_INTERFACE *This, + IN UINTN Pages, + IN EFI_PHYSICAL_ADDRESS HostAddress +); + +struct _EFI_DEVICE_IO_INTERFACE { + EFI_IO_ACCESS Mem; + EFI_IO_ACCESS Io; + EFI_IO_ACCESS Pci; + EFI_IO_MAP Map; + EFI_PCI_DEVICE_PATH PciDevicePath; + EFI_IO_UNMAP Unmap; + EFI_IO_ALLOCATE_BUFFER AllocateBuffer; + EFI_IO_FLUSH Flush; + EFI_IO_FREE_BUFFER FreeBuffer; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/DevicePath.h b/Include/Protocol/DevicePath.h new file mode 100644 index 0000000..304d92c --- /dev/null +++ b/Include/Protocol/DevicePath.h @@ -0,0 +1,570 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/DevicePath.h 16 4/10/12 12:50p Artems $ +// +// $Revision: 16 $ +// +// $Date: 4/10/12 12:50p $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DevicePath.h $ +// +// 16 4/10/12 12:50p Artems +// EIP 87234: SCT devicepath test error - added support for SAS Ex device +// path +// +// 15 10/20/11 7:01p Artems +// Added new DevicePath types as described in UEFI spec v.2.3.1 +// +// 14 5/05/11 12:05p Artems +// Added support for new device types. Minor changes done to reduce +// difference with EDKII +// +// 13 4/21/11 12:53p Artems +// EIP 58707: Added changes introduced in UEFI specification v. 2.3.1 +// +// 11 11/15/10 4:34p Felixp +// MSG_SATA_DP constant is added. +// +// 10 28/02/08 7:38p Anandakrishnanl +// Added sata device path length definition +// +// 9 3/19/07 2:21p Felixp +// +// 8 1/17/07 9:54a Felixp +// New device path types added +// +// 4 1/12/07 5:24p Felixp +// +// 3 12/06/06 11:46a Vyacheslava +// +// 6 5/19/06 10:20p Felixp +// SET_NODE_LENGTH & NODE_LENGTH macros added +// +// 5 3/13/06 1:40a Felixp +// +// 4 4/20/05 4:54p Andriyn +// USB_DEVICE_PATH added +// +// 2 2/03/05 4:56p Felixp +// NEXT_NODE macros added +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 17 12/22/04 11:10a Markw +// Added the rest of the device paths. +// +// 16 12/21/04 5:53p Markw +// Added several device path structures. +// +// 15 12/21/04 5:00p Markw +// Modified device path defines for consistency and added defines for all +// types and subtypes. +// +// 14 12/21/04 4:21p Markw +// Renamed hardware device path definition for consistency and some more +// hardware paths. +// +// 13 12/13/04 3:36p Markw +// Device Path checked erasing previous changes. Fixed. Added Vendor +// Define Device Path Terminal GUIDs. +// +// 12 12/10/04 4:24p Felixp +// +// 11 12/08/04 8:57a Radhikav +// Added UART Devicpath. + +// 10 12/02/04 6:27p Markw +// Added Vendor Define Device Path and Terminal GUIDs. +// +// 9 11/16/04 6:15p Robert +// Updated errors in the Hard drive device path and the cdrom device path +// structures +// +// 8 10/11/04 5:54p Olegi +// +// 7 10/01/04 5:46p Robert +// Added support for Hard drives and CDROM device paths +// +// 6 9/27/04 12:09p Felixp +// +// 5 7/16/04 3:57p Felixp +// Changes to support both 7f and ff values for the device path end type +// +// 4 3/18/04 5:22p Markw +// Add memory mapped device path. +// +// 3 2/17/04 4:38p Felixp +// Media device path added +// +// 2 2/09/04 2:23p Markw +// header/typedef fixes +// +// 1 2/09/04 1:25p Markw +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: DevicePath.h +// +// Description: This file is an include file used to define the Protocol and +// definitions for the Device Path. +// +//<AMI_FHDR_END> +//***************************************************************************** + +#ifndef __DEVICE_PATH_PROTOCOL_H__ +#define __DEVICE_PATH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_DEVICE_PATH_PROTOCOL_GUID \ + { 0x09576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} + +GUID_VARIABLE_DECLARATION(gEfiDevicePathProtocolGuid, EFI_DEVICE_PATH_PROTOCOL_GUID); + +#define NODE_LENGTH(pPath) (*(UINT16*)&(pPath)->Length[0]) +#define SET_NODE_LENGTH(pPath,Length) (NODE_LENGTH(pPath)=(Length)) +#define NEXT_NODE(pPath) ((EFI_DEVICE_PATH_PROTOCOL*)((UINT8*)(pPath)+NODE_LENGTH(pPath))) + +#define END_DEVICE_PATH 0x7F +#define END_DEVICE_PATH1 0xFF + #define END_INSTANCE_SUBTYPE 0x01 + #define END_ENTIRE_SUBTYPE 0xFF + #define END_DEVICE_PATH_LENGTH 0x04 + +#define isEndNode(pDp) ((pDp)->Type==END_DEVICE_PATH||(pDp)->Type==END_DEVICE_PATH1) + +#define HARDWARE_DEVICE_PATH 0x01 + #define HW_PCI_DP 0x01 + #define HW_PCCARD_DP 0x02 + #define HW_MEMMAP_DP 0x03 + #define HW_VENDOR_DP 0x04 + #define HW_CONTROLLER_DP 0x05 + #define HW_PCI_DEVICE_PATH_LENGTH 0x06 + +#define ACPI_DEVICE_PATH 0x02 + #define ACPI_DP 0x01 + #define ACPI_DEVICE_PATH_LENGTH 0x0C + #define ACPI_EXTENDED_DP 0x02 + #define ACPI_ADR_DP 0x03 + +#define MESSAGING_DEVICE_PATH 0x03 + #define MSG_ATAPI_DP 0x01 + #define MSG_SCSI_DP 0x02 + #define MSG_FIBRECHANNEL_DP 0x03 + #define MSG_1394_DP 0x04 + #define MSG_USB_DP 0x05 + #define MSG_I2O_DP 0x06 + #define MSG_INFINIBAND_DP 0x09 + #define MSG_VENDOR_DP 0x0A + #define MSG_MAC_ADDR_DP 0x0B + #define MSG_IPv4_DP 0x0C + #define MSG_IPv6_DP 0x0D + #define MSG_UART_DP 0x0E + #define MSG_USB_CLASS_DP 0x0F + #define MSG_USB_WWID_CLASS_DP 0x10 + #define MSG_USB_LOGICAL_UNIT_CLASS_DP 0x11 + #define MSG_USB_SATA_DP 0x12 + #define MSG_SATA_DP 0x12 + #define MSG_ISCSI_DP 0x13 + #define MSG_VLAN_DP 0x14 + #define MSG_FIBRECHANNELEX_DP 0x15 + #define MSG_SASEX_DP 0x16 + + #define MSG_DEVICE_PATH_LENGTH 0x08 + #define ATAPI_DEVICE_PATH_LENGTH 0x08 + #define SATA_DEVICE_PATH_LENGTH 0x0A + #define UART_DEVICE_PATH_LENGTH 0x13 + +#define MEDIA_DEVICE_PATH 0x04 + #define MEDIA_HARDDRIVE_DP 0x01 + #define MEDIA_CDROM_DP 0x02 + #define MEDIA_VENDOR_DP 0x03 + #define MEDIA_FILEPATH_DP 0x04 + #define MEDIA_PROTOCOL_DP 0x05 + #define MEDIA_FV_FILEPATH_DP 0x06 + #define MEDIA_FV_DP 0x07 + #define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x08 + +//Does not follow our device path naming convensions but +//this is how it is defined in the CSM Spec +#define BBS_DEVICE_PATH 0x05 + #define BBS_BBS_DP 0x01 + +//EFI defined Vendor defined device path guids. +#define EFI_PC_ANSI_GUID \ + {0xe0c14753,0xf9be,0x11d2,0x9a,0x0c,0x00,0x90,0x27,0x3f,0xc1,0x4d} +#define EFI_VT_100_GUID \ + {0xdfa66065,0xb419,0x11d3,0x9a,0x2d,0x00,0x90,0x27,0x3f,0xc1,0x4d} +#define EFI_VT_100_PLUS_GUID \ + {0x7baec70b,0x57e0,0x4c76,0x8e,0x87,0x2f,0x9e,0x28,0x08,0x83,0x43} +#define EFI_VT_UTF8_GUID \ + {0xad15a0d6,0x8bec,0x4acf,0xa0,0x73,0xd0,0x1d,0xe7,0x7e,0x2d,0x88} +#define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL \ + {0x37499A9D,0x542F,0x4C89,0xA0,0x26,0x35,0xDA,0x14,0x20,0x94,0xE4} +#define EFI_SAS_PROTOCOL_GUID \ + {0xd487ddb4,0x008b,0x11d9,0xaf,0xdc,0x00,0x10,0x83,0xff,0xca,0x4d} +#define EFI_DEBUGPORT_PROTOCOL_GUID \ + {0xEBA4E8D2,0x3858,0x41EC,0xA2,0x81,0x26,0x47,0xBA,0x96,0x60,0xD0} + +GUID_VARIABLE_DECLARATION(gEfiPcAnsiGuid, EFI_PC_ANSI_GUID); +GUID_VARIABLE_DECLARATION(gEfiVT100Guid, EFI_VT_100_GUID); +GUID_VARIABLE_DECLARATION(gEfiVT100PlusGuid, EFI_VT_100_PLUS_GUID); +GUID_VARIABLE_DECLARATION(gEfiVTUTF8Guid, EFI_VT_UTF8_GUID); +GUID_VARIABLE_DECLARATION(gEfiUartDevicePathGuid, DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL); +GUID_VARIABLE_DECLARATION(gEfiSasDevicePathGuid, EFI_SAS_PROTOCOL_GUID); +GUID_VARIABLE_DECLARATION(gEfiDebugPortProtocolGuid, EFI_DEBUGPORT_PROTOCOL_GUID); + +#pragma pack (push) //May not be alligned on a boundary. +#pragma pack (1) + +//Hardware Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT8 Function; + UINT8 Device; +} PCI_DEVICE_PATH; + +//Hardware Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT8 Function; +} PCCARD_DEVICE_PATH; + +//Hardware Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + EFI_MEMORY_TYPE MemoryType; + EFI_PHYSICAL_ADDRESS StartingAddress; + EFI_PHYSICAL_ADDRESS EndingAddress; +} MEMMAP_DEVICE_PATH; + +//Hardware Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + EFI_GUID Guid; + //Variable Length Vendor Defined Data +} VENDOR_DEVICE_PATH; + +//Hardware Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 Controller; +} CONTROLLER_DEVICE_PATH; + +//ACPI Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 HID; + UINT32 UID; +} ACPI_HID_DEVICE_PATH; + +//ACPI Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 HID; + UINT32 UID; + UINT32 CID; + //Variable Length _HIDSTR string + //Variable Length _UIDSTR string + //Variable Length _CIDSTR string +} ACPI_EXTENDED_HID_DEVICE_PATH; + +#define PNP_EISA_ID_CONST 0x41d0 +#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16)) +#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId))) +#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId))) + +#define PNP_EISA_ID_MASK 0xffff +#define EISA_ID_TO_NUM(_Id) ((_Id) >> 16) + +//ACPI Address Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 ADR; +} ACPI_ADR_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT8 PrimarySecondary; + UINT8 SlaveMaster; + UINT16 Lun; +} ATAPI_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT16 Pun; + UINT16 Lun; +} SCSI_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 Reserved; + UINT64 WWN; + UINT64 Lun; +} FIBRECHANNEL_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 Reserved; + UINT8 WWN[8]; + UINT8 Lun[8]; +} FIBRECHANNELEX_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 Reserved; + UINT64 Guid; //Different than EFI_GUID. +} F1394_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT8 ParentPortNumber; + UINT8 InterfaceNumber; +} USB_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT16 VendorId; + UINT16 ProductId; + UINT8 DeviceClass; + UINT8 DeviceSubClass; + UINT8 DeviceProtocol; +} USB_CLASS_DEVICE_PATH; + +//USB WWID Device Path +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT16 InterfaceNumber; + UINT16 VendorId; + UINT16 ProductId; +} USB_WWID_DEVICE_PATH; + +// Device Logical Unit +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT8 Lun; +} LOGICAL_UNIT_DEVICE_PATH; + +//SATA Device Path +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT16 PortNumber; + UINT16 MultiplierPortNumber; + UINT16 LogicalUnitNumber; +} SATA_DEVICE_PATH; + +#define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000 + +//iSCSI Device Path Node +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT16 NetworkProtocol; + UINT16 LoginOption; + UINT64 Lun; + UINT16 TargetPortalGroupTag; + // CHAR8 iSCSI Target Name +} iSCSI_DEVICE_PATH; + +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT16 VlanId; +} VLAN_DEVICE_PATH; + +//Serial Attached SCSI (SAS) Device Path +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + EFI_GUID Guid; + UINT32 Reserved; + UINT64 SasAddress; + UINT64 Lun; + UINT16 DeviceTopology; + UINT16 RelativeTargetPort; +} SAS_DEVICE_PATH; + +//Serial Attached SCSI (SAS) Ex Device Path +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT8 SasAddress[8]; + UINT8 Lun[8]; + UINT16 DeviceTopology; + UINT16 RelativeTargetPort; +} SASEX_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 Tid; +} I20_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + EFI_MAC_ADDRESS MacAddr; + UINT8 IfType; +} MAC_ADDRESS_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + EFI_IPv4_ADDRESS LocalIpAddress; + EFI_IPv4_ADDRESS RemoteIpAddress; + UINT16 LocalPort; + UINT16 RemotePort; + UINT16 Protocol; + BOOLEAN StaticIpAddress; + EFI_IPv4_ADDRESS GatewayIpAddress; + EFI_IPv4_ADDRESS SubnetMask; +} IPv4_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + EFI_IPv6_ADDRESS LocalIp; + EFI_IPv6_ADDRESS RemoteIp; + UINT16 LocalPort; + UINT16 RemotePort; + UINT16 Protocol; + UINT8 IpAddressOrigin; + UINT8 PrefixLength; + EFI_IPv6_ADDRESS GatewayIpAddress; +} IPv6_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 ResourceFlags; + UINT64 PortGid[2]; + UINT64 ServiceId; + UINT64 TargetPortId; + UINT64 DeviceId; +} INFINIBAND_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 Reserved; + UINT64 BaudRate; + UINT8 DataBits; + UINT8 Parity; + UINT8 StopBits; +} UART_DEVICE_PATH; + +//Messaging Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + EFI_GUID Guid; + UINT32 FlowControlMap; +} UART_FLOW_CONTROL_DEVICE_PATH; + +//Media Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 PartitionNumber; + UINT64 PartitionStart; + UINT64 PartitionSize; + UINT8 Signature[16]; + UINT8 MBRType; + UINT8 SignatureType; +} HARDDRIVE_DEVICE_PATH; + +#define MBR_TYPE_MASTER_BOOT_RECORD 0x01 +#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02 + +#define SIGNATURE_TYPE_MBR 0x01 +#define SIGNATURE_TYPE_GUID 0x02 + +//Media Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 BootEntry; + UINT64 PartitionStart; + UINT64 PartitionSize; +} CDROM_DEVICE_PATH; + +//Media Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + CHAR16 PathName[1]; +} FILEPATH_DEVICE_PATH; + +//Media Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + EFI_GUID NameGuid; + //Variable Unicode Path String. +} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH; + +//Media Device Path Type +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + EFI_GUID ProtocolGuid; +} PROTOCOL_DEVICE_PATH; + +// Media relative offset range device path. +typedef struct _{ + EFI_DEVICE_PATH_PROTOCOL Header; + UINT32 Reserved; + UINT64 StartingOffset; + UINT64 EndingOffset; +} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH; + +//BIOS Boot Specification Device Path +//Does not follow our device path naming convensions but +//this is how it is defined in the CSM Spec +typedef struct _BBS_BBS_DEVICE_PATH { + EFI_DEVICE_PATH_PROTOCOL Header; + UINT16 DeviceType; + UINT16 StatusFlag; + CHAR8 String[1]; +} BBS_BBS_DEVICE_PATH; +#pragma pack (pop) + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/DevicePathFromText.h b/Include/Protocol/DevicePathFromText.h new file mode 100644 index 0000000..42c183b --- /dev/null +++ b/Include/Protocol/DevicePathFromText.h @@ -0,0 +1,91 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Include/Protocol/DevicePathFromText.h 1 5/05/11 12:05p Artems $ +// +// $Revision: 1 $ +// +// $Date: 5/05/11 12:05p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DevicePathFromText.h $ +// +// 1 5/05/11 12:05p Artems +// +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: DevicePathFromText.h +// +// Description: +// EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL definition file +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __DEVICE_PATH_FROM_TEXT_PROTOCOL__H__ +#define __DEVICE_PATH_FROM_TEXT_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> +#include <Protocol/DevicePath.h> + + +#define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \ + { 0x5c99a21, 0xc70f, 0x4ad2, 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e } + +GUID_VARIABLE_DECLARATION(gEfiDevicePathFromTextProtocolGuid, EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID); + + +typedef struct _EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL; + +typedef +EFI_DEVICE_PATH_PROTOCOL* +(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE) ( + IN CONST CHAR16* TextDeviceNode +); + +typedef +EFI_DEVICE_PATH_PROTOCOL* +(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH) ( + IN CONST CHAR16* TextDevicePath +); + +struct _EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL { + EFI_DEVICE_PATH_FROM_TEXT_NODE ConvertTextToDeviceNode; + EFI_DEVICE_PATH_FROM_TEXT_PATH ConvertTextToDevicePath; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/DevicePathToText.h b/Include/Protocol/DevicePathToText.h new file mode 100644 index 0000000..4ce3726 --- /dev/null +++ b/Include/Protocol/DevicePathToText.h @@ -0,0 +1,98 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Include/Protocol/DevicePathToText.h 2 6/13/11 6:18p Artems $ +// +// $Revision: 2 $ +// +// $Date: 6/13/11 6:18p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DevicePathToText.h $ +// +// 2 6/13/11 6:18p Artems +// Fixed bug in file header +// +// 1 5/05/11 12:05p Artems +// +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: DevicePathToText.h +// +// Description: +// EFI_DEVICE_PATH_TO_TEXT_PROTOCOL definition file +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __DEVICE_PATH_TO_TEXT_PROTOCOL__H__ +#define __DEVICE_PATH_TO_TEXT_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> +#include <Protocol/DevicePath.h> + +#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \ + { 0x8b843e20, 0x8132, 0x4852, 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } + +GUID_VARIABLE_DECLARATION(gEfiDevicePathToTextProtocolGuid, EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID); + + +typedef struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL EFI_DEVICE_PATH_TO_TEXT_PROTOCOL; + +typedef +CHAR16* +(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) ( + IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode, + IN BOOLEAN DisplayOnly, + IN BOOLEAN AllowShortcuts +); + +typedef +CHAR16* +(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) ( + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, + IN BOOLEAN DisplayOnly, + IN BOOLEAN AllowShortcuts +); + +struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL { + EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText; + EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/DevicePathUtilities.h b/Include/Protocol/DevicePathUtilities.h new file mode 100644 index 0000000..74c0706 --- /dev/null +++ b/Include/Protocol/DevicePathUtilities.h @@ -0,0 +1,113 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2006, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/DevicePathUtilities.h 1 10/12/06 6:43p Felixp $ +// +// $Revision: 1 $ +// +// $Date: 10/12/06 6:43p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DevicePathUtilities.h $ +// +// 1 10/12/06 6:43p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: DevicePathUtilities.h +// +// Description: EFI_DEVICE_PATH_UTILITIES_PROTOCOL protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __EFI_DEVICE_PATH_UTILITIES_PROTOCOL__H__ +#define __EFI_DEVICE_PATH_UTILITIES_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \ + {0x379be4e,0xd706,0x437d,0xb0,0x37,0xed,0xb8,0x2f,0xb7,0x72,0xa4} + +GUID_VARIABLE_DECLARATION(gEfiDevicePathUtilitiesProtocolGuid, EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID); + +typedef UINTN (EFIAPI *EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE)( + IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePath +); + +typedef EFI_DEVICE_PATH_PROTOCOL* (EFIAPI *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH)( + IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePath +); + +typedef EFI_DEVICE_PATH_PROTOCOL* (EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_PATH)( + IN CONST EFI_DEVICE_PATH_PROTOCOL* Src1, + IN CONST EFI_DEVICE_PATH_PROTOCOL* Src2 +); + +typedef EFI_DEVICE_PATH_PROTOCOL* (EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_NODE)( + IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePath, + IN CONST EFI_DEVICE_PATH_PROTOCOL* DeviceNode +); + +typedef EFI_DEVICE_PATH_PROTOCOL* (EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE)( + IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePath, + IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePathInstance +); + +typedef EFI_DEVICE_PATH_PROTOCOL* (EFIAPI *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE)( + IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance, + OUT UINTN *DevicePathInstanceSize +); + +typedef EFI_DEVICE_PATH_PROTOCOL* (EFIAPI *EFI_DEVICE_PATH_UTILS_CREATE_NODE)( + IN UINT8 NodeType, IN UINT8 NodeSubType, + IN UINT16 NodeLength +); + +typedef BOOLEAN (EFIAPI *EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE)( + IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePath +); + +typedef struct _EFI_DEVICE_PATH_UTILITIES_PROTOCOL{ + EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize; + EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH DuplicateDevicePath; + EFI_DEVICE_PATH_UTILS_APPEND_PATH AppendDevicePath; + EFI_DEVICE_PATH_UTILS_APPEND_NODE AppendDeviceNode; + EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE AppendDevicePathInstance; + EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE GetNextDevicePathInstance; + EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE IsDevicePathMultiInstance; + EFI_DEVICE_PATH_UTILS_CREATE_NODE CreateDeviceNode; +} EFI_DEVICE_PATH_UTILITIES_PROTOCOL; +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (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/Include/Protocol/DiskIo.h b/Include/Protocol/DiskIo.h new file mode 100644 index 0000000..c06b811 --- /dev/null +++ b/Include/Protocol/DiskIo.h @@ -0,0 +1,160 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/DiskIo.h 4 4/20/07 3:47p Robert $ +// +// $Revision: 4 $ +// +// $Date: 4/20/07 3:47p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DiskIo.h $ +// +// 4 4/20/07 3:47p Robert +// Updated File header for Coding standard compliance +// +// 3 3/13/06 1:40a Felixp +// +// 2 3/04/05 10:34a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 8/19/04 6:26p Robert +// +// 1 1/26/04 3:25p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: DiskIo.h +// +// Description: Contains Function Prototypes and Data Structures for +// the DiskIo Protocol +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __DISK_IO_PROTOCOL_H__ +#define __DISK_IO_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_DISK_IO_PROTOCOL_GUID \ + { 0xCE345171, 0xBA0B, 0x11d2, 0x8e, 0x4F, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + +GUID_VARIABLE_DECLARATION(gEfiDiskIoProtocolGuid, EFI_DISK_IO_PROTOCOL_GUID); + +#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000 + + +typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL; + + +//============================================================================= +// Function Prototypes + +//============================================================================= +// Function: ReadDisk +// +// Description: rreads the number of bytes specified by BufferSize from the device +// +// Inputs: +// This - Indicates a pointer to the calling context. +// MediaId - ID of the medium to be read. +// Offset - The starting byte offset on the logical block I/O device to read from. +// BufferSize - The size in bytes of Buffer. The number of bytes to read from +// the device. +// +// Outputs: Returns EFI_STATUS +// Buffer - A pointer to the destination buffer for the data. The caller is responsible +// for either having implicit or explicit ownership of the buffer. +// +// Notes: +// +//============================================================================= +typedef EFI_STATUS (*EFI_DISK_READ) ( + IN EFI_DISK_IO_PROTOCOL *This, + IN UINT32 MediaId, + IN UINT64 Offset, + IN UINTN BufferSize, + OUT VOID *Buffer + ); + + + +//============================================================================= +// Function: WriteDisk +// +// Description: writes the number of bytes specified by BufferSize to the device +// +// Inputs: +// This - Indicates a pointer to the calling context. +// MediaId - ID of the medium to be read. +// Offset - The starting byte offset on the logical block I/O device to read from. +// BufferSize - The size in bytes of Buffer. The number of bytes to read from +// the device. +// Buffer - A pointer to the destination buffer for the data. The caller is responsible +// for either having implicit or explicit ownership of the buffer. +// +// Outputs: Returns EFI_STATUS +// +// Notes: +// +//============================================================================= +typedef EFI_STATUS (*EFI_DISK_WRITE) ( + IN EFI_DISK_IO_PROTOCOL *This, + IN UINT32 MediaId, + IN UINT64 Offset, + IN UINTN BufferSize, + IN VOID *Buffer + ); + + + +//============================================================================= +// Protocol Definition +typedef struct _EFI_DISK_IO_PROTOCOL { + UINT64 Revision; + EFI_DISK_READ ReadDisk; + EFI_DISK_WRITE WriteDisk; + } EFI_DISK_IO_PROTOCOL; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/DriverBinding.h b/Include/Protocol/DriverBinding.h new file mode 100644 index 0000000..5a5ff80 --- /dev/null +++ b/Include/Protocol/DriverBinding.h @@ -0,0 +1,111 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/DriverBinding.h 3 3/13/06 1:40a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DriverBinding.h $ +// +// 3 3/13/06 1:40a Felixp +// +// 2 3/04/05 10:34a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 3 12/02/04 10:32a Markw +// Added DevicePath include. +// +// 2 3/13/04 5:13p Felixp +// +// 1 3/13/04 4:36p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: DriverBinging.h +// +// Description: EFI_DRIVER_BINDING Protocol Definition. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __DRIVER_BINDING_PROTOCOL_H__ +#define __DRIVER_BINDING_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_DRIVER_BINDING_PROTOCOL_GUID \ + {0x18A031AB,0xB443,0x4D1A,0xA5,0xC0,0x0C,0x09,0x26,0x1E,0x9F,0x71} + +GUID_VARIABLE_DECLARATION(gEfiDriverBindingProtocolGuid, EFI_DRIVER_BINDING_PROTOCOL_GUID); + +typedef struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_DRIVER_BINDING_PROTOCOL_SUPPORTED) ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_DRIVER_BINDING_PROTOCOL_START) ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_DRIVER_BINDING_PROTOCOL_STOP) ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer OPTIONAL +); + +struct _EFI_DRIVER_BINDING_PROTOCOL { + EFI_DRIVER_BINDING_PROTOCOL_SUPPORTED Supported; + EFI_DRIVER_BINDING_PROTOCOL_START Start; + EFI_DRIVER_BINDING_PROTOCOL_STOP Stop; + UINT32 Version; + EFI_HANDLE ImageHandle; + EFI_HANDLE DriverBindingHandle; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/DriverDiagnostics2.h b/Include/Protocol/DriverDiagnostics2.h new file mode 100644 index 0000000..a059e7f --- /dev/null +++ b/Include/Protocol/DriverDiagnostics2.h @@ -0,0 +1,99 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Include/Protocol/DriverDiagnostics2.h 1 4/21/11 12:53p Artems $ +// +// $Revision: 1 $ +// +// $Date: 4/21/11 12:53p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DriverDiagnostics2.h $ +// +// 1 4/21/11 12:53p Artems +// +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: DriverDiagnostics2.h +// +// Description: +// EFI_DRIVER_DIAGNOSTICS2_PROTOCOL definition file +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __DRIVER_DIAGNOSTICS2_PROTOCOL__H__ +#define __DRIVER_DIAGNOSTICS2_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + +#define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \ + { 0x4d330321, 0x025f, 0x4aac, 0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63 } + +GUID_VARIABLE_DECLARATION(gEfiDriverDiagnostics2ProtocolGuid, EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID); + + +typedef struct _EFI_DRIVER_DIAGNOSTICS2_PROTOCOL EFI_DRIVER_DIAGNOSTICS2_PROTOCOL; + +typedef enum { + EfiDriverDiagnosticTypeStandard = 0, + EfiDriverDiagnosticTypeExtended = 1, + EfiDriverDiagnosticTypeManufacturing = 2, + EfiDriverDiagnosticTypeMaximum +} EFI_DRIVER_DIAGNOSTIC_TYPE; + +typedef +EFI_STATUS +(EFIAPI *EFI_DRIVER_DIAGNOSTICS2_RUN_DIAGNOSTICS) ( + IN EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_HANDLE ChildHandle OPTIONAL, + IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType, + IN CHAR8 *Language, + OUT EFI_GUID **ErrorType, + OUT UINTN *BufferSize, + OUT CHAR16 **Buffer +); + + +struct _EFI_DRIVER_DIAGNOSTICS2_PROTOCOL { + EFI_DRIVER_DIAGNOSTICS2_RUN_DIAGNOSTICS RunDiagnostics; + CHAR8 *SupportedLanguages; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/DriverFamilyOverride.h b/Include/Protocol/DriverFamilyOverride.h new file mode 100644 index 0000000..1a38165 --- /dev/null +++ b/Include/Protocol/DriverFamilyOverride.h @@ -0,0 +1,82 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Include/Protocol/DriverFamilyOverride.h 1 4/22/11 6:45p Artems $ +// +// $Revision: 1 $ +// +// $Date: 4/22/11 6:45p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DriverFamilyOverride.h $ +// +// 1 4/22/11 6:45p Artems +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: DriverFamilyOverride.h +// +// Description: +// EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL definition file +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __DRIVER_FAMILY_OVERRIDE_PROTOCOL__H__ +#define __DRIVER_FAMILY_OVERRIDE_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + +#define EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID \ + {0xb1ee129e, 0xda36, 0x4181, 0x91, 0xf8, 0x4, 0xa4, 0x92, 0x37, 0x66, 0xa7 } + +GUID_VARIABLE_DECLARATION(gEfiDriverFamilyOverrideProtocolGuid, EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID); + + +typedef struct _EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL; + +typedef +UINT32 +(EFIAPI *EFI_DRIVER_FAMILY_OVERRIDE_GET_VERSION) ( + IN EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL *This +); + +struct _EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL { + EFI_DRIVER_FAMILY_OVERRIDE_GET_VERSION GetVersion; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/DriverHealth.h b/Include/Protocol/DriverHealth.h new file mode 100644 index 0000000..a4fd13b --- /dev/null +++ b/Include/Protocol/DriverHealth.h @@ -0,0 +1,120 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Include/Protocol/DriverHealth.h 1 4/21/11 12:53p Artems $ +// +// $Revision: 1 $ +// +// $Date: 4/21/11 12:53p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/DriverHealth.h $ +// +// 1 4/21/11 12:53p Artems +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: DriverHealth.h +// +// Description: +// EFI_DRIVER_HEALTH_PROTOCOL definition file +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __DRIVER_HEALTH_PROTOCOL__H__ +#define __DRIVER_HEALTH_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> +#include <UefiHii.h> + +#define EFI_DRIVER_HEALTH_PROTOCOL_GUID \ + { 0x2a534210, 0x9280, 0x41d8, 0xae, 0x79, 0xca, 0xda, 0x1, 0xa2, 0xb1, 0x27 } + +GUID_VARIABLE_DECLARATION(gEfiDriverHealthProtocolGuid, EFI_DRIVER_HEALTH_PROTOCOL_GUID); + + +typedef struct _EFI_DRIVER_HEALTH_PROTOCOL EFI_DRIVER_HEALTH_PROTOCOL; + +typedef enum { + EfiDriverHealthStatusHealthy, + EfiDriverHealthStatusRepairRequired, + EfiDriverHealthStatusConfigurationRequired, + EfiDriverHealthStatusFailed, + EfiDriverHealthStatusReconnectRequired, + EfiDriverHealthStatusRebootRequired +} EFI_DRIVER_HEALTH_STATUS; + +typedef struct { + EFI_HII_HANDLE HiiHandle; + EFI_STRING_ID StringId; + UINT64 Reserved; +} EFI_DRIVER_HEALTH_HII_MESSAGE; + +typedef +EFI_STATUS +(EFIAPI *EFI_DRIVER_HEALTH_REPAIR_NOTIFY) ( + IN UINTN Value, + IN UINTN Limit +); + +typedef +EFI_STATUS +(EFIAPI *EFI_DRIVER_HEALTH_GET_HEALTH_STATUS) ( + IN EFI_DRIVER_HEALTH_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, OPTIONAL + IN EFI_HANDLE ChildHandle, OPTIONAL + OUT EFI_DRIVER_HEALTH_STATUS *HealthStatus, + OUT EFI_DRIVER_HEALTH_HII_MESSAGE **MessageList, OPTIONAL + OUT EFI_HII_HANDLE *FormHiiHandle OPTIONAL +); + +typedef +EFI_STATUS +(EFIAPI *EFI_DRIVER_HEALTH_REPAIR) ( + IN EFI_DRIVER_HEALTH_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_HANDLE ChildHandle, OPTIONAL + IN EFI_DRIVER_HEALTH_REPAIR_NOTIFY RepairNotify OPTIONAL +); + +struct _EFI_DRIVER_HEALTH_PROTOCOL { + EFI_DRIVER_HEALTH_GET_HEALTH_STATUS GetHealthStatus; + EFI_DRIVER_HEALTH_REPAIR Repair; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/DxeSmmReadyToLock.h b/Include/Protocol/DxeSmmReadyToLock.h new file mode 100644 index 0000000..a32ba0a --- /dev/null +++ b/Include/Protocol/DxeSmmReadyToLock.h @@ -0,0 +1,72 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* + +//************************************************************************* +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/DxeSmmReadyToLock.h 1 6/22/11 11:54a Markw $ +// +// $Revision: 1 $ +// +// $Date: 6/22/11 11:54a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/DxeSmmReadyToLock.h $ +// +// 1 6/22/11 11:54a Markw +// +// 6 1/13/10 2:13p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: DxeSmmReadyToLock.h +// +// Description: DxeSmmReadyToLock protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef __DXE_SMM_READY_TO_LOCK__H__ +#define __DXE_SMM_READY_TO_LOCK__H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL_GUID \ + {0x60ff8964, 0xe906, 0x41d0, 0xaf, 0xed, 0xf2, 0x41, 0xe9, 0x74, 0xe0, 0x8e } + +GUID_VARIABLE_DECLARATION(gEfiDxeSmmReadyToLockProtocolGuid,EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL_GUID); + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/EBC.h b/Include/Protocol/EBC.h new file mode 100644 index 0000000..59f57d8 --- /dev/null +++ b/Include/Protocol/EBC.h @@ -0,0 +1,106 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/EBC.h 3 3/13/06 1:40a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/EBC.h $ +// +// 3 3/13/06 1:40a Felixp +// +// 2 3/04/05 10:34a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 8/22/04 11:23p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: EBC.h +// +// Description: EBC Protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __EBC_PROTOCOL__H__ +#define __EBC_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_EBC_PROTOCOL_GUID \ + {0x13AC6DD1,0x73D0,0x11D4,0xB0,0x6B,0x00,0xAA,0x00,0xBD,0x6D,0xE7} + +GUID_VARIABLE_DECLARATION(gEfiEbcProtocolGuid, EFI_EBC_PROTOCOL_GUID ); + +typedef struct _EFI_EBC_PROTOCOL EFI_EBC_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_EBC_CREATE_THUNK) ( + IN EFI_EBC_PROTOCOL *This, IN EFI_HANDLE ImageHandle, + IN VOID *EbcEntryPoint, OUT VOID **Thunk +); + +typedef EFI_STATUS (EFIAPI *EFI_EBC_UNLOAD_IMAGE) ( + IN EFI_EBC_PROTOCOL *This, IN EFI_HANDLE ImageHandle +); + +typedef EFI_STATUS (* EBC_ICACHE_FLUSH) ( + IN EFI_PHYSICAL_ADDRESS Start, IN UINT64 Length +); + +typedef EFI_STATUS (* EFI_EBC_REGISTER_ICACHE_FLUSH) ( + IN EFI_EBC_PROTOCOL *This, IN EBC_ICACHE_FLUSH Flush +); + +typedef EFI_STATUS (* EFI_EBC_GET_VERSION) ( + IN EFI_EBC_PROTOCOL *This, OUT UINT64 *Version +); + +struct _EFI_EBC_PROTOCOL { + EFI_EBC_CREATE_THUNK CreateThunk; + EFI_EBC_UNLOAD_IMAGE UnloadImage; + EFI_EBC_REGISTER_ICACHE_FLUSH RegisterICacheFlush; + EFI_EBC_GET_VERSION GetVersion; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/EdidActive.h b/Include/Protocol/EdidActive.h new file mode 100644 index 0000000..2090424 --- /dev/null +++ b/Include/Protocol/EdidActive.h @@ -0,0 +1,70 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2006, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/EdidActive.h 1 12/20/06 1:45p Felixp $ +// +// $Revision: 1 $ +// +// $Date: 12/20/06 1:45p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/EdidActive.h $ +// +// 1 12/20/06 1:45p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: EdidActive.h +// +// Description: EFI_EDID_ACTIVE_PROTOCOL protocol declaration +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __EFI_EDID_ACTIVE_PROTOCOL__H__ +#define __EFI_EDID_ACTIVE_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_EDID_ACTIVE_PROTOCOL_GUID \ + { 0xbd8c1056, 0x9f36, 0x44ec, 0x92, 0xa8, 0xa6, 0x33, 0x7f, 0x81, 0x79, 0x86 } + +GUID_VARIABLE_DECLARATION (gEfiEdidActiveProtocolGuid, EFI_EDID_ACTIVE_PROTOCOL_GUID); + +typedef struct { + UINT32 SizeOfEdid; + UINT8 *Edid; +} EFI_EDID_ACTIVE_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (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/Include/Protocol/EdidDiscovered.h b/Include/Protocol/EdidDiscovered.h new file mode 100644 index 0000000..6182e8b --- /dev/null +++ b/Include/Protocol/EdidDiscovered.h @@ -0,0 +1,70 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2006, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/EdidDiscovered.h 1 12/20/06 1:45p Felixp $ +// +// $Revision: 1 $ +// +// $Date: 12/20/06 1:45p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/EdidDiscovered.h $ +// +// 1 12/20/06 1:45p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: EdidDiscovered.h +// +// Description: EFI_EDID_DISCOVERED_PROTOCOL protocol declaration +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __EFI_EDID_DISCOVERED_PROTOCOL__H__ +#define __EFI_EDID_DISCOVERED_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_EDID_DISCOVERED_PROTOCOL_GUID \ + { 0x1c0c34f6, 0xd380, 0x41fa, 0xa0, 0x49, 0x8a, 0xd0, 0x6c,0x1a, 0x66, 0xaa } + +GUID_VARIABLE_DECLARATION (gEfiEdidDiscoveredProtocolGuid, EFI_EDID_DISCOVERED_PROTOCOL_GUID); + +typedef struct { + UINT32 SizeOfEdid; + UINT8 *Edid; +} EFI_EDID_DISCOVERED_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (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/Include/Protocol/EdidOverride.h b/Include/Protocol/EdidOverride.h new file mode 100644 index 0000000..8936842 --- /dev/null +++ b/Include/Protocol/EdidOverride.h @@ -0,0 +1,84 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/EdidOverride.h 1 10/30/13 6:44a Ireneyang $ +// +// $Revision: 1 $ +// +// $Date: 10/30/13 6:44a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/EdidOverride.h $ +// +// 1 10/30/13 6:44a Ireneyang +// -Fix no display in Win8. It would have a compiler error when +// enableing token "OEM_EDID_OVERRIDE_PROTOCOL_SUPPORT". +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: EdidOverride.h +// +// Description: EFI_EDID_OVERRIDE_PROTOCOL protocol declaration +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __EFI_EDID_OVERRIDE_PROTOCOL__H__ +#define __EFI_EDID_OVERRIDE_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_EDID_OVERRIDE_PROTOCOL_GUID \ + { 0x48ecb431, 0xfb72, 0x45c0, 0xa9, 0x22, 0xf4, 0x58, 0xfe, 0x4, 0xb, 0xd5 } + +GUID_VARIABLE_DECLARATION (gEfiEdidOverrideProtocolGuid, EFI_EDID_OVERRIDE_PROTOCOL_GUID); + +#define EFI_EDID_OVERRIDE_DONT_OVERRIDE 0x01 +#define EFI_EDID_OVERRIDE_ENABLE_HOT_PLUG 0x02 + +typedef struct _EFI_EDID_OVERRIDE_PROTOCOL EFI_EDID_OVERRIDE_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID) ( + IN EFI_EDID_OVERRIDE_PROTOCOL *This, + IN EFI_HANDLE *ChildHandle, + OUT UINT32 *Attributes, + IN OUT UINTN *EdidSize, + IN OUT UINT8 **Edid + ); + +typedef struct _EFI_EDID_OVERRIDE_PROTOCOL { + EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID GetEdid; +} EFI_EDID_OVERRIDE_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2012, 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/Include/Protocol/EfiOemBadging.h b/Include/Protocol/EfiOemBadging.h new file mode 100644 index 0000000..9860bca --- /dev/null +++ b/Include/Protocol/EfiOemBadging.h @@ -0,0 +1,101 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2007, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/EfiOemBadging.h 1 8/31/07 11:58a Felixp $ +// +// $Revision: 1 $ +// +// $Date: 8/31/07 11:58a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/EfiOemBadging.h $ +// +// 1 8/31/07 11:58a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: EfiOemBadging.h +// +// Description: OEM Badging protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __OEM_BADGING_PROTOCOL__H__ +#define __OEM_BADGING_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_OEM_BADGING_PROTOCOL_GUID \ + { 0x170e13c0, 0xbf1b, 0x4218, 0x87, 0x1d, 0x2a, 0xbd, 0xc6, 0xf8, 0x87, 0xbc } + +GUID_VARIABLE_DECLARATION(gEfiOEMBadgingProtocolGuid, EFI_OEM_BADGING_PROTOCOL_GUID); + +typedef struct _EFI_OEM_BADGING_PROTOCOL EFI_OEM_BADGING_PROTOCOL; + +typedef enum { + EfiBadgingFormatBMP, + EfiBadgingFormatJPEG, + EfiBadgingFormatTIFF, + EfiBadgingFormatGIF, + EfiBadgingFormatUnknown +} EFI_BADGING_FORMAT; + +typedef enum { + EfiBadgingDisplayAttributeLeftTop, + EfiBadgingDisplayAttributeCenterTop, + EfiBadgingDisplayAttributeRightTop, + EfiBadgingDisplayAttributeCenterRight, + EfiBadgingDisplayAttributeRightBottom, + EfiBadgingDisplayAttributeCenterBottom, + EfiBadgingDisplayAttributeLeftBottom, + EfiBadgingDisplayAttributeCenterLeft, + EfiBadgingDisplayAttributeCenter, + EfiBadgingDisplayAttributeCustomized +} EFI_BADGING_DISPLAY_ATTRIBUTE; + +typedef EFI_STATUS (EFIAPI *EFI_BADGING_GET_IMAGE) ( + IN EFI_OEM_BADGING_PROTOCOL *This, + IN OUT UINT32 *Instance, OUT EFI_BADGING_FORMAT *Format, + OUT UINT8 **ImageData, OUT UINTN *ImageSize, + OUT EFI_BADGING_DISPLAY_ATTRIBUTE *Attribute, + OUT UINTN *CoordinateX, OUT UINTN *CoordinateY +); + +struct _EFI_OEM_BADGING_PROTOCOL { + EFI_BADGING_GET_IMAGE GetImage; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2007, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/Emul6064KbdInput.h b/Include/Protocol/Emul6064KbdInput.h new file mode 100644 index 0000000..4e7facf --- /dev/null +++ b/Include/Protocol/Emul6064KbdInput.h @@ -0,0 +1,93 @@ +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/Emul6064KbdInput.h 4 6/28/10 5:24p Olegi $ +// +// $Revision: 4 $ +// +// $Date: 6/28/10 5:24p $ +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: Emul6064KbdInput.h +// +// Description: Protocol used for USB 6064 keyboard emulation +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + + +#ifndef _EMUL6064KBDINPUT_PROTOCOL_H_ +#define _EMUL6064KBDINPUT_PROTOCOL_H_ + +EFI_FORWARD_DECLARATION (EFI_EMUL6064KBDINPUT_PROTOCOL); + +#define EFI_EMUL6064KBDINPUT_PROTOCOL_GUID \ + { 0x62ceef5a, 0x1d7c, 0x4943, 0x9b, 0x3a, 0x95, 0xe2, 0x49, 0x4c, 0x89, 0x90 } + +typedef enum { + KBC_KBDTRANS_AT = 0, //NOT TRANSLATED (XLAT cleared in CCB) + KBC_KBDTRANS_PCXT = 1, //TRANSLATED (XLAT set in CCB) +} KBC_KBDTRANSLATION; + +typedef +EFI_STATUS +(EFIAPI *EFI_EMUL6064KBDINPUT_PROTOCOL_SEND) ( + IN EFI_EMUL6064KBDINPUT_PROTOCOL * This, + IN UINT8* data, + IN UINT32 count + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_EMUL6064KBDINPUT_PROTOCOL_GETTRANS) ( + IN EFI_EMUL6064KBDINPUT_PROTOCOL * This, + OUT KBC_KBDTRANSLATION* outTrans + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_EMUL6064KBDINPUT_PROTOCOL_UPDATELEDSTATE) ( + IN EFI_EMUL6064KBDINPUT_PROTOCOL * This, + IN UINT8 data + ); + + +typedef struct _EFI_EMUL6064KBDINPUT_PROTOCOL { + EFI_EMUL6064KBDINPUT_PROTOCOL_SEND Send ; + EFI_EMUL6064KBDINPUT_PROTOCOL_GETTRANS GetTranslation; + EFI_EMUL6064KBDINPUT_PROTOCOL_UPDATELEDSTATE UpdateLEDState; +} EFI_EMUL6064KBDINPUT_PROTOCOL; + +extern EFI_GUID gEmul6064KbdInputProtocolGuid; + +#endif + +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** diff --git a/Include/Protocol/Emul6064MsInput.h b/Include/Protocol/Emul6064MsInput.h new file mode 100644 index 0000000..ade138f --- /dev/null +++ b/Include/Protocol/Emul6064MsInput.h @@ -0,0 +1,83 @@ +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/Emul6064MsInput.h 4 6/28/10 5:24p Olegi $ +// +// $Revision: 4 $ +// +// $Date: 6/28/10 5:24p $ +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: Emul6064MsInput.h +// +// Description: Protocol used for 6064 USB mouse emulation +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef _EMUL6064MSINPUT_PROTOCOL_H_ +#define _EMUL6064MSINPUT_PROTOCOL_H_ + +EFI_FORWARD_DECLARATION (EFI_EMUL6064MSINPUT_PROTOCOL); + +#define EFI_EMUL6064MSINPUT_PROTOCOL_GUID \ + { 0x7578b307, 0xb25b, 0x44f9, 0x89, 0x2e, 0x20, 0x9b, 0x0e, 0x39, 0x93, 0xc6 } + +#define PS2MSFLAGS_LBUTTON 0x01 +#define PS2MSFLAGS_RBUTTON 0x02 +#define PS2MSFLAGS_XSIGN 0x10 +#define PS2MSFLAGS_YSIGN 0x20 +#define PS2MSFLAGS_XO 0x40 +#define PS2MSFLAGS_YO 0x80 + +typedef struct { + UINT8 flags; + UINT8 x; + UINT8 y; +} PS2MouseData; + + +typedef +EFI_STATUS +(EFIAPI *EFI_EMUL6064MSINPUT_PROTOCOL_SEND) ( + IN EFI_EMUL6064MSINPUT_PROTOCOL * This, + IN PS2MouseData* data + ); + +typedef struct _EFI_EMUL6064MSINPUT_PROTOCOL { + EFI_EMUL6064MSINPUT_PROTOCOL_SEND Send; +} EFI_EMUL6064MSINPUT_PROTOCOL; + +extern EFI_GUID gEmul6064MsInputProtocolGuid; + +#endif + +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** diff --git a/Include/Protocol/Emul6064Trap.h b/Include/Protocol/Emul6064Trap.h new file mode 100644 index 0000000..011458a --- /dev/null +++ b/Include/Protocol/Emul6064Trap.h @@ -0,0 +1,115 @@ +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** + +//**************************************************************************** +// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/Emul6064Trap.h 5 4/04/11 5:34a Ryanchou $ +// +// $Revision: 5 $ +// +// $Date: 4/04/11 5:34a $ +// +//**************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/Emul6064Trap.h $ +// +// 5 4/04/11 5:34a Ryanchou +// [TAG] EIP57534 +// [Category] Bug Fix +// [Severity] Minor +// [Symptom] BIOS rom image build process may stopped with error. +// [RootCause] Has unnecessary semi-colon (;). +// [Solution] Remove the unnecessary semi-colon. +// [Files] Emul6064Trap.h +// +// 4 7/08/10 2:22a Rameshr +// Ohci Emulation support Added. +// EIP 39712 +// +// 3 6/28/10 5:24p Olegi +// EIP22197: Corrected headers/footers. +// +// 2 2/04/09 12:48p Olegi +// Added NONSMMEMUL6064TRAP definitions. +// +// 1 12/17/07 2:46p Olegi +//**************************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: Emul6064Trap.h +// +// Description: Protocol used for 6064 port trapping +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + + +#ifndef _EMUL6064TRAP_PROTOCOL_H_ +#define _EMUL6064TRAP_PROTOCOL_H_ + +EFI_FORWARD_DECLARATION (EFI_EMUL6064TRAP_PROTOCOL); + +#define EFI_EMUL6064TRAP_PROTOCOL_GUID \ + { 0x6ea0f71c, 0x614a, 0x437e, 0x8f, 0x49, 0x24, 0x3a, 0xd4, 0xe8, 0x32, 0x68 } + +#define EFI_NONSMMEMUL6064TRAP_PROTOCOL_GUID \ + { 0x68b81e51, 0x2583, 0x4582, 0x95, 0xdb, 0xc5, 0x72, 0x32, 0x36, 0xc4, 0xf1 } + +#define IRQ_SUPPORTED 0x0001 + +typedef +BOOLEAN +(EFIAPI *EFI_EMUL6064TRAP_PROTOCOL_ENABLE) ( + IN EFI_EMUL6064TRAP_PROTOCOL * This + ); + +typedef +BOOLEAN +(EFIAPI *EFI_EMUL6064TRAP_PROTOCOL_DISABLE) ( + IN EFI_EMUL6064TRAP_PROTOCOL * This + ); + +typedef +UINT32 +(EFIAPI *EFI_EMUL6064TRAP_PROTOCOL_FEATURE) ( + IN EFI_EMUL6064TRAP_PROTOCOL * This + ); + + +typedef struct _EFI_EMUL6064TRAP_PROTOCOL { + EFI_EMUL6064TRAP_PROTOCOL_ENABLE TrapEnable; + EFI_EMUL6064TRAP_PROTOCOL_DISABLE TrapDisable; + EFI_EMUL6064TRAP_PROTOCOL_FEATURE FeatureSupported; +} EFI_EMUL6064TRAP_PROTOCOL; + +extern EFI_GUID gEmul6064TrapProtocolGuid; +extern EFI_GUID gNonSmmEmul6064TrapProtocolGuid; + +#endif + +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** diff --git a/Include/Protocol/ExtHii.h b/Include/Protocol/ExtHii.h new file mode 100644 index 0000000..361817d --- /dev/null +++ b/Include/Protocol/ExtHii.h @@ -0,0 +1,171 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/ExtHii.h 6 12/29/09 1:17p Yakovlevs $Revision: 14 $ +// +// $Date: 12/29/09 1:17p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/ExtHii.h $ +// +// 6 12/29/09 1:17p Yakovlevs +//********************************************************************** + +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: Hii.h +// +// Description: This file defines the Extended Human Interface +// Infrastructure protocol. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __EXT_HII_PROTOCOL_H__ +#define __EXT_HII_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +/****** DO NOT WRITE ABOVE THIS LINE *******/ +#if EFI_SPECIFICATION_VERSION>0x20000 && !defined(GUID_VARIABLE_DEFINITION) +#pragma message("The EXT_HII_PROTOCOL protocol is only supported for the UEFI 2.0 projects") +#pragma message("The supported version of the UEFI specification is defined by the EFI_SPECIFICATION_VERSION SDL token") +#error the protocol is depricated +#else +//====================================================================== +#include <EFI.h> + +#define EFI_HII_EXT_PROTOCOL_GUID \ + { 0x2a57ae75, 0x8b7a, 0x4c64, 0x86, 0x56, 0xdb, 0x51, 0xdd, 0xc3, 0x6f, 0x7b } + +GUID_VARIABLE_DECLARATION(gEfiExtHiiProtocolGuid,EFI_HII_EXT_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <AmiDxeLib.h> +#include <Protocol/Hii.h> + +//Protocol Prototype +typedef struct _EXT_HII_PROTOCOL EXT_HII_PROTOCOL; + +typedef struct _EXT_STR_INFO { + UINT16 StrLen; //Length of the String in unicode characters + UINT16 ScrLen; //Length of the string in Narrow Glyphs(Screen Grid) +// BOOLEAN AllGlyphs; //Indicates if all gliphs for the string available. + UINT16 *StrPtr; //pointer to UNICODE string itself; +} EXT_STR_INFO; + +typedef struct _HII_FORMSET { + UINT32 HandleId; + EFI_HII_HANDLE Handle; //Actual Handle Value + //this structure member must be updated each time UpdateForm is called + //it always reflects an actual length of Last updated Formset!!!! + UINTN BufferLength;//in bytes excluding EndOfFormSet OPCODE!!! + EFI_IFR_FORM_SET *FormSetData; + EFI_IFR_END_FORM_SET *EndFormSet; + T_ITEM_LIST Forms; //contains pointers to HII_FORM Structure + T_ITEM_LIST Labels; //contains pointers to HII_LABEL Structure + T_ITEM_LIST Storages; +} HII_FORMSET; + +typedef struct _HII_FORM { + EFI_FORM_ID FormId; + EFI_IFR_FORM *FormData; + EFI_IFR_END_FORM *EndForm; + //this structure member must be updated each time UpdateForm is called + //it always reflects an actual length of Last updated Form!!!! + UINTN BufferLength; //in bytes including EndOfForm OPCODE!!! + T_ITEM_LIST Labels; //contains pointers to HII_LABEL Structure + //the very first label is a fake label containing all data from beginning of the form + //to the first valid label which means to be updated + //!!!!I'm definetly missing the END_OF_LABEL_OP opcode!!!!! + HII_FORMSET *Owner; +} HII_FORM; + + +typedef VOID (EFIAPI *HII_LABEL_UPDATE_CALLBACK)(UINT16 LabelId, UINT16 HiiHandle, BOOLEAN AddData); + + +typedef EFI_STATUS (EFIAPI *HII_EXT_REGISTER_LABEL_UPDATE_CALBACK)( + IN EXT_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN EFI_FORM_LABEL LabelId, + IN HII_LABEL_UPDATE_CALLBACK CallBack); + +typedef EFI_STATUS (EFIAPI *HII_EXT_UNREGISTER_LABEL_UPDATE_CALBACK)( + IN EXT_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN EFI_FORM_LABEL LabelId); + +typedef EFI_STATUS (EFIAPI *HII_EXT_GET_FORM_INFO)( + IN EXT_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN EFI_FORM_ID FormId, + OUT HII_FORM **ExtFormInfo); + +//Will get extended string info. +typedef EFI_STATUS (EFIAPI *HII_EXT_GET_STRING)( + IN EXT_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN STRING_REF Token, + IN CHAR16 *Lang, + OUT EXT_STR_INFO **ExtStrInfo); + +typedef EFI_STATUS (EFIAPI *HII_EXT_GET_FORMSET)( + IN EXT_HII_PROTOCOL *This, + IN UINT16 ClassMask, + IN UINT16 SubClass, + OUT T_ITEM_LIST *FormSetList); + +typedef EFI_STATUS (EFIAPI *HII_EXT_GET_FORM_LABELS)( + IN EXT_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN EFI_FORM_ID FormID, + OUT T_ITEM_LIST *LabelList); + + +typedef struct _EXT_HII_PROTOCOL{ + HII_EXT_GET_STRING ExtGetStringInfo; + HII_EXT_GET_FORM_INFO ExtGetFormInfo; + HII_EXT_GET_FORMSET ExtGetFormsetInfo; + HII_EXT_REGISTER_LABEL_UPDATE_CALBACK ExtRegLblCallBack; + HII_EXT_UNREGISTER_LABEL_UPDATE_CALBACK ExtUnregLblCallBack; + HII_EXT_GET_FORM_LABELS ExtGetFormLabels; +//TODO +// suggestions ????? +//TODO +} EXT_HII_PROTOCOL; + +#endif // #if EFI_SPECIFICATION_VERSION>0x20000 +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif //_EXT_HII_H_ + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/FastBootProtocol.cif b/Include/Protocol/FastBootProtocol.cif new file mode 100644 index 0000000..a28ace1 --- /dev/null +++ b/Include/Protocol/FastBootProtocol.cif @@ -0,0 +1,8 @@ +<component> + name = "FastBoot Protocol" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "FastBootProtocol" +[files] +"FastBootProtocol.h" +<endComponent> diff --git a/Include/Protocol/FastBootProtocol.h b/Include/Protocol/FastBootProtocol.h new file mode 100644 index 0000000..0a24b30 --- /dev/null +++ b/Include/Protocol/FastBootProtocol.h @@ -0,0 +1,248 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* +//************************************************************************* +// $Header: /Alaska/SOURCE/Modules/PTT/FastBootProtocol.h 8 4/18/13 5:35a Simonchen $ +// +// $Revision: 8 $ +// +// $Date: 4/18/13 5:35a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/PTT/FastBootProtocol.h $ +// +// 8 4/18/13 5:35a Simonchen +// [TAG] EIP113454 +// [Category] New Feature +// [Description] create for implement or experiment for Intel raid mode +// on fastboot. +// [Files] FastBootProtocol.h +// +// 7 8/23/12 6:08a Bibbyyeh +// Add a flag "InFastBootPath" in FAST_BOOT_POLICY protocol. +// +// 6 8/10/12 3:26a Bibbyyeh +// [TAG] EIP96276 +// [Category] New Feature +// [Description] Function request for PTT_12 +// EIP96276.2 Fixed USB skip table issue. +// EIP96276.3 Add token ¡¥CONNECT_ALL_SATA_DEVICE_IN_FASTBOOT¡¦ to +// gFastBootPolicy. +// EIP96276.4 Add IsValidFBBootOptionPtr support by driver type. Exp : usb +// type skip or other type +// EIP96276.5 Add token ¡¥Test mode¡¨ to gFastBootPolicy Setup menu. +// EIP96276.6 Disable Tse Hotkey support in fastboot path. +// EIP96276.7 Modify TRACE message. +// [Files] FastBoot.c FastBoot.sd FastBoot.sdl FastBoot.uni +// FastBootRuntime.c FastBootProtocol.c +// +// 5 8/07/12 4:42a Bibbyyeh +// [TAG] EIP97545 +// [Category] Improvement +// [Description] Updated PTT Module to Implement Support for +// Initializing the Keyboard in First Call of Readkeystroke on Fastboot. +// [Files] FastBoot.c FastBoot.h FastBootProtocol.h +// +// 4 6/01/12 6:51a Bibbyyeh +// [TAG] EIP90455 +// [Category] New Feature +// [Description] PTT improvement - fastboot policy protocol for dynamic +// control fast boot behavior. +// [Files] FastBoot.c FastBoot.sdl FastBoot.sd FastBoot.uni +// FastBootRuntime.c FastBootTseHook.c FastBootProtocol.h FastBoot.h +// +// 3 9/08/11 5:27a Bibbyyeh +// [TAG] EIP68329 +// [Category] Bug Fix +// [Severity] Important +// [Symptom] OS can't back to desktop correctly after resumed from +// S3. +// [RootCause] TSEIDEPasswordFreezeDevices is skipped in fastboot path +// if SKIP_TSE_HANDSHAKE is enabled. +// [Solution] Call TSEIDEPasswordFreezeDevices after ReadyToBoot +// Event in fastboot path. +// [Files] FastBoot.c FastBootProtocol.h FastBootTseHook.c +// +// 2 7/07/11 10:11a Bibbyyeh +// [TAG] EIP63924 +// [Category] Improvement +// [Description] +// 1. Add elink for FastBoot mode change, default checking rule is check +// post hotkey. +// 2. Timer call back for check hotkey is not necessary. Create a protocol +// for calling checkforkey in TSE. +// 3. Since EIP68383 improve the performance of ps2 keyboard, we don't +// need to exchange the initial order of ConIn/ConOut for getting more +// time to detect hotkey. +// [Files] FastBoot.sdl FastBoot.mak FastBoot.c FastBootTseHook.c +// FastBoot.h FastBootProtocol.h +// +// 1 3/11/11 10:04p Bibbyyeh +// [TAG] EIP54993 +// [Category] Improvement +// [Description] +// 1.Sync with Fastboot_10 +// 2.Remove token "SAVE_LAST_BOOT_DEVICE_CHECKSUM" +// 3.Add token "CALL_DISPATCHER_AGAIN_IN_FASTBOOT" +// 4.Use SimpleText protocol to detect mode change hotkey instead of +// pBS->ConIn. +// 5.Simplify the code about "AMILEGACY16_FASTBOOT_SOLUTION". +// 6.Fixed a bug that SATA device can't be found if keep TSE execution on +// fastboot path. +// [Files] PPT.cif FastBoot.sdl FastBootRuntime.c FastBootTseHook.c +// FastBoot.c FastBoot.h FastBoot.sd FastBootProtocol.cif +// FastBootProtocol.h FastBootSMI.cif FastBootSMI.sdl FastBootSMI.c +// FastBootSMI.dxs FastBootSMI.mak +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: FastBootProtocol.h +// +// Description: +// Fast boot protocol definitions +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __FASTBOOT_PROTOCOL__H__ +#define __FASTBOOT_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#pragma pack(1) + + +// {3496A19A-2E99-41ba-833E-0FDE2EBF2A55} +#define AMI_FAST_BOOT_PROTOCOL_GUID \ + { 0x3496a19a, 0x2e99, 0x41ba, 0x83, 0x3e, 0xf, 0xde, 0x2e, 0xbf, 0x2a, 0x55 } + + //(EIP63924+)> +// {8fba43b8-acdb-4ee2-ab31-0fa4d5b6c3c5} +#define FAST_BOOT_TSE_PROTOCOL_GUID \ + { 0x0fba43b8, 0xacdb, 0x4ee2, 0xab, 0x31, 0x0f, 0xa4, 0xd5, 0xb6, 0xc3, 0xc5 } + //<(EIP63924+) + +#define FAST_BOOT_POLICY_PROTOCOL_GUID \ + { 0xb2a07be9, 0xc754, 0x4c36, 0x93, 0x02, 0x7c, 0xc7, 0x8a, 0xa0, 0xd8, 0x75 } + +GUID_VARIABLE_DECLARATION(AmiFastBootProtocolGuid, AMI_FAST_BOOT_PROTOCOL_GUID); + +typedef struct _SKIP_PCI_LIST{ + UINT8 Class; + UINT8 SubClass; +} SKIP_PCI_LIST; + +typedef struct _FAST_BOOT_POLICY { + BOOLEAN FastBootEnable; + BOOLEAN TestMode; +//pervious boot information + BOOLEAN UEfiBoot; + UINT16 BootOptionNumber; + UINT16 DevStrCheckSum; + EFI_DEVICE_PATH_PROTOCOL *FastBootOption; + BOOLEAN LastBootFailure; + BOOLEAN LastBootVarPresence; + UINT32 BootCount; +//previous boot sata information + VOID *SataDevice; +//fast boot behavior para + BOOLEAN FirstFastBootInS4; + BOOLEAN CheckBootOptionNumber; + BOOLEAN CheckDevStrCheckSum; + UINT8 SataSupport; + BOOLEAN VGASupport; + UINT8 UsbSupport; + VOID *UsbSkipTable; + UINTN UsbSkipTableSize; + BOOLEAN Ps2Support; + BOOLEAN NetWorkStackSupport; + SKIP_PCI_LIST *SkipPciList; + UINTN SkipPciListSize; + BOOLEAN CheckPassword; + BOOLEAN SkipTSEHandshake; +// BOOLEAN ConnectAllSata; //(EIP96276.3)+ + BOOLEAN InFastBootPath; +} FAST_BOOT_POLICY; + + +typedef +EFI_STATUS +(EFIAPI *AMI_FAST_BOOT_LAUNCH) ( + VOID + ); + +typedef +VOID +(EFIAPI *AMI_FAST_BOOT_CONNECT_INPUT_DEVICE) ( + VOID + ); + +typedef +BOOLEAN +(EFIAPI *AMI_FAST_BOOT_IS_RUNTIME) ( + VOID + ); + +typedef struct _AMI_FAST_BOOT_PROTOCOL +{ + AMI_FAST_BOOT_LAUNCH Launch; + AMI_FAST_BOOT_CONNECT_INPUT_DEVICE ConnectInputDevices; + AMI_FAST_BOOT_IS_RUNTIME IsRuntime; +}AMI_FAST_BOOT_PROTOCOL; + + + //(EIP63924+)> +typedef +EFI_STATUS +(EFIAPI *FAST_BOOT_CHECK_FOR_KEY) ( + BOOLEAN *EnterSetup, + UINT32 *BootFlow + ); + +typedef +EFI_STATUS +(EFIAPI *FAST_BOOT_STOP_CHECK_FOR_KEY_TIMER)(); + + //(EIP68329+)> +typedef +VOID +(EFIAPI *FAST_BOOT_PASSWORD_FREEZE_DEVICES)(); + //<(EIP68329+) +typedef struct _FAST_BOOT_TSE_PROTOCOL +{ + FAST_BOOT_CHECK_FOR_KEY FastBootCheckForKey; + FAST_BOOT_STOP_CHECK_FOR_KEY_TIMER FastBootStopCheckForKeyTimer; + FAST_BOOT_PASSWORD_FREEZE_DEVICES FastBootPasswordFreezeDevices; //(EIP68329+) +} +FAST_BOOT_TSE_PROTOCOL; + //<(EIP63924+) +#pragma pack() +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/FirmwareManagement.h b/Include/Protocol/FirmwareManagement.h new file mode 100644 index 0000000..8d68fbf --- /dev/null +++ b/Include/Protocol/FirmwareManagement.h @@ -0,0 +1,189 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Include/Protocol/FirmwareManagement.h 1 5/02/11 5:39p Artems $ +// +// $Revision: 1 $ +// +// $Date: 5/02/11 5:39p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/FirmwareManagement.h $ +// +// 1 5/02/11 5:39p Artems +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: FirmwareManagement.h +// +// Description: +// EFI_FIRMWARE_MANAGEMENT_PROTOCOL definition file +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __FIRMWARE_MANAGEMENT_PROTOCOL__H__ +#define __FIRMWARE_MANAGEMENT_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> +#include <WinCertificate.h> + +#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID \ + { 0x86c77a67, 0xb97, 0x4633, 0xa1, 0x87, 0x49, 0x10, 0x4d, 0x6, 0x85, 0xc7 } + +#define IMAGE_ATTRIBUTE_IMAGE_UPDATABLE 0x0000000000000001 +#define IMAGE_ATTRIBUTE_RESET_REQUIRED 0x0000000000000002 +#define IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004 +#define IMAGE_ATTRIBUTE_IN_USE 0x0000000000000008 + +#define IMAGE_COMPATIBILITY_CHECK_SUPPORTED 0x0000000000000001 + +#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION 1 + +#define IMAGE_UPDATABLE_VALID 0x0000000000000001 +#define IMAGE_UPDATABLE_INVALID 0x0000000000000002 +#define IMAGE_UPDATABLE_INVALID_TYPE 0x0000000000000004 +#define IMAGE_UPDATABLE_INVALID_OLD 0x0000000000000008 + +#define PACKAGE_ATTRIBUTE_VERSION_UPDATABLE 0x0000000000000001 +#define PACKAGE_ATTRIBUTE_RESET_REQUIRED 0x0000000000000002 +#define PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004 + +GUID_VARIABLE_DECLARATION(gEfiFirmwareManagementProtocolGuid, EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID); + + +typedef struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL EFI_FIRMWARE_MANAGEMENT_PROTOCOL; + +typedef struct { + UINT64 MonotonicCount; + WIN_CERTIFICATE_UEFI_GUID AuthInfo; +} EFI_FIRMWARE_IMAGE_AUTHENTICATION; + +typedef struct { + UINT8 ImageIndex; + EFI_GUID ImageTypeId; + UINT64 ImageId; + CHAR16 *ImageIdName; + UINT32 Version; + CHAR16 *VersionName; + UINTN Size; + UINT64 AttributesSupported; + UINT64 AttributesSetting; + UINT64 Compatibilities; +} EFI_FIRMWARE_IMAGE_DESCRIPTOR; + +typedef +EFI_STATUS +(EFIAPI *EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS) ( + IN UINTN Completion +); + +typedef +EFI_STATUS +(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE_INFO) ( + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, + IN OUT UINTN *ImageInfoSize, + IN OUT EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo, + OUT UINT32 *DescriptorVersion, + OUT UINT8 *DescriptorCount, + OUT UINTN *DescriptorSize, + OUT UINT32 *PackageVersion, + OUT CHAR16 **PackageVersionName +); + +typedef +EFI_STATUS +(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE) ( + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, + IN UINT8 ImageIndex, + IN OUT VOID *Image, + IN OUT UINTN *ImageSize +); + +typedef +EFI_STATUS +(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_IMAGE) ( + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, + IN UINT8 ImageIndex, + IN CONST VOID *Image, + IN UINTN ImageSize, + IN CONST VOID *VendorCode, + IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress, + OUT CHAR16 **AbortReason +); + +typedef +EFI_STATUS +(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_CHECK_IMAGE) ( + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, + IN UINT8 ImageIndex, + IN CONST VOID *Image, + IN UINTN ImageSize, + OUT UINT32 *ImageUpdatable +); + +typedef +EFI_STATUS +(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_PACKAGE_INFO) ( + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, + OUT UINT32 *PackageVersion, + OUT CHAR16 **PackageVersionName, + OUT UINT32 *PackageVersionNameMaxLen, + OUT UINT64 *AttributesSupported, + OUT UINT64 *AttributesSetting +); + +typedef +EFI_STATUS +(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_PACKAGE_INFO) ( + IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, + IN CONST VOID *Image, + IN UINTN ImageSize, + IN CONST VOID *VendorCode, + IN UINT32 PackageVersion, + IN CONST CHAR16 *PackageVersionName +); + +struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL { + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE_INFO GetImageInfo; + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE GetImage; + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_IMAGE SetImage; + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_CHECK_IMAGE CheckImage; + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_PACKAGE_INFO GetPackageInfo; + EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_PACKAGE_INFO SetPackageInfo; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/FirmwareVolume.h b/Include/Protocol/FirmwareVolume.h new file mode 100644 index 0000000..21babbc --- /dev/null +++ b/Include/Protocol/FirmwareVolume.h @@ -0,0 +1,234 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/FirmwareVolume.h 4 6/16/11 3:22p Felixp $ +// +// $Revision: 4 $ +// +// $Date: 6/16/11 3:22p $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/FirmwareVolume.h $ +// +// 4 6/16/11 3:22p Felixp +// Surround backward compatibility definitions with #if +// BACKWARD_COMPATIBLE_MODE +// +// 3 5/27/11 5:53p Felixp +// Headers are updated to improve separation of the Framework and PI +// interfaces. +// The definitions that will be removed in the future versions are marked +// with the comments. +// +// 2 2/05/11 2:30p Artems +// Added PI 1.0-1.1 compatibility +// +// 1 3/13/06 1:38a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 4 12/31/03 2:41p Markw +// Fix structure help +// +// 3 12/19/03 2:21p Markw +// Add EFI_FV_... Attribute definition +// +// 2 12/18/03 12:53p Markw +// Header changes +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: FirmwareVolume.h +// +// Description: This file is an include file used to define the Protocol for the +// Firmware Volume Protocol. +// +//<AMI_FHDR_END> +//***************************************************************************** +#ifndef __FIRMWARE_VOLUME_PROTOCOL_H__ +#define __FIRMWARE_VOLUME_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <FFS.h> + +#if BACKWARD_COMPATIBLE_MODE && PI_SPECIFICATION_VERSION>=0x00010000 +#include <Protocol/FirmwareVolume2.h> +#define EFI_FIRMWARE_VOLUME_PROTOCOL_GUID EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID +GUID_VARIABLE_DECLARATION(gEfiFirmwareVolumeProtocolGuid, EFI_FIRMWARE_VOLUME_PROTOCOL_GUID); +typedef EFI_FIRMWARE_VOLUME2_PROTOCOL EFI_FIRMWARE_VOLUME_PROTOCOL; + +#else +// 389F751F-1838-4388-8390-CD8154BD27F8 +#define EFI_FIRMWARE_VOLUME_PROTOCOL_GUID \ + {0x389F751F,0x1838,0x4388,0x83,0x90,0xCD,0x81,0x54,0xBD,0x27,0xF8} + +GUID_VARIABLE_DECLARATION(gEfiFirmwareVolumeProtocolGuid, EFI_FIRMWARE_VOLUME_PROTOCOL_GUID); + +//************************************************************ +// EFI_FV_ATTRIBUTES +//************************************************************ +typedef UINT64 EFI_FV_ATTRIBUTES; + +//************************************************************ +// EFI_FV_ATTRIBUTES bit definitions +//************************************************************ +#define EFI_FV_READ_DISABLE_CAP 0x0000000000000001 +#define EFI_FV_READ_ENABLE_CAP 0x0000000000000002 +#define EFI_FV_READ_STATUS 0x0000000000000004 +#define EFI_FV_WRITE_DISABLE_CAP 0x0000000000000008 +#define EFI_FV_WRITE_ENABLE_CAP 0x0000000000000010 +#define EFI_FV_WRITE_STATUS 0x0000000000000020 +#define EFI_FV_LOCK_CAP 0x0000000000000040 +#define EFI_FV_LOCK_STATUS 0x0000000000000080 +#define EFI_FV_WRITE_POLICY_RELIABLE 0x0000000000000100 +#define EFI_FV_ALIGNMENT_CAP 0x0000000000008000 +#define EFI_FV_ALIGNMENT_2 0x0000000000010000 +#define EFI_FV_ALIGNMENT_4 0x0000000000020000 +#define EFI_FV_ALIGNMENT_8 0x0000000000040000 +#define EFI_FV_ALIGNMENT_16 0x0000000000080000 +#define EFI_FV_ALIGNMENT_32 0x0000000000100000 +#define EFI_FV_ALIGNMENT_64 0x0000000000200000 +#define EFI_FV_ALIGNMENT_128 0x0000000000400000 +#define EFI_FV_ALIGNMENT_256 0x0000000000800000 +#define EFI_FV_ALIGNMENT_512 0x0000000001000000 +#define EFI_FV_ALIGNMENT_1K 0x0000000002000000 +#define EFI_FV_ALIGNMENT_2K 0x0000000004000000 +#define EFI_FV_ALIGNMENT_4K 0x0000000008000000 +#define EFI_FV_ALIGNMENT_8K 0x0000000010000000 +#define EFI_FV_ALIGNMENT_16K 0x0000000020000000 +#define EFI_FV_ALIGNMENT_32K 0x0000000040000000 +#define EFI_FV_ALIGNMENT_64K 0x0000000080000000 + + +struct _EFI_FIRMWARE_VOLUME_PROTOCOL; +typedef struct _EFI_FIRMWARE_VOLUME_PROTOCOL EFI_FIRMWARE_VOLUME_PROTOCOL; + +typedef EFI_STATUS (EFIAPI * EFI_FV_GET_ATTRIBUTES) ( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + OUT EFI_FV_ATTRIBUTES *FvAttributes); + + +typedef EFI_STATUS (EFIAPI * EFI_FV_SET_ATTRIBUTES) ( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + IN OUT EFI_FV_ATTRIBUTES *FvAttributes); + +typedef EFI_STATUS (EFIAPI * EFI_FV_READ_FILE) ( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + IN EFI_GUID *NameGuid, + IN OUT VOID **Buffer, + IN OUT UINTN *BufferSize, + OUT EFI_FV_FILETYPE *FoundType, + OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes, + OUT UINT32 *AuthenticationStatus); + +typedef EFI_STATUS (EFIAPI * EFI_FV_READ_SECTION) ( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + IN EFI_GUID *NameGuid, + IN EFI_SECTION_TYPE SectionType, + IN UINTN SectionInstance, + IN OUT VOID **Buffer, + IN OUT UINTN *BufferSize, + OUT UINT32 *AuthenticationStatus); + + +//************************************************************ +// EFI_FV_WRITE_POLICY +//************************************************************ +typedef UINT32 EFI_FV_WRITE_POLICY; +#define EFI_FV_UNRELIABLE_WRITE 0x00000000 +#define EFI_FV_RELIABLE_WRITE 0x00000001 + +//************************************************************ +// EFI_FV_WRITE_FILE_DATA +//************************************************************ +typedef struct { + EFI_GUID *NameGuid; + EFI_FV_FILETYPE Type; + EFI_FV_FILE_ATTRIBUTES FileAttributes; + VOID *Buffer; + UINT32 BufferSize; +} EFI_FV_WRITE_FILE_DATA; + +typedef EFI_STATUS (EFIAPI * EFI_FV_WRITE_FILE) ( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + IN UINT32 NumberOfFiles, + IN EFI_FV_WRITE_POLICY WritePolicy, + IN EFI_FV_WRITE_FILE_DATA *FileData); + +typedef EFI_STATUS (EFIAPI * EFI_FV_GET_NEXT_FILE) ( + IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, + IN OUT VOID *Key, + IN OUT EFI_FV_FILETYPE *FileType, + OUT EFI_GUID *NameGuid, + OUT EFI_FV_FILE_ATTRIBUTES *Attributes, + OUT UINTN *Size); + +//********************************************************************** +//<AMI_SHDR_START> +// +// Name: EFI_FIRMWARE_VOLUME_PROTOCOL +// +// Description: Firmware Volume Protocol for Reading/Seting Volume Attributes +// Read/Writing Files. +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// GetVolumeAttributes EFI_FV_GET_ATTRIBUTES +// SetVolumeAttributes EFI_FV_SET_ATTRIBUTES +// ReadFile EFI_FV_READ_FILE +// ReadSection EFI_FV_READ_SECTION +// WriteFile EFI_FV_WRITE_FILE +// GetNextFile EFI_FV_GET_NEXT_FILE +// KeySize UINT32 +// ParentHandle EFI_HANDLE +// +//<AMI_SHDR_END> +//********************************************************************** +typedef struct _EFI_FIRMWARE_VOLUME_PROTOCOL { + EFI_FV_GET_ATTRIBUTES GetVolumeAttributes; + EFI_FV_SET_ATTRIBUTES SetVolumeAttributes; + EFI_FV_READ_FILE ReadFile; + EFI_FV_READ_SECTION ReadSection; + EFI_FV_WRITE_FILE WriteFile; + EFI_FV_GET_NEXT_FILE GetNextFile; + UINT32 KeySize; + EFI_HANDLE ParentHandle; +} EFI_FIRMWARE_VOLUME_PROTOCOL; +#endif // #else PI_SPECIFICATION_VERSION>=0x00010000 +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/FirmwareVolume2.h b/Include/Protocol/FirmwareVolume2.h new file mode 100644 index 0000000..60e0eb4 --- /dev/null +++ b/Include/Protocol/FirmwareVolume2.h @@ -0,0 +1,260 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/FirmwareVolume2.h 1 2/05/11 2:31p Artems $ +// +// $Revision: 1 $ +// +// $Date: 2/05/11 2:31p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/FirmwareVolume2.h $ +// +// 1 2/05/11 2:31p Artems +// FirmwareVolume2 protocol definition +// +// 6 1/13/10 2:13p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: FirmwareVolume2.h +// +// Description: This file includes definition of the Firmware Volume2 Protocol +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __FIRMWARE_VOLUME2_PROTOCOL_H__ +#define __FIRMWARE_VOLUME2_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <ffs.h> + +#if PI_SPECIFICATION_VERSION<0x00010000 +#include <Protocol/FirmwareVolume.h> +#define EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID EFI_FIRMWARE_VOLUME_PROTOCOL_GUID +GUID_VARIABLE_DECLARATION(gEfiFirmwareVolume2ProtocolGuid, EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID); +typedef EFI_FIRMWARE_VOLUME_PROTOCOL EFI_FIRMWARE_VOLUME2_PROTOCOL; + +#else + +// Firmware Volume Protocol GUID definition +#define EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID \ + { 0x220e73b6, 0x6bdb, 0x4413, 0x84, 0x5, 0xb9, 0x74, 0xb1, 0x8, 0x61, 0x9a } + +GUID_VARIABLE_DECLARATION(gEfiFirmwareVolume2ProtocolGuid, EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID); + +EFI_FORWARD_DECLARATION (EFI_FIRMWARE_VOLUME2_PROTOCOL); + +typedef EFI_FIRMWARE_VOLUME2_PROTOCOL EFI_FIRMWARE_VOLUME_PROTOCOL; + +typedef UINT64 EFI_FV_ATTRIBUTES; + +// +// ************************************************************ +// EFI_FV2_ATTRIBUTES bit definitions +// ************************************************************ +// +#define EFI_FV2_READ_DISABLE_CAP 0x0000000000000001 +#define EFI_FV2_READ_ENABLE_CAP 0x0000000000000002 +#define EFI_FV2_READ_STATUS 0x0000000000000004 + +#define EFI_FV2_WRITE_DISABLE_CAP 0x0000000000000008 +#define EFI_FV2_WRITE_ENABLE_CAP 0x0000000000000010 +#define EFI_FV2_WRITE_STATUS 0x0000000000000020 + +#define EFI_FV2_LOCK_CAP 0x0000000000000040 +#define EFI_FV2_LOCK_STATUS 0x0000000000000080 +#define EFI_FV2_WRITE_POLICY_RELIABLE 0x0000000000000100 + +#define EFI_FV2_READ_LOCK_CAP 0x0000000000001000 +#define EFI_FV2_READ_LOCK_STATUS 0x0000000000002000 +#define EFI_FV2_WRITE_LOCK_CAP 0x0000000000004000 +#define EFI_FV2_WRITE_LOCK_STATUS 0x0000000000008000 +#define EFI_FV2_ALIGNMENT 0x00000000001F0000 + + +#define EFI_FV2_ALIGNMENT_1 0x0000000000000000 +#define EFI_FV2_ALIGNMENT_2 0x0000000000010000 +#define EFI_FV2_ALIGNMENT_4 0x0000000000020000 +#define EFI_FV2_ALIGNMENT_8 0x0000000000030000 +#define EFI_FV2_ALIGNMENT_16 0x0000000000040000 +#define EFI_FV2_ALIGNMENT_32 0x0000000000050000 +#define EFI_FV2_ALIGNMENT_64 0x0000000000060000 +#define EFI_FV2_ALIGNMENT_128 0x0000000000070000 +#define EFI_FV2_ALIGNMENT_256 0x0000000000080000 +#define EFI_FV2_ALIGNMENT_512 0x0000000000090000 +#define EFI_FV2_ALIGNMENT_1K 0x00000000000A0000 +#define EFI_FV2_ALIGNMENT_2K 0x00000000000B0000 +#define EFI_FV2_ALIGNMENT_4K 0x00000000000C0000 +#define EFI_FV2_ALIGNMENT_8K 0x00000000000D0000 +#define EFI_FV2_ALIGNMENT_16K 0x00000000000E0000 +#define EFI_FV2_ALIGNMENT_32K 0x00000000000F0000 +#define EFI_FV2_ALIGNMENT_64K 0x0000000000100000 +#define EFI_FV2_ALIGNMENT_128K 0x0000000000110000 +#define EFI_FV2_ALIGNMENT_256K 0x0000000000120000 +#define EFI_FV2_ALIGNMENT_512K 0x0000000000130000 +#define EFI_FV2_ALIGNMENT_1M 0x0000000000140000 +#define EFI_FV2_ALIGNMENT_2M 0x0000000000150000 +#define EFI_FV2_ALIGNMENT_4M 0x0000000000160000 +#define EFI_FV2_ALIGNMENT_8M 0x0000000000170000 +#define EFI_FV2_ALIGNMENT_16M 0x0000000000180000 +#define EFI_FV2_ALIGNMENT_32M 0x0000000000190000 +#define EFI_FV2_ALIGNMENT_64M 0x00000000001A0000 +#define EFI_FV2_ALIGNMENT_128M 0x00000000001B0000 +#define EFI_FV2_ALIGNMENT_256M 0x00000000001C0000 +#define EFI_FV2_ALIGNMENT_512M 0x00000000001D0000 +#define EFI_FV2_ALIGNMENT_1G 0x00000000001E0000 +#define EFI_FV2_ALIGNMENT_2G 0x00000000001F0000 + +#define EFI_FV_FILE_ATTRIB_FIXED 0x00000100 +#define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200 + +//************************************************************ +// EFI_FV_WRITE_POLICY +//************************************************************ +typedef UINT32 EFI_FV_WRITE_POLICY; +#define EFI_FV_UNRELIABLE_WRITE 0x00000000 +#define EFI_FV_RELIABLE_WRITE 0x00000001 + +//************************************************************ +// EFI_FV_WRITE_FILE_DATA +//************************************************************ +typedef struct { + EFI_GUID *NameGuid; + EFI_FV_FILETYPE Type; + EFI_FV_FILE_ATTRIBUTES FileAttributes; + VOID *Buffer; + UINT32 BufferSize; +} EFI_FV_WRITE_FILE_DATA; + +// +// Protocol API definitions +// + +typedef +EFI_STATUS +(EFIAPI *EFI_FV_GET_ATTRIBUTES) ( + IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This, + OUT EFI_FV_ATTRIBUTES *Attributes + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_FV_SET_ATTRIBUTES) ( + IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This, + IN OUT EFI_FV_ATTRIBUTES *Attributes + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_FV_READ_FILE) ( + IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This, + IN CONST EFI_GUID *NameGuid, + IN OUT VOID **Buffer, + IN OUT UINTN *BufferSize, + OUT EFI_FV_FILETYPE *FoundType, + OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes, + OUT UINT32 *AuthenticationStatus + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_FV_READ_SECTION) ( + IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This, + IN CONST EFI_GUID *NameGuid, + IN EFI_SECTION_TYPE SectionType, + IN UINTN SectionInstance, + IN OUT VOID **Buffer, + IN OUT UINTN *BufferSize, + OUT UINT32 *AuthenticationStatus + ); + + +typedef +EFI_STATUS +(EFIAPI *EFI_FV_WRITE_FILE) ( + IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This, + IN UINT32 NumberOfFiles, + IN EFI_FV_WRITE_POLICY WritePolicy, + IN EFI_FV_WRITE_FILE_DATA *FileData + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_FV_GET_NEXT_FILE) ( + IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This, + IN OUT VOID *Key, + IN OUT EFI_FV_FILETYPE *FileType, + OUT EFI_GUID *NameGuid, + OUT EFI_FV_FILE_ATTRIBUTES *Attributes, + OUT UINTN *Size + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_FV_GET_INFO) ( + IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This, + IN CONST EFI_GUID *InformationType, + IN OUT UINTN *BufferSize, + OUT VOID *Buffer + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_FV_SET_INFO) ( + IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This, + IN CONST EFI_GUID *InformationType, + IN UINTN BufferSize, + IN CONST VOID *Buffer + ); + + +typedef struct _EFI_FIRMWARE_VOLUME2_PROTOCOL { + EFI_FV_GET_ATTRIBUTES GetVolumeAttributes; + EFI_FV_SET_ATTRIBUTES SetVolumeAttributes; + EFI_FV_READ_FILE ReadFile; + EFI_FV_READ_SECTION ReadSection; + EFI_FV_WRITE_FILE WriteFile; + EFI_FV_GET_NEXT_FILE GetNextFile; + UINT32 KeySize; + EFI_HANDLE ParentHandle; + EFI_FV_GET_INFO GetInfo; + EFI_FV_SET_INFO SetInfo; +} EFI_FIRMWARE_VOLUME2_PROTOCOL; + + +#endif // #else PI_SPECIFICATION_VERSION<0x00010000 +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/FirmwareVolumeBlock.h b/Include/Protocol/FirmwareVolumeBlock.h new file mode 100644 index 0000000..33ef2d9 --- /dev/null +++ b/Include/Protocol/FirmwareVolumeBlock.h @@ -0,0 +1,192 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/FirmwareVolumeBlock.h 1 11/18/14 5:13a Chienhsieh $ +// +// $Revision: 1 $ +// +// $Date: 11/18/14 5:13a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/FirmwareVolumeBlock.h $ +// +// 1 11/18/14 5:13a Chienhsieh +// Update rev6. +// +// 6 2/25/13 5:35p Artems +// [TAG] EIP N/A +// [Category] Spec Update +// [Severity] Minor +// [Description] Added definition of LBA_TERMINATOR +// [Files] FirmwareVolumeBlock.h +// +// 5 6/16/11 5:33p Felixp +// FORWARD_COMPATIBLE_MODE definitions removed (they are not needed in the +// Core version of the header). +// +// 1 6/16/11 4:57p Felixp +// +// 4 6/16/11 3:33p Felixp +// Surround backward compatibility definitions with #if +// BACKWARD_COMPATIBLE_MODE +// +// 3 6/10/11 12:58p Artems +// Added backward compatibility macro definition for PI mode +// +// 2 5/27/11 5:53p Felixp +// Headers are updated to improve separation of the Framework and PI +// interfaces. +// The definitions that will be removed in the future versions are marked +// with the comments. +// +// 1 3/13/06 1:38a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 2 12/31/03 2:50p Markw +// Added S Header. +// +// 1 12/18/03 4:14p Markw +// +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: FirmwareVolumeBlock.h +// +// Description: This file is an include file used to define the Protocol for the +// Firmware Volume Block Protocol. +// +//<AMI_FHDR_END> +//***************************************************************************** +#ifndef __FIRMWARE_VOLUME_BLOCK_PROTOCOL_H__ +#define __FIRMWARE_VOLUME_BLOCK_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <FFS.h> + +#if PI_SPECIFICATION_VERSION<0x00010000 +// 0xDE28BC59-6228-41BD-BDF6-A3B9ADB58DA1 +#define FW_VOLUME_BLOCK_PROTOCOL_GUID \ + {0xDE28BC59, 0x6228, 0x41BD, 0xBD, 0xF6, 0xA3, 0xB9,0xAD,0xB5, 0x8D, 0xA1} +#define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID FW_VOLUME_BLOCK_PROTOCOL_GUID +#else +#define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \ + { 0x8f644fa9, 0xe850, 0x4db1, 0x9c, 0xe2, 0xb, 0x44, 0x69, 0x8e, 0x8d, 0xa4 } +#if BACKWARD_COMPATIBLE_MODE +#define FW_VOLUME_BLOCK_PROTOCOL_GUID EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID +#endif // BACKWARD_COMPATIBLE_MODE +#endif + +#define EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL_GUID EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID +#define EFI_LBA_LIST_TERMINATOR 0xFFFFFFFFFFFFFFFF + +GUID_VARIABLE_DECLARATION(gEfiFirmwareVolumeBlockProtocolGuid, EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID); +GUID_VARIABLE_DECLARATION(gEfiFirmwareVolumeBlock2ProtocolGuid, EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL_GUID); + +typedef struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL; +typedef EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL; + +typedef EFI_STATUS (EFIAPI * EFI_FVB_GET_ATTRIBUTES) ( + IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This, + OUT EFI_FVB_ATTRIBUTES *Attributes); + +typedef EFI_STATUS (EFIAPI * EFI_FVB_SET_ATTRIBUTES) ( + IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This, + IN OUT EFI_FVB_ATTRIBUTES *Attributes); + +typedef EFI_STATUS (EFIAPI * EFI_FVB_GET_PHYSICAL_ADDRESS) ( + IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This, + OUT EFI_PHYSICAL_ADDRESS *Address); + +typedef EFI_STATUS (EFIAPI * EFI_FVB_GET_BLOCK_SIZE) ( + IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This, + IN EFI_LBA Lba, + OUT UINTN *BlockSize, + OUT UINTN *NumberOfBlocks); + +typedef EFI_STATUS (EFIAPI *EFI_FVB_READ)( + IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This, + IN EFI_LBA Lba, + IN UINTN Offset, + IN OUT UINTN *NumBytes, + OUT UINT8 *Buffer); + +typedef EFI_STATUS (EFIAPI * EFI_FVB_WRITE) ( + IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This, + IN EFI_LBA Lba, + IN UINTN Offset, + IN OUT UINTN *NumBytes, + IN UINT8 *Buffer); + +typedef EFI_STATUS (EFIAPI * EFI_FVB_ERASE_BLOCKS) ( + IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,...); + +//********************************************************************** +//<AMI_SHDR_START> +// +// Name: EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL +// +// Description: Firmware Volume Protocol Block Gets/Sets attributes, +// reads/writes/erases blocks in the firmware volume. +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// GetAttributes EFI_FVB_GET_ATTRIBUTES +// SetAttributes EFI_FVB_SET_ATTRIBUTES +// GetPhysicalAddress EFI_FVB_GET_PHYSICAL_ADDRESS +// GetBlockSize EFI_FVB_GET_BLOCK_SIZE +// Read EFI_FVB_READ +// Write EFI_FVB_WRITE +// EraseBlocks EFI_FVB_ERASE_BLOCKS +// ParentHandle EFI_HANDLE +// +//<AMI_SHDR_END> +//********************************************************************** +typedef struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL { + EFI_FVB_GET_ATTRIBUTES GetAttributes; + EFI_FVB_SET_ATTRIBUTES SetAttributes; + EFI_FVB_GET_PHYSICAL_ADDRESS GetPhysicalAddress; + EFI_FVB_GET_BLOCK_SIZE GetBlockSize; + EFI_FVB_READ Read; + EFI_FVB_WRITE Write; + EFI_FVB_ERASE_BLOCKS EraseBlocks; + EFI_HANDLE ParentHandle; +} EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/FlashProtocol.h b/Include/Protocol/FlashProtocol.h new file mode 100644 index 0000000..b6643fd --- /dev/null +++ b/Include/Protocol/FlashProtocol.h @@ -0,0 +1,93 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/FlashProtocol.h 2 5/21/09 4:34p Felixp $ +// +// $Revision: 2 $ +// +// $Date: 5/21/09 4:34p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/FlashProtocol.h $ +// +// 2 5/21/09 4:34p Felixp +// +// 1 5/21/09 4:33p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: FlashProtocol.h +// +// Description: Flash Protocol +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __FLASH_PROTOCOL__H__ +#define __FLASH_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// {755B6596-6896-4ba3-B3DD-1C629FD1EA88} +#define FLASH_PROTOCOL_GUID \ + { 0x755b6596, 0x6896, 0x4ba3, 0xb3, 0xdd, 0x1c, 0x62, 0x9f, 0xd1, 0xea, 0x88 } + +// {ECB867AB-8DF4-492d-8150-A7FD1B9B5A75} +#define FLASH_SMM_PROTOCOL_GUID \ + { 0xecb867ab, 0x8df4, 0x492d, 0x81, 0x50, 0xa7, 0xfd, 0x1b, 0x9b, 0x5a, 0x75 } + +GUID_VARIABLE_DECLARATION(gFlashProtocolGuid,FLASH_PROTOCOL_GUID); +GUID_VARIABLE_DECLARATION(gFlashSmmProtocolGuid,FLASH_SMM_PROTOCOL_GUID); + +typedef struct _FLASH_PROTOCOL FLASH_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *FLASH_READ_WRITE)( + VOID* FlashAddress, UINTN Size, VOID* DataBuffer +); +typedef EFI_STATUS (EFIAPI *FLASH_ERASE)( + VOID* FlashAddress, UINTN Size +); +typedef EFI_STATUS (EFIAPI *FLASH_WRITE_ENABLE_DISABLE)(); + +struct _FLASH_PROTOCOL { + FLASH_READ_WRITE Read; + FLASH_ERASE Erase; + FLASH_READ_WRITE Write; //Write only + FLASH_READ_WRITE Update; //Erase if necessary + FLASH_WRITE_ENABLE_DISABLE DeviceWriteEnable; + FLASH_WRITE_ENABLE_DISABLE DeviceWriteDisable; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/FormBrowser2.h b/Include/Protocol/FormBrowser2.h new file mode 100644 index 0000000..f9e62ef --- /dev/null +++ b/Include/Protocol/FormBrowser2.h @@ -0,0 +1,106 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/FormBrowser2.h 3 10/26/09 10:46a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 10/26/09 10:46a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/FormBrowser2.h $ +// +// 3 10/26/09 10:46a Felixp +// Declaration of EFI_BROWSER_ACTION_REQUEST type and the values of the +// type are removed (they are already defined in UefiHii.h). +// +// 2 10/13/09 6:06p Felixp +// Hii.h renamed to UefiHii.h +// +// 1 10/09/09 3:52p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: FormBrowser2.h +// +// Description: Form Browser protocol header file +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __FORM_BROWSER_2__H__ +#define __FORM_BROWSER_2__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <UefiHii.h> + +#define EFI_FORM_BROWSER2_PROTOCOL_GUID \ + { 0xb9d4c360, 0xbcfb, 0x4f9b, 0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58 } + +GUID_VARIABLE_DECLARATION(gEfiFormBrowser2ProtocolGuid, EFI_FORM_BROWSER2_PROTOCOL_GUID); + +typedef struct _EFI_FORM_BROWSER2_PROTOCOL EFI_FORM_BROWSER2_PROTOCOL; + +typedef struct { + UINTN LeftColumn; + UINTN RightColumn; + UINTN TopRow; + UINTN BottomRow; +} EFI_SCREEN_DESCRIPTOR; + +typedef EFI_STATUS (EFIAPI *EFI_SEND_FORM2)( + IN CONST EFI_FORM_BROWSER2_PROTOCOL *This, + IN EFI_HII_HANDLE *Handles, + IN UINTN HandleCount, + IN EFI_GUID *FormSetGuid, OPTIONAL + IN UINT16 FormId, OPTIONAL + IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL + OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_BROWSER_CALLBACK2)( + IN CONST EFI_FORM_BROWSER2_PROTOCOL *This, + IN OUT UINTN *ResultsDataSize, + IN OUT EFI_STRING ResultsData, + IN BOOLEAN RetrieveData, + IN CONST EFI_GUID *VariableGuid, OPTIONAL + IN CONST CHAR16 *VariableName OPTIONAL +); + +struct _EFI_FORM_BROWSER2_PROTOCOL { + EFI_SEND_FORM2 SendForm; + EFI_BROWSER_CALLBACK2 BrowserCallback; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/FormCallBack.h b/Include/Protocol/FormCallBack.h new file mode 100644 index 0000000..7aeddea --- /dev/null +++ b/Include/Protocol/FormCallBack.h @@ -0,0 +1,108 @@ +#ifndef __FORM_CALLBACK_PROTOCOL_H__ +#define __FORM_CALLBACK_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#if EFI_SPECIFICATION_VERSION>0x20000 && !defined(GUID_VARIABLE_DEFINITION) +#pragma message("The EFI_FORM_CALLBACK_PROTOCOL protocol is only supported for the UEFI 2.0 projects") +#pragma message("UEFI 2.1 projects must use HiiConfigAccess.h header instead") +#pragma message("The supported version of the UEFI specification is defined by the EFI_SPECIFICATION_VERSION SDL token") +#error the protocol is depricated +#else +#include <EFI.h> + +#define EFI_FORM_CALLBACK_PROTOCOL_GUID \ + { 0xf3e4543d, 0xcf35, 0x6cef, 0x35, 0xc4, 0x4f, 0xe6, 0x34, 0x4d, 0xfc, 0x54 } + +GUID_VARIABLE_DECLARATION(gEfiFormCallbackProtocolGuid,EFI_FORM_CALLBACK_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <Protocol/Hii.h> + +typedef struct _EFI_FORM_CALLBACK_PROTOCOL EFI_FORM_CALLBACK_PROTOCOL; + +//This flags are different from IFR Flags +#define RESET_REQUIRED 1 //callback operation resulted in an eventual reset to be done upon exit of the browser +#define EXIT_REQUIRED 2 //after the processing of the callback results - exit the browser +#define SAVE_REQUIRED 4 //after the processing of the callback results - save the NV data +#define NV_CHANGED 8 //processing of the callback results - turn the NV flag on +#define NV_NOT_CHANGED 16 //after the processing of the callback results - turn the NV flag off + +#pragma pack(push, 1) + +typedef struct _EFI_IFR_PACKET { + EFI_HII_IFR_PACK *IfrData; + EFI_HII_STRING_PACK *StringData; +} EFI_IFR_PACKET; + +typedef struct _IFR_DATA_HDR{ + UINT8 OpCode; //string, numeric, one-of, check box or text + UINT8 Length; //length of the EFI_IFR_DATA_ENTRY packet + UINT16 Flags; //Flags settings see above +} IFR_DATA_HDR; + +typedef struct { + IFR_DATA_HDR Header; + UINT8 Data[1]; //The data in the form based on the op-code type +// If the OpCode is a OneOf or Numeric type - Data is a UINT16 value +// If the OpCode is a String type - Data is a CHAR16[x] type +// If the OpCode is a Checkbox type - Data is a UINT8 value +// If the OpCode is a NV Access type - Data is a EFI_IFR_NV_DATA structure +} EFI_IFR_DATA; + + +typedef struct { + UINT8 *NvRamMap; // If the flag of the op-code specified retrieval of a copy of the NVRAM map, + // this is a pointer to a buffer copy + UINT32 EntryCount; // Number of EFI_IFR_DATA_ENTRY entries + EFI_IFR_DATA Data[1]; // Data entries. +} EFI_IFR_DATA_ARRAY; + + +typedef union { + EFI_IFR_DATA_ARRAY DataArray; // Primarily used by those who call back to their drivers and use HII as a repository + EFI_IFR_PACKET DataPacket; // Primarily used by those which do not use HII as a repository + CHAR16 String[1]; // If returning an error - fill the string with null-terminated contents +} EFI_HII_CALLBACK_PACKET; + +#pragma pack(pop) + +// The following are a Callback Protocol functions +typedef EFI_STATUS (EFIAPI *EFI_FORM_CALLBACK) ( + IN EFI_FORM_CALLBACK_PROTOCOL *This, + IN UINT16 KeyValue, + IN EFI_IFR_DATA_ARRAY *Data, + OUT EFI_HII_CALLBACK_PACKET **Packet ); + + +typedef EFI_STATUS (EFIAPI *EFI_NV_READ) ( + IN EFI_FORM_CALLBACK_PROTOCOL *This, + IN CHAR16 *VariableName, + IN EFI_GUID *VendorGuid, + OUT UINT32 *Attributes OPTIONAL, + IN OUT UINTN *DataSize, + OUT VOID *Buffer ); + +typedef EFI_STATUS (EFIAPI *EFI_NV_WRITE) ( + IN EFI_FORM_CALLBACK_PROTOCOL *This, + IN CHAR16 *VariableName, + IN EFI_GUID *VendorGuid, + IN UINT32 Attributes, + IN UINTN DataSize, + IN VOID *Buffer, + OUT BOOLEAN *ResetRequired); + + +//the FormCallback Protocol structure +typedef struct _EFI_FORM_CALLBACK_PROTOCOL { + EFI_NV_READ NvRead; + EFI_NV_WRITE NvWrite; + EFI_FORM_CALLBACK Callback; +} EFI_FORM_CALLBACK_PROTOCOL; +#endif // #if EFI_SPECIFICATION_VERSION>0x20000 +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif
\ No newline at end of file diff --git a/Include/Protocol/GraphicsOutput.h b/Include/Protocol/GraphicsOutput.h new file mode 100644 index 0000000..ffb6b04 --- /dev/null +++ b/Include/Protocol/GraphicsOutput.h @@ -0,0 +1,151 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2006, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/GraphicsOutput.h 1 12/20/06 1:45p Felixp $ +// +// $Revision: 1 $ +// +// $Date: 12/20/06 1:45p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/GraphicsOutput.h $ +// +// 1 12/20/06 1:45p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: GraphicsOutput.h +// +// Description: EFI_GRAPHICS_OUTPUT_PROTOCOL protocol declaration +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __EFI_GRAPHICS_OUTPUT_PROTOCOL__H__ +#define __EFI_GRAPHICS_OUTPUT_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + +#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ + { 0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } + +GUID_VARIABLE_DECLARATION (gEfiGraphicsOutputProtocolGuid, EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID); + +typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL; + +typedef struct { + UINT32 RedMask; + UINT32 GreenMask; + UINT32 BlueMask; + UINT32 ReservedMask; +} EFI_PIXEL_BITMASK; + +typedef enum { + PixelRedGreenBlueReserved8BitPerColor, + PixelBlueGreenRedReserved8BitPerColor, + PixelBitMask, + PixelBltOnly, + PixelFormatMax +} EFI_GRAPHICS_PIXEL_FORMAT; + +typedef struct { + UINT32 Version; + UINT32 HorizontalResolution; + UINT32 VerticalResolution; + EFI_GRAPHICS_PIXEL_FORMAT PixelFormat; + EFI_PIXEL_BITMASK PixelInformation; + UINT32 PixelsPerScanLine; +} EFI_GRAPHICS_OUTPUT_MODE_INFORMATION; + +typedef EFI_STATUS (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE)( + IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, + IN UINT32 ModeNumber, + OUT UINTN *SizeOfInfo, + OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info +); + +typedef EFI_STATUS (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE)( + IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, + IN UINT32 ModeNumber +); + +typedef struct { + UINT8 Blue; + UINT8 Green; + UINT8 Red; + UINT8 Reserved; +} EFI_GRAPHICS_OUTPUT_BLT_PIXEL; + +typedef union { + EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel; + UINT32 Raw; +} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION; + +typedef enum { + EfiBltVideoFill, + EfiBltVideoToBltBuffer, + EfiBltBufferToVideo, + EfiBltVideoToVideo, + EfiGraphicsOutputBltOperationMax +} EFI_GRAPHICS_OUTPUT_BLT_OPERATION; + +typedef EFI_STATUS (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) ( + IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, + IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL, + IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, + IN UINTN SourceX, IN UINTN SourceY, + IN UINTN DestinationX, IN UINTN DestinationY, + IN UINTN Width, IN UINTN Height, + IN UINTN Delta OPTIONAL +); + +typedef struct { + UINT32 MaxMode; + UINT32 Mode; + EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info; + UINTN SizeOfInfo; + EFI_PHYSICAL_ADDRESS FrameBufferBase; + UINTN FrameBufferSize; +} EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE; + +struct _EFI_GRAPHICS_OUTPUT_PROTOCOL { + EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode; + EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode; + EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt; + EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (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/Include/Protocol/GuidedSectionExtraction.h b/Include/Protocol/GuidedSectionExtraction.h new file mode 100644 index 0000000..1f512d5 --- /dev/null +++ b/Include/Protocol/GuidedSectionExtraction.h @@ -0,0 +1,103 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/GuidedSectionExtraction.h 2 3/13/06 1:40a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 3/13/06 1:40a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/GuidedSectionExtraction.h $ +// +// 2 3/13/06 1:40a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 2 12/31/03 2:53p Markw +// Added S-Header. +// +// 1 12/24/03 1:59p Markw +// +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: GuidedSectionExtraction.h +// +// Description: This file is an include file used to define the Protocol for the +// Guided Section Extraction Protocol. It is used for GUID processing +// for the Firmware Volume. +// +//<AMI_FHDR_END> +//***************************************************************************** + +#ifndef __GUIDED_SECTION_EXTRACTION_PROTOCOL_H__ +#define __GUIDED_SECTION_EXTRACTION_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_EXTRACT_GUIDED_SECTION)( + IN EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This, + IN VOID *InputSection, + OUT VOID **OutputBuffer, + OUT UINTN *OutputSize, + OUT UINT32 *AuthenticationStatus); + +//********************************************************************** +//<AMI_SHDR_START> +// +// Name: EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL +// +// Description: Provide proccessing for extracting a Guided Section. +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// ExtractSection EFI_EXTRACT_GUIDED_SECTION +// +//<AMI_SHDR_END> +//********************************************************************** +typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL { + EFI_EXTRACT_GUIDED_SECTION ExtractSection; +} EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/HII.h b/Include/Protocol/HII.h new file mode 100644 index 0000000..4c27e3f --- /dev/null +++ b/Include/Protocol/HII.h @@ -0,0 +1,1009 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/HII.h 11 10/14/09 10:24p Felixp $Revision: 14 $ +// +// $Date: 10/14/09 10:24p $ +//********************************************************************** +// Revision History +// ---------------- +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: Hii.h +// +// Description: This file defines the Human Interface Infrastructure protocol +// which will be used by resources which want to publish +// IFR/Font/String data and have it collected by the +// Configuration engine. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __HII_PROTOCOL_H__ +#define __HII_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +/****** DO NOT WRITE ABOVE THIS LINE *******/ +#if EFI_SPECIFICATION_VERSION>0x20000 && !defined(GUID_VARIABLE_DEFINITION) +#pragma message("The Include\\Hii.h header contains UEFI 2.0 definitions") +#pragma message("UEFI 2.1 projects must use different set of headers:") +#pragma message("\tfor generic HII definitions use: UefiHii.h") +#pragma message("\tfor HII database operations use: Protocol\\HiiDatabase.h") +#pragma message("\tfor HII string operations use: Protocol\\HiiString.h") +#pragma message("The supported version of the UEFI specification is defined by the EFI_SPECIFICATION_VERSION SDL token") +#error the header is depricated +#else +//====================================================================== +#include <EFI.h> + +#define EFI_HII_OLD_PROTOCOL_GUID \ + { 0xcd361957, 0xafbe, 0x425e, 0xa3, 0x58, 0x5f, 0x58, 0x89, 0xcf, 0xfe, 0x7b } +#define EFI_HII_NEW_PROTOCOL_GUID \ + { 0xea816d2c, 0xcee5, 0x4f02, 0x99, 0xb5, 0xd3, 0x90, 0x5c, 0xbb, 0xd0, 0x77 } +#define EFI_HII_PROTOCOL_GUID EFI_HII_NEW_PROTOCOL_GUID + +GUID_VARIABLE_DECLARATION(gEfiHiiProtocolGuid,EFI_HII_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <Protocol/UgaDraw.h> + +typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL; + +//====================================================================== +// Global definition +//====================================================================== + +//====================================================================== +// Defined Type values +#define EFI_HII_FONT 1 +#define EFI_HII_STRING 2 +#define EFI_HII_IFR 3 +#define EFI_HII_KEYBOARD 4 +#define EFI_HII_HANDLES 5 +#define EFI_HII_VARIABLE 6 //not in current spec +#define EFI_HII_DEVICE_PATH 7 //not in current spec + + +//Unicode Char const +//#define NARROW_CHAR 0xFFF0 +//#define WIDE_CHAR 0xFFF1 +//#define NON_BREAKING_CHAR 0xFFF2 + + +//Gliph const +#define GLYPH_W 8 +#define GLYPH_H 19 + + +typedef UINT16 EFI_FORM_ID; +typedef UINT16 EFI_FORM_LABEL; +typedef UINT16 EFI_HII_HANDLE; + +// Glyph Attributes +#define GLYPH_NON_SPACING 1 +#define GLYPH_WIDE 2 + +// String attributes +#define LANG_RIGHT_TO_LEFT 1 + +//String releated definitions +typedef UINT32 RELOFST; +typedef UINT16 STRING_REF; +typedef CHAR16 *EFI_STRING; + +//IFR releated definitions +#define EFI_IFR_FORM_OP 0x01 +#define EFI_IFR_SUBTITLE_OP 0x02 +#define EFI_IFR_TEXT_OP 0x03 +#define EFI_IFR_GRAPHIC_OP 0x04 +#define EFI_IFR_ONE_OF_OP 0x05 +#define EFI_IFR_CHECKBOX_OP 0x06 +#define EFI_IFR_NUMERIC_OP 0x07 +#define EFI_IFR_PASSWORD_OP 0x08 +#define EFI_IFR_ONE_OF_OPTION_OP 0x09 // ONEOF OPTION field +#define EFI_IFR_SUPPRESS_IF_OP 0x0A +#define EFI_IFR_END_FORM_OP 0x0B +#define EFI_IFR_HIDDEN_OP 0x0C +#define EFI_IFR_END_FORM_SET_OP 0x0D +#define EFI_IFR_FORM_SET_OP 0x0E +#define EFI_IFR_REF_OP 0x0F +#define EFI_IFR_END_ONE_OF_OP 0x10 +#define EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP +#define EFI_IFR_INCONSISTENT_IF_OP 0x11 +#define EFI_IFR_EQ_ID_VAL_OP 0x12 +#define EFI_IFR_EQ_ID_ID_OP 0x13 +#define EFI_IFR_EQ_ID_LIST_OP 0x14 +#define EFI_IFR_AND_OP 0x15 +#define EFI_IFR_OR_OP 0x16 +#define EFI_IFR_NOT_OP 0x17 +#define EFI_IFR_END_IF_OP 0x18 // for endif of inconsistentif, suppressif, grayoutif +#define EFI_IFR_GRAYOUT_IF_OP 0x19 +#define EFI_IFR_DATE_OP 0x1A +#define EFI_IFR_TIME_OP 0x1B +#define EFI_IFR_STRING_OP 0x1C +#define EFI_IFR_LABEL_OP 0x1D +#define EFI_IFR_SAVE_DEFAULTS_OP 0x1E +#define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F +#define EFI_IFR_BANNER_OP 0x20 +#define EFI_IFR_INVENTORY_OP 0x21 +#define EFI_IFR_EQ_VAR_VAL_OP 0x22 +#define EFI_IFR_ORDERED_LIST_OP 0x23 +#define EFI_IFR_VARSTORE_OP 0x24 +#define EFI_IFR_VARSTORE_SELECT_OP 0x25 +#define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26 +#define EFI_IFR_LAST_OPCODE EFI_IFR_VARSTORE_SELECT_PAIR_OP +#define EFI_IFR_NV_ACCESS_COMMAND 0xFF + +//Values for the flags fields in some VFR opcodes +#define EFI_IFR_FLAG_DEFAULT 0x01 +#define EFI_IFR_FLAG_MANUFACTURING 0x02 +#define EFI_IFR_FLAG_INTERACTIVE 0x04 +#define EFI_IFR_FLAG_NV_ACCESS 0x08 +#define EFI_IFR_FLAG_RESET_REQUIRED 0x10 +#define EFI_IFR_FLAG_LATE_CHECK 0x20 +#define EFI_IFR_FLAG_CREATED 0x80 // Used to flag dynamically created op-codes. + +#define EFI_NON_DEVICE_CLASS 0x00 // Useful when you do not want something in the Device Manager +#define EFI_DISK_DEVICE_CLASS 0x01 +#define EFI_VIDEO_DEVICE_CLASS 0x02 +#define EFI_NETWORK_DEVICE_CLASS 0x04 +#define EFI_INPUT_DEVICE_CLASS 0x08 +#define EFI_ON_BOARD_DEVICE_CLASS 0x10 +#define EFI_OTHER_DEVICE_CLASS 0x20 + +#define EFI_SETUP_APPLICATION_SUBCLASS 0x00 +#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01 +#define EFI_FRONT_PAGE_SUBCLASS 0x02 +#define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit + +#define EFI_IFR_BANNER_ALIGN_LEFT 0 +#define EFI_IFR_BANNER_ALIGN_CENTER 1 +#define EFI_IFR_BANNER_ALIGN_RIGHT 2 +#define EFI_IFR_BANNER_TIMEOUT 0xFF + +//---------------------------------------------------------------------------- +// Modifier values + +#define EFI_NULL_MODIFIER 0x0000 +#define EFI_LEFT_CONTROL_MODIFIER 0x0001 +#define EFI_RIGHT_CONTROL_MODIFIER 0x0002 +#define EFI_LEFT_ALT_MODIFIER 0x0003 +#define EFI_RIGHT_ALT_MODIFIER 0x0004 +#define EFI_ALT_GR_MODIFIER 0x0005 +#define EFI_INSERT_MODIFIER 0x0006 +#define EFI_DELETE_MODIFIER 0x0007 +#define EFI_PAGE_DOWN_MODIFIER 0x0008 +#define EFI_PAGE_UP_MODIFIER 0x0009 +#define EFI_HOME_MODIFIER 0x000A +#define EFI_END_MODIFIER 0x000B +#define EFI_LEFT_SHIFT_MODIFIER 0x000C +#define EFI_RIGHT_SHIFT_MODIFIER 0x000D +#define EFI_CAPS_LOCK_MODIFIER 0x000E +#define EFI_NUM_LOCK_MODIFIER 0x000F +#define EFI_LEFT_ARROW_MODIFIER 0x0010 +#define EFI_RIGHT_ARROW_MODIFIER 0x0011 +#define EFI_DOWN_ARROW_MODIFIER 0x0012 +#define EFI_UP_ARROW_MODIFIER 0X0013 +#define EFI_DEAD_KEY_MODIFIER 0x0014 +#define EFI_DEAD_KEY_DEPENDENCY_MODIFIER 0x0015 +#define EFI_FUNCTION_KEY_ONE_MODIFIER 0x0016 +#define EFI_FUNCTION_KEY_TWO_MODIFIER 0x0017 +#define EFI_FUNCTION_KEY_THREE_MODIFIER 0x0018 +#define EFI_FUNCTION_KEY_FOUR_MODIFIER 0x0019 +#define EFI_FUNCTION_KEY_FIVE_MODIFIER 0x001A +#define EFI_FUNCTION_KEY_SIX_MODIFIER 0x001B +#define EFI_FUNCTION_KEY_SEVEN_MODIFIER 0x001C +#define EFI_FUNCTION_KEY_EIGHT_MODIFIER 0x001D +#define EFI_FUNCTION_KEY_NINE_MODIFIER 0x001E +#define EFI_FUNCTION_KEY_TEN_MODIFIER 0x001F +#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020 +#define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021 + +// Keys that have multiple control functions based on modifier +// settings are handled in the keyboard driver implementation. +// For instance PRINT_KEY might have a modifier held down and +// is still a nonprinting character, but might have an alternate +// control function like SYSREQUEST + +#define EFI_PRINT_MODIFIER 0x0022 +#define EFI_SYS_REQUEST_MODIFIER 0x0023 +#define EFI_SCROLL_LOCK_MODIFIER 0x0024 +#define EFI_PAUSE_MODIFIER 0x0025 +#define EFI_BREAK_MODIFIER 0x0026 + +// Keyboard layout switching modifiers +// This assumes that the driver implementation will not +// assign a key definition if one of the following modifier +// values is presented. + +#define EFI_LAYOUT_SWITCH_MODIFIER 0x0027 +#define EFI_LAYOUT_SWITCH_DEPENDENCY_MODIFIER 0x0028 + + +//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#pragma pack(push, 1) //must be 1 +//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +//====================================================================== +//Packages +typedef struct _EFI_HII_PACK_HEADER { + UINT32 Length; + UINT16 Type; +} EFI_HII_PACK_HEADER; + + +//******************************************************** +// EFI_HII_HANDLE_PACK +//******************************************************** +typedef struct _EFI_HII_HANDLE_PACK{ + EFI_HII_PACK_HEADER Header; // Must be filled in + EFI_HANDLE ImageHandle; // Must be filled in + EFI_HANDLE DeviceHandle; // Optional + EFI_HANDLE ControllerHandle; // Optional + EFI_HANDLE CallbackHandle; // Optional +} EFI_HII_HANDLE_PACK; + + +typedef struct EFI_HII_PACKAGES { +//TODO: HII Spec. 0.92 defines NumberOfPackages as UINT32 +//However, EDK header defines it as UINTN +//Should we be compatible with the spec or with EDK? +//For now, we are choosing EDK +// UINT32 NumberOfPackages; + UINTN NumberOfPackages; + EFI_GUID *GuidId; +// EFI_HII_HANDLE_PACK *HandlePack; + +} EFI_HII_PACKAGES; + + +//====================================================================== +// EFI_HII_IFR_PACK +//====================================================================== +typedef struct { + EFI_HII_PACK_HEADER Header; +} EFI_HII_IFR_PACK; + +//====================================================================== +// EFI_HII_VARIABLE_PACK +//====================================================================== +typedef struct { + EFI_HII_PACK_HEADER Header; + EFI_GUID VariableGuid; + UINT32 VariableNameLength; + UINT16 VariableId; +// CHAR16 VariableName[]; //Null-terminated +} EFI_HII_VARIABLE_PACK; + +//====================================================================== +// EFI_HII_VARIABLE_PACK_LIST +//====================================================================== +typedef struct _EFI_HII_VARIABLE_PACK_LIST { + struct _EFI_HII_VARIABLE_PACK_LIST *NextVariablePack; + EFI_HII_VARIABLE_PACK *VariablePack; +//Per implementation but better to gave it anywhere in the memory. + //EFI_HII_VARIABLE_PACK Content // +} EFI_HII_VARIABLE_PACK_LIST; + + +//====================================================================== +// EFI_DEVICE_PATH_PACK +//====================================================================== +typedef struct { + EFI_HII_PACK_HEADER Header; +// EFI_DEVICE_PATH DevicePath[]; +} EFI_HII_DEVICE_PATH_PACK; + +//====================================================================== +// EFI_HII_DATA_TABLE +//====================================================================== +typedef struct { + EFI_HII_HANDLE HiiHandle; + EFI_GUID PackageGuid; + UINT32 DataTableSize; + UINT32 IfrDataOffset; + UINT32 StringDataOffset; + UINT32 VariableDataOffset; + UINT32 DevicePathOffset; + UINT32 NumberOfVariableData; + UINT32 NumberOfLanguages; + //EFI_HII_DEVICE_PATH_PACK DevicePath[]; + //EFI_HII_VARIABLE_PACK VariableData[]; + //EFI_HII_IFR_PACK IfrData; + //EFI_HII_STRING_PACK StringData[]; +} EFI_HII_DATA_TABLE; + +//====================================================================== +// EFI_HII_EXPORT_TABLE +//====================================================================== +typedef struct { +//HII .91 spec defines following field as UINT32 but Intel's R8 implememtation still +//using UINT16 value. To be Compliant with ITK, I'll leave this field as UINT16 +//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO +// uncomment this and comment next line +// UINT32 NumberOfHiiDataTables; +//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO + UINT16 NumberOfHiiDataTables; + EFI_GUID Revision; + //EFI_HII_DATA_TABLE HiiDataTable[]; +} EFI_HII_EXPORT_TABLE; + +//====================================================================== +typedef struct { + BOOLEAN FormSetUpdate; // If TRUE, next variable is significant + EFI_PHYSICAL_ADDRESS FormCallbackHandle; // If not 0, will update Formset with this info + BOOLEAN FormUpdate; // If TRUE, next variable is significant +//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO + //to maintain compatibility with Intel's Setup I changed this + //Intel doesnot have this field included in Sources but they does in Spec?????????? + //UINT16 FormValue; // Which Form to be Updated if FormUpdate=TRUE; +//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO + STRING_REF FormTitle; // If not 0, will update Form with this info + UINT16 DataCount; // The number of Data entries in this structure + UINT8 *Data; // An array of 1+ op-codes, specified by DataCount +} EFI_HII_UPDATE_DATA; + +//====================================================================== +// A string package is used to localize strings to a particular +// language. The package is associated with a particular driver +// or set of drivers. Tools are used to associate tokens with +// string references in forms and in programs. These tokens are +// language agnostic. When paired with a language pack (directly +// or indirectly), the string token resolves into an actual +// UNICODE string. The NumStringPointers determines how many +// StringPointers (offset values) there are as well as the total +// number of Strings that are defined. +typedef struct { + EFI_HII_PACK_HEADER Header; + RELOFST LanguageNameString; + RELOFST PrintableLanguageName; + UINT32 NumStringPointers; + UINT32 Attributes; +// RELOFST StringPointers[]; +// EFI_STRING Strings[]; +} EFI_HII_STRING_PACK; + +//====================================================================== + +typedef struct { + CHAR16 UnicodeWeight; + UINT8 Attributes; + UINT8 GlyphCol1[GLYPH_H]; +} EFI_NARROW_GLYPH; + +typedef struct { + CHAR16 UnicodeWeight; + UINT8 Attributes; + UINT8 GlyphCol1[GLYPH_H]; + UINT8 GlyphCol2[GLYPH_H]; + UINT8 Pad[3]; +} EFI_WIDE_GLYPH; + +//====================================================================== +// A font list consists of a font header followed by a series +// of glyph structures. Note that fonts are not language specific. +typedef struct { + EFI_HII_PACK_HEADER Header; + UINT16 NumberOfNarrowGlyphs; + UINT16 NumberOfWideGlyphs; +} EFI_HII_FONT_PACK; + +//====================================================================== +// Keyboard Keys Definition +typedef enum { + EfiKeyLCtrl, EfiKeyA0, EfiKeyLAlt, EfiKeySpaceBar, + EfiKeyA2, EfiKeyA3, EfiKeyA4, EfiKeyRCtrl, EfiKeyLeftArrow, + EfiKeyDownArrow, EfiKeyRightArrow, EfiKeyZero, + EfiKeyPeriod, EfiKeyEnter, EfiKeyLShift, EfiKeyB0, + EfiKeyB1, EfiKeyB2, EfiKeyB3, EfiKeyB4, EfiKeyB5, EfiKeyB6, + EfiKeyB7, EfiKeyB8, EfiKeyB9, EfiKeyB10, EfiKeyRshift, + EfiKeyUpArrow, EfiKeyOne, EfiKeyTwo, EfiKeyThree, + EfiKeyCapsLock, EfiKeyC1, EfiKeyC2, EfiKeyC3, EfiKeyC4, + EfiKeyC5, EfiKeyC6, EfiKeyC7, EfiKeyC8, EfiKeyC9, + EfiKeyC10, EfiKeyC11, EfiKeyC12, EfiKeyFour, EfiKeyFive, + EfiKeySix, EfiKeyPlus, EfiKeyTab, EfiKeyD1, EfiKeyD2, + EfiKeyD3, EfiKeyD4, EfiKeyD5, EfiKeyD6, EfiKeyD7, EfiKeyD8, + EfiKeyD9, EfiKeyD10, EfiKeyD11, EfiKeyD12, EfiKeyD13, + EfiKeyDel, EfiKeyEnd, EfiKeyPgDn, EfiKeySeven, EfiKeyEight, + EfiKeyNine, EfiKeyE0, EfiKeyE1, EfiKeyE2, EfiKeyE3, + EfiKeyE4, EfiKeyE5, EfiKeyE6, EfiKeyE7, EfiKeyE8, EfiKeyE9, + EfiKeyE10, EfiKeyE11, EfiKeyE12, EfiKeyBackSpace, + EfiKeyIns, EfiKeyHome, EfiKeyPgUp, EfiKeyNLck, EfiKeySlash, + EfiKeyAsterisk, EfiKeyMinus, EfiKeyEsc, EfiKeyF1, EfiKeyF2, + EfiKeyF3, EfiKeyF4, EfiKeyF5, EfiKeyF6, EfiKeyF7, EfiKeyF8, + EfiKeyF9, EfiKeyF10, EfiKeyF11, EfiKeyF12, EfiKeyPrint, + EfiKeySLck, EfiKeyPause +} EFI_KEY; + +typedef struct { + EFI_KEY Key; + CHAR16 Unicode; + CHAR16 ShiftedUnicode; + CHAR16 AltGrUnicode; + CHAR16 ShiftedAltGrUnicode; + UINT16 Modifier; +} EFI_KEY_DESCRIPTOR; + +//====================================================================== +// This structure allows a sparse set of keys to be redefined +// or a complete redefinition of the keyboard layout. Most +// keyboards have a lot of commonality in their layouts, therefore +// only defining those keys that need to change from the default +// minimizes the passed in information. +// +// Additionally, when an update occurs, the active keyboard layout +// will be switched to the newly updated keyboard layout. This +// allows for situations that when a keyboard layout driver is +// loaded as part of system initialization, the system will default +// the keyboard behavior to the new layout. +// +// Each call to update the keyboard mapping should contain the +// complete set of key descriptors to be updated, since every +// call to the HII which contains an EFI_HII_KEYBOARD_PACK will +// wipe the previous set of overrides. A call to +// +typedef struct { + EFI_HII_PACK_HEADER Header; + EFI_KEY_DESCRIPTOR *Descriptor; + UINT8 DescriptorCount; +} EFI_HII_KEYBOARD_PACK; + + + +// The StringPack is a pointer to a series of EFI_HII_STRING_PACK structures. +// The terminating instance of this structure will be a NULL entry. + + +//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO +//Not actual anymore is been replaced by EFI_HII_PACKAGES structure below +typedef struct { + EFI_HII_IFR_PACK *IfrPack; + EFI_HII_FONT_PACK *FontPack; + EFI_HII_STRING_PACK *StringPack; + EFI_HII_KEYBOARD_PACK *KeyboardPack; + EFI_GUID *GuidId; +} EFI_HII_PACK_LIST; + + +//====================================================================== +// IFR Structure definitions +typedef struct { + UINT8 OpCode; + UINT8 Length; +} EFI_IFR_OP_HEADER; + +typedef struct { + EFI_IFR_OP_HEADER Header; + EFI_GUID Guid; + STRING_REF FormSetTitle; + STRING_REF Help; + EFI_PHYSICAL_ADDRESS CallbackHandle; + UINT16 Class; + UINT16 SubClass; + UINT16 NvDataSize; // set once, size of the NV data as defined in the script +} EFI_IFR_FORM_SET; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 FormId; + STRING_REF FormTitle; +} EFI_IFR_FORM; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 LabelId; +} EFI_IFR_LABEL; + +typedef struct { + EFI_IFR_OP_HEADER Header; + STRING_REF SubTitle; +} EFI_IFR_SUBTITLE; + +typedef struct { + EFI_IFR_OP_HEADER Header; + STRING_REF Help; + STRING_REF Text; + STRING_REF TextTwo; + UINT8 Flags; // This is included solely for purposes of interactive/dynamic support. + UINT16 Key; // Value to be passed to caller to identify this particular op-code +} EFI_IFR_TEXT; + +// +// goto +// +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 FormId; + STRING_REF Prompt; + STRING_REF Help; // The string Token for the context-help + UINT8 Flags; // This is included solely for purposes of interactive/dynamic support. + UINT16 Key; // Value to be passed to caller to identify this particular op-code +} EFI_IFR_REF; + +typedef struct { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_END_FORM; + +typedef struct { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_END_FORM_SET; + +// +// Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......code assumes this to be true, if this ever +// changes we need to revisit the InitializeTagStructures code +// +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name + UINT8 Width; // The Size of the Data being saved + STRING_REF Prompt; // The String Token for the Prompt + STRING_REF Help; // The string Token for the context-help +} EFI_IFR_ONE_OF; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; // The offset in NV for storage of the data + UINT8 MaxEntries; // The maximum number of options in the ordered list (=size of NVStore) + STRING_REF Prompt; // The string token for the prompt + STRING_REF Help; // The string token for the context-help +} EFI_IFR_ORDERED_LIST; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name + UINT8 Width; // The Size of the Data being saved + STRING_REF Prompt; // The String Token for the Prompt + STRING_REF Help; // The string Token for the context-help + UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely + UINT16 Key; // Value to be passed to caller to identify this particular op-code +} EFI_IFR_CHECK_BOX; + +typedef struct { + EFI_IFR_OP_HEADER Header; + STRING_REF Option; // The string token describing the option + UINT16 Value; // The value associated with this option that is stored in the NVRAM if chosen + UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely above + UINT16 Key; // Value to be passed to caller to identify this particular op-code +} EFI_IFR_ONE_OF_OPTION; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name + UINT8 Width; // The Size of the Data being saved + STRING_REF Prompt; // The String Token for the Prompt + STRING_REF Help; // The string Token for the context-help + UINT8 Flags; // This is included solely for purposes of interactive/dynamic support. + UINT16 Key; // Value to be passed to caller to identify this particular op-code + UINT16 Minimum; + UINT16 Maximum; + UINT16 Step; // If step is 0, then manual input is specified, otherwise, left/right arrow selection is called for + UINT16 Default; +} EFI_IFR_NUMERIC; + +// +// There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input from +// a user, however may or may not need to use storage in the NVRAM space. The decided method for determining if NVRAM space +// will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an impossibility) then use system +// resources to store the data away and not NV resources. In other words, the setup engine will call gRT->SetTime, and gRT->SetDate +// for the saving of data, and the values displayed will be from the gRT->GetXXXX series of calls. +// +typedef struct { + EFI_IFR_NUMERIC Hour; + EFI_IFR_NUMERIC Minute; + EFI_IFR_NUMERIC Second; +} EFI_IFR_TIME; + +typedef struct { + EFI_IFR_NUMERIC Year; + EFI_IFR_NUMERIC Month; + EFI_IFR_NUMERIC Day; +} EFI_IFR_DATE; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name + UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday + STRING_REF Prompt; // The String Token for the Prompt + STRING_REF Help; // The string Token for the context-help + UINT8 Flags; // This is included solely for purposes of interactive/dynamic support. + UINT16 Key; // Value to be passed to caller to identify this particular op-code + UINT8 MinSize; // Minimum allowable sized password + UINT8 MaxSize; // Maximum allowable sized password + UINT16 Encoding; +} EFI_IFR_PASSWORD; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name + UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday + STRING_REF Prompt; // The String Token for the Prompt + STRING_REF Help; // The string Token for the context-help + UINT8 Flags; // This is included solely for purposes of interactive/dynamic support. + UINT16 Key; // Value to be passed to caller to identify this particular op-code + UINT8 MinSize; // Minimum allowable sized password + UINT8 MaxSize; // Maximum allowable sized password +} EFI_IFR_STRING; + +typedef struct { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_END_ONE_OF; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 Value; + UINT16 Key; +} EFI_IFR_HIDDEN; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT8 Flags; +} EFI_IFR_SUPPRESS; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT8 Flags; +} EFI_IFR_GRAYOUT; + +typedef struct { + EFI_IFR_OP_HEADER Header; + STRING_REF Popup; + UINT8 Flags; +} EFI_IFR_INCONSISTENT; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; // offset into variable storage + UINT8 Width; // size of variable storage + UINT16 Value; // value to compare against +} EFI_IFR_EQ_ID_VAL; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; // offset into variable storage + UINT8 Width; // size of variable storage + UINT16 ListLength; + UINT16 ValueList[1]; +} EFI_IFR_EQ_ID_LIST; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 QuestionId1; // offset into variable storage for first value to compare + UINT8 Width; // size of variable storage (must be same for both) + UINT16 QuestionId2; // offset into variable storage for second value to compare +} EFI_IFR_EQ_ID_ID; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 VariableId; // offset into variable storage + UINT16 Value; // value to compare against +} EFI_IFR_EQ_VAR_VAL; + +typedef struct { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_AND; + +typedef struct { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_OR; + +typedef struct { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_NOT; + +typedef struct { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_END_IF; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 FormId; + STRING_REF Prompt; + STRING_REF Help; + UINT8 Flags; + UINT16 Key; +} EFI_IFR_SAVE_DEFAULTS; + +typedef struct { + EFI_IFR_OP_HEADER Header; + STRING_REF Help; + STRING_REF Text; + STRING_REF TextTwo; // optional text +} EFI_IFR_INVENTORY; + +typedef struct { + EFI_IFR_OP_HEADER Header; + EFI_GUID Guid; // GUID for the variable + UINT16 VarId; // variable store ID, as referenced elsewhere in the form + UINT16 Size; // size of the variable storage +//UINT8 VarName[] // ASCII representation of VarName +} EFI_IFR_VARSTORE; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 VarId; // variable store ID, as referenced elsewhere in the form +} EFI_IFR_VARSTORE_SELECT; + +// +// Used for the ideqid VFR statement where two variable stores may be referenced in the +// same VFR statement. +// A browser should treat this as an EFI_IFR_VARSTORE_SELECT statement and assume that all following +// IFR opcodes use the VarId as defined here. +// +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 VarId; // variable store ID, as referenced elsewhere in the form + UINT16 SecondaryVarId; // variable store ID, as referenced elsewhere in the form +} EFI_IFR_VARSTORE_SELECT_PAIR; + +// Save defaults and restore defaults have same structure +#define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS + +typedef struct { + EFI_IFR_OP_HEADER Header; + STRING_REF Title; // The string token for the banner title + UINT16 LineNumber; // 1-based line number + UINT8 Alignment; // left, center, or right-aligned +} EFI_IFR_BANNER; + +typedef struct { + EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; // Offset into the map + UINT8 StorageWidth; // Width of the value + CHAR8 Data[1]; // The Data itself +} EFI_IFR_NV_DATA; + + + +//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#pragma pack(pop) //must be 1 +//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +typedef EFI_STATUS (EFIAPI *EFI_HII_NEW_PACK_OLD)( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_PACK_LIST *Package, +//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO +//IN EFI_HII_PACKAGES *Packages, +//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO + OUT EFI_HII_HANDLE *Handle ); + +typedef EFI_STATUS (EFIAPI *EFI_HII_NEW_PACK)( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_PACKAGES *Packages, + OUT EFI_HII_HANDLE *Handle ); + +typedef EFI_STATUS (EFIAPI *EFI_HII_REMOVE_PACK) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle ); + +typedef EFI_STATUS (EFIAPI *EFI_HII_FIND_HANDLES) ( + IN EFI_HII_PROTOCOL *This, + IN OUT UINT16 *HandleBufferLength, + OUT EFI_HII_HANDLE *Handle ); + +typedef EFI_STATUS (EFIAPI *EFI_HII_EXPORT) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN OUT UINTN *BufferSize, + OUT VOID *Buffer ); + +//Not in Spec and do we need it???? +typedef EFI_STATUS (EFIAPI *EFI_HII_RESET_STRINGS) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle); + +typedef EFI_STATUS (EFIAPI *EFI_HII_TEST_STRING) ( + IN EFI_HII_PROTOCOL *This, + IN CHAR16 *StringToTest, + IN OUT UINT32 *FirstMissing, + OUT UINT32 *GlyphBufferSize ); + +typedef EFI_STATUS (EFIAPI *EFI_HII_GET_GLYPH) ( + IN EFI_HII_PROTOCOL *This, + IN CHAR16 *Source, + IN OUT UINT16 *Index, + OUT UINT8 **GlyphBuffer, + OUT UINT16 *BitWidth, + IN OUT UINT32 *InternalStatus ); + +typedef EFI_STATUS (EFIAPI *EFI_HII_GLYPH_TO_BLT) ( + IN EFI_HII_PROTOCOL *This, + IN UINT8 *GlyphBuffer, + IN EFI_UGA_PIXEL Foreground, + IN EFI_UGA_PIXEL Background, + IN UINTN Count, + IN UINTN Width, + IN UINTN Height, + IN OUT EFI_UGA_PIXEL *BltBuffer); + +typedef EFI_STATUS (EFIAPI *EFI_HII_NEW_STRING) ( + IN EFI_HII_PROTOCOL *This, + IN CHAR16 *Language, + IN EFI_HII_HANDLE Handle, + IN OUT STRING_REF *Reference, + IN CHAR16 *NewString ); + +typedef EFI_STATUS (EFIAPI *EFI_HII_GET_PRI_LANGUAGES) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + OUT EFI_STRING *LanguageString); + +typedef EFI_STATUS (EFIAPI *EFI_HII_GET_SEC_LANGUAGES) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN CHAR16 *PrimaryLanguage, + OUT EFI_STRING *LanguageString ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_STRING_OLD) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN STRING_REF Token, + IN BOOLEAN Raw, + IN CHAR16 *LanguageString, + IN OUT UINT16 *BufferLength, + OUT EFI_STRING StringBuffer + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_STRING_NEW) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN STRING_REF Token, + IN BOOLEAN Raw, + IN CHAR16 *LanguageString, + IN OUT UINTN *BufferLength, //0.92 Spec Update + OUT EFI_STRING StringBuffer +); + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_LINE) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN STRING_REF Token, + IN OUT UINT16 *Index, + IN UINT16 LineWidth, + IN CHAR16 *LanguageString, + IN OUT UINT16 *BufferLength, + OUT EFI_STRING StringBuffer + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_FORMS_OLD) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN EFI_FORM_ID FormId, + IN OUT UINT16 *BufferLength, + OUT UINT8 *Buffer + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_FORMS_NEW) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN EFI_FORM_ID FormId, + IN OUT UINTN *BufferLength, + OUT UINT8 *Buffer + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE_OLD) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN UINTN DefaultMask, + IN OUT UINT16 *BufferLength, + OUT UINT8 *Buffer + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE_NEW) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN UINTN DefaultMask, + OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList + ); + + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_UPDATE_FORM) ( + IN EFI_HII_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN EFI_FORM_LABEL Label, + IN BOOLEAN AddData, + IN EFI_HII_UPDATE_DATA *Data + ); + +typedef EFI_STATUS (EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT)( + IN EFI_HII_PROTOCOL *This, + OUT UINT16 *DescriptorCount, + OUT EFI_KEY_DESCRIPTOR *Descriptor); + + +typedef struct _EFI_HII_PROTOCOL_OLD { + EFI_HII_NEW_PACK_OLD NewPack; //part kb data is missing + EFI_HII_REMOVE_PACK RemovePack; //ok + EFI_HII_FIND_HANDLES FindHandles; //ok + EFI_HII_EXPORT ExportDatabase; //ok + + EFI_HII_TEST_STRING TestString; //ok + EFI_HII_GET_GLYPH GetGlyph; //ok + EFI_HII_GLYPH_TO_BLT GlyphToBlt; //ok + + EFI_HII_NEW_STRING NewString; //ok + EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;//ok + EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;//ok + EFI_HII_GET_STRING_OLD GetString; //ok + EFI_HII_RESET_STRINGS ResetStrings; //ok + EFI_HII_GET_LINE GetLine; //ok + EFI_HII_GET_FORMS_OLD GetForms; //ok + EFI_HII_GET_DEFAULT_IMAGE_OLD GetDefaultImage;// + EFI_HII_UPDATE_FORM UpdateForm; + + EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout; +} EFI_HII_PROTOCOL_OLD; + +typedef struct _EFI_HII_PROTOCOL { + EFI_HII_NEW_PACK NewPack; //part kb data is missing + EFI_HII_REMOVE_PACK RemovePack; //ok + EFI_HII_FIND_HANDLES FindHandles; //ok + EFI_HII_EXPORT ExportDatabase; //ok + + EFI_HII_TEST_STRING TestString; //ok + EFI_HII_GET_GLYPH GetGlyph; //ok + EFI_HII_GLYPH_TO_BLT GlyphToBlt; //ok + + EFI_HII_NEW_STRING NewString; //ok + EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;//ok + EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;//ok + EFI_HII_GET_STRING_NEW GetString; //ok + EFI_HII_RESET_STRINGS ResetStrings; //ok + EFI_HII_GET_LINE GetLine; //ok + EFI_HII_GET_FORMS_NEW GetForms; //ok + EFI_HII_GET_DEFAULT_IMAGE_NEW GetDefaultImage;//ok + EFI_HII_UPDATE_FORM UpdateForm; + + EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout; +} EFI_HII_PROTOCOL; + +#endif // #if EFI_SPECIFICATION_VERSION>0x20000 +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/HardwareChangeProtocol.h b/Include/Protocol/HardwareChangeProtocol.h new file mode 100644 index 0000000..0a2cbb0 --- /dev/null +++ b/Include/Protocol/HardwareChangeProtocol.h @@ -0,0 +1,362 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/HardwareSignatureManagement/Protocol/HardwareChangeProtocol.h 7 1/09/14 8:04a Albertlin $ +// +// $Revision: 7 $ +// +// $Date: 1/09/14 8:04a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/HardwareSignatureManagement/Protocol/HardwareChangeProtocol.h $ +// +// 7 1/09/14 8:04a Albertlin +// [TAG] EIP147244 +// [Category] Not Specified +// [Description] BIOS need to report changed hardware signature when +// BIOS setup was modified. +// [Files] HardwareChangeProtocol.h +// +// 6 3/01/13 3:34a Albertlin +// [TAG] EIP115994 +// [Category] Improvement +// [Description] Modify the comment for chm table. +// [Files] HardwareChangeProtocol.h +// +// 5 1/10/13 10:28p Albertlin +// [TAG] EIP109014 +// [Category] Improvement +// [Description] Currently, HardwareSignature module report signature by +// changed count.But it cause the same hardware may have different +// signature. +// For solve this issue, BIOS should report signature by hardware config. +// [Files] HardwareChangeDetect.c HardwareSignatureManagement.c +// HardwareSignatureManagement.sdl HardwareChangeProtocol.h +// +// 4 12/11/12 1:51a Sophiachen +// [TAG] EIP105523 +// [Category] New Feature +// [Description] Record the disk configuration data to check the +// connection change of disk. +// [Files] HardwareChangeDetect.c, HardwareSignatureManagement.c, +// HardwareChangeProtocol.h +// +// 3 11/20/12 8:20a Sophiachen +// [TAG] EIP105154 +// [Category] New Feature +// [Description] Record the video configuration data to check the +// connection change of monitor. +// [Files] HardwareChangeDetect.c, HardwareSignatureManagement.c, +// HardwareChangeProtocol.h +// +// 2 10/18/12 7:53a Sophiachen +// +// 1 9/25/12 8:58a Sophiachen +// [TAG] EIP96258 +// [Category] New Feature +// [Description] Update the Hardware Signature of the ACPI table FACS +// field can notify ACPI OS whether any hardware configuration change. +// [Files] HardwareChangeProtocols.cif +// Protocol\HardwareChangeProtocol.h +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: HardwareChangeProtocol.h +// +// Description: The header file for Hardware change protocol. +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef __HARDWARE_CHANGE_PROTOCOL__H__ +#define __HARDWARE_CHANGE_PROTOCOL__H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// {43169678-506C-46fe-B32A-FCB301F74FBD} +#define HARDWARE_CHANGE_PROTOCOL_GUID \ + { 0x43169678, 0x506c, 0x46fe, 0xb3, 0x2a, 0xfc, 0xb3, 0x1, 0xf7, 0x4f, 0xbd } + +// {B80A8E5B-C02A-4a31-AE12-58E46E803E89} +#define HARDWARE_CONFIG_DATA_GUID \ + { 0xb80a8e5b, 0xc02a, 0x4a31, 0xae, 0x12, 0x58, 0xe4, 0x6e, 0x80, 0x3e, 0x89 } + +// {e08126e5-b93c-4f5e-8e81-6dfcf34ff88e} +#define FIRMWARE_UPDATE_COUNT_GUID \ + { 0xe08126e5, 0xb93c, 0x4f5e, 0x8e, 0x81, 0x6d, 0xfc, 0xf3, 0x4f, 0xf8, 0x8e } + +//<EIP147244 > +// {81c76078-bfde-4368-9790-570914c01a65} +#define SETUP_UPDATE_COUNT_GUID \ + { 0x81c76078, 0xbfde, 0x4368, 0x97, 0x90, 0x57, 0x09, 0x14, 0xc0, 0x1a, 0x65 } + +#define SETUP_UPDATE_COUNT_VARIABLE L"SetUpdateCountVar" +//EFI_GUID gSetupUpdateCountGuid = SETUP_UPDATE_COUNT_GUID; +//<EIP147244 > + +#define HW_CHANGE_PS2_KEYBOARD BIT0 +#define HW_CHANGE_PS2_MOUSE BIT1 +#define HW_CHANGE_MEMORY_SIZE_CONFIG BIT2 +#define HW_CHANGE_MEMORY_MAP_CONFIG BIT3 +#define HW_CHANGE_PCI_CONFIG BIT4 +#define HW_CHANGE_USB_CONFIG BIT5 +#define HW_CHANGE_VIDEO_CONFIG BIT6 +#define HW_CHANGE_DISK_CONFIG BIT7 +//For limit the protocol be called +#define LIMIT_PROTOCOL_CALLED 20 + +#if HARDWARE_SIGNATURE_DEBUG_MESSAGES +#define HWSIG_TRACE(Arguments) TRACE(Arguments) +#else +#define HWSIG_TRACE(Arguments) +#endif + +typedef enum { + Ps2KeyboardConfigType, + Ps2MouseConfigType, + MemorySizeConfigType, + MemoryMapConfigType, + PciConfigType, + UsbConfigType, + VideoConfigType, + DiskConfigType, + MaxConfigType +} HW_CONFIG_TYPE; + +#pragma pack (push,1) + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: HW_MEMORY_MAP_DATA +// +// Description: This structure represents the memory map data which contains +// memory size(Megabyte) and checksum of the runtime memory type. +// +// Fields: Name Type Description +// ------------------------------------------------------------------ +// MemMapCheckSum UINT8 Checksum of the runtime memory type +// MemoryMbSize UINT32 Total memory size(Megabyte) +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _HW_MEMORY_MAP_DATA { + UINT8 MemMapCheckSum; + UINT32 MemoryMbSize; +} HW_MEMORY_MAP_DATA; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: HW_PCI_DATA +// +// Description: This structure represents the PCI configuration data which +// contains number of PCI/PCIE devices, checksum of Bus number/Device number/ +// Function number, and checksum of VID/DID. +// +// Fields: Name Type Description +// ------------------------------------------------------------------ +// PciNum UINT16 Number of PCI/PCIE devices +// BdfChecksum UINT8 Checksum of Bus number/Device number/Function number +// VidDidChecksum UINT8 Checksum of VID/DID +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _HW_PCI_DATA { + UINT16 PciNum; + UINT8 BdfChecksum; + UINT8 VidDidChecksum; +} HW_PCI_DATA; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: HW_USB_DATA +// +// Description: This structure represents the USB configuration data which +// contains number of USB devices, checksum of VID/PID, and checksum of Port +// number and Interface number. +// +// Fields: Name Type Description +// ------------------------------------------------------------------ +// UsbNum UINT16 Number of USB devices +// VidPidChecksum UINT8 Checksum of VID/PID +// PortNumInterfaceNumChecksum UINT8 Checksum of Port number and Interface number +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _HW_USB_DATA { + UINT16 UsbNum; + UINT8 VidPidChecksum; + UINT8 PortNumInterfaceNumChecksum; +} HW_USB_DATA; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: HW_VIDEO_DATA +// +// Description: This structure represents the Video configuration data which +// contains checksum of EDID data, and checksum of resolution. +// +// Fields: Name Type Description +// ------------------------------------------------------------------ +// EdidCheckNum UINT8 Checksum of EDID data +// ResolutionChecksum UINT8 Checksum of resolution +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _HW_VIDEO_DATA { + UINT8 EdidCheckNum; + UINT8 ResolutionChecksum; +} HW_VIDEO_DATA; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: HW_DISK_DATA +// +// Description: This structure represents the Disk configuration data with checksum. +// +// Fields: Name Type Description +// ------------------------------------------------------------------ +// CDSchecksum UINT8 Checksum +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _HW_DISK_DATA { + UINT32 CDSchecksum; +} HW_DISK_DATA; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: DISK_STRUCTURE +// +// Description: This structure represents the Disk configuration data which +// contains port number and serial number . +// +// Fields: Name Type Description +// ------------------------------------------------------------------ +// Portnumber UINT8 Port number +// Serialnumber UINT8 Serial number +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _DISK_STRUCTURE { + UINT8 Portnumber; + UINT8 Serialnumber[20]; +} DISK_STRUCTURE; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: HW_CONFIG_DATA +// +// Description: This structure represents the hardware configuration data +// which contains PS2 Keyboard/Mouse configuration, Memory Map configuration, +// PCI configuration Data, USB configuration Data, Video configuration data, +// Disk configuration data, Firmware update times, and Checksum which external +// function given. +// +// Fields: Name Type Description +// ------------------------------------------------------------------ +// bPs2Keyboard BOOLEAN The present state of PS2 Keyboard +// bPs2Mouse BOOLEAN The present state of PS2 Mouse +// MemMapData HW_MEMORY_MAP_DATA Memory configuration data +// PciData HW_PCI_DATA PCI configuration data +// UsbData HW_USB_DATA USB configuration data +// VideoData HW_VIDEO_DATA Video configuration data +// DiskData HW_DISK_DATA Disk configuration data +// FirmwareUpdateCount UINT32 Firmware update count +// ReturnChecksum UINT32 Checksum which the external function given +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct _HW_CONFIG_DATA { + BOOLEAN bPs2Keyboard; + BOOLEAN bPs2Mouse; + HW_MEMORY_MAP_DATA MemMapData; + HW_PCI_DATA PciData; +#if HARDWARE_SIGNATURE_USB_CHANGE + HW_USB_DATA UsbData; +#endif + HW_VIDEO_DATA VideoData; + HW_DISK_DATA DiskData; + UINT32 FirmwareUpdateCount; +//<EIP147244 > + UINT32 SetupUpdateCount; +//<EIP147244 > + UINT32 ReturnChecksum[LIMIT_PROTOCOL_CALLED]; +} HW_CONFIG_DATA; +#pragma pack (pop) + +typedef +EFI_STATUS (EFIAPI *SET_HW_CONFIG_DATA) ( + IN HW_CONFIG_TYPE ConfigType, + IN UINTN BufferSize, + IN VOID *Buffer +); + +typedef +EFI_STATUS (EFIAPI *GET_HW_CONFIG_DATA_FROM_NVRAM) ( + IN OUT HW_CONFIG_DATA *HardwareConfigData +); + +typedef +EFI_STATUS (EFIAPI *SIGNAL_HW_SIGNATURE_CHANGE) ( + IN UINT32 ReturnChecksum +); + +typedef struct { + SET_HW_CONFIG_DATA SetHardwareConfigData; + GET_HW_CONFIG_DATA_FROM_NVRAM GetHardwareConfigDataFromNvram; + SIGNAL_HW_SIGNATURE_CHANGE SignalHardwareSignatureChange; +} EFI_HARDWARE_CHANGE_PROTOCOL; + +EFI_STATUS SetHardwareConfigData( + IN HW_CONFIG_TYPE ConfigType, + IN UINTN BufferSize, + IN VOID *Buffer +); + +EFI_STATUS GetHardwareConfigDataFromNvram( + IN OUT HW_CONFIG_DATA *HardwareConfigData +); + +EFI_STATUS SignalHardwareSignatureChange( + IN UINT32 ReturnChecksum ); + +UINT32 CRC32 ( + IN UINT8 *fpData, + IN UINT16 Length, + IN UINT8 ExtenData +); + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/Hash.h b/Include/Protocol/Hash.h new file mode 100644 index 0000000..21bfc59 --- /dev/null +++ b/Include/Protocol/Hash.h @@ -0,0 +1,137 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/Hash.h 3 5/13/11 4:35p Artems $ +// +// $Revision: 3 $ +// +// $Date: 5/13/11 4:35p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/Hash.h $ +// +// 3 5/13/11 4:35p Artems +// AMI coding style compliance added +// +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: <Hash.h> +// +// Description: Hash protocol header file +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef __EFI_HASH_PROTOCOL_H__ +#define __EFI_HASH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_HASH_SERVICE_BINDING_PROTOCOL_GUID \ + { 0x42881c98, 0xa4f3, 0x44b0, 0xa3, 0x9d, 0xdf, 0xa1, 0x86, 0x67, 0xd8, 0xcd } + +#define EFI_HASH_PROTOCOL_GUID \ + { 0xc5184932, 0xdba5, 0x46db, 0xa5, 0xba, 0xcc, 0x0b, 0xda, 0x9c, 0x14, 0x35 } + +#define EFI_HASH_ALGORITHM_SHA1_GUID \ + { 0x2ae9d80f, 0x3fb2, 0x4095, 0xb7, 0xb1, 0xe9, 0x31, 0x57, 0xb9, 0x46, 0xb6 } + +#define EFI_HASH_ALGORITHM_SHA224_GUID \ + { 0x8df01a06, 0x9bd5, 0x4bf7, 0xb0, 0x21, 0xdb, 0x4f, 0xd9, 0xcc, 0xf4, 0x5b } + +#define EFI_HASH_ALGORITHM_SHA256_GUID \ + { 0x51aa59de, 0xfdf2, 0x4ea3, 0xbc, 0x63, 0x87, 0x5f, 0xb7, 0x84, 0x2e, 0xe9 } + +#define EFI_HASH_ALGORITHM_SHA384_GUID \ + { 0xefa96432, 0xde33, 0x4dd2, 0xae, 0xe6, 0x32, 0x8c, 0x33, 0xdf, 0x77, 0x7a } + +#define EFI_HASH_ALGORITHM_SHA512_GUID \ + { 0xcaa4381e, 0x750c, 0x4770, 0xb8, 0x70, 0x7a, 0x23, 0xb4, 0xe4, 0x21, 0x30 } + +#define EFI_HASH_ALGORTIHM_MD5_GUID \ + { 0xaf7c79c, 0x65b5, 0x4319, 0xb0, 0xae, 0x44, 0xec, 0x48, 0x4e, 0x4a, 0xd7 } + +typedef struct _EFI_HASH_PROTOCOL EFI_HASH_PROTOCOL; + +typedef UINT8 EFI_MD5_HASH[16]; +typedef UINT8 EFI_SHA1_HASH[20]; +typedef UINT8 EFI_SHA224_HASH[28]; +typedef UINT8 EFI_SHA256_HASH[32]; +typedef UINT8 EFI_SHA384_HASH[48]; +typedef UINT8 EFI_SHA512_HASH[64]; + +typedef union { + EFI_MD5_HASH *Md5Hash; + EFI_SHA1_HASH *Sha1Hash; + EFI_SHA224_HASH *Sha224Hash; + EFI_SHA256_HASH *Sha256Hash; + EFI_SHA384_HASH *Sha384Hash; + EFI_SHA512_HASH *Sha512Hash; +} EFI_HASH_OUTPUT; + +typedef +EFI_STATUS +(EFIAPI *EFI_HASH_GET_HASH_SIZE) ( + IN CONST EFI_HASH_PROTOCOL *This, + IN CONST EFI_GUID *HashAlgorithm, + OUT UINTN *HashSize +); + +typedef +EFI_STATUS +(EFIAPI *EFI_HASH_HASH) ( + IN CONST EFI_HASH_PROTOCOL *This, + IN CONST EFI_GUID *HashAlgorithm, + IN BOOLEAN Extend, + IN CONST UINT8 *Message, + IN UINT64 MessageSize, + IN OUT EFI_HASH_OUTPUT *Hash +); + +struct _EFI_HASH_PROTOCOL { + EFI_HASH_GET_HASH_SIZE GetHashSize; + EFI_HASH_HASH Hash; +}; + +GUID_VARIABLE_DECLARATION(gEfiHashServiceBindingProtocolGuid, EFI_HASH_SERVICE_BINDING_PROTOCOL_GUID); +GUID_VARIABLE_DECLARATION(gEfiHashProtocolGuid, EFI_HASH_PROTOCOL_GUID); +GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha1Guid, EFI_HASH_ALGORITHM_SHA1_GUID); +GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha224Guid, EFI_HASH_ALGORITHM_SHA224_GUID); +GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha256Guid, EFI_HASH_ALGORITHM_SHA256_GUID); +GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha384Guid, EFI_HASH_ALGORITHM_SHA384_GUID); +GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha512Guid, EFI_HASH_ALGORITHM_SHA512_GUID); +GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmMD5Guid, EFI_HASH_ALGORTIHM_MD5_GUID); + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/HiiConfigAccess.h b/Include/Protocol/HiiConfigAccess.h new file mode 100644 index 0000000..e133ac9 --- /dev/null +++ b/Include/Protocol/HiiConfigAccess.h @@ -0,0 +1,114 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/HiiConfigAccess.h 3 11/25/09 11:23a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 11/25/09 11:23a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/HiiConfigAccess.h $ +// +// 3 11/25/09 11:23a Felixp +// Action parameter of the Callback function is updated based on UEFI +// errata +// +// 2 10/13/09 6:06p Felixp +// Hii.h renamed to UefiHii.h +// +// 1 10/09/09 3:52p Felixp +// +// 1 2/27/09 3:55p Artems +// Initial check-in +// +// 1 3/18/07 5:23p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: <HiiConfigAccess.h> +// +// Description: Hii Config access protocol header file +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __HII_CONFIG_ACCESS__H__ +#define __HII_CONFIG_ACCESS__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <UefiHii.h> + +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \ + { 0x330d4706, 0xf2a0, 0x4e4f, 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } + +GUID_VARIABLE_DECLARATION(gEfiHiiConfigAccessProtocolGuid, EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID); + +typedef struct _EFI_HII_CONFIG_ACCESS_PROTOCOL EFI_HII_CONFIG_ACCESS_PROTOCOL; + +typedef EFI_STATUS +(EFIAPI * EFI_HII_ACCESS_EXTRACT_CONFIG ) ( + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, + IN CONST EFI_STRING Request, + OUT EFI_STRING *Progress, + OUT EFI_STRING *Results +); + +typedef EFI_STATUS +(EFIAPI * EFI_HII_ACCESS_ROUTE_CONFIG ) ( + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, + IN CONST EFI_STRING Configuration, + OUT EFI_STRING *Progress +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_ACCESS_FORM_CALLBACK) ( + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, +//Based on errata for uefi2.1-2.3 approved in the 11/18 USWG meeting +//the Action parameter is not a pointer + IN EFI_BROWSER_ACTION Action, + IN EFI_QUESTION_ID QuestionId, + IN UINT8 Type, + IN EFI_IFR_TYPE_VALUE *Value, + OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest +); + +struct _EFI_HII_CONFIG_ACCESS_PROTOCOL { + EFI_HII_ACCESS_EXTRACT_CONFIG ExtractConfig; + EFI_HII_ACCESS_ROUTE_CONFIG RouteConfig; + EFI_HII_ACCESS_FORM_CALLBACK Callback; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/HiiConfigRouting.h b/Include/Protocol/HiiConfigRouting.h new file mode 100644 index 0000000..063fb44 --- /dev/null +++ b/Include/Protocol/HiiConfigRouting.h @@ -0,0 +1,137 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/HiiConfigRouting.h 2 10/13/09 6:06p Felixp $ +// +// $Revision: 2 $ +// +// $Date: 10/13/09 6:06p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/HiiConfigRouting.h $ +// +// 2 10/13/09 6:06p Felixp +// Hii.h renamed to UefiHii.h +// +// 1 10/09/09 3:52p Felixp +// +// 1 2/27/09 3:55p Artems +// Initial check-in +// +// 1 3/18/07 5:23p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: HiiConfigRouting.h +// +// Description: Hii Configuration Routing protocol header file +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __HII_CONFIG_ROUTING_PROTOCOL__H__ +#define __HII_CONFIG_ROUTING_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <UefiHii.h> + +#define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \ + { 0x587e72d7, 0xcc50, 0x4f79, 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f } + +GUID_VARIABLE_DECLARATION(gEfiHiiConfigRoutingProtocolGuid, EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID); + +typedef struct _EFI_HII_CONFIG_ROUTING_PROTOCOL EFI_HII_CONFIG_ROUTING_PROTOCOL; + +typedef EFI_STATUS +(EFIAPI * EFI_HII_EXTRACT_CONFIG ) ( + IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + IN CONST EFI_STRING Request, + OUT EFI_STRING *Progress, + OUT EFI_STRING *Results +); + +typedef EFI_STATUS +(EFIAPI * EFI_HII_EXPORT_CONFIG ) ( + IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + OUT EFI_STRING *Results +); + +typedef EFI_STATUS +(EFIAPI * EFI_HII_ROUTE_CONFIG ) ( + IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + IN CONST EFI_STRING Configuration, + OUT EFI_STRING *Progress +); + +typedef EFI_STATUS +(EFIAPI * EFI_HII_BLOCK_TO_CONFIG ) ( + IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + IN CONST EFI_STRING ConfigRequest, + IN CONST UINT8 *Block, + IN CONST UINTN BlockSize, + OUT EFI_STRING *Config, + OUT EFI_STRING *Progress +); + +typedef EFI_STATUS +(EFIAPI * EFI_HII_CONFIG_TO_BLOCK ) ( + IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + IN CONST EFI_STRING ConfigResp, + IN OUT CONST UINT8 *Block, + IN OUT UINTN *BlockSize, + OUT EFI_STRING *Progress +); + +typedef EFI_STATUS +(EFIAPI * EFI_HII_GET_ALT_CFG ) ( + IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + IN CONST EFI_STRING ConfigResp, + IN CONST EFI_GUID *Guid, + IN CONST EFI_STRING Name, + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, + IN CONST EFI_STRING AltCfgId, + OUT EFI_STRING *AltCfgResp +); + +struct _EFI_HII_CONFIG_ROUTING_PROTOCOL { + EFI_HII_EXTRACT_CONFIG ExtractConfig; + EFI_HII_EXPORT_CONFIG ExportConfig; + EFI_HII_ROUTE_CONFIG RouteConfig; + EFI_HII_BLOCK_TO_CONFIG BlockToConfig; + EFI_HII_CONFIG_TO_BLOCK ConfigToBlock; + EFI_HII_GET_ALT_CFG GetAltConfig; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/HiiDatabase.h b/Include/Protocol/HiiDatabase.h new file mode 100644 index 0000000..b53d177 --- /dev/null +++ b/Include/Protocol/HiiDatabase.h @@ -0,0 +1,189 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/HiiDatabase.h 2 10/13/09 6:06p Felixp $ +// +// $Revision: 2 $ +// +// $Date: 10/13/09 6:06p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/HiiDatabase.h $ +// +// 2 10/13/09 6:06p Felixp +// Hii.h renamed to UefiHii.h +// +// 1 10/09/09 3:52p Felixp +// +// 1 2/27/09 3:55p Artems +// Initial check-in +// +// 1 3/18/07 5:23p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: <HiiDatabase.h> +// +// Description: Hii Database protocol header file +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __HII_DATABASE__H__ +#define __HII_DATABASE__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <UefiHii.h> + +#define EFI_HII_DATABASE_PROTOCOL_GUID \ + { 0xef9fc172, 0xa1b2, 0x4693, 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } + +GUID_VARIABLE_DECLARATION(gEfiHiiDatabaseProtocolGuid, EFI_HII_DATABASE_PROTOCOL_GUID); + +typedef struct _EFI_HII_DATABASE_PROTOCOL EFI_HII_DATABASE_PROTOCOL; + +typedef EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_NEW_PACK) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList, + IN CONST EFI_HANDLE DriverHandle, + OUT EFI_HII_HANDLE *Handle +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_REMOVE_PACK) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_HII_HANDLE Handle +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_UPDATE_PACK) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_LIST_PACKS) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN UINT8 PackageType, + IN CONST EFI_GUID *PackageGuid, + IN OUT UINTN *HandleBufferLength, + OUT EFI_HII_HANDLE *Handle +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_EXPORT_PACKS) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN OUT UINTN *BufferSize, + OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer +); + +typedef UINTN EFI_HII_DATABASE_NOTIFY_TYPE; + +#define EFI_HII_DATABASE_NOTIFY_NEW_PACK 0x00000001 +#define EFI_HII_DATABASE_NOTIFY_REMOVE_PACK 0x00000002 +#define EFI_HII_DATABASE_NOTIFY_EXPORT_PACK 0x00000004 +#define EFI_HII_DATABASE_NOTIFY_ADD_PACK 0x00000008 + +typedef EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_NOTIFY) ( + IN UINT8 PackageType, + IN CONST EFI_GUID *PackageGuid, + IN CONST EFI_HII_PACKAGE_HEADER *Package, + IN EFI_HII_HANDLE Handle, + IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_REGISTER_NOTIFY) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN UINT8 PackageType, + IN CONST EFI_GUID *PackageGuid, + IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn, + IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, + OUT EFI_HANDLE *NotifyHandle +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_UNREGISTER_NOTIFY) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_HANDLE NotificationHandle +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_FIND_KEYBOARD_LAYOUTS) ( + IN EFI_HII_DATABASE_PROTOCOL *This, + IN OUT UINT16 *KeyGuidBufferLength, + OUT EFI_GUID *KeyGuidBuffer +); + +typedef +EFI_STATUS (EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) ( + IN EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_GUID *KeyGuid, + IN OUT UINT16 *KeyGuidBufferLength, + OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout +); + +typedef +EFI_STATUS (EFIAPI *EFI_HII_SET_KEYBOARD_LAYOUT) ( + IN EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_GUID *KeyGuid +); + +typedef +EFI_STATUS (EFIAPI *EFI_HII_DATABASE_GET_PACK_HANDLE) ( + IN EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_HII_HANDLE PackageListHandle, + OUT EFI_HANDLE *DriverHandle +); + +struct _EFI_HII_DATABASE_PROTOCOL { + EFI_HII_DATABASE_NEW_PACK NewPackageList; + EFI_HII_DATABASE_REMOVE_PACK RemovePackageList; + EFI_HII_DATABASE_UPDATE_PACK UpdatePackageList; + EFI_HII_DATABASE_LIST_PACKS ListPackageLists; + EFI_HII_DATABASE_EXPORT_PACKS ExportPackageLists; + EFI_HII_DATABASE_REGISTER_NOTIFY RegisterPackageNotify; + EFI_HII_DATABASE_UNREGISTER_NOTIFY UnregisterPackageNotify; + EFI_HII_FIND_KEYBOARD_LAYOUTS FindKeyboardLayouts; + EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout; + EFI_HII_SET_KEYBOARD_LAYOUT SetKeyboardLayout; + EFI_HII_DATABASE_GET_PACK_HANDLE GetPackageListHandle; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/HiiFont.h b/Include/Protocol/HiiFont.h new file mode 100644 index 0000000..812754b --- /dev/null +++ b/Include/Protocol/HiiFont.h @@ -0,0 +1,202 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/HiiFont.h 6 5/23/12 3:41p Artems $ +// +// $Revision: 6 $ +// +// $Date: 5/23/12 3:41p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/HiiFont.h $ +// +// 6 5/23/12 3:41p Artems +// [TAG] EIP N/A +// [Category] Spec Update +// [Severity] Minor +// [Description] Minor change in protocol function input parameter +// [Files] HiiFont.h +// +// 5 10/25/11 6:55p Artems +// Renamed CLIP flags according to UEFI 2.3.1 spec +// +// 4 12/04/09 12:14p Felixp +// +// 3 12/03/09 6:02p Artems +// moved font related structures outside pack pragma +// +// 2 10/13/09 6:06p Felixp +// Hii.h renamed to UefiHii.h +// +// 1 10/09/09 3:52p Felixp +// +// 1 2/27/09 3:55p Artems +// Initial check-in +// +// 1 3/18/07 5:23p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: <HiiFont.h> +// +// Description: Hii Font protocol header file +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __HII_FONT__H__ +#define __HII_FONT__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_HII_FONT_PROTOCOL_GUID \ + { 0xe9ca4775, 0x8657, 0x47fc, 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 } + +GUID_VARIABLE_DECLARATION(gEfiHiiFontProtocolGuid, EFI_HII_FONT_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <UefiHii.h> +#include <Protocol/GraphicsOutput.h> + +typedef UINT32 EFI_HII_OUT_FLAGS; + +#define EFI_HII_OUT_FLAG_CLIP 0x00000001 +#define EFI_HII_OUT_FLAG_WRAP 0x00000002 +#define EFI_HII_OUT_FLAG_CLIP_CLEAN_Y 0x00000004 +#define EFI_HII_OUT_FLAG_CLIP_CLEAN_X 0x00000008 +#define EFI_HII_OUT_FLAG_TRANSPARENT 0x00000010 +#define EFI_HII_IGNORE_IF_NO_GLYPH 0x00000020 +#define EFI_HII_IGNORE_LINE_BREAK 0x00000040 +#define EFI_HII_DIRECT_TO_SCREEN 0x00000080 + +typedef UINT32 EFI_FONT_INFO_MASK; + +#define EFI_FONT_INFO_SYS_FONT 0x00000001 +#define EFI_FONT_INFO_SYS_SIZE 0x00000002 +#define EFI_FONT_INFO_SYS_STYLE 0x00000004 +#define EFI_FONT_INFO_SYS_FORE_COLOR 0x00000010 +#define EFI_FONT_INFO_SYS_BACK_COLOR 0x00000020 +#define EFI_FONT_INFO_RESIZE 0x00001000 +#define EFI_FONT_INFO_RESTYLE 0x00002000 +#define EFI_FONT_INFO_ANY_FONT 0x00010000 +#define EFI_FONT_INFO_ANY_SIZE 0x00020000 +#define EFI_FONT_INFO_ANY_STYLE 0x00040000 + +typedef struct _EFI_HII_ROW_INFO { + UINTN StartIndex; + UINTN EndIndex; + UINTN LineHeight; + UINTN LineWidth; + UINTN BaselineOffset; +} EFI_HII_ROW_INFO; + +typedef struct _EFI_FONT_DISPLAY_INFO { + EFI_GRAPHICS_OUTPUT_BLT_PIXEL ForegroundColor; + EFI_GRAPHICS_OUTPUT_BLT_PIXEL BackgroundColor; + EFI_FONT_INFO_MASK FontInfoMask; + EFI_FONT_INFO FontInfo; +} EFI_FONT_DISPLAY_INFO; + +typedef struct _EFI_IMAGE_OUTPUT { + UINT16 Width; + UINT16 Height; + union { + EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap; + EFI_GRAPHICS_OUTPUT_PROTOCOL *Screen; + } Image; +} EFI_IMAGE_OUTPUT; + +//Protocol functions prototypes + +typedef struct _EFI_HII_FONT_PROTOCOL EFI_HII_FONT_PROTOCOL; + +typedef EFI_STATUS +(EFIAPI *EFI_HII_STRING_TO_IMAGE) ( + IN CONST EFI_HII_FONT_PROTOCOL *This, + IN EFI_HII_OUT_FLAGS Flags, + IN CONST EFI_STRING String, + IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL, + IN OUT EFI_IMAGE_OUTPUT **Blt, + IN UINTN BltX, + IN UINTN BltY, + OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL, + OUT UINTN *RowInfoArraySize OPTIONAL, + OUT UINTN *ColumnInfoArray OPTIONAL +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_STRING_ID_TO_IMAGE) ( + IN CONST EFI_HII_FONT_PROTOCOL *This, + IN EFI_HII_OUT_FLAGS Flags, + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, + IN CONST CHAR8* Language, + IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL, + IN OUT EFI_IMAGE_OUTPUT **Blt, + IN UINTN BltX, + IN UINTN BltY, + OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL, + OUT UINTN *RowInfoArraySize OPTIONAL, + OUT UINTN *ColumnInfoArray OPTIONAL +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_GET_GLYPH) ( + IN CONST EFI_HII_FONT_PROTOCOL *This, + IN CHAR16 Char, + IN CONST EFI_FONT_DISPLAY_INFO *StringInfo, + OUT EFI_IMAGE_OUTPUT **Blt, + OUT UINTN *Baseline OPTIONAL +); + +typedef VOID *EFI_FONT_HANDLE; + +typedef EFI_STATUS +(EFIAPI *EFI_HII_GET_FONT_INFO) ( + IN CONST EFI_HII_FONT_PROTOCOL *This, + IN OUT EFI_FONT_HANDLE *FontHandle, + IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, OPTIONAL + OUT EFI_FONT_DISPLAY_INFO **StringInfoOut, + IN CONST EFI_STRING String OPTIONAL +); + +struct _EFI_HII_FONT_PROTOCOL { + EFI_HII_STRING_TO_IMAGE StringToImage; + EFI_HII_STRING_ID_TO_IMAGE StringIdToImage; + EFI_HII_GET_GLYPH GetGlyph; + EFI_HII_GET_FONT_INFO GetFontInfo; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/HiiPackageList.h b/Include/Protocol/HiiPackageList.h new file mode 100644 index 0000000..d5ddb62 --- /dev/null +++ b/Include/Protocol/HiiPackageList.h @@ -0,0 +1,67 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/HiiPackageList.h 1 11/19/09 12:53p Felixp $ +// +// $Revision: 1 $ +// +// $Date: 11/19/09 12:53p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/HiiPackageList.h $ +// +// 1 11/19/09 12:53p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: HiiPackageList.h +// +// Description: HII Package List Protocol Definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __HII_PACKAGE_LIST_PROTOCOL__H__ +#define __HII_PACKAGE_LIST_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <UefiHii.h> + +#define EFI_HII_PACKAGE_LIST_PROTOCOL_GUID \ + { 0x6a1ee763, 0xd47a, 0x43b4, {0xaa, 0xbe, 0xef, 0x1d, 0xe2, 0xab, 0x56, 0xfc}} + +GUID_VARIABLE_DECLARATION(gEfiHiiPackageListProtocolGuid, EFI_HII_PACKAGE_LIST_PROTOCOL_GUID); + +typedef EFI_HII_PACKAGE_LIST_HEADER* EFI_HII_PACKAGE_LIST_PROTOCOL; +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/HiiString.h b/Include/Protocol/HiiString.h new file mode 100644 index 0000000..d579daf --- /dev/null +++ b/Include/Protocol/HiiString.h @@ -0,0 +1,141 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/HiiString.h 3 5/23/12 3:51p Artems $ +// +// $Revision: 3 $ +// +// $Date: 5/23/12 3:51p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/HiiString.h $ +// +// 3 5/23/12 3:51p Artems +// [TAG] EIP N/A +// [Category] Spec Update +// [Severity] Minor +// [Description] Change in input parameter of protocol function +// [Files] HiiString.h +// +// 2 10/13/09 6:06p Felixp +// Hii.h renamed to UefiHii.h +// +// 1 10/09/09 3:52p Felixp +// +// 1 2/27/09 3:55p Artems +// Initial check-in +// +// 1 3/18/07 5:23p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: <HiiString.h> +// +// Description: Hii String protocol header file +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __HII_STRING__H__ +#define __HII_STRING__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <UefiHii.h> + +#define EFI_HII_STRING_PROTOCOL_GUID \ + { 0xfd96974, 0x23aa, 0x4cdc, 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a } + +GUID_VARIABLE_DECLARATION(gEfiHiiStringProtocolGuid, EFI_HII_STRING_PROTOCOL_GUID); + +typedef struct _EFI_HII_STRING_PROTOCOL EFI_HII_STRING_PROTOCOL; + +typedef EFI_STATUS +(EFIAPI *EFI_HII_NEW_STRING) ( + IN CONST EFI_HII_STRING_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + OUT EFI_STRING_ID *StringId, + IN CONST CHAR8 *Language, + IN CONST CHAR16 *LanguageName OPTIONAL, + IN CONST EFI_STRING String, + IN CONST EFI_FONT_INFO *StringFontInfo +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_GET_STRING) ( + IN CONST EFI_HII_STRING_PROTOCOL *This, + IN CONST CHAR8 *Language, + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, + OUT EFI_STRING String, + IN OUT UINTN *StringSize, + OUT EFI_FONT_INFO **StringFontInfo OPTIONAL +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_SET_STRING) ( + IN CONST EFI_HII_STRING_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, + IN CONST CHAR8 *Language, + IN CONST EFI_STRING String, + IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_GET_LANGUAGES) ( + IN CONST EFI_HII_STRING_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + IN OUT CHAR8 *Languages, + IN OUT UINTN *LanguagesSize +); + +typedef EFI_STATUS +(EFIAPI *EFI_HII_GET_2ND_LANGUAGES) ( + IN CONST EFI_HII_STRING_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + IN CONST CHAR8* FirstLanguage, + IN OUT CHAR8 *SecondLanguages, + IN OUT UINTN *SecondLanguagesSize +); + +struct _EFI_HII_STRING_PROTOCOL { + EFI_HII_NEW_STRING NewString; + EFI_HII_GET_STRING GetString; + EFI_HII_SET_STRING SetString; + EFI_HII_GET_LANGUAGES GetLanguages; + EFI_HII_GET_2ND_LANGUAGES GetSecondaryLanguages; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/HiiUtilities.h b/Include/Protocol/HiiUtilities.h new file mode 100644 index 0000000..3c90e19 --- /dev/null +++ b/Include/Protocol/HiiUtilities.h @@ -0,0 +1,155 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/HiiUtilities.h 3 5/23/12 3:54p Artems $ +// +// $Revision: 3 $ +// +// $Date: 5/23/12 3:54p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/HiiUtilities.h $ +// +// 3 5/23/12 3:54p Artems +// [TAG] EIP N/A +// [Category] Improvement +// [Description] Rewrite GraphicsConsole driver to draw strings as a +// whole, +// not symbol-by-symbol for performance reasons +// [Files] HiiUtilities.h, AmiDxeLib.h, EfiLib.h, GC.c, UefiHiiUtils.c +// +// 2 2/23/10 10:14p Felixp +// SetBrowserData function is added +// +// 1 10/09/09 3:15p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: HiiUtilities.h +// +// Description: HII Utilities Protocol +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __HII_UTILITIES_PROTOCOL__H__ +#define __HII_UTILITIES_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// {67B5787C-0E6A-4796-943E-A093B73A0267} +#define HII_UTILITIES_PROTOCOL_GUID \ + { 0x67b5787c, 0xe6a, 0x4796, 0x94, 0x3e, 0xa0, 0x93, 0xb7, 0x3a, 0x2, 0x67 } + +GUID_VARIABLE_DECLARATION(gHiiUtilitiesProtocolGuid,HII_UTILITIES_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#if EFI_SPECIFICATION_VERSION>0x20000 +#include <Protocol/HiiConfigAccess.h> +#else +#include <Protocol/FormCallBack.h > +#endif + +typedef struct _CALLBACK_INFO CALLBACK_INFO; + +typedef VOID(*INIT_HII_PACK)( + EFI_HII_HANDLE HiiHandle, + CALLBACK_INFO *pCallBackFound +); + +struct _CALLBACK_INFO{ + EFI_GUID *pGuid; +#if EFI_SPECIFICATION_VERSION>0x20000 + EFI_HII_CONFIG_ACCESS_PROTOCOL *pFormCallback; +#else + EFI_FORM_CALLBACK_PROTOCOL *pFormCallback; +#endif + UINT16 Class, SubClass; + EFI_HII_HANDLE HiiHandle; +}; + +typedef EFI_STATUS (EFIAPI *HII_UTILS_LOAD_RESOURCES)( + IN EFI_HANDLE ImageHandle, IN UINTN NumberOfCallbacks, + IN CALLBACK_INFO *CallbackInfo, IN INIT_HII_PACK InitFunction OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *HII_UTILS_LOAD_STRINGS)( + EFI_HANDLE ImageHandle, OUT EFI_HII_HANDLE *HiiHandle +); + +typedef EFI_STATUS (EFIAPI *HII_UTILS_GET_STRING)( + IN EFI_HII_HANDLE HiiHandle, IN STRING_REF StringId, + IN OUT UINTN *StringSize, OUT EFI_STRING String +); + +typedef EFI_STATUS (EFIAPI *HII_UTILS_SET_STRING)( + IN EFI_HII_HANDLE HiiHandle, IN STRING_REF StringId, IN EFI_STRING String +); + +typedef EFI_STATUS (EFIAPI *HII_UTILS_PUBLISH_PACKAGES)( + IN VOID *PackagePointers, IN UINTN NumberOfPackages, + IN EFI_GUID *PackageGuid, IN EFI_HANDLE DriverHandle OPTIONAL, + OUT EFI_HII_HANDLE *HiiHandle +); + +typedef EFI_STATUS (EFIAPI *HII_UTILS_GET_BROWSER_DATA)( + IN UINTN *BufferSize, OUT VOID *Buffer, + IN CONST EFI_GUID *VarStoreGuid OPTIONAL, + IN CONST CHAR16 *VarStoreName OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *HII_UTILS_SET_BROWSER_DATA)( + IN UINTN BufferSize, IN VOID *Buffer, + IN CONST EFI_GUID *VarStoreGuid, OPTIONAL + IN CONST CHAR16 *VarStoreName OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *HII_UTILS_GET_GLYPH_WIDTH)( + IN CHAR16 Char, OUT UINT16 *Width +); + +typedef struct{ + HII_UTILS_LOAD_RESOURCES LoadResources; + HII_UTILS_LOAD_STRINGS LoadStrings; + HII_UTILS_PUBLISH_PACKAGES PublishPackages; + HII_UTILS_GET_BROWSER_DATA GetBrowserData; + HII_UTILS_SET_BROWSER_DATA SetBrowserData; + HII_UTILS_GET_STRING GetString; + HII_UTILS_SET_STRING SetString; + HII_UTILS_GET_GLYPH_WIDTH GetGlyphWidth; +}HII_UTILITIES_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/HotKeys.h b/Include/Protocol/HotKeys.h new file mode 100644 index 0000000..eb4375b --- /dev/null +++ b/Include/Protocol/HotKeys.h @@ -0,0 +1,108 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/HotKeys.h 3 3/13/06 1:40a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/HotKeys.h $ +// +// 3 3/13/06 1:40a Felixp +// +// 2 3/04/05 10:38a Mandal +// +// 1 2/01/05 1:14a Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 10/28/04 10:19a Olegi +// +// 1 9/30/04 3:38p Olegi +// Initial HotKeys protocol checkin. + +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: HotKeys.h +// +// Description: HotKeys protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __HOT_KEYS_PROTOCOL_H__ +#define __HOT_KEYS_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_HOT_KEYS_PROTOCOL_GUID \ + {0xf1e48287, 0x3fe1, 0x4535, 0x89, 0xab, 0x48, 0xd6, 0xc3, 0xda, 0x27, 0x59} + +GUID_VARIABLE_DECLARATION(gEfiHotKeysProtocolGuid,EFI_HOT_KEYS_PROTOCOL_GUID); + +// +// Keyboard extension functions definitions +// +typedef EFI_STATUS (*KEY_EXTENDED_FUNC) (VOID* Context); + +typedef struct _KEY_ASSOCIATION { + UINT8 KeyCode; + UINT8 KeyAttrib; + BOOLEAN ReportKey; + KEY_EXTENDED_FUNC KeyExtendedFunc; + VOID* FunctionContext; +} KEY_ASSOCIATION; + +// +// Forward declaration +// +//typedef struct _HOT_KEYS_PROTOCOL HOT_KEYS_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *REGISTER_HOT_KEY) ( + IN KEY_ASSOCIATION *HotKey, + IN BOOLEAN ReplaceExisting +); + +typedef EFI_STATUS (EFIAPI *UNREGISTER_HOT_KEYS) (); + +typedef struct _HOT_KEYS_PROTOCOL { + REGISTER_HOT_KEY RegisterHotKey; + UNREGISTER_HOT_KEYS UnregisterHotKeys; +} HOT_KEYS_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/IdeBusBoard.h b/Include/Protocol/IdeBusBoard.h new file mode 100644 index 0000000..2f84bb4 --- /dev/null +++ b/Include/Protocol/IdeBusBoard.h @@ -0,0 +1,138 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Modules/IdeBus/IdeBusBoard.h 2 9/27/11 3:17a Rajeshms $ +// +// $Revision: 2 $ +// +// $Date: 9/27/11 3:17a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Modules/IdeBus/IdeBusBoard.h $ +// +// 2 9/27/11 3:17a Rajeshms +// [TAG] EIP69295 +// [Category] Improvement +// [Description] The Timeout values used by IDE and AHCI drivers are +// made as SDL tokens, so that the timeout values can be varied. +// [Files] IdeBusBoard.c, CORE_DXE.sdl, AhciSmm.h, AhciBus.h, IDESMM.h, +// Ata.c, Atapi.c, IdeBus.c, IdeBus.h, IdeBusMaster.c, IdeBusBoard.h +// +// 1 8/25/10 5:37a Rameshr +// New Feature: EIP 37748 +// Description: Move all the IDEBus Source driver SDL token into IdeBus +// Bin Driver. +// FilesModified: Ata.c, Atapi.c, idebus.c, IdeBus.h, +// IdebuscomponentName.c, IdeBusmaster.c IdeBusSrc.mak IdebusSrc.sdl +// IdeHpa.c, IdePowerManagement.c +// +// +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: IdeBusBoard.h +// +// Description: defines Platform IDE Protocol +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __IdeBusBoard__H__ +#define __IdeBusBoard__H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + +#define PLATFORM_IDE_PROTOCOL_GUID \ + { 0x6737f69b, 0xb8cc, 0x45bc, 0x93, 0x27, 0xcc, 0xf5, 0xee, 0xf7, 0xc, 0xde } + +// +// Protocol revision number +// Any backwards compatible changes to this protocol will result in an update in the revision number +// +// Revision 2: Changed from Original version to support for ATA/ATAPI timeout values as TOKENS. +// +#define PLATFORM_IDE_PROTOCOL_REVISION 2 +// +// Protocol Revision Number supported by IdeBus Source. +// +#define PLATFORM_IDE_PROTOCOL_SUPPORTED_REVISION 2 + +#ifndef EFI_COMPONENT_NAME2_PROTOCOL_GUID //old Core +#ifndef LANGUAGE_CODE_ENGLISH +#define LANGUAGE_CODE_ENGLISH "eng" +#endif +BOOLEAN LanguageCodesEqual( + CONST CHAR8* LangCode1, CONST CHAR8* LangCode2 +); +#endif + +// +// Interface structure for PLATFORM_IDE_PROTOCOL +// +typedef struct _PLATFORM_IDE_PROTOCOL { + UINT8 Revision; + BOOLEAN MasterSlaveEnumeration; + BOOLEAN IdeBusMasterSupport; + BOOLEAN AtapiBusMasterSupport; + BOOLEAN AcousticManagementSupport; + BOOLEAN IdePowerManagementSupport; + INT16 StandbyTimeout; + BOOLEAN AdvPowerManagementSupport; + UINT8 AdvPowerManagementLevel; + BOOLEAN PowerupInStandbySupport; + BOOLEAN PowerupInStandbyMode; + BOOLEAN IdePwrManagementInterfaceSupport; + BOOLEAN HostProtectedAreaSupport; + BOOLEAN IdeHPSupport; + BOOLEAN EfiIdeProtocol; + BOOLEAN AhciCompatibleMode; + BOOLEAN SBIdeSupport; + BOOLEAN HddPowerLossInS3; + BOOLEAN DiPMSupport; + BOOLEAN DisableSoftSetPrev; + BOOLEAN ForceHddPasswordPrompt; + EFI_GUID gIdeControllerProtocolGuid; + EFI_GUID gComponentNameProtocolGuid; + UINT32 S3BusyClearTimeout; + UINT32 DmaAtaCompleteCommandTimeout; + UINT32 DmaAtaPiCompleteCommandTimeout; + UINT32 AtaPiResetCommandTimeout; + UINT32 AtaPiBusyClearTimeout; + UINT32 PoweonBusyClearTimeout; +} PLATFORM_IDE_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/IdeBusBoardProtocol.cif b/Include/Protocol/IdeBusBoardProtocol.cif new file mode 100644 index 0000000..879a042 --- /dev/null +++ b/Include/Protocol/IdeBusBoardProtocol.cif @@ -0,0 +1,8 @@ +<component> + name = "IdeBusBoardProtocol" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "IdeBusBoardProtocol" +[files] +"IdeBusBoard.h" +<endComponent> diff --git a/Include/Protocol/IdeControllerInit.h b/Include/Protocol/IdeControllerInit.h new file mode 100644 index 0000000..ecd789a --- /dev/null +++ b/Include/Protocol/IdeControllerInit.h @@ -0,0 +1,358 @@ +/*++ + +Copyright (c) 2004, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + IdeControllerInit.h + +Abstract: + + EFI Platform IDE Init Protocol + +Revision History + + 0.01 - Draft, 5-01-2002 + Add Atapi6 Identify structure definition, 8-14-2002 + +--*/ + +#ifndef _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H +#define _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H + +#ifdef __cplusplus +extern "C" { +#endif + +// +// Global ID for the EFI Platform IDE Protocol GUID +// +#define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \ + { 0xa1e37052, 0x80d9, 0x4e65, 0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9 } + +GUID_VARIABLE_DECLARATION(gEfiIdeControllerInitProtocolGuid,EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID); + +//////////////////////////////////////////////////////////////////////////////////////// +// Forward reference, ANSI compatability +// +typedef struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL EFI_IDE_CONTROLLER_INIT_PROTOCOL; + +// +////////////////////////////////////////////////////////////////////////////////////////// +// EFI_IDE_BUS_ENUMERATION_PHASE +// EFI_IDE_CONTROLLER_ENUM_PHASE +// +typedef enum{ + EfiIdeBeforeChannelEnumeration, + EfiIdeAfterChannelEnumeration, + EfiIdeBeforeChannelReset, + EfiIdeAfterChannelReset, + EfiIdeBusBeforeDevicePresenceDetection, + EfiIdeBusAfterDevicePresenceDetection, + EfiIdeResetMode, + EfiIdeBusPhaseMaximum +} EFI_IDE_CONTROLLER_ENUM_PHASE; + +// +//****************************************************** +// EFI_ATA_EXT_TRANSFER_PROTOCOL +//****************************************************** +// +// This extended mode describes the SATA physical protocol. +// SATA physical layers can operate at different speeds. +// These speeds are defined below. Various PATA protocols +// and associated modes are not applicable to SATA devices. +// + +typedef enum { + EfiAtaSataTransferProtocol +} EFI_ATA_EXT_TRANSFER_PROTOCOL; + +#define EFI_SATA_AUTO_SPEED 0 +#define EFI_SATA_GEN1_SPEED 1 +#define EFI_SATA_GEN2_SPEED 2 + +// +//******************************************************* +// EFI_IDE_CABLE_TYPE +//******************************************************* +// +typedef enum { + EfiIdeCableTypeUnknown, + EfiIdeCableType40pin, + EfiIdeCableType80Pin, + EfiIdeCableTypeSerial, + EfiIdeCableTypeMaximum +} EFI_IDE_CABLE_TYPE; + +// +//****************************************************** +// EFI_ATA_MODE +//****************************************************** +// +typedef struct { + BOOLEAN Valid; + UINT32 Mode; +} EFI_ATA_MODE; + +// +//****************************************************** +// EFI_ATA_EXTENDED_MODE +//****************************************************** +// +typedef struct { + EFI_ATA_EXT_TRANSFER_PROTOCOL TransferProtocol; + UINT32 Mode; +} EFI_ATA_EXTENDED_MODE; + +// +//****************************************************** +// EFI_ATA_COLLECTIVE_MODE +//****************************************************** +// +typedef struct { + EFI_ATA_MODE PioMode; + EFI_ATA_MODE SingleWordDmaMode; + EFI_ATA_MODE MultiWordDmaMode; + EFI_ATA_MODE UdmaMode; + UINT32 ExtModeCount; + EFI_ATA_EXTENDED_MODE ExtMode[1]; +} EFI_ATA_COLLECTIVE_MODE; + +// +//******************************************************* +// EFI_ATA_IDENTIFY_DATA +//******************************************************* +// + +#pragma pack(1) + +typedef struct { + UINT16 config; // General Configuration + UINT16 cylinders; // Number of Cylinders + UINT16 reserved_2; + UINT16 heads; //Number of logical heads + UINT16 vendor_data1; + UINT16 vendor_data2; + UINT16 sectors_per_track; + UINT16 vendor_specific_7_9[3]; + CHAR8 SerialNo[20]; // ASCII + UINT16 vendor_specific_20_21[2]; + UINT16 ecc_bytes_available; + CHAR8 FirmwareVer[8]; // ASCII + CHAR8 ModelName[40]; // ASCII + UINT16 multi_sector_cmd_max_sct_cnt; + UINT16 reserved_48; + UINT16 capabilities; + UINT16 reserved_50; + UINT16 pio_cycle_timing; //51 + UINT16 reserved_52; + UINT16 field_validity; + UINT16 current_cylinders; + UINT16 current_heads; + UINT16 current_sectors; + UINT16 CurrentCapacityLsb; + UINT16 CurrentCapacityMsb; + UINT16 reserved_59; + UINT16 user_addressable_sectors_lo; + UINT16 user_addressable_sectors_hi; + UINT16 reserved_62; + UINT16 multi_word_dma_mode; + UINT16 advanced_pio_modes; //64 + UINT16 min_multi_word_dma_cycle_time; + UINT16 rec_multi_word_dma_cycle_time; + UINT16 min_pio_cycle_time_without_flow_control; + UINT16 min_pio_cycle_time_with_flow_control; //68 + UINT16 reserved_69_79[11]; + UINT16 major_version_no; + UINT16 minor_version_no; + UINT16 command_set_supported_82; // word 82 + UINT16 command_set_supported_83; // word 83 + UINT16 command_set_feature_extn; // word 84 + UINT16 command_set_feature_enb_85; // word 85 + UINT16 command_set_feature_enb_86; // word 86 + UINT16 command_set_feature_default; // word 87 + UINT16 ultra_dma_mode; // word 88 + UINT16 reserved_89_105[17]; + UINT16 phy_logic_sector_support; // word 106 + UINT16 reserved_107_116[10]; + UINT16 logic_sector_size_lo; // word 117 + UINT16 logic_sector_size_hi; // word 118 + UINT16 reserved_119_127[9]; + UINT16 security_status; + UINT16 vendor_data_129_159[31]; + UINT16 reserved_160_208[49]; + UINT16 alignment_logic_in_phy_blocks; // word 209 + UINT16 reserved_210_255[46]; +} EFI_ATA_IDENTIFY_DATA; + +#pragma pack() +// +//******************************************************* +// EFI_ATAPI_IDENTIFY_DATA +//******************************************************* +// +#pragma pack(1) +typedef struct { + UINT16 config; // General Configuration + UINT16 obsolete_1; + UINT16 specific_config; + UINT16 obsolete_3; + UINT16 retired_4_5[2]; + UINT16 obsolete_6; + UINT16 cfa_reserved_7_8[2]; + UINT16 retired_9; + CHAR8 SerialNo[20]; // ASCII + UINT16 retired_20_21[2]; + UINT16 obsolete_22; + CHAR8 FirmwareVer[8]; // ASCII + CHAR8 ModelName[40]; // ASCII + UINT16 multi_sector_cmd_max_sct_cnt; + UINT16 reserved_48; + UINT16 capabilities_49; + UINT16 capabilities_50; + UINT16 obsolete_51_52[2]; + UINT16 field_validity; + UINT16 obsolete_54_58[5]; + UINT16 mutil_sector_setting; + UINT16 user_addressable_sectors_lo; + UINT16 user_addressable_sectors_hi; + UINT16 obsolete_62; + UINT16 multi_word_dma_mode; + UINT16 advanced_pio_modes; + UINT16 min_multi_word_dma_cycle_time; + UINT16 rec_multi_word_dma_cycle_time; + UINT16 min_pio_cycle_time_without_flow_control; + UINT16 min_pio_cycle_time_with_flow_control; + UINT16 reserved_69_74[6]; + UINT16 queue_depth; + UINT16 reserved_76_79[4]; + UINT16 major_version_no; + UINT16 minor_version_no; + UINT16 cmd_set_support_82; + UINT16 cmd_set_support_83; + UINT16 cmd_feature_support; + UINT16 cmd_feature_enable_85; + UINT16 cmd_feature_enable_86; + UINT16 cmd_feature_default; + UINT16 ultra_dma_select; + UINT16 time_required_for_sec_erase; + UINT16 time_required_for_enhanced_sec_erase; + UINT16 current_advanced_power_mgmt_value; + UINT16 master_pwd_revison_code; + UINT16 hardware_reset_result; + UINT16 current_auto_acoustic_mgmt_value; + UINT16 reserved_95_99[5]; + UINT16 max_user_lba_for_48bit_addr[4]; + UINT16 reserved_104_126[23]; + UINT16 removable_media_status_notification_support; + UINT16 security_status; + UINT16 vendor_data_129_159[31]; + UINT16 cfa_power_mode; + UINT16 cfa_reserved_161_175[15]; + UINT16 current_media_serial_no[30]; + UINT16 reserved_206_254[49]; + UINT16 integrity_word; +} EFI_ATAPI_IDENTIFY_DATA; + +#pragma pack() +// +//******************************************************* +// EFI_IDENTIFY_DATA +//******************************************************* +// +typedef union { + EFI_ATA_IDENTIFY_DATA AtaData; + EFI_ATAPI_IDENTIFY_DATA AtapiData; +} EFI_IDENTIFY_DATA; + +#define EFI_ATAPI_DEVICE_IDENTIFY_DATA 0x8000 + +// +///////////////////////////////////////////////////////////////////////////////////////// +// Function prototype declaration, for ANSI compatability +// +typedef +EFI_STATUS +(*EFI_IDE_CONTROLLER_GET_CHANNEL_INFO) ( + IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, + IN UINT8 Channel, + OUT BOOLEAN *Enabled, + OUT UINT8 *MaxDevices + +); + +typedef +EFI_STATUS +(*EFI_IDE_CONTROLLER_NOTIFY_PHASE) ( + IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, + IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase, + IN UINT8 Channel +); + +typedef +EFI_STATUS +(*EFI_IDE_CONTROLLER_SUBMIT_DATA) ( + IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, + IN UINT8 Channel, + IN UINT8 Device, + IN EFI_IDENTIFY_DATA *IdentifyData +); + + +typedef +EFI_STATUS +(*EFI_IDE_CONTROLLER_DISQUALIFY_MODE) ( + IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, + IN UINT8 Channel, + IN UINT8 Device, + IN EFI_ATA_COLLECTIVE_MODE *BadModes +); + +typedef +EFI_STATUS +(*EFI_IDE_CONTROLLER_CALCULATE_MODE) ( + IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, + IN UINT8 Channel, + IN UINT8 Device, + OUT EFI_ATA_COLLECTIVE_MODE **SupportedModes +); + +// +// ?? What happen to EFI_IDE_CONTROLLER_SET_TIMING ??? +// +typedef +EFI_STATUS +(EFIAPI *EFI_IDE_CONTROLLER_SET_TIMING) ( + IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, + IN UINT8 Channel, + IN UINT8 Device, + IN EFI_ATA_COLLECTIVE_MODE *Modes +); + +// +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Interface structure +// EFI_IDE_CONTROLLER_INIT_PROTOCOL protocol provides the chipset specific information to the IDE bus driver. +// An IDE Bus driver wants to manage an IDE bus and possible IDE devices will have to retrieve the +// EFI_IDE_CONTROLLER_INIT_PROTOCOL instances. +// +typedef struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL { + EFI_IDE_CONTROLLER_GET_CHANNEL_INFO GetChannelInfo; + EFI_IDE_CONTROLLER_NOTIFY_PHASE NotifyPhase; + EFI_IDE_CONTROLLER_SUBMIT_DATA SubmitData; + EFI_IDE_CONTROLLER_DISQUALIFY_MODE DisqualifyMode; + EFI_IDE_CONTROLLER_CALCULATE_MODE CalculateMode; + EFI_IDE_CONTROLLER_SET_TIMING SetTiming; + BOOLEAN EnumAll; + UINT8 ChannelCount; +} EFI_IDE_CONTROLLER_INIT_PROTOCOL; + +#endif diff --git a/Include/Protocol/IncompatiblePciDeviceSupport.h b/Include/Protocol/IncompatiblePciDeviceSupport.h new file mode 100644 index 0000000..69a644e --- /dev/null +++ b/Include/Protocol/IncompatiblePciDeviceSupport.h @@ -0,0 +1,86 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/IncompatiblePciDeviceSupport.h 1 3/13/06 1:40a Felixp $ +// +// $Revision: 1 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/IncompatiblePciDeviceSupport.h $ +// +// 1 3/13/06 1:40a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: <This File Name> +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL_H__ +#define __INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL_GUID \ + {0xeb23f55a, 0x7863, 0x4ac2, 0x8d, 0x3d, 0x95, 0x65, 0x35, 0xde, 0x03, 0x75} + +GUID_VARIABLE_DECLARATION(gEfiIncompatiblePciDeviceSupportProtocolGuid,EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL_GUID); + +typedef struct _EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_CHECK_DEVICE) ( + IN EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL *This, + IN UINTN VendorId, + IN UINTN DeviceId, + IN UINTN Revision, + IN UINTN SubVendorId,OPTIONAL + IN UINTN SubDeviceId,OPTIONAL + OUT VOID *Configuration +); + + +typedef struct _EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL { + EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_CHECK_DEVICE CheckDevice; +} EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + diff --git a/Include/Protocol/IntelSaGopDriver.h b/Include/Protocol/IntelSaGopDriver.h new file mode 100644 index 0000000..a42e751 --- /dev/null +++ b/Include/Protocol/IntelSaGopDriver.h @@ -0,0 +1,190 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/IntelGopDriver/IntelSaGopDriverProtocol/IntelSaGopDriver.h 3 4/23/13 8:00a Ireneyang $ +// +// $Revision: 3 $ +// +// $Date: 4/23/13 8:00a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/IntelGopDriver/IntelSaGopDriverProtocol/IntelSaGopDriver.h $ +// +// 3 4/23/13 8:00a Ireneyang +// [TAG] None +// [Severity] Improvement +// [Description] Support for BIST (Built-In Self Test) Protocol. +// [Files] IntelSaGopSetup.c; IntelSaGopSetup.h; +// IntelSaGopSetup.sd; +// IntelSaGopSetup.sd; IntelSaGopSetup.sdl; +// IntelSaGopSetup.uni; IntelSaGopDriver.h; +// +// 2 8/14/12 5:49a Yurenlai +// [TAG] None +// [Severity] Important +// [Description] Implemented BIOS Integration Guide Rev 1.0 to Intel SA +// GOP driver. +// [Files] IntelSaGopDriver.cif, IntelSaGopDriver.mak, +// IntelSaGopDriver.sdl, IntelSaGopPolicy.c, +// IntelSaGopSetup.c, IntelSaGopSetup.h, +// IntelSaGopSetup.mak, +// IntelSaGopSetup.sd, IntelSaGopSetup.sdl, +// IntelSaGopSetup.uni, +// IntelSaGopSwitch.c, IntelSaGopDriver.h, NBPlatformData.h +// +// 1 3/08/12 10:57p Yurenlai +// [TAG] None +// [Category] Improvement +// [Description] Create Haswell Intel SA GOP Driver module part. +// Notice : IntelGopDriver.efi and vbt.bin is dummy files. +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: IntelSaGopDriver.h +// +// Description: GOP Specific Setup Variables and Structures +// +//<AMI_FHDR_END> +//************************************************************************* + +#ifndef _PLATFORM_GOP_POLICY_PROTOCOL_H_ +#define _PLATFORM_GOP_POLICY_PROTOCOL_H_ + +#define EFI_PLATFORM_GOP_POLICY_PROTOCOL_GUID \ + { 0xec2e931b, 0x3281, 0x48a5, 0x81, 0x7, 0xdf, 0x8a, 0x8b, 0xed, 0x3c, 0x5d } + +#define GOP_DISPLAY_BRIGHTNESS_PROTOCOL_GUID \ + { 0x6ff23f1d, 0x877c, 0x4b1b, 0x93, 0xfc, 0xf1, 0x42, 0xb2, 0xee, 0xa6, 0xa7 } + +#define GOP_DISPLAY_BIST_PROTOCOL_GUID \ + { 0xf51dd33a, 0xe57f, 0x4020, 0xb4, 0x66, 0xf4, 0xc1, 0x71, 0xc6, 0xe4, 0xf7 } + +#define PLATFORM_GOP_POLICY_PROTOCOL_REVISION_01 0x01 +#define PLATFORM_GOP_POLICY_PROTOCOL_REVISION_02 0x0222 + +#define GOP_DISPLAY_BRIGHTNESS_PROTOCOL_REVISION_01 0x01 + +#define GOP_DISPLAY_BIST_PROTOCOL_REVISION_01 0x01 + +#pragma pack(1) + +typedef +struct _GOP_DISPLAY_BRIGHTNESS_PROTOCOL GOP_DISPLAY_BRIGHTNESS_PROTOCOL; + +typedef +struct _GOP_DISPLAY_BIST_PROTOCOL GOP_DISPLAY_BIST_PROTOCOL; + +typedef enum { + LidClosed, + LidOpen, + LidStatusMax +} LID_STATUS; + +typedef enum { + Docked, + UnDocked, + DockStatusMax +} DOCK_STATUS; + +typedef +EFI_STATUS +(EFIAPI *GET_PLATFORM_LID_STATUS) ( + OUT LID_STATUS *CurrentLidStatus +); + +typedef +EFI_STATUS +(EFIAPI *GET_VBT_DATA) ( + OUT EFI_PHYSICAL_ADDRESS *VbtAddress, + OUT UINT32 *VbtSize +); + +typedef +EFI_STATUS +(EFIAPI *GET_PLATFORM_DOCK_STATUS) ( + OUT DOCK_STATUS CurrentDockStatus +); + +typedef +EFI_STATUS +(EFIAPI *GET_MAXIMUM_BRIGHTNESS_LEVEL) ( + IN GOP_DISPLAY_BRIGHTNESS_PROTOCOL *This, + OUT UINT32 *MaxBrightnessLevel +); + +typedef +EFI_STATUS +(EFIAPI *GET_CURRENT_BRIGHTNESS_LEVEL) ( + IN GOP_DISPLAY_BRIGHTNESS_PROTOCOL *This, + OUT UINT32 *CurrentBrightnessLevel +); + +typedef +EFI_STATUS +(EFIAPI *SET_BRIGHTNESS_LEVEL) ( + IN GOP_DISPLAY_BRIGHTNESS_PROTOCOL *This, + IN UINT32 BrightnessLevel +); + +typedef +EFI_STATUS +(EFIAPI *ENABLE_BIST) ( + IN GOP_DISPLAY_BIST_PROTOCOL *This +); + +typedef +EFI_STATUS +(EFIAPI *DISABLE_BIST) ( + IN GOP_DISPLAY_BIST_PROTOCOL *This +); + +#pragma pack() + +typedef struct _PLATFORM_GOP_POLICY_PROTOCOL { + UINT32 Revision; + GET_PLATFORM_LID_STATUS GetPlatformLidStatus; + GET_VBT_DATA GetVbtData; + GET_PLATFORM_DOCK_STATUS GetPlatformDockStatus; +} PLATFORM_GOP_POLICY_PROTOCOL; + +typedef struct _GOP_DISPLAY_BRIGHTNESS_PROTOCOL { + UINT32 Revision; + GET_MAXIMUM_BRIGHTNESS_LEVEL GetMaxBrightnessLevel; + GET_CURRENT_BRIGHTNESS_LEVEL GetCurrentBrightnessLevel; + SET_BRIGHTNESS_LEVEL SetBrightnessLevel; +} GOP_DISPLAY_BRIGHTNESS_PROTOCOL; + +typedef struct _GOP_DISPLAY_BIST_PROTOCOL{ + UINT32 Revision; + ENABLE_BIST EnableBist; + DISABLE_BIST DisableBist; +} GOP_DISPLAY_BIST_PROTOCOL; + +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/IntelSaGopDriverProtocol.cif b/Include/Protocol/IntelSaGopDriverProtocol.cif new file mode 100644 index 0000000..f1b4080 --- /dev/null +++ b/Include/Protocol/IntelSaGopDriverProtocol.cif @@ -0,0 +1,8 @@ +<component> + name = "IntelSaGopDriverProtocol" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "IntelSaGopDriverProtocol" +[files] +"IntelSaGopDriver.h" +<endComponent>
\ No newline at end of file diff --git a/Include/Protocol/Legacy8259.h b/Include/Protocol/Legacy8259.h new file mode 100644 index 0000000..6cf3d85 --- /dev/null +++ b/Include/Protocol/Legacy8259.h @@ -0,0 +1,174 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/Legacy8259.h 2 3/13/06 1:40a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/Legacy8259.h $ +// +// 2 3/13/06 1:40a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 7/13/04 2:33p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LEGACY8259_PROTOCOL_H__ +#define __LEGACY8259_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include<EFI.h> + +// {38321DBA-4FE0-4E17-8AEC-413055EAEDC1} +#define EFI_LEGACY_8259_PROTOCOL_GUID \ + {0x38321dba,0x4fe0,0x4e17,0x8a,0xec,0x41,0x30,0x55,0xea,0xed,0xc1} + +GUID_VARIABLE_DECLARATION(gEfiLegacy8259ProtocolGuid,EFI_LEGACY_8259_PROTOCOL_GUID); + +typedef struct _EFI_LEGACY_8259_PROTOCOL EFI_LEGACY_8259_PROTOCOL; + + +//************************************************ +// EFI_8259_MODE +//************************************************ +typedef enum { + Efi8259LegacyMode, + Efi8259ProtectedMode, + Efi8259MaxMode +} EFI_8259_MODE; + +//****************************************** +// EFI_8259_IRQ +//****************************************** +typedef enum { + Efi8259Irq0, Efi8259Irq1, + Efi8259Irq2, Efi8259Irq3, + Efi8259Irq4, Efi8259Irq5, + Efi8259Irq6, Efi8259Irq7, + Efi8259Irq8, Efi8259Irq9, + Efi8259Irq10, Efi8259Irq11, + Efi8259Irq12, Efi8259Irq13, + Efi8259Irq14, Efi8259Irq15, + Efi8259IrqMax +} EFI_8259_IRQ; + + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_SET_VECTOR_BASE) ( + IN EFI_LEGACY_8259_PROTOCOL *This, + IN UINT8 MasterBase, + IN UINT8 SlaveBase +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_GET_MASK) ( + IN EFI_LEGACY_8259_PROTOCOL *This, + OUT UINT16 *LegacyMask OPTIONAL, + OUT UINT16 *LegacyEdgeLevel OPTIONAL, + OUT UINT16 *ProtectedMask OPTIONAL, + OUT UINT16 *ProtectedEdgeLevel OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_SET_MASK) ( + IN EFI_LEGACY_8259_PROTOCOL *This, + IN UINT16 *LegacyMask OPTIONAL, + IN UINT16 *LegacyEdgeLevel OPTIONAL, + IN UINT16 *ProtectedMask OPTIONAL, + IN UINT16 *ProtectedEdgeLevel OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_SET_MODE) ( + IN EFI_LEGACY_8259_PROTOCOL *This, + IN EFI_8259_MODE Mode, + IN UINT16 *Mask OPTIONAL, + IN UINT16 *EdgeLevel OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_GET_VECTOR) ( + IN EFI_LEGACY_8259_PROTOCOL *This, + IN EFI_8259_IRQ Irq, + OUT UINT8 *Vector +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_ENABLE_IRQ) ( + IN EFI_LEGACY_8259_PROTOCOL *This, + IN EFI_8259_IRQ Irq, + IN BOOLEAN LevelTriggered +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_DISABLE_IRQ) ( + IN EFI_LEGACY_8259_PROTOCOL *This, + IN EFI_8259_IRQ Irq +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_GET_INTERRUPT_LINE) ( + IN EFI_LEGACY_8259_PROTOCOL *This, + IN EFI_HANDLE PciHandle, + OUT UINT8 *Vector +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_END_OF_INTERRUPT) ( + IN EFI_LEGACY_8259_PROTOCOL *This, + IN EFI_8259_IRQ Irq +); + +typedef struct _EFI_LEGACY_8259_PROTOCOL { + EFI_LEGACY_8259_SET_VECTOR_BASE SetVectorBase; + EFI_LEGACY_8259_GET_MASK GetMask; + EFI_LEGACY_8259_SET_MASK SetMask; + EFI_LEGACY_8259_SET_MODE SetMode; + EFI_LEGACY_8259_GET_VECTOR GetVector; + EFI_LEGACY_8259_ENABLE_IRQ EnableIrq; + EFI_LEGACY_8259_DISABLE_IRQ DisableIrq; + EFI_LEGACY_8259_GET_INTERRUPT_LINE GetInterruptLine; + EFI_LEGACY_8259_END_OF_INTERRUPT EndOfInterrupt; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/LegacyAhci.h b/Include/Protocol/LegacyAhci.h new file mode 100644 index 0000000..66873a5 --- /dev/null +++ b/Include/Protocol/LegacyAhci.h @@ -0,0 +1,110 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/AHCI/INT13/protocol/LegacyAhci.h 5 2/10/11 10:50a Rameshr $ +// +// $Revision: 5 $ +// +// $Date: 2/10/11 10:50a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/AHCI/INT13/protocol/LegacyAhci.h $ +// +// 5 2/10/11 10:50a Rameshr +// [TAG] EIP53704 +// [Category] Improvement +// [Description] AMI headers update for Alaska Ahci Driver +// [Files] LegacyAhci.h +// +// 4 5/28/08 9:42a Rameshraju +// Updated the AMI Address. +// +// 3 3/28/08 12:15p Michaela +// updated copyright +// +// 2 8/02/08 12:48p Anandakrishnanl +// Matched InitAhciSupport Parameters with c file +// +// 1 12/07/07 11:18a Olegi +// +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: LegacyAhci.h +// +// Description: AHCI INT13 initialization protocol +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LEGACY_AHCI_PROTOCOL_H__ +#define __LEGACY_AHCI_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_AHCI_INT13_INIT_PROTOCOL_GUID \ + { 0x67820532, 0x7613, 0x4dd3, 0x9e, 0xd7, 0x3d, 0x9b, 0xe3, 0xa7, 0xda, 0x63 } + +// the following ifndef is used when this .h file is included from EDK module... +#ifndef GUID_VARIABLE_DECLARATION +#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable +#endif + +GUID_VARIABLE_DECLARATION(gAint13ProtocolGuid,EFI_AHCI_INT13_INIT_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#pragma pack (1) + +typedef struct _EFI_AHCI_INT13_INIT_PROTOCOL EFI_AHCI_INT13_INIT_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_INIT_AHCI_INT13_SUPPORT) (); + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_AHCI_INT13_INIT_PROTOCOL +// +// Description: AHCI Int13 initialization protocol definition +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct _EFI_AHCI_INT13_INIT_PROTOCOL { + EFI_INIT_AHCI_INT13_SUPPORT InitAhciInt13Support; +} EFI_AHCI_INT13_INIT_PROTOCOL; + +#pragma pack () + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/LegacyBios.h b/Include/Protocol/LegacyBios.h new file mode 100644 index 0000000..ffb60da --- /dev/null +++ b/Include/Protocol/LegacyBios.h @@ -0,0 +1,1041 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/LegacyBios.h 19 3/15/11 3:48p Olegi $ +// +// $Revision: 19 $ +// +// $Date: 3/15/11 3:48p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/LegacyBios.h $ +// +// 19 3/15/11 3:48p Olegi +// [TAG] EIP55913 +// [Category] Improvement +// [Description] Remove LastOpromAddress from EFI_COMPATIBILITY16_TABLE +// structure +// [Files] Amilegacy16.bin, LegacyBios.h, LegacyBiosExt.h, Csm.c +// +// 18 1/12/10 11:51a Olegi +// Copyright message updated. +// +// 17 6/12/07 10:10a Olegi +// Changed MAX_BBS_ENTRIES_NO from 64 to 256 to comply with EDK protocol +// file. +// +// 16 4/27/07 5:17p Olegi +// CSM.CHM file preparation. +// +// 15 4/10/07 5:21p Olegi +// +// 14 2/06/07 10:47a Olegi +// +// 13 9/15/06 4:18p Davidd +// Update the EfiSystemTable type in EFI_COMPATIBILITY16_TABLE to UINT32 +// per CSM Spec Ver 0.96 +// +// 12 8/14/06 10:01a Olegi +// +// 11 5/25/06 2:30p Olegi +// +// 10 3/13/06 2:43p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: LegacyBios.h +// +// Description: LegacyBios protocol declaration +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LEGACY_BIOS_PROTOCOL_H__ +#define __LEGACY_BIOS_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_LEGACY_BIOS_PROTOCOL_GUID \ + { 0xdb9a1e3d, 0x45cb, 0x4abb, 0x85, 0x3b, 0xe5, 0x38, 0x7f, 0xdb, 0x2e, 0x2d} + +GUID_VARIABLE_DECLARATION(gEfiLegacyBiosProtocolGuid,EFI_LEGACY_BIOS_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <Protocol/DevicePath.h> +#pragma pack (1) + +typedef struct _EFI_LEGACY_BIOS_PROTOCOL EFI_LEGACY_BIOS_PROTOCOL; + +#define F0000_BIT 1 +#define E0000_BIT 2 + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_COMPATIBILITY16_TABLE +// +// Desription: +// There is a table located within the traditional BIOS in either the 0xF000:xxxx +// or 0xE000:xxxx physical address range. It is located on a 16-byte boundary and +// provides the physical address of the entry point for the Compatibility16 +// functions. These functions provide the platform-specific information that is +// required by the generic EfiCompatibility code. The functions are invoked via +// thunking by using EFI_LEGACY_BIOS_PROTOCOL.FarCall86() with the 32-bit physical +// entry point defined below. +// +// Fields: +// Signature UINT32 The string "$EFI" +// TableChecksum UINT8 The value required such that byte checksum of TableLength equals zero. +// TableLength UINT8 The length of this table. +// EfiMajorRevision UINT8 The major EFI revision for which this table was generated. +// EfiMinorRevision UINT8 The minor EFI revision for which this table was generated. +// TableMajorRevision UINT8 The major revision of this table. +// TableMinorRevision UINT8 The minor revision of this table. +// Reserved UINT16 Reserved for future usage. +// Compatibility16CallSegment UINT16 The segment of the entry point. +// Compatibility16CallOffset UINT16 The offset of the entry point. +// PnPInstallationCheckSegment UINT16 The segment of the PnP installation check structure. +// PnPInstallationCheckOffset UINT16 The offset of the PnP installation check structure. +// EfiSystemTable UINT32 The address of the EFI system resources table. +// OemIdStringPointer UINT32 The address of an OEM-provided identifier string, 0-terminated. +// AcpiRsdPtrPointer UINT32 The 32-bit physical address where ACPI RSD PTR is stored. +// OemRevision UINT16 The OEM revision number. Usage is undefined. +// E820Pointer UINT32 The 32-bit physical address where INT15 E820 data is stored. +// E820Length UINT32 The length of the E820 data and is filled in by the EfiCompatibility code. +// IrqRoutingTablePointer UINT32 The 32-bit physical address where the $PIR table is stored. +// IrqRoutingTableLength UINT32 The length of the $PIR table and is filled in by the EfiCompatibility code. +// MpTablePtr UINT32 The 32-bit physical address where the MP table is stored. +// MpTableLength UINT32 The length of the MP table and is filled in by the EfiCompatibility code. +// OemintSegment UINT16 The segment of the OEM-specific INT table/code. +// OemIntOffset UINT16 The offset of the OEM-specific INT table/code. +// Oem32Segment UINT16 The segment of the OEM-specific 32-bit table/code. +// Oem32Offset UINT16 The offset of the OEM-specific 32-bit table/code. +// Oem16Segment UINT16 The segment of the OEM-specific 16-bit table/code. +// Oem16Offset UINT16 The offset of the OEM-specific 16-bit table/code. +// TpmSegment UINT16 The segment of the TPM binary passed to 16-bit CSM. +// TpmOffset UINT16 The offset of the TPM binary passed to 16-bit CSM. +// IbvPointer UINT32 A pointer to a string identifying the independent BIOS vendor. +// PciExpressBase UINT32 This field is the base value of the start of the PCI Express memory-mapped configuration registers. +// LastpciBus UINT8 Maximum PCI bus number assigned. +// LastOpromAddress UINT32 The last address that can be occupied by the Option ROM. +// +// Notes: +// 1) The string "$EFI" denotes the start of the EfiCompatibility table. Byte 0 is +// "I," byte 1 is "F," byte 2 is "E," and byte 3 is "$" and is normally accessed +// as a DWORD or UINT32. +// 2) The E820Pointer, IrqRoutingTablePointer, and MpTablePtr values are generated +// by calling the Compatibility16GetTableAddress() function and converted to +// 32-bit physical pointers. +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct _EFI_COMPATIBILITY16_TABLE { + UINT32 Signature; + UINT8 TableChecksum; + UINT8 TableLength; + UINT8 EfiMajorRevision; + UINT8 EfiMinorRevision; + UINT8 TableMajorRevision; + UINT8 TableMinorRevision; + UINT16 Reserved; + UINT16 Compatibility16CallSegment; + UINT16 Compatibility16CallOffset; + UINT16 PnPInstallationCheckSegment; + UINT16 PnPInstallationCheckOffset; + UINT32 EfiSystemTable; + UINT32 OemIdStringPointer; + UINT32 AcpiRsdPtrPointer; + UINT16 OemRevision; + UINT32 E820Pointer; + UINT32 E820Length; + UINT32 IrqRoutingTablePointer; + UINT32 IrqRoutingTableLength; + UINT32 MpTablePtr; + UINT32 MpTableLength; + UINT16 OemIntSegment; + UINT16 OemIntOffset; + UINT16 Oem32Segment; + UINT16 Oem32Offset; + UINT16 Oem16Segment; + UINT16 Oem16Offset; + UINT16 TpmSegment; + UINT16 TpmOffset; + UINT32 IbvPointer; + UINT32 PciExpressBase; + UINT8 LastPciBus; +} EFI_COMPATIBILITY16_TABLE; + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: HDD_INFO +// +// Fields: +// Status UINT16 Status of IDE device. See Notes for details. +// Bus UINT32 PCI bus of IDE controller. +// Device UINT32 PCI device of IDE controller. +// Function UINT32 PCI function of IDE controller. +// CommandBaseAddress UINT16 Command ports base address. +// ControlBaseAddress UINT16 Control ports base address. +// BusMasterAddress UINT16 Bus master address. +// IdentifyDrive ATAPI_IDENTIFY Data that identifies the drive data. +// +// Notes: +// The values for the Status field are the following: +// HDD_PRIMARY 0x01 +// HDD_SECONDARY 0x02 +// HDD_MASTER_ATAPI 0x04 +// HDD_SLAVE_ATAPI 0x08 +// HDD_MASTER_IDE 0x20 +// HDD_SLAVE_IDE 0x40 +// HDD_SATA_PATA 0x80 +// There is one HDD_INFO structure per IDE controller. The IdentifyDrive is +// one per drive. Index 0 is master and index 1 is slave. +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct _ATAPI_IDENTIFY { + UINT16 Raw[256]; +} ATAPI_IDENTIFY; + +//************************************************* +// IDE device status values +//************************************************* + +#define HDD_PRIMARY 0x01 +#define HDD_SECONDARY 0x02 +#define HDD_MASTER_ATAPI 0x04 +#define HDD_SLAVE_ATAPI 0x08 +#define HDD_MASTER_IDE 0x20 +#define HDD_SLAVE_IDE 0x40 +#define HDD_SATA_PATA 0x80 + +typedef struct _HDD_INFO { + UINT16 Status; + UINT32 Bus; + UINT32 Device; + UINT32 Function; + UINT16 CommandBaseAddress; + UINT16 ControlBaseAddress; + UINT16 BusMasterAddress; + UINT8 HddIrq; + ATAPI_IDENTIFY IdentifyDrive[2]; +} HDD_INFO; + + +//**************************************************** +// BBS related definitions +//**************************************************** + +// +// BootPriority values +// +#define BBS_DO_NOT_BOOT_FROM 0xFFFC +#define BBS_LOWEST_PRIORITY 0xFFFD +#define BBS_UNPRIORITIZED_ENTRY 0xFFFE +#define BBS_IGNORE_ENTRY 0xFFFF +// +// Following is a description of the above fields. +// +// BBS_DO_NOT_BOOT_FROM - Removes a device from the boot list but still +// allows it to be enumerated as a valid device +// under MS-DOS*. +// BBS_LOWEST_PRIORITY - Forces the device to be the last boot device. +// BBS_UNPRIORITIZED_ENTRY - Value that is placed in the BBS_TABLE.BootPriority +// field before priority has been assigned but that +// indicates it is valid entry. Other values indicate +// the priority, with 0x0000 being the highest priority. +// BBS_IGNORE_ENTRY - When placed in the BBS_TABLE.BootPriority field, +// indicates that the entry is to be skipped. +// + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: BBS_STATUS_FLAGS +// +// Fields: +// OldPosition UINT16:4 Prior priority. +// Reserved1 UINT16:4 Reserved for future use. +// Enabled UINT16:1 If 0, ignore this entry. +// Failed UINT16:1 0-Not known if boot failure occurred; 1-Boot attempt failed. +// MediaPresent UINT16:2 State of media present, see notes. +// Reserved2 UINT16:4 Reserved for future use. +// +// Notes: +// MediaPresent field details: +// 00 = No bootable media is present in the device. +// 01 = Unknown if a bootable media present. +// 10 = Media is present and appears bootable. +// 11 = Reserved. +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT16 OldPosition : 4; + UINT16 Reserved1 : 4; + UINT16 Enabled : 1; + UINT16 Failed : 1; + UINT16 MediaPresent: 2; + UINT16 Reserved2 : 4; +} BBS_STATUS_FLAGS; + + + +//**************************************************** +// DeviceType values +//**************************************************** +#define BBS_FLOPPY 0x01 +#define BBS_HARDDISK 0x02 +#define BBS_CDROM 0x03 +#define BBS_PCMCIA 0x04 +#define BBS_USB 0x05 +#define BBS_EMBED_NETWORK 0x06 +#define BBS_BEV_DEVICE 0x80 +#define BBS_UNKNOWN 0xff + + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: BBS_TABLE +// +// Fields: +// BootPriority UINT16 The boot priority for this boot device. +// Bus UINT32 The PCI bus for this boot device. +// Device UINT32 The PCI device for this boot device. +// Function UINT32 The PCI function for the boot device. +// Class UINT8 The PCI class for this boot device.. +// SubClass UINT8 The PCI Subclass for this boot device. +// MfgString UINT32 Segment:offset address of an ASCIIZ description. +// DeviceType UINT16 BBS device type. +// StatusFlags BBS_STATUS_FLAGS Status of this boot device. +// BootHandler UINT32 Segment:Offset address of boot loader for IPL devices. +// DescString UINT32 Segment:offset address of an ASCIIZ description string. +// InitPerReserved UINT32 Reserved. +// AdditionalIrq??Handler UINT32 See notes for details. +// AssignedDriveNumber UINT8 The drive number(0x80 -0x8?) assigned by the 16-bit code. +// IBV1 UINT32 IBV specific field. +// IBV2 UINT32 IBV specific field. +// +// Notes: +// The use of AdditionalIrq??Handler fields is IBV dependent. They can be +// used to flag that an OpROM has hooked the specified IRQ. The OpROM +// may be BBS compliant as some SCSI BBS-compliant OpROMs also hook IRQ +// vectors in order to run their BIOS Setup. +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct _BBS_TABLE { + UINT16 BootPriority; + UINT32 Bus; + UINT32 Device; + UINT32 Function; + UINT8 Class; + UINT8 SubClass; + UINT16 MfgStringOffset; + UINT16 MfgStringSegment; + UINT16 DeviceType; + BBS_STATUS_FLAGS StatusFlags; + UINT16 BootHandlerOffset; + UINT16 BootHandlerSegment; + UINT16 DescStringOffset; + UINT16 DescStringSegment; + UINT32 InitPerReserved; + UINT32 AdditionalIrq13Handler; + UINT32 AdditionalIrq18Handler; + UINT32 AdditionalIrq19Handler; + UINT32 AdditionalIrq40Handler; + UINT8 AssignedDriveNumber; + UINT32 AdditionalIrq41Handler; + UINT32 AdditionalIrq46Handler; + UINT32 IBV1; + UINT32 IBV2; +} BBS_TABLE; + +#define MAX_BBS_ENTRIES_NO 256 + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_IA32_REGISTER_SET +// Name: EFI_BYTE_REGS +// Name: EFI_WORD_REGS +// Name: EFI_DWORD_REGS +// Name: EFI_FLAGS_REG +// Name: EFI_EFLAGS_REG +// +// Description: These register set definitions are used in EFI_LEGACY_BIOS_INT86 +// and EFI_LEGACY_BIOS_FARCALL86 fuctions. +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT16 CF:1; + UINT16 Reserved1:1; + UINT16 PF:1; + UINT16 Reserved2:1; + UINT16 AF:1; + UINT16 Reserved3:1; + UINT16 ZF:1; + UINT16 SF:1; + UINT16 TF:1; + UINT16 IF:1; + UINT16 DF:1; + UINT16 OF:1; + UINT16 IOPL:2; + UINT16 NT:1; + UINT16 Reserved4:1; +} EFI_FLAGS_REG; + +#define CARRY_FLAG 0x01 + +typedef struct { + UINT32 CF:1; + UINT32 Reserved1:1; + UINT32 PF:1; + UINT32 Reserved2:1; + UINT32 AF:1; + UINT32 Reserved3:1; + UINT32 ZF:1; + UINT32 SF:1; + UINT32 TF:1; + UINT32 IF:1; + UINT32 DF:1; + UINT32 OF:1; + UINT32 IOPL:2; + UINT32 NT:1; + UINT32 Reserved4:2; + UINT32 VM:1; + UINT32 Reserved5:14; +} EFI_EFLAGS_REG; + +typedef struct { + UINT32 EAX; + UINT32 EBX; + UINT32 ECX; + UINT32 EDX; + UINT32 ESI; + UINT32 EDI; + EFI_EFLAGS_REG EFlags; + UINT16 ES; + UINT16 CS; + UINT16 SS; + UINT16 DS; + UINT16 FS; + UINT16 GS; + UINT32 EBP; +} EFI_DWORD_REGS; + +typedef struct { + UINT16 AX; + UINT16 ReservedAX; + UINT16 BX; + UINT16 ReservedBX; + UINT16 CX; + UINT16 ReservedCX; + UINT16 DX; + UINT16 ReservedDX; + UINT16 SI; + UINT16 ReservedSI; + UINT16 DI; + UINT16 ReservedDI; + EFI_FLAGS_REG Flags; + UINT16 ReservedFlags; + UINT16 ES; + UINT16 CS; + UINT16 SS; + UINT16 DS; + UINT16 FS; + UINT16 GS; + UINT16 BP; + UINT16 ReservedBP; +} EFI_WORD_REGS; + +typedef struct { + UINT8 AL, AH; + UINT16 ReservedAX; + UINT8 BL, BH; + UINT16 ReservedBX; + UINT8 CL, CH; + UINT16 ReservedCX; + UINT8 DL, DH; + UINT16 ReservedDX; +} EFI_BYTE_REGS; + +typedef union { + EFI_DWORD_REGS E; + EFI_WORD_REGS X; + EFI_BYTE_REGS H; +} EFI_IA32_REGISTER_SET; + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_INT86 +// +// Description: Issues a traditional software INT. +// +// Input: +// This - Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// BiosInt - The software INT requested. +// Regs - The IA-32 registers. +// +// Output: +// FALSE INT completed. Status returned in Regs. +// TRUE INT was not completed. +// +// Referrals: EFI_IA32_REGISTER_SET +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +BOOLEAN +(EFIAPI *EFI_LEGACY_BIOS_INT86) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + IN UINT8 BiosInt, + IN OUT EFI_IA32_REGISTER_SET *Regs + ); + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_FARCALL86 +// +// Description: This function performs a far call into Compatibility16 or +// traditional OpROM code at the specified Segment:Offset. +// Input: +// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// Segment Segment of 16-bit mode call. +// Offset Offset of 16-bit mode call. +// Regs The IA-32 registers, type EFI_IA32_REGISTER_SET +// Stack Caller-allocated stack that is used to pass arguments. +// StackSize Size of Stack in bytes. +// +// Output: +// FALSE FarCall() completed. Status returned in Regs +// TRUE FarCall() was not completed. +// +// Referrals: EFI_IA32_REGISTER_SET +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +BOOLEAN +(EFIAPI *EFI_LEGACY_BIOS_FARCALL86) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + IN UINT16 Segment, + IN UINT16 Offset, + IN EFI_IA32_REGISTER_SET *Regs, + IN VOID *Stack, + IN UINTN StackSize + ); + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_CHECK_ROM +// +// Description: Tests to see if a traditional PCI ROM exists for this device +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// PciHandle The handle for this device. Type EFI_HANDLE is defined in +// InstallProtocolInterface() in the EFI 1.10 Specification. +// RomImage Pointer to the ROM image. +// RomSize The size of the ROM image. +// Flags The type of ROM discovered. Multiple bits can be set, as follows: +// 00 = No ROM +// 01 = ROM Found +// 02 = ROM is a valid legacy ROM +// +// Output: EFI_SUCCESS A traditional OpROM is available for this device. +// EFI_UNSUPPORTED A traditional OpROM is not supported. +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_CHECK_ROM) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + IN EFI_HANDLE PciHandle, + OUT VOID **RomImage, OPTIONAL + OUT UINTN *RomSize, OPTIONAL + OUT UINTN *Flags + ); + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_INSTALL_ROM +// +// Description: Shadows an OpROM +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// PciHandle The PCI PC-AT* OpROM from this device's ROM BAR will be loaded +// RomImage A PCI PC-AT ROM image. This argument is non-NULL if there is +// no hardware associated with the ROM and thus no PciHandle; otherwise it +// must be NULL. An example is the PXE base code. +// Flags The type of ROM discovered. Multiple bits can be set, as follows: +// 00 = No ROM. +// 01 = ROM found. +// 02 = ROM is a valid legacy ROM. +// DiskStart Disk number of the first device hooked by the ROM. If DiskStart is +// the same as DiskEnd, no disks were hooked. +// DiskEnd Disk number of the last device hooked by the ROM. +// RomShadowAddress Shadow address of PC-AT ROM. +// ShadowedRomSize Size in bytes of RomShadowAddress. +// +// Output: +// EFI_SUCCESS The OpROM was shadowed +// EFI_UNSUPPORTED The PciHandle was not found +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_INSTALL_ROM) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + IN EFI_HANDLE PciHandle, + IN VOID **RomImage, + OUT UINTN *Flags, + OUT UINT8 *DiskStart, OPTIONAL + OUT UINT8 *DiskEnd, OPTIONAL + OUT VOID **RomShadowAddress, OPTIONAL + OUT UINT32 *ShadowedRomSize OPTIONAL + ); + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_BOOT +// +// Description: Boots a traditional OS +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// BootOption The EFI device path from BootXXXX variable. +// LoadOptionSize Size of LoadOption. +// LoadOption The load option from BootXXXX variable. +// +// Output: +// EFI_DEVICE_ERROR Failed to boot from any boot device and +// memory is uncorrupted. +// +// Notes: This function normally never returns. It will either boot the OS +// or reset the system if memory has been "corrupted" by loading a +// boot sector and passing control to it. +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_BOOT) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + IN BBS_BBS_DEVICE_PATH *BootOption, + IN UINT32 LoadOptionsSize, + IN VOID *LoadOptions + ); + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS +// +// Description: Updates the BDA to reflect status of the Scroll Lock, +// Num Lock, and Caps Lock keys and LEDs. +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// Leds Current LED status, as follows: +// Bit 0 - Scroll Lock 0 = Off +// Bit 1 - Num Lock +// Bit 2 - Caps Lock +// Output: +// EFI_SUCCESS The BDA was updated successfully. +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + IN UINT8 Leds + ); + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_GET_BBS_INFO +// +// Description: Presents BBS information to external agents. +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// HddCount Number of HDD_INFO structures. +// HddInfo Onboard IDE controller information. +// BbsCount Number of BBS_TABLE structures. +// BbsTable BBS entry. +// +// Output: EFI_SUCCESS +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_GET_BBS_INFO) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + OUT UINT16 *HddCount, + OUT struct _HDD_INFO **HddInfo, + OUT UINT16 *BbsCount, + IN OUT struct _BBS_TABLE **BbsTable + ); + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS +// +// Description: Allows external agents to force loading of all legacy OpROMs. +// This function can be invoked before GetBbsInfo() to ensure all +// devices are counted. +// Input: +// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// +// Output: +// EFI_SUCCESS OpROMs are shadowed successfully. +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This + ); + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_PREPARE_TO_BOOT +// +// Description: This function is called when booting an EFI-aware OS with legacy +// hard disks. The legacy hard disks may or may not be the boot +// device but will be accessed by the EFI-aware OS. +// Input: +// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// BbsCount Number of BBS_TABLE structures. +// BbsTable BBS entry. +// +// Output: +// EFI_SUCCESS Boot is prepared successfully. +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_PREPARE_TO_BOOT) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + OUT UINT16 *BbsCount, + OUT struct _BBS_TABLE **BbsTable + ); + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_GET_LEGACY_REGION +// +// Description: This function is called when EFI needs to reserve an area +// in the 0xE0000 or 0xF0000 64 KB blocks. +// Input: +// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// LegacyMemorySize Requested size in bytes of the region. +// Region Requested region. +// 00 = Either 0xE0000 or 0xF0000 blocks. +// Bit0 = 1 Specify 0xF0000 block +// Bit1 = 1 Specify 0xE0000 block +// Alignment Bit-mapped value specifying the address alignment of the requested +// region. The first nonzero value from the right is alignment. +// +// Output: +// LegacyMemoryAddress Address assigned. +// EFI_SUCCESS The requested region was assigned. +// EFI_ACCESS_DENIED The function was previously invoked. +// Other The requested region was not assigned. +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_GET_LEGACY_REGION) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + IN UINTN LegacyMemorySize, + IN UINTN Region, + IN UINTN Alignment, + OUT VOID **LegacyMemoryAddress + ); + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_COPY_LEGACY_REGION +// +// Description: This function is called when copying data to the region +// assigned by EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion(). +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// LegacyMemorySize Size in bytes of the memory to copy. +// LegacyMemoryAddress The location within the region returned by +// EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion(). +// LegacyMemorySourceAddress Source of the data to copy. +// +// Output: +// EFI_SUCCESS The data was copied successfully. +// EFI_ACCESS_DENIED Either the starting or ending address is out of bounds. +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_COPY_LEGACY_REGION) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + IN UINTN LegacyMemorySize, + IN VOID *LegacyMemoryAddress, + IN VOID *LegacyMemorySourceAddress + ); + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: UDC_ATTRIBUTES +// +// Fields: +// DirectoryServiceValidity UINT8:1 This bit set indicates that the ServiceAreaData is valid. +// RacbaUsedFlag UINT8:1 This bit set indicates to use the RACBA only if DirectoryServiceValidity is 0. +// ExecuteHddDiagnosticsFlag UINT8:1 This bit set indicates to execute hard disk diagnostics. +// Reserved UINT8:5 Reserved for future use. Set to 0. +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 DirectoryServiceValidity : 1; + UINT8 RabcaUsedFlag : 1; + UINT8 ExecuteHddDiagnosticsFlag : 1; + UINT8 Reserved : 5; +} UDC_ATTRIBUTES; + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: UD_TABLE +// +// Fields: +// Attributes UDC_ATTRIBUTES This field contains the bit-mapped attributes of the PARTIES information. +// DeviceNumber UINT8 This field contains the zero-based device on which the selected ServiceDataArea is present. +// BbsTableEntryNumberForParentDevice UINT8 This field contains the zero-based index into the BbsTable for the parent device. +// BbsTableEntryNumberForBoot UINT8 This field contains the zero-based index into the BbsTable for the boot entry. +// BbsTableEntryNumberForHddDiag UINT8 This field contains the zero-based index into the BbsTable for the HDD diagnostics entry. +// BeerData UINT8[128] The raw Beer data. +// ServiceAreaData UINT8[64] The raw data of selected service area. +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UDC_ATTRIBUTES Attributes; + UINT8 DeviceNumber; + UINT8 BbsTableEntryNumberForParentDevice; + UINT8 BbsTableEntryNumberForBoot; + UINT8 BbtTableEntryNumberForHddDiag; + UINT8 BeerData[128]; + UINT8 ServiceAreaData[64]; +} UD_TABLE; + + +//---------------------------------------------------------------------------- +// PCI Bus Xlat protocol definition +// +// {CB5C54C0-230D-43db-922C-24D34F8C915C} +#define AMICSM_PCIBUSNUM_XLAT_PROTOCOL_GUID \ + {0xcb5c54c0, 0x230d, 0x43db, 0x92, 0x2c, 0x24, 0xd3, 0x4f, 0x8c, 0x91, 0x5c} + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: AMICSM_GET_PCIBUS_XLAT_NUMBER +// +// Description: This function returns the PCI bus number translated according +// to Xlat table defined in BusNumXlat.inc. This translation file +// is generated by AMISDL using "BUSNUM_XLAT" output type. +// +// Input: Build time PCI bus number - 1st coulmn of the xlat table +// +// Output: EFI_SUCCESS, real PCI bus number - 2nd column of the xlat table +// EFI_NOT_FOUND, the requested bus is not found in the xlat table +// EFI_INVALID_PARAMETER, if NULL pointer is supplied on input +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *AMICSM_GET_PCIBUS_XLAT_NUMBER) ( + IN OUT UINT8 *busNumber +); + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: AMICSM_PCIBUSNUM_XLAT_PROTOCOL +// +// Description: This protocol defines the function that returns the PCI +// according to the table generated by AMISDL out of the list +// of PCI-PCI bridges. +// Fields: +// GetXlatPciBusNum AMICSM_GET_PCIBUS_XLAT_NUMBER Returns the translated bus number +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct _AMICSM_PCIBUSNUM_XLAT_PROTOCOL { + AMICSM_GET_PCIBUS_XLAT_NUMBER GetXlatPciBusNum; +} AMICSM_PCIBUSNUM_XLAT_PROTOCOL; + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE +// +// Description: This function is called when either booting to an unconventional +// device such as a PARTIES partition and/or executing hard disk +// diagnostics. +// Input: +// This +// Indicates the EFI_LEGACY_BIOS_PROTOCOL instance. +// Attributes +// Flags used to interpret the rest of the input parameters. Type UDC_ATTRIBUTES +// is defined in Compatibility16PrepareToBoot(). +// BbsEntry +// The zero-based index into the BbsTable for the parent device. Type BBS_TABLE +// is defined in Compatibility16PrepareToBoot(). +// BeerData +// Pointer to the 128 bytes of raw Beer data. +// ServiceAreaData +// Pointer to the 64 bytes of raw service area data. It is up to the caller to +// select the appropriate service area and point to it. +// +// Output: +// EFI_INVALID_PARAMETER Either the Attribute and/or pointers do not match. +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE) ( + IN EFI_LEGACY_BIOS_PROTOCOL *This, + IN UDC_ATTRIBUTES Attributes, + IN UINTN BbsEntry, + IN VOID *BeerData, + IN VOID *ServiceAreaData + ); + + +//***************************************************************** +// Compatibility16 Functions +//***************************************************************** +typedef enum { + Compatibility16InitializeYourself, // 0000, + Compatibility16UpdateBbs, // 0001, + Compatibility16PrepareToBoot, // 0002, + Compatibility16Boot, // 0003, + Compatibility16RetrieveLastBootDevice,// 0004, + Compatibility16DispatchOprom, // 0005, + Compatibility16GetTableAddress, // 0006, + Compatibility16SetKeyboardLeds, // 0007, + Compatibility16InstallPciHandler // 0008, +} EFI_COMPATIBILITY_FUNCTIONS; + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_PROTOCOL +// +// Description: Abstracts the traditional BIOS from the rest of EFI. The +// LegacyBoot() member function allows the BDS to support booting +// a traditional OS. EFI thunks drivers that make EFI bindings for +// BIOS INT services use all the other member functions. +// Fields: +// Int86 EFI_LEGACY_BIOS_INT86 Performs traditional software INT. +// FarCall86 EFI_LEGACY_BIOS_FARCALL86 Performs a 16-bit far call. +// CheckPciRom EFI_LEGACY_BIOS_CHECK_ROM Checks if a traditional OpROM exists for this device. +// InstallPciRom EFI_LEGACY_BIOS_INSTALL_ROM Loads a traditional OpROM in traditional OpROM address space. +// LegacyBoot EFI_LEGACY_BIOS_BOOT Boots a traditional OS. +// UpdateKeyboardLedStatus EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS Updates BDA to reflect the current EFI keyboard LED status. +// GetBbsInfo EFI_LEGACY_BIOS_GET_BBS_INFO Allows an external agent, such as BIOS Setup, to get the BBS data. +// ShadowAllLegacyOproms EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS Causes all legacy OpROMs to be shadowed. +// PrepareToBoot EFI_LEGACY_BIOS_PREPARE_TO_BOOT Performs all actions prior to boot. +// GetLegacyRegion EFI_LEGACY_BIOS_GET_LEGACY_REGION Allows EFI to reserve an area in the 0xE0000 or 0xF0000 block. +// CopyLegacyRegion EFI_LEGACY_BIOS_COPY_LEGACY_REGION Allows EFI to copy data to the area specified by GetLegacyRegion. +// BootUnconventionalDevice EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE Allows the user to boot off an unconventional device. +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct _EFI_LEGACY_BIOS_PROTOCOL { + EFI_LEGACY_BIOS_INT86 Int86; + EFI_LEGACY_BIOS_FARCALL86 FarCall86; + EFI_LEGACY_BIOS_CHECK_ROM CheckPciRom; + EFI_LEGACY_BIOS_INSTALL_ROM InstallPciRom; + EFI_LEGACY_BIOS_BOOT LegacyBoot; + EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS + UpdateKeyboardLedStatus; + EFI_LEGACY_BIOS_GET_BBS_INFO GetBbsInfo; + EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS + ShadowAllLegacyOproms; + EFI_LEGACY_BIOS_PREPARE_TO_BOOT + PrepareToBootEFI; + EFI_LEGACY_BIOS_GET_LEGACY_REGION + GetLegacyRegion; + EFI_LEGACY_BIOS_COPY_LEGACY_REGION + CopyLegacyRegion; + EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE + BootUnconventionalDevice; +} EFI_LEGACY_BIOS_PROTOCOL; + +#pragma pack () + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/LegacyBiosExt.h b/Include/Protocol/LegacyBiosExt.h new file mode 100644 index 0000000..6eb801c --- /dev/null +++ b/Include/Protocol/LegacyBiosExt.h @@ -0,0 +1,440 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/LegacyBiosExt.h 37 1/10/14 12:17p Olegi $ +// +// $Revision: 37 $ +// +// $Date: 1/10/14 12:17p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/LegacyBiosExt.h $ +// +// 37 1/10/14 12:17p Olegi +// EIP149769: LegacyToEfi boot management +// Changed default setting, added new token to extend the functionality +// +// 36 10/18/13 12:39p Olegi +// EIP139866 +// Create interface to manage LegacyToEfi CSM feature +// +// 35 10/07/13 10:22a Olegi +// [TAG] EIP138427 +// [Category] New Feature +// [Description] Create interface to let OEM customers change CSM16 +// variables +// [Files] csm.c, csm.h, csmlib.c, legacybiosext.h +// +// 34 9/26/13 10:43a Olegi +// +// 33 8/14/13 8:37a Olegi +// [TAG] EIP132753 +// [Category] Improvement +// Legacy2Efi module support +// +// 32 12/26/12 3:26p Olegi +// +// 31 7/23/12 12:10p Olegi +// [TAG] EIP92416 +// [Description] Testing request for Smbios (INT)a_4.6.5.1_SMBIOS_32 +// label +// LegacyBiosExt protocol is rearranged to match the one used by the +// SMBIOS. +// +// 30 12/23/11 2:14p Olegi +// [TAG] EIP78921 +// [Category] Improvement +// [Description] CsmBlockIo should create device handle in BBS table +// +// 29 3/15/11 3:50p Olegi +// [TAG] EIP55913 +// [Category] Improvement +// [Description] Remove LastOpromAddress from EFI_COMPATIBILITY16_TABLE +// structure +// [Files] Csm.c LegacyBios.h LegacyBiosExt.h +// +// 28 3/14/11 10:00a Olegi +// [TAG] EIP54942 +// [Category] New Feature +// [Description] CLP support implementation +// [Files] CsmOprom.c LegacyBiosExt.h +// +// 27 9/13/10 5:50p Vyacheslava +// Added ReverseThunkPtrOfs variable. +// +// 26 8/18/10 5:25p Olegi +// added two fields to LEGACY16_TO_EFI_DATA_TABLE structure: offset of +// "$EFI" and offset of SMBIOS header. EIP42457 +// +// 25 7/27/10 2:14p Olegi +// Added ReverseThunkPtrOfs field to LEGACY16_TO_EFI_DATA_TABLE_STRUC +// structure. EIP39674. +// +// 24 7/08/10 11:29a Olegi +// Added EFI_AMI_LEGACYBOOT_PROTOCOL_GUID definition. +// +// 23 5/17/10 4:27p Olegi +// +// 22 5/14/10 4:09p Olegi +// +// 21 4/28/10 11:55a Olegi +// +// 20 1/27/10 6:28p Olegi +// +// 19 1/12/10 11:51a Olegi +// Copyright message updated. +// +// 18 8/07/09 4:33p Olegi +// SD binary ID definition added. +// +// 17 7/02/08 1:51p Olegi +// +// 16 5/22/08 11:47a Olegi +// Added CSM16_OEM_BEFORE_CALL_BOOT_VECTOR definition. +// +// 15 5/08/08 6:03p Olegi +// Added definition of OPROM_MULTIPLE_MODULEID +// +// 14 1/31/08 6:09p Olegi +// Modifications in AllocateEbda API +// +// 13 1/16/08 2:05p Olegi +// +// 12 1/16/08 1:54p Olegi +// AllocateEbda interface is updated. +// +// 9 12/03/07 4:01p Olegi +// Added three new interface functions: UnlockShadow, LockShadow, and +// Get16BitFuncAddress. +// +// 8 11/14/07 12:36p Olegi +// +// 7 10/24/07 12:28p Olegi +// Function AllocateEbda added to LegacyBiosExt protocol. +// +// 6 8/21/07 11:27a Olegi +// +// 5 8/09/07 4:24p Olegi +// +// 4 7/13/07 8:44a Olegi +// +// 3 6/21/07 10:31a Olegi +// +// 2 6/18/07 5:52p Olegi +// +// 1 6/13/07 10:44a Olegi +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: LegacyBiosExt.h +// +// Description: AMI extensions to LegacyBios protocol +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LEGACY_BIOS_EXT_PROTOCOL_H__ +#define __LEGACY_BIOS_EXT_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +//#include <EFI.h> +#include <Protocol\LegacyRegion.h> +#include <Protocol\LegacyBios.h> + +#define EFI_LEGACY_BIOS_EXT_PROTOCOL_GUID \ + { 0x8e008510, 0x9bb1, 0x457d, 0x9f, 0x70, 0x89, 0x7a, 0xba, 0x86, 0x5d, 0xb9 } + +GUID_VARIABLE_DECLARATION(gEfiLegacyBiosExtProtocolGuid,EFI_LEGACY_BIOS_EXT_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#pragma pack (1) + +typedef struct _EFI_LEGACY_BIOS_EXT_PROTOCOL EFI_LEGACY_BIOS_EXT_PROTOCOL; + +//**************************************************************************** +// Embedded Legacy ROM ID definitions +//**************************************************************************** +#define CSM16_VENDORID 0 +#define CSM16_DEVICEID 0 +#define CSM16_AHCI_RT_DID 1 +#define CSM16_USB_RT_DID 2 +#define CSM16_PNP_RT_DID 3 +#define CSM16_SD_BOOT_DID 4 + +//**************************************************************************** +// OEM Module ID definitions. Note: use CSM16_VENDORID and CSM16_DEVICEID as +// vendor/device ID for these modules. +//**************************************************************************** +#define CSM16_MODULEID 1 +#define SERVICEROM_MODULEID 2 +#define OEM_MODULEID 3 + +#define OPROM_MODULEID 0x20 +#define OPROM_MULTIPLE_MODULEID (0xa0 << 8) + +//**************************************************************************** +// CSM16 API equates +//**************************************************************************** +#define CSM16_OEM_HW_RESET 1 +#define CSM16_OEM_NMI 2 +#define CSM16_SMBIOS_PNP 3 +#define CSM16_OEM_AFTER_SWSMI 4 +#define CSM16_OEM_BEFORE_SWSMI 5 +#define CSM16_OEM_ON_BOOT_FAIL 6 +#define CSM16_CSP_AHCI_ACCESSHBA 7 +#define CSM16_OEM_BEFORE_CALL_BOOT_VECTOR 8 +#define CSM16_OEM_PROBE_KBC 9 +#define CSM16_OEM_VIRUS_WARNING 10 +#define CSM16_OEM_SERIAL_ACCESS 11 +#define CSM16_OEM_BEFORE_CALL_INT19 12 +#define CSM16_OEM_TRY_NEXT_BOOT 14 + +#define MAX_OEM16_FUNC_NUM 14 + +typedef struct{ + UINT16 ModuleId, VendorId, DeviceId; + UINT32 Size; +} OPROM_HEADER; + +typedef struct { + UINT16 ModuleId; + UINT16 VendorId; + UINT16 DeviceId; +} PARTIAL_OPROM_HEADER; + + +typedef EFI_STATUS (EFIAPI *EFI_AMICSM_GET_EMBEDDED_ROM) ( + IN UINT16 ModuleId, + IN UINT16 VendorId, + IN UINT16 DeviceId, + OUT VOID **ImageStart, + OUT UINTN *ImageSize +); + +typedef EFI_STATUS (EFIAPI *EFI_AMICSM_GET_BBS_TABLE) ( + IN OUT BBS_TABLE **BbsTable, + IN OUT UINT8 *BbsCount +); + +typedef EFI_STATUS (EFIAPI *EFI_AMICSM_ADD_BBS_ENTRY) ( + IN BBS_TABLE *BbsEntry +); + +typedef EFI_STATUS (EFIAPI *EFI_AMICSM_INSERT_BBS_ENTRY_AT) ( + IN EFI_LEGACY_BIOS_EXT_PROTOCOL *This, + IN OUT BBS_TABLE *BbsEntry, + IN OUT UINT8 *EntryNumber +); + +typedef EFI_STATUS (EFIAPI *EFI_AMICSM_REMOVE_BBS_ENTRY_AT) ( + IN EFI_LEGACY_BIOS_EXT_PROTOCOL *This, + IN UINT8 EntryNumber +); + +typedef EFI_STATUS (EFIAPI *EFI_AMICSM_ALLOCATE_EBDA) ( + IN EFI_LEGACY_BIOS_EXT_PROTOCOL *This, + IN UINT8 RequestedSizeKB, + OUT UINT32 *NewEbdaAddress, + OUT UINT32 *EbdaStartOffset +); + +typedef EFI_STATUS (EFIAPI *EFI_AMICSM_UNLOCK_SHADOW) ( + IN UINT8 *Address, + IN UINTN Size, + OUT UINT32 *LockUnlockAddr, + OUT UINT32 *LockUnlockSize +); + +typedef EFI_STATUS (EFIAPI *EFI_AMICSM_LOCK_SHADOW) ( + IN UINT32 LockAddr, + IN UINT32 LockSize +); + +typedef struct _LEGACY16_TO_EFI_DATA_TABLE_STRUC { + UINT32 MiscInfoAddress; // 32-bit address of misc_info variable + UINT32 RtCmosByteAddress; // 32-bit address of rt_cmos_byte variable + UINT32 SmiFlashTableAddress; // 32-bit address of RUN_CSEG:smiflash_table variable + UINT16 CdrBevOffset; + UINT16 CDROMSupportAPIOfs; + UINT16 AddedPnpFunctionsOfs; + UINT16 BaidRmdVectorCntOfs; + UINT16 ReverseThunkPtrOfs; + UINT16 ReverseThunkStackPtrOfs; + UINT16 Compatibility16TableOfs; + UINT16 SmbiosTableOfs; + UINT16 StartOfFreeE000Ofs; + UINT16 ReadjustHddPrioritiesOfs; + UINT16 BootBufferPtrOfs; +} LEGACY16_TO_EFI_DATA_TABLE_STRUC; + +typedef EFI_STATUS (*EFI_AMICSM_GET_16BIT_FUNC_ADDRESS)(UINT16 id, UINT32 *Addr); + +typedef UINTN (*EFI_AMICSM_COPY_LEGACY_TABLE)( + IN VOID *Table, + IN UINT16 TableSize, + IN UINT16 Alignment, + IN UINT16 Csm16LocationAttribute +); + +typedef EFI_STATUS (*EFI_AMICSM_INSTALL_ISA_ROM)( + IN EFI_LEGACY_BIOS_EXT_PROTOCOL *This, + IN UINTN RomAddress +); + +typedef EFI_STATUS (*EFI_AMICSM_GET_SHADOWRAM_ADDRESS)( + IN OUT UINT32 *AddrMin, + IN UINT32 AddrMax, + IN UINT32 Size, + IN UINT32 Alignment +); + +//---------------------------------// +// CSM16_CONFIGURATION definitions // +//---------------------------------//------------------------------------- +typedef enum { + Csm16FeatureGet, + Csm16FeatureSet, + Csm16FeatureReset +} CSM16_CONFIGURATION_ACTION; + +typedef enum { + Csm16HeadlessI19Retry, + Csm16I13MbrWriteProtect, + Csm16LegacyFree, + Csm16ZipHddEmulation, + Csm16NoUsbBoot, + Csm16I19Trap, + Csm16Flexboot, + Csm16GA20, + Csm16SkipGA20Deactivation, + Csm16Nmi, + Csm16CpuRealModeOnBoot, + Csm16PS2, + Csm16LegacyToEfi, + Csm16LegacyToEfiPonr, + Csm16FeatureMax +} CSM16_FEATURE; + +typedef EFI_STATUS (*EFI_AMICSM16_CONFIGURATION) ( + IN CSM16_CONFIGURATION_ACTION ConfigAction, + IN CSM16_FEATURE Param, + OUT OPTIONAL UINT32 *Data +); + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_EXT_PROTOCOL +// +// Description: Extends LegacyBios protocol with the AMI implementation specific +// CSM funcitons and data. +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct _EFI_LEGACY_BIOS_EXT_PROTOCOL { + EFI_AMICSM_GET_EMBEDDED_ROM GetEmbeddedRom; + EFI_AMICSM_ADD_BBS_ENTRY AddBbsEntry; + EFI_AMICSM_INSERT_BBS_ENTRY_AT InsertBbsEntryAt; + EFI_AMICSM_REMOVE_BBS_ENTRY_AT RemoveBbsEntryAt; + EFI_AMICSM_ALLOCATE_EBDA AllocateEbda; + EFI_AMICSM_UNLOCK_SHADOW UnlockShadow; + EFI_AMICSM_LOCK_SHADOW LockShadow; + EFI_AMICSM_GET_16BIT_FUNC_ADDRESS Get16BitFuncAddress; + EFI_AMICSM_COPY_LEGACY_TABLE CopyLegacyTable; + EFI_AMICSM_INSTALL_ISA_ROM InstallIsaRom; + EFI_AMICSM_GET_SHADOWRAM_ADDRESS GetShadowRamAddress; + EFI_AMICSM_GET_BBS_TABLE GetBbsTable; + EFI_AMICSM16_CONFIGURATION Csm16Configuration; +} EFI_LEGACY_BIOS_EXT_PROTOCOL; + +// PCI Interrupt installation protocol + +#define EFI_PCIIRQ_PGM_PROTOCOL_GUID \ + { 0x9400d59b, 0xe9c, 0x4f6c, 0xb5, 0x9a, 0xfc, 0x20, 0x0, 0x9d, 0xb9, 0xec }; + +typedef struct { + VOID *PciIo; + UINT8 Irq; +} PROGRAMMED_PCIIRQ_CTX; + +#define EFI_AMI_LEGACYBOOT_PROTOCOL_GUID \ + {0x120d28aa, 0x6630, 0x46f0, 0x81, 0x57, 0xc0, 0xad, 0xc2, 0x38, 0x3b, 0xf5}; + +VOID SignalAmiLegacyBootEvent(VOID); + +// CLP support related definitions + +// The following PCIR data structure is the extended version of PCI_DATA_STRUCTURE +// from PCI.H. It can be removed once PCI header file is generically updated. +typedef struct { + UINT32 Signature; + UINT16 VendorId; + UINT16 DeviceId; + UINT16 Reserved0; + UINT16 Length; + UINT8 Revision; + UINT8 ClassCode[3]; + UINT16 ImageLength; + UINT16 CodeRevision; + UINT8 CodeType; + UINT8 Indicator; + UINT16 MaxRtImageLength; + UINT16 CfgUtilPointer; + UINT16 ClpEntryPoint; +} PCI_PCIR30_DATA_STRUCTURE; + +#define EFI_CLP_PROTOCOL_GUID \ + {0xcbbee336, 0x2682, 0x4cd6, 0x81, 0x8b, 0xa, 0xd, 0x96, 0x7e, 0x5a, 0x67}; + +typedef struct _EFI_CLP_PROTOCOL EFI_CLP_PROTOCOL; + +typedef EFI_STATUS (*EFI_CLP_EXECUTE) ( + IN EFI_CLP_PROTOCOL *This, + IN UINT8 *CmdInputLine, + IN UINT8 *CmdResponseBuffer, + OUT UINT32 *CmdStatus +); + +typedef struct _EFI_CLP_PROTOCOL { + EFI_HANDLE Handle; + UINT16 EntrySeg; + UINT16 EntryOfs; + EFI_CLP_EXECUTE Execute; +} EFI_CLP_PROTOCOL; + +#pragma pack () + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/LegacyBiosPlatform.h b/Include/Protocol/LegacyBiosPlatform.h new file mode 100644 index 0000000..0d07a90 --- /dev/null +++ b/Include/Protocol/LegacyBiosPlatform.h @@ -0,0 +1,560 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/LegacyBiosPlatform.h 15 4/24/12 6:41p Olegi $ +// +// $Revision: 15 $ +// +// $Date: 4/24/12 6:41p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/LegacyBiosPlatform.h $ +// +// 15 4/24/12 6:41p Olegi +// [TAG] EIP86770 +// [Category] Improvement +// [Description] Added EfiGetBcvSkipDeviceList to +// EFI_GET_PLATFORM_INFO_MODE structure. +// +// 14 1/12/10 11:51a Olegi +// Copyright message updated. +// +// 13 12/02/09 9:57a Olegi +// Extended the parameters of GetPlatformInfo with +// EfiGetPlatformNmiInformation. +// +// 12 12/09/08 3:33p Olegi +// +// 11 12/04/08 5:57p Olegi +// +// 10 11/12/08 5:02p Olegi +// +// 9 4/27/07 5:49p Olegi +// +// 8 4/27/07 5:17p Olegi +// CSM.CHM file preparation. +// +// 7 3/13/06 2:43p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: LegacyBiosPlatform.h +// +// Description: LegacyBiosPlatform protocol declaration +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LEGACY_BIOS_PLATFORM_PROTOCOL_H__ +#define __LEGACY_BIOS_PLATFORM_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \ + { 0x783658a3, 0x4172, 0x4421, 0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4 } + +GUID_VARIABLE_DECLARATION(gEfiLegacyBiosPlatformProtocolGuid,EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <Protocol/DevicePath.h> +#pragma pack(1) + +typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL EFI_LEGACY_BIOS_PLATFORM_PROTOCOL; + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT +// +// Description: Prepares the attempt to boot a traditional OS. +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. +// BbsDevicePath EFI Device Path from BootXXXX variable. +// BbsTable A list of BBS entries of type BBS_TABLE. +// LoadOptionsSize Size of LoadOption in bytes. +// LoadOptions LoadOption from BootXXXX variable. +// EfiToLegacyBootTable Pointer to EFI_TO_COMPATIBILITY16_BOOT_TABLE. +// +// Output: +// EFI_SUCCESS Ready to boot. +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT) ( + IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This, + IN BBS_BBS_DEVICE_PATH *BbsDevicePath, + IN VOID *BbsTable, + IN UINT32 LoadOptionsSize, + IN VOID *LoadOptions, + IN VOID *EfiToLegacyBootTable + ); + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ +// +// Description: This function translates the given PIRQ back through all +// buses, if required, and returns the true PIRQ and associated IRQ. +// Input: +// This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. +// PciBus PCI bus number for this device. +// PciDevice PCI device number for this device. +// PciFunction PCI function number for this device. +// Pirq The PIRQ. PIRQ A = 0, PIRQ B = 1, and so on. +// PirqIrq IRQ assigned to the indicated PIRQ. +// +// Output: +// EFI_SUCCESS The PIRQ was translated. +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ) ( + IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This, + IN UINTN PciBus, + IN UINTN PciDevice, + IN UINTN PciFunction, + IN OUT UINT8 *Pirq, + OUT UINT8 *PciIrq + ); + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_PIRQ_ENTRY +// +// Description: EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition +// +// Fields: +// Pirq UINT8 If nonzero, a value assigned by the IBV. +// IrqMask UINT16 If nonzero, the IRQs that can be assigned to this device. +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 Pirq; + UINT16 IrqMask; +} EFI_LEGACY_PIRQ_ENTRY; + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_IRQ_ROUTING_ENTRY +// +// Description: EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition +// +// Fields: +// Bus UINT8 PCI bus of the entry. +// Device UINT8 PCI device of this entry. +// PirqEntry EFI_LEGACY_PIRQ_ENTRY An IBV value and IRQ mask for PIRQ pins A through D. +// Slot UINT8 If nonzero, the slot number assigned by the board manufacturer. +// Reserved UINT8 Reserved for future use. +// +// Referrals: EFI_LEGACY_PIRQ_ENTRY +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT8 Bus; + UINT8 Device; + EFI_LEGACY_PIRQ_ENTRY PirqEntry[4]; + UINT8 Slot; + UINT8 Reserved; +} EFI_LEGACY_IRQ_ROUTING_ENTRY; + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_PIRQ_TABLE_HEADER +// +// Description: EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition +// +// Fields: +// Signature UINT32 "$PIR". +// MinorVersion UINT8 0x00. +// MajorVersion UINT8 0x01 for table version 1.0. +// TableSize UINT16 0x20 + RoutingTableEntries * 0x10. +// Bus UINT8 PCI interrupt router bus. +// DevFunc UINT8 PCI interrupt router device/function. +// PciOnlyIrq UINT16 If nonzero, bit map of IRQs reserved for PCI. +// CompatibleVid UINT16 Vendor ID of a compatible PCI interrupt router. +// CompatibleDid UINT16 Device ID of a compatible PCI interrupt router. +// Minport UINT32 If nonzero, a value passed directly to the IRQ miniport's Initialize function. +// Reserved UINT8[11] Reserved for future usage. +// Checksum UINT8 This byte plus the sum of all other bytes in the LocalPirqTable equal 0x00. +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT32 Signature; + UINT8 MinorVersion; + UINT8 MajorVersion; + UINT16 TableSize; + UINT8 Bus; + UINT8 DevFun; + UINT16 PciOnlyIrq; + UINT16 CompatibleVid; + UINT16 CompatibleDid; + UINT32 Miniport; + UINT8 Reserved[11]; + UINT8 Checksum; +} EFI_LEGACY_PIRQ_TABLE_HEADER; + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY +// +// Description: EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition +// +// Fields: +// Irq UINT8 IRQ for this entry. +// Used UINT8 Status of this IRQ +// +// Notes: The field Used data definitions below: +// PCI_UNUSED 0x00 - This IRQ has not been assigned to PCI. +// PCI_USED 0xFF - This IRQ has been assigned to PCI. +// LEGACY_USED 0xFE - This IRQ has been used by an SIO legacy device and +// cannot be used by PCI. +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct { + UINT8 Irq; + UINT8 Used; +} EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY; + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE +// +// Description: Returns information associated with PCI IRQ routing. +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. +// +// RoutingTable Pointer to the PCI IRQ routing table. This location is the $PIR table +// minus the header. The contents are described by the PCI IRQ Routing Table +// Specification and consist of RoutingTableEntries of EFI_LEGACY_IRQ_ROUTING_ENTRY. +// +// RoutingTableEntries Number of entries in the PCI IRQ routing table. +// +// LocalPirqTable $PIR table. It consists of EFI_LEGACY_PIRQ_TABLE_HEADER, +// immediately followed by RoutingTable. +// +// PirqTableSize Size of $PIR table. +// +// LocalIrqPriorityTable A priority table of IRQs to assign to PCI. This table +// consists of IrqPriorityTableEntries of EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY +// and is used to prioritize the allocation of IRQs to PCI. +// +// IrqPriorityTableEntries Number of entries in the priority table. +// +// Output: +// EFI_SUCCESS Data was returned successfully. +// +// Referrals: +// EFI_LEGACY_BIOS_PLATFORM_PROTOCOL, EFI_LEGACY_IRQ_ROUTING_ENTRY, +// EFI_LEGACY_PIRQ_TABLE_HEADER, EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE) ( + IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This, + OUT VOID **RoutingTable, + OUT UINTN *RoutingTableEntries, + OUT VOID **LocalPirqTable, OPTIONAL + OUT UINTN *PirqTableSize, OPTIONAL + OUT VOID **LocalIrqPriorityTable, OPTIONAL + OUT UINTN *IrqPriorityTableEntries OPTIONAL + ); + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_GET_PLATFORM_HOOK_MODE +// +// Description: Mode definitions for EFI_LEGACY_BIOS_PLATFORM_HOOKS +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef enum { + EfiPlatformHookPrepareToScanRom = 0, + EfiPlatformHookShadowServiceRoms = 1, + EfiPlatformHookAfterRomInit = 2 +} EFI_GET_PLATFORM_HOOK_MODE; + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_PLATFORM_HOOKS +// +// Description: Allows platform to perform any required action after a LegacyBios +// operation. +// Input: +// DeviceHandle List of PCI devices in the system. +// ShadowAddress First free OpROM area, after other OpROMs have been dispatched. +// Compatibility16Table Pointer to the Compatibility16 Table. +// AdditionalData Pointer to additional data returned - mode specific. +// +// Output: +// EFI_SUCCESS The operation performed successfully. +// EFI_UNSUPPORTED Mode is not supported on this platform. +// EFI_SUCCESS Mode specific. +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> +struct _EFI_COMPATIBILITY16_TABLE; +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS) ( + IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This, + IN EFI_GET_PLATFORM_HOOK_MODE Mode, + IN UINT16 Type, + IN EFI_HANDLE OPTIONAL DeviceHandle, + IN OUT UINTN OPTIONAL *ShadowAddress, + IN struct _EFI_COMPATIBILITY16_TABLE *Compatibility16Table, + OUT VOID OPTIONAL **AdditionalData + ); + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_PLATFORM_SMM_INIT +// +// Description: Loads and registers the Compatibility16 handler with the EFI SMM code. +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. +// EfiToCompatibility16BootTable The boot table passed to the Compatibility16. +// +// Output: +// EFI_SUCCESS The SMM code loaded. +// EFI_DEVICE_ERROR The SMM code failed to load. +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT) ( + IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This, + IN VOID *EfiToCompatibility16BootTable + ); + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_GET_PLATFORM_HANDLE_MODE +// +// Description: Mode definitions for EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef enum { + EfiGetPlatformVgaHandle = 0, + EfiGetPlatformIdeHandle = 1, + EfiGetPlatformIsaBusHandle = 2, + EfiGetPlatformUsbHandle = 3 +} EFI_GET_PLATFORM_HANDLE_MODE; + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE +// +// Description: Returns a buffer of handles for the requested subfunction. +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. +// Mode Specifies what handle to return. +// GetVgaHandle +// GetIdeHandle +// GetIsaBusHandle +// GetUsbHandle +// Type Handle Modifier - Mode specific +// HandleBuffer Pointer to buffer containing all Handles matching the specified criteria. +// Handles are sorted in priority order. Type EFI_HANDLE is defined in +// InstallProtocolInterface() in the EFI 1.10 Specification. +// HandleCount Number of handles in HandleBuffer. +// AdditionalData Pointer to additional data returned - mode specific.. +// +// Output: +// EFI_SUCCESS The handle is valid. +// EFI_UNSUPPORTED Mode is not supported on this platform. +// EFI_NOT_FOUND The handle is not known. +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE) ( + IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This, + IN EFI_GET_PLATFORM_HANDLE_MODE Mode, + IN UINT16 Type, + OUT EFI_HANDLE **HandleBuffer, + OUT UINTN *HandleCount, + OUT VOID OPTIONAL **AdditionalData + ); + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_GET_PLATFORM_INFO_MODE +// +// Description: Mode definitions for EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef enum { + EfiGetPlatformBinaryMpTable = 0, + EfiGetPlatformBinaryOemIntData = 1, + EfiGetPlatformBinaryOem16Data = 2, + EfiGetPlatformBinaryOem32Data = 3, + EfiGetPlatformBinaryTpmBinary = 4, + EfiGetPlatformBinarySystemRom = 5, + EfiGetPlatformPciExpressBase = 6, + EfiGetPlatformPmmSize = 7, + EfiGetPlatformEndRomShadowAddr = 8, + EfiGetPlatformOpromVideoMode = 9, + EfiGetPlatformIntSaveRestoreTable = 10, + EfiGetPlatformPciIrqMask = 11, + EfiGetPlatformGateA20Information = 12, + EfiGetPlatformNmiInformation = 13, + EfiGetBcvSkipDeviceList = 14, +} EFI_GET_PLATFORM_INFO_MODE; + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO +// +// Description: Finds the binary data or other platform information. +// Refer to the subfunctions for additional information. +// +// Input: +// This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance. +// Mode Specifies what data to return: +// GetMpTable +// GetOemIntData +// GetOem16Data +// GetOem32Data +// GetTpmBinary +// GetSystemRom +// GetPciExpressBase +// GetPmmSize +// GetPlatformEndRomShadowAddr +// EfiGetOpromVideoSwitchingMode +// EfiGetInterruptSaveRestoreTable +// +// Table Pointer to OEM legacy 16-bit code or data. +// TableSize Size of data. +// Location Location to place table. 0x00 - Either 0xE0000 or 0xF0000 64 KB blocks. +// Bit 0 = 1 0xF0000 64 KB block. +// Bit 1 = 1 0xE0000 64 KB block. +// Note: Multiple bits can be set. +// Alignment Bit-mapped address alignment granularity. The first nonzero bit from the +// right is the address granularity. +// LegacySegment Segment where EfiCompatibility code will place the table or data. +// LegacyOffset Offset where EfiCompatibility code will place the table or data. +// +// Output: +// EFI_SUCCESS The data was returned successfully. +// EFI_UNSUPPORTED Mode is not supported on this platform. +// EFI_NOT_FOUND Binary image not found. +// +// Referrals: EFI_GET_PLATFORM_INFO_MODE +// +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> + +typedef +EFI_STATUS +(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO) ( + IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This, + IN EFI_GET_PLATFORM_INFO_MODE Mode, + IN OUT VOID **Table, + IN OUT UINTN *TableSize, + IN OUT UINTN *Location, + OUT UINTN *Alignment, + IN UINT16 LegacySegment, + IN UINT16 LegacyOffset + ); + + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EFI_LEGACY_BIOS_PLATFORM_PROTOCOL +// +// Description: The EFI_LEGACY_BIOS_PLATFORM_PROTOCOL is used to abstract the +// platform-specific traditional hardware and or policy decisions +// from the generic EfiCompatibility code. +// Fields: +// GetPlatformInfo EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO Gets binary data or other platform information. +// GetPlatformHandle EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE Returns a buffer of all handles matching the requested subfunction. +// SmmInit EFI_LEGACY_BIOS_PLATFORM_SMM_INIT Loads and initializes the traditional BIOS SMM handler. +// PlatformHooks EFI_LEGACY_BIOS_PLATFORM_HOOKS Allows platform to perform any required actions after a LegacyBios operation. +// GetRoutingTable EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE Gets $PIR table. +// TranslatePirq EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ Translates the given PIRQ to the final value after traversing any PCI bridges. +// PrepareToBoot EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT Final platform function before the system attempts to boot to a traditional OS. +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL { + EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo; + EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle; + EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit; + EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks; + EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable; + EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq; + EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot; +} EFI_LEGACY_BIOS_PLATFORM_PROTOCOL; + +#pragma pack() + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/LegacyInterrupt.h b/Include/Protocol/LegacyInterrupt.h new file mode 100644 index 0000000..adec21f --- /dev/null +++ b/Include/Protocol/LegacyInterrupt.h @@ -0,0 +1,119 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/CSM/Generic/protocol/LegacyInterrupt.h 5 1/12/10 11:51a Olegi $ +// +// $Revision: 5 $ +// +// $Date: 1/12/10 11:51a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/CSM/Generic/protocol/LegacyInterrupt.h $ +// +// 5 1/12/10 11:51a Olegi +// Copyright message updated. +// +// 4 4/27/07 5:17p Olegi +// CSM.CHM file preparation. +// +// 3 3/13/06 2:43p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 10/26/04 9:48a Olegi +// +// 2 8/24/04 3:56p Markw +// Fixed ifndef in *.h file. +// +// 1 8/24/04 3:55p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: LegacyInterrupt.h +// +// Description: Legacy Interrupt driver header file +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LEGACY_INTERRUPT_PROTOCOL_H__ +#define __LEGACY_INTERRUPT_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// { 31CE593D-108A-485D-ADB2-78F21F2966BE } +#define EFI_LEGACY_INTERRUPT_PROTOCOL_GUID \ + {0x31ce593d,0x108a,0x485d,0xad,0xb2,0x78,0xf2,0x1f,0x29,0x66,0xbe} + +GUID_VARIABLE_DECLARATION(gEfiLegacyInterruptProtocolGuid,EFI_LEGACY_INTERRUPT_PROTOCOL_GUID); + +typedef struct _EFI_LEGACY_INTERRUPT_PROTOCOL EFI_LEGACY_INTERRUPT_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS) ( + IN EFI_LEGACY_INTERRUPT_PROTOCOL *This, + OUT UINT8 *NumberPirqs +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_INTERRUPT_GET_LOCATION) ( + IN EFI_LEGACY_INTERRUPT_PROTOCOL *This, + OUT UINT8 *Bus, + OUT UINT8 *Device, + OUT UINT8 *Function +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_INTERRUPT_READ_PIRQ) ( + IN EFI_LEGACY_INTERRUPT_PROTOCOL *This, + IN UINT8 PirqNumber, + OUT UINT8 *PirqData +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_INTERRUPT_WRITE_PIRQ) ( + IN EFI_LEGACY_INTERRUPT_PROTOCOL *This, + IN UINT8 PirqNumber, + IN UINT8 PirqData +); + + +typedef struct _EFI_LEGACY_INTERRUPT_PROTOCOL { + EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS GetNumberPirqs; + EFI_LEGACY_INTERRUPT_GET_LOCATION GetLocation; + EFI_LEGACY_INTERRUPT_READ_PIRQ ReadPirq; + EFI_LEGACY_INTERRUPT_WRITE_PIRQ WritePirq; +} EFI_LEGACY_INTERRUPT_PROTOCOL; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/LegacyRegion.h b/Include/Protocol/LegacyRegion.h new file mode 100644 index 0000000..43f2ad0 --- /dev/null +++ b/Include/Protocol/LegacyRegion.h @@ -0,0 +1,129 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/LegacyRegion/LegacyRegion Protocols/LegacyRegion.h 1 4/02/13 6:28a Ireneyang $ +// +// $Revision: 1 $ +// +// $Date: 4/02/13 6:28a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/LegacyRegion/LegacyRegion Protocols/LegacyRegion.h $ +// +// 1 4/02/13 6:28a Ireneyang +// +// 1 12/20/12 12:40p Olegi +// +// 5 1/12/10 11:51a Olegi +// Copyright message updated. +// +// 4 4/27/07 5:17p Olegi +// CSM.CHM file preparation. +// +// 3 3/13/06 2:43p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 10/26/04 9:48a Olegi +// +// 1 8/30/04 3:13p Markw +// +// 2 8/24/04 3:56p Markw +// Fixed ifndef in *.h file. +// +// 1 8/24/04 3:55p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: LegacyRegion.h +// +// Description: LegacyRegion protocol API declaration +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LEGACY_REGION_PROTOCOL_H__ +#define __LEGACY_REGION_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +//{0FC9013A-0568-4BA9-9B7E-C9C390A6609B} +#define EFI_LEGACY_REGION_PROTOCOL_GUID \ + {0xfc9013a,0x568,0x4ba9,0x9b,0x7e,0xc9,0xc3,0x90,0xa6,0x60,0x9b} + +GUID_VARIABLE_DECLARATION(gEfiLegacyRegionProtocolGuid,EFI_LEGACY_REGION_PROTOCOL_GUID); + +typedef struct _EFI_LEGACY_REGION_PROTOCOL EFI_LEGACY_REGION_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_DECODE) ( + IN EFI_LEGACY_REGION_PROTOCOL *This, + IN UINT32 Start, + IN UINT32 Length, + IN BOOLEAN *On +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_LOCK) ( + IN EFI_LEGACY_REGION_PROTOCOL *This, + IN UINT32 Start, + IN UINT32 Length, + OUT UINT32 *Granularity OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_BOOT_LOCK) ( + IN EFI_LEGACY_REGION_PROTOCOL *This, + IN UINT32 Start, + IN UINT32 Length, + OUT UINT32 *Granularity OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_UNLOCK) ( + IN EFI_LEGACY_REGION_PROTOCOL *This, + IN UINT32 Start, + IN UINT32 Length, + OUT UINT32 *Granularity OPTIONAL +); + + +struct _EFI_LEGACY_REGION_PROTOCOL { + EFI_LEGACY_REGION_DECODE Decode; + EFI_LEGACY_REGION_LOCK Lock; + EFI_LEGACY_REGION_BOOT_LOCK BootLock; + EFI_LEGACY_REGION_UNLOCK UnLock; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/LegacyRegion2.h b/Include/Protocol/LegacyRegion2.h new file mode 100644 index 0000000..17ee599 --- /dev/null +++ b/Include/Protocol/LegacyRegion2.h @@ -0,0 +1,148 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/LegacyRegion/LegacyRegion Protocols/LegacyRegion2.h 1 4/02/13 6:28a Ireneyang $ +// +// $Revision: 1 $ +// +// $Date: 4/02/13 6:28a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/LegacyRegion/LegacyRegion Protocols/LegacyRegion2.h $ +// +// 1 4/02/13 6:28a Ireneyang +// +// 1 12/20/12 12:40p Olegi +// +// 2 5/24/11 2:04p Olegi +// Header/footer updated. +// +// 6 1/13/10 2:13p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: LegacyRegion2.h +// +// Description: LegacyRegion2 protocol definition (PI 1.2, Volume 5) +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LEGACY_REGION2_PROTOCOL_H__ +#define __LEGACY_REGION2_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <Efi.h> + +#define EFI_LEGACY_REGION2_PROTOCOL_GUID \ + { 0x70101eaf, 0x85, 0x440c, 0xb3, 0x56, 0x8e, 0xe3, 0x6f, 0xef, 0x24, 0xf0 } + +GUID_VARIABLE_DECLARATION(gEfiLegacyRegion2ProtocolGuid,EFI_LEGACY_REGION2_PROTOCOL_GUID); + +typedef struct _EFI_LEGACY_REGION2_PROTOCOL EFI_LEGACY_REGION2_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION2_DECODE)( + IN EFI_LEGACY_REGION2_PROTOCOL *This, + IN UINT32 Start, + IN UINT32 Length, + OUT UINT32 *Granularity, + IN BOOLEAN *On +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION2_LOCK)( + IN EFI_LEGACY_REGION2_PROTOCOL *This, + IN UINT32 Start, + IN UINT32 Length, + OUT UINT32 *Granularity +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION2_BOOT_LOCK)( + IN EFI_LEGACY_REGION2_PROTOCOL *This, + IN UINT32 Start, + IN UINT32 Length, + OUT UINT32 *Granularity OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION2_UNLOCK)( + IN EFI_LEGACY_REGION2_PROTOCOL *This, + IN UINT32 Start, + IN UINT32 Length, + OUT UINT32 *Granularity +); + +typedef enum { + LegacyRegionDecoded, ///< This region is currently set to allow reads. + LegacyRegionNotDecoded, ///< This region is currently set to not allow reads. + LegacyRegionWriteEnabled, ///< This region is currently set to allow writes. + LegacyRegionWriteDisabled, ///< This region is currently set to write protected. + LegacyRegionBootLocked, ///< This region's attributes are locked, cannot be modified until + ///< after a power cycle. + LegacyRegionNotLocked ///< This region's attributes are not locked. +} EFI_LEGACY_REGION_ATTRIBUTE; + +typedef struct { + /// The beginning of the physical address of this + /// region. + UINT32 Start; + /// The number of bytes in this region. + UINT32 Length; + /// Attribute of the Legacy Region Descriptor that + /// describes the capabilities for that memory region. + EFI_LEGACY_REGION_ATTRIBUTE Attribute; + /// Describes the byte length programmability + /// associated with the Start address and the specified + /// Attribute setting. + UINT32 Granularity; +} EFI_LEGACY_REGION_DESCRIPTOR; + +typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_GET_INFO)( + IN EFI_LEGACY_REGION2_PROTOCOL *This, + OUT UINT32 *DescriptorCount, + OUT EFI_LEGACY_REGION_DESCRIPTOR **Descriptor +); + +/// The EFI_LEGACY_REGION2_PROTOCOL is used to abstract the hardware control of the memory +/// attributes of the Option ROM shadowing region, 0xC0000 to 0xFFFFF. +/// There are three memory attributes that can be modified through this protocol: read, write and +/// boot-lock. These protocols may be set in any combination. +struct _EFI_LEGACY_REGION2_PROTOCOL { + EFI_LEGACY_REGION2_DECODE Decode; + EFI_LEGACY_REGION2_LOCK Lock; + EFI_LEGACY_REGION2_BOOT_LOCK BootLock; + EFI_LEGACY_REGION2_UNLOCK UnLock; + EFI_LEGACY_REGION_GET_INFO GetInfo; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/LegacyRegionProtocols.cif b/Include/Protocol/LegacyRegionProtocols.cif new file mode 100644 index 0000000..ede35cc --- /dev/null +++ b/Include/Protocol/LegacyRegionProtocols.cif @@ -0,0 +1,10 @@ +<component> + name = "LegacyRegion Protocols" + category = ModulePart + LocalRoot = "Include\Protocol" + RefName = "LEGACY_REGION_PROTOCOLS" + +[files] +"LegacyRegion.h" +"LegacyRegion2.h" +<endComponent> diff --git a/Include/Protocol/LegacySredir.h b/Include/Protocol/LegacySredir.h new file mode 100644 index 0000000..28b06c5 --- /dev/null +++ b/Include/Protocol/LegacySredir.h @@ -0,0 +1,361 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/Legacy Serial Redirection/LegacySredir.h 22 11/18/14 5:30a Anandakrishnanl $ +// +// $Revision: 22 $ +// +// $Date: 11/18/14 5:30a $ +//********************************************************************** +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/Legacy Serial Redirection/LegacySredir.h $ +// +// 22 11/18/14 5:30a Anandakrishnanl +// [TAG] EIP192802 +// [Category] Improvement +// [Description] Support for legacy redirection by UART polling is added +// for platforms in which serial port does not support IRQ on PIC Mode. +// [Files] LegacySredir.c,LegacySredir.h,LegacySredir.sdl +// +// 21 12/10/13 7:13a Divyac +// [TAG] EIP146597 +// [Category] Bug Fix +// [Severity] Important +// [Symptom] Build Error in Legacy Serial Redirection for label +// 4.5.5_LegacySredir_37 +// [RootCause] Modules Which were consuming EFI_LEGACY_SREDIR_PROTOCOL +// had been throwing error, since the Protocol header file LegacySredir.h +// has been updated. +// [Solution] Added #define Macros for backward Compatibility +// [Files] LegacySredir.h +// +// 20 12/09/13 5:21a Divyac +// [TAG] EIP129549 +// [Category] Improvement +// [Description] Serial Redirection has dependency on Amilegacy16.bin +// [Files] LegacySredir.c, LegacySredir.h, OR_MOD.EQU, SREDIR.ASM +// +// 19 12/09/13 4:51a Divyac +// [TAG] EIP146051 +// [Category] Improvement +// [Description] Refresh Key needs to be configured via SDL token for +// Legacy Serial Redirection. +// [Files] LegacySredir.c, LegacySredir_Setup.C, LegacySredir.h, +// Sredir.bin +// +// 18 2/29/12 11:39p Rameshr +// [TAG] EIP82480 +// [Category] Bug Fix +// [Severity] Important +// [Symptom] System does not boot to Legacy Devices when Launch Video +// OpRom DISABLED +// [RootCause] Temp buffer address is not correct +// [Solution] Redirection uses the 0x9F000 are temp buffer to save the +// Video data. It should have been calculated in runtime based on the Base +// memory allocated for sredir.bin +// [Files] Legacysredir.c, LegacySredir.h +// +// 17 2/27/12 6:05a Jittenkumarp +// [TAG] EIP81401 +// [Category] New Feature +// [Description] Select Redirection After BIOS POST as BootLoader in +// serial redirection, the behaviour is made same as Core8. +// [Files] LegacySredir.c, LegacySredir.mak, LegacySredir.sdl, +// LegacySredir_Setup.c, LegacySredir.h ,SerialBootCall.asm, +// SredirBootFail.asm,GRAPHREDIR.ASM, INT10REDIR.ASM, OR_MOD.EQU, +// SREDIR.ASM,LegacySredir.cif +// +// 16 12/28/11 10:56p Rajeshms +// [TAG] EIP65051 +// [Category] Improvement +// [Description] Data passing between EFI to Legacy has been changed in +// Legacy console redirection as we are running out of registers to pass +// parameters from EFI to Legacy. +// [Files] LegacySredir.c, LegacySredir.h, LegacySredir_Setup.C, +// SREDIR.ASM, OR_MOD.ASM, OR_MOD.EQU +// +// 15 11/09/11 11:53p Rajeshms +// [TAG]- EIP 63665 +// [Category]-IMPROVEMENT +// [Description]- Install Linux(Legacy OS) through remote. Some Linux +// versions are forced to text mode to redirect and some are redirected in +// graphics mode itself. It might not work for all the Linux versions as +// the Linux kernel's behave differently. +// [Files]- Terminal.sdl, Terminal.uni, Terminal.sd, LegacySredir.c, +// LegacySredir.h, LegacySredir_Setup.c, GRAPHREDIR.ASM, INT10REDIR.ASM, +// OR_MOD.ASM, OR_MOD.EQU, SREDIR.ASM +// +// 14 8/16/11 4:46p Davidd +// [TAG] EIP55337 +// [Category] New Feature +// [Description] Add optional code to clear keyboard buffer at +// ReadyToBoot in Legacy Serial Redirection driver +// [Files] LegacySredir.c +// LegacySredir.h +// LegacySredir.sdl +// Sredir.asm +// +// 13 7/13/11 2:40a Rajeshms +// [TAG]- EIP 36444 +// [Category]- New Feature +// [Description]- Add Setup option for Various Putty keyPad support in +// Legacy console redirection driver +// [Files]- LegacySredir.c, LegacySredir.h, LegacySredir_Setup.C, +// SREDIR.ASM, KEYREDIR.ASM, OR_MOD.EQU, SREDIR.MAK +// +// 12 6/14/11 5:38a Rameshr +// [TAG]- EIP 58140 +// [Category]- New Feature +// [Description]- Add Setup option for Vt-UTF8 combo key support in Legacy +// console redirection driver +// [Files]- Sredir.asm, Legacysredir.c, Legacysredir.h, +// Legacysredir_setup.c +// +// 11 5/03/10 1:22a Rameshr +// Issue:Need to handle different Base Hz values for SerialStatusCode, +// Terminal, and Legacy Serial Redirection. +// Solution: Moved Uart input clock into Core.sdl token and used in all +// the above modules. +// EIP: 37332 +// +// 10 4/13/10 4:15a Rameshr +// Recorder Mode support added +// EIP 36514 +// Some of the MMIO COM port has non standard bits implemented. These bits +// are reset to 0 in Sredir.bin +// EIP 37123 +// +// 9 3/05/10 4:43a Rameshr +// +// 8 3/05/10 4:38a Rameshr +// MMIO COM device support added. +// EIP 33847 +// +// 7 3/05/10 1:33a Rameshr +// Sredir.bin Version added +// +// 6 10/23/09 10:47a Yul +// EIP 24167 and EIP 26405 +// Serial redirection selection of 80X24 or 80X25 implemented based on +// setup question instead of BUILD token +// +// 5 6/29/09 12:12p Rameshr +// Coding Standard and File header updated. +// +// 4 4/21/09 2:09p Rameshr +// Build problem Resolved +// +// 3 4/21/09 12:16p Rameshr +// Updated the Legacy console redirection to get the Databits,Parity and +// Stop bits from the Terminal Driver Setup option +// EIP20874-Legacy serial redirection is using hra coded values for +// Databits as 8, Parity as None and Stop bit as 1 +// +// 2 4/17/07 4:43a Rameshraju +// PCIserial support added +// +//********************************************************************** + +//<AMI_FHDR_START> +//**************************************************************************** +// +// Name: LegacySreDir.h +// +// Description: Legacy console redirection Protocol header file +//**************************************************************************** +//<AMI_FHDR_END> + +#ifndef __LEGACY_SREDIR_PROTOCOL_H__ +#define __LEGACY_SREDIR_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + +#define AMI_LEGACY_SREDIR_PROTOCOL_GUID \ + { 0xA062CF1F, 0x8473, 0x4aa3, 0x87, 0x93, 0x60, 0x0B, 0xC4, 0xFF, 0xA9, 0xA9 } + +#define EFI_LEGACY_SREDIR_PROTOCOL_GUID AMI_LEGACY_SREDIR_PROTOCOL_GUID + +#ifndef GUID_VARIABLE_DECLARATION +#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable +#endif + +GUID_VARIABLE_DECLARATION( gAmiLegacySredirProtocolGuid, AMI_LEGACY_SREDIR_PROTOCOL_GUID); +#define gEfiLegacySredirProtocolGuid gAmiLegacySredirProtocolGuid + +#ifndef GUID_VARIABLE_DEFINITION +typedef struct _AMI_LEGACY_SREDIR_PROTOCOL AMI_LEGACY_SREDIR_PROTOCOL; + +#define SREDIR_VENDORID 0x7 +#define SREDIR_DEVICEID 0x9 +#define SREDIR_MODULEID 0x3 + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: AMI_LEGACYSREDIR_TABLE +// +// Desription: There is a table located within the traditional BIOS.It is located on a 16-byte +// boundary and provides the physical address of the entry point for the Legacy Redirection +// functions. These functions provide the platform-specific information that is +// required by the generic EfiCompatibility code. The functions are invoked via +// thunking by using EFI_LEGACY_BIOS_PROTOCOL.FarCall86() with the 32-bit physical +// entry point defined below. +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +#pragma pack(1) +typedef struct _AMI_LEGACYSREDIR_TABLE { + UINT32 Signature; + UINT8 Version; + UINT8 TableChecksum; + UINT8 TableLength; + UINT16 SreDirSegment; + UINT16 SreDirOffset; + UINT16 SreDirEfiToLegacyOffset; +} AMI_LEGACYSREDIR_TABLE; +#pragma pack() + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: AMI_LEGACYSREDIR_FUNCTIONS +// +// Description: This structure consists of functions which are used for Leagcy Redirection +// +// Fields: +// +// LEGACY_SreDirInitializeSerialPort : Initialises the Serial Port +// LEGACY_SerialRedirection : Starts the Legacy Serial Redirection by hooking the required interrupts +// LEGACY_ReleaseSerialRedirection : Stops the Legacy Serial Redirection by Releasing the corresponding interrupts +// LEGACY_InvalidFunction_FAR : Invalid function +// +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> + +typedef enum { + LEGACY_SreDirInitializeSerialPort, // 0000, + LEGACY_SerialRedirection, // 0001, + LEGACY_ReleaseSerialRedirection, // 0002, + LEGACY_GetInterruptAddress, // 0003, + LEGACY_ClearKbCharBuffer, // 0004, + LEGACY_InvalidFunction_FAR, // 0005 +} AMI_LEGACYSREDIR_FUNCTIONS; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: AMI_COM_PARAMETERS +// +// Description: This structure consists of Com parameters and setup values +// which are used to transfer the data from EFI to Legacy for +// Legacy Redirection. +// +// +// Notes: Don't Change this structure,as the same structure is defined in +// CSM16 Serial Redirection. +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +#pragma pack(1) +typedef struct _AMI_COM_PARAMETERS { + UINT32 SdlParameters; + UINT16 BaseAddress; + UINT32 MMIOBaseAddress; + UINT8 SerialIRQ; + UINT32 Baudrate; + UINT8 TerminalType; + UINT8 FlowControl; + UINT8 DataParityStop; + UINT8 LegacyOsResolution; + UINT8 RecorderMode; + UINT8 VtUtf8; + UINT8 PuttyKeyPad; + UINT8 SwSMIValue; + UINT8 InstallLegacyOSthroughRemote; + UINT16 SredirBinSize; + + UINT8 RedirectionAfterBiosPost; + UINT8 Flag; //This is not a setup variable rather than used as + // a flag to start or stop Serial Redirection + UINT8 RefreshScreenKey; + UINT8 SwSMIPort; // Sw SMI port Address + UINT8 UartPollingRedirection; +} AMI_COM_PARAMETERS; +#pragma pack() + + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: LEGACY_SREDIR_ENABLE +// +// Description: Enable the Legacy Serial Redirection +// +// Input: +// This Legacy Serial Redirection Protocol address +// +// Output: +// EFI_SUCCESS Redirection Enabled +// EFI_NOT_FOUND Redirection Not enabled +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> +typedef EFI_STATUS (EFIAPI *LEGACY_SREDIR_ENABLE) ( + IN AMI_LEGACY_SREDIR_PROTOCOL *This +); + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Name: LEGACY_SREDIR_DISABLE +// +// Description: Disable the Legacy Serial Redirection +// +// Input: +// This Legacy Serial Redirection Protocol address +// +// Output: +// EFI_SUCCESS Redirection Disabled +// EFI_NOT_FOUND Redirection Not disabled +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> +typedef EFI_STATUS (EFIAPI *LEGACY_SREDIR_DISABLE) ( + IN AMI_LEGACY_SREDIR_PROTOCOL *This +); + +typedef struct _AMI_LEGACY_SREDIR_PROTOCOL { + LEGACY_SREDIR_ENABLE EnableLegacySredir; + LEGACY_SREDIR_DISABLE DisableLegacySredir; +} AMI_LEGACY_SREDIR_PROTOCOL; + +#define EFI_LEGACY_SREDIR_PROTOCOL AMI_LEGACY_SREDIR_PROTOCOL + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/LegacySredirProtocol.cif b/Include/Protocol/LegacySredirProtocol.cif new file mode 100644 index 0000000..940bf45 --- /dev/null +++ b/Include/Protocol/LegacySredirProtocol.cif @@ -0,0 +1,8 @@ +<component> + name = "Legacy Sredir Protocol" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "LEGACY_SREDIR_PROTOCOL" +[files] +"\LegacySredir.h" +<endComponent> diff --git a/Include/Protocol/LoadFile.h b/Include/Protocol/LoadFile.h new file mode 100644 index 0000000..8337515 --- /dev/null +++ b/Include/Protocol/LoadFile.h @@ -0,0 +1,90 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/LoadFile.h 4 3/13/06 1:40a Felixp $ +// +// $Revision: 4 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/LoadFile.h $ +// +// 4 3/13/06 1:40a Felixp +// +// 3 6/17/05 5:56p Felixp +// +// 2 3/04/05 10:35a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 3/19/04 1:14p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: LoadFile.h +// +// Description: LOAD_FILE protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LOAD_FILE_PROTOCOL_H__ +#define __LOAD_FILE_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_LOAD_FILE_PROTOCOL_GUID \ + {0x56EC3091,0x954C,0x11d2,0x8E,0x3F,0x00,0xA0,0xC9,0x69,0x72,0x3B} + +GUID_VARIABLE_DECLARATION(gEfiLoadFileProtocolGuid, EFI_LOAD_FILE_PROTOCOL_GUID); + +typedef struct _EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_LOAD_FILE) ( + IN EFI_LOAD_FILE_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, + IN BOOLEAN BootPolicy, IN OUT UINTN *BufferSize, + IN VOID *Buffer OPTIONAL +); + +struct _EFI_LOAD_FILE_PROTOCOL{ + EFI_LOAD_FILE LoadFile; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/LoadFile2.h b/Include/Protocol/LoadFile2.h new file mode 100644 index 0000000..80289e6 --- /dev/null +++ b/Include/Protocol/LoadFile2.h @@ -0,0 +1,86 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/LoadFile2.h 2 4/19/11 10:53a Yakovlevs $ +// +// $Revision: 2 $ +// +// $Date: 4/19/11 10:53a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/LoadFile2.h $ +// +// 2 4/19/11 10:53a Yakovlevs +// [TAG] EIP 57664 +// [Category] New Feature +// [Description] Aptio PI 1.2; UEFI 2.3.1 Support Extended PCI bus +// driver functionality +// [Files] DevicePath.h; LoadFile2.h; PciBus.h; PciBus.c. +// +// 1 11/19/09 12:53p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: LoadFile2.h +// +// Description: Load File 2 Protocol Definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LOAD_FILE2_PROTOCOL_H__ +#define __LOAD_FILE2_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_LOAD_FILE2_PROTOCOL_GUID \ + {0x4006c0c1,0xfcb3,0x403e,0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d} + +GUID_VARIABLE_DECLARATION(gEfiLoadFile2ProtocolGuid, EFI_LOAD_FILE2_PROTOCOL_GUID); + +typedef struct _EFI_LOAD_FILE2_PROTOCOL EFI_LOAD_FILE2_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_LOAD_FILE2) ( + IN EFI_LOAD_FILE2_PROTOCOL *This, + IN EFI_DEVICE_PATH_PROTOCOL *FilePath, + IN BOOLEAN BootPolicy, + IN OUT UINTN *BufferSize, + IN VOID *Buffer OPTIONAL +); + +struct _EFI_LOAD_FILE2_PROTOCOL{ + EFI_LOAD_FILE2 LoadFile; +}; +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/LoadPe32Image.h b/Include/Protocol/LoadPe32Image.h new file mode 100644 index 0000000..4efcf57 --- /dev/null +++ b/Include/Protocol/LoadPe32Image.h @@ -0,0 +1,95 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/LoadPe32Image.h 2 3/13/06 1:40a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/LoadPe32Image.h $ +// +// 2 3/13/06 1:40a Felixp +// +// 1 4/27/05 11:27a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: LoadPe32Image.h +// +// Description: EFI_PE32_IMAGE_PROTOCOL protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LOAD_PE32_IMAGE_PROTOCOL_H__ +#define __LOAD_PE32_IMAGE_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define PE32_IMAGE_PROTOCOL_GUID \ + {0x5cb5c776,0x60d5,0x45ee,0x88,0x3c,0x45,0x27,0x8,0xcd,0x74,0x3f } + +GUID_VARIABLE_DECLARATION(gEfiLoadPeImageGuid, PE32_IMAGE_PROTOCOL_GUID); + +#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_NONE 0x00 +#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION 0x01 +#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION 0x02 + +typedef struct _EFI_PE32_IMAGE_PROTOCOL EFI_PE32_IMAGE_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *LOAD_PE_IMAGE)( + IN EFI_PE32_IMAGE_PROTOCOL *This, + IN EFI_HANDLE ParentImageHandle, + IN EFI_DEVICE_PATH_PROTOCOL *FilePath, + IN VOID *SourceBuffer OPTIONAL, IN UINTN SourceSize, + IN EFI_PHYSICAL_ADDRESS DstBuffer OPTIONAL, + IN OUT UINTN *NumberOfPages OPTIONAL, + OUT EFI_HANDLE *ImageHandle, + OUT EFI_PHYSICAL_ADDRESS *EntryPoint OPTIONAL, + IN UINT32 Attribute +); + +typedef EFI_STATUS (EFIAPI *UNLOAD_PE_IMAGE)( + IN EFI_PE32_IMAGE_PROTOCOL *This, IN EFI_HANDLE ImageHandle +); + +struct _EFI_PE32_IMAGE_PROTOCOL { + LOAD_PE_IMAGE LoadPeImage; + UNLOAD_PE_IMAGE UnLoadPeImage; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, 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/Include/Protocol/LoadedImage.h b/Include/Protocol/LoadedImage.h new file mode 100644 index 0000000..8a1b057 --- /dev/null +++ b/Include/Protocol/LoadedImage.h @@ -0,0 +1,153 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/LoadedImage.h 5 11/08/10 6:15p Felixp $ +// +// $Revision: 5 $ +// +// $Date: 11/08/10 6:15p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/LoadedImage.h $ +// +// 5 11/08/10 6:15p Felixp +// The Core source files are updated to remove upper ASCII characters +// (above 128) +// from the comment blocks. The characters caused build errors +// with Japanese version of Microsoft compiler. +// +// 4 5/22/09 1:18p Felixp +// Clean up +// +// 3 3/13/06 1:40a Felixp +// +// 2 3/04/05 10:35a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 2 2/19/04 4:31p Felixp +// +// 1 2/16/04 5:11p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: LoadedImage.h +// +// Description: EFI_LOADED_IMAGE_PROTOCOL Protocol Definition. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LOADED_IMAGE_PROTOCOL_H__ +#define __LOADED_IMAGE_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_LOADED_IMAGE_PROTOCOL_GUID \ + {0x5B1B31A1,0x9562,0x11d2,0x8E,0x3F,0x00,0xA0,0xC9,0x69,0x72,0x3B} + +GUID_VARIABLE_DECLARATION(gEfiLoadedImageProtocolGuid, EFI_LOADED_IMAGE_PROTOCOL_GUID); + +#define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000 + +//********************************************************************** +//<AMI_PHDR_START> +// +// Procedure: EFI_UNLOAD +// +// Description: Unloads an image from memory. +// +// Input: +// IN EFI_HANDLE ImageHandle - The handle to the image to unload. +// +// Output: EFI_STATUS +// Status Codes Returned +// EFI_SUCCESS - The image was unloaded. +// EFI_INVALID_PARAMETER - The ImageHandle was not valid. +// +//<AMI_PHDR_END> +//********************************************************************** +typedef EFI_STATUS (EFIAPI *EFI_UNLOAD) ( + IN EFI_HANDLE ImageHandle +); + +//********************************************************************** +//<AMI_THDR_START> +// +// Name: EFI_LOADED_IMAGE_PROTOCOL +// +// Fields: Name Type Description +// Revision UINT32 Defines the revision of the EFI_LOADED_IMAGE_PROTOCOL structure. +// ParentHandle EFI_HANDLE Parent image's image handle. NULL if the image is loaded directly from the firmware's boot manager. +// SystemTable EFI_SYSTEM_TABLE* The image's EFI system table pointer. +// DeviceHandle EFI_HANDLE The device handle that the EFI Image was loaded from. +// FilePath EFI_DEVICE_PATH_PROTOCOL* A pointer to the file path portion specific to DeviceHandle that the EFI Image was loaded from. +// Reserved VOID* Reserved. DO NOT USE. +// LoadOptionsSize UINT32 The size in bytes of LoadOptions. +// LoadOptions VOID* A pointer to the image's binary load options. +// ImageBase VOID* The base address at which the image was loaded. +// ImageSize UINT64 The size in bytes of the loaded image. +// ImageCodeType EFI_MEMORY_TYPE The Memory type that the code sections were loaded as. +// ImageDataType EFI_MEMORY_TYPE The Memory type that the data sections were loaded as. +// Unload EFI_IMAGE_UNLOAD Function that unloads the image. +// +// Description: EFI_LOADED_IMAGE_PROTOCOL protocol interface structure +// +//<AMI_THDR_END> +//********************************************************************** +typedef struct { + UINT32 Revision; + EFI_HANDLE ParentHandle; + EFI_SYSTEM_TABLE *SystemTable; + // Source location of the image + EFI_HANDLE DeviceHandle; + EFI_DEVICE_PATH_PROTOCOL *FilePath; + VOID *Reserved; + // Image's load options + UINT32 LoadOptionsSize; + VOID *LoadOptions; + // Location where image was loaded + VOID *ImageBase; + UINT64 ImageSize; + EFI_MEMORY_TYPE ImageCodeType; + EFI_MEMORY_TYPE ImageDataType; + EFI_UNLOAD Unload; +} EFI_LOADED_IMAGE_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/LoadedImageDevicePath.h b/Include/Protocol/LoadedImageDevicePath.h new file mode 100644 index 0000000..f345685 --- /dev/null +++ b/Include/Protocol/LoadedImageDevicePath.h @@ -0,0 +1,71 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/LoadedImageDevicePath.h 1 11/19/09 12:53p Felixp $ +// +// $Revision: 1 $ +// +// $Date: 11/19/09 12:53p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/LoadedImageDevicePath.h $ +// +// 1 11/19/09 12:53p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: LoadedImageDevicePath.h +// +// Description: Loaded Image Device Path Protocol Definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __LOADED_IMAGE_DEVICE_PATH_PROTOCOL__H__ +#define __LOADED_IMAGE_DEVICE_PATH_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#ifndef GUID_VARIABLE_DEFINITION +#include <Protocol/DevicePath.h> +#else +#include <EFI.h> +#endif + +#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \ + { 0xbc62157e, 0x3e33, 0x4fec, 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } + +GUID_VARIABLE_DECLARATION(gEfiLoadedImageDevicePathProtocolGuid, EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID); + +typedef EFI_DEVICE_PATH_PROTOCOL EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL; +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/MXMProtocol.cif b/Include/Protocol/MXMProtocol.cif new file mode 100644 index 0000000..9a4b019 --- /dev/null +++ b/Include/Protocol/MXMProtocol.cif @@ -0,0 +1,9 @@ +<component> + name = "MXM Protocol" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "MXM_Protocol" +[files] +"Mxm30.h" +"Nbci.h" +<endComponent> diff --git a/Include/Protocol/ManageShadowProtocol.h b/Include/Protocol/ManageShadowProtocol.h new file mode 100644 index 0000000..9e17613 --- /dev/null +++ b/Include/Protocol/ManageShadowProtocol.h @@ -0,0 +1,131 @@ +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** + +//**************************************************************************** +// $Header: /Alaska/SOURCE/Modules/RsdpPlus/Rsdp+ Includes/Protocol/ManageShadowProtocol.h 3 9/17/12 11:35p Norlwu $ +// +// $Revision: 3 $ +// +// $Date: 9/17/12 11:35p $ +//**************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/RsdpPlus/Rsdp+ Includes/Protocol/ManageShadowProtocol.h $ +// +// 3 9/17/12 11:35p Norlwu +// [TAG] EIP92735 +// [Category] Improvement +// [Description] Please help to return the pointer and offset of +// HeapToF000 in MANAGE_SHADOW_RAM_PROTOCOL +// [Files] RsdpPlus.c +// ManageShadowRam.c +// ManageShadowProtocol.h +// +// 2 8/17/12 8:14a Norlwu +// [TAG] EIP98247 +// [Category] Improvement +// [Description] [RsdpPlus]Add alignment support in +// MANAGE_SHADOW_RAM_PROTOCOL +// [Files] RsdpPlus.sdl +// RsdpPlus.mak +// RsdpPlus.c +// ManageShadowRam.c +// ManageShadowRam.h +// +// 1 2/09/12 3:17a Norlwu +// [TAG] EIP81756 +// [Category] New Feature +// [Description] Enhance RspdPlus module. +// [Files] ManageShadowProtocol.h +//**************************************************************************** + +//<AMI_FHDR_START> +//----------------------------------------------------------------------------- +// +// Name: ManageShadowProtocol.h +// +// Description: +// +//----------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __MANAGE_SHADOW_PROTOCOL_H__ +#define __MANAGE_SHADOW_PROTOCOL_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define MANAGE_SHADOW_RAM_PROTOCOL_GUID \ + {0x1fa319e, 0xc36c, 0x4f19, 0x9d, 0x9d, 0xd0, 0x29, 0xd, 0xbe, 0xe9, 0x28} + +typedef struct{ + UINTN BuffAddress; + UINTN UsedLength; +}DATA_BUFF_STRUC; + +typedef +EFI_STATUS +(EFIAPI *HEAP_TO_E000) ( + UINT8 *pData, + UINT32 Align, + UINTN Length, + DATA_BUFF_STRUC *pData2 +); + +typedef +EFI_STATUS +(EFIAPI *HEAP_TO_F000) ( + UINT8 *pData, + UINT32 Align, + UINTN Length, + DATA_BUFF_STRUC *pData2 +); + +typedef struct { + HEAP_TO_E000 HeapToE000; + HEAP_TO_F000 HeapToF000; +} MANAGE_SHADOW_RAM_PROTOCOL; + + +//elink struct type define +typedef VOID (UPDATE_E000_SHDOW_RAM_HOOK)( + IN UINT32* pShadowRam, + IN UINTN Length +); + +typedef VOID (UPDATE_F000_SHDOW_RAM_HOOK)( + IN UINT32* pShadowRam, + IN UINTN Length +); + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** diff --git a/Include/Protocol/Metronome.h b/Include/Protocol/Metronome.h new file mode 100644 index 0000000..7869fb5 --- /dev/null +++ b/Include/Protocol/Metronome.h @@ -0,0 +1,99 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Metronome.h 2 3/13/06 1:45a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 3/13/06 1:45a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Metronome.h $ +// +// 2 3/13/06 1:45a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:42a Felixp +// +// 1 12/23/04 9:29a Felixp +// +// 2 3/29/04 2:32a Felixp +// +// 1 12/31/03 11:05a Robert +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: Metronome.h +// +// Description: This file is an include file used to define the Architectural +// Protocol for the Legacy Metronome. For questions about the specification +// refer to the DXE CIS +// +//<AMI_FHDR_END> +//***************************************************************************** +#ifndef __METRONOME_ARCH_PROTOCOL_H__ +#define __METRONOME_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// GUID for the Metronome Architectural Protocol +#define EFI_METRONOME_ARCH_PROTOCOL_GUID \ + { 0x26baccb2, 0x6f42, 0x11d4, 0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } + +GUID_VARIABLE_DECLARATION(gEfiMetronomeArchProtocolGuid, EFI_METRONOME_ARCH_PROTOCOL_GUID); + +// Declare forward reference for the Metronome Architectural Protocol +typedef struct _EFI_METRONOME_ARCH_PROTOCOL EFI_METRONOME_ARCH_PROTOCOL; + + +typedef +EFI_STATUS +(EFIAPI *EFI_METRONOME_WAIT_FOR_TICK) ( + IN struct _EFI_METRONOME_ARCH_PROTOCOL *This, + IN UINT32 TickNumber + ); + + +// Architectural Protocol structure for Metronome +typedef struct _EFI_METRONOME_ARCH_PROTOCOL { + EFI_METRONOME_WAIT_FOR_TICK WaitForTick; + UINT32 TickPeriod; +} EFI_METRONOME_ARCH_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/MonotonicCounter.h b/Include/Protocol/MonotonicCounter.h new file mode 100644 index 0000000..98149a9 --- /dev/null +++ b/Include/Protocol/MonotonicCounter.h @@ -0,0 +1,78 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/MonotonicCounter.h 3 3/13/06 1:45a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 3/13/06 1:45a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/MonotonicCounter.h $ +// +// 3 3/13/06 1:45a Felixp +// +// 2 3/04/05 10:42a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:42a Felixp +// +// 1 12/23/04 9:29a Felixp +// +// 1 3/30/04 2:24a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: MonotonicCounter.h +// +// Description: MonotonicCounter Architectural Protocol Definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __MONOTONIC_COUNTER_ARCH_PROTOCOL_H__ +#define __MONOTONIC_COUNTER_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_MONOTONIC_COUNTER_ARCH_PROTOCOL_GUID \ + {0x1da97072,0xbddc,0x4b30,0x99,0xf1,0x72,0xa0,0xb5,0x6f,0xff,0x2a} + +GUID_VARIABLE_DECLARATION(gEfiMonotonicCounterArchProtocolGuid, EFI_MONOTONIC_COUNTER_ARCH_PROTOCOL_GUID); + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/MpService.h b/Include/Protocol/MpService.h new file mode 100644 index 0000000..1d7aafd --- /dev/null +++ b/Include/Protocol/MpService.h @@ -0,0 +1,436 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/MpService.h 1 10/25/12 8:54a Wesleychen $ +// +// $Revision: 1 $ +// +// $Date: 10/25/12 8:54a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/MpService.h $ +// +// 1 10/25/12 8:54a Wesleychen +// EFI_MP_PROC_CONTEXT is copyied from Intel CPU RC. +// +// 5 11/12/11 6:46p Artems +// +// 5 9/09/11 4:47p Markw +// [TAG] EIP64115 +// [Category] Spec Update +// [Description] Always support Framework MP Services for binaries. +// Support Framework MP Service header for Framework, and +// support PI MP Service header for PI. +// +// [Files] Cpu.sdl, CpuMp.c, CpuDxe.h, CpuDxe.c, MpServices.h +// +// 4 7/13/11 3:39p Felixp +// #if PI_SPECIFICATION_VERSION <= 0x0001000A is replaced with +// #if PI_SPECIFICATION_VERSION < 0x0001000A +// (equal sign is removed). +// +// 3 6/23/11 5:34p Felixp +// Improved compatibility with existing CPU modules. +// (PI definitions are disabled when NO_PI_MP_SERVICES_SUPPORT macro is +// defined). +// +// 2 6/16/11 9:50a Felixp +// Header is updated to include PI and Framework flavors of the protocol +// +// 3 8/03/09 4:04p Markw +// Add GetProcessorContext update. +// +// 2 3/04/09 10:45a Markw +// Update copyright header. +// +// 1 11/02/07 1:59p Markw +// +// 1 11/02/07 1:45p Markw +// +// 2 7/23/07 7:33p Markw +// Make EFI_MP_SERVICES_PROTOCOL output parameters optional. +// +// 1 3/28/06 1:07p Markw +// +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: MpService.h +// +// Description: This file is an include file used to define the Protocol for the +// DXE Mp Service Protocol. +// +//<AMI_FHDR_END> +//***************************************************************************** + +#ifndef _MP_SERVICES_H_ +#define _MP_SERVICES_H_ + +#include <Efi.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#if PI_SPECIFICATION_VERSION < 0x0001000A || BACKWARD_COMPATIBLE_MODE && defined(NO_PI_MP_SERVICES_SUPPORT) + +#define EFI_MP_SERVICES_PROTOCOL_GUID \ + {0xf33261e7,0x23cb,0x11d5,0xbd,0x5c,0x0,0x80,0xc7,0x3c,0x88,0x81} + +GUID_VARIABLE_DECLARATION(gEfiMpServiceProtocolGuid, EFI_MP_SERVICES_PROTOCOL_GUID); + +#ifndef EFI_AP_PROCEDURE_TYPE_DEFINED +#define EFI_AP_PROCEDURE_TYPE_DEFINED +typedef VOID (*EFI_AP_PROCEDURE) ( + IN VOID *Buffer +); +#endif + +//******************************************************* +// Processor Context Buffer Definitions. +//******************************************************* +//(Intel CPU RC)> +//EFI_MP_PROC_CONTEXT is copyied from Intel CPU RC, it's different from Aptio CPU module +// +typedef union { + struct { + UINT32 Status : 2; + UINT32 Tested : 1; + UINT32 Reserved1 : 13; + UINT32 VirtualMemoryUnavailable : 1; + UINT32 Ia32ExecutionUnavailable : 1; + UINT32 FloatingPointUnavailable : 1; + UINT32 MiscFeaturesUnavailable : 1; + UINT32 Reserved2 : 12; + } Bits; + UINT32 Uint32; +} EFI_MP_HEALTH_FLAGS; + +#define EFI_MP_HEALTH_FLAGS_STATUS_HEALTHY 0x0 +#define EFI_MP_HEALTH_FLAGS_STATUS_PERFORMANCE_RESTRICTED 0x1 +#define EFI_MP_HEALTH_FLAGS_STATUS_FUNCTIONALLY_RESTRICTED 0x2 + +typedef struct { + EFI_MP_HEALTH_FLAGS Flags; + UINT32 TestStatus; +} EFI_MP_HEALTH; + +typedef enum { + EfiCpuAP = 0, + EfiCpuBSP, + EfiCpuDesignationMaximum +} EFI_CPU_DESIGNATION; + +typedef struct { + UINT32 Package; + UINT32 Die; + UINT32 Core; + UINT32 Thread; +} PHYSICAL_LOCATION; + +typedef struct { + UINT32 ApicID; + BOOLEAN Enabled; + EFI_CPU_DESIGNATION Designation; + EFI_MP_HEALTH Health; + UINTN PackageNumber; + UINTN NumberOfCores; + UINTN NumberOfThreads; + UINT64 ProcessorPALCompatibilityFlags; + UINT64 ProcessorTestMask; +} EFI_MP_PROC_CONTEXT; +//<(Intel CPU RC) + +#define EFI_MP_PROC_CONTEXT_VERSION \ + {0x4DCFD87B, 0x2C99, 0x11d6, 0xAF, 0x22,0x00,0xA0, 0xC9, 0x44, 0xA0, 0x5B} + + +typedef struct _EFI_MP_SERVICES_PROTOCOL EFI_MP_SERVICES_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_GET_GENERAL_MP_INFO) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + OUT UINTN *NumberOfCPUs OPTIONAL, + OUT UINTN *MaximumNumberOfCPUs OPTIONAL, + OUT UINTN *NumberOfEnabledCPUs OPTIONAL, + OUT UINTN *RendezvousIntNumber OPTIONAL, + OUT UINTN *RendezvousProcLength OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_GET_PROCESSOR_CONTEXT) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN UINTN ProcessorNumber, + IN OUT UINTN *BufferLength, + IN OUT VOID *ProcessorContextBuffer +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_STARTUP_ALL_APS) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN EFI_AP_PROCEDURE Procedure, + IN BOOLEAN SingleThread, + IN EFI_EVENT WaitEvent OPTIONAL, + IN UINTN TimeoutInMicroSecs OPTIONAL, + IN OUT VOID *ProcArguments OPTIONAL, + OUT UINTN *FailedCPUList OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_STARTUP_THIS_AP) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN EFI_AP_PROCEDURE Procedure, + IN UINTN ProcessorNumber, + IN EFI_EVENT WaitEvent OPTIONAL, + IN UINTN TimeoutInMicroSecs OPTIONAL, + IN OUT VOID *ProcArguments OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_SWITCH_BSP) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN UINTN ProcessorNumber, + IN BOOLEAN EnableOldBSP +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_SEND_IPI) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN UINTN ProcessorNumber, + IN UINTN VectorNumber, + IN UINTN DeliveryMode +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_ENABLEDISABLEAP) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN UINTN ProcessorNumber, + IN BOOLEAN Enable, + IN VOID *HealthState OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_WHOAMI) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + OUT UINTN *ProcessorNumber +); + +typedef struct _EFI_MP_SERVICES_PROTOCOL { + EFI_MP_SERVICES_GET_GENERAL_MP_INFO GetGeneralMPInfo; + EFI_MP_SERVICES_GET_PROCESSOR_CONTEXT GetProcessorContext; + EFI_MP_SERVICES_STARTUP_ALL_APS StartupAllAPs; + EFI_MP_SERVICES_STARTUP_THIS_AP StartupThisAP; + EFI_MP_SERVICES_SWITCH_BSP SwitchBSP; + EFI_MP_SERVICES_SEND_IPI SendIPI; + EFI_MP_SERVICES_ENABLEDISABLEAP EnableDisableAP; + EFI_MP_SERVICES_WHOAMI WhoAmI; +}; + +#else // #if PI_SPECIFICATION_VERSION < 0x0001000A + +/// Global ID for the EFI_MP_SERVICES_PROTOCOL. +#define EFI_MP_SERVICES_PROTOCOL_GUID \ + { 0x3fdda605, 0xa76e, 0x4f46, 0xad, 0x29, 0x12, 0xf4, 0x53, 0x1b, 0x3d, 0x08 } + +GUID_VARIABLE_DECLARATION(gEfiMpServiceProtocolGuid, EFI_MP_SERVICES_PROTOCOL_GUID); + +typedef struct _EFI_MP_SERVICES_PROTOCOL EFI_MP_SERVICES_PROTOCOL; + +#ifndef EFI_AP_PROCEDURE_TYPE_DEFINED +#define EFI_AP_PROCEDURE_TYPE_DEFINED +typedef VOID (*EFI_AP_PROCEDURE) ( + IN VOID *Buffer +); +#endif + +/// Terminator for a list of failed CPUs returned by StartAllAPs(). +#define END_OF_CPU_LIST 0xffffffff + +/// This bit is used in the StatusFlag field of EFI_PROCESSOR_INFORMATION and +/// indicates whether the processor is playing the role of BSP. If the bit is 1, +/// then the processor is BSP. Otherwise, it is AP. +#define PROCESSOR_AS_BSP_BIT 0x00000001 + +/// This bit is used in the StatusFlag field of EFI_PROCESSOR_INFORMATION and +/// indicates whether the processor is enabled. If the bit is 1, then the +/// processor is enabled. Otherwise, it is disabled. +#define PROCESSOR_ENABLED_BIT 0x00000002 + +/// This bit is used in the StatusFlag field of EFI_PROCESSOR_INFORMATION and +/// indicates whether the processor is healthy. If the bit is 1, then the +/// processor is healthy. Otherwise, some fault has been detected for the processor. +#define PROCESSOR_HEALTH_STATUS_BIT 0x00000004 + +/// Structure that describes the pyhiscal location of a logical CPU. +typedef struct { + /// Zero-based physical package number that identifies the cartridge of the processor. + UINT32 Package; + /// Zero-based physical core number within package of the processor. + UINT32 Core; + /// Zero-based logical thread number within core of the processor. + UINT32 Thread; +} EFI_CPU_PHYSICAL_LOCATION; + +/// Structure that describes information about a logical CPU. +typedef struct { + /// The unique processor ID determined by system hardware. For IA32 and X64, + /// the processor ID is the same as the Local APIC ID. Only the lower 8 bits + /// are used, and higher bits are reserved. For IPF, the lower 16 bits contains + /// id/eid, and higher bits are reserved. + /// + UINT64 ProcessorId; + /// + /// Flags indicating if the processor is BSP or AP, if the processor is enabled + /// or disabled, and if the processor is healthy. Bits 3..31 are reserved and + /// must be 0. + /// + /// <pre> + /// BSP ENABLED HEALTH Description + /// === ======= ====== =================================================== + /// 0 0 0 Unhealthy Disabled AP. + /// 0 0 1 Healthy Disabled AP. + /// 0 1 0 Unhealthy Enabled AP. + /// 0 1 1 Healthy Enabled AP. + /// 1 0 0 Invalid. The BSP can never be in the disabled state. + /// 1 0 1 Invalid. The BSP can never be in the disabled state. + /// 1 1 0 Unhealthy Enabled BSP. + /// 1 1 1 Healthy Enabled BSP. + /// </pre> + /// + UINT32 StatusFlag; + /// + /// The physical location of the processor, including the physical package number + /// that identifies the cartridge, the physical core number within package, and + /// logical thread number within core. + /// + EFI_CPU_PHYSICAL_LOCATION Location; +} EFI_PROCESSOR_INFORMATION; + +typedef +EFI_STATUS +(EFIAPI *EFI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS)( + IN EFI_MP_SERVICES_PROTOCOL *This, + OUT UINTN *NumberOfProcessors, + OUT UINTN *NumberOfEnabledProcessors + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_MP_SERVICES_GET_PROCESSOR_INFO)( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN UINTN ProcessorNumber, + OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_MP_SERVICES_STARTUP_ALL_APS)( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN EFI_AP_PROCEDURE Procedure, + IN BOOLEAN SingleThread, + IN EFI_EVENT WaitEvent OPTIONAL, + IN UINTN TimeoutInMicroSeconds, + IN VOID *ProcedureArgument OPTIONAL, + OUT UINTN **FailedCpuList OPTIONAL + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_MP_SERVICES_STARTUP_THIS_AP)( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN EFI_AP_PROCEDURE Procedure, + IN UINTN ProcessorNumber, + IN EFI_EVENT WaitEvent OPTIONAL, + IN UINTN TimeoutInMicroseconds, + IN VOID *ProcedureArgument OPTIONAL, + OUT BOOLEAN *Finished OPTIONAL + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_MP_SERVICES_SWITCH_BSP)( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN UINTN ProcessorNumber, + IN BOOLEAN EnableOldBSP + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_MP_SERVICES_ENABLEDISABLEAP)( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN UINTN ProcessorNumber, + IN BOOLEAN EnableAP, + IN UINT32 *HealthFlag OPTIONAL + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_MP_SERVICES_WHOAMI)( + IN EFI_MP_SERVICES_PROTOCOL *This, + OUT UINTN *ProcessorNumber + ); + +/// When installed, the MP Services Protocol produces a collection of services +/// that are needed for MP management. +/// +/// Before the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled, the module +/// that produces this protocol is required to place all APs into an idle state +/// whenever the APs are disabled or the APs are not executing code as requested +/// through the StartupAllAPs() or StartupThisAP() services. The idle state of +/// an AP before the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled is +/// implementation dependent. +/// +/// After the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled, all the APs +/// must be placed in the OS compatible CPU state as defined by the UEFI +/// Specification. Implementations of this protocol may use the UEFI event +/// EFI_EVENT_GROUP_READY_TO_BOOT to force APs into the OS compatible state as +/// defined by the UEFI Specification. Modules that use this protocol must +/// guarantee that all non-blocking mode requests on all APs have been completed +/// before the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled. Since the +/// order that event notification functions in the same event group are executed +/// is not deterministic, an event of type EFI_EVENT_GROUP_READY_TO_BOOT cannot +/// be used to guarantee that APs have completed their non-blocking mode requests. +/// +/// When the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled, the StartAllAPs() +/// and StartupThisAp() services must no longer support non-blocking mode requests. +/// The support for SwitchBSP() and EnableDisableAP() may no longer be supported +/// after this event is signaled. Since UEFI Applications and UEFI OS Loaders +/// execute after the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled, these +/// UEFI images must be aware that the functionality of this protocol may be reduced. +/// +struct _EFI_MP_SERVICES_PROTOCOL { + EFI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS GetNumberOfProcessors; + EFI_MP_SERVICES_GET_PROCESSOR_INFO GetProcessorInfo; + EFI_MP_SERVICES_STARTUP_ALL_APS StartupAllAPs; + EFI_MP_SERVICES_STARTUP_THIS_AP StartupThisAP; + EFI_MP_SERVICES_SWITCH_BSP SwitchBSP; + EFI_MP_SERVICES_ENABLEDISABLEAP EnableDisableAP; + EFI_MP_SERVICES_WHOAMI WhoAmI; +}; + +#endif // #if PI_SPECIFICATION_VERSION <= 0x0001000A +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/MpService/MpService.h b/Include/Protocol/MpService/MpService.h new file mode 100644 index 0000000..e5dec6a --- /dev/null +++ b/Include/Protocol/MpService/MpService.h @@ -0,0 +1,232 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1987-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuProtocols/MpService/MpService.h 2 2/23/12 2:05a Davidhsieh $ +// +// $Revision: 2 $ +// +// $Date: 2/23/12 2:05a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuProtocols/MpService/MpService.h $ +// +// 2 2/23/12 2:05a Davidhsieh +// [TAG] EIP72056 +// [Category] Improvement +// [Description] Change EFI_MP_PROC_CONTEXT to follow Intel CPU driver +// +// 1 2/07/12 3:59a Davidhsieh +// +// 1 7/07/11 4:41a Davidhsieh +// +// 1 5/06/11 6:08a Davidhsieh +// First release +// +// 3 8/03/09 4:04p Markw +// Add GetProcessorContext update. +// +// 2 3/04/09 10:45a Markw +// Update copyright header. +// +// 1 11/02/07 1:59p Markw +// +// 1 11/02/07 1:45p Markw +// +// 2 7/23/07 7:33p Markw +// Make EFI_MP_SERVICES_PROTOCOL output parameters optional. +// +// 1 3/28/06 1:07p Markw +// +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: MpService.h +// +// Description: This file is an include file used to define the Protocol for the +// DXE Mp Service Protocol. +// +//<AMI_FHDR_END> +//***************************************************************************** + +#ifndef _MP_SERVICES_H_ +#define _MP_SERVICES_H_ + +#include "efi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//This Protocol has been significantly changed by the PI spec. If this protocol is used, +//be prepared to update your code accordingly. + +#define EFI_MP_SERVICES_PROTOCOL_GUID \ + {0xf33261e7,0x23cb,0x11d5,0xbd,0x5c,0x0,0x80,0xc7,0x3c,0x88,0x81} + +typedef VOID (*EFI_AP_PROCEDURE) ( + IN VOID *Buffer +); + +//******************************************************* +// Processor Context Buffer Definitions. +//******************************************************* +//EFI_MP_PROC_CONTEXT is copyied from Intel CPU RC, it's different from Aptio CPU module +// +typedef union { + struct { + UINT32 Status : 2; + UINT32 Tested : 1; + UINT32 Reserved1 : 13; + UINT32 VirtualMemoryUnavailable : 1; + UINT32 Ia32ExecutionUnavailable : 1; + UINT32 FloatingPointUnavailable : 1; + UINT32 MiscFeaturesUnavailable : 1; + UINT32 Reserved2 : 12; + } Bits; + UINT32 Uint32; +} EFI_MP_HEALTH_FLAGS; + +#define EFI_MP_HEALTH_FLAGS_STATUS_HEALTHY 0x0 +#define EFI_MP_HEALTH_FLAGS_STATUS_PERFORMANCE_RESTRICTED 0x1 +#define EFI_MP_HEALTH_FLAGS_STATUS_FUNCTIONALLY_RESTRICTED 0x2 + +typedef struct { + EFI_MP_HEALTH_FLAGS Flags; + UINT32 TestStatus; +} EFI_MP_HEALTH; + +typedef enum { + EfiCpuAP = 0, + EfiCpuBSP, + EfiCpuDesignationMaximum +} EFI_CPU_DESIGNATION; + +typedef struct { + UINT32 Package; + UINT32 Die; + UINT32 Core; + UINT32 Thread; +} PHYSICAL_LOCATION; + +typedef struct { + UINT32 ApicID; + BOOLEAN Enabled; + EFI_CPU_DESIGNATION Designation; + EFI_MP_HEALTH Health; + UINTN PackageNumber; + UINTN NumberOfCores; + UINTN NumberOfThreads; + UINT64 ProcessorPALCompatibilityFlags; + UINT64 ProcessorTestMask; +} EFI_MP_PROC_CONTEXT; + +#define EFI_MP_PROC_CONTEXT_VERSION \ + {0x4DCFD87B, 0x2C99, 0x11d6, 0xAF, 0x22,0x00,0xA0, 0xC9, 0x44, 0xA0, 0x5B} + + +typedef struct _EFI_MP_SERVICES_PROTOCOL EFI_MP_SERVICES_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_GET_GENERAL_MP_INFO) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + OUT UINTN *NumberOfCPUs OPTIONAL, + OUT UINTN *MaximumNumberOfCPUs OPTIONAL, + OUT UINTN *NumberOfEnabledCPUs OPTIONAL, + OUT UINTN *RendezvousIntNumber OPTIONAL, + OUT UINTN *RendezvousProcLength OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_GET_PROCESSOR_CONTEXT) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN UINTN ProcessorNumber, + IN OUT UINTN *BufferLength, + IN OUT VOID *ProcessorContextBuffer +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_STARTUP_ALL_APS) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN EFI_AP_PROCEDURE Procedure, + IN BOOLEAN SingleThread, + IN EFI_EVENT WaitEvent OPTIONAL, + IN UINTN TimeoutInMicroSecs OPTIONAL, + IN OUT VOID *ProcArguments OPTIONAL, + OUT UINTN *FailedCPUList OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_STARTUP_THIS_AP) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN EFI_AP_PROCEDURE Procedure, + IN UINTN ProcessorNumber, + IN EFI_EVENT WaitEvent OPTIONAL, + IN UINTN TimeoutInMicroSecs OPTIONAL, + IN OUT VOID *ProcArguments OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_SWITCH_BSP) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN UINTN ProcessorNumber, + IN BOOLEAN EnableOldBSP +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_SEND_IPI) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN UINTN ProcessorNumber, + IN UINTN VectorNumber, + IN UINTN DeliveryMode +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_ENABLEDISABLEAP) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + IN UINTN ProcessorNumber, + IN BOOLEAN Enable, + IN VOID *HealthState OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_WHOAMI) ( + IN EFI_MP_SERVICES_PROTOCOL *This, + OUT UINTN *ProcessorNumber +); + +typedef struct _EFI_MP_SERVICES_PROTOCOL { + EFI_MP_SERVICES_GET_GENERAL_MP_INFO GetGeneralMPInfo; + EFI_MP_SERVICES_GET_PROCESSOR_CONTEXT GetProcessorContext; + EFI_MP_SERVICES_STARTUP_ALL_APS StartupAllAPs; + EFI_MP_SERVICES_STARTUP_THIS_AP StartupThisAP; + EFI_MP_SERVICES_SWITCH_BSP SwitchBSP; + EFI_MP_SERVICES_SEND_IPI SendIPI; + EFI_MP_SERVICES_ENABLEDISABLEAP EnableDisableAP; + EFI_MP_SERVICES_WHOAMI WhoAmI; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1987-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/Mxm30.h b/Include/Protocol/Mxm30.h new file mode 100644 index 0000000..a53b70e --- /dev/null +++ b/Include/Protocol/Mxm30.h @@ -0,0 +1,80 @@ +// {2EF1BA1A-C836-4a50-BF89-525FF29FF787} +#define MXM30_PEI_GUID \ + { 0x2ef1ba1a, 0xc836, 0x4a50, 0xbf, 0x89, 0x52, 0x5f, 0xf2, 0x9f, 0xf7, 0x87 } + +// {4EA9D4FE-E6F6-410b-8037-0F98B5968B65} +#define MXM3_EFI_GUID \ + { 0x4EA9D4FE, 0xE6F6, 0x410B, 0x90, 0x37, 0x0f, 0x98, 0xB5, 0x96, 0x8B, 0x65 } + +///////////////////////////////////////////////////////////////////////////////////////// +//////M X M 3.0 D E F I N I T I O N S ///////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////// +#define EFI30_DataBlockID MXM_REV_SUPPORTED +//0x30; +// the revision of the MXM software specification that is supported by the MXM module. +// Format is binary coded decimal, for example: 0x30 = 3.0, etc. + +#define EFI30_SupportFuncs MXM_FUNC_SUPPORTED +//0x3; +// Bit 0 = `1' MxmReturnSpecLevel method is required +// Bit 1 = `1' MxmReturnStucture is also required +// Bit 2 = `1' OPTIONAL. if MxmSelectOutputDevice is supported, `0' if not +// Bit 3 = `1' OPTIONAL. if MxmCheckOutputDevice is supported, `0' if not + +typedef struct { + CHAR8 Sig[4]; // "MXM_" + UINT8 Ver; + UINT8 Rev; + UINT16 Len; +} MXM_STRUCT_HDR; + +typedef EFI_STATUS (EFIAPI *MXM_RETURN_SPEC_LEVEL) ( + IN struct _MXM3_EFI_INTERFACE *This, + IN EFI_HANDLE ControllerHandle, + IN OUT CHAR16 usStructSize, + IN OUT CHAR8 *pucRevisionLevel, + OUT UINTN *puSupportFuncs +); + +typedef EFI_STATUS (EFIAPI *MXM_RETURN_STRUCTURE)( + IN struct _MXM3_EFI_INTERFACE *This, + IN EFI_HANDLE ControllerHandle, + IN OUT CHAR16 *usStructSize, + IN CHAR16 usDataBlockID, + OUT CHAR8 **pMxmStruct +); + +typedef EFI_STATUS (EFIAPI *MXM_SELECT_OUTPUT_DEVICE)( + IN struct _MXM3_EFI_INTERFACE *This, + IN EFI_HANDLE ControllerHandle, + IN OUT CHAR16 usStructSize, + IN EFI_HANDLE ChildHandle, + IN CHAR8 ucOutputSetting +); + +typedef EFI_STATUS (EFIAPI *MXM_CHECK_OUTPUT_DEVICE)( + IN struct _MXM3_EFI_INTERFACE *This, + IN EFI_HANDLE ControllerHandle, + IN OUT CHAR16 usStructSize, + IN EFI_HANDLE ChildHandle, + OUT CHAR8 ucDisplayAvailable +); + +typedef struct _MXM3_EFI_INTERFACE { + MXM_RETURN_SPEC_LEVEL MxmReturnSpecLevel; + MXM_RETURN_STRUCTURE MxmReturnStructure; + MXM_SELECT_OUTPUT_DEVICE MxmSelectOutputDevice; + MXM_CHECK_OUTPUT_DEVICE MxmCheckOutputDevice; +} MXM3_EFI_PROTOCOL; + + + +EFI_STATUS +LoadFile( + IN EFI_GUID *Guid, + OUT VOID **Buffer, + OUT UINTN *BufferSize + ); + +//#define MXM_DRIVER_VERSION 0x001 + diff --git a/Include/Protocol/NBMemInfo.h b/Include/Protocol/NBMemInfo.h new file mode 100644 index 0000000..1dc03b4 --- /dev/null +++ b/Include/Protocol/NBMemInfo.h @@ -0,0 +1,89 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/NB Protocols/NBMemInfo.h 2 10/14/12 12:13a Jeffch $ +// +// $Revision: 2 $ +// +// $Date: 10/14/12 12:13a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/NB Protocols/NBMemInfo.h $ +// +// 2 10/14/12 12:13a Jeffch +// [TAG] None +// [Severity] Important +// [Description] Follow MahoBay Update. +// [Files] NBMemInfo.h, NBPEI.c, PciHostBridge.c +// +// 1 2/08/12 4:35a Yurenlai +// Intel Haswell/NB eChipset initially releases. +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: NBMemInfo.h +// +// Description: The header file for NB Memory Information +// +//<AMI_FHDR_END> +//************************************************************************* + +#ifndef _NB_MEMORY_INFO_ +#define _NB_MEMORY_INFO_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <Token.h> + +#define EFI_NB_MEMORY_INFO_GUID \ + {0x490216c0, 0x76a, 0x44d3, 0xa5, 0x36, 0xac, 0xe0, 0x5c, 0x90, 0xe3, 0x86} + +// {40312829-7891-4abd-B200-0C541B061939} +#define EFI_NB_MRC_S3_DATA_GUID \ + {0x40312829, 0x7891, 0x4abd, 0xb2, 0x00, 0x0c, 0x54, 0x1b, 0x06, 0x19, 0x39} + +GUID_VARIABLE_DECLARATION(gEfiNBMemoryInfoGuid, EFI_NB_MEMORY_INFO_GUID); + +#define NB_MEMORY_INFO_VARIABLE L"NBMemoryInfo" + +#pragma pack(push,1) + + +#pragma pack(pop) + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/NBPlatformData.h b/Include/Protocol/NBPlatformData.h new file mode 100644 index 0000000..e9e60e6 --- /dev/null +++ b/Include/Protocol/NBPlatformData.h @@ -0,0 +1,117 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/NB Protocols/NBPlatformData.h 5 1/28/13 3:36a Jeffch $ +// +// $Revision: 5 $ +// +// $Date: 1/28/13 3:36a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/NB Protocols/NBPlatformData.h $ +// +// 5 1/28/13 3:36a Jeffch +// [TAG] None +// [Severity] Important +// [Description] Update SA RC 1.0. +// [Files] NBPei.c; GetSetupData.c; NbSetupData.h; NBDXE.c; NB.sd; +// NB.uni; +// +// 4 12/24/12 2:53a Jeffch +// [TAG] None +// [Category] Improvement +// [Description] added ULT SKU auto disable PEG. +// [Files] NBPei.c; NBDxe.c; NbPlatform.h; NB.sd; +// +// 3 11/29/12 2:30a Jeffch +// [TAG] None +// [Category] Improvement +// [Description] added bootime check IGFX Available. +// [Files] NBDxe.c; NbPlatform.h; NB.sd; +// +// 2 8/14/12 4:42a Yurenlai +// [TAG] None +// [Severity] Important +// [Description] Implemented BIOS Integration Guide Rev 1.0 to Intel SA +// GOP driver. +// [Files] IntelSaGopDriver.cif, IntelSaGopDriver.mak, +// IntelSaGopDriver.sdl, +// IntelSaGopPolicy.c, IntelSaGopSetup.c, IntelSaGopSetup.h, +// IntelSaGopSetup.mak, IntelSaGopSetup.sd, IntelSaGopSetup.sdl, +// IntelSaGopSetup.uni, IntelSaGopSwitch.c, +// IntelSaGopDriver.h, +// NBPlatformData.h +// +// 1 2/08/12 4:35a Yurenlai +// Intel Haswell/NB eChipset initially releases. +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: NBPlatformData.h +// +// Description: NB Specific Setup Variables and Structures +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef _NB_PLATFORM_DATA_H_ +#define _NB_PLATFORM_DATA_H_ +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef EXIT_PM_AUTH_PROTOCOL_GUID +#define EXIT_PM_AUTH_PROTOCOL_GUID \ + { 0xd088a413, 0xa70, 0x4217, 0xba, 0x55, 0x9a, 0x3c, 0xb6, 0x5c, 0x41, 0xb3 }; +#endif + + #pragma pack(1) + + typedef struct _NB_PLATFORM_DATA + { + UINT8 DimmPresent[4]; + UINT8 IGFXCapability; + UINT8 IGFXAvailable; + UINT8 IGFXGopAvailable; + UINT8 PegAvailable; + UINT8 VTdAvailable; + UINT8 UserBoard; + UINT8 PresentCPU; + UINT8 XmpProfile1; + UINT8 XmpProfile2; + UINT8 DDR3Type; + }NB_PLATFORM_DATA; + + #pragma pack() + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/NBProtocols.CIF b/Include/Protocol/NBProtocols.CIF new file mode 100644 index 0000000..0de04ee --- /dev/null +++ b/Include/Protocol/NBProtocols.CIF @@ -0,0 +1,9 @@ +<component> + name = "NB Protocols" + category = ModulePart + LocalRoot = "INCLUDE\Protocol" + RefName = "NB Protocols" +[files] +"NBMemInfo.h" +"NBPlatformData.h" +<endComponent> diff --git a/Include/Protocol/Nbci.h b/Include/Protocol/Nbci.h new file mode 100644 index 0000000..276fa93 --- /dev/null +++ b/Include/Protocol/Nbci.h @@ -0,0 +1,77 @@ +#define NBCI_EFI_GUID \ + { 0x4EA9D4FE, 0xE6F6, 0x410B, 0x80, 0x37, 0x0F, 0x98, 0xB5, 0x96, 0x8B, 0x65 } + +///////////////////////////////////////////////////////////////////////////////////////// +//////N B C I D E F I N I T I O N S //////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////// +#define EFI_Nbci_DataBlockID NBCI_REV_SUPPORTED +//0x11; +// the revision of the NBCI software specification that is supported by the NBCI module. +// Format is binary coded decimal, for example: 0x30 = 3.0, etc. + +#define EFI_Nbci_SupportFuncs NBCI_FUNC_SUPPORTED +//0x3; +// Bit 0 = `1' NBCIReturnSpecLevel method is required +// Bit 1 = `1' NBCIReturnStucture is also required +// Bit 2 = `1' OPTIONAL. if NBCISelectOutputDevice is supported, `0' if not +// Bit 3 = `1' OPTIONAL. if NBCICheckOutputDevice is supported, `0' if not + +typedef struct { + CHAR8 Sig[4]; // "NBCI_" + UINT8 Ver; + UINT8 Rev; + UINT16 Len; +} NBCI_STRUCT_HDR; + +typedef EFI_STATUS (EFIAPI *NBCI_RETURN_SPEC_LEVEL) ( + IN struct _NBCI_EFI_INTERFACE *This, + IN OUT CHAR8 *pucRevisionLevel, + OUT UINTN *puSupportFuncs +); + +typedef EFI_STATUS (EFIAPI *NBCI_RETURN_STRUCTURE)( + IN struct _NBCI_EFI_INTERFACE *This, + IN EFI_HANDLE ControllerHandle, + IN OUT CHAR16 *usStructSize, + IN CHAR16 usDataBlockID, + OUT CHAR8 **pNBCIStruct +); + +typedef EFI_STATUS (EFIAPI *NBCI_SELECT_OUTPUT_DEVICE)( + IN struct _NBCI_EFI_INTERFACE *This, + IN EFI_HANDLE ControllerHandle, + IN OUT CHAR16 usStructSize, + IN EFI_HANDLE ChildHandle, + IN CHAR8 ucOutputSetting +); + +typedef EFI_STATUS (EFIAPI *NBCI_CHECK_OUTPUT_DEVICE)( + IN struct _NBCI_EFI_INTERFACE *This, + IN EFI_HANDLE ControllerHandle, + IN OUT CHAR16 usStructSize, + IN EFI_HANDLE ChildHandle, + OUT CHAR8 ucDisplayAvailable +); + +typedef struct _NBCI_EFI_INTERFACE { + NBCI_RETURN_SPEC_LEVEL NBCIReturnSpecLevel; + NBCI_RETURN_STRUCTURE NBCIReturnStructure; + NBCI_SELECT_OUTPUT_DEVICE NBCISelectOutputDevice; + NBCI_CHECK_OUTPUT_DEVICE NBCICheckOutputDevice; +} NBCI_EFI_PROTOCOL; + + +EFI_STATUS +LoadAcpiTables( + IN EFI_EVENT Event, IN VOID *Context + ); + +EFI_STATUS +LoadFile( + IN EFI_GUID *Guid, + OUT VOID **Buffer, + OUT UINTN *BufferSize + ); + +//#define NBCI_DRIVER_VERSION 0x001 + diff --git a/Include/Protocol/NvmExpressPassThru.h b/Include/Protocol/NvmExpressPassThru.h new file mode 100644 index 0000000..2e9e7ac --- /dev/null +++ b/Include/Protocol/NvmExpressPassThru.h @@ -0,0 +1,307 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2015, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/NvmExpressPassThru.h 1 5/14/15 2:40a Karthikar $ +// +// $Revision: 1 $ +// +// $Date: 5/14/15 2:40a $ +//********************************************************************** +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: NvmExpressPassThru.h +// +// Description: Protocol Header file for the NvmExpressPassThru Protocol +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef __EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL_H__ +#define __EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL_H__ + +typedef struct _EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL; + +#define EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL_GUID \ + {0x52c78312, 0x8edc, 0x4233, { 0x98, 0xf2, 0x1a, 0x1a, 0xa5, 0xe3, 0x88, 0xa5 } } + +#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001 + +#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002 + +#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_NONBLOCKINGIO 0x0004 + +#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_CMD_SET_NVME 0x0008 + +// FusedOperation +#define NORMAL_CMD 0x00 +#define FUSED_FIRST_CMD 0x01 +#define FUSED_SECOND_CMD 0x02 + +// Flags +#define CDW2_VALID 0x01 +#define CDW3_VALID 0x02 +#define CDW10_VALID 0x04 +#define CDW11_VALID 0x08 +#define CDW12_VALID 0x10 +#define CDW13_VALID 0x20 +#define CDW14_VALID 0x40 +#define CDW15_VALID 0x80 + +typedef struct { + UINT32 Attributes; + UINT32 IoAlign; + UINT32 NvmeVersion; +} EFI_NVM_EXPRESS_PASS_THRU_MODE; + +typedef struct { + UINT8 OpCode; + UINT8 FusedOperation; + UINT16 Unused; +} NVME_CDW0; + +typedef struct { + NVME_CDW0 Cdw0; + UINT8 Flags; + UINT32 Nsid; + UINT32 Cdw2; + UINT32 Cdw3; + UINT32 Cdw10; + UINT32 Cdw11; + UINT32 Cdw12; + UINT32 Cdw13; + UINT32 Cdw14; + UINT32 Cdw15; +} EFI_NVM_EXPRESS_COMMAND; + +// This structure maps to the NVM Express specification Completion Queue Entry + +typedef struct { + UINT32 DW0; + UINT32 DW1; + UINT32 DW2; + UINT32 DW3; +} EFI_NVM_EXPRESS_COMPLETION; + +typedef struct _EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET { + // The timeout, in 100 ns units, to use for the execution of this + // NVM Express Command Packet. A Timeout value of 0 means that this + // function will wait indefinitely for the command to execute. + // If Timeout is greater than zero, then this function will return + // EFI_TIMEOUT if the time required to execute the NVM Express + // command is greater than Timeout + UINT64 CommandTimeout; + // + // A pointer to the data buffer to transfer between the host, and the + // NVM Express controller for read, write, and bi-directional commands + // + VOID *TransferBuffer; + // + // On input, the size in bytes of TransferBuffer. On output, the number + // of bytes transferred to the NVM Express controller, or namespace + // + UINT32 TransferLength; + // + // A pointer to the optional metadata buffer to transfer between the host, + // and the NVM Express controller.If this field is not NULL, then it must + // be aligned on the boundary specified by the IoAlign field in the + // EFI_NVM_EXPRESS_PASS_THRU_MODE structure. + // + VOID *MetaDataBuffer; + // + // On Input, the size in bytes of MetadataBuffer. On output, the number + // of bytes transferred to/from the NVM Express controller, or namespace + // + UINT32 MetadataLength; + // + // The type of the queue that the NVMe command should be posted to. + // A value of 0 indicates it should be posted to the Admin Submission Queue. + // A value of 1 indicates it should be posted to an I/O Submission Queue + // + UINT16 QueueType; + // + // A pointer to an NVM Express Command Packet. + // + EFI_NVM_EXPRESS_COMMAND *NvmeCmd; + // + // The raw NVM Express completion queue + // + EFI_NVM_EXPRESS_COMPLETION *NvmeCompletion; +} EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET; +//********************************************************************** +//<AMI_PHDR_START> +// +// +// Description: Sends an NVM Express Command Packet to an NVM Express controller or namespace. +// +// Input: +// IN This A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance +// IN NamespaceId A 32 bit namespace ID as defined in the NVMe specification +// to which the NVM Express Command Packet will be sent. +// IN Packet A pointer to the NVM Express Command Packet to send to +// the NVMe namespace specified by NamespaceId. +// IN Event Event to be signalled when the NVM Express Command Packet completes +// and non-blocking I/O is supported +// Output: +// EFI_SUCCESS The NVM Express Command Packet was sent by the host successfully +// EFI_BAD_BUFFER_SIZE The number of bytes that could be transferred is not valid +// EFI_NOT_READY The NVM Express Command Packet could not be sent as the controller +// is not ready +// EFI_DEVICE_ERROR Device error +// EFI_UNSUPPORTED The command described by the NVM Express Command Packet is not +// supported by the host adapter +// EFI_TIMEOUT A timeout occurred while waiting for the NVM Express Command Packet +// to execute +// Modified: +// +// Referrals: +// +// Notes: +//<AMI_PHDR_END> +//********************************************************************** + +typedef +EFI_STATUS +(EFIAPI *EFI_NVM_EXPRESS_PASS_THRU_PASSTHRU) ( + IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This, + IN UINT32 NamespaceId, + IN OUT EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET *Packet, + IN EFI_EVENT Event + ); + +//********************************************************************** +//<AMI_PHDR_START> +// +// Description:Used to retrieve the next namespace ID for this NVM Express controller. +// +// Input: +// IN This A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance +// IN NamespaceId On input, a pointer to a valid namespace ID on this NVM Express controller +// or a pointer to the value 0xFFFFFFFF. A pointer to the value 0xFFFFFFFF retrieves +// the first valid namespace ID on this NVM Express controller. +// Output: +// EFI_SUCCESS The Namespace ID of the next Namespace was returned +// EFI_NOT_FOUND There are no more namespaces defined on this controller +// EFI_INVALID_PARAMETER The Namespace ID was not valid +// +// Modified: +// +// Referrals: +// +// Notes: +// +//<AMI_PHDR_END> +//********************************************************************** + +typedef +EFI_STATUS +(EFIAPI *EFI_NVM_EXPRESS_PASS_THRU_GET_NEXT_NAMESPACE) ( + IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This, + IN OUT UINT32 *NamespaceId + ); +//********************************************************************** +//<AMI_PHDR_START> +// +// Description:Used to allocate and build a device path node for an NVM Express namespace +// on an NVM Express controller +// +// Input: +// IN This A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance +// IN NamespaceId The NVM Express namespace ID for which a device path node is +// to be allocated and built +// IN DevicePath A pointer to a single device path node that describes the +// NVM Express namespace specified by NamespaceId. +// This function is responsible for allocating the buffer DevicePath +// with the boot service AllocatePool(). It is the caller's responsibility +// to free DevicePath when the caller is finished with DevicePath. +// +// Output: +// EFI_SUCCESS The device path node that describes the NVM Express +// namespace specified by NamespaceId was allocated and +// returned in DevicePath +// EFI_NOT_FOUND The NamespaceIdis not valid +// EFI_INVALID_PARAMETER DevicePath is NULL +// EFI_OUT_OF_RESOURCES There are not enough resources to allocate the +// DevicePath node. +// Modified: +// +// Referrals: +// +// Notes: +// +//<AMI_PHDR_END> +//********************************************************************** +typedef +EFI_STATUS +(EFIAPI *EFI_NVM_EXPRESS_PASS_THRU_BUILD_DEVICE_PATH) ( + IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This, + IN UINT32 NamespaceId, + IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath + ); + +//********************************************************************** +//<AMI_PHDR_START> +// +// Description: Used to translate a device path node to a namespace ID +// +// Input: +// IN This A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance +// IN NamespaceId The NVM Express namespace ID contained in the device path node +// IN DevicePath A pointer to the device path node that describes an NVM +// Express namespace on the NVM Express controller. +// Output: +// EFI_SUCCESS Namespace ID is returned in NamespaceID +// +// Modified: +// +// Referrals: +// +// Notes: +// +//<AMI_PHDR_END> +//********************************************************************** + +typedef +EFI_STATUS +(EFIAPI *EFI_NVM_EXPRESS_PASS_THRU_GET_NAMESPACE) ( + IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This, + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, + OUT UINT32 *NamespaceId + ); + +struct _EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL { + EFI_NVM_EXPRESS_PASS_THRU_MODE *Mode; + EFI_NVM_EXPRESS_PASS_THRU_PASSTHRU PassThru; + EFI_NVM_EXPRESS_PASS_THRU_GET_NEXT_NAMESPACE GetNextNamespace; + EFI_NVM_EXPRESS_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath; + EFI_NVM_EXPRESS_PASS_THRU_GET_NAMESPACE GetNameSpace; +}; + +extern EFI_GUID gEfiNvmExpressPassThruProtocolGuid; + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2015, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/PAhciBus.h b/Include/Protocol/PAhciBus.h new file mode 100644 index 0000000..0f6e2c1 --- /dev/null +++ b/Include/Protocol/PAhciBus.h @@ -0,0 +1,399 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/PAhciBus.h 3 2/01/15 11:02p Chienhsieh $ +// +// $Revision: 3 $ +// +// $Date: 2/01/15 11:02p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/PAhciBus.h $ +// +// 3 2/01/15 11:02p Chienhsieh +// Update v12 for AHCI module labeled 27. +// +// 12 6/25/14 10:08a Anandakrishnanl +// [TAG] EIP170118 +// [Category] Bug Fix +// [Severity] Normal +// [Symptom] MDAT can't program correctly in AHCI module +// [RootCause] Identify Data Word 76_79 Offset for DiPM Support/Enabled +// is incorrect for validation +// [Solution] Changed separating DiPM and Device Sleep into two routines +// and also modified the tokens to disable both support by default . +// Corrected Identify data validations +// [Files] AhciBus.c +// AhciBus.h +// AhciSrc.sdl +// PAhciBus.h +// PIDEBus.h +// +// 11 7/23/13 11:58p Srikantakumarp +// [TAG] EIP129989 +// [Category] Improvement +// [Description] Added DIPM support in Aptio 4.x AHCIBUS driver. +// [Files] AhciBus.c, AhciBus.h, AhciController.h, AhciSrc.sdl, +// PAhciBus.h +// +// 10 7/22/13 2:10a Rameshr +// [TAG] EIP129028 +// [Category] Improvement +// [Description] Implement the POWERUP_IN_STANDBY_MODE support in +// AHCIBUS driver +// [Files] Ahcibus.c, Ahcibus.h, Pahcibus.h +// +// 9 7/18/13 4:23a Rameshr +// [TAG] EIP127919 +// [Category] Improvement +// [Description] "Device is Atapi" bit of PxCMD will be set if the ATAPI +// device connected on the Port and "Drive LED on ATAPI" Enabled by AHCI +// platform policy +// [Files] Pahcibus.h, Ahcibus.c, Ahcibus.h +// +// 8 11/28/12 7:22a Deepthins +// [TAG] EIP104011 +// [Category] Bug Fix +// [Severity] Minor +// [Symptom] AhciBaseAddress build x86 problem +// [RootCause] When x64_BUILD is disabled, UINTN is UINT32, when copied +// to UINT64 can cause data loss +// [Solution] AhciBaseAddress is defined as UINT32 instead of UINTN. +// [Files] AtaPassThru.c ,PAhciBus.h +// +// 7 9/10/12 3:05a Rameshr +// [TAG] EIP95440 +// [Category] Improvement +// [Description] Add HddSecurity and HddSmart feature under UEFI Raid +// driver mode +// [Files] Ahcibus.c, Pahcibus.h, Aint13.c +// +// 6 8/16/12 3:16a Rajeshms +// [TAG] EIP97048 +// [Category] New Feature +// [Description] ATAPI PassThru Support using +// EFI_EXT_SCSI_PASS_THRU_PROTOCOL. +// [Files] AhciBus.c, AhciController.c, IdeBus.c, Atapi.c, PIDEBus.h, +// PAhciBus.h, ScsiPassThruAtapi.sdl, ScsiPassThruAtapi.mak, +// ScsiPassThruAtapi.c, ScsiPassThruAtapiSupport.h, ScsiPassThruAtapi.chm, +// ScsiPassThruExt.h +// +// 5 7/20/12 6:16a Anandakrishnanl +// [TAG] EIP88683 +// [Category] New Feature +// [Description] EFI_ATA_PASS_THRU_PROTOCOL Support for Aptio IDE +// [Files] AhciBus.c +// AhciBus.h +// AInt13.h +// IdeBus.c +// IdeBus.h +// PIDEBus.h +// PAhciBus.h +// AtaPassThru.sdl +// AtaPassThru.mak +// AtaPassThru.c +// AtaPassThruSupport.h +// AtaPassThru.chm +// +// 4 12/23/10 3:49a Lavanyap +// [TAG] - EIP41445 +// [Category] - NEW FEATURE +// [Description] - Created SataPioDataOut and AtaPioDataOut protocol +// function that can accept additional input parameters. +// [Files] - AhciBus.h, AhciBus.c, AhciController.c, Ata.c, IdeBus.c, +// IdeBus.h, IdeBusMaster.c,PAhciBus.h, PIdeBus.h +// +// 3 1/11/10 12:15p Krishnakumarg +// Added DiPM in AHCI_BUS_PROTOCOL - EIP 30041 +// +// 2 9/08/09 9:21a Krishnakumarg +// Acoustic member variables added to AHCI_BUS_PROTOCOL +// +// 1 28/02/08 7:51p Anandakrishnanl +// Added PIdeBus.h and PAhciBus.h to generic Protocol for HddSecurity +// support. +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: AhciBus.h +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef _PAchiBus_ +#define _PAchiBus_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define AHCI_BUS_INIT_PROTOCOL_GUID \ + {0xB2FA4764, 0x3B6E, 0x43D3, 0x91, 0xDF, 0x87, 0xD1, 0x5A, 0x3E, 0x56, 0x68} + + +GUID_VARIABLE_DECLARATION(gAciBusInitProtocolGuid,AHCI_BUS_INIT_PROTOCOL_GUID); + + +#define AHCI_PLATFORM_POLICY_PROTOCOL_GUID \ + {0x17706d27, 0x83fe, 0x4770,0x87, 0x5f, 0x4c, 0xef, 0x4c, 0xb8, 0xf6, 0x3d} + +GUID_VARIABLE_DECLARATION(gAciPlatformPolicyProtocolGuid,AHCI_PLATFORM_POLICY_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <AmiDxeLib.h> + +// Forward reference for pure ANSI compatability +typedef struct _SATA_DEVICE_INTERFACE SATA_DEVICE_INTERFACE; +typedef struct _AHCI_BUS_PROTOCOL AHCI_BUS_PROTOCOL; + +#define COMMAND_COMPLETE_TIMEOUT 5000 // 5Sec + +#pragma pack(1) + +typedef struct { + UINT32 Lowdword; + UINT32 Upperdword; +} STRUCT_U64_U32; + +//typedef enum { +// ATA = 0, +// ATAPI = 1, +// PMPORT = 2 +//} DEVICE_TYPE; + +typedef enum { + NON_DATA_CMD = 0, + PIO_DATA_IN_CMD = 1, + PIO_DATA_OUT_CMD = 2, + DMA_DATA_IN_CMD = 3, + DMA_DATA_OUT_CMD = 4, + PACKET_PIO_DATA_IN_CMD = 5, + PACKET_PIO_DATA_OUT_CMD = 6, + PACKET_DMA_DATA_IN_CMD = 7, + PACKET_DMA_DATA_OUT_CMD = 8, +} COMMAND_TYPE; + + +typedef struct { + DLIST AhciControllerList; + DLINK AhciControllerLink; +} AHCI_CONTOLLER_LINKED_LIST; + +typedef struct _AHCI_ATAPI_COMMAND{ + UINT8 Ahci_Atapi_Command[0x10]; +} AHCI_ATAPI_COMMAND; + +typedef struct{ + VOID *Buffer; + UINT32 ByteCount; + UINT8 Features; + UINT8 FeaturesExp; + UINT16 SectorCount; + UINT8 LBALow; + UINT8 LBALowExp; + UINT8 LBAMid; + UINT8 LBAMidExp; + UINT8 LBAHigh; + UINT8 LBAHighExp; + UINT8 Device; + UINT8 Command; + UINT8 Control; + AHCI_ATAPI_COMMAND AtapiCmd; +}COMMAND_STRUCTURE; + +typedef EFI_STATUS (*EFI_SATA_DEV_RAED_WRITE_PIO) ( + IN SATA_DEVICE_INTERFACE *SataDevInterface, + IN OUT VOID *Buffer, + IN UINTN ByteCount, + IN UINT64 LBA, + IN UINT8 ReadWriteCommand, + IN BOOLEAN READWRITE +); + +typedef EFI_STATUS (*EFI_SATA_DEV_PIO_DATA_IN) ( + IN SATA_DEVICE_INTERFACE *SataDevInterface, + IN OUT COMMAND_STRUCTURE *CommandStructure, + IN BOOLEAN READWRITE + +); + +typedef EFI_STATUS (*EFI_SATA_DEV_PIO_DATA_OUT) ( + IN SATA_DEVICE_INTERFACE *SataDevInterface, + IN OUT VOID *Buffer, + IN UINTN ByteCount, + IN UINT8 Features, + IN UINT8 LBALow, + IN UINT8 LBALowExp, + IN UINT8 LBAMid, + IN UINT8 LBAMidExp, + IN UINT8 LBAHigh, + IN UINT8 LBAHighExp, + IN UINT8 Command, + IN BOOLEAN READWRITE +); +typedef EFI_STATUS (*EFI_SATA_DEV_NON_DATA_CMD) ( + IN SATA_DEVICE_INTERFACE *SataDevInterface, + IN COMMAND_STRUCTURE CommandStructure +); + +typedef EFI_STATUS (*EFI_SATA_DEV_WAIT_FOR_CMD_COMPLETE) ( + IN SATA_DEVICE_INTERFACE *SataDevInterface, + IN COMMAND_TYPE CommandType, + IN UINTN TimeOut + +); + +typedef EFI_STATUS (*EFI_SATA_GENERATE_PORT_RESET) ( + AHCI_BUS_PROTOCOL *AhciBusInterface, + SATA_DEVICE_INTERFACE *SataDevInterface, + UINT8 Port, + UINT8 PMPort, + UINT8 Speed, + UINT8 PowerManagement +); + +typedef EFI_STATUS (*EFI_EXECUTE_PACKET_COMMAND) ( + IN SATA_DEVICE_INTERFACE *SataDevInterface, + IN COMMAND_STRUCTURE *CommandStructure, + IN BOOLEAN READWRITE +); + +typedef struct _AHCI_BUS_PROTOCOL{ + EFI_HANDLE ControllerHandle; + UINT32 AhciBaseAddress; + UINT32 AhciVersion; + UINT32 HBACapability; + UINT32 HBAPortImplemented; // Bit Map + UINT32 PortCommandListBaseAddr; + UINT32 PortCommandListLength; + UINT32 PortCommandTableBaseAddr; + UINT32 PortCommandTableLength; + UINT32 PortFISBaseAddr; + UINT32 PortFISBaseAddrEnd; + DLIST SataDeviceList; + EFI_DEVICE_PATH_PROTOCOL *DevicePathProtocol; + EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeControllerInterface; + EFI_PCI_IO_PROTOCOL *PciIO; + UINT32 Address1; // Unmodified PortFISBaseAddr + UINT32 Address2; // Unmodified PortCommandListBaseAddr + UINT8 NumberofPortsImplemented; // 1 based Count + BOOLEAN AHCIRAIDMODE; // Set to TRUE in AHCI mode, FALSE in RAID mode + + EFI_SATA_DEV_RAED_WRITE_PIO SataReadWritePio; + EFI_SATA_DEV_PIO_DATA_IN ExecutePioDataCommand; + EFI_SATA_DEV_PIO_DATA_OUT SataPioDataOut; + EFI_SATA_DEV_NON_DATA_CMD ExecuteNonDataCommand; + EFI_SATA_DEV_WAIT_FOR_CMD_COMPLETE WaitforCommandComplete; + EFI_SATA_GENERATE_PORT_RESET GeneratePortReset; + EFI_EXECUTE_PACKET_COMMAND ExecutePacketCommand; + + BOOLEAN Acoustic_Enable; // Acoustic Support + UINT8 Acoustic_Management_Level; // Acoustic Level + UINT8 DiPM; + UINT16 PrevPortNum; + UINT16 PrevPortMultiplierPortNum; + +}AHCI_BUS_PROTOCOL; + +typedef struct _SATA_DISK_INFO{ + EFI_DISK_INFO_PROTOCOL DiskInfo; // should be the first Entry + SATA_DEVICE_INTERFACE *SataDevInterface; +}SATA_DISK_INFO; + +typedef struct _SATA_BLOCK_IO{ + EFI_BLOCK_IO_PROTOCOL BlkIo; // should be the first Entry + SATA_DEVICE_INTERFACE *SataDevInterface; +}SATA_BLOCK_IO; + +typedef struct _SATA_DEVICE_INTERFACE{ + EFI_HANDLE IdeDeviceHandle; + UINT8 PortNumber; + UINT8 PMPortNumber; + UINT8 NumPMPorts; // Number of Ports in PM, Valid for PMPORT only + UINT8 DeviceState; + UINT32 Signature; + UINT32 SControl; + DEVICE_TYPE DeviceType; + + UINT8 PIOMode; + UINT8 SWDma; + UINT8 MWDma; + UINT8 UDma; + UINT8 IORdy; + UINT8 ReadCommand; + UINT8 WriteCommand; + IDENTIFY_DATA IdentifyData; + EFI_UNICODE_STRING_TABLE *UDeviceName; + ATAPI_DEVICE *AtapiDevice; + UINT8 AtapiSenseData[256]; + UINT8 AtapiSenseDataLength; + + UINT32 PortCommandListBaseAddr; + UINT32 PortFISBaseAddr; + + AHCI_BUS_PROTOCOL *AhciBusInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePathProtocol; + SATA_BLOCK_IO *SataBlkIo; + SATA_DISK_INFO *SataDiskInfo; + SECURITY_PROTOCOL *IdeSecurityInterface; + SMART_INTERFACE *SMARTInterface; + POWER_MGMT_INTERFACE *PowerMgmtInterface; + + DLINK SataDeviceLink; + DLIST PMSataDeviceList; // for devices behind Port Multiplier + DLINK PMSataDeviceLink; +}SATA_DEVICE_INTERFACE; + +typedef struct{ + BOOLEAN RaidDriverMode; // Set to TRUE For UEFI Raid driver and FALSE for Legacy Raid option rom + BOOLEAN AhciBusAtapiSupport; // Set to FALSE For UEFI Raid driver and TRUE for Legacy Raid option rom + BOOLEAN DriverLedOnAtapiEnable; // Set to TRUE to enable the Drive LED on ATAPI Enable (DLAE) bit + BOOLEAN PowerUpInStandbySupport; + BOOLEAN PowerUpInStandbyMode; + BOOLEAN DipmSupport; // Set to TRUE to Support the Device initiated power management. + BOOLEAN DipmEnable; // Set to TRUE to Enable the Device initiated power management. + BOOLEAN DeviceSleepSupport; // Set to TRUE to Support the Device Sleep + BOOLEAN DeviceSleepEnable; +} AHCI_PLATFORM_POLICY_PROTOCOL; + +#pragma pack() + +#endif // #ifndef GUID_VARIABLE_DEFINITION +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//*************************************************************************
\ No newline at end of file diff --git a/Include/Protocol/PDiskInfo.h b/Include/Protocol/PDiskInfo.h new file mode 100644 index 0000000..6715382 --- /dev/null +++ b/Include/Protocol/PDiskInfo.h @@ -0,0 +1,130 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/BIN/Core/Modules/IdeBus/PDiskInfo.h 4 7/05/11 2:54a Anandakrishnanl $ +// +// $Revision: 4 $ +// +// $Date: 7/05/11 2:54a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Modules/IdeBus/PDiskInfo.h $ +// +// 4 7/05/11 2:54a Anandakrishnanl +// [TAG] EIP56530 +// [Category] Improvement +// [Description] EFI_IDE_CONTROLLER_INIT_PROTOCOL and +// EFI_DISK_INFO_PROTOCOL are used accordingly to the PI 1.2 spec +// [Files] AhciBus.c, IdeControllerInit.h, PDiskInfo.h +// +// 3 8/25/10 5:38a Rameshr +// New Feature: EIP 37748 +// Description: Move all the IDEBus Source driver SDL token into IdeBus +// Bin Driver. +// FilesModified: Ata.c, Atapi.c, idebus.c, IdeBus.h, +// IdebuscomponentName.c, IdeBusmaster.c IdeBusSrc.mak IdebusSrc.sdl +// IdeHpa.c, IdePowerManagement.c +// +// 2 7/01/09 12:25p Rameshr +// Coding Standard and File header updated. +// +// 1 12/01/05 9:38a Felixp +// +// 2 3/04/05 10:44a Mandal +// +// 1 1/28/05 12:45p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/10/04 1:01p Srinin +// +// +//********************************************************************** + +#ifndef __DISK_INFO_H__ +#define __DISK_INFO_H__ + + +#define EFI_DISK_INFO_PROTOCOL_GUID \ + { 0xd432a67f, 0x14dc, 0x484b, 0xb3, 0xbb, 0x3f, 0x2, 0x91, 0x84, 0x93, 0x27 } + + +typedef struct _EFI_DISK_INFO_PROTOCOL EFI_DISK_INFO_PROTOCOL; + +typedef +EFI_STATUS +(*EFI_DISK_INFO_INQUIRY) ( + IN EFI_DISK_INFO_PROTOCOL *This, + IN OUT VOID *InquiryData, + IN OUT UINT32 *InquiryDataSize +); + +typedef +EFI_STATUS +(*EFI_DISK_INFO_IDENTIFY) ( + IN EFI_DISK_INFO_PROTOCOL *This, + IN OUT VOID *IdentifyData, + IN OUT UINT32 *IdentifyDataSize +); + +typedef +EFI_STATUS +(*EFI_DISK_INFO_SENSE_DATA) ( + IN EFI_DISK_INFO_PROTOCOL *This, + IN OUT VOID *SenseData, + IN OUT UINT32 *SenseDataSize, + OUT UINT8 *SenseDataNumber +); + +typedef +EFI_STATUS +(*EFI_DISK_INFO_WHICH_IDE) ( + IN EFI_DISK_INFO_PROTOCOL *This, + OUT UINT32 *IdeChannel, + OUT UINT32 *IdeDevice +); + +#define EFI_DISK_INFO_IDE_INTERFACE_GUID \ + { 0x5e948fe3, 0x26d3, 0x42b5, 0xaf, 0x17, 0x61, 0x2, 0x87, 0x18, 0x8d, 0xec } + +#define EFI_DISK_INFO_AHCI_INTERFACE_GUID \ +{ 0x9e498932, 0x4abc, 0x45af, 0xa3, 0x4d, 0x2, 0x47, 0x78, 0x7b, 0xe7, 0xc6 } + +typedef struct _EFI_DISK_INFO_PROTOCOL { + EFI_GUID Interface; + EFI_DISK_INFO_INQUIRY Inquiry; + EFI_DISK_INFO_IDENTIFY Identify; + EFI_DISK_INFO_SENSE_DATA SenseData; + EFI_DISK_INFO_WHICH_IDE WhichIde; +} EFI_DISK_INFO_PROTOCOL; + + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/PIDEBus.cif b/Include/Protocol/PIDEBus.cif new file mode 100644 index 0000000..3a63549 --- /dev/null +++ b/Include/Protocol/PIDEBus.cif @@ -0,0 +1,8 @@ +<component> + name = "IDEBusProtocol" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "IDEBusProtocol" +[files] +"\PDiskInfo.h" +<endComponent>
\ No newline at end of file diff --git a/Include/Protocol/PIDEBus.h b/Include/Protocol/PIDEBus.h new file mode 100644 index 0000000..5077984 --- /dev/null +++ b/Include/Protocol/PIDEBus.h @@ -0,0 +1,1364 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/PIDEBus.h 3 2/01/15 11:02p Chienhsieh $ +// +// $Revision: 3 $ +// +// $Date: 2/01/15 11:02p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/PIDEBus.h $ +// +// 3 2/01/15 11:02p Chienhsieh +// Update v31 for AHCI module labeled 27. +// +// 31 6/25/14 10:12a Anandakrishnanl +// [TAG] EIP170118 +// [Category] Bug Fix +// [Severity] Normal +// [Symptom] MDAT can't program correctly in AHCI module +// [RootCause] Identify Data Word 76_79 Offset for DiPM +// Support/Enabled is incorrect for validation +// [Solution] Changed separating DiPM and Device Sleep into two routines +// and also modified the tokens to disable both support by default . +// Corrected Identify data validations. +// [Files] AhciBus.c +// AhciBus.h +// AhciSrc.sdl +// PAhciBus.h +// PIDEBus.h +// +// 2 9/18/13 1:47a Thomaschen +// Update for ACHI module labeled 24. +// +// 29 6/06/13 4:17a Rameshr +// [TAG] EIP106423 +// [Category] Improvement +// [Description] HddPassword Support in UEFI Raid and Legacy Raid. And +// also taken care where there is no Conin Device avilable in the post +// [Files] IdeSecurity.cif,IdeSecurity.sdl,IdeSecurity.mak,IdeSecurityB +// dsCall.c,HddPassword.c, Ahcibus.c, Pidebus.h +// +// 28 11/27/12 3:23a Rameshr +// [TAG] EIP106985 +// [Category] Improvement +// [Description] The IDE_SMART_INTERFACE structure matched with the +// SMART_INTERFACE structure +// [Files] PIDEBus.h +// +// 27 8/16/12 3:14a Rajeshms +// [TAG] EIP97048 +// [Category] New Feature +// [Description] ATAPI PassThru Support using +// EFI_EXT_SCSI_PASS_THRU_PROTOCOL. +// [Files] AhciBus.c, AhciController.c, IdeBus.c, Atapi.c, PIDEBus.h, +// PAhciBus.h, ScsiPassThruAtapi.sdl, ScsiPassThruAtapi.mak, +// ScsiPassThruAtapi.c, ScsiPassThruAtapiSupport.h, ScsiPassThruAtapi.chm, +// ScsiPassThruExt.h +// +// 26 7/20/12 6:15a Anandakrishnanl +// [TAG] EIP88683 +// [Category] New Feature +// [Description] EFI_ATA_PASS_THRU_PROTOCOL Support for Aptio IDE +// [Files] AhciBus.c +// AhciBus.h +// AInt13.h +// IdeBus.c +// IdeBus.h +// PIDEBus.h +// PAhciBus.h +// AtaPassThru.sdl +// AtaPassThru.mak +// AtaPassThru.c +// AtaPassThruSupport.h +// AtaPassThru.chm +// +// 25 7/02/12 8:17a Jittenkumarp +// [TAG] EIP91969 +// [Category] Improvement +// [Description] Added versioning and signature support in IDESMART +// driver +// [Files] IdeSMART.c, IdeSMART.h, IdeSMART.sdl, PIDEBus.h +// +// 24 3/20/12 12:10a Anandakrishnanl +// [TAG] EIP68496 +// [Category] Bug Fix +// [Severity] Normal +// [Symptom] Opal Security Little Endian vs Big Endian +// [RootCause] Equate defines are defined in alternative endian +// [Solution] Equate defines changed to reflect correct format +// [Files] PIDEBus.h +// +// 23 12/05/11 6:14p Rajkumarkc +// [TAG] EIP77142 +// [Category] Improvement +// [Description] Added the function 'IdeNonDataCommandExp' in the +// 'IDE_BUS_PROTOCOL' and removed the existing function +// 'IdeNonDataCommand' for supporting the upper 24bits of LBA. +// [Files] +// Ata.c +// IdeBus.c +// Idebus.h +// PIDEBus.h +// +// 22 8/22/11 2:59a Anandakrishnanl +// [TAG] EIP62912 +// [Category] Improvement +// [Description] Opal Security Definitions Should be Moved to PIDEBUS.h +// from StorageSecurityProtocol.h +// StorageSecurityProtocol.h included in OPAL security driver module will +// give build error when disabled without sdl token #if +// OpalSecurity_SUPPORT properly placed in Ahcibus and IdeBus drivers. But +// Bus driver should not depend on any tokens. For this reason need to +// move OPAL_SEC_INIT_PROTOCOL_GUID in Pidebus.h +// [Files] IdeBus.c +// Pidebus.h +// OpalSecurity.cif +// OpalSecurity.h +// IdeOpalSec.c +// AhciOpalSec.c +// +// 21 6/13/11 11:52a Artems +// Removed unreferenced include +// +// 20 5/19/11 2:42a Anandakrishnanl +// [TAG] EIP53565 +// [Category] New Feature +// [Description] UEFI2.3+ Specifications defines Storage Security +// protocol which needs to be implemented. +// [Files] AhciBus.c,IdeBus.c,AHCIOpalSec.c,IDEOpalSec.c,OpalSecurity.c +// ,OpalSecurity.chm,OpalSecurity.cif,OpalSecurity.h,OpalSecurity.mak,Opal +// Security.sdl,PIDEBus.h,StorageSecurityProtocol.CIF,StorageSecurityProto +// col.h +// +// 19 2/21/11 3:50a Rameshr +// [TAG] - EIP53730 +// [Category] - Improvement +// [Description] - Add Odd Loading type information into ATAPI_DEVICE +// structure in AHCI mode +// [Files] - Pidebus.h +// +// 18 2/05/11 6:39p Krishnakumarg +// [TAG] - EIP36485 +// [Category] - Action Item +// [Description] - IDESMART module enhancement +// [Files] - IdeSmart.c,IdeSmart.h,PIdeBus.h +// +// 17 12/23/10 3:48a Lavanyap +// [TAG] - EIP41445 +// [Category] - NEW FEATURE +// [Description] - Created SataPioDataOut and AtaPioDataOut protocol +// function that can accept additional input parameters. +// [Files] - AhciBus.h, AhciBus.c, AhciController.c, Ata.c, IdeBus.c, +// IdeBus.h, IdeBusMaster.c,PAhciBus.h, PIdeBus.h +// +// 16 9/13/10 1:48a Rameshr +// [TAG]- EIP 43299 +// [Category]-IMPROVEMENT +// [Description]- About IdeSecurity module. It use soft smi port 0xb2 +// directly.It will need to re-modify on all of AMD project. +// 1) Added the SDL token for Sw SMI port address. +// 2) Used Pciio protocol to get the device location and passed this +// information to SMM driver. +// [Files]- IdeSecurity.c, IdeSmm.c, PideBus.h +// +// 15 8/25/10 5:41a Rameshr +// New Feature: EIP 37748 +// Description: Move all the IDEBus Source driver SDL token into IdeBus +// Bin Driver. +// FilesModified: Ata.c, Atapi.c, idebus.c, IdeBus.h, +// IdebuscomponentName.c, IdeBusmaster.c IdeBusSrc.mak IdebusSrc.sdl +// IdeHpa.c, IdePowerManagement.c +// +// 14 8/20/10 4:28p Krishnakumarg +// Ide Smart doesn't support the ATA 8 Read Smart Data. EIP#42492 +// Corrected datasize for PollPeriod in Selftest funtion +// +// 13 8/13/10 5:02p Krishnakumarg +// Ide Smart doesn't support the ATA 8 Read Smart Data. EIP#42492 +// +// 12 5/12/10 4:58p Aaronp +// Changed definitions of password flags function and security flags +// function to refelect return values. +// +// 11 5/05/10 11:39a Aaronp +// +// 10 5/03/10 11:04a Krishnakumarg +// Request additional generic functionality to be added to the IdeSMART +// component.EIP#31559 +// +// 9 2/24/10 2:04p Felixp +// +// 8 1/20/10 9:51a Krishnakumarg +// Included previous IDE_SETUP_PROTOCOL structure and definitions to have +// backward compatibility with AHCI drivers. +// +// 7 1/11/10 12:17p Krishnakumarg +// Added DiPM in IDE_BUS_PROTOCOL - EIP 30041. +// Removed IDE_SETUP_PROTOCOL and Acoustic defintions as this is +// implemented in SBIDE subcomponent. +// +// 6 9/04/09 5:21p Krishnakumarg +// IDE_SETUP_PROTOCOL definition added for Acoustic management +// implementation EIP:11835 +// Acoustic flag definitions added. +// +// 5 7/08/09 12:52p Felixp +// +// 4 6/22/09 11:41a Rameshr +// Odd Type information Saved in Atapi Device Structure. +// EIP:21548 +// +// 3 4/28/09 7:13p Rameshr +// HDD password support in RAID mode +// +// 2 7/03/08 6:02p Anandakrishnanl +// Added Protocol and Guid Changes for SMART support as a seperate +// Driver. +// +// +// 1 28/02/08 7:51p Anandakrishnanl +// Added PIdeBus.h and PAhciBus.h to generic Protocol for HddSecurity +// support. +// +// 11 14/08/07 2:04p Anandakrishnanl +// Coding standard applied. +// +// 10 22/06/07 12:51p Anandakrishnanl +// HardDisk Security Support Module Added. +// Need ACPI Module and SB Module and under Core\Include we updated +// Setup.h. +// Also New IdeBus bin module. +// +// 9 12/19/06 6:16p Srinin +// DISABLE_SATA2_SOFTPREV equate added. +// +// 8 11/13/06 1:39p Ambikas +// +// 7 4/26/06 4:03p Robert +// +// 5 3/13/06 1:46a Felixp +// +// 4 1/09/06 11:34a Felixp +// IDE_BUS_INIT_PROTOCOL modified. +// +// 2 12/14/05 3:13p Srinin +// IDE_BUS_INIT_PROTOCOL modified. +// +// 1 12/01/05 9:38a Felixp +// +// 4 8/23/05 10:57a Srinin +// +// 4 8/17/05 3:30p Srinin +// ATA/ATAPI device identification modified. +// +// 3 3/04/05 10:45a Mandal +// +// 2 2/01/05 1:03p Srinin +// IDE HotPlug Support added. +// +// 1 1/28/05 12:45p Felixp +// +// 7 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 5 1/13/05 4:26p Srinin +// Host Protection Area Support added. +// +// 4 1/11/05 2:11p Srinin +// IDE Power Management Support added. +// +// 3 1/10/05 11:32a Srinin +// IDE SMART Support added. +// +// 2 1/05/05 11:22a Srinin +// Busmaster and Password support added. +// +// 1 12/10/04 1:01p Srinin +// +// +//********************************************************************** + +#ifndef _PIDEBus_ +#define _PIDEBus_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef GUID_VARIABLE_DEFINITION + +#include <Protocol\IdeControllerInit.h> + +#define IDE_BUS_DRIVER_BINDING_PROTOCOL_GUID \ + { 0x8AA67071, 0x8BEC, 0x47AB, 0x83, 0xC8, 0xCD, 0x0E, 0xB7, 0x23, 0xD0, 0x72 } + +#define IDE_BUS_INIT_PROTOCOL_GUID \ + { 0xE159A956, 0x3299, 0x4EE9, 0x91, 0x76, 0x65, 0x18, 0x1A, 0x4E, 0x5E, 0x9F } + +#define IDE_SECURITY_INTERFACE_GUID \ + { 0xF4F63529, 0x281E, 0x4040, 0xA3, 0x13, 0xC1, 0xD6, 0x76, 0x63, 0x84, 0xBE } + +#define IDE_SMART_INTERFACE_GUID \ + { 0xFFBD9AD2, 0xF1DB, 0x4F92, 0xA6, 0x49, 0xEB, 0x9E, 0xED, 0xEA, 0x86, 0xB5 } + +#define IDE_POWER_MGMT_INTERFACE_GUID \ + { 0x67BC3883, 0x7E79, 0x4BC1, 0xA3, 0x3E, 0x3A, 0xF7, 0xD1, 0x75, 0x89, 0xBA } + +#define IDE_HPA_INTERFACE_GUID\ + { 0x51AA65FC, 0x82B6, 0x49E6, 0x95, 0xE2, 0xE6, 0x82, 0x7A, 0x8D, 0x7D, 0xB4 } + +#define IDE_SETUP_PROTOCOL_GUID\ + { 0x5578ae16, 0xf1c9, 0x4e8f, 0xb1, 0x29, 0xba, 0x7, 0xf8, 0xfc, 0xf8, 0x4a } + +#define HDD_SECURITY_INIT_PROTOCOL_GUID \ + { 0xce6f86bb, 0xb800, 0x4c71, 0xb2, 0xd1, 0x38, 0x97, 0xa3, 0xbc, 0x1d, 0xae } + +#define HDD_SMART_INIT_PROTOCOL_GUID \ + { 0x9401bd4f, 0x1a00, 0x4990, 0xab, 0x56, 0xda, 0xf0, 0xe4, 0xe3, 0x48, 0xde } + +#define HDD_SECURITY_END_PROTOCOL_GUID \ + { 0xad77ae29, 0x4c20, 0x4fdd, 0x85, 0x04, 0x81, 0x76, 0x61, 0x9b, 0x67, 0x6a } + +#define OPAL_SEC_INIT_PROTOCOL_GUID \ + { 0x59af16b0, 0x661d, 0x4865, 0xa3, 0x81, 0x38, 0xde, 0x68, 0x38, 0x5d, 0x8d } + +#define ATA_PASS_THRU_INIT_PROTOCOL_GUID \ + { 0xc6734411, 0x2dda, 0x4632, 0xa5, 0x92, 0x92, 0x0f, 0x24, 0xd6, 0xed, 0x21 } + +#define SCSI_PASS_THRU_ATAPI_INIT_PROTOCOL_GUID \ + { 0x0fc50878, 0x1633, 0x432a, 0xbd, 0xe4, 0x84, 0x13, 0x57, 0xfc, 0x15, 0xe9 } + +#define ONBOARD_RAID_CONTROLLER_GUID \ + { 0x5d206dd3, 0x516a, 0x47dc, 0xa1, 0xbc, 0x6d, 0xa2, 0x04, 0xaa, 0xbe, 0x08 } + +#define HDD_PASSWORD_VERIFIED_GUID \ + { 0x1fd29be6, 0x70d0, 0x42a4, 0xa6, 0xe7, 0xe5, 0xd1, 0x0e, 0x6a, 0xc3, 0x76 } + +#define MASTER_DRIVE 0 +#define SLAVE_DRIVE 1 +#define PRIMARY_CHANNEL 0 +#define SECONDARY_CHANNEL 1 + + +#define HOB 0x80 +#define SRST 0x04 +#define nIEN 0x02 + +#define ABRT 0x04 + +#define BSY 0x80 +#define DRDY 0x40 +#define DF 0x20 +#define DRQ 0x08 +#define ERR 0x01 +#define CHK 0x01 + +// Get Media Status ERROR register output +#define WP 0x40 +#define MC 0x20 +#define MCR 0x08 +#define NM 0x02 + +// IDE Bus Master status Register +#define BM_INTERRUPT 0x4 +#define BM_ERROR 0x2 +#define BM_ACTIVE 0x1 + +// IDE Bus Master Command Register +#define BM_START_STOP 0x1 +#define DMA_MEMORY_WRITE 0x08 +#define DMA_MEMORY_READ 0x00 + + +#define SPIN_UP_REQUIRED1 0x37C8 +#define SPIN_UP_REQUIRED2 0x738c + +#define ATAPI_SIGNATURE 0xEB14 +#define ATAPI_FORMAT_UNIT 0x04 +#define ATAPI_INQUIRY 0x12 +#define ATAPI_MODE_SELECT 0x55 +#define ATAPI_MODE_SENSE 0x5A +#define READ_WRITE_ERROR 0x01 +#define CACHING_PAGE 0x08 +#define REMOVABLE_BLOCK_CAPABILITIES 0x1B +#define TIMER_PROTECT_PAGE 0x1C +#define RETURN_ALL_PAGES 0x3F +#define ATAPI_PREVENT_ALLOW_MEDIA_REMOVAL 0x1E +#define ATAPI_READ_10 0x28 +#define ATAPI_READ_12 0xA8 +#define ATAPI_READ_CAPACITY 0x25 +#define ATAPI_READ_FORMAT_CAPACITIES 0x23 +#define ATAPI_REQUEST_SENSE 0x03 +#define ATAPI_SEEK 0x2B +#define ATAPI_START_STOP_UNIT 0x1B +#define STOP_DISC 0x00 +#define START_DISC 0x01 +#define EJECT_DISC 0x02 +#define LOAD_DISC 0x03 +#define ATAPI_TEST_UNIT_READY 0x00 +#define ATAPI_VERIFY 0x2F +#define ATAPI_WRITE_10 0x2A +#define ATAPI_WRITE_12 0xAA +#define ATAPI_WRITE_AND_VERIFY 0x2E +#define ATAPI_GET_CONFIGURATION 0x46 +#define GET_PROFILE_LIST 0x00 +#define FEATURE_DISCRIPTOR 0x02 +#define GET_REMOVEABLE_MEDIUM_FEATURE 0x03 + + +#define MEDIUM_NOT_PRESENT 0x01 +#define BECOMING_READY 0x02 +#define MEDIA_CHANGED 0x03 +#define DEVICE_ERROR 0x04 +#define WRITE_PROTECTED_MEDIA 0x05 +#define POWER_ON_OR_DEVICE_RESET 0x06 +#define ILLEGAL_REQUEST 0x07 + + +#define DEVICE_RESET 0x08 +#define PACKET_COMMAND 0xA0 +#define DMA 0x01 +#define OVL 0x02 + +#define IDENTIFY_COMMAND 0xEC +#define IDENTIFY_PACKET_COMMAND 0xA1 + +#define READ_SECTORS 0x20 +#define READ_SECTORS_EXT 0x24 +#define READ_LOG_EXT_COMMAND 0x2F + +#define READ_MULTIPLE 0xC4 +#define READ_MULTIPLE_EXT 0x29 + +#define WRITE_SECTORS 0x30 +#define WRITE_SECTORS_EXT 0x34 + +#define WRITE_MULTIPLE 0xC5 +#define WRITE_MULTIPLE_EXT 0x39 + +#define READ_DMA 0xC8 +#define READ_DMA_EXT 0x25 + +#define WRITE_DMA 0xCA +#define WRITE_DMA_EXT 0x35 + +#define SET_MULTIPLE_MODE 0xC6 +#define GET_MEDIA_STATUS 0xDA + +#define SET_FEATURE_COMMAND 0xEF +#define SET_TRANSFER_MODE 0x03 +#define ADV_POWER_MANAGEMENT 0x05 +#define ENABLE_POWERUP_IN_STANDBY 0x06 +#define SET_DEVICE_SPINUP 0x07 +#define DISABLE_MEDIA_STATUS_NOTIFICATION 0x31 +#define ENABLE_MEDIA_STATUS_NOTIFICATION 0x95 +#define ACOUSTIC_MANAGEMENT_ENABLE 0x42 +#define DISABLE_ADV_POWER_MANAGEMENT 0x85 +#define DISABLE_POWERUP_IN_STANDBY 0x86 +#define ACOUSTIC_MANAGEMENT_DISABLE 0xC2 +#define DISABLE_SATA2_SOFTPREV 0x90 + + +#define SECURITY_SET_PASSWORD 0xF1 +#define SECURITY_UNLOCK 0xF2 +#define SECURITY_ERASE_PREPARE 0xF3 +#define SECURITY_ERASE_UNIT 0xF4 +#define SECURITY_FREEZE_LOCK 0xF5 +#define SECURITY_DISABLE_PASSWORD 0xF6 +#define SECURITY_BUFFER_LENGTH 512 // Bytes +#define DEV_CONFIG_FREEZE_LOCK 0xB1 +#define DEV_CONFIG_FREEZE_LOCK_FEATURES 0xC1 + + +#define SMART_COMMAND 0xB0 +#define SMART_READ_DATA 0xD0 +#define SMART_READ_THRESHOLD 0xD1 // (Obsolete) +#define SMART_AUTOSAVE 0xD2 +#define SMART_EXECUTE_OFFLINE_IMMEDIATE 0xD4 +#define SMART_READLOG 0xD5 +#define SMART_WRITELOG 0xD6 +#define SMART_ENABLE_CMD 0xD8 +#define SMART_DISABLE_CMD 0xD9 +#define SMART_RETURN_STATUS 0xDA +#define THRESHOLD_NOT_EXCEEDED 0xC24F +#define THRESHOLD_EXCEEDED 0x2CF4 +#define SMART_ABORT_SELF_TEST_SUBROUTINE 0x7F + +// +// Trusted Commands +// +#define TRUSTED_NON_DATA 0x5B +#define TRUSTED_RECEIVE 0x5C +#define TRUSTED_SEND 0x5E + +// +// Level 0 Discovery Feature code +// +#define TPER_FEATURE_CODE 0x0100 +#define LOCKING_FEATURE_CODE 0x0200 +#define OPAL_SSC_FEATURE_CODE 0x0002 + +#define PIO_FLOW_CONTROL 0x08 +#define MWDMA_MODE 0x20 +#define UDMA_MODE 0x40 + +#define ATA_SECTOR_BYTES 512 +#define MAX_SECTOR_COUNT_PIO 256 +#define MAX_SECTOR_COUNT_PIO_48BIT 65536 +#define CDROM_BLOCK_SIZE 2048 +#define LS120_BLOCK_SIZE 512 + +#define STANDBY_IMMEDIATE 0xE0 +#define IDLE_IMMEDIATE 0xE1 +#define STANDBY_CMD 0xE2 +#define IDLE_CMD 0xE3 +#define CHECK_POWER_MODE 0xE5 +#define SLEEP_CMD 0xE6 + +#define READ_NATIVE_MAX_ADDRESS 0xF8 +#define READ_NATIVE_MAX_ADDRESS_EXT 0x27 +#define SET_MAX_ADDRESS 0xF9 +#define SET_MAX_SET_PASSWORD 0x01 +#define SET_MAX_LOCK 0x02 +#define SET_MAX_UNLOCK 0x03 +#define SET_MAX_FREEZE_LOCK 0x04 +#define SET_MAX_ADDRESS_EXT 0x37 + +#define READ_LOG_EXT 0x2F +#define IDENTIFY_DEVICE_DATA_LOG 0x30 +#define SERIAL_ATA_SETTINGS_PAGE 0x08 +#define DEVSLP_TIMING_VARIABLES_OFFSET 0x30 +#define DEVSLEEP_EXIT_TIMEOUT 20 +#define MINIMUM_DEVSLP_ASSERTION_TIME 10 + +#define DIRECT_ACCESS_DEVICE 0 +#define SEQUENTIAL_ACCESS_DEVICE 1 +#define WORM 4 +#define CDROM_DEVICE 5 +#define OPTICAL_MEMORY_DEVICE 7 + +#if (SBIDE_SUPPORT == 0) + +// Equates used for Acoustic Flags +#define ACOUSTIC_SUPPORT_DISABLE 0x00 +#define ACOUSTIC_SUPPORT_ENABLE 0x01 +#define ACOUSTIC_LEVEL_BYPASS 0xFF +#define ACOUSTIC_LEVEL_MAXIMUM_PERFORMANCE 0xFE +#define ACOUSTIC_LEVEL_QUIET 0x80 + + +/// Equates used for DiPM Support +#define DiPM_SUB_COMMAND 0x03 // Count value in SetFeature identification : 03h Device-initiated interface power state transitions +#define DiPM_ENABLE 0x10 +#define DiPM_DISABLE 0x90 +#define IDENTIFY_DiPM_ENABLED 0x08 // Identify Data Word 79 Bit 3 : Device initiating interface power management Enabled +#define IDENTIFY_DiPM__SUPPORT 0x08 // Identify Data Word 78 Bit 3 : Supports Device initiating interface power management +#define IDENTIFY_DiPM_HIIPM_REQUESTS_CAPABLE 0x200 // Identify Data Word 76 Bit 9 : Receipt of host-initiated interface power management requests + +/// Equates used for DevSleep Support +#define DEVSLEEP_SUB_COMMAND 0x09 // Count value in SetFeature identification : 09h Device Sleep +#define DEVSLEEP_ENABLE 0x10 +#define DEVSLEEP_DISABLE 0x90 +#define IDENTIFY_DEVSLEEP_ENABLED 0x100 // Identify Data Word 79 Bit 8 : Device Sleep Enabled +#define IDENTIFY_DEVSLEEP_SUPPORT 0x100 // Identify Data Word 78 Bit 8 : Supports Device Sleep +#define IDENTIFY_DEVSLP_TO_REDUCED_PWRSTATE_CAPABLE 0x80 // Identify Data Word 77 Bit 7 : Device Sleep in reduced Power state capable + +typedef struct { + UINT8 AcousticPwrMgmt; + UINT8 AcousticLevel; + UINT8 DiPM; +}IDE_SETUP_PROTOCOL; +#else +#include "SBIDE.h" +#endif + +// Equates used for SMART command support + +// LOG Address Definition +#define LOG_DIRECTORY 0x00 +#define SUM_SMART_ERROR_LOG 0x01 //Summary SMART ERROR LOG +#define COMP_SMART_ERROR_LOG 0x02 //Comprehensive SMART ERROR LOG +#define SMART_SELFTEST_LOG 0x06 +#define HOST_VENDOR_SPECIFIC 0x80 //0x80 - 0x9F +#define DEVICE_VENDOR_SPECIFIC 0xA0 //0xA0 - 0xBF + +// AUTOSAVE Enable/Disable option +#define DISABLE_AUTOSAVE 0x00 +#define ENABLE_AUTOSAVE 0xF1 + +typedef enum { + ATA = 0, + ATAPI = 1, + PMPORT = 2 +} DEVICE_TYPE; + +// Forward reference for pure ANSI compatability +typedef struct _IDE_SMART_INTERFACE IDE_SMART_INTERFACE; +typedef struct _IDE_SECURITY_PROTOCOL IDE_SECURITY_PROTOCOL; +typedef struct _IDE_POWER_MGMT_INTERFACE IDE_POWER_MGMT_INTERFACE; +typedef struct _IDE_HPA_INTERFACE IDE_HPA_INTERFACE; +typedef struct _HDD_SECURITY_INIT_PROTOCOL HDD_SECURITY_INIT_PROTOCOL; +typedef struct _OPAL_SECURITY_INIT_PROTOCOL OPAL_SECURITY_INIT_PROTOCOL; +typedef struct _HDD_SMART_INIT_PROTOCOL HDD_SMART_INIT_PROTOCOL; +typedef struct _ATA_PASS_THRU_INIT_PROTOCOL ATA_PASS_THRU_INIT_PROTOCOL; +typedef struct _IDE_BUS_PROTOCOL IDE_BUS_PROTOCOL; +typedef struct _IDE_BLOCK_IO IDE_BLOCK_IO; + +typedef struct _IDE_DISK_INFO{ + EFI_DISK_INFO_PROTOCOL DiskInfo; // should be the first Entry + IDE_BUS_PROTOCOL *IdeBusInterface; +}IDE_DISK_INFO; + +typedef struct _IDE_BLOCK_IO{ + EFI_BLOCK_IO_PROTOCOL BlkIo; // should be the first Entry + IDE_BUS_PROTOCOL *IdeBusInterface; +}IDE_BLOCK_IO; + +typedef EFI_STATUS (*EFI_IDE_ATA_RAED_WRITE_PIO) ( + IN IDE_BUS_PROTOCOL *This, + IN OUT VOID *Buffer, + IN UINTN ByteCount, + IN UINT64 LBA, + IN UINT8 ReadWriteCommand, + IN BOOLEAN ReadWrite +); + +typedef EFI_STATUS (*EFI_IDE_ATA_PIO_DATA_IN) ( + IN IDE_BUS_PROTOCOL *This, + OUT VOID *Buffer, + IN UINT32 ByteCount, + IN UINT8 Features, + IN UINT8 SectorCount, + IN UINT8 LBALow, + IN UINT8 LBAMid, + IN UINT8 LBAHigh, + IN UINT8 Device, + IN UINT8 Command, + IN BOOLEAN Multiple +); + +typedef EFI_STATUS (*EFI_IDE_ATA_PIO_DATA_OUT) ( + IN IDE_BUS_PROTOCOL *This, + IN OUT VOID *Buffer, + IN UINTN ByteCount, + IN UINT8 Features, + IN UINT32 SectorCountIn, + IN UINT8 LBALow, + IN UINT8 LBALowExp, + IN UINT8 LBAMid, + IN UINT8 LBAMidExp, + IN UINT8 LBAHigh, + IN UINT8 LBAHighExp, + IN UINT8 Device, + IN UINT8 Command, + IN BOOLEAN ReadWrite, + IN BOOLEAN Multiple +); + +typedef EFI_STATUS (*EFI_IDE_NON_DATA_CMD) ( + IN IDE_BUS_PROTOCOL *This, + IN UINT8 Features, + IN UINT8 SectorCount, + IN UINT8 SectorCountExp, + IN UINT8 LBALow, + IN UINT8 LBALowExp, + IN UINT8 LBAMid, + IN UINT8 LBAMidExp, + IN UINT8 LBAHigh, + IN UINT8 LBAHighExp, + IN UINT8 Device, + IN UINT8 Command + +); + +typedef EFI_STATUS (*EFI_WAIT_FOR_CMD_COMPLETE) ( + IN IDE_BUS_PROTOCOL *This +); + +typedef UINT16 SECURITY_FLAGS; +// BIT0 : Security Supported +// BIT1 : Security Enabled +// BIT2 : Security Locked +// BIT3 : Security Frozen +// BIT4 : Security Count Expired +// BIT5 : Enhanced Security Erase supported +// BIT6 : Enhanced Security Erase supported +// BIT8 : Security Level 0:High, 1:Maximum + +typedef EFI_STATUS (*EFI_IDE_RETURN_SECURITY_STATUS) ( + IN IDE_SECURITY_PROTOCOL *This, + SECURITY_FLAGS *SecurityStatus +); + +typedef EFI_STATUS (*EFI_IDE_SECURITY_SET_PASSWORD) ( + IN IDE_SECURITY_PROTOCOL *This, + UINT16 Control, + UINT8 *Buffer, + UINT16 RevisionCode +); + +typedef EFI_STATUS (*EFI_IDE_SECURITY_UNLOCK_PASSWORD) ( + IN IDE_SECURITY_PROTOCOL *This, + UINT16 Control, + UINT8 *Buffer +); + + +typedef EFI_STATUS (*EFI_IDE_SECURITY_DISABLE_PASSWORD) ( + IN IDE_SECURITY_PROTOCOL *This, + UINT16 Control, + UINT8 *Buffer +); + +typedef EFI_STATUS (*EFI_IDE_SECURITY_FREEZE_LOCK) ( + IN IDE_SECURITY_PROTOCOL *This +); + +typedef EFI_STATUS (*EFI_IDE_SECURITY_ERASE_UNIT) ( + IN IDE_SECURITY_PROTOCOL *This, + UINT16 Control, + UINT8 *Buffer +); + +typedef UINT32 PASSWORD_FLAGS; +// IdePasswordFlags: +// BIT0 User Password Support +// BIT1 Master Password Support +// BIT2 Display User Password +// BIT3 Display Master Password +// BIT11 OEM Default Master Password +// BIT16 MasterPassword Set Status. +// BIT17 UserPassword Set Status. + +typedef EFI_STATUS (*EFI_IDE_RETURN_PASSWORD_FLAGS) ( + IN IDE_SECURITY_PROTOCOL *This, + PASSWORD_FLAGS *IdePasswordFlags +); + +typedef EFI_STATUS (*IDE_SMARTRETURNSTATUS) ( + IN IDE_SMART_INTERFACE *This +); + +typedef EFI_STATUS (*IDE_SMARTSELFTEST) ( + IN IDE_SMART_INTERFACE *This, + IN UINT8 SelfTestType, + OUT UINT16 *PollPeriod +); + +typedef EFI_STATUS (*IDE_SMARTABORTSELFTEST) ( + IN IDE_SMART_INTERFACE *This +); + +typedef EFI_STATUS (*IDE_SENDSMARTCOMMAND) ( + IN IDE_SMART_INTERFACE *This, + IN UINT8 SubCommand, + IN UINT8 AutoSaveEnable, //OPTIONAL + IN UINT8 SelfTestType //OPTIONAL +); + +typedef EFI_STATUS (*IDE_SMARTREADDATA) ( + IN IDE_SMART_INTERFACE *This, + IN UINT8 SubCommand, + OUT VOID *Buffer, + IN UINT8 LogAddress, //OPTIONAL + IN UINT8 SectorCount //OPTIONAL +); + +typedef EFI_STATUS (*IDE_SMARTWRITEDATA) ( + IN IDE_SMART_INTERFACE *This, + IN UINT8 SubCommand, + IN VOID *Buffer, + IN UINT8 LogAddress, + IN UINT8 SectorCount +); + +typedef EFI_STATUS (*IDE_SMARTGETSMARTDATA) ( + IN IDE_SMART_INTERFACE *This, + OUT UINT8 **SmartData +); + +typedef EFI_STATUS (*IDE_SMARTSELFTESTSTATUS) ( + IN IDE_SMART_INTERFACE *This, + OUT UINT8 *TestStatus +); + +typedef EFI_STATUS (*EFI_IDE_CHECK_POWER_MODE)( + IN IDE_POWER_MGMT_INTERFACE *IdePowerMgmtInterface, + IN OUT UINT8 *PowerMode +); + +typedef EFI_STATUS (*EFI_IDE_IDLE_MODE)( + IN IDE_POWER_MGMT_INTERFACE *IdePowerMgmtInterface, + IN UINT8 StandbyTimeout +); + +typedef EFI_STATUS (*EFI_IDE_STANDBY_MODE)( + IN IDE_POWER_MGMT_INTERFACE *IdePowerMgmtInterface, + IN UINT8 StandbyTimeout +); + +typedef EFI_STATUS (*EFI_IDE_ADVANCE_POWER_MGMT_MODE)( + IN IDE_POWER_MGMT_INTERFACE *IdePowerMgmtInterface, + IN UINT8 AdvPowerMgmtLevel +); + +typedef EFI_STATUS (*EFI_IDE_GET_NATIVE_MAX_ADDRESS)( + IN IDE_HPA_INTERFACE *This, + OUT UINT64 *LBA +); + +typedef EFI_STATUS (*EFI_IDE_SET_MAX_ADDRESS)( + IN IDE_HPA_INTERFACE *This, + OUT UINT64 LBA, + IN BOOLEAN Volatile +); + +typedef EFI_STATUS (*EFI_IDE_HPA_DISABLED_LAST_LBA)( + IN IDE_HPA_INTERFACE *This, + OUT UINT64 *LBA +); + +typedef EFI_STATUS (*EFI_IDE_SET_MAX_PASSWORD)( + IN IDE_HPA_INTERFACE *This, + IN UINT8 *PasswordBuffer +); + +typedef EFI_STATUS (*EFI_IDE_SET_MAX_LOCK)( + IN IDE_HPA_INTERFACE *This +); + +typedef EFI_STATUS (*EFI_IDE_SET_MAX_UNLOCK)( + IN IDE_HPA_INTERFACE *This, + IN UINT8 *PasswordBuffer +); + +typedef EFI_STATUS (*EFI_IDE_SET_MAX_FREEZE_LOCK)( + IN IDE_HPA_INTERFACE *This +); + +typedef EFI_STATUS (EFIAPI *HDD_SECURITY_INSTALL) ( + IN VOID *BusInterface, + IN BOOLEAN ModeFlag +); + +typedef EFI_STATUS (EFIAPI *HDD_SECURITY_UNINSTALL) ( + IN VOID *BusInterface, + IN BOOLEAN ModeFlag +); + +typedef EFI_STATUS (EFIAPI *HDD_SMART_INSTALL) ( + IN VOID *BusInterface, + IN BOOLEAN ModeFlag +); + +typedef EFI_STATUS (EFIAPI *HDD_SMART_UNINSTALL) ( + IN VOID *BusInterface, + IN BOOLEAN ModeFlag +); + +typedef EFI_STATUS (EFIAPI *HDD_SMART_INIT) ( + IN VOID *BusInterface, + IN BOOLEAN ModeFlag +); + + +#pragma pack(1) + +typedef struct { + CHAR8 *Language; + CHAR16 *UnicodeString; +} EFI_UNICODE_STRING_TABLE; + + +typedef struct { + UINT32 DataLength; + UINT8 Reserved[2]; + UINT16 CurrentProfile; +} GET_CONFIGURATION_HEADER; + +// Based on ATA/ATAPI-6 +typedef struct _IDENTIFY_DATA{ + + UINT16 General_Config_0; + UINT16 Reserved_1; + UINT16 Special_Config_2; + UINT16 Reserved_3; + UINT16 Reserved_4; + UINT16 Reserved_5; + UINT16 Reserved_6; + UINT16 Reserved_7; + UINT16 Reserved_8; + UINT16 Reserved_9; + UINT8 Serial_Number_10[20]; + UINT16 Reserved_20; + UINT16 Reserved_21; + UINT16 Reserved_22; + UINT8 Firmware_Revision_23[8]; + UINT8 Model_Number_27[40]; + UINT16 Maximum_Sector_Multiple_Command_47; + UINT16 Trusted_Computing_Support; + UINT16 Capabilities_49; + UINT16 Capabilities_50; + UINT16 PIO_Mode_51; + UINT16 Reserved_52; + UINT16 Valid_Bits_53; + UINT16 Reserved_54_58[5]; + UINT16 Valid_Bits_59; + UINT32 Addressable_Sector_60; + UINT16 SingleWord_DMA_62; + UINT16 MultiWord_DMA_63; + UINT16 PIO_Mode_64; + UINT16 Min_Multiword_DMA_timing_65; + UINT16 Manuf_Multiword_DMA_timing_66; + UINT16 Min_PIO_Mode_timing_67; + UINT16 Min_PIO_Mode_timing_68; + UINT16 Reserved_69_74[6]; + UINT16 Queue_Depth_75; + UINT16 Reserved_76_79[4]; + UINT16 Major_Revision_80; + UINT16 Minor_Revision_81; + UINT16 Command_Set_Supported_82; + UINT16 Command_Set_Supported_83; + UINT16 Command_Set_Supported_84; + UINT16 Command_Set_Enabled_85; + UINT16 Command_Set_Enabled_86; + UINT16 Command_Set_Enabled_87; + UINT16 UDMA_Mode_88; + UINT16 Time_security_Earse_89; + UINT16 Time_Esecurity_Earse_90; + UINT16 Current_Power_Level_91; + UINT16 Master_Password_Rev_92; + UINT16 Hard_Reset_Value_93; + UINT16 Acoustic_Level_94; + UINT16 Reserved_95_99[5]; + UINT64 LBA_48; + UINT16 Reserved_104_126[23]; + UINT16 Status_Notification_127; + UINT16 Security_Status_128; + UINT16 Reserved_129_159[31]; + UINT16 CFA_Power_Mode_160; + UINT16 Reserved_161_175[15]; + UINT16 Media_Serial_Number_176_205[30]; + UINT16 Reserved_206_254[49]; + UINT16 Checksum_255; +} IDENTIFY_DATA; + +typedef struct { + UINT16 BMCommandRegister; + UINT16 Reserved; + UINT16 BMStatusRegister; + UINT16 BMDescriptorTablePointerReg; +} BUS_MASTER_IO; + + +typedef struct { + UINT32 BaseAddress; + UINT16 ByteCount; + UINT16 Flag; +} BUS_MASTER_DESCRIPTOR_TABLE; + + +typedef struct { + UINT16 DataReg; + UINT16 FeatureReg; + UINT16 ErrorReg; + UINT16 SectorCountReg; + UINT16 LBALowReg; + UINT16 LBAMidReg; + UINT16 LBAHighReg; + UINT16 DeviceReg; + UINT16 CommandReg; + UINT16 StatusReg; +} COMMAND_BLOCK; + +typedef struct{ + UINT16 DeviceControlReg; + UINT16 AlternateStatusReg; +} CONTROL_BLOCK; + + +typedef struct { + UINT8 IdeBusInitData[2][2]; + IDE_BUS_PROTOCOL *pIdeBusProtocol[2][2]; + EFI_IDE_CONTROLLER_INIT_PROTOCOL *EfiIdeControllerInterface; + IDE_CONTROLLER_PROTOCOL *IdeControllerInterface; + UINT8 BusMasterSelection; + UINT8 HPMask; + EFI_EVENT HPEvent; + UINT8 Flags; + UINT8 Acoustic_Management_Level; + UINT8 DiPM; + UINT16 PrevPortNum; + UINT16 PrevPortMultiplierPortNum; +} IDE_BUS_INIT_PROTOCOL; + +typedef struct { + COMMAND_BLOCK CommandBlock; + CONTROL_BLOCK ControlBlock; + BUS_MASTER_IO BusMasterBlock; +} IO_REGS; + + +typedef enum { + Obsolete, + Removabledisk, + CDROM, + CDR, + CDRW, + DVDROM, + DVDRSequentialrecording, + DVDRAM, + DVDRWRestrictedOverwrite, + DVDRWSequentialrecording, + DVDRDualLayerSequential, + DVDRDualLayerJumprecording, + DVDRWDualLayer, + DVDDownloaddiscrecording, + DVDRW, + DVDR, + BDROM, + BDRSequentialRecording, + BDRRandomRecordingMode, + BDRE, + HDDVDROM, + HDDVDR, + HDDVDRAM, + HDDVDRW, + HDDVDRDualLayer, + HDDVDRWDualLayer, + UnknownType +} ODD_TYPE; + +typedef enum { + CaddySlotType, + TrayType, + PopupType, + ReservedType, + EmbeddedChangerWithIndividuallyChangeablediscs, + EmbeddedChangerUsingCartridgeMmechanism, + ReservedLoadingType +} ODD_LOADING_TYPE; + +typedef struct { + UINT8 *PacketBuffer; + UINT8 DeviceType; + UINT8 Lun; + UINT8 PacketSize; + UINT16 BlockSize; + BOOLEAN ReadOnly; + UINT8 Atapi_Status; + UINT8 *InquiryData; + UINT32 InquiryDataSize; + ODD_TYPE OddType; + ODD_LOADING_TYPE OddLoadingType; +} ATAPI_DEVICE; + +typedef struct _IDE_DEVICE_INTERFACE { + IDENTIFY_DATA IdentifyData; + UINT8 Channel; + UINT8 Device; + DEVICE_TYPE DeviceType; + UINT8 PIOMode; + UINT8 SWDma; + UINT8 MWDma; + UINT8 UDma; + UINT8 IORdy; + UINT8 ReadCommand; + UINT8 WriteCommand; + IO_REGS Regs; + EFI_PCI_IO_PROTOCOL *PciIO; + EFI_UNICODE_STRING_TABLE *UDeviceName; + ATAPI_DEVICE *AtapiDevice; +} IDE_DEVICE_INTERFACE; + + +typedef struct { + UINT32 Signature; + UINT8 UserPassword[32]; + UINT8 MasterPassword[32]; + UINT16 BaseAddress; + UINT16 DeviceControlReg; + UINT8 Device; // Master/Slave + UINT16 Control; + UINT16 RevisionCode; + UINT8 PortNumber; + UINT8 PMPortNumber; + UINT8 BusNo; + UINT8 DeviceNo; + UINT8 FunctionNo; + BOOLEAN ModeFlag; + DLINK LinkList; +} HDD_PASSWORD; + +typedef struct _IDE_SMART_INTERFACE{ + UINT8 Revision; + UINT32 Signature; + IDE_SMARTSELFTEST SMARTSelfTest; + IDE_SMARTSELFTESTSTATUS SMARTSelfTestStatus; + IDE_SMARTRETURNSTATUS SMARTReturnStatus; + IDE_SENDSMARTCOMMAND SendSmartCommand; + IDE_SMARTREADDATA SmartReadData; + IDE_SMARTWRITEDATA SmartWriteData; + IDE_SMARTABORTSELFTEST SMARTAbortSelfTest; + IDE_SMARTGETSMARTDATA SMARTGetSmartData; +}IDE_SMART_INTERFACE; + + +typedef struct _SMART_INTERFACE{ + + UINT8 Revision; + UINT32 Signature; + IDE_SMARTSELFTEST SMARTSelfTest; + IDE_SMARTSELFTESTSTATUS SMARTSelfTestStatus; + IDE_SMARTRETURNSTATUS SMARTReturnStatus; + IDE_SENDSMARTCOMMAND SendSmartCommand; + IDE_SMARTREADDATA SmartReadData; + IDE_SMARTWRITEDATA SmartWriteData; + IDE_SMARTABORTSELFTEST SMARTAbortSelfTest; + IDE_SMARTGETSMARTDATA SMARTGetSmartData; + VOID *BusInterface; + UINT8 ShortPollingTime; + UINT16 ExtPollingTime; + BOOLEAN ModeFlag; +}SMART_INTERFACE; + +typedef struct _IDE_SECURITY_PROTOCOL{ + + EFI_IDE_RETURN_SECURITY_STATUS ReturnSecurityStatus; + EFI_IDE_SECURITY_SET_PASSWORD SecuritySetPassword; + EFI_IDE_SECURITY_UNLOCK_PASSWORD SecurityUnlockPassword; + EFI_IDE_SECURITY_DISABLE_PASSWORD SecurityDisablePassword; + EFI_IDE_SECURITY_FREEZE_LOCK SecurityFreezeLock; + EFI_IDE_SECURITY_ERASE_UNIT SecurityEraseUnit; + EFI_IDE_RETURN_PASSWORD_FLAGS ReturnIdePasswordFlags; + +}IDE_SECURITY_PROTOCOL; + +typedef struct _SECURITY_PROTOCOL{ + + EFI_IDE_RETURN_SECURITY_STATUS ReturnSecurityStatus; + EFI_IDE_SECURITY_SET_PASSWORD SecuritySetPassword; + EFI_IDE_SECURITY_UNLOCK_PASSWORD SecurityUnlockPassword; + EFI_IDE_SECURITY_DISABLE_PASSWORD SecurityDisablePassword; + EFI_IDE_SECURITY_FREEZE_LOCK SecurityFreezeLock; + EFI_IDE_SECURITY_ERASE_UNIT SecurityEraseUnit; + EFI_IDE_RETURN_PASSWORD_FLAGS ReturnIdePasswordFlags; + HDD_PASSWORD *pHDDPasswordBuffer; + VOID *BusInterface; + BOOLEAN ModeFlag; + +}SECURITY_PROTOCOL; + +typedef struct _IDE_POWER_MGMT_INTERFACE { + + EFI_IDE_CHECK_POWER_MODE CheckPowerMode; + EFI_IDE_IDLE_MODE IdleMode; + EFI_IDE_STANDBY_MODE StandbyMode; + EFI_IDE_ADVANCE_POWER_MGMT_MODE AdvancePowerMgmtMode; + +}IDE_POWER_MGMT_INTERFACE; + +typedef struct _POWER_MGMT_INTERFACE { + + EFI_IDE_CHECK_POWER_MODE CheckPowerMode; + EFI_IDE_IDLE_MODE IdleMode; + EFI_IDE_STANDBY_MODE StandbyMode; + EFI_IDE_ADVANCE_POWER_MGMT_MODE AdvancePowerMgmtMode; + IDE_BUS_PROTOCOL *IdeBusInterface; + +}POWER_MGMT_INTERFACE; + +typedef struct _IDE_HPA_INTERFACE { + + EFI_IDE_GET_NATIVE_MAX_ADDRESS GetNativeMaxAddress; + EFI_IDE_SET_MAX_ADDRESS SetMaxAddress; + EFI_IDE_HPA_DISABLED_LAST_LBA HPADisabledLastLBA; + EFI_IDE_SET_MAX_PASSWORD SetMaxPassword; + EFI_IDE_SET_MAX_LOCK SetMaxLock; + EFI_IDE_SET_MAX_UNLOCK SetMaxUnLock; + EFI_IDE_SET_MAX_FREEZE_LOCK SetMaxFreezeLock; + +}IDE_HPA_INTERFACE; + +typedef struct _HPA_INTERFACE { + + EFI_IDE_GET_NATIVE_MAX_ADDRESS GetNativeMaxAddress; + EFI_IDE_SET_MAX_ADDRESS SetMaxAddress; + EFI_IDE_HPA_DISABLED_LAST_LBA HPADisabledLastLBA; + EFI_IDE_SET_MAX_PASSWORD SetMaxPassword; + EFI_IDE_SET_MAX_LOCK SetMaxLock; + EFI_IDE_SET_MAX_UNLOCK SetMaxUnLock; + EFI_IDE_SET_MAX_FREEZE_LOCK SetMaxFreezeLock; + IDE_BUS_PROTOCOL *IdeBusInterface; + +}HPA_INTERFACE; + +typedef struct _PORT_DRIVE_DATA { + UINT8 DriveNumber; + UINT8 PortNumber; +} PORT_DRIVE_DATA; + +typedef struct _HDD_SECURITY_INIT_PROTOCOL { + HDD_SECURITY_INSTALL InstallSecurityInterface; + HDD_SECURITY_UNINSTALL StopSecurityModeSupport; +} HDD_SECURITY_INIT_PROTOCOL; + +typedef struct _HDD_SMART_INIT_PROTOCOL { + HDD_SMART_INSTALL InstallSMARTInterface; + HDD_SMART_UNINSTALL UnInstallSMARTInterface; + HDD_SMART_INIT InitSMARTSupport; + BOOLEAN SmartDiagonasticFlag; +} HDD_SMART_INIT_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *OPAL_SECURITY_INSTALL) ( + IN VOID *BusInterface, + IN BOOLEAN ModeFlag +); + +typedef EFI_STATUS (EFIAPI *OPAL_SECURITY_UNINSTALL) ( + IN VOID *BusInterface, + IN BOOLEAN ModeFlag +); + +typedef struct _OPAL_SECURITY_INIT_PROTOCOL { + OPAL_SECURITY_INSTALL InstallOpalSecurityInterface; + OPAL_SECURITY_UNINSTALL UnInstallOpalSecurityInterface; +} OPAL_SECURITY_INIT_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *ATA_PASS_THRU_INSTALL) ( + IN VOID *Controller, + IN BOOLEAN ModeFlag +); + +typedef EFI_STATUS (EFIAPI *ATA_PASS_THRU_UNINSTALL) ( + IN VOID *Controller, + IN BOOLEAN ModeFlag +); + +typedef struct _ATA_PASS_THRU_INIT_PROTOCOL { + ATA_PASS_THRU_INSTALL InstallAtaPassThru; + ATA_PASS_THRU_UNINSTALL StopAtaPassThruSupport; +} ATA_PASS_THRU_INIT_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *GENERAL_ATAPI_COMMAND_DATA)( + IN IDE_BUS_PROTOCOL *IdeBusInterface, + UINT8 *PacketBuffer, + UINT8 *Buffer, + IN OUT UINT16 *ByteCount ); + +typedef EFI_STATUS (EFIAPI *SCSI_PASS_THRU_INSTALL) ( + IN VOID *Controller, + IN BOOLEAN ModeFlag +); + +typedef EFI_STATUS (EFIAPI *SCSI_PASS_THRU_UNINSTALL) ( + IN VOID *Controller, + IN BOOLEAN ModeFlag +); + +typedef struct _SCSI_PASS_THRU_ATAPI_INIT_PROTOCOL { + SCSI_PASS_THRU_INSTALL InstallScsiPassThruAtapi; + SCSI_PASS_THRU_UNINSTALL StopScsiPassThruAtapiSupport; +} SCSI_PASS_THRU_ATAPI_INIT_PROTOCOL; + + +typedef struct _IDE_BUS_PROTOCOL{ + IDE_BLOCK_IO *IdeBlkIo; + IDE_DISK_INFO *IdeDiskInfo; + EFI_DEVICE_PATH_PROTOCOL *DevicePathProtocol; + EFI_IDE_CONTROLLER_INIT_PROTOCOL *EfiIdeControllerInterface; + EFI_HANDLE IdeControllerInterfaceHandle; + IDE_CONTROLLER_PROTOCOL *IdeControllerInterface; + SECURITY_PROTOCOL *IdeSecurityInterface; + SMART_INTERFACE *SMARTInterface; + POWER_MGMT_INTERFACE *PowerMgmtInterface; + HPA_INTERFACE *HPAInterface; + IDE_BUS_INIT_PROTOCOL *IdeBusInitInterface; + EFI_PCI_IO_PROTOCOL *PciIO; + EFI_HANDLE IdeDeviceHandle; + IDE_DEVICE_INTERFACE IdeDevice; + EFI_UNICODE_STRING_TABLE *ControllerNameTable; + UINT8 AtapiSenseData[256]; + UINT8 AtapiSenseDataLength; + EFI_IDE_ATA_RAED_WRITE_PIO AtaReadWritePio; + EFI_IDE_ATA_PIO_DATA_IN AtaPioDataIn; + EFI_IDE_ATA_PIO_DATA_OUT AtaPioDataOut; + EFI_IDE_NON_DATA_CMD IdeNonDataCommand; + EFI_WAIT_FOR_CMD_COMPLETE WaitForCmdCompletion; + GENERAL_ATAPI_COMMAND_DATA GeneralAtapiCommandAndData; +} IDE_BUS_PROTOCOL; + +typedef struct _IDE_BLK_IO_DEV { + UINT32 Signature; + EFI_HANDLE Handle; + EFI_BLOCK_IO_PROTOCOL BlkIo; // should be the first Entry + IDE_BUS_PROTOCOL *IdeBusInterface; + IDE_DISK_INFO *IdeDiskInfo; + EFI_DEVICE_PATH_PROTOCOL *DevicePathProtocol; + EFI_IDE_CONTROLLER_INIT_PROTOCOL *EfiIdeControllerInterface; + EFI_HANDLE IdeControllerInterfaceHandle; + IDE_CONTROLLER_PROTOCOL *IdeControllerInterface; + SECURITY_PROTOCOL *IdeSecurityInterface; + SMART_INTERFACE *SMARTInterface; + POWER_MGMT_INTERFACE *PowerMgmtInterface; + HPA_INTERFACE *HPAInterface; + IDE_BUS_INIT_PROTOCOL *IdeBusInitInterface; + EFI_PCI_IO_PROTOCOL *PciIO; + EFI_HANDLE IdeDeviceHandle; + IDE_DEVICE_INTERFACE IdeDevice; + EFI_UNICODE_STRING_TABLE *ControllerNameTable; + UINT8 AtapiSenseData[256]; +} IDE_BLK_IO_DEV; + +#define _CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field))) +#ifndef CR +#define CR(record, TYPE, field, signature) _CR(record, TYPE, field) +#endif + +#define EFI_SIGNATURE_16(A, B) ((A) | (B << 8)) +#define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16)) + +#define IDE_BLK_IO_DEV_SIGNATURE EFI_SIGNATURE_32 ('i', 'b', 'i', 'd') +#define IDE_BLOCK_IO_DEV_FROM_THIS(a) CR (a, IDE_BLK_IO_DEV, BlkIo, IDE_BLK_IO_DEV_SIGNATURE) + + + +#pragma pack() + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/PIDEController.h b/Include/Protocol/PIDEController.h new file mode 100644 index 0000000..196d342 --- /dev/null +++ b/Include/Protocol/PIDEController.h @@ -0,0 +1,151 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/PIDEController.h 1 2/08/12 8:26a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/08/12 8:26a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/PIDEController.h $ +// +// 1 2/08/12 8:26a Yurenlai +// Intel Lynx Point/SB eChipset initially releases. +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: PIDEController.h +// +// Description: The header file for the south bridge ATA controller(s). +// +//<AMI_FHDR_END> +//************************************************************************* + +#ifndef _PIDEController_ +#define _PIDEController_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define IDE_CONTROLLER_PROTOCOL_GUID \ + {0x20E28787, 0xDF32, 0x4BDA, 0xB7, 0xE7, 0xCB, 0xBD, 0xA3, 0x37, 0x1E, 0xF8} + +#define SATA_CONTROLLER_PROTOCOL_GUID \ + {0x2acb6627, 0xdf02, 0x4e23, 0xb4, 0xf9, 0x6a, 0x93, 0xfa, 0x6e, 0x9d, 0xa6} + +// Forward reference for pure ANSI compatability +typedef struct _IDE_CONTROLLER_PROTOCOL IDE_CONTROLLER_PROTOCOL; +typedef struct _IDENTIFY_DATA IDENTIFY_DATA; +typedef struct _IDE_DEVICE_INTERFACE IDE_DEVICE_INTERFACE; +typedef struct _IDE_BUS_PROTOCOL IDE_BUS_PROTOCOL; + +#pragma pack(1) + +typedef struct { + UINT8 Register; + UINT8 And_Mask; + UINT8 Or_Mask; +} IDE_CONTROLLER_INIT_DATA; + + +// Equates used for Flag +#define Acoustic_Support_Enable 0x01 +#define S3_RESUME_UNLOCK_HDD_PASSWORD 0x02 // Set bit 1 in Flags only + // if HDD loses power in S3 + // state. + +typedef struct { + UINT8 PrimaryChannel; + UINT8 PrimaryMasterDevice; + UINT8 PrimarySlaveDevice; + UINT8 SecondaryChannel; + UINT8 SecondaryMasterDevice; + UINT8 SecondarySlaveDevice; + UINT8 BusMasterEnable; + UINT8 HPMask; + UINT8 Flags; + UINT8 Acoustic_Management_Level; +} CONTROLLER_INFO; + +typedef EFI_STATUS (*EFI_IDE_CONTROLLER_SET_PIO_TIMING) ( + IDE_DEVICE_INTERFACE *IdeDevice +); + +typedef EFI_STATUS (*EFI_IDE_CONTROLLER_SET_DMA_TIMING) ( + IDE_DEVICE_INTERFACE *IdeDevice +); + +typedef EFI_STATUS (*EFI_IDE_CONTROLLER_GET_MODE) ( + IDE_DEVICE_INTERFACE *IdeDevice +); + +typedef EFI_STATUS (*EFI_IDE_CONTROLLER_GET_CONTROLLER_INFO) ( + IN EFI_HANDLE Controller, + IN OUT CONTROLLER_INFO *ControllerInfo +); + +typedef EFI_STATUS (*EFI_IDE_HP_DEVICE_CHANGE) ( + EFI_PCI_IO_PROTOCOL *PciIO, + UINT8 HPMask, + UINT8 *CurrentStatus +); + + +typedef EFI_STATUS (*EFI_IDE_DISABLE_ENABLE_CHANNEL) ( + EFI_PCI_IO_PROTOCOL *PciIO, + UINT8 Channel, + UINT8 Device, + BOOLEAN DisableEnable +); + +typedef struct _IDE_CONTROLLER_PROTOCOL { + UINT8 Max_Channel; + EFI_PCI_IO_PROTOCOL *PciIO; + EFI_HANDLE ControllerHandle; + EFI_IDE_CONTROLLER_GET_CONTROLLER_INFO IdeGetControllerInfo; + EFI_IDE_CONTROLLER_SET_PIO_TIMING IdeSetPioMode; + EFI_IDE_CONTROLLER_SET_DMA_TIMING IdeSetDmaMode; + EFI_IDE_CONTROLLER_GET_MODE GetbestPioDmaMode; + EFI_IDE_HP_DEVICE_CHANGE HPCheckForDeviceChange; + EFI_IDE_DISABLE_ENABLE_CHANNEL HPDisableEnableChannel; + CHAR16 * Controllername; +}IDE_CONTROLLER_PROTOCOL; + +#pragma pack() + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/PciHostBridgeResourceAllocation.h b/Include/Protocol/PciHostBridgeResourceAllocation.h new file mode 100644 index 0000000..0577328 --- /dev/null +++ b/Include/Protocol/PciHostBridgeResourceAllocation.h @@ -0,0 +1,363 @@ +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2004, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/PciHostBridgeResourceAllocation.h 2 3/13/06 1:40a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/PciHostBridgeResourceAllocation.h $ +// +// 2 3/13/06 1:40a Felixp +// +// 1 11/04/05 6:36p Yakovlevs +// +// 1 4/18/05 5:42p Yakovlevs +// Host Brg Resource Allocation Protocol +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: PciHostBridgeResourceAllocation.h +// +// Description: This file is an include file used to define the Protocol and +// definitions for the Pci Host Bridge Resource Allocation. +// +//<AMI_FHDR_END> +//***************************************************************************** +#ifndef __PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_H__ +#define __PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GUID \ + { 0xCF8034BE,0x6768,0x4d8b,0xB7,0x39,0x7C,0xCE,0x68,0x3A,0x9F,0xBE } + +GUID_VARIABLE_DECLARATION(gEfiPciHostBridgeResourceAllocationProtocolGuid,EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <Protocol/PciRootBridgeIo.h> + +typedef struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL; + + +//---------------------------------------------------------------------------- +// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ATTRIBUTES +//---------------------------------------------------------------------------- +// If this bit is set, then the PCI Root Bridge does not +// support separate windows for Non-prefetchable and Prefetchable +// memory. A PCI bus driver needs to include requests for Prefetchable +// memory in the Non-prefetchable memory pool. +#define EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM 1 + +//---------------------------------------------------------------------------- +// If this bit is set, then the PCI Root Bridge supports +// 64 bit memory windows. If this bit is not set, +// the PCI bus driver needs to include requests for 64 bit +// memory address in the corresponding 32 bit memory pool. +#define EFI_PCI_HOST_BRIDGE_MEM64_DECODE 2 + + +//---------------------------------------------------------------------------- +// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE +//---------------------------------------------------------------------------- +typedef enum { + EfiPciHostBridgeBeginEnumeration, + EfiPciHostBridgeBeginBusAllocation, + EfiPciHostBridgeEndBusAllocation, + EfiPciHostBridgeBeginResourceAllocation, + EfiPciHostBridgeAllocateResources, + EfiPciHostBridgeSetResources, + EfiPciHostBridgeFreeResources, + EfiPciHostBridgeEndResourceAllocation +} EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE; + +//---------------------------------------------------------------------------- +// EfiPciHostBridgeBeginEnumeration +// Reset the host bridge PCI apertures and internal data structures. +// PCI enumerator should issue this notification before starting fresh +// enumeration process. Enumeration cannot be restarted after sending +// any other notification such as EfiPciHostBridgeBeginBusAllocation. +// +// EfiPciHostBridgeBeginBusAllocation +// The bus allocation phase is about to begin. No specific action +// is required here. This notification can be used to perform any +// chipset specific programming. +// +// EfiPciHostBridgeEndBusAllocation +// The bus allocation and bus programming phase is complete. No specific +// action is required here. This notification can be used to perform any +// chipset specific programming. +// +// EfiPciHostBridgeBeginResourceAllocation +// The resource allocation phase is about to begin.No specific action is +// required here. This notification can be used to perform any chipset specific programming. +// +// EfiPciHostBridgeAllocateResources +// Allocate resources per previously submitted requests for all the PCI Root +// Bridges. These resource settings are returned on the next call to +// GetProposedResources(). +// +// EfiPciHostBridgeSetResources +// Program the Host Bridge hardware to decode previously allocated resources +// (proposed resources) for all the PCI Root Bridges. +// +// EfiPciHostBridgeFreeResources +// De-allocate previously allocated resources previously for all the PCI +// Root Bridges and reset the I/O and memory apertures to initial state. +// +// EfiPciHostBridgeEndResourceAllocation +// The resource allocation phase is completed. No specific action is required +// here. This notification can be used to perform any chipset specific programming. + +//---------------------------------------------------------------------------- +// EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE +//---------------------------------------------------------------------------- +typedef enum { + EfiPciBeforeChildBusEnumeration, + EfiPciBeforeResourceCollection +} EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE; + +//---------------------------------------------------------------------------- +// EfiPciBeforeChildBusEnumeration +// This notification is only applicable to PCI-PCI bridges and +// indicates that the PCI enumerator is about to begin enumerating +// the bus behind the PCI-PCI Bridge. This notification is sent after +// the primary bus number, the secondary bus number and the subordinate +// bus number registers in the PCI-PCI Bridge are programmed to valid +// (not necessary final) values +// +// EfiPciBeforeResourceCollection +// This notification is sent before the PCI enumerator probes BAR registers +// for every valid PCI function. +// + +//---------------------------------------------------------------------------- +//Description: +// Enter a certain phase of the PCI enumeration process +// +//Input: +// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance +// Phase -- The phase during enumeration +// +//Output: +// EFI_SUCCESS - Success +// EFI_OUT_OF_RESOURCES - If SubmitResources ( ) could not allocate resources +// EFI_NOT_READY - This phase cannot be entered at this time +// EFI_DEVICE_ERROR - SetResources failed due to HW error. +//---------------------------------------------------------------------------- +typedef EFI_STATUS (EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE)( + IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This, + IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase ); + +//---------------------------------------------------------------------------- +//Description: +// Return the device handle of the next PCI root bridge that is associated with +// this Host Bridge +// +//Input: +// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance +// RootBridgeHandle -- Returns the device handle of the next PCI Root Bridge. +// On input, it holds the RootBridgeHandle returned by the most +// recent call to GetNextRootBridge().The handle for the first +// PCI Root Bridge is returned if RootBridgeHandle is NULL on input +// +//Output: +// EFI_SUCCESS - Success +// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid +//---------------------------------------------------------------------------- +typedef EFI_STATUS (EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE)( + IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This, + IN OUT EFI_HANDLE *RootBridgeHandle); + + +//---------------------------------------------------------------------------- +//Routine Description: +// Returns the attributes of a PCI Root Bridge. +// +//Input: +// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance +// RootBridgeHandle -- The device handle of the PCI Root Bridge +// that the caller is interested in +// Attribute -- The pointer to attributes of the PCI Root Bridge +// +//Output: +// EFI_SUCCESS - Success +// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid +// EFI_INVALID_PARAMETER - Attributes is NULL +//---------------------------------------------------------------------------- +typedef EFI_STATUS (EFIAPI * EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES)( + IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This, + IN EFI_HANDLE RootBridgeHandle, + OUT UINT64 *Attributes); + + +//---------------------------------------------------------------------------- +//Routine Description: +// This is the request from the PCI enumerator to set up +// the specified PCI Root Bridge for bus enumeration process. +// +//Arguments: +// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance +// RootBridgeHandle -- The PCI Root Bridge to be set up +// Configuration -- Pointer to the pointer to the PCI bus resource descriptor +// +//Returns: +// EFI_SUCCESS - Success +// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid +// EFI_DEVICE_ERROR - Request failed due to hardware error +// EFI_OUT_OF_RESOURCES - Request failed due to lack of resources +//---------------------------------------------------------------------------- +typedef EFI_STATUS(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION)( + IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This, + IN EFI_HANDLE RootBridgeHandle, + OUT VOID **Configuration); + + +//---------------------------------------------------------------------------- +//Routine Description: +// This function programs the PCI Root Bridge hardware so that +// it decodes the specified PCI bus range +// +//Arguments: +// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance +// RootBridgeHandle -- The PCI Root Bridge whose bus range is to be programmed +// Configuration -- The pointer to the PCI bus resource descriptor +// +//Returns: +// EFI_SUCCESS - Success +// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid +// EFI_INVALID_PARAMETER - Configuration is NULL +// EFI_INVALID_PARAMETER - Configuration does not point to a valid ACPI resource descriptor +// EFI_INVALID_PARAMETER - Configuration contains one or more memory or IO ACPI resource descriptor +// EFI_INVALID_PARAMETER - Address Range Minimum or Address Range Length fields in Configuration +// are invalid for this Root Bridge. +// EFI_INVALID_PARAMETER - Configuration contains one or more invalid ACPI resource descriptor +// EFI_DEVICE_ERROR - Request failed due to hardware error +// EFI_OUT_OF_RESOURCES - Request failed due to lack of resources +//---------------------------------------------------------------------------- +typedef EFI_STATUS(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS)( + IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This, + IN EFI_HANDLE RootBridgeHandle, + IN VOID *Configuration); + + +//---------------------------------------------------------------------------- +//Routine Description: +// Submits the I/O and memory resource requirements for the specified PCI Root Bridge +// +//Arguments: +// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance +// RootBridgeHandle -- The PCI Root Bridge whose I/O and memory resource requirements +// are being submitted +// Configuration -- The pointer to the PCI I/O and PCI memory resource descriptor +//Returns: +// EFI_SUCCESS - Success +// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid +// EFI_INVALID_PARAMETER - Configuration is NULL +// EFI_INVALID_PARAMETER - Configuration does not point to a valid ACPI resource descriptor +// EFI_INVALID_PARAMETER - Configuration includes a resource descriptor of unsupported type +//---------------------------------------------------------------------------- +typedef EFI_STATUS(EFIAPI * EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES)( + IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This, + IN EFI_HANDLE RootBridgeHandle, + IN VOID *Configuration); + + +//---------------------------------------------------------------------------- +//Routine Description: +// This function returns the proposed resource settings for the specified +// PCI Root Bridge +// +//Arguments: +// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance +// RootBridgeHandle -- The PCI Root Bridge handle +// Configuration -- The pointer to the pointer to the PCI I/O +// and memory resource descriptor +//Returns: +// EFI_SUCCESS - Success +// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid +// EFI_DEVICE_ERROR - Request failed due to hardware error +// EFI_OUT_OF_RESOURCES - Request failed due to lack of resources +//---------------------------------------------------------------------------- +typedef EFI_STATUS(EFIAPI * EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES)( + IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This, + IN EFI_HANDLE RootBridgeHandle, + OUT VOID **Configuration); + + +//---------------------------------------------------------------------------- +//Routine Description: +// This function is called for all the PCI controllers that the PCI +// bus driver finds. Can be used to Preprogram the controller. +// +//Arguments: +// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance +// RootBridgeHandle -- The PCI Root Bridge handle +// PciBusAddress -- Address of the controller on the PCI bus +// Phase -- The Phase during resource allocation +// +//Returns: +// EFI_SUCCESS - Success +// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid +// EFI_DEVICE_ERROR - Device pre-initialization failed due to hardware error. +//---------------------------------------------------------------------------- +typedef EFI_STATUS(EFIAPI * EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER)( + IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This, + IN EFI_HANDLE RootBridgeHandle, + IN EFI_PCI_CONFIGURATION_ADDRESS PciAddress, + IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase); + + +//---------------------------------------------------------------------------- +// The Protocol itself +//---------------------------------------------------------------------------- +typedef struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL { + EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE NotifyPhase; + EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE GetNextRootBridge; + EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES GetAllocAttributes; + EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION StartBusEnumeration; + EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS SetBusNumbers; + EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES SubmitResources; + EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES GetProposedResources; + EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER PreprocessController; +} EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif //_PCI_HB_RES_ALLOC_ + +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2004, 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/Include/Protocol/PciHotPlugInit.h b/Include/Protocol/PciHotPlugInit.h new file mode 100644 index 0000000..38a5d7b --- /dev/null +++ b/Include/Protocol/PciHotPlugInit.h @@ -0,0 +1,119 @@ +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2005, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/PciHotPlugInit.h 2 3/13/06 1:40a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/PciHotPlugInit.h $ +// +// 2 3/13/06 1:40a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: <This File Name> +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __PCI_HOT_PLUG_INIT_PROTOCOL_H__ +#define __PCI_HOT_PLUG_INIT_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +/****** DO NOT WRITE ABOVE THIS LINE *******/ +#include <EFI.h> + +//********************************************************************** +#define EFI_PCI_HOT_PLUG_INIT_PROTOCOL_GUID \ + { 0xaa0e8bc1, 0xdabc, 0x46b0, 0xa8, 0x44, 0x37, 0xb8, 0x16, 0x9b, 0x2b, 0xea } + +GUID_VARIABLE_DECLARATION(gEfiPciHotPlugInitProtocolGuid,EFI_PCI_HOT_PLUG_INIT_PROTOCOL_GUID); + +typedef struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL EFI_PCI_HOT_PLUG_INIT_PROTOCOL; + +#define EFI_HPC_STATE_INITIALIZED 0x01 +#define EFI_HPC_STATE_ENABLED 0x02 + +typedef UINT16 EFI_HPC_STATE; + +typedef struct{ + EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath; + EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath; +} EFI_HPC_LOCATION; + + +typedef enum{ + EfiPaddingPciBus, + EfiPaddingPciRootBridge +}EFI_HPC_PADDING_ATTRIBUTES; + +typedef EFI_STATUS (EFIAPI *EFI_GET_ROOT_HPC_LIST)( + IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This, + OUT UINTN *HpcCount, + OUT EFI_HPC_LOCATION **HpcList +); + +typedef EFI_STATUS (EFIAPI *EFI_INITIALIZE_ROOT_HPC)( + IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This, + IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath, + IN UINT64 HpcPciAddress, + IN EFI_EVENT Event, OPTIONAL + OUT EFI_HPC_STATE *HpcState +); + +typedef EFI_STATUS (EFIAPI *EFI_GET_PCI_HOT_PLUG_PADDING)( + IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This, + IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath, + IN UINT64 HpcPciAddress, + OUT EFI_HPC_STATE *HpcState, + OUT VOID **Padding, + OUT EFI_HPC_PADDING_ATTRIBUTES *Attributes +); + + +// Prototypes for the PCI Hot Plug Init Protocol +typedef struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL { + EFI_GET_ROOT_HPC_LIST GetRootHpcList; + EFI_INITIALIZE_ROOT_HPC InitializeRootHpc; + EFI_GET_PCI_HOT_PLUG_PADDING GetResourcePadding; +} EFI_PCI_HOT_PLUG_INIT_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif + +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2005, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// diff --git a/Include/Protocol/PciIo.h b/Include/Protocol/PciIo.h new file mode 100644 index 0000000..58f2abf --- /dev/null +++ b/Include/Protocol/PciIo.h @@ -0,0 +1,306 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/PciIo.h 4 10/01/08 12:56p Yakovlevs $ +// +// $Revision: 4 $ +// +// $Date: 10/01/08 12:56p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/PciIo.h $ +// +// 4 10/01/08 12:56p Yakovlevs +// UEFI 2.1 PciIo Attributes definitions added. +// +// 3 3/13/06 1:40a Felixp +// +// 2 3/04/05 10:36a Mandal +// + +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: PciIo.h +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __PCI_IO_PROTOCOL_H__ +#define __PCI_IO_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// Global ID for the PCI I/O Protocol +#define EFI_PCI_IO_PROTOCOL_GUID \ + { 0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a } + +GUID_VARIABLE_DECLARATION(gEfiPciIoProtocolGuid,EFI_PCI_IO_PROTOCOL_GUID); + +// Prototypes for the PCI I/O Protocol +typedef enum { + EfiPciIoWidthUint8 = 0, + EfiPciIoWidthUint16, + EfiPciIoWidthUint32, + EfiPciIoWidthUint64, + EfiPciIoWidthFifoUint8, + EfiPciIoWidthFifoUint16, + EfiPciIoWidthFifoUint32, + EfiPciIoWidthFifoUint64, + EfiPciIoWidthFillUint8, + EfiPciIoWidthFillUint16, + EfiPciIoWidthFillUint32, + EfiPciIoWidthFillUint64, + EfiPciIoWidthMaximum +} EFI_PCI_IO_PROTOCOL_WIDTH; + +//Complete PCI address generater +#define EFI_PCI_IO_PASS_THROUGH_BAR 0xff // Special BAR that passes a memory or I/O cycle through unchanged + +#define EFI_PCI_IO_ATTRIBUTE_MASK 0x077f // All the following I/O and Memory cycles + +#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001 // I/O cycles 0x0000-0x00FF (10 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002 // I/O cycles 0x0100-0x03FF or greater (10 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004 // I/O cycles 0x3C6, 0x3C8, 0x3C9 (10 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008 // MEM cycles 0xA0000-0xBFFFF (24 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010 // I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (10 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 // I/O cycles 0x1F0-0x1F7, 0x3F6, 0x3F7 (10 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 // I/O cycles 0x170-0x177, 0x376, 0x377 (10 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 // Map a memory range so write are combined +#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100 // Enable the I/O decode bit in the PCI Config Header +#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200 // Enable the Memory decode bit in the PCI Config Header +#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400 // Enable the DMA bit in the PCI Config Header +#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800 // Map a memory range so all r/w accesses are cached +#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 // Disable a memory range +#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000 // Clear for an add-in PCI Device +#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000 // Clear for a physical PCI Option ROM accessed through ROM BAR +#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 // Clear for PCI controllers that can not genrate a DAC +//UEFI 2.1 Update +#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 // I/O cycles 0x0100-0x03FF or greater (16 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 // I/O cycles 0x3C6, 0x3C8, 0x3C9 (16 bit decode) +#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000 // I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (16 bit decode) + +#define EFI_PCI_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY | EFI_PCI_IO_ATTRIBUTE_BUS_MASTER) +#define EFI_VGA_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_IO) + +//******************************************************* +// EFI_PCI_IO_PROTOCOL_OPERATION +//******************************************************* +typedef enum { + EfiPciIoOperationBusMasterRead, + EfiPciIoOperationBusMasterWrite, + EfiPciIoOperationBusMasterCommonBuffer, + EfiPciIoOperationMaximum +} EFI_PCI_IO_PROTOCOL_OPERATION; + + +//******************************************************* +// EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION +//******************************************************* +typedef enum { + EfiPciIoAttributeOperationGet, + EfiPciIoAttributeOperationSet, + EfiPciIoAttributeOperationEnable, + EfiPciIoAttributeOperationDisable, + EfiPciIoAttributeOperationSupported, + EfiPciIoAttributeOperationMaximum +} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION; + + +typedef EFI_STATUS(*EFI_PCI_IO_PROTOCOL_POLL_IO_MEM) ( + IN struct _EFI_PCI_IO_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL_WIDTH Width, + IN UINT8 BarIndex, + IN UINT64 Offset, + IN UINT64 Mask, + IN UINT64 Value, + IN UINT64 Delay, + OUT UINT64 *Result + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_IO_MEM) ( + IN struct _EFI_PCI_IO_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL_WIDTH Width, + IN UINT8 BarIndex, + IN UINT64 Offset, + IN UINTN Count, + IN OUT VOID *Buffer + ); + +typedef struct { + EFI_PCI_IO_PROTOCOL_IO_MEM Read; + EFI_PCI_IO_PROTOCOL_IO_MEM Write; +} EFI_PCI_IO_PROTOCOL_ACCESS; + +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_CONFIG) ( + IN struct _EFI_PCI_IO_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL_WIDTH Width, + IN UINT32 Offset, + IN UINTN Count, + IN OUT VOID *Buffer + ); + +typedef struct { + EFI_PCI_IO_PROTOCOL_CONFIG Read; + EFI_PCI_IO_PROTOCOL_CONFIG Write; +} EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS; + +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_COPY_MEM) ( + IN struct _EFI_PCI_IO_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL_WIDTH Width, + IN UINT8 DestBarIndex, + IN UINT64 DestOffset, + IN UINT8 SrcBarIndex, + IN UINT64 SrcOffset, + IN UINTN Count + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_MAP) ( + IN struct _EFI_PCI_IO_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL_OPERATION Operation, + IN VOID *HostAddress, + IN OUT UINTN *NumberOfBytes, + OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, + OUT VOID **Mapping + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_UNMAP) ( + IN struct _EFI_PCI_IO_PROTOCOL *This, + IN VOID *Mapping + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER) ( + IN struct _EFI_PCI_IO_PROTOCOL *This, + IN EFI_ALLOCATE_TYPE Type, + IN EFI_MEMORY_TYPE MemoryType, + IN UINTN Pages, + OUT VOID **HostAddress, + IN UINT64 Attributes + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_FREE_BUFFER) ( + IN struct _EFI_PCI_IO_PROTOCOL *This, + IN UINTN Pages, + IN VOID *HostAddress + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_FLUSH) ( + IN struct _EFI_PCI_IO_PROTOCOL *This + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_LOCATION) ( + IN struct _EFI_PCI_IO_PROTOCOL *This, + OUT UINTN *SegmentNumber, + OUT UINTN *BusNumber, + OUT UINTN *DeviceNumber, + OUT UINTN *FunctionNumber + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_ATTRIBUTES) ( + IN struct _EFI_PCI_IO_PROTOCOL *This, + IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation, + IN UINT64 Attributes, + OUT UINT64 *Result OPTIONAL + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES) ( + IN struct _EFI_PCI_IO_PROTOCOL *This, + IN UINT8 BarIndex, + OUT UINT64 *Supports, OPTIONAL + OUT VOID **Resources OPTIONAL + ); + + +typedef +EFI_STATUS +(EFIAPI *EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES) ( + IN struct _EFI_PCI_IO_PROTOCOL *This, + IN UINT64 Attributes, + IN UINT8 BarIndex, + IN OUT UINT64 *Offset, + IN OUT UINT64 *Length + ); + +// +// Interface structure for the PCI I/O Protocol +// +typedef struct _EFI_PCI_IO_PROTOCOL { + EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollMem; + EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollIo; + EFI_PCI_IO_PROTOCOL_ACCESS Mem; + EFI_PCI_IO_PROTOCOL_ACCESS Io; + EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci; + EFI_PCI_IO_PROTOCOL_COPY_MEM CopyMem; + EFI_PCI_IO_PROTOCOL_MAP Map; + EFI_PCI_IO_PROTOCOL_UNMAP Unmap; + EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer; + EFI_PCI_IO_PROTOCOL_FREE_BUFFER FreeBuffer; + EFI_PCI_IO_PROTOCOL_FLUSH Flush; + EFI_PCI_IO_PROTOCOL_GET_LOCATION GetLocation; + EFI_PCI_IO_PROTOCOL_ATTRIBUTES Attributes; + EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes ; + EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES SetBarAttributes; + UINT64 RomSize; + VOID *RomImage; +} EFI_PCI_IO_PROTOCOL; + + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/PciPlatform.h b/Include/Protocol/PciPlatform.h new file mode 100644 index 0000000..c8d13e5 --- /dev/null +++ b/Include/Protocol/PciPlatform.h @@ -0,0 +1,137 @@ +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2005, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/PciPlatform.h 2 3/13/06 1:40a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/PciPlatform.h $ +// +// 2 3/13/06 1:40a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: <This File Name> +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __PCI_PLATFORM_PROTOCOL_H__ +#define __PCI_PLATFORM_PROTOCOL_H__ + +#ifdef __cplusplus +extern "C" { +#endif +/****** DO NOT WRITE ABOVE THIS LINE *******/ + +//********************************************************************** +#include <EFI.h> + +// Protocol for GUID. +#define EFI_PCI_PLATFORM_PROTOCOL_GUID \ +{ 0x7d75280, 0x27d4, 0x4d69, 0x90, 0xd0, 0x56, 0x43, 0xe2, 0x38, 0xb3, 0x41} + +GUID_VARIABLE_DECLARATION(gEfiPciPlatformProtocolGuid,EFI_PCI_PLATFORM_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <Protocol/PciHostBridgeResourceAllocation.h> + +typedef struct _EFI_PCI_PLATFORM_PROTOCOL EFI_PCI_PLATFORM_PROTOCOL; + +typedef UINT32 EFI_PCI_PLATFORM_POLICY; + +//------------------------------------------------- +#define EFI_RESERVE_NONE_IO_ALIAS 0x0000 +#define EFI_RESERVE_ISA_IO_ALIAS 0x0001 +#define EFI_RESERVE_ISA_IO_NO_ALIAS 0x0002 +#define EFI_RESERVE_VGA_IO_ALIAS 0x0004 +#define EFI_RESERVE_VGA_IO_NO_ALIAS 0x0008 + + +typedef enum { + ChipsetEntry, + ChipsetExit, + MaximumChipsetPhase +} EFI_PCI_CHIPSET_EXECUTION_PHASE; + +//------------------------------------------------- +// Protocol Function Definitions +//------------------------------------------------- +typedef EFI_STATUS (EFIAPI * EFI_PCI_PLATFORM_PHASE_NOTIFY)( + IN EFI_PCI_PLATFORM_PROTOCOL *This, + IN EFI_HANDLE HostBridge, + IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase, + IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase +); + +//------------------------------------------------- +typedef EFI_STATUS (EFIAPI * EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER)( + IN EFI_PCI_PLATFORM_PROTOCOL *This, + IN EFI_HANDLE HostBridge, + IN EFI_HANDLE RootBridge, + IN EFI_PCI_CONFIGURATION_ADDRESS PciAddress, + IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase, + IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase +); + +//------------------------------------------------- +typedef EFI_STATUS (EFIAPI * EFI_PCI_PLATFORM_GET_PLATFORM_POLICY)( + IN EFI_PCI_PLATFORM_PROTOCOL *This, + OUT EFI_PCI_PLATFORM_POLICY *PciPolicy +); + +//------------------------------------------------- +typedef EFI_STATUS (EFIAPI *EFI_PCI_PLATFORM_GET_PCI_ROM)( + IN EFI_PCI_PLATFORM_PROTOCOL *This, + IN EFI_HANDLE PciHandle, + OUT VOID **RomImage, + OUT UINTN *RomSize +); + +//------------------------------------------------- +typedef struct _EFI_PCI_PLATFORM_PROTOCOL { + EFI_PCI_PLATFORM_PHASE_NOTIFY PhaseNotify; + EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER PlatformPrepController; + EFI_PCI_PLATFORM_GET_PLATFORM_POLICY GetPlatformPolicy; + EFI_PCI_PLATFORM_GET_PCI_ROM GetPciRom; +} EFI_PCI_PLATFORM_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/PciRootBridgeIo.h b/Include/Protocol/PciRootBridgeIo.h new file mode 100644 index 0000000..bc173a0 --- /dev/null +++ b/Include/Protocol/PciRootBridgeIo.h @@ -0,0 +1,311 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/PciRootBridgeIo.h 4 2/05/11 2:33p Artems $ +// +// $Revision: 4 $ +// +// $Date: 2/05/11 2:33p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/PciRootBridgeIo.h $ +// +// 4 2/05/11 2:33p Artems +// Added EFI_PCI_CONFIGURATION_ADDRESS definition +// +// 3 10/06/08 3:32p Yakovlevs +// UEFI 2.1 Update +// +// 2 3/13/06 1:40a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 2 2/05/04 6:26p Markw +// Added EFI_PCI_CONFIGURATION_ADDRESS structure. +// +// 1 2/03/04 10:23a Markw +// +// 1 2/03/04 10:22a Markw +// +// 1 1/26/04 3:25p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: PciRootBridgeIo_h +// +// Description: Provides functions to access memory/io/pci behind a Pci bridge. +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef __PCI_ROOT_BRIDGE_IO_PROTOCOL_H__ +#define __PCI_ROOT_BRIDGE_IO_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \ + {0x2F707EBB,0x4A1A,0x11d4,0x9A,0x38,0x00,0x90,0x27,0x3F,0xC1,0x4D} + +GUID_VARIABLE_DECLARATION(gEfiPciRootBridgeIoProtocolGuid,EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID); + +//******************************************************* +// EFI PCI Root Bridge I/O Protocol Attribute bits +//******************************************************* +#define EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001 +#define EFI_PCI_ATTRIBUTE_ISA_IO 0x0002 +#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO 0x0004 +#define EFI_PCI_ATTRIBUTE_VGA_MEMORY 0x0008 +#define EFI_PCI_ATTRIBUTE_VGA_IO 0x0010 +#define EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 +#define EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 +#define EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 +#define EFI_PCI_ATTRIBUTE_MEMORY_CACHED 0x0800 +#define EFI_PCI_ATTRIBUTE_MEMORY_DISABLE 0x1000 +#define EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 +//UIEFI 2.1 update +#define EFI_PCI_ATTRIBUTE_ISA_IO_16 0x10000 +#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 +#define EFI_PCI_ATTRIBUTE_VGA_IO_16 0x40000 + +//******************************************************* +// EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH +//******************************************************* +typedef enum { + EfiPciWidthUint8, + EfiPciWidthUint16, + EfiPciWidthUint32, + EfiPciWidthUint64, + EfiPciWidthFifoUint8, + EfiPciWidthFifoUint16, + EfiPciWidthFifoUint32, + EfiPciWidthFifoUint64, + EfiPciWidthFillUint8, + EfiPciWidthFillUint16, + EfiPciWidthFillUint32, + EfiPciWidthFillUint64, + EfiPciWidthMaximum +} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH; + +//******************************************************* +// EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION +//******************************************************* +typedef enum { + EfiPciOperationBusMasterRead, + EfiPciOperationBusMasterWrite, + EfiPciOperationBusMasterCommonBuffer, + EfiPciOperationBusMasterRead64, + EfiPciOperationBusMasterWrite64, + EfiPciOperationBusMasterCommonBuffer64, + EfiPciOperationMaximum +} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION; + + +typedef struct { + UINT8 Register; + UINT8 Function; + UINT8 Device; + UINT8 Bus; + UINT32 ExtendedRegister; +} EFI_PCI_CONFIGURATION_ADDRESS; + +#define EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS EFI_PCI_CONFIGURATION_ADDRESS + +typedef struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL; + +//******************************************************* +// EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM +//******************************************************* +typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM) ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINT64 Mask, + IN UINT64 Value, + IN UINT64 Delay, + OUT UINT64 *Result +); + +typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM) ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINT64 Mask, + IN UINT64 Value, + IN UINT64 Delay, + OUT UINT64 *Result +); + +typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM) ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer +); + +typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM) ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, + IN UINT64 DestAddress, + IN UINT64 SrcAddress, + IN UINTN Count +); + +typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP) ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation, + IN VOID *HostAddress, + IN OUT UINTN *NumberOfBytes, + OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, + OUT VOID **Mapping +); + +typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP) ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, + IN VOID *Mapping +); + +typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER) ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, + IN EFI_ALLOCATE_TYPE Type, + IN EFI_MEMORY_TYPE MemoryType, + IN UINTN Pages, + OUT VOID **HostAddress, + IN UINT64 Attributes +); + +typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER) ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, + IN UINTN Pages, + IN VOID *HostAddress +); + +typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH) ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This +); + +typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES) ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, + OUT UINT64 *Supports OPTIONAL, + OUT UINT64 *Attributes OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES) ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, + IN UINT64 Attributes, + IN OUT UINT64 *ResourceBase OPTIONAL, + IN OUT UINT64 *ResourceLength OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION) ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, + OUT VOID **Resources +); + +//********************************************************************** +//<AMI_THDR_START> +// +// Name: EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS +// +// Description: This provides north bridge functions to open, close, lock, +// and describe SMM space. +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// Read EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM - definition to read Mem/Io/Pci. +// Write EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM - definition to read Mem/Io/Pci. +//<AMI_THDR_END> +//********************************************************************** +typedef struct { + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Read; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Write; +} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS; + +//********************************************************************** +//<AMI_THDR_START> +// +// Name: EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL +// +// Description: Functions to access Pci Root Bridge for reading/writting +// Memory/IO/config space. +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// ParentHandle EFI_HANDLE +// PollMem EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM +// PollIo EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM +// Mem EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS +// Io EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS +// Pci EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS +// CopyMem EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM +// Map EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP +// Unmap EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP +// AllocateBuffer EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER +// FreeBuffer EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER +// Flush EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH +// GetAttributes EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES +// SetAttributes EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES +// Configuration EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION +// SegmentNumber UINT32 +// +//<AMI_THDR_END> +//********************************************************************** +struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL { + EFI_HANDLE ParentHandle; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM PollMem; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM PollIo; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Mem; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Io; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Pci; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM CopyMem; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP Map; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP Unmap; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER FreeBuffer; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH Flush; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES GetAttributes; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES SetAttributes; + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION Configuration; + UINT32 SegmentNumber; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/Performance.h b/Include/Protocol/Performance.h new file mode 100644 index 0000000..7f8945e --- /dev/null +++ b/Include/Protocol/Performance.h @@ -0,0 +1,117 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2008, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/Performance.h 2 5/06/08 10:04a Felixp $Revision: +// +// $Date: 5/06/08 10:04a $Log: +// +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: Performance.h +// +// Description: Header file for DXE_PERFORMANCE protocol +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef _EFI_PERFORMANCE_H_ +#define _EFI_PERFORMANCE_H_ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + +#define EFI_PERFORMANCE_PROTOCOL_GUID \ + { 0xFFECFFFF, 0x923C, 0x14d2, 0x9E, 0x3F, 0x22, 0xA0, 0xC9, 0x69, 0x56, 0x3B } + +#define EFI_PERF_TOKEN_LENGTH 32 +#define EFI_PERF_HOST_LENGTH 32 +#define EFI_PERF_PDBFILENAME_LENGTH 40 + +typedef struct _EFI_PERFORMANCE_PROTOCOL EFI_PERFORMANCE_PROTOCOL; + +typedef struct { + EFI_HANDLE Handle; + UINT16 Token[EFI_PERF_TOKEN_LENGTH]; + UINT16 Host[EFI_PERF_HOST_LENGTH]; + UINT64 StartTick; + UINT64 EndTick; + EFI_GUID GuidName; + UINT8 PdbFileName[EFI_PERF_PDBFILENAME_LENGTH]; + UINT8 Phase; +} EFI_GAUGE_DATA ; + + +typedef +EFI_STATUS +(EFIAPI * EFI_PERF_START_GAUGE) ( + IN EFI_PERFORMANCE_PROTOCOL *This, + IN EFI_HANDLE Handle, + IN UINT16 *Token, + IN UINT16 *Host, + IN UINT64 Ticker + ); + +typedef +EFI_STATUS +(EFIAPI * EFI_PERF_END_GAUGE) ( + IN EFI_PERFORMANCE_PROTOCOL *This, + IN EFI_HANDLE Handle, + IN UINT16 *Token, + IN UINT16 *Host, + IN UINT64 Ticker + ); + + +typedef +EFI_GAUGE_DATA * +(EFIAPI * EFI_PERF_GET_GAUGE) ( + IN EFI_PERFORMANCE_PROTOCOL *This, + IN EFI_HANDLE Handle, + IN UINT16 *Token, + IN UINT16 *Host, + IN EFI_GAUGE_DATA *PrevGauge + ); + + +typedef struct _EFI_PERFORMANCE_PROTOCOL{ + EFI_PERF_START_GAUGE StartGauge; + EFI_PERF_END_GAUGE EndGauge; + EFI_PERF_GET_GAUGE GetGauge; +} EFI_PERFORMANCE_PROTOCOL; + +GUID_VARIABLE_DECLARATION(gEfiPerformanceProtocolGuid, EFI_PERFORMANCE_PROTOCOL_GUID); + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2008, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/PlatformDriverOverride.h b/Include/Protocol/PlatformDriverOverride.h new file mode 100644 index 0000000..1f69eaa --- /dev/null +++ b/Include/Protocol/PlatformDriverOverride.h @@ -0,0 +1,105 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/PlatformDriverOverride.h 3 3/13/06 1:40a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/PlatformDriverOverride.h $ +// +// 3 3/13/06 1:40a Felixp +// +// 2 3/04/05 10:36a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 2 3/13/04 5:13p Felixp +// +// 1 3/13/04 4:36p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: PlatformDriverOverride.h +// +// Description: EFI_PLATFORM_DRIVER_OVERRIDE Protocol Definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL__H__ +#define __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID \ + { 0x6b30c738,0xa391,0x11d4,0x9a,0x3b,0x00,0x90,0x27,0x3f,0xc1,0x4d } + +GUID_VARIABLE_DECLARATION(gEfiPlatformDriverOverrideProtocolGuid,EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID); + +typedef struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER) ( + IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN OUT EFI_HANDLE *DriverImageHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH) ( + IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN OUT EFI_DEVICE_PATH_PROTOCOL **DriverImagePath +); + +typedef EFI_STATUS (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED) ( + IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *DriverImagePath, + IN EFI_HANDLE DriverImageHandle +); + +struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL { + EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER GetDriver; + EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH GetDriverPath; + EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED DriverLoaded; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/PlatformToDriverConfiguration.h b/Include/Protocol/PlatformToDriverConfiguration.h new file mode 100644 index 0000000..f97e383 --- /dev/null +++ b/Include/Protocol/PlatformToDriverConfiguration.h @@ -0,0 +1,110 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Include/Protocol/PlatformToDriverConfiguration.h 1 4/22/11 6:45p Artems $ +// +// $Revision: 1 $ +// +// $Date: 4/22/11 6:45p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/PlatformToDriverConfiguration.h $ +// +// 1 4/22/11 6:45p Artems +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: PlatformToDriverConfiguration.h +// +// Description: +// EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL definition file +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL__H__ +#define __PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + +#define EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL_GUID \ + { 0x642cd590, 0x8059, 0x4c0a, 0xa9, 0x58, 0xc5, 0xec, 0x7, 0xd2, 0x3c, 0x4b } + +GUID_VARIABLE_DECLARATION(gEfiPlatformToDriverConfigurationProtocolGuid, EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL_GUID); + +typedef struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL; + +typedef enum { + EfiPlatformConfigurationActionNone = 0, + EfiPlatformConfigurationActionStopController = 1, + EfiPlatformConfigurationActionRestartController = 2, + EfiPlatformConfigurationActionRestartPlatform = 3, + EfiPlatformConfigurationActionNvramFailed = 4, + EfiPlatformConfigurationActionMaximum +} EFI_PLATFORM_CONFIGURATION_ACTION; + +typedef +EFI_STATUS +(EFIAPI *EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY) ( + IN EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_HANDLE ChildHandle OPTIONAL, + IN UINTN *Instance, + OUT EFI_GUID **ParameterTypeGuid, + OUT VOID **ParameterBlock, + OUT UINTN *ParameterBlockSize +); + +typedef +EFI_STATUS + (EFIAPI *EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE) ( + IN EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_HANDLE ChildHandle OPTIONAL, + IN UINTN *Instance, + IN EFI_GUID *ParameterTypeGuid, + IN VOID *ParameterBlock, + IN UINTN ParameterBlockSize, + IN EFI_PLATFORM_CONFIGURATION_ACTION ConfigurationAction +); + +struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL { + EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY Query; + EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE Response; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/Protocol.cif b/Include/Protocol/Protocol.cif new file mode 100644 index 0000000..68b68aa --- /dev/null +++ b/Include/Protocol/Protocol.cif @@ -0,0 +1,100 @@ +<component> + name = "Protocol" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "Protocol" +[files] +"AbsPointerProtocol.h" +"AuthenticationInfo.h" +"BlockIo.h" +"BootScriptSave.h" +"BusSpecificDriverOverride.h" +"ComponentName.h" +"ComponentName2.h" +"DataHub.h" +"DebugSupport.h" +"Decompress.h" +"DeviceIo.h" +"DevicePath.h" +"DevicePathFromText.h" +"DevicePathToText.h" +"DiskIo.h" +"DriverBinding.h" +"ServiceBinding.h" +"DriverDiagnostics2.h" +"DriverHealth.h" +"DriverFamilyOverride.h" +"EBC.h" +"FirmwareVolume.h" +"FirmwareVolume2.h" +"FirmwareVolumeBlock.h" +"FirmwareManagement.h" +"GuidedSectionExtraction.h" +"HII.h" +"IdeControllerInit.h" +"Legacy8259.h" +"LoadedImage.h" +"LoadFile.h" +"PciIo.h" +"PciRootBridgeIo.h" +"PlatformDriverOverride.h" +"PlatformToDriverConfiguration.h" +"SerialIo.h" +"SimpleFileSystem.h" +"SimplePointer.h" +"SimpleTextIn.h" +"SimpleTextOut.h" +"UgaDraw.h" +"UnicodeCollation.h" +"HotKeys.h" +"AmiSio.h" +"AmiReflashProtocol.h" +"SuperIo.h" +"ExtHii.h" +"FormCallBack.h" +"SetupInit.h" +"LoadPe32Image.h" +"ConsoleControl.h" +"CpuIo.h" +"CpuIo2.h" +"AcpiSupport.h" +"AcpiSystemDescriptionTable.h" +"AcpiTable.h" +"PciPlatform.h" +"PciHostBridgeResourceAllocation.h" +"PciHotPlugInit.h" +"IncompatiblePciDeviceSupport.h" +"SmBus.h" +"DevicePathUtilities.h" +"GraphicsOutput.h" +"EdidActive.h" +"EdidDiscovered.h" +"SimpleTextInEx.h" +"EfiOemBadging.h" +"AmiKeycode.h" +"PIDEBus.h" +"PAhciBus.h" +"Performance.h" +"FlashProtocol.h" +"HiiConfigRouting.h" +"HiiConfigAccess.h" +"HiiDatabase.h" +"HiiFont.h" +"HiiString.h" +"FormBrowser2.h" +"HiiUtilities.h" +"TcgService.h" +"LoadFile2.h" +"LoadedImageDevicePath.h" +"HiiPackageList.h" +"Hash.h" +"UserManager.h" +"UserCredential.h" +"DeferredImageLoad.h" +"StorageSecurityCommand.h" +"AtaPassThru.h" +"MpService.h" +"ReportStatusCodeHandler.h" +"SmmReportStatusCodeHandler.h" +"ScsiPassThruExt.h" +<endComponent> diff --git a/Include/Protocol/RealTimeClock.h b/Include/Protocol/RealTimeClock.h new file mode 100644 index 0000000..6e7ae06 --- /dev/null +++ b/Include/Protocol/RealTimeClock.h @@ -0,0 +1,79 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/RealTimeClock.h 1 3/13/06 1:45a Felixp $ +// +// $Revision: 1 $ +// +// $Date: 3/13/06 1:45a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/RealTimeClock.h $ +// +// 1 3/13/06 1:45a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:42a Felixp +// +// 1 12/23/04 9:29a Felixp +// +// 1 1/15/04 6:19p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: RealTimeClock.h +// +// Description: The Real Time Clock Architectural Protocol only consists +// of a GUID. The Protocol is installed with a NULL pointer +// to the structure after the RTC EFI services are installed. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __REAL_TIME_CLOCK_ARCH_PROTOCOL_H__ +#define __REAL_TIME_CLOCK_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID \ + {0x27CFAC87,0x46CC,0x11d4,0x9A,0x38,0x00,0x90,0x27,0x3F,0xC1,0x4D} + +GUID_VARIABLE_DECLARATION(gEfiRealTimeClockArchProtocolGuid, EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID); +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/ReportStatusCodeHandler.h b/Include/Protocol/ReportStatusCodeHandler.h new file mode 100644 index 0000000..ccbfe3a --- /dev/null +++ b/Include/Protocol/ReportStatusCodeHandler.h @@ -0,0 +1,94 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/ReportStatusCodeHandler.h 1 6/16/11 9:48a Felixp $ +// +// $Revision: 1 $ +// +// $Date: 6/16/11 9:48a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/ReportStatusCodeHandler.h $ +// +// 1 6/16/11 9:48a Felixp +// +// 6 1/13/10 2:13p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: ReportStatusCodeHandler.h +// +// Description: Report Status Code Handler Protocol definitions header. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__ +#define __REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_RSC_HANDLER_PROTOCOL_GUID \ + { 0x86212936, 0xe76, 0x41c8, 0xa0, 0x3a, 0x2a, 0xf2, 0xfc, 0x1c, 0x39, 0xe2 } + +GUID_VARIABLE_DECLARATION(gEfiRscHandlerProtocolGuid, EFI_RSC_HANDLER_PROTOCOL_GUID); + +typedef EFI_STATUS +(EFIAPI *EFI_RSC_HANDLER_CALLBACK)( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID *CallerId, + IN EFI_STATUS_CODE_DATA *Data +); + +typedef EFI_STATUS +(EFIAPI *EFI_RSC_HANDLER_REGISTER) ( + IN EFI_RSC_HANDLER_CALLBACK Callback, //A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is + //called when a call to ReportStatusCode() occurs. + IN EFI_TPL Tpl //TPL at which callback can be safely invoked. +); + +typedef EFI_STATUS +(EFIAPI *EFI_RSC_HANDLER_UNREGISTER) ( + IN EFI_RSC_HANDLER_CALLBACK Callback //A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is to be + //unregistered. +); + +typedef struct { + EFI_RSC_HANDLER_REGISTER Register; //Register the callback for notification of status code messages. + EFI_RSC_HANDLER_UNREGISTER Unregister; //Unregister the callback. +} EFI_RSC_HANDLER_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif // __REPORT_STATUS_CODE_HANDLER_H__ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/Reset.h b/Include/Protocol/Reset.h new file mode 100644 index 0000000..0bb4a07 --- /dev/null +++ b/Include/Protocol/Reset.h @@ -0,0 +1,80 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Reset.h 2 3/13/06 1:45a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 3/13/06 1:45a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Reset.h $ +// +// 2 3/13/06 1:45a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:42a Felixp +// +// 1 12/23/04 9:29a Felixp +// +// 1 3/25/04 3:02p Robert +// +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: Reset.h +// +// Description: This file contains the support values for the Reset +// Architectural Protocol +// +//<AMI_FHDR_END> +//***************************************************************************** +#ifndef __RESET_ARCH_PROTOCOL_H__ +#define __RESET_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// GUID for the Reset Architectural Protocol +#define EFI_RESET_ARCH_PROTOCOL_GUID \ + { 0x27CFAC88, 0x46CC, 0x11D4, 0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } + +GUID_VARIABLE_DECLARATION(gEfiResetArchProtocolGuid, EFI_RESET_ARCH_PROTOCOL_GUID); + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/Runtime.h b/Include/Protocol/Runtime.h new file mode 100644 index 0000000..6dbe9b4 --- /dev/null +++ b/Include/Protocol/Runtime.h @@ -0,0 +1,118 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Runtime.h 4 10/07/06 10:18a Felixp $ +// +// $Revision: 4 $ +// +// $Date: 10/07/06 10:18a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Runtime.h $ +// +// 4 10/07/06 10:18a Felixp +// Updated to a new Runtime protocol defined by DXE CIS 0.91 +// +// 3 3/13/06 1:45a Felixp +// +// 2 3/04/05 10:44a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:42a Felixp +// +// 1 12/23/04 9:29a Felixp +// +// 1 3/30/04 2:24a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: Runtime.h +// +// Description: Runtime Architectural Protocol Definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __RUNTIME_ARCH_PROTOCOL_H__ +#define __RUNTIME_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \ + { 0xb7dfb4e1, 0x52f, 0x449f, 0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33 } + +GUID_VARIABLE_DECLARATION(gEfiRuntimeArchProtocolGuid, EFI_RUNTIME_ARCH_PROTOCOL_GUID); + +#ifndef EFI_LIST_ENTRY_DEFINED +#define EFI_LIST_ENTRY_DEFINED +typedef struct _EFI_LIST_ENTRY { + struct _EFI_LIST_ENTRY *ForwardLink; + struct _EFI_LIST_ENTRY *BackLink; +} EFI_LIST_ENTRY; +#endif + +typedef struct _EFI_RUNTIME_IMAGE_ENTRY { + VOID *ImageBase; + UINT64 ImageSize; + VOID *RelocationData; + EFI_HANDLE Handle; + EFI_LIST_ENTRY Link; +} EFI_RUNTIME_IMAGE_ENTRY; + +typedef struct _EFI_RUNTIME_EVENT_ENTRY { + UINT32 Type; + EFI_TPL NotifyTpl; + EFI_EVENT_NOTIFY NotifyFunction; + VOID *NotifyContext; + EFI_EVENT *Event; + EFI_LIST_ENTRY Link; +} EFI_RUNTIME_EVENT_ENTRY; + +// Interface stucture for the Runtime Architectural Protocol +typedef struct _EFI_RUNTIME_ARCH_PROTOCOL { + EFI_LIST_ENTRY ImageHead; + EFI_LIST_ENTRY EventHead; + UINTN MemoryDescriptorSize; + UINT32 MemoryDesciptorVersion; + UINTN MemoryMapSize; + EFI_MEMORY_DESCRIPTOR *MemoryMapPhysical; + EFI_MEMORY_DESCRIPTOR *MemoryMapVirtual; + BOOLEAN VirtualMode; + BOOLEAN AtRuntime; +} EFI_RUNTIME_ARCH_PROTOCOL; +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/S3SaveState.h b/Include/Protocol/S3SaveState.h new file mode 100644 index 0000000..21509bf --- /dev/null +++ b/Include/Protocol/S3SaveState.h @@ -0,0 +1,187 @@ +/** @file + S3 Save State Protocol as defined in PI1.2 Specification VOLUME 5 Standard. + + This protocol is used by DXE PI module to store or record various IO operations + to be replayed during an S3 resume. + This protocol is not required for all platforms. + + Copyright (c) 2009 - 2010, Intel Corporation + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + + @par Revision Reference: + This PPI is defined in UEFI Platform Initialization Specification 1.2 Volume 5: + Standards + +**/ + +#ifndef __S3_SAVE_STATE_H__ +#define __S3_SAVE_STATE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + + +#define EFI_S3_SAVE_STATE_PROTOCOL_GUID \ + { 0xe857caf6, 0xc046, 0x45dc, 0xbe, 0x3f, 0xee, 0x7, 0x65, 0xfb, 0xa8, 0x87} + +GUID_VARIABLE_DECLARATION(gEfiS3SaveStateProtocolGuid,EFI_S3_SAVE_STATE_PROTOCOL_GUID); + +typedef VOID *EFI_S3_BOOT_SCRIPT_POSITION; + +typedef struct _EFI_S3_SAVE_STATE_PROTOCOL EFI_S3_SAVE_STATE_PROTOCOL; + +/** + Record operations that need to be replayed during an S3 resume. + + This function is used to store an OpCode to be replayed as part of the S3 resume boot path. It is + assumed this protocol has platform specific mechanism to store the OpCode set and replay them + during the S3 resume. + + @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance. + @param[in] OpCode The operation code (opcode) number. + @param[in] ... Argument list that is specific to each opcode. See the following subsections for the + definition of each opcode. + + @retval EFI_SUCCESS The operation succeeded. A record was added into the specified + script table. + @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported. + @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_S3_SAVE_STATE_WRITE)( + IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This, + IN UINT16 OpCode, + ... +); + +/** + Record operations that need to be replayed during an S3 resume. + + This function is used to store an OpCode to be replayed as part of the S3 resume boot path. It is + assumed this protocol has platform specific mechanism to store the OpCode set and replay them + during the S3 resume. + The opcode is inserted before or after the specified position in the boot script table. If Position is + NULL then that position is after the last opcode in the table (BeforeOrAfter is TRUE) or before + the first opcode in the table (BeforeOrAfter is FALSE). The position which is pointed to by + Position upon return can be used for subsequent insertions. + + This function has a variable parameter list. The exact parameter list depends on the OpCode that is + passed into the function. If an unsupported OpCode or illegal parameter list is passed in, this + function returns EFI_INVALID_PARAMETER. + If there are not enough resources available for storing more scripts, this function returns + EFI_OUT_OF_RESOURCES. + OpCode values of 0x80 - 0xFE are reserved for implementation specific functions. + + @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance. + @param[in] BeforeOrAfter Specifies whether the opcode is stored before (TRUE) or after (FALSE) the position + in the boot script table specified by Position. If Position is NULL or points to + NULL then the new opcode is inserted at the beginning of the table (if TRUE) or end + of the table (if FALSE). + @param[in, out] Position On entry, specifies the position in the boot script table where the opcode will be + inserted, either before or after, depending on BeforeOrAfter. On exit, specifies + the position of the inserted opcode in the boot script table. + @param[in] OpCode The operation code (opcode) number. See "Related Definitions" in Write() for the + defined opcode types. + @param[in] ... Argument list that is specific to each opcode. See the following subsections for the + definition of each opcode. + + @retval EFI_SUCCESS The operation succeeded. An opcode was added into the script. + @retval EFI_INVALID_PARAMETER The Opcode is an invalid opcode value. + @retval EFI_INVALID_PARAMETER The Position is not a valid position in the boot script table. + @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script table. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_S3_SAVE_STATE_INSERT)( + IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This, + IN BOOLEAN BeforeOrAfter, + IN OUT EFI_S3_BOOT_SCRIPT_POSITION *Position OPTIONAL, + IN UINT16 OpCode, + ... +); + +/** + Find a label within the boot script table and, if not present, optionally create it. + + If the label Label is already exists in the boot script table, then no new label is created, the + position of the Label is returned in *Position and EFI_SUCCESS is returned. + If the label Label does not already exist and CreateIfNotFound is TRUE, then it will be + created before or after the specified position and EFI_SUCCESS is returned. + If the label Label does not already exist and CreateIfNotFound is FALSE, then + EFI_NOT_FOUND is returned. + + @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance. + @param[in] BeforeOrAfter Specifies whether the label is stored before (TRUE) or after (FALSE) the position in + the boot script table specified by Position. If Position is NULL or points to + NULL then the new label is inserted at the beginning of the table (if TRUE) or end of + the table (if FALSE). + @param[in] CreateIfNotFound Specifies whether the label will be created if the label does not exists (TRUE) or not (FALSE). + @param[in, out] Position On entry, specifies the position in the boot script table where the label will be inserted, + either before or after, depending on BeforeOrAfter. On exit, specifies the position + of the inserted label in the boot script table. + @param[in] Label Points to the label which will be inserted in the boot script table. + + @retval EFI_SUCCESS The label already exists or was inserted. + @retval EFI_NOT_FOUND The label did not already exist and CreateifNotFound was FALSE. + @retval EFI_INVALID_PARAMETER The Opcode is an invalid opcode value. + @retval EFI_INVALID_PARAMETER The Position is not a valid position in the boot script table. + @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_S3_SAVE_STATE_LABEL)( + IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This, + IN BOOLEAN BeforeOrAfter, + IN BOOLEAN CreateIfNotFound, + IN OUT EFI_S3_BOOT_SCRIPT_POSITION *Position OPTIONAL, + IN CONST CHAR8 *Label +); + +/** + Compare two positions in the boot script table and return their relative position. + + This function compares two positions in the boot script table and returns their relative positions. If + Position1 is before Position2, then -1 is returned. If Position1 is equal to Position2, + then 0 is returned. If Position1 is after Position2, then 1 is returned. + + @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance. + @param[in] Position1 The positions in the boot script table to compare. + @param[in] Position2 The positions in the boot script table to compare. + @param[out] RelativePosition On return, points to the result of the comparison. + + @retval EFI_SUCCESS The label already exists or was inserted. + @retval EFI_INVALID_PARAMETER The Position1 or Position2 is not a valid position in the boot script table. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_S3_SAVE_STATE_COMPARE)( + IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This, + IN EFI_S3_BOOT_SCRIPT_POSITION Position1, + IN EFI_S3_BOOT_SCRIPT_POSITION Position2, + OUT UINTN *RelativePosition +); + +struct _EFI_S3_SAVE_STATE_PROTOCOL { + EFI_S3_SAVE_STATE_WRITE Write; + EFI_S3_SAVE_STATE_INSERT Insert; + EFI_S3_SAVE_STATE_LABEL Label; + EFI_S3_SAVE_STATE_COMPARE Compare; +}; + +//extern EFI_GUID gEfiS3SaveStateProtocolGuid; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif // __S3_SAVE_STATE_H__ diff --git a/Include/Protocol/S3SmmSaveState.h b/Include/Protocol/S3SmmSaveState.h new file mode 100644 index 0000000..50606b1 --- /dev/null +++ b/Include/Protocol/S3SmmSaveState.h @@ -0,0 +1,46 @@ +/** @file + S3 SMM Save State Protocol as defined in PI1.2 Specification VOLUME 5 Standard. + + The EFI_S3_SMM_SAVE_STATE_PROTOCOL publishes the PI SMMboot script abstractions + On an S3 resume boot path the data stored via this protocol is replayed in the order it was stored. + The order of replay is the order either of the S3 Save State Protocol or S3 SMM Save State Protocol + Write() functions were called during the boot process. Insert(), Label(), and + Compare() operations are ordered relative other S3 SMM Save State Protocol write() operations + and the order relative to S3 State Save Write() operations is not defined. Due to these ordering + restrictions it is recommended that the S3 State Save Protocol be used during the DXE phase when + every possible. + The EFI_S3_SMM_SAVE_STATE_PROTOCOL can be called at runtime and + EFI_OUT_OF_RESOURCES may be returned from a runtime call. It is the responsibility of the + platform to ensure enough memory resource exists to save the system state. It is recommended that + runtime calls be minimized by the caller. + + Copyright (c) 2009, Intel Corporation + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + + @par Revision Reference: + This PPI is defined in UEFI Platform Initialization Specification 1.2 Volume 5: + Standards + +**/ + +#ifndef __S3_SMM_SAVE_STATE_H__ +#define __S3_SMM_SAVE_STATE_H__ + +#include <Protocol/S3SaveState.h> + +#define EFI_S3_SMM_SAVE_STATE_PROTOCOL_GUID \ + {0x320afe62, 0xe593, 0x49cb, 0xa9, 0xf1, 0xd4, 0xc2, 0xf4, 0xaf, 0x1, 0x4c} + +GUID_VARIABLE_DECLARATION(gEfiS3SmmSaveStateProtocolGuid,EFI_S3_SMM_SAVE_STATE_PROTOCOL_GUID); + +typedef EFI_S3_SAVE_STATE_PROTOCOL EFI_S3_SMM_SAVE_STATE_PROTOCOL; + + +#endif // __S3_SMM_SAVE_STATE_H__ + diff --git a/Include/Protocol/SBPlatformData.h b/Include/Protocol/SBPlatformData.h new file mode 100644 index 0000000..ba1eeda --- /dev/null +++ b/Include/Protocol/SBPlatformData.h @@ -0,0 +1,93 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SBPlatformData.h 3 4/24/13 6:50a Scottyang $ +// +// $Revision: 3 $ +// +// $Date: 4/24/13 6:50a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SBPlatformData.h $ +// +// 3 4/24/13 6:50a Scottyang +// [TAG] EIP82149 +// [Category] Improvement +// [Description] Intel(R) 8 Series Chipset Family Deep Sx and CPU +// Soft-Strap BIOS Override Co-Existence Issue. If the soft-strap override +// feature is required and enabled, BIOS must disable Deep Sx +// functionality. +// [Files] SBDxe.c, SB.sd, SBPlatformData.h +// +// 2 10/16/12 5:15a Scottyang +// [TAG] None +// +// [Category] Improvement +// +// [Description] One rom for two chip and one chip. +// [Files] SPPEIBoard.c, SB.sd, SBDxe.c, SBPEI.c, PCH.asl, +// SBPlatformData.h +// +// 1 2/08/12 8:26a Yurenlai +// Intel Lynx Point/SB eChipset initially releases. +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: SBPlatformData.h +// +// Description: SB Specific Setup Variables and Structures +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef _SB_PLATFORM_DATA_H_ +#define _SB_PLATFORM_DATA_H_ +#ifdef __cplusplus +extern "C" { +#endif + + #pragma pack(1) + + typedef struct _SB_PLATFORM_DATA + { + UINT8 PchHotLevelPresent; + UINT8 GbePciePortNum; + UINT8 PcieSBDE; + UINT8 PchRid; + UINT8 LPTType; + UINT8 HideDeepSx; // [EIP82149] + }SB_PLATFORM_DATA; + + #pragma pack() + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SBSmiProtocol.h b/Include/Protocol/SBSmiProtocol.h new file mode 100644 index 0000000..be7d2c3 --- /dev/null +++ b/Include/Protocol/SBSmiProtocol.h @@ -0,0 +1,134 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SBSmiProtocol.h 1 2/08/12 8:26a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/08/12 8:26a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SBSmiProtocol.h $ +// +// 1 2/08/12 8:26a Yurenlai +// Intel Lynx Point/SB eChipset initially releases. +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: SBSmiProtocol.h +// +// Description: South Bridge SMI Dispatch Protocol header. +// +//<AMI_FHDR_END> +//************************************************************************* + +#ifndef _SB_SMI_PROTOCOL_H +#define _SB_SMI_PROTOCOL_H + +#pragma pack(push, 1) + +// {589BC616-BB4F-47ed-92F7-93393C697E25} +#define AMI_SB_SMI_PROTOCOL_GUID \ + {0x589bc616, 0xbb4f, 0x47ed, 0x92, 0xf7, 0x93, 0x39, 0x3c, 0x69, 0x7e, 0x25} + +#define EFI_SB_PCIE_ERROR_LOG_DISPATCH_PROTOCOL_GUID \ + {0xf281fc6e, 0xf4c4, 0x431c, 0x96, 0x2b, 0x2f, 0x13, 0xae, 0x79, 0x84, 0xec} + + +#ifndef __SMM_CHILD_DISPATCH__H__ +typedef struct _GENERIC_LINK GENERIC_LINK; +typedef struct _GENERIC_LINK { + void *Link; +}; +#endif + +typedef struct _SB_PCIE_ERR +{ + UINT32 PcieAddress; + UINT8 Bus; + UINT8 Dev; + UINT8 Fun; + UINT16 VendorId; + UINT16 DeviceId; + UINT16 PciCommand; + UINT16 PciStatus; + UINT16 PciCCode; + UINT16 PcieStatus; + UINT32 PortType; + UINT8 Version; + UINT16 SecondaryStatus; + UINT16 BridgeControl; + BOOLEAN Correctable; + BOOLEAN NonFatal; + BOOLEAN Fatal; + BOOLEAN ParityError; + BOOLEAN SystemError; +} SB_PCIE_ERR; + +typedef struct _EFI_SB_PCIE_ERROR_LOG_DISPATCH_PROTOCOL EFI_SB_PCIE_ERROR_LOG_DISPATCH_PROTOCOL; + +typedef VOID (EFIAPI *EFI_SB_PCIE_ERROR_LOG_DISPATCH) ( + IN EFI_HANDLE DispatchHandle, + IN SB_PCIE_ERR SbPcieErrorInfo +); + +typedef struct _SB_PCIE_ERROR_LOG_DISPATCH_LINK SB_PCIE_ERROR_LOG_DISPATCH_LINK; +struct _SB_PCIE_ERROR_LOG_DISPATCH_LINK { + IN SB_PCIE_ERROR_LOG_DISPATCH_LINK *Link; + IN EFI_SB_PCIE_ERROR_LOG_DISPATCH Function; +}; + +typedef EFI_STATUS (EFIAPI *EFI_SB_PCIE_ERROR_LOG_REGISTER) ( + IN EFI_SB_PCIE_ERROR_LOG_DISPATCH_PROTOCOL *This, + IN EFI_SB_PCIE_ERROR_LOG_DISPATCH DispatchFunction, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SB_PCIE_ERROR_LOG_UNREGISTER) ( + IN EFI_SB_PCIE_ERROR_LOG_DISPATCH_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +struct _EFI_SB_PCIE_ERROR_LOG_DISPATCH_PROTOCOL { + EFI_SB_PCIE_ERROR_LOG_REGISTER Register; + EFI_SB_PCIE_ERROR_LOG_UNREGISTER UnRegister; +}; + +#define NMI_SC_PORT 0x61 +#define SMI_EN_OFFSET 0x30 //SMI Control and Enable Register +#define SMI_STS_OFFSET 0x34 //SMI Status Register +#define TCOBASE_OFFSET 0x60 //TCO registers offset +#define TCO1_CNT_OFFSET TCOBASE_OFFSET + 0x08 //TCO1 Control Register +#define TCO1_STS_OFFSET TCOBASE_OFFSET + 0x04 //TCO1 Status Register + +#pragma pack(pop) + +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SMBIOSProto.CIF b/Include/Protocol/SMBIOSProto.CIF new file mode 100644 index 0000000..69efc5c --- /dev/null +++ b/Include/Protocol/SMBIOSProto.CIF @@ -0,0 +1,10 @@ +<component> + name = "SMBIOS - Protocols" + category = ModulePart + LocalRoot = "Include\Protocol" + RefName = "SMBIOSProto" +[files] +"SmbiosDynamicData.h" +"SmbiosGetFlashDataProtocol.h" +"SMBios.h" +<endComponent> diff --git a/Include/Protocol/SMBios.h b/Include/Protocol/SMBios.h new file mode 100644 index 0000000..1a564e6 --- /dev/null +++ b/Include/Protocol/SMBios.h @@ -0,0 +1,1729 @@ +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2016, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// + +//**********************************************************************// +// $Header: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SMBios.h 30 4/07/16 5:51p Davidd $ +// +// $Revision: 30 $ +// +// $Date: 4/07/16 5:51p $ +//**********************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SMBios.h $ +// +// 30 4/07/16 5:51p Davidd +// [TAG] EIP231162 +// [Category] New Feature +// [Description] Merge Aptio V Smbios -09 changes for Aptio 4 +// 4.6.5.5_SMBIOS_40 release +// [Files] Smbios.sdl +// SmbiosDynamicData.h +// Smbios.h +// SmbiosStaticData.sdl +// SmbiosStaticData.asm +// SmbData.mac +// SmbMacro.aid +// SmbDesc.def +// +// 29 6/13/14 3:25p Davidd +// [TAG] EIP171151 +// [Category] Bug Fix +// [Severity] Minor +// [Symptom] Smbios Type 12 - Changes beyond string #8 were not +// persistent across the reboot +// [RootCause] Test flag is only 8 bits +// [Solution] Create and use array of test flags for specified number of +// Type 12 structure +// [Files] Smbios.c +// Smbios.h +// +// 28 6/03/13 6:21p Davidd +// [TAG] EIP125665 +// [Category] New Feature +// [Description] Request to Support multiple instances of SMBIOS Type 3 +// structure (merge EIP106206 into Aptio 4) +// [Files] Smbdata.mac +// SmbiosStaticData.sdl +// Smbstruc.def +// Smbios.c +// SmbiosDMIEditFunc.c +// Smbios.h +// +// 27 5/29/13 12:48p Davidd +// [TAG] EIP124735 +// [Category] Spec Update +// [Severity] Normal +// [Description] SMBIOS 2.8.0 specification support for Aptio 4 +// [Files] Smb.equ +// Smbdata.mac +// Smbdesc.def +// Smbstruc.def +// Smbios.c +// Smbios.h +// SmbiosDynamicData.h +// +// 26 5/23/13 2:38p Davidd +// [TAG] EIP104836 +// [Category] New Feature +// [Description] DMIEdit support edit type 4 +// [Files] SmbiosBoard.c +// SmbiosDMIEditBoard.sdl +// Smbios.c +// SmbiosDMIEditFunc.c +// Smbios.h +// SmbiosDynamicData.h +// +// 25 6/11/12 11:24a Davidd +// [TAG] EIP92170 +// [Category] Improvement +// [Description] Adding DmiEdit support for multiple instances of Smbios +// type 39 structure to match with AMI DmiEdit tool +// [Files] Smbios.h +// Smbios.c +// SmbiosStaticData.sdl +// +// 24 3/26/12 12:04p Davidd +// [TAG] EIP84370 +// [Category] New Feature +// [Description] Flash memory(type 16 and 17) on aptio +// [Files] Smbdata.mac +// SmbiosStaticData.asm +// SmbiosStaticData.sdl +// Smbios.c +// Smbios.mak +// Smbios.h +// +// 23 3/09/12 10:56a Davidd +// [TAG] EIP81469 +// [Category] Bug Fix +// [Severity] Normal +// [Symptom] SMBIOS protocl didn't compatible with PI1.1 +// [RootCause] PI1.1 protocol functions incorrectly added after AMI +// functions of Smbios protocols. +// [Solution] Moved PI1.1 protocol functions to the top of the protocol. +// [Files] Smbios.c +// Smbios.h +// +// 22 1/17/12 4:37p Davidd +// [TAG] EIP78264 +// [Category] Improvement +// [Description] SMBOS Type 2 (Spec 2.7.1) - No multiple type 2 support +// [Files] Smbios.c +// Smbios.h +// Smbdata.mac +// Smbdesc.def +// SmbiosStaticData.sdl +// +// 21 11/17/11 2:43p Davidd +// [TAG] EIP74579 +// [Category] Improvement +// [Description] Update SMBIOS moudule to let AMDELNX support SMBIOS +// spec 2.7 +// (remove the 64 characters string limitation) +// [Files] Smbios.h +// SmbiosStaticData.sdl +// Smbios.c +// SMBios.dxs +// SmbiosDMIEdit.sdl +// SmbiosDMIEdit.h +// SmbiosDMIEditFunc.c +// SmbiosNvram.c +// SmbiosFlashData.sdl +// +// 20 10/05/11 3:53p Davidd +// [Category] NEW FEATURE +// [Description] Allow Smbios Type 2 Location field and Type 3 SKU +// Number field +// to be updated by dmieditwingui tool +// [Files] Smbios.c +// SmbiosDMIEditFunc.c +// Smbdata.mac +// Smbios.h +// +// 19 8/03/11 10:54a Davidd +// [TAG] EIP64029 +// [Category] NEW FEATURE +// [Description] Allow SMBIOS Type 22 to be modified using DMIEdit +// [Files] Smbios.h +// Smbios.c +// SmbiosDmieditFunc.c +// +// 18 6/10/11 3:02p Davidd +// [TAG] EIP61934 +// [Category] Improvement +// [Description] Dependency viewer is not working in Chief River Project +// [Files] Smbios.h +// +// 17 5/04/11 3:34p Davidd +// [TAG] EIP57144 +// [Category] NEW FEATURE +// [Description] Allow SMBIOS Type 39 to be modified using DMIEdit +// [Files] SmbiosBoard.c +// Smbios.h +// SmbiosDynamicData.h +// Smbios.c +// SmbiosDmieditFunc.c +// SmbiosNvramFunc.c +// +// 16 11/02/10 4:17p Davidd +// [TAG] EIP42938 +// [Category] BUG FIX +// [Severity] Critical +// [Symptom] The SMBIOS string field cannot be successfully updated +// if it was programmed to Null by the 3-party SMBIOS tool +// [RootCause] BIOS did not have support for NULL strings +// [Solution] Problem has been fixed with code changes +// [Files] +// Smbios.c +// SmbiosDMIEditFunc.c +// SmbiosGetFlashData.c +// SmbiosDMIEdit.h +// SmbiosFlashData.sdl +// +// 15 10/08/10 8:14p Davidd +// [TAG] EIP43278 +// +// [Category] Function Request +// +// [Severity] Normal +// +// [Description] SMBIOS 2.7 requirement +// +// [Files] Include\Protocol\Smbios.h +// Include\Protocol\SmbiosDynamicData.h +// Board\EM\SMBIOS\SMBiosStaticData\SmbiosStaticData.sdl +// Board\EM\SMBIOS\SMBiosStaticData\SMBDATA.MAC +// Board\EM\SMBIOS\SMBiosStaticData\SMBSTRUC.DEF +// Board\EM\SMBIOS\SMBiosStaticData\SMBMACRO.AID +// Board\EM\SMBIOS\SMBiosStaticData\Smbdesc.def +// Board\EM\SMBIOS\SMBiosStaticData\SMB.EQU +// +// 14 5/18/10 5:15p Davidd +// Added PnP function 52h commands 3 and 4 support - EIP 38010. +// +// 13 5/06/10 10:37a Davidd +// Added Smbios PI 1.1 support. +// +// 12 11/23/09 5:52p Davidd +// Corrected the DMIEdit data not updated after being updated 5-6 times +// (when NVRAM is used to store DMIEdit data) - EIP 30837. +// +// 11 1/28/09 11:36a Davidd +// +// 10 11/14/08 4:44p Davidd +// - Added GetFreeHandle protocol +// - Added AddStructureByHandle protocol +// - Added ReadStructureByType protocol +// +// 9 10/23/08 6:22p Davidd +// Added changes to support SMBIOS version 2.5 and 2.6. +// +// 8 11/26/07 11:39a Davidd +// +// 7 11/21/07 10:39a Davidd +// Added SmbiosUpdateHeader protocol. +// +// 6 11/09/07 11:15a Davidd +// Reapply the fixes for long string that were inadvertently changed in +// revision 5. +// +// 5 6/21/07 3:11p Pats +// Modified to support editing of SMBIOS structure type 0, offsets 5 and 8 +// +// 4 4/18/07 12:36p Davidd +// Fixed long strings (64 characters) problem after being updated with +// DMIEdit and system restarted. +// +// 3 3/28/07 7:49p Davidd +// Updated the year on the AMI banner +// +// 2 12/15/06 1:16p Davidd +// Code cleanup and reformatted to coding standard. +// +// 1 3/02/06 2:29p Davidd +// +// 3 8/10/05 10:35a Davidd +// Removed definition for EFI_SMBIOS_PROTOCOL_GUID. It has been moved to +// SmbiosGetFlashDataProtocol.h +// +// 2 7/20/05 12:41p Davidd +// - Corrected dynamic update on-board device problem. +// +// 1 4/29/05 2:03p Davidd +// Initial checkin. +// +//**********************************************************************// + +#ifndef _Smbios_DRIVER_H +#define _Smbios_DRIVER_H + +#include <token.h> + +#define EFI_SMBIOS_STATIC_DATA_GUID \ + {0xdaf4bf89, 0xce71, 0x4917, { 0xb5, 0x22, 0xc8, 0x9d, 0x32, 0xfb, 0xc5, 0x9f }} +#define EFI_SMBIOS_NVRAM_DATA_GUID \ + {0x4b3082a3, 0x80c6, 0x4d7e, { 0x9c, 0xd0, 0x58, 0x39, 0x17, 0x26, 0x5d, 0xf1 }} + +#ifndef EFI_SMBIOS_PROTOCOL_GUID + #if (SMBIOS_PI_1_1 == 0) + #define EFI_SMBIOS_PROTOCOL_GUID \ + {0x5e90a50d, 0x6955, 0x4a49, { 0x90, 0x32, 0xda, 0x38, 0x12, 0xf8, 0xe8, 0xe5 }} + #else + #define EFI_SMBIOS_PROTOCOL_GUID \ + {0x03583ff6, 0xcb36, 0x4940, { 0x94, 0x7e, 0xb9, 0xb3, 0x9f, 0x4a, 0xfa, 0xf7 }} + #endif +#endif + +//**********************************************************************// +// DMI ERROR Codes +//**********************************************************************// + +#define DMI_SUCCESS 0x00 +#define DMI_UNKNOWN_FUNCTION 0x81 +#define DMI_FUNCTION_NOT_SUPPORTED 0x82 +#define DMI_INVALID_HANDLE 0x83 +#define DMI_BAD_PARAMETER 0x84 +#define DMI_INVALID_SUBFUNCTION 0x85 +#define DMI_NO_CHANGE 0x86 +#define DMI_ADD_STRUCTURE_FAILED 0x87 +#define DMI_READ_ONLY 0x8D +#define DMI_LOCK_NOT_SUPPORTED 0x90 +#define DMI_CURRENTLY_LOCKED 0x91 +#define DMI_INVALID_LOCK 0x92 + +//**********************************************************************// + +#pragma pack(1) + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_TABLE_ENTRY_POINT +// +// Description: SMBIOS Structure Table Entry Point +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT8 AnchorString[4]; + UINT8 EntryPointStructureChecksum; + UINT8 EntryPointLength; + UINT8 MajorVersion; + UINT8 MinorVersion; + UINT16 MaxStructureSize; + UINT8 EntryPointRevision; + UINT8 FormattedArea[5]; + UINT8 IntermediateAnchorString[5]; + UINT8 IntermediateChecksum; + UINT16 TableLength; + UINT32 TableAddress; + UINT16 NumberOfSmbiosStructures; + UINT8 SmbiosBCDRevision; +} SMBIOS_TABLE_ENTRY_POINT; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_STRUCTURE_HEADER +// +// Description: SMBIOS Structure Header - Common for all structures +// Describing the type, size of the fixed area, and handle +// of the structure. +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT8 Type; + UINT8 Length; + UINT16 Handle; +} SMBIOS_STRUCTURE_HEADER; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_BIOS_INFO +// +// Description: BIOS Information Structure (Type 0) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 BiosVendor; // String number + UINT8 BiosVersion; // String number + UINT16 BiosStartingAddrSegment; + UINT8 BiosReleaseDate; // String number + UINT8 BiosRomSize; + UINT32 BiosChar_1; + UINT32 BiosChar_2; + UINT8 BiosCharExtByte1; + UINT8 BiosCharExtByte2; + UINT8 SystemBiosMajorRelease; + UINT8 SystemBiosMinorRelease; + UINT8 ECFirmwareMajorRelease; + UINT8 ECFirmwareMinorRelease; +} SMBIOS_BIOS_INFO; // TYPE 0 + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_SYSTEM_INFO +// +// Description: System Information Structure (Type 1) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Manufacturer; // String number + UINT8 ProductName; // String number + UINT8 Version; // String number + UINT8 SerialNumber; // String number + EFI_GUID Uuid; + UINT8 WakeupType; + UINT8 SkuNumber; + UINT8 Family; +} SMBIOS_SYSTEM_INFO; // TYPE 1 + +#if BASE_BOARD_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_BASE_BOARD_INFO +// +// Description: Base Board (or Module) Information Structure (Type 2) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Manufacturer; // String number + UINT8 ProductName; // String number + UINT8 Version; // String number + UINT8 SerialNumber; // String number + UINT8 AssetTag; // String number + UINT8 FeatureTag; + UINT8 Location; // String number + UINT16 ChassisHandle; + UINT8 BoardType; + UINT8 NumberOfObjectHandles; +#if NUMBER_OF_OBJECT_HANDLES != 0 + UINT8 ObjectHandles[NUMBER_OF_OBJECT_HANDLES]; +#endif +} SMBIOS_BASE_BOARD_INFO; // TYPE 2 +#endif + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_SYSTEM_ENCLOSURE_INFO +// +// Description: System Enclosure or Chassis Information Structure (Type 3) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Manufacturer; // String number + UINT8 Type; + UINT8 Version; // String number + UINT8 SerialNumber; // String number + UINT8 AssetTag; // String number + UINT8 BootupState; + UINT8 PowerSupplyState; + UINT8 ThermalState; + UINT8 SecurityStatus; + UINT32 OemDefined; + UINT8 Height; + UINT8 NumberOfPowerCord; + UINT8 ElementCount; + UINT8 ElementRecordLength; +#if ((ELEMENT_COUNT != 0) && (ELEMENT_LEN != 0)) + UINT8 Elements[ELEMENT_COUNT * ELEMENT_LEN]; +#endif + UINT8 SkuNumber; +} SMBIOS_SYSTEM_ENCLOSURE_INFO; // TYPE 3 + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_PROCESSOR_INFO +// +// Description: Processor Information Structure (Type 4) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 SocketDesignation; // String number + UINT8 ProcessotType; + UINT8 Family; + UINT8 ProcessorManufacturer; // String number + UINT32 ProcessorID_1; + UINT32 ProcessorID_2; + UINT8 ProcessorVersion; // String number + UINT8 Voltage; + UINT16 ExtClockFreq; + UINT16 MaxSpeed; + UINT16 CurrentSpeed; + UINT8 Status; + UINT8 Upgrade; + UINT16 L1CacheHandle; + UINT16 L2CacheHandle; + UINT16 L3CacheHandle; + UINT8 SerialNumber; // String number + UINT8 AssetTag; // String number + UINT8 PartNumber; // String number + UINT8 CoreCount; // Number of cores per processor socket + UINT8 CoreEnabled; // Number of enabled cores per processor socket + UINT8 ThreadCount; // Number of threads per processor socket + UINT16 ProcessorChar; // Defines which functions the processor supports + UINT16 Family2; +} SMBIOS_PROCESSOR_INFO; // TYPE 4 + +#if MEM_CTRL_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_MEM_CONTROLLER_INFO +// +// Description: Memory Controller Information Structure (Type 5) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 ErrDetMethod; + UINT8 ECC; + UINT8 SupportInterleave; + UINT8 CurrentInterleave; + UINT8 MaxMemModuleSize; + UINT16 SupportSpeed; + UINT16 SupportMemTypes; + UINT8 MemModuleVoltage; + UINT8 NumberMemSlots; + UINT16 MemModuleConfigHandle[NUMBER_OF_MEM_MODULE]; + UINT8 EnabledECC; +} SMBIOS_MEM_CONTROLLER_INFO; // TYPE 5 +#endif + +#if MEM_MODULE_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_MEM_MODULE_INFO +// +// Description: Memory Module Information Structure (Type 6) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 SocketDesignation; + UINT8 BankConnections; + UINT8 CurrentSpeed; + UINT16 CurrentMemType; + UINT8 InstalledSize; + UINT8 EnabledSize; + UINT8 ErrorStatus; +} SMBIOS_MEM_MODULE_INFO; // TYPE 6 +#endif + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_CACHE_INFO +// +// Description: Cache Information Structure (Type 7) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 SocketDesignation; + UINT16 CacheConfig; + UINT16 MaxCacheSize; + UINT16 InstalledSize; + UINT16 SupportSRAM; + UINT16 CurrentSRAM; + UINT8 CacheSpeed; + UINT8 ErrorCorrectionType; + UINT8 SystemCacheType; + UINT8 Associativity; +} SMBIOS_CACHE_INFO; // TYPE 7 + +#if PORT_CONNECTOR_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_PORT_CONN_INFO +// +// Description: Port Connector Information Structure (Type 8) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 IntRefDesig; + UINT8 IntConnType; + UINT8 ExtRefDesig; + UINT8 ExtConnType; + UINT8 PortType; +} SMBIOS_PORT_CONN_INFO; // TYPE 8 +#endif + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_SYSTEM_SLOTS_INFO +// +// Description: System Slot Information Structure (Type 9) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 SlotDesig; + UINT8 SlotType; + UINT8 SlotDataBusWidth; + UINT8 CurrentUsage; + UINT8 SlotLength; + UINT16 SlotID; + UINT8 SlotChar_1; + UINT8 SlotChar_2; + UINT16 SegGroupNumber; + UINT8 BusNumber; + UINT8 DevFuncNumber; +} SMBIOS_SYSTEM_SLOTS_INFO; // TYPE 9 + +#if ONBOARD_DEVICE_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SINGLE_DEV_INFO +// +// Description: Single Device Information +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT8 DeviceType; + UINT8 DescStringNum; +} SINGLE_DEV_INFO; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_ONBOARD_DEV_INFO +// +// Description: On Board Devices Information Structure (Type 10) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + SINGLE_DEV_INFO OnBoardDev; +} SMBIOS_ONBOARD_DEV_INFO; // TYPE 10 +#endif + +#if OEM_STRING_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_OEM_STRINGS_INFO +// +// Description: OEM Strings Structure (Type 11) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Count; +} SMBIOS_OEM_STRINGS_INFO; // TYPE 11 +#endif + +#if SYSTEM_CONFIG_OPTION_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_SYSTEM_CONFIG_INFO +// +// Description: System Configuration Options (Type 12) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Count; +} SMBIOS_SYSTEM_CONFIG_INFO; // TYPE 12 +#endif + +#if BIOS_LANGUAGE_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_BIOS_LANG_INFO +// +// Description: BIOS Language Information (Type 13) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 InstallableLang; + UINT8 Flags; + UINT8 Reserved[15]; + UINT8 CurrentLang; +} SMBIOS_BIOS_LANG_INFO; // TYPE 13 +#endif + +#if EVENT_LOG_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: EVENT_LOG_DESCRIPTOR +// +// Description: Event Log Descriptor - Part of the System Event Log (Type 15) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT8 LogType; + UINT8 VariableDataFormatType; +} EVENT_LOG_DESCRIPTOR; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_EVENT_LOG_INFO +// +// Description: System Event Log (Type 15) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT16 LogAreaLength; + UINT16 LogHeaderStartOffset; + UINT16 LogDataStartOffset; + UINT8 AccessMethod; + UINT8 LogStatus; + UINT32 LogChangeToken; + UINT32 AccesMethodAddr; + UINT8 LogHeaderFormat; + UINT8 NumbetOfLogTypeDesc; + UINT8 LengthOfLogTypeDesc; + EVENT_LOG_DESCRIPTOR LogDescriptors[NO_OF_SUPPORTED_EVENTS]; +} SMBIOS_EVENT_LOG_INFO; // TYPE 15 +#endif + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_PHYSICAL_MEM_ARRAY_INFO +// +// Description: Physical Memory Array (Type 16) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Location; + UINT8 Use; + UINT8 MemErrorCorrection; + UINT32 MaxCapacity; + UINT16 MemErrInfoHandle; + UINT16 NumberOfMemDev; + UINT64 ExtMaxCapacity; +} SMBIOS_PHYSICAL_MEM_ARRAY_INFO; // TYPE 16 + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_MEMORY_DEVICE_INFO +// +// Description: Memory Device (Type 17) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT16 PhysicalMemArrayHandle; + UINT16 MemErrorInfoHandle; + UINT16 TotalWidth; + UINT16 DataWidth; + UINT16 Size; + UINT8 FormFactor; + UINT8 DeviceSet; + UINT8 DeviceLocator; + UINT8 BankLocator; + UINT8 MemoryType; + UINT16 TypeDetail; + UINT16 Speed; + UINT8 Manufacturer; + UINT8 SerialNumber; + UINT8 AssetTag; + UINT8 PartNumber; + UINT8 Attributes; + UINT32 ExtendedSize; + UINT16 ConfMemClkSpeed; + UINT16 MinimumVoltage; + UINT16 MaximumVoltage; + UINT16 ConfiguredVoltage; +} SMBIOS_MEMORY_DEVICE_INFO; // TYPE 17 + +#if MEMORY_ERROR_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_MEMORY_ERROR_INFO +// +// Description: 32-bit Memory Error Information (Type 18) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 ErrorType; + UINT8 ErrorGranularity; + UINT8 ErrorOperation; + UINT32 VendorSyndrome; + UINT32 MemArrayErrorAddress; + UINT32 DeviceErrorAddress; + UINT32 ErrorResolution; +} SMBIOS_MEMORY_ERROR_INFO; // TYPE 18 +#endif + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_MEM_ARRAY_MAP_ADDR_INFO +// +// Description: Memory Array Mapped Address (Type 19) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT32 StartingAddress; + UINT32 EndingAddress; + UINT16 MemoryArrayHandle; + UINT8 PartitionWidth; + UINT64 ExtendedStartAddr; + UINT64 ExtendedEndAddr; +} SMBIOS_MEM_ARRAY_MAP_ADDR_INFO; // TYPE 19 + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_MEM_DEV_MAP_ADDR_INFO +// +// Description: Memory Device Mapped Address (Type 20) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT32 StartingAddress; + UINT32 EndingAddress; + UINT16 MemoryDeviceHandle; + UINT16 MemoryArrayMapAddrHandle; + UINT8 PartitionRowPosition; + UINT8 InterleavePosition; + UINT8 InterleaveDataDepth; + UINT64 ExtendedStartAddr; + UINT64 ExtendedEndAddr; +} SMBIOS_MEM_DEV_MAP_ADDR_INFO; // TYPE 20 + +#if BUILTIN_POINTING_DEVICE_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_POINTING_DEV_INFO +// +// Description: Built-in Pointing Device (Type 21) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Type; + UINT8 Interface; + UINT8 NumberOfButtons; +} SMBIOS_POINTING_DEV_INFO; // TYPE 21 +#endif + +#if PORTABLE_BATTERY_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_PORTABLE_BATTERY_INFO +// +// Description: Portable Battery (Type 22) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Location; + UINT8 Manufacturer; + UINT8 ManufacturerData; + UINT8 SerialNumber; + UINT8 DeviceName; + UINT8 DeviceChemistry; + UINT16 DesignCapacity; + UINT16 DesignVoltage; + UINT8 SBDSVersion; + UINT8 MaxErrorInBatteryData; + UINT16 SBDSSerialNumber; + UINT16 SBDSManufacturerDate; + UINT8 SBDSDeviceChecmistry; + UINT8 DesignCapabilityMult; + UINT32 OEMSpecific; +} SMBIOS_PORTABLE_BATTERY_INFO; // TYPE 22 +#endif + +#if SYSTEM_RESET_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_SYSTEM_RESET_INFO +// +// Description: System Reset (Type 23) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Capabilities; + UINT16 ResetCount; + UINT16 ResetLimit; + UINT16 TimerInterval; + UINT16 TimeOut; +} SMBIOS_SYSTEM_RESET_INFO; // TYPE 23 +#endif + +#if HARDWARE_SECURITY_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_HARDWARE_SECURITY_INFO +// +// Description: Hardware Security (Type 24) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 HardwareSecSettings; +} SMBIOS_HARDWARE_SECURITY_INFO; // TYPE 24 +#endif + +#if SYSTEM_POWER_CONTROLS_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_SYSTEM_PWR_CONTROL_INFO +// +// Description: System Power Control (Type 25) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 NextSchedulePwrOnMonth; + UINT8 NextSchedulePwrOnDayOfMonth; + UINT8 NextSchedulePwrOnHour; + UINT8 NextSchedulePwrOnMinute; + UINT8 NextSchedulePwrOnSecond; +} SMBIOS_SYSTEM_PWR_CONTROL_INFO; // TYPE 25 +#endif + +#if VOLTAGE_PROBE_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_VOLTAGE_PROBE_INFO +// +// Description: Voltage Probe (Type 26) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Description; + UINT8 LocationAndStatus; + UINT16 MaxValue; + UINT16 MinValue; + UINT16 Resolution; + UINT16 Tolerance; + UINT16 Accuracy; + UINT32 OEMDefine; + UINT16 NorminalValue; +} SMBIOS_VOLTAGE_PROBE_INFO; // TYPE 26 +#endif + +#if COOLING_DEVICE_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_COOLING_DEV_INFO +// +// Description: Cooling Device (Type 27) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT16 TempProbeHandle; + UINT8 DevTypeAndStatus; + UINT8 CoolingUnitGroup; + UINT32 OEMDefine; + UINT16 NorminalSpeed; + UINT8 Description; +} SMBIOS_COOLING_DEV_INFO; // TYPE 27 +#endif + +#if TEMPERATURE_PROBE_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_TEMPERATURE_PROBE_INFO +// +// Description: Temperature Probe (Type 28) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Description; + UINT8 LocationAndStatus; + UINT16 MaxValue; + UINT16 MinValue; + UINT16 Resolution; + UINT16 Tolerance; + UINT16 Accuracy; + UINT32 OEMDefine; + UINT16 NorminalValue; +} SMBIOS_TEMPERATURE_PROBE_INFO; // TYPE 28 +#endif + +#if ELECTRICAL_PROBE_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_ELECT_CURRENT_PROBE_INFO +// +// Description: Electrical Current Probe (Type 29) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Description; + UINT8 LocationAndStatus; + UINT16 MaxValue; + UINT16 MinValue; + UINT16 Resolution; + UINT16 Tolerance; + UINT16 Accuracy; + UINT32 OEMDefine; + UINT16 NorminalValue; +} SMBIOS_ELECT_CURRENT_PROBE_INFO; // TYPE 29 +#endif + +#if OUT_OF_BAND_REMOTE_ACCESS_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_OUT_OF_BAND_REMOTE_ACCESS_INFO +// +// Description: Out-of-Band Remote Access (Type 30) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 ManufacturerName; + UINT8 Connections; +} SMBIOS_OUT_OF_BAND_REMOTE_ACCESS_INFO; // TYPE 30 +#endif + +#if MKF_BIS_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_BIS_ENTRYPOINT_INFO +// +// Description: Boot Integrity Services (BIS) Entry Point (Type 31) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Checksum; + UINT8 Reserved_1; + UINT16 Reserved_2; + UINT32 BISEntrySt; + UINT32 BISEntryTt; + UINT64 Reserved_3; + UINT32 Reserved_4; +} SMBIOS_BIS_ENTRYPOINT_INFO; // TYPE 31 +#endif + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_SYSTEM_BOOT_INFO +// +// Description: System Boot Information (Type 32) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Reserved[6]; + UINT8 BootStatus[10]; +} SMBIOS_SYSTEM_BOOT_INFO; // TYPE 32 + +#if SIXTY_FOURBIT_MEMORY_ERROR_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_SIXTYFOUR_MEM_ERROR_INFO +// +// Description: 64-bit Memory Error Information (Type 33) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 ErrorType; + UINT8 ErrorGranularity; + UINT8 ErrorOperation; + UINT32 VendorSyndrome; + UINT64 MemoryArrayErrAddr; + UINT64 DeviceErrAddr; + UINT32 ErrorResolution; +} SMBIOS_SIXTYFOUR_MEM_ERROR_INFO; // TYPE 33 +#endif + +#if MANAGEMENT_DEVICE_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_MANAGEMENT_DEV_INFO +// +// Description: Management Device (Type 34) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 Description; + UINT8 Type; + UINT32 Address; + UINT8 AddressType; +} SMBIOS_MANAGEMENT_DEV_INFO; // TYPE 34 +#endif + +#if MEMORY_CHANNEL_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: TYPE37_MEMORY_DEVICE +// +// Description: Type 37 Memory Device +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT8 MemDevLoad; + UINT16 MemDevHandle; +} TYPE37_MEMORY_DEVICE; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_MEMORY_CHANNEL_INFO +// +// Description: Memory Channel (Type 37) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 ChannelType; + UINT8 MaxChannelLoad; + UINT8 MemDeviceCount; + TYPE37_MEMORY_DEVICE MemoryDevice[NUMBER_OF_MEMORY_CHANNELS]; +} SMBIOS_MEMORY_CHANNEL_INFO; // TYPE 37 +#endif + +#if IPMI_DEVICE_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_IPMI_DEV_INFO +// +// Description: IPMI Device Information (Type 38) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 InterfaceType; + UINT8 IPMISpecRevision; + UINT8 I2CSlaveAddr; + UINT8 NVStorageDevAddr; + UINT64 BaseAddress; +} SMBIOS_IPMI_DEV_INFO; // TYPE 38 +#endif + +#if SYSTEM_POWER_SUPPLY_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_SYSTEM_PWR_SUPPY_INFO +// +// Description: System Power Supply (Type 39) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 PwrUnitGroup; + UINT8 Location; + UINT8 DeviceName; + UINT8 Manufacturer; + UINT8 SerialNumber; + UINT8 AssetTagNumber; + UINT8 ModelPartNumber; + UINT8 RevisionLevel; + UINT16 MaxPwrCapacity; + UINT16 PwrSupplyChar; + UINT16 InputVoltProbeHandle; + UINT16 CoolingDevHandle; + UINT16 InputCurrentProbeHandle; +} SMBIOS_SYSTEM_PWR_SUPPY_INFO; // TYPE 39 +#endif + +#if ADDITIONAL_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_ADDITIONAL_INFO +// +// Description: System Power Supply (Type 40) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT8 EntryLength; + UINT16 RefHandle; + UINT8 RefOffset; + UINT8 StringNum; + union { + UINT8 Value8; + UINT16 Value16; + UINT32 Value32; + }; +} ADDITIONAL_INFO_ENTRY; + +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 NumAdditionalInfoEntries; + ADDITIONAL_INFO_ENTRY AdditionalEntries[ADDITIONAL_INFO_COUNT]; +} SMBIOS_ADDITIONAL_INFO; // TYPE 40 +#endif + +#if ONBOARD_DEVICE_EXTENDED_INFO +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_ONBOARD_DEVICE_EXTENDED_INFO +// +// Description: Onboard Devices Extended Information (Type 41) +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + SMBIOS_STRUCTURE_HEADER StructureType; + UINT8 RefDesignation; + UINT8 DeviceType; + UINT8 DeviceTypeInstance; + UINT16 SegGroupNumber; + UINT8 BusNumber; + UINT8 DevFuncNumber; +} SMBIOS_ONBOARD_DEV_EXT_INFO; // TYPE 41 +#endif + +typedef struct _JEDEC_MF_ID { + UINT8 VendorId; + CHAR8 *ManufacturerString; +} JEDEC_MF_ID; + +typedef struct { + UINT8 NumContCode; + UINT8 ModuleManufacturer; + UINT8 *Manufacturer; +} JEDEC_DATA; + +//**********************************************************************// +// SMBIOS NVRAM DATA +//**********************************************************************// +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_NVRAM_TYPE +// +// Description: DMI Type X data +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT32 Flag; + CHAR8 *StringSet[32]; +} SMBIOS_NVRAM_TYPE; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_NVRAM_TYPE0 +// +// Description: DMI Type 0 data +// UINT32 Flag; // Bit0 = Vendor string changed +// // Bit1 = BIOS version string changed +// // Bit2 = BIOS Release Date string changed +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT32 Flag; + CHAR8 *StringSet[3]; +} SMBIOS_NVRAM_TYPE0; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_NVRAM_TYPE1 +// +// Description: DMI Type 1 data +// UINT32 Flag; // Bit0 = Manufacturer string changed +// // Bit1 = Product Name string changed +// // Bit2 = Version string changed +// // Bit3 = Serial Number string changed +// // Bit4 = SKU string changed +// // Bit5 = Family string changed +// // Bit16 = UUID changed +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT32 Flag; + CHAR8 *StringSet[6]; + EFI_GUID Uuid; +} SMBIOS_NVRAM_TYPE1; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_NVRAM_TYPE2 +// +// Description: DMI Type 2 data +// UINT32 Flag; // Bit0 = Manufacturer string changed +// // Bit1 = Product Name string changed +// // Bit2 = Version string changed +// // Bit3 = Serial Number string changed +// // Bit4 = Asset Tag string changed +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT32 Flag; + CHAR8 *StringSet[6]; + UINT16 Handle; +} SMBIOS_NVRAM_TYPE2; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_NVRAM_TYPE3 +// +// Description: DMI Type 3 data +// UINT32 Flag; // Bit0 = Manufacturer string changed +// // Bit1 = Version string changed +// // Bit2 = Serial Number string changed +// // Bit3 = Asset Tag string changed +// // Bit4 = SKU Number string changed +// // Bit16 = Chassis Type changed +// // Bit17 = OEM-defined changed +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT32 Flag; + CHAR8 *StringSet[5]; + UINT8 Type; + UINT32 OemDefined; + UINT16 Handle; +} SMBIOS_NVRAM_TYPE3; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_NVRAM_TYPE4 +// +// Description: DMI Type 4 data +// UINT32 Flag; // Bit0 = Serial Number string changed +// // Bit1 = Asset Tag string changed +// // Bit2 = Part Number string changed +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT32 Flag; + CHAR8 *StringSet[6]; +} SMBIOS_NVRAM_TYPE4; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_NVRAM_TYPE11 +// +// Description: DMI Type 11 data +// UINT32 Flag; // Bit(x) = String #(x) changed +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT32 Flag; + CHAR8 *StringSet[32]; +} SMBIOS_NVRAM_TYPE11; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_NVRAM_TYPE12 +// +// Description: DMI Type 12 data +// UINT32 Flag; // Bit(x) = String #(x) changed +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT32 Flag; + CHAR8 *StringSet[32]; +} SMBIOS_NVRAM_TYPE12; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_NVRAM_TYPE22 +// +// Description: DMI Type 22 data +// UINT8 Flag; // Bit0 = Location string changed +// // Bit1 = Manufacturer string changed +// // Bit2 = Manufacturer Date changed +// // Bit3 = Serial Number string changed +// // Bit4 = Device Name string changed +// // Bit5 = SBDS Version Number string changed +// // Bit6 = SBDS Device Chemistry string changed +// // Bit16 = Device Chemistry changed +// // Bit17 = Design Capacity changed +// // Bit18 = Design Voltage changed +// // Bit19 = Maximum Error in Battery Data changed +// // Bit20 = SBDS Serial Number changed +// // Bit21 = SBDS Manufacturer Date changed +// // Bit22 = Design Capacity Multiplier changed +// // Bit23 = OEM-specific changed +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT32 Flag; + CHAR8 *StringSet[7]; + UINT8 DeviceChemistry; + UINT16 DesignCapacity; + UINT16 DesignVoltage; + UINT8 MaxErrorInBatteryData; + UINT16 SbdsSerialNumber; + UINT16 SbdsManufacturerDate; + UINT8 DesignCapacityMultiplier; + UINT32 OemSpecific; + UINT16 Handle; +} SMBIOS_NVRAM_TYPE22; + +//<AMI_SHDR_START> +//---------------------------------------------------------------------------- +// Name: SMBIOS_NVRAM_TYPE39 +// +// Description: DMI Type 39 data +// UINT8 Flag; // Bit0 = Location string changed +// // Bit1 = Device Name string changed +// // Bit2 = Manufacturer string changed +// // Bit3 = Serial Number string changed +// // Bit4 = Asset Tag string changed +// // Bit5 = Model Part Number string changed +// // Bit6 = Revision Level string changed +// // Bit16 = Power Unit Group changed +// // Bit17 = Max Power Capacity changed +// // Bit18 = Power Supply Characteristics changed +// // Bit19 = Input Voltage Probe Handle changed +// // Bit20 = Cooling Device Handle changed +// // Bit21 = Input Current Probe Handle changed +//---------------------------------------------------------------------------- +//<AMI_SHDR_END> +typedef struct { + UINT32 Flag; + CHAR8 *StringSet[7]; + UINT8 PwrUnitGroup; + UINT16 MaxPwrCapacity; + UINT16 PwrSupplyChar; + UINT16 InputVoltageProbeHandle; + UINT16 CoolingDevHandle; + UINT16 InputCurrentProbeHandle; + UINT16 Handle; +} SMBIOS_NVRAM_TYPE39; + +typedef struct { + UINT8 Type; + UINT16 Handle; + UINT8 Offset; + UINT8 Flags; // Bit0 = Write Once + // Bit1 = Delete Structure + // Bit2 = Add structure +} DMI_VAR; + +typedef struct { + UINT8 Offset; + UINT8 SpecStrNum; + UINT8 CurStrValue; +} STRING_TABLE; + +#pragma pack() + +//**********************************************************************// +// SMBIOS Protocol +//**********************************************************************// + +typedef struct _EFI_SMBIOS_PROTOCOL EFI_SMBIOS_PROTOCOL; + +typedef VOID* (EFIAPI *EFI_SMBIOS_GET_TABLE_ENTRY) ( +); + +typedef VOID* (EFIAPI *EFI_SMBIOS_GET_SCRATCH_BUFFER) ( +); + +typedef UINT16 (EFIAPI *EFI_SMBIOS_GET_BUFFER_MAX_SIZE) ( +); + +typedef UINT16 (EFIAPI *EFI_SMBIOS_GET_FREE_HANDLE) ( +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_ADD_STRUCTURE) ( + IN UINT8 *Buffer, + IN UINT16 Size +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_ADD_STRUC_HANDLE) ( + IN UINT16 Handle, + IN UINT8 *Buffer, + IN UINT16 Size +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_DELETE_STRUCTURE) ( + IN UINT16 Handle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_READ_STRUCTURE) ( + IN UINT16 Handle, + IN OUT UINT8 **BufferPtr, + IN OUT UINT16 *BufferSize +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_READ_STRUC_TYPE) ( + IN UINT8 Type, + IN UINT8 Instance, + IN UINT8 **BufferPtr, + IN UINT16 *BufferSize +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_WRITE_STRUCTURE) ( + IN UINT16 Handle, + IN UINT8 *BufferPtr, + IN UINT16 BufferSize +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_UPDATE_HEADER) ( +); + +typedef enum { + ADD_STRUCTURE, + DELETE_STRUCTURE, +} SMBIOS_OPERATION; + +typedef UINT8 EFI_SMBIOS_STRING; +typedef UINT8 EFI_SMBIOS_TYPE; +typedef UINT16 EFI_SMBIOS_HANDLE; + +#if ( defined(SMBIOS_PI_1_1) && (SMBIOS_PI_1_1 == 1) ) + +#define SMBIOS_MAJOR_VERSION 02 +#define SMBIOS_MINOR_VERSION 06 + +#define EFI_SMBIOS_TYPE_BIOS_INFORMATION 0 +#define EFI_SMBIOS_TYPE_SYSTEM_INFORMATION 1 +#define EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION 2 +#define EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE 3 +#define EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION 4 +#define EFI_SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION 5 +#define EFI_SMBIOS_TYPE_MEMORY_MODULE_INFORMATON 6 +#define EFI_SMBIOS_TYPE_CACHE_INFORMATION 7 +#define EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION 8 +#define EFI_SMBIOS_TYPE_SYSTEM_SLOTS 9 +#define EFI_SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION 10 +#define EFI_SMBIOS_TYPE_OEM_STRINGS 11 +#define EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS 12 +#define EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION 13 +#define EFI_SMBIOS_TYPE_GROUP_ASSOCIATIONS 14 +#define EFI_SMBIOS_TYPE_SYSTEM_EVENT_LOG 15 +#define EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY 16 +#define EFI_SMBIOS_TYPE_MEMORY_DEVICE 17 +#define EFI_SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION 18 +#define EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS 19 +#define EFI_SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS 20 +#define EFI_SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE 21 +#define EFI_SMBIOS_TYPE_PORTABLE_BATTERY 22 +#define EFI_SMBIOS_TYPE_SYSTEM_RESET 23 +#define EFI_SMBIOS_TYPE_HARDWARE_SECURITY 24 +#define EFI_SMBIOS_TYPE_SYSTEM_POWER_CONTROLS 25 +#define EFI_SMBIOS_TYPE_VOLTAGE_PROBE 26 +#define EFI_SMBIOS_TYPE_COOLING_DEVICE 27 +#define EFI_SMBIOS_TYPE_TEMPERATURE_PROBE 28 +#define EFI_SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE 29 +#define EFI_SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS 30 +#define EFI_SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE 31 +#define EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION 32 +#define EFI_SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION 33 +#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE 34 +#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT 35 +#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA 36 +#define EFI_SMBIOS_TYPE_MEMORY_CHANNEL 37 +#define EFI_SMBIOS_TYPE_IPMI_DEVICE_INFORMATION 38 +#define EFI_SMBIOS_TYPE_SYSTEM_POWER_SUPPLY 39 +#define EFI_SMBIOS_TYPE_INACTIVE 126 +#define EFI_SMBIOS_TYPE_END_OF_TABLE 127 +#define EFI_SMBIOS_OEM_BEGIN 128 +#define EFI_SMBIOS_OEM_END 255 + +#pragma pack(1) + +typedef struct { + EFI_SMBIOS_TYPE Type; + UINT8 Length; + EFI_SMBIOS_HANDLE Handle; +} EFI_SMBIOS_TABLE_HEADER; + +#define PRODUCER_HANDLE_ELEMENTS 200 +typedef struct { + EFI_SMBIOS_HANDLE SmbiosHandle; + EFI_HANDLE ProducerHandle; +} EFI_PRODUCER_HANDLE; + +#pragma pack() + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_ADD) ( + IN CONST EFI_SMBIOS_PROTOCOL *This, + IN EFI_HANDLE ProducerHandle, OPTIONAL + IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle, + IN EFI_SMBIOS_TABLE_HEADER *Record +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_UPDATE_STRING) ( + IN CONST EFI_SMBIOS_PROTOCOL *This, + IN EFI_SMBIOS_HANDLE *SmbiosHandle, + IN UINTN *StringNumber, + IN CHAR8 *String +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_REMOVE) ( + IN CONST EFI_SMBIOS_PROTOCOL *This, + IN UINTN SmbiosHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_GET_NEXT) ( + IN CONST EFI_SMBIOS_PROTOCOL *This, + IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle, + IN EFI_SMBIOS_TYPE *Type, OPTIONAL + OUT EFI_SMBIOS_TABLE_HEADER **Record, + OUT EFI_HANDLE *ProducerHandle OPTIONAL +); +#endif // End of SMBIOS_PI_1_1 == 1 + +typedef struct _EFI_SMBIOS_PROTOCOL { +#if ( defined(SMBIOS_PI_1_1) && (SMBIOS_PI_1_1 == 1) ) + EFI_SMBIOS_ADD Add; + EFI_SMBIOS_UPDATE_STRING UpdateString; + EFI_SMBIOS_REMOVE Remove; + EFI_SMBIOS_GET_NEXT GetNext; + UINT8 MajorVersion; + UINT8 MinorVersion; +#endif // End of SMBIOS_PI_1_1 == 1 + EFI_SMBIOS_GET_TABLE_ENTRY SmbiosGetTableEntryPoint; // SMBIOS Table Entry Point + EFI_SMBIOS_GET_SCRATCH_BUFFER SmbiosGetScratchBufferPtr; // Scratch Buffer of maximum table size + EFI_SMBIOS_GET_BUFFER_MAX_SIZE SmbiosGetBufferMaxSize; // Maximum SMBIOS Table Size + EFI_SMBIOS_GET_FREE_HANDLE SmbiosGetFreeHandle; // Get available free handle + EFI_SMBIOS_ADD_STRUCTURE SmbiosAddStructure; // Add structure + EFI_SMBIOS_ADD_STRUC_HANDLE SmbiosAddStrucByHandle; // Add structure + EFI_SMBIOS_DELETE_STRUCTURE SmbiosDeleteStructure; // Delete structure (by handle) + EFI_SMBIOS_READ_STRUCTURE SmbiosReadStructure; // Read structure. Caller is responsible + // for deallocating the memory + EFI_SMBIOS_READ_STRUC_TYPE SmbiosReadStrucByType; // Read structure by type. Caller is + // responsible for deallocating the memory + EFI_SMBIOS_WRITE_STRUCTURE SmbiosWriteStructure; // Write structure + EFI_SMBIOS_UPDATE_HEADER SmbiosUpdateHeader; // Update SMBIOS Table Header +}; + +//**********************************************************************// +// SMBIOS Functions +//**********************************************************************// + +VOID* +GetSmbiosTableEntryPoint( +); + +VOID* +GetScratchBufferPtr( +); + +UINT16 +GetBufferMaxSize( +); + +UINT16 +GetFreeHandle( +); + +EFI_STATUS +AddStructure( + IN UINT8 *Buffer, + IN UINT16 Size +); + +EFI_STATUS +AddStructureByHandle( + IN UINT16 Handle, + IN UINT8 *Buffer, + IN UINT16 Size +); + +EFI_STATUS +DeleteStructureByHandle( + IN UINT16 Handle +); + +EFI_STATUS +ReadStructureByHandle( + IN UINT16 Handle, + IN OUT UINT8 **BufferPtr, + IN OUT UINT16 *BufferSize +); + +EFI_STATUS +ReadStructureByType( + IN UINT8 Type, + IN UINT8 Instance, + IN OUT UINT8 **BufferPtr, + IN OUT UINT16 *BufferSize +); + +EFI_STATUS +WriteStructureByHandle( + IN UINT16 Handle, + IN UINT8 *BufferPtr, + IN UINT16 BufferSize +); + +EFI_STATUS +UpdateSmbiosTableHeader( +); + +UINT16 +GetStructureLength( + IN UINT8 *BufferStart +); + +BOOLEAN +FindStructureHandle( + IN OUT UINT8 **Buffer, + IN UINT16 Handle +); + +EFI_STATUS +ReplaceString( + IN UINT8 *DestStructPtr, + IN UINT8 StringNum, + IN UINT8 *StringData +); + +VOID +ClearStringNumber ( + IN STRING_TABLE *StringTablePtr, + IN UINT8 Index +); + +#if ( defined(SMBIOS_PI_1_1) && (SMBIOS_PI_1_1 == 1) ) +EFI_STATUS +SmbiosPiAddStructure ( + IN CONST EFI_SMBIOS_PROTOCOL *This, + IN EFI_HANDLE ProducerHandle, OPTIONAL + IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle, + IN EFI_SMBIOS_TABLE_HEADER *Record +); + +EFI_STATUS +SmbiosPiUpdateString ( + IN CONST EFI_SMBIOS_PROTOCOL *This, + IN EFI_SMBIOS_HANDLE *SmbiosHandle, + IN UINTN *StringNumber, + IN CHAR8 *String +); + +EFI_STATUS +SmbiosPiRemoveStructure ( + IN CONST EFI_SMBIOS_PROTOCOL *This, + IN UINTN SmbiosHandle +); + +EFI_STATUS +SmbiosPiGetNextStructure ( + IN CONST EFI_SMBIOS_PROTOCOL *This, + IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle, + IN EFI_SMBIOS_TYPE *Type, OPTIONAL + OUT EFI_SMBIOS_TABLE_HEADER **Record, + OUT EFI_HANDLE *ProducerHandle OPTIONAL +); +#endif // End of SMBIOS_PI_1_1 == 1 + +#endif // _Smbios_DRIVER_H + +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2016, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// diff --git a/Include/Protocol/SMIFlashProtocols.CIF b/Include/Protocol/SMIFlashProtocols.CIF new file mode 100644 index 0000000..99d7a96 --- /dev/null +++ b/Include/Protocol/SMIFlashProtocols.CIF @@ -0,0 +1,8 @@ +<component> + name = "SMIFlash Protocols" + category = ModulePart + LocalRoot = "INCLUDE\Protocol" + RefName = "SMIFlashProtocols" +[files] +"smiflash.h" = "protocols" +<endComponent> diff --git a/Include/Protocol/SbHpet.h b/Include/Protocol/SbHpet.h new file mode 100644 index 0000000..bd8f2cc --- /dev/null +++ b/Include/Protocol/SbHpet.h @@ -0,0 +1,238 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SbHpet.h 1 11/19/13 7:27a Barretlin $ +// +// $Revision: 1 $ +// +// $Date: 11/19/13 7:27a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SbHpet.h $ +// +// 1 11/19/13 7:27a Barretlin +// [TAG] EIP141917 +// [Category] New Feature +// [Description] Support SetTimer() with HPET Timer on Lynx Point +// [Files] SB.sdl SBGeneric.c SBDxe.c SbHpet.h SamrtTimer.sdl +// +// 6 1/13/10 2:13p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SbHPET.h +// +// Description: High Precision Event Timer register definitions. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SB_HPET__H__ +#define __SB_HPET__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <Efi.h> + +//---------------------------------------------------------------------------- +// High Precision Event Timer Registers +//---------------------------------------------------------------------------- +// HPET General Register Offsets +#define HPET_GENERAL_CAPABILITIES_ID_OFFSET 0x000 +#define HPET_GENERAL_CONFIGURATION_OFFSET 0x010 +#define HPET_GENERAL_INTERRUPT_STATUS_OFFSET 0x020 +// HPET Timer Register Offsets +#define HPET_MAIN_COUNTER_OFFSET 0x0F0 +#define HPET_TIMER_CONFIGURATION_OFFSET 0x100 +#define HPET_TIMER_COMPARATOR_OFFSET 0x108 +#define HPET_TIMER_MSI_ROUTE_OFFSET 0x110 +// Stride between sets of HPET Timer Registers +#define HPET_TIMER_STRIDE 0x020 + +#pragma pack(push,1) + +// HPET General Capabilities and ID Register +typedef union { + struct { + UINT32 Revision:8; + UINT32 NumberOfTimers:5; + UINT32 CounterSize:1; + UINT32 Reserved0:1; + UINT32 LegacyRoute:1; + UINT32 VendorId:16; + UINT32 CounterClockPeriod:32; + } Bits; + UINT64 Uint64; +} HPET_GENERAL_CAPABILITIES_ID_REGISTER; + +// HPET General Configuration Register +typedef union { + struct { + UINT32 MainCounterEnable:1; + UINT32 LegacyRouteEnable:1; + UINT32 Reserved0:30; + UINT32 Reserved1:32; + } Bits; + UINT64 Uint64; +} HPET_GENERAL_CONFIGURATION_REGISTER; + +// HPET General Interrupt Status Register +typedef union { + struct { + UINT32 Timer0InterruptActive:1; + UINT32 Timer1InterruptActive:1; + UINT32 Timer2InterruptActive:1; + UINT32 Reserved0:29; + UINT32 Reserved1:32; + } Bits; + UINT64 Uint64; +} HPET_GENERAL_INTERRUPT_STATUS_REGISTER; + +// HPET Timer Configuration Register +typedef union { + struct { + UINT32 Reserved0:1; + UINT32 LevelTriggeredInterrupt:1; + UINT32 InterruptEnable:1; + UINT32 PeriodicInterruptEnable:1; + UINT32 PeriodicInterruptCapablity:1; + UINT32 CounterSizeCapablity:1; + UINT32 ValueSetEnable:1; + UINT32 Reserved1:1; + UINT32 CounterSizeEnable:1; + UINT32 InterruptRoute:5; + UINT32 MsiInterruptEnable:1; + UINT32 MsiInterruptCapablity:1; + UINT32 Reserved2:16; + UINT32 InterruptRouteCapability; + } Bits; + UINT64 Uint64; +} HPET_TIMER_CONFIGURATION_REGISTER; + +// HPET Timer MSI Route Register +typedef union { + struct { + UINT32 Value:32; + UINT32 Address:32; + } Bits; + UINT64 Uint64; +} HPET_TIMER_MSI_ROUTE_REGISTER; + +#if defined(HPET_APIC_INTERRUPT_MODE) && (HPET_APIC_INTERRUPT_MODE != 0) +//------------------------- +// HPET APIC Support +//------------------------- +#define IO_APIC_REDIR_TABLE_LOW 0x10 // Reditection Table Low 32 bits. +#define IO_APIC_REDIR_TABLE_HIGH 0x11 // Reditection Table High 32 bits. + +#define APIC_EOI_REGISTER 0xB0 +#define APIC_PPR_REGISTER 0xA0 +#define APIC_APR_REGISTER 0x90 +#define APIC_ISR_REGISTER 0x100 +#define ISR_REG(v) (APIC_ISR_REGISTER + (v / 32) * 0x10) +#define ISR_BIT(v) (UINT32) (1 << (v % 32)) + +struct IO_APIC { + UINT8 Index; + UINT8 Unused[3]; + UINT32 Unused1[3]; + UINT32 Data; + UINT32 Unused2[11]; + UINT32 Eoi; +}; + +typedef struct { + UINT32 Vector : 8, + DeliveryMode : 3, + DestMode : 1, + DeliveryStatus : 1, + Polarity : 1, + Irr : 1, + Trigger : 1, + Mask : 1, + __Reserved_2 : 15; + + UINT32 __Reserved_3 : 24, + Dest : 8; +} IO_APIC_ROUTE_ENTRY; + +union ENTRY_UNION { + struct { UINT32 W1, W2; }; + IO_APIC_ROUTE_ENTRY Entry; +}; + +//--------------------------------------------------------------------------- +struct IO_APIC* IoApicBase( VOID ); + +EFI_STATUS IoApicWrite ( + IN UINT8 Reg, + IN UINT32 Value +); + +UINT32 IoApicRead( + IN UINT8 Reg +); + +EFI_STATUS IoApicEnableIrq ( + IN UINT8 Irq, + IN BOOLEAN LevelTriggered, + IN BOOLEAN Polarity +); + +EFI_STATUS +IoApicDisableIrq ( + IN UINT8 Irq + ); + +EFI_STATUS IoApicEoi ( + IN UINT8 Irq +); + +EFI_STATUS IoApicMaskIrq ( + IN UINT8 Irq +); + +EFI_STATUS IoApicUnmaskIrq ( + IN UINT8 Irq +); + +UINT8 GetHpetApicPin ( VOID ); + +BOOLEAN IsHpetApicEnable ( VOID ); + +#endif + +#pragma pack(pop) + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/ScsiPassThruExt.h b/Include/Protocol/ScsiPassThruExt.h new file mode 100644 index 0000000..8bd32f9 --- /dev/null +++ b/Include/Protocol/ScsiPassThruExt.h @@ -0,0 +1,212 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Include/Protocol/ScsiPassThruExt.h 1 8/16/12 5:00a Rajeshms $ +// +// $Revision: 1 $ +// +// $Date: 8/16/12 5:00a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/ScsiPassThruExt.h $ +// +// 1 8/16/12 5:00a Rajeshms +// [TAG] EIP97048 +// [Category] New Feature +// [Description] ATAPI PassThru Support using +// EFI_EXT_SCSI_PASS_THRU_PROTOCOL. +// [Files] AhciBus.c, AhciController.c, IdeBus.c, Atapi.c, PIDEBus.h, +// PAhciBus.h, ScsiPassThruAtapi.sdl, ScsiPassThruAtapi.mak, +// ScsiPassThruAtapi.c, ScsiPassThruAtapiSupport.h, ScsiPassThruAtapi.chm, +// ScsiPassThruExt.h +// +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: ScsiPassThruExt.h +// +// Description: +// EFI_EXT_SCSI_PASS_THRU_PROTOCOL definition file. +// +//<AMI_FHDR_END> +//************************************************************************* + +#ifndef __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__ +#define __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID \ + { \ + 0x143b7632, 0xb81b, 0x4cb7, {0xab, 0xd3, 0xb6, 0x25, 0xa5, 0xb9, 0xbf, 0xfe } \ + } + +GUID_VARIABLE_DECLARATION(gEfiExtScsiPassThruProtocolGuid, EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID); + +typedef struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL EFI_EXT_SCSI_PASS_THRU_PROTOCOL; + +#define TARGET_MAX_BYTES 0x10 + +#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001 +#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002 +#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004 + +// +// DataDirection +// +#define EFI_EXT_SCSI_DATA_DIRECTION_READ 0 +#define EFI_EXT_SCSI_DATA_DIRECTION_WRITE 1 +#define EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL 2 +// +// HostAdapterStatus +// +#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OK 0x00 +#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND 0x09 +#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT 0x0b +#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_MESSAGE_REJECT 0x0d +#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_RESET 0x0e +#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PARITY_ERROR 0x0f +#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED 0x10 +#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT 0x11 +#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN 0x12 +#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_FREE 0x13 +#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR 0x14 +#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OTHER 0x7f +// +// TargetStatus +// +#define EFI_EXT_SCSI_STATUS_TARGET_GOOD 0x00 +#define EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION 0x02 +#define EFI_EXT_SCSI_STATUS_TARGET_CONDITION_MET 0x04 +#define EFI_EXT_SCSI_STATUS_TARGET_BUSY 0x08 +#define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE 0x10 +#define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE_CONDITION_MET 0x14 +#define EFI_EXT_SCSI_STATUS_TARGET_RESERVATION_CONFLICT 0x18 +#define EFI_EXT_SCSI_STATUS_TARGET_TASK_SET_FULL 0x28 +#define EFI_EXT_SCSI_STATUS_TARGET_ACA_ACTIVE 0x30 +#define EFI_EXT_SCSI_STATUS_TARGET_TASK_ABORTED 0x40 + +typedef struct { + UINT32 AdapterId; + UINT32 Attributes; + UINT32 IoAlign; +} EFI_EXT_SCSI_PASS_THRU_MODE; + +typedef struct { + UINT64 Timeout; + VOID *InDataBuffer; + VOID *OutDataBuffer; + VOID *SenseData; + VOID *Cdb; + UINT32 InTransferLength; + UINT32 OutTransferLength; + UINT8 CdbLength; + UINT8 DataDirection; + UINT8 HostAdapterStatus; + UINT8 TargetStatus; + UINT8 SenseDataLength; +} EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET; + +typedef +EFI_STATUS +(EFIAPI *EFI_EXT_SCSI_PASS_THRU_PASSTHRU) ( + IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, + IN UINT8 *Target, + IN UINT64 Lun, + IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet, + IN EFI_EVENT Event OPTIONAL +); + +typedef +EFI_STATUS +(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN) ( + IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, + IN OUT UINT8 **Target, + IN OUT UINT64 *Lun +); + +typedef +EFI_STATUS +(EFIAPI *EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH) ( + IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, + IN UINT8 *Target, + IN UINT64 Lun, + IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath +); + +typedef +EFI_STATUS +(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN) ( + IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, + OUT UINT8 **Target, + OUT UINT64 *Lun +); + +typedef +EFI_STATUS +(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL) ( + IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This +); + +typedef +EFI_STATUS +(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN) ( + IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, + IN UINT8 *Target, + IN UINT64 Lun +); + +typedef +EFI_STATUS +(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET) ( + IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, + IN OUT UINT8 **Target +); + +struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL { + EFI_EXT_SCSI_PASS_THRU_MODE *Mode; + EFI_EXT_SCSI_PASS_THRU_PASSTHRU PassThru; + EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN GetNextTargetLun; + EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath; + EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN GetTargetLun; + EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL ResetChannel; + EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN ResetTargetLun; + EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET GetNextTarget; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SecSMIFlashProtocols.CIF b/Include/Protocol/SecSMIFlashProtocols.CIF new file mode 100644 index 0000000..3c06e9b --- /dev/null +++ b/Include/Protocol/SecSMIFlashProtocols.CIF @@ -0,0 +1,8 @@ +<component> + name = "SecSMIFlash Protocols" + category = ModulePart + LocalRoot = "INCLUDE\Protocol" + RefName = "SecSMIFlashProtocols" +[files] +"SecSmiFlash.h" = "Protocols" +<endComponent> diff --git a/Include/Protocol/SecSmiFlash.h b/Include/Protocol/SecSmiFlash.h new file mode 100644 index 0000000..4c8d7bc --- /dev/null +++ b/Include/Protocol/SecSmiFlash.h @@ -0,0 +1,165 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2014, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SecureFlashPkg/SecureSmiFlash/SecSmiFlash.h 8 3/18/14 3:10p Alexp $ +// +// $Revision: 8 $ +// +// $Date: 3/18/14 3:10p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SecureFlashPkg/SecureSmiFlash/SecSmiFlash.h $ +// +// 8 3/18/14 3:10p Alexp +// change year to 2014 in ftr & hdr +// +// 7 6/12/13 3:53p Alexp +// CapsuleValidate() made external function in SecSmiFlash API +// +// 6 5/18/12 3:55p Alexp +// Add pointer to local copy of *RomLayout table inside Sec Smi Flash +// Protocol table +// +// 5 2/03/12 2:41p Alexp +// Use SHA256 Hash for Hash table +// +// 4 1/18/12 5:39p Alexp +// add defines SEC_FLASH_HASH_TBL_BLOCK_COUNT/SEC_FLASH_HASH_TBL_SIZE +// +// 3 1/13/12 4:29p Alexp +// cleaned up comments +// +// 2 11/03/11 6:45p Alexp +// define Afu Flash page as SDL token: AFU_FLASH_PAGE_SIZE +// +// 4 5/25/11 8:32p Alexp +// change FSHandle from *UINT32 to UINT32 +// +// 8 4/22/11 4:36p Alexp +// hardwire sw smi codes for Sec SMI. +// +// 6 4/18/11 7:20p Alexp +// change HashTable to Sha1. Temp solution. may remove table as not +// practical +// +// 5 4/13/11 7:09p Alexp +// enhanced Protocol with local poijters to HashTbl, Capsule, FSHandle +// +// 3 4/11/11 2:11p Alexp +// -Revision 12 and upper to support "Installed" field in Flash Info as +// bit mask +// -Add support for new CApsule SigningCert header +// - Replace PKpub with new FW Sign key as a root Platform key to verify +// Capsule Sig with +//********************************************************************** + +#ifndef _EFI_SEC_SMI_FLASH_H_ +#define _EFI_SEC_SMI_FLASH_H_ + +#include <RomLayout.h> +#include <Protocol/Hash.h> +#include <Protocol/AmiDigitalSignature.h> +#include <BaseCryptLib.h> +#include <FlashUpd.h> +#include <Protocol/SmiFlash.h> +#include "AmiCertificate.h" + +// {3BF4AF16-AB7C-4b43-898D-AB26AC5DDC6C} +#define EFI_SEC_SMI_FLASH_GUID \ +{ 0x3bf4af16, 0xab7c, 0x4b43, { 0x89, 0x8d, 0xab, 0x26, 0xac, 0x5d, 0xdc, 0x6c } } + +GUID_VARIABLE_DECLARATION(gSecureSMIFlashProtocolGuid, EFI_SEC_SMI_FLASH_GUID); + +typedef struct _EFI_SEC_SMI_FLASH_PROTOCOL EFI_SEC_SMI_FLASH_PROTOCOL; + +// SMI Flash INFO_BLOCK->Implemented bit mask flags +//typedef enum {SMIflash=0, noSMIflash=1, SecuredSMIflash=2}; +#ifndef SwSmi_LoadFwImage +#define SwSmi_LoadFwImage 0x1D +#define SwSmi_GetFlashPolicy 0x1E +#define SwSmi_SetFlashMethod 0x1F +#endif +// SMI Flash Command API +typedef enum { + SecSMIflash_Load =SwSmi_LoadFwImage, + SecSMIflash_GetPolicy=SwSmi_GetFlashPolicy, + SecSMIflash_SetFlash =SwSmi_SetFlashMethod, + SMIflash_Enable =0x20, + SMIflash_Read =0x21, + SMIflash_Erase =0x22, + SMIflash_Write =0x23, + SMIflash_Disable =0x24, + SMIflash_Info =0x25 +}; + +#define SEC_FLASH_HASH_TBL_BLOCK_COUNT (FLASH_SIZE/FLASH_BLOCK_SIZE) +#define SEC_FLASH_HASH_TBL_SIZE (sizeof(EFI_SHA256_HASH)*SEC_FLASH_HASH_TBL_BLOCK_COUNT) + +typedef struct { + FLASH_UPD_POLICY FlUpdPolicy; + UINT8 PKpub[DEFAULT_RSA_KEY_MODULUS_LEN]; + UINT8 ErrorCode; +} FLASH_POLICY_INFO_BLOCK; + +typedef struct { + AMI_FLASH_UPDATE_BLOCK FlUpdBlock; + UINT8 ErrorCode; + UINT32 FSHandle; +} FUNC_FLASH_SESSION_BLOCK; + +typedef EFI_STATUS (*LOAD_FLASH_IMAGE) ( + IN OUT FUNC_BLOCK *FuncBlock +); + +typedef EFI_STATUS (*GET_FLASH_UPD_POLICY) ( + IN OUT FLASH_POLICY_INFO_BLOCK *InfoBlock +); + +typedef EFI_STATUS (*SET_FLASH_UPD_METHOD) ( + IN OUT FUNC_FLASH_SESSION_BLOCK *InfoBlock +); + +typedef EFI_STATUS (*CAPSULE_VALIDATE) ( + IN OUT UINT8 **pFWCapsule, + IN OUT APTIO_FW_CAPSULE_HEADER **pFWCapsuleHdr +); + +struct _EFI_SEC_SMI_FLASH_PROTOCOL { + LOAD_FLASH_IMAGE LoadFwImage; // SW SMI Port 0x1d + GET_FLASH_UPD_POLICY GetFlUpdPolicy; // SW SMI Port 0x1e + SET_FLASH_UPD_METHOD SetFlUpdMethod; // SW SMI Port 0x1f + CAPSULE_VALIDATE CapsuleValidate; + UINT32 *pFwCapsule; // Local buffer for FwCapsule + ROM_AREA *RomLayout; // Local copy of Rom Layout table + EFI_SHA256_HASH *HashTbl; // ptr to Fw image Hash table + UINT32 FSHandle; // SetFlash Session handle +}; + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2014, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/Security.h b/Include/Protocol/Security.h new file mode 100644 index 0000000..163b757 --- /dev/null +++ b/Include/Protocol/Security.h @@ -0,0 +1,81 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2006, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Security.h 1 4/25/07 9:36a Felixp $ +// +// $Revision: 1 $ +// +// $Date: 4/25/07 9:36a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Security.h $ +// +// 1 4/25/07 9:36a Felixp +// +// 1 5/19/06 11:28p Felixp +// +// 1 3/13/06 1:57a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: <This File Name> +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __ARCH_PROTOCOL_SECURITY__H__ +#define __ARCH_PROTOCOL_SECURITY__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SECURITY_ARCH_PROTOCOL_GUID \ + { 0xA46423E3, 0x4617, 0x49f1, 0xB9, 0xFF, 0xD1, 0xBF, 0xA9, 0x11, 0x58, 0x39 } + +typedef struct _EFI_SECURITY_ARCH_PROTOCOL EFI_SECURITY_ARCH_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SECURITY_FILE_AUTHENTICATION_STATE)( + IN EFI_SECURITY_ARCH_PROTOCOL *This, + IN UINT32 AuthenticationStatus, + IN EFI_DEVICE_PATH_PROTOCOL *File +); + +struct _EFI_SECURITY_ARCH_PROTOCOL { + EFI_SECURITY_FILE_AUTHENTICATION_STATE FileAuthenticationState; +}; + +GUID_VARIABLE_DECLARATION(gEfiSecurityArchProtocolGuid, EFI_SECURITY_ARCH_PROTOCOL_GUID); +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (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/Include/Protocol/Security2.h b/Include/Protocol/Security2.h new file mode 100644 index 0000000..1cd533e --- /dev/null +++ b/Include/Protocol/Security2.h @@ -0,0 +1,80 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Security2.h 1 4/09/12 5:41p Artems $ +// +// $Revision: 1 $ +// +// $Date: 4/09/12 5:41p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Security2.h $ +// +// 1 4/09/12 5:41p Artems +// Initial check-in +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: Security2.h +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __ARCH_PROTOCOL_SECURITY2__H__ +#define __ARCH_PROTOCOL_SECURITY2__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SECURITY2_ARCH_PROTOCOL_GUID \ + { 0x94ab2f58, 0x1438, 0x4ef1, 0x91, 0x52, 0x18, 0x94, 0x1a, 0x3a, 0xe, 0x68 } + +typedef struct _EFI_SECURITY2_ARCH_PROTOCOL EFI_SECURITY2_ARCH_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SECURITY2_FILE_AUTHENTICATION) ( + IN CONST EFI_SECURITY2_ARCH_PROTOCOL *This, + IN CONST EFI_DEVICE_PATH_PROTOCOL *File, + IN VOID *FileBuffer, + IN UINTN FileSize, + IN BOOLEAN BootPolicy +); + +struct _EFI_SECURITY2_ARCH_PROTOCOL { + EFI_SECURITY2_FILE_AUTHENTICATION FileAuthentication; +}; + +GUID_VARIABLE_DECLARATION(gEfiSecurity2ArchProtocolGuid, EFI_SECURITY2_ARCH_PROTOCOL_GUID); +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//*************************************************************************
\ No newline at end of file diff --git a/Include/Protocol/SerialIo.h b/Include/Protocol/SerialIo.h new file mode 100644 index 0000000..457ef53 --- /dev/null +++ b/Include/Protocol/SerialIo.h @@ -0,0 +1,186 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/SerialIo.h 3 3/13/06 1:40a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/SerialIo.h $ +// +// 3 3/13/06 1:40a Felixp +// +// 2 10/26/05 5:08p Ambikas +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 12/02/04 12:07p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SerialIo_h +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SERIAL_IO_PROTOCOL_H__ +#define __SERIAL_IO_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SERIAL_IO_PROTOCOL_GUID \ + {0xbb25cf6f,0xf1D4,0x11d2,0x9a,0x0c,0x00,0x90,0x27,0x3f,0xc1,0xfd} + +GUID_VARIABLE_DECLARATION(gEfiSerialIoProtocolGuid,EFI_SERIAL_IO_PROTOCOL_GUID); + +#define EFI_SERIAL_IO_PROTOCOL_REVISION 0x00010000 + +//******************************************************* +// SERIAL_IO_MODE +//******************************************************* +typedef struct { + UINT32 ControlMask; + // current Attributes + UINT32 Timeout; + UINT64 BaudRate; + UINT32 ReceiveFifoDepth; + UINT32 DataBits; + UINT32 Parity; + UINT32 StopBits; +} SERIAL_IO_MODE; + +//******************************************************* +// EFI_PARITY_TYPE +//******************************************************* +typedef enum { + DefaultParity, + NoParity, + EvenParity, + OddParity, + MarkParity, + SpaceParity +} EFI_PARITY_TYPE; + +//******************************************************* +// EFI_STOP_BITS_TYPE +//******************************************************* +typedef enum { + DefaultStopBits, + OneStopBit, // 1 stop bit + OneFiveStopBits, // 1.5 stop bits + TwoStopBits // 2 stop bits +} EFI_STOP_BITS_TYPE; + + +//******************************************************* +// CONTROL BITS +//******************************************************* +#define EFI_SERIAL_CLEAR_TO_SEND 0x0010 +#define EFI_SERIAL_DATA_SET_READY 0x0020 +#define EFI_SERIAL_RING_INDICATE 0x0040 +#define EFI_SERIAL_CARRIER_DETECT 0x0080 +#define EFI_SERIAL_REQUEST_TO_SEND 0x0002 +#define EFI_SERIAL_DATA_TERMINAL_READY 0x0001 +#define EFI_SERIAL_INPUT_BUFFER_EMPTY 0x0100 +#define EFI_SERIAL_OUTPUT_BUFFER_EMPTY 0x0200 +#define EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE 0x1000 +#define EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE 0x2000 +#define EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE 0x4000 +#define EFI_SERIAL_SOFTWARE_FLOW_CONTROL_ENABLE 0x8000 + + + + + +typedef struct _EFI_SERIAL_IO_PROTOCOL EFI_SERIAL_IO_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SERIAL_RESET) ( + IN EFI_SERIAL_IO_PROTOCOL *This +); + +typedef EFI_STATUS (EFIAPI *EFI_SERIAL_SET_ATTRIBUTES) ( + IN EFI_SERIAL_IO_PROTOCOL *This, + IN UINT64 BaudRate, + IN UINT32 ReceiveFifoDepth, + IN UINT32 Timeout, + IN EFI_PARITY_TYPE Parity, + IN UINT8 DataBits, + IN EFI_STOP_BITS_TYPE StopBits +); + +typedef EFI_STATUS (EFIAPI *EFI_SERIAL_SET_CONTROL_BITS) ( + IN EFI_SERIAL_IO_PROTOCOL *This, + IN UINT32 Control +); + +typedef EFI_STATUS (EFIAPI *EFI_SERIAL_GET_CONTROL_BITS) ( + IN EFI_SERIAL_IO_PROTOCOL *This, + OUT UINT32 *Control +); + +typedef EFI_STATUS (EFIAPI *EFI_SERIAL_WRITE) ( + IN EFI_SERIAL_IO_PROTOCOL *This, + IN OUT UINTN *BufferSize, + IN VOID *Buffer +); + +typedef EFI_STATUS (EFIAPI *EFI_SERIAL_READ) ( + IN EFI_SERIAL_IO_PROTOCOL *This, + IN OUT UINTN *BufferSize, + OUT VOID *Buffer +); + +struct _EFI_SERIAL_IO_PROTOCOL { + UINT32 Revision; + EFI_SERIAL_RESET Reset; + EFI_SERIAL_SET_ATTRIBUTES SetAttributes; + EFI_SERIAL_SET_CONTROL_BITS SetControl; + EFI_SERIAL_GET_CONTROL_BITS GetControl; + EFI_SERIAL_WRITE Write; + EFI_SERIAL_READ Read; + SERIAL_IO_MODE *Mode; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/ServiceBinding.h b/Include/Protocol/ServiceBinding.h new file mode 100644 index 0000000..b28b7b4 --- /dev/null +++ b/Include/Protocol/ServiceBinding.h @@ -0,0 +1,84 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/ServiceBinding.h 1 5/24/12 3:18p Artems $ +// +// $Revision: 1 $ +// +// $Date: 5/24/12 3:18p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/ServiceBinding.h $ +// +// 1 5/24/12 3:18p Artems +// [TAG] EIP N/A +// [Category] Spec Update +// [Severity] Minor +// [Description] Added definition for EFI_SERVICE_BINDING_PROTOCOL +// [Files] ServiceBinding.h +// +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: ServiceBinging.h +// +// Description: EFI_SERVICE_BINDING Protocol Definition. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SERVICE_BINDING_PROTOCOL_H__ +#define __SERVICE_BINDING_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +typedef struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD) ( + IN EFI_SERVICE_BINDING_PROTOCOL *This, + IN OUT EFI_HANDLE *ChildHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD) ( + IN EFI_SERVICE_BINDING_PROTOCOL*This, + IN EFI_HANDLE ChildHandle +); + +struct _EFI_SERVICE_BINDING_PROTOCOL { + EFI_SERVICE_BINDING_CREATE_CHILD CreateChild; + EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/SetupInit.h b/Include/Protocol/SetupInit.h new file mode 100644 index 0000000..018b0f0 --- /dev/null +++ b/Include/Protocol/SetupInit.h @@ -0,0 +1,73 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/SetupInit.h 4 11/23/09 7:07p Felixp $ +// +// $Revision: 4 $ +// +// $Date: 11/23/09 7:07p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/SetupInit.h $ +// +// 4 11/23/09 7:07p Felixp +// The content is removed. The protocol is deprecated. +// +// 3 3/13/06 1:40a Felixp +// +// 2 3/25/05 11:21a Felixp +// +// 1 3/25/05 11:19a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SetupInit.h +// +// Description: SetupInit Protocol +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SETUP_INIT_PROTOCOL_H__ +#define __SETUP_INIT_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#if !defined(GUID_VARIABLE_DEFINITION) +#pragma message("The SETUP_INIT_INTERFACE protocol is depricated.") +#pragma message("Use LoadResources library function instead.") +#if EFI_SPECIFICATION_VERSION>0x20000 +#error the protocol is depricated +#endif +#endif +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/SimpleFileSystem.h b/Include/Protocol/SimpleFileSystem.h new file mode 100644 index 0000000..fcc9743 --- /dev/null +++ b/Include/Protocol/SimpleFileSystem.h @@ -0,0 +1,247 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy , Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/SimpleFileSystem.h 6 1/27/10 1:36p Aaronp $ +// +// $Revision: 6 $ +// +// $Date: 1/27/10 1:36p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/SimpleFileSystem.h $ +// +// 6 1/27/10 1:36p Aaronp +// Updated comments and formatting. +// +// 5 3/13/06 1:40a Felixp +// +// 4 3/16/05 3:48p Felixp +// +// 3 3/16/05 2:46p Felixp +// +// 2 3/04/05 10:37a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 5 7/20/04 7:10p Yakovlevs +// +// 4 7/20/04 7:06p Yakovlevs +// +// 3 3/25/04 4:53p Felixp +// +// 2 3/19/04 12:23a Felixp +// +// 1 3/19/04 12:17a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SimpleFileSystem.h +// +// Description: EFI_SIMPLE_FILE_SYSTEM Protocol Definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SIMPLE_FILE_SYSTEM_PROTOCOL_H__ +#define __SIMPLE_FILE_SYSTEM_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ + { 0x964e5b22,0x6459,0x11d2,0x8e,0x39,0x0,0xa0,0xc9,0x69,0x72,0x3b } + +GUID_VARIABLE_DECLARATION(gEfiSimpleFileSystemProtocolGuid, EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID); + +#define EFI_FILE_PROTOCOL_REVISION 0x00010000 + +typedef struct _EFI_FILE_PROTOCOL EFI_FILE_PROTOCOL; + +// Open Modes used by the EFI_FILE_OPEN function +#define EFI_FILE_MODE_READ 0x0000000000000001 +#define EFI_FILE_MODE_WRITE 0x0000000000000002 +#define EFI_FILE_MODE_CREATE 0x8000000000000000 + +// File Attributes +#define EFI_FILE_READ_ONLY 0x0000000000000001 +#define EFI_FILE_HIDDEN 0x0000000000000002 +#define EFI_FILE_SYSTEM 0x0000000000000004 +#define EFI_FILE_RESERVED 0x0000000000000008 +#define EFI_FILE_DIRECTORY 0x0000000000000010 +#define EFI_FILE_ARCHIVE 0x0000000000000020 +#define EFI_FILE_VALID_ATTR 0x0000000000000037 + +// Opens an existing file, or creates a new file, or open a directory +typedef EFI_STATUS (EFIAPI *EFI_FILE_OPEN) ( + IN EFI_FILE_PROTOCOL *This, + OUT EFI_FILE_PROTOCOL **NewHandle, + IN CHAR16 *FileName, + IN UINT64 OpenMode, + IN UINT64 Attributes +); + +// Closes a file, or direcotry +typedef EFI_STATUS (EFIAPI *EFI_FILE_CLOSE) ( IN EFI_FILE_PROTOCOL *This ); + +// Deletes a file, or directory +typedef EFI_STATUS (EFIAPI *EFI_FILE_DELETE) ( IN EFI_FILE_PROTOCOL *This ); + +// Read out of a file +typedef EFI_STATUS (EFIAPI *EFI_FILE_READ) ( + IN EFI_FILE_PROTOCOL *This, + IN OUT UINTN *BufferSize, + OUT VOID *Buffer +); + +// Writes to a file +typedef EFI_STATUS (EFIAPI *EFI_FILE_WRITE) ( + IN EFI_FILE_PROTOCOL *This, + IN OUT UINTN *BufferSize, + IN VOID *Buffer +); + +// Returns the current position in a file +typedef EFI_STATUS (EFIAPI *EFI_FILE_GET_POSITION) ( + IN EFI_FILE_PROTOCOL *This, + OUT UINT64 *Position +); + +// Sets the current position in a file +typedef EFI_STATUS (EFIAPI *EFI_FILE_SET_POSITION) ( + IN EFI_FILE_PROTOCOL *This, + IN UINT64 Position +); + +#define EFI_FILE_INFO_ID \ + { 0x9576e92,0x6d3f,0x11d2,0x8e,0x39,0x0,0xa0,0xc9,0x69,0x72,0x3b } + +typedef struct { + UINT64 Size; + UINT64 FileSize; + UINT64 PhysicalSize; + EFI_TIME CreateTime; + EFI_TIME LastAccessTime; + EFI_TIME ModificationTime; + UINT64 Attribute; +//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO +//S.Y. +//GetFileInfo was retunring EFI_BUFFER_TOO_SMALL because of this +//!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +//we must take care of this in SimpleFileSystem Driver this is not right definition +//!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + CHAR16 FileName[1]; +//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO +} EFI_FILE_INFO; + +// File Attribute Bits returned by +#define EFI_FILE_READ_ONLY 0x0000000000000001 +#define EFI_FILE_HIDDEN 0x0000000000000002 +#define EFI_FILE_SYSTEM 0x0000000000000004 +#define EFI_FILE_RESERVED 0x0000000000000008 +#define EFI_FILE_DIRECTORY 0x0000000000000010 +#define EFI_FILE_ARCHIVE 0x0000000000000020 +#define EFI_FILE_VALID_ATTR 0x0000000000000037 + +#define EFI_FILE_SYSTEM_INFO_ID \ + { 0x9576e93,0x6d3f,0x11d2,0x8e,0x39,0x0,0xa0,0xc9,0x69,0x72,0x3b } + +typedef struct { + UINT64 Size; + BOOLEAN ReadOnly; + UINT64 VolumeSize; + UINT64 FreeSpace; + UINT32 BlockSize; + CHAR16 VolumeLabel[]; +} EFI_FILE_SYSTEM_INFO; + + +#define EFI_FILE_SYSTEM_VOLUME_LABEL_ID \ + { 0xDB47D7D3,0xFE81,0x11d3,0x9A,0x35,0x00,0x90,0x27,0x3F,0xC1,0x4D } + +typedef struct { + CHAR16 VolumeLabel[]; +} EFI_FILE_SYSTEM_VOLUME_LABEL; + +// Reads the requested file or direcotry info +typedef EFI_STATUS (EFIAPI *EFI_FILE_GET_INFO) ( + IN EFI_FILE_PROTOCOL *This, + IN EFI_GUID *InformationType, + IN OUT UINTN *BufferSize, + OUT VOID *Buffer +); + +// Sets the requested file's info +typedef EFI_STATUS (EFIAPI *EFI_FILE_SET_INFO) ( + IN EFI_FILE_PROTOCOL *This, + IN EFI_GUID *InformationType, + IN UINTN BufferSize, + IN VOID *Buffer +); + +// Flushes all modified information to the device +typedef EFI_STATUS (EFIAPI *EFI_FILE_FLUSH) ( IN EFI_FILE_PROTOCOL *This ); + +struct _EFI_FILE_PROTOCOL { + UINT64 Revision; + EFI_FILE_OPEN Open; + EFI_FILE_CLOSE Close; + EFI_FILE_DELETE Delete; + EFI_FILE_READ Read; + EFI_FILE_WRITE Write; + EFI_FILE_GET_POSITION GetPosition; + EFI_FILE_SET_POSITION SetPosition; + EFI_FILE_GET_INFO GetInfo; + EFI_FILE_SET_INFO SetInfo; + EFI_FILE_FLUSH Flush; +}; + +#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION 0x00010000 + +typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_VOLUME_OPEN) ( + IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This, + OUT EFI_FILE_PROTOCOL **Root +); + +struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL { + UINT64 Revision; + EFI_VOLUME_OPEN OpenVolume; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy , Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/SimplePointer.h b/Include/Protocol/SimplePointer.h new file mode 100644 index 0000000..c8bbc89 --- /dev/null +++ b/Include/Protocol/SimplePointer.h @@ -0,0 +1,108 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/SimplePointer.h 2 3/13/06 1:40a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 3/13/06 1:40a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/SimplePointer.h $ +// +// 2 3/13/06 1:40a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 8/30/04 11:38a Olegi +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SimplePointer.h +// +// Description: SimplePointer protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SIMPLE_POINTER_PROTOCOL_H__ +#define __SIMPLE_POINTER_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SIMPLE_POINTER_PROTOCOL_GUID \ + {0x31878c87,0xb75,0x11d5,0x9a,0x4f,0x0,0x90,0x27,0x3f,0xc1,0x4d} + +GUID_VARIABLE_DECLARATION(gEfiSimplePointerProtocolGuid,EFI_SIMPLE_POINTER_PROTOCOL_GUID); + +// Forward declaration +typedef struct _EFI_SIMPLE_POINTER_PROTOCOL EFI_SIMPLE_POINTER_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SIMPLE_POINTER_RESET) ( + EFI_SIMPLE_POINTER_PROTOCOL *This, + BOOLEAN ExtendedVerification); + +typedef struct { + INT32 RelativeMovementX; + INT32 RelativeMovementY; + INT32 RelativeMovementZ; + BOOLEAN LeftButton; + BOOLEAN RightButton; +} EFI_SIMPLE_POINTER_STATE; + +typedef struct { + UINT64 ResolutionX; + UINT64 ResolutionY; + UINT64 ResolutionZ; + BOOLEAN LeftButton; + BOOLEAN RightButton; +} EFI_SIMPLE_POINTER_MODE; + +typedef EFI_STATUS (EFIAPI *EFI_SIMPLE_POINTER_GET_STATE) ( + EFI_SIMPLE_POINTER_PROTOCOL *This, + EFI_SIMPLE_POINTER_STATE *State); + +typedef struct _EFI_SIMPLE_POINTER_PROTOCOL { + EFI_SIMPLE_POINTER_RESET Reset; + EFI_SIMPLE_POINTER_GET_STATE GetState; + EFI_EVENT WaitForInput; + EFI_SIMPLE_POINTER_MODE *Mode; +} EFI_SIMPLE_POINTER_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, 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/Include/Protocol/SimpleTextIn.h b/Include/Protocol/SimpleTextIn.h new file mode 100644 index 0000000..87b6a30 --- /dev/null +++ b/Include/Protocol/SimpleTextIn.h @@ -0,0 +1,113 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/SimpleTextIn.h 7 7/21/11 3:59p Artems $ +// +// $Revision: 7 $ +// +// $Date: 7/21/11 3:59p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/SimpleTextIn.h $ +// +// 7 7/21/11 3:59p Artems +// EIP 64356: Combine common keyboard definitions in one file +// +// 6 8/21/09 10:19a Felixp +// define GUID_VARIABLE_DECLARATION macro only if it has not been already +// defined. +// +// 5 10/17/07 4:10p Felixp +// Clean up +// +// 3 3/13/06 1:40a Felixp +// +// 2 3/04/05 10:37a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 2 10/11/04 5:56p Olegi +// +// 1 8/30/04 11:38a Olegi +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SimpleTextIn.h +// +// Description: SimpleTextIn protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SIMPLE_TEXT_INPUT_PROTOCOL_H__ +#define __SIMPLE_TEXT_INPUT_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> +#include <KeyboardCommonDefinitions.h> + +#ifndef GUID_VARIABLE_DECLARATION +#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable +#endif + +#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ + {0x387477c1, 0x69c7, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + +GUID_VARIABLE_DECLARATION(gEfiSimpleTextInProtocolGuid,EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID); + +//EFI.h contains forward declaration of EFI_SIMPLE_TEXT_INPUT_PROTOCOL +//typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_INPUT_RESET) ( + EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, + BOOLEAN ExtendedVerification ); + +typedef EFI_STATUS (EFIAPI *EFI_INPUT_READ_KEY) ( + EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, + EFI_INPUT_KEY *Key ); + +typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL { + EFI_INPUT_RESET Reset; + EFI_INPUT_READ_KEY ReadKeyStroke; + EFI_EVENT WaitForKey; +} EFI_SIMPLE_TEXT_INPUT_PROTOCOL; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/SimpleTextInEx.h b/Include/Protocol/SimpleTextInEx.h new file mode 100644 index 0000000..316d321 --- /dev/null +++ b/Include/Protocol/SimpleTextInEx.h @@ -0,0 +1,148 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/SimpleTextInEx.h 11 9/22/11 6:16a Rameshr $ +// +// $Revision: 11 $ +// +// $Date: 9/22/11 6:16a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/SimpleTextInEx.h $ +// +// 11 9/22/11 6:16a Rameshr +// [TAG] EIP63054 +// [Category] New Feature +// [Description] Undo Pervious check-in. +// +// 9 7/21/11 3:58p Artems +// EIP 64356: Combine common keyboard definitions in one file +// +// 8 8/21/09 10:19a Felixp +// define GUID_VARIABLE_DECLARATION macro only if it has not been already +// defined. +// +// 7 3/17/08 4:56p Rameshraju +// Build error resolved. +// +// 6 10/18/07 11:23a Felixp +// +// 5 10/17/07 4:24p Felixp +// +// 4 10/17/07 4:10p Felixp +// Clean up +// +// 2 8/24/07 3:03p Olegi +// +// 1 8/23/07 2:44p Olegi +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SimpleTextInEx.h +// +// Description: SimpleTextInEx protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SIMPLE_TEXT_INPUT_EX_PROTOCOL_H__ +#define __SIMPLE_TEXT_INPUT_EX_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> +#include <KeyboardCommonDefinitions.h> + +#ifndef GUID_VARIABLE_DECLARATION +#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable +#endif + +#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ + {0xdd9e7534, 0x7762, 0x4698, 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa} + +GUID_VARIABLE_DECLARATION(gEfiSimpleTextInExProtocolGuid,EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION + +typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_INPUT_RESET_EX) ( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN BOOLEAN ExtendedVerification +); + + +typedef struct { + EFI_INPUT_KEY Key; + EFI_KEY_STATE KeyState; +} EFI_KEY_DATA; + +typedef EFI_STATUS (EFIAPI *EFI_INPUT_READ_KEY_EX) ( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + OUT EFI_KEY_DATA *KeyData +); + +typedef EFI_STATUS (EFIAPI *EFI_SET_STATE) ( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_KEY_TOGGLE_STATE *KeyToggleState +); + +typedef EFI_STATUS (EFIAPI *EFI_KEY_NOTIFY_FUNCTION) ( + IN EFI_KEY_DATA *KeyData +); + +typedef EFI_STATUS (EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY) ( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_KEY_DATA *KeyData, + IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, + OUT EFI_HANDLE *NotifyHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY) ( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_HANDLE NotificationHandle +); + +typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL { + EFI_INPUT_RESET_EX Reset; + EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx; + EFI_EVENT WaitForKeyEx; + EFI_SET_STATE SetState; + EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify; + EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify; +} EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/SimpleTextOut.h b/Include/Protocol/SimpleTextOut.h new file mode 100644 index 0000000..e4d95ef --- /dev/null +++ b/Include/Protocol/SimpleTextOut.h @@ -0,0 +1,258 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/SimpleTextOut.h 1 3/13/06 1:39a Felixp $ +// +// $Revision: 1 $ +// +// $Date: 3/13/06 1:39a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/SimpleTextOut.h $ +// +// 1 3/13/06 1:39a Felixp +// +// 2 10/26/05 5:08p Ambikas +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 3 12/10/04 4:39p Robert +// Added #pragma pack(1) around the Simple text output mode datastructure +// +// 2 11/08/04 3:15p Robert +// fixed a typedef for the for the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL +// +// 1 11/03/04 9:39p Felixp +// +// 1 9/15/04 5:09p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SimpleTextOut.h +// +// Description: SIMPLE_TEXT_OUTPUT Protocol Definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SIMPLE_TEXT_OUPUT_PROTOCOL_H__ +#define __SIMPLE_TEXT_OUPUT_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \ + {0x387477c2,0x69c7,0x11d2,0x8e,0x39,0x00,0xa0,0xc9,0x69,0x72,0x3b} + +GUID_VARIABLE_DECLARATION(gEfiSimpleTextOutProtocolGuid,EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID); + +//EFI.h contains forward declaration of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL +//typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL; + +//******************************************************* +// SIMPLE_TEXT_OUTPUT_MODE +//******************************************************* + +#pragma pack(1) +typedef struct { + INT32 MaxMode; + INT32 Mode; + INT32 Attribute; + INT32 CursorColumn; + INT32 CursorRow; + BOOLEAN CursorVisible; +} SIMPLE_TEXT_OUTPUT_MODE; + +#pragma pack() +//******************************************************* +// UNICODE DRAWING CHARACTERS +//******************************************************* +#define BOXDRAW_HORIZONTAL 0x2500 +#define BOXDRAW_VERTICAL 0x2502 +#define BOXDRAW_DOWN_RIGHT 0x250c +#define BOXDRAW_DOWN_LEFT 0x2510 +#define BOXDRAW_UP_RIGHT 0x2514 +#define BOXDRAW_UP_LEFT 0x2518 +#define BOXDRAW_VERTICAL_RIGHT 0x251c +#define BOXDRAW_VERTICAL_LEFT 0x2524 +#define BOXDRAW_DOWN_HORIZONTAL 0x252c +#define BOXDRAW_UP_HORIZONTAL 0x2534 +#define BOXDRAW_VERTICAL_HORIZONTAL 0x253c +#define BOXDRAW_DOUBLE_HORIZONTAL 0x2550 +#define BOXDRAW_DOUBLE_VERTICAL 0x2551 +#define BOXDRAW_DOWN_RIGHT_DOUBLE 0x2552 +#define BOXDRAW_DOWN_DOUBLE_RIGHT 0x2553 +#define BOXDRAW_DOUBLE_DOWN_RIGHT 0x2554 +#define BOXDRAW_DOWN_LEFT_DOUBLE 0x2555 +#define BOXDRAW_DOWN_DOUBLE_LEFT 0x2556 +#define BOXDRAW_DOUBLE_DOWN_LEFT 0x2557 +#define BOXDRAW_UP_RIGHT_DOUBLE 0x2558 +#define BOXDRAW_UP_DOUBLE_RIGHT 0x2559 +#define BOXDRAW_DOUBLE_UP_RIGHT 0x255a +#define BOXDRAW_UP_LEFT_DOUBLE 0x255b +#define BOXDRAW_UP_DOUBLE_LEFT 0x255c +#define BOXDRAW_DOUBLE_UP_LEFT 0x255d +#define BOXDRAW_VERTICAL_RIGHT_DOUBLE 0x255e +#define BOXDRAW_VERTICAL_DOUBLE_RIGHT 0x255f +#define BOXDRAW_DOUBLE_VERTICAL_RIGHT 0x2560 +#define BOXDRAW_VERTICAL_LEFT_DOUBLE 0x2561 +#define BOXDRAW_VERTICAL_DOUBLE_LEFT 0x2562 +#define BOXDRAW_DOUBLE_VERTICAL_LEFT 0x2563 +#define BOXDRAW_DOWN_HORIZONTAL_DOUBLE 0x2564 +#define BOXDRAW_DOWN_DOUBLE_HORIZONTAL 0x2565 +#define BOXDRAW_DOUBLE_DOWN_HORIZONTAL 0x2566 +#define BOXDRAW_UP_HORIZONTAL_DOUBLE 0x2567 +#define BOXDRAW_UP_DOUBLE_HORIZONTAL 0x2568 +#define BOXDRAW_DOUBLE_UP_HORIZONTAL 0x2569 +#define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE 0x256a +#define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL 0x256b +#define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL 0x256c +//******************************************************* +// EFI Required Block Elements Code Chart +//******************************************************* +#define BLOCKELEMENT_FULL_BLOCK 0x2588 +#define BLOCKELEMENT_LIGHT_SHADE 0x2591 +//******************************************************* +// EFI Required Geometric Shapes Code Chart +//******************************************************* +#define GEOMETRICSHAPE_UP_TRIANGLE 0x25b2 +#define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba +#define GEOMETRICSHAPE_DOWN_TRIANGLE 0x25bc +#define GEOMETRICSHAPE_LEFT_TRIANGLE 0x25c4 +//******************************************************* +// EFI Required Arrow shapes +//******************************************************* +#define ARROW_LEFT 0x2190 +#define ARROW_UP 0x2191 +#define ARROW_RIGHT 0x2192 +#define ARROW_DOWN 0x2193 +//******************************************************* +// Attributes +//******************************************************* +#define EFI_BLACK 0x00 +#define EFI_BLUE 0x01 +#define EFI_GREEN 0x02 +#define EFI_CYAN 0x03 +#define EFI_RED 0x04 +#define EFI_MAGENTA 0x05 +#define EFI_BROWN 0x06 +#define EFI_LIGHTGRAY 0x07 +#define EFI_BRIGHT 0x08 +#define EFI_DARKGRAY 0x08 +#define EFI_LIGHTBLUE 0x09 +#define EFI_LIGHTGREEN 0x0A +#define EFI_LIGHTCYAN 0x0B +#define EFI_LIGHTRED 0x0C +#define EFI_LIGHTMAGENTA 0x0D +#define EFI_YELLOW 0x0E +#define EFI_WHITE 0x0F +#define EFI_BACKGROUND_BLACK 0x00 +#define EFI_BACKGROUND_BLUE 0x10 +#define EFI_BACKGROUND_GREEN 0x20 +#define EFI_BACKGROUND_CYAN 0x30 +#define EFI_BACKGROUND_RED 0x40 +#define EFI_BACKGROUND_MAGENTA 0x50 +#define EFI_BACKGROUND_BROWN 0x60 +#define EFI_BACKGROUND_LIGHTGRAY 0x70 +#define EFI_TEXT_ATTR(foreground,background) \ + ((foreground) | ((background) << 4)) + + +typedef EFI_STATUS (EFIAPI *EFI_TEXT_RESET) ( + IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, + IN BOOLEAN ExtendedVerification +); + +typedef EFI_STATUS (EFIAPI *EFI_TEXT_STRING) ( + IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, + IN CHAR16 *String +); + +typedef EFI_STATUS (EFIAPI *EFI_TEXT_TEST_STRING) ( + IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, + IN CHAR16 *String +); + +typedef EFI_STATUS (EFIAPI *EFI_TEXT_QUERY_MODE) ( + IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, + IN UINTN ModeNumber, + OUT UINTN *Columns, + OUT UINTN *Rows +); + +typedef EFI_STATUS (* EFIAPI EFI_TEXT_SET_MODE) ( + IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, + IN UINTN ModeNumber +); + +typedef EFI_STATUS (EFIAPI *EFI_TEXT_SET_ATTRIBUTE) ( + IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, + IN UINTN Attribute +); + +typedef EFI_STATUS (EFIAPI *EFI_TEXT_CLEAR_SCREEN) ( + IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This +); + +typedef EFI_STATUS (EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) ( + IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, + IN UINTN Column, + IN UINTN Row +); + +typedef EFI_STATUS (EFIAPI *EFI_TEXT_ENABLE_CURSOR) ( + IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, + IN BOOLEAN Visible +); + + +typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL { + EFI_TEXT_RESET Reset; + EFI_TEXT_STRING OutputString; + EFI_TEXT_TEST_STRING TestString; + EFI_TEXT_QUERY_MODE QueryMode; + EFI_TEXT_SET_MODE SetMode; + EFI_TEXT_SET_ATTRIBUTE SetAttribute; + EFI_TEXT_CLEAR_SCREEN ClearScreen; + EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition; + EFI_TEXT_ENABLE_CURSOR EnableCursor; + SIMPLE_TEXT_OUTPUT_MODE *Mode; + } EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/SmBus.h b/Include/Protocol/SmBus.h new file mode 100644 index 0000000..aa2d349 --- /dev/null +++ b/Include/Protocol/SmBus.h @@ -0,0 +1,140 @@ +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2009, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// +//**********************************************************************// +// $Header: /Alaska/BIN/Core/Include/Protocol/SmBus.h 3 1/16/09 9:51a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 1/16/09 9:51a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/SmBus.h $ +// +// 3 1/16/09 9:51a Felixp +// SM Bus Protocol and PPI headers are updated. Common code moved into +// newly created header file (Include\SmBus.h). +// +// 1 11/07/05 3:40p Sivagarn +// Initial Checkin +// +//***************************************************************************** +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// Name: SmBus.h +// +// Description: This file contains the protocol definitions for Smbus protocol +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> +#ifndef __SMBUS_HC_PROTOCOL_H__ +#define __SMBUS_HC_PROTOCOL_H__ +#include <EFI.h> +#include <SmBus.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_SMBUS_HC_PROTOCOL_GUID \ + {0xe49d33ed, 0x513d, 0x4634, 0xb6, 0x98, 0x6f, 0x55, 0xaa, 0x75, 0x1c, 0x1b} + +GUID_VARIABLE_DECLARATION(gEfiSmbusProtocolGuid,EFI_SMBUS_HC_PROTOCOL_GUID); + +typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL; +typedef struct _EFI_SMBUS_DATA_STRUC SMBUS_DATA_STRUC; + + +//******************************************************* +// EFI_SMBUS_NOTIFY_FUNCTION +//******************************************************* +typedef +EFI_STATUS +(EFIAPI *EFI_SMBUS_NOTIFY_FUNCTION) ( + IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, + IN UINTN Data +); +//******************************************************* +// EFI_SMBUS_HC_EXECUTE_OPERATION +//******************************************************* +typedef +EFI_STATUS +(EFIAPI *EFI_SMBUS_HC_EXECUTE_OPERATION) ( + IN EFI_SMBUS_HC_PROTOCOL *This, + IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, + IN EFI_SMBUS_DEVICE_COMMAND Command, + IN EFI_SMBUS_OPERATION Operation, + IN BOOLEAN PecCheck, + IN OUT UINTN *Length, + IN OUT VOID *Buffer + ); +//******************************************************* +// EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE +//******************************************************* +typedef +EFI_STATUS +(EFIAPI *EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE) ( + IN EFI_SMBUS_HC_PROTOCOL *This, + IN BOOLEAN ArpAll, + IN EFI_SMBUS_UDID *SmbusUdid, OPTIONAL + IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress OPTIONAL +); +//******************************************************* +// EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP +//******************************************************* +typedef +EFI_STATUS +(EFIAPI *EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP) ( + IN EFI_SMBUS_HC_PROTOCOL *This, + IN OUT UINTN *Length, + IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap +); +//******************************************************* +// EFI_SMBUS_HC_PROTOCOL_NOTIFY +//******************************************************* +typedef +EFI_STATUS +(EFIAPI *EFI_SMBUS_HC_PROTOCOL_NOTIFY) ( + IN EFI_SMBUS_HC_PROTOCOL *This, + IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, + IN UINTN Data, + IN EFI_SMBUS_NOTIFY_FUNCTION NotifyFunction +); +//******************************************************* +// EFI_SMBUS_HC_PROTOCOL +//******************************************************* +typedef struct _EFI_SMBUS_HC_PROTOCOL { + EFI_SMBUS_HC_EXECUTE_OPERATION Execute; + EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE ArpDevice; + EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP GetArpMap; + EFI_SMBUS_HC_PROTOCOL_NOTIFY Notify; +}; + +#ifdef __cplusplus +} +#endif +#endif // __SMBUS_CTRL_H__ +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2009, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// diff --git a/Include/Protocol/SmbiosDynamicData.h b/Include/Protocol/SmbiosDynamicData.h new file mode 100644 index 0000000..76bf66e --- /dev/null +++ b/Include/Protocol/SmbiosDynamicData.h @@ -0,0 +1,585 @@ +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2016, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// + +//**********************************************************************// +// $Header: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SmbiosDynamicData.h 33 4/07/16 5:50p Davidd $ +// +// $Revision: 33 $ +// +// $Date: 4/07/16 5:50p $ +//**********************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SmbiosDynamicData.h $ +// +// 33 4/07/16 5:50p Davidd +// [TAG] EIP231162 +// [Category] New Feature +// [Description] Merge Aptio V Smbios -09 changes for Aptio 4 +// 4.6.5.5_SMBIOS_40 release +// [Files] Smbios.sdl +// SmbiosDynamicData.h +// Smbios.h +// SmbiosStaticData.sdl +// SmbiosStaticData.asm +// SmbData.mac +// SmbMacro.aid +// SmbDesc.def +// +// 32 5/29/13 12:47p Davidd +// [TAG] EIP124735 +// [Category] Spec Update +// [Severity] Normal +// [Description] SMBIOS 2.8.0 specification support for Aptio 4 +// [Files] Smb.equ +// Smbdata.mac +// Smbdesc.def +// Smbstruc.def +// Smbios.c +// Smbios.h +// SmbiosDynamicData.h +// +// 31 5/23/13 2:37p Davidd +// [TAG] EIP104836 +// [Category] New Feature +// [Description] DMIEdit support edit type 4 +// [Files] SmbiosBoard.c +// SmbiosDMIEditBoard.sdl +// Smbios.c +// SmbiosDMIEditFunc.c +// Smbios.h +// SmbiosDynamicData.h +// +// 30 6/16/11 12:28p Davidd +// [TAG] EIP61776 +// [Category] Improvement +// [Description] SMBIOS Type 17 "Type Detail" Registered/Unbuffered, +// needs to be dynamically updated +// [Files] Smbios.sdl +// SmbiosDynamicData.h +// Smbios.c +// +// 29 5/04/11 3:34p Davidd +// [TAG] EIP57144 +// [Category] NEW FEATURE +// [Description] Allow SMBIOS Type 39 to be modified using DMIEdit +// [Files] SmbiosBoard.c +// Smbios.h +// SmbiosDynamicData.h +// Smbios.c +// SmbiosDmieditFunc.c +// SmbiosNvramFunc.c +// +// 28 12/08/10 10:57a Davidd +// [TAG] EIP48952 +// [Category] Improvement +// [Description] Customer Request for SMBIOS Type 16 +// MemoryErrorCorrection field to be filled out +// [Files] +// Smbios.c +// SmbiosDynamicData.h +// +// 27 11/19/10 6:19p Davidd +// [TAG] EIP46175 +// [Category] Improvement +// [Description] Redesign SMBIOS to avoid redundant SPD reading +// [Files] +// Smbios.c +// SmbiosDynamicData.h +// +// 26 11/15/10 3:56p Davidd +// [TAG] EIP46175 +// [Category] Improvement +// [Description] Redesign SMBIOS to avoid redundant SPD reading +// [Files] +// Smbios.c +// SmbiosDynamicData.h +// +// 25 11/15/10 2:19p Davidd +// [TAG] EIP46936 +// [Category] Improvement +// [Description] Generic Smbios module should have the support to +// disable SMBIOS memory update +// [Files] +// Smbios.c +// Smbios.sdl +// SmbiosBoard.c +// SmbiosDynamicData.h +// +// 24 10/08/10 8:07p Davidd +// [TAG] EIP43278 +// +// [Category] Function Request +// +// [Severity] Normal +// +// [Description] SMBIOS 2.7 requirement +// +// [Files] Include\Protocol\Smbios.h +// Include\Protocol\SmbiosDynamicData.h +// Board\EM\SMBIOS\SMBiosStaticData\SmbiosStaticData.sdl +// Board\EM\SMBIOS\SMBiosStaticData\SMBDATA.MAC +// Board\EM\SMBIOS\SMBiosStaticData\SMBSTRUC.DEF +// Board\EM\SMBIOS\SMBiosStaticData\SMBMACRO.AID +// Board\EM\SMBIOS\SMBiosStaticData\Smbdesc.def +// Board\EM\SMBIOS\SMBiosStaticData\SMB.EQU +// +// 23 6/02/09 3:52p Davidd +// Updated AMI headers (EIP 22180) +// +// 22 5/19/09 11:01a Davidd +// Changes added to improve memory type 17 porting (EIP 22241). +// +// 21 12/30/08 3:15p Davidd +// Fixed the hanging problem when only SMBIOS binary component is present +// (ref. EIP 18370) +// +// 20 11/14/08 4:42p Davidd +// - Added OemUpdate protocol +// +// 19 10/23/08 6:21p Davidd +// Added changes to support SMBIOS version 2.5 and 2.6. +// +// 18 2/22/08 10:20a Davidd +// Simplified the way the number of memory slots for each physical memory +// array are defined. +// +// 17 2/06/08 3:44p Davidd +// Added NumberOfBatteries field to _EFI_SMBIOS_BOARD_PROTOCOL to hold the +// number of batteries in the system. +// +// 16 2/01/08 11:57a Davidd +// Changes made to support SMBIOS type 17 with multiple memory arrays. +// +// 15 12/17/07 12:20p Davidd +// Added PORTABLE_BATTERY_INFO to EFI_SMBIOS_BOARD_PROTOCOL +// +// 14 11/26/07 5:53p Davidd +// Changes added to dynamically update the Processor Information Type 4. +// +// 13 11/21/07 10:38a Davidd +// Added dynamic data update support for Portable Battery Data structure +// 22. +// +// 12 9/12/07 2:26p Davidd +// Added changes to set memory type and speed to unknown for unoccupied +// memory slot. +// +// 11 6/05/07 4:18p Michaela +// Added AMI_SMBIOS_CPU_INFO_PROTOCOL for dynamic +// updating of CPU information +// +// 10 3/29/07 4:05p Davidd +// Made change to the year in the AMI banner +// +// 9 3/21/07 4:01p Michaela +// Added MemErrInfoHandle field in MEMORY_DEVICE +// structure typedef +// +// 8 12/15/06 1:15p Davidd +// Code cleanup and reformatted to coding standard. +// +// 7 3/02/06 10:35a Davidd +// Commented out fields deemed to be static. +// +// 6 7/27/05 1:25p Davidd +// Removed conditional compilation switches and added them to +// SmbiosBoardProtocol. +// +// 5 7/18/05 6:07p Davidd +// Added protocol definition for creating the dynamic data. +// +// 4 7/13/05 5:35p Davidd +// Added Processor Manufacturer and Processor Version fields. +// +// 3 7/05/05 12:17p Davidd +// Made SMBIOS variables static so that it can be shared in different +// files. +// +// 2 6/21/05 12:08p Davidd +// Corrected build error. +// +// 1 5/02/05 3:23p Davidd +// Initial Check-in. +// +// 1 4/29/05 2:12p Davidd +// Initial checkin. +// +//**********************************************************************// + +#ifndef _SMIBios_Dynamic_H +#define _SMIBios_Dynamic_H + +#include <Token.h> +#include <AmiHobs.h> +#include <Protocol/SmBus.h> + +#if SMBIOS_SUPPORT +#define EFI_SMBIOS_DYNAMIC_DATA_GUID \ + {0xe380280c, 0x4c35, 0x4aa3, { 0xb9, 0x61, 0x7a, 0xe4, 0x89, 0xa2, 0xb9, 0x26 }} + +#define EFI_SMBIOS_BOARD_PROTOCOL_GUID \ + {0x903dd14, 0x2ca0, 0x458a, 0xb5, 0xeb, 0xc, 0xc, 0xa3, 0xd, 0x78, 0x5c} + +#define EFI_MEMORY_SUBCLASS_DRIVER_GUID \ + { 0x1767CEED, 0xDB82, 0x47cd, 0xBF, 0x2B, 0x68, 0x45, 0x8A, 0x8C, 0xCF, 0xFF } + +#define EFI_MEMORY_SUBCLASS_GUID \ + {0x4E8F4EBB, 0x64B9, 0x4e05, 0x9B, 0x18, 0x4C, 0xFE, 0x49, 0x23, 0x50, 0x97} + +// {3D6CDB0A-5B1F-43a3-A43B-441267F9DAB5} +#define AMI_SMBIOS_CPU_INFO_PROTOCOL_GUID \ + {0x3d6cdb0a, 0x5b1f, 0x43a3, 0xa4, 0x3b, 0x44, 0x12, 0x67, 0xf9, 0xda, 0xb5} + +#define MAX_NUMBER_OF_MEM_MODULE A1_MEMORY_SOCKETS +#if NO_OF_PHYSICAL_MEMORY_ARRAY >= 2 + #if A2_MEMORY_SOCKETS > MAX_NUMBER_OF_MEM_MODULE + #undef MAX_NUMBER_OF_MEM_MODULE + #define MAX_NUMBER_OF_MEM_MODULE A2_MEMORY_SOCKETS + #endif +#endif +#if NO_OF_PHYSICAL_MEMORY_ARRAY >= 3 + #if A3_MEMORY_SOCKETS > MAX_NUMBER_OF_MEM_MODULE + #undef MAX_NUMBER_OF_MEM_MODULE + #define MAX_NUMBER_OF_MEM_MODULE A3_MEMORY_SOCKETS + #endif +#endif +#if NO_OF_PHYSICAL_MEMORY_ARRAY == 4 + #if A4_MEMORY_SOCKETS > MAX_NUMBER_OF_MEM_MODULE + #undef MAX_NUMBER_OF_MEM_MODULE + #define MAX_NUMBER_OF_MEM_MODULE A4_MEMORY_SOCKETS + #endif +#endif + +static CHAR16 *SmbiosBaseBoardVar = L"BASEBOARD DATA"; +static CHAR16 *SmbiosChassisVar = L"CHASSIS DATA"; +static CHAR16 *SmbiosCpuVar = L"CPU DATA"; +static CHAR16 *SmbiosSlotsVar = L"SLOTS DATA"; +static CHAR16 *SmbiosOnBoardVar = L"ONBOARD DEV DATA"; +static CHAR16 *SmbiosMemVar = L"MEMORY DATA"; +static CHAR16 *SmbiosBatteryVar = L"BATTERY DATA"; +static CHAR16 *SmbiosOnBoardExtVar = L"ONBOARD DEV EXTENDED DATA"; + +#pragma pack(1) + +//**********************************************************************// +// Base Board Structure +//**********************************************************************// +#if BASE_BOARD_INFO +typedef struct { // Type 2 + CHAR8 *BoardManufacturer; + CHAR8 *BoardName; +} BASE_BOARD_DATA; +#endif //BASE_BOARD_INFO + +//**********************************************************************// +// Chassis Structure +//**********************************************************************// +#if SYS_CHASSIS_INFO +typedef struct { // Type 3 + UINT8 Type; +} CHASSIS_DATA; +#endif //SYS_CHASSIS_INFO + +//**********************************************************************// +// CPU Structure +//**********************************************************************// + +typedef struct { // Type 4 + UINT8 Family; // 3.3.5.2 + UINT32 ProcessorID_1; // 3.3.5.3 - 1st DWORD + UINT32 ProcessorID_2; // 3.3.5.3 - 2nd DWORD + UINT8 Voltage; // 3.3.5.4 + UINT16 ExtClockFreq; // in MHz + UINT16 MaxSpeed; // in MHz + UINT16 CurrentSpeed; // in MHz + UINT8 Status; // pg 43 + UINT8 Upgrade; // 3.3.5.5 + UINT8 Manufacturer[18]; + UINT8 Version[48]; + UINT8 CoreCount; // 3.3.5.6 + UINT8 CoreEnabled; // 3.3.5.7 + UINT8 ThreadCount; // 3.3.5.8 + UINT16 Family2; // 3.3.5.2 +} CPU_DATA; + +typedef struct { // Type 7 + UINT16 CacheConfig; // pg 52 + UINT16 MaxCacheSize; // pg 52 + UINT16 InstalledSize; // pg 52 + UINT16 SupportSRAM; // 3.3.8.1 + UINT16 CurrentSRAM; // 3.3.8.1 + UINT8 CacheSpeed; // in nS + UINT8 ErrorCorrectionType; // 3.3.8.2 + UINT8 SystemCacheType; // 3.3.8.3 + UINT8 Associativity; // 3.3.8.4 +} CACHE_DATA; + +typedef struct { // One for each CPU + CPU_DATA CpuData; + CACHE_DATA L1Cache; + CACHE_DATA L2Cache; + CACHE_DATA L3Cache; +} SINGLE_CPU_DATA; + +typedef struct { // CPU data structure + UINT8 NumberCPU; + SINGLE_CPU_DATA CpuData[NO_OF_PROCESSOR_SOCKETS]; +} CPU_DYNAMIC_DATA; + +typedef CPU_DYNAMIC_DATA SMBIOS_CPU_INFO_PROTOCOL; + +//**********************************************************************// +// Slot Structure +//**********************************************************************// + +typedef struct { // Type 9 + UINT8 CurrentUsage[NUMBER_OF_SYSTEM_SLOTS]; // 3.3.10.3 + UINT8 BusNumber[NUMBER_OF_SYSTEM_SLOTS]; +} SYSTEM_SLOT_DYNAMIC_DATA; + +//**********************************************************************// +// On-Board Device Structure +//**********************************************************************// + +#if ONBOARD_DEVICE_INFO +typedef struct { // Type 10 + UINT8 OnBoardDev[NUMBER_OF_ONBOARD_DEVICES]; // 3.3.11.1 +} ONBOARD_DEV_DYNAMIC_DATA; +#endif + +//**********************************************************************// +// Memory Structure +//**********************************************************************// + +typedef struct { // Type 18 + UINT8 ErrorType; // 3.3.19.1 + UINT8 ErrorGranularity; // 3.3.19.2 + UINT8 ErrorOperation; // 3.3.19.3 + UINT32 MemArrayErrorAddress; // 32-bit physical address (8000 0000h if unknown) + UINT32 DeviceErrorAddress; // 32-bit physical address (8000 0000h if unknown) + UINT32 ErrorResolution; // in bytes +} MEM_ERROR; + +typedef struct { // Type 19 + UINT32 StartingAddress; // in KB + UINT32 EndingAddress; // in KB + UINT8 PartitionWidth; // + UINT64 ExtendedStartAddr; // in bytes + UINT64 ExtendedEndAddr; // in bytes +} MEM_ARRAY_MAP_ADDR; + +#if MEMORY_DEVICE_INFO +typedef struct { // Type 20 + UINT32 StartingAddress; // in KB + UINT32 EndingAddress; // in KB + UINT8 PartitionRowPosition; // + UINT8 InterleavePosition; // + UINT8 InterleaveDataDepth; // + UINT64 ExtendedStartAddr; // in bytes + UINT64 ExtendedEndAddr; // in bytes +} MEM_DEV_MAP_ADDR; +#endif + +typedef struct { // Type 17 + UINT16 MemErrInfoHandle; // Type 18 + UINT16 TotalWidth; // in bits (FFFFh if unknown) + UINT16 Size; // FFFFh if unknown, 7FFFh if size is >= 32GB - 1MB + UINT8 DeviceSet; // + UINT8 MemoryType; // + UINT16 Speed; // in MHz + UINT32 ExtendedSize; // in megabytes when Size field = 7FFFh, 0 otherwise + UINT16 ConfMemClkSpeed; // in MHz, 0 if unknown + UINT16 TypeDetail; // + UINT16 MinimumVoltage; // Minimum operating voltage in millivolts, 0 if unknown + UINT16 MaximumVoltage; // Maximum operating voltage in millivolts, 0 if unknown + UINT16 ConfiguredVoltage; // Configured voltage in millivolts, 0 if unknown +} MEMORY_DEVICE; + +typedef struct { + MEMORY_DEVICE Type17; // Type 17 + MEM_ERROR Type18; // Type 18 +#if MEMORY_DEVICE_INFO + MEM_DEV_MAP_ADDR Type20; // Type 20 +#endif +} MEMORY_DEVICE_GROUP; + +typedef struct { // Type 16 + UINT32 MaxCapacity; // in KB (8000 0000h if unknown) + UINT16 MemErrInfoHandle; // Type 18 + MEM_ERROR ArrayMemoryError; // Type 18 + MEM_ARRAY_MAP_ADDR MemArrayMapAddr; // Type 19 + MEMORY_DEVICE_GROUP MemoryDeviceData[MAX_NUMBER_OF_MEM_MODULE]; // Type 17 group + EFI_SMBUS_DEVICE_ADDRESS SpdSmBusAddr[MAX_NUMBER_OF_MEM_MODULE]; + UINT64 ExtMaxCapacity; // in Bytes when MaxCapacity = 8000 0000h, 0 otherwise +} PHYSICAL_MEM_ARRAY; + +typedef struct { + PHYSICAL_MEM_ARRAY PhysicalMemArray[NO_OF_PHYSICAL_MEMORY_ARRAY]; +} SYSTEM_MEM_ARRAY_DYNAMIC_DATA; + +#ifndef AMI_SMBIOS_MEMORY_INFO_HOB_GUID + #define AMI_SMBIOS_MEMORY_INFO_HOB_GUID \ + {0x7d6b8734, 0xb754, 0x443f, { 0xb5, 0x88, 0x77, 0x43, 0x84, 0x3a, 0xd3, 0xf1 }} +#endif + +typedef struct { + UINT8 Byte2; // Memory Type + UINT8 Byte5To8[9 - 5]; // Attribute, Total Width, Data Width (DDR2 & 3) + UINT8 Byte11To14[15 - 11]; // ECC Data Width, Data Width (DDR4) + UINT8 Byte64To71[72 - 64]; // Manufacturer (DDR2) + UINT8 Byte73To90[91 - 73]; // Part Number (DDR2) + UINT8 Byte95To98[99 - 95]; // Serial Number (DDR2) + UINT8 Byte117To118[119 - 117]; // Manufacturer (DDR3) + UINT8 Byte122To125[126 - 122]; // Serial Number (DDR3) + UINT8 Byte128To145[146 - 128]; // Part Number (DDR3) + UINT8 Byte320To321[322 - 320]; // Manufacturer (DDR4) + UINT8 Byte325To328[329 - 325]; // Serial Number (DDR4) + UINT8 Byte329To348[349 - 329]; // Part Number (DDR4) +} MEM_SPD_DATA; + +//**********************************************************************// +// SPD data needed from NB driver +//**********************************************************************// +//typedef struct { +// EFI_HOB_GUID_TYPE EfiHobGuidType; +// MEM_SPD_DATA SpdDataArray[NO_OF_PHYSICAL_MEMORY_ARRAY][MAX_NUMBER_OF_MEM_MODULE]; +//} AMI_SMBIOS_MEMORY_INFO_HOB; + +//**********************************************************************// +// Portable Battery Structure +//**********************************************************************// + +#if PORTABLE_BATTERY_INFO +typedef struct { // One for each Portable Battery + UINT8 DeviceName[65]; + UINT16 DesignCapacity; + UINT16 DesignVoltage; + UINT8 SbdsVersion[65]; + UINT16 SbdsSerialNumber; + UINT16 SbdsManufacturedDate; + UINT8 DesignCapacityMult; + BOOLEAN Valid; +} SMBIOS_PORTABLE_BATTERY_DYNAMIC_INFO; + +typedef struct { // Type 22 + SMBIOS_PORTABLE_BATTERY_DYNAMIC_INFO BatteryDynamicData[NO_OF_PORTABLE_BATTERY]; +} BATTERY_DYNAMIC_DATA; +#endif + +//**********************************************************************// +// On-Board Device Extended Information Structure +//**********************************************************************// + +#if ONBOARD_DEVICE_EXTENDED_INFO +typedef struct { // Type 41 + UINT8 OnBoardDev[ONBOARD_DEVICE_EXT_COUNT]; // 3.3.42 + UINT8 BusNumber[ONBOARD_DEVICE_EXT_COUNT]; +} ONBOARD_DEV_EXT_DYNAMIC_DATA; +#endif + +#pragma pack() + +typedef struct _EFI_SMBIOS_BOARD_PROTOCOL EFI_SMBIOS_BOARD_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_BASE_BOARD_DATA_STRUCTURE) ( +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_CHASSIS_DATA_STRUCTURE) ( +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_CPU_DATA_STRUCTURE) ( +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_SYSTEM_SLOT_DATA_STRUCTURE) ( +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_ONBOARD_DEV_DATA_STRUCTURE) ( +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_BATTERY_DEV_DATA_STRUCTURE) ( +); + +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_ONBOARD_DEV_EXT_STRUCTURE) ( +); +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_ENABLE_SMBUS_CONTROLLER) ( +); +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_RESTORE_SMBUS_CONTROLLER) ( +); +typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_READ_SPD) ( +); +typedef VOID (EFIAPI *EFI_SMBIOS_OEM_UPDATE) ( +); + +typedef struct _EFI_SMBIOS_BOARD_PROTOCOL { + UINT8 BaseBoardInfoSupport; + UINT8 SysChassisInfoSupport; + UINT8 ProcessorDmiEditSupport; + UINT8 OemStringInfoSupport; + UINT8 SystemConfigOptionInfoSupport; + UINT8 MemoryErrorInfoSupport; + UINT8 OnboardDeviceInfoSupport; + UINT8 PortableBatteryInfoSupport; + UINT8 AdditionalInfoSupport; + UINT8 OnboardDeviceExtInfoSupport; + UINT8 SystemPowerSupplyInfoSupport; + UINT8 NumberOfCPU; + UINT8 NumberOfSystemSlots; + UINT8 NumberOfOnBoardDevices; + UINT8 NumberOfPhysicalMemoryArray; + UINT8 NumberOfBatteries; + UINT8 NumberOfOnboardDevExt; + EFI_SMBIOS_CREATE_BASE_BOARD_DATA_STRUCTURE SmbiosCreateBaseBoardData; // Create Base Board dynamic data + EFI_SMBIOS_CREATE_CHASSIS_DATA_STRUCTURE SmbiosCreateChassisData; // Create Chassis dynamic data + EFI_SMBIOS_CREATE_CPU_DATA_STRUCTURE SmbiosCreateCPUData; // Create CPU dynamic data + EFI_SMBIOS_CREATE_SYSTEM_SLOT_DATA_STRUCTURE SmbiosCreateSystemSlotData; // Create system slot dynamic data + EFI_SMBIOS_CREATE_ONBOARD_DEV_DATA_STRUCTURE SmbiosCreateOnBoardDevData; // Create on-board device dynamic data + EFI_SMBIOS_CREATE_BATTERY_DEV_DATA_STRUCTURE SmbiosCreateBatteryDevData; // Create Portable Battery device dynamic data + EFI_SMBIOS_CREATE_ONBOARD_DEV_EXT_STRUCTURE SmbiosCreateOnBoardDevExtInfo; + EFI_SMBIOS_ENABLE_SMBUS_CONTROLLER EnableSmbusController; + EFI_SMBIOS_RESTORE_SMBUS_CONTROLLER RestoreSmbusController; + EFI_SMBIOS_READ_SPD GetSpdByte; + EFI_SMBIOS_OEM_UPDATE OemUpdate; + UINT8 NumberOfMemorySlots[NO_OF_PHYSICAL_MEMORY_ARRAY]; +}; + +EFI_STATUS CreateBaseBoardDataForSMBios(); +EFI_STATUS CreateChassisDataForSMBios(); +EFI_STATUS CreateCPUDataForSMBios(); +EFI_STATUS CreateSlotDataForSMBios(); +EFI_STATUS CreateOnBoardDevDataForSMBios(); +EFI_STATUS CreateBatteryDataForSMBios(); +EFI_STATUS CreateOnBoardDevExtInfoForSMBios(); +EFI_STATUS EnableSmbusController(); +EFI_STATUS RestoreSmbusController(); +EFI_STATUS GetSpdByte(); +VOID OemUpdate(); + +#endif // if SMBIOS_SUPPORT + +#endif + +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2016, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// diff --git a/Include/Protocol/SmbiosGetFlashDataProtocol.h b/Include/Protocol/SmbiosGetFlashDataProtocol.h new file mode 100644 index 0000000..d1a2d07 --- /dev/null +++ b/Include/Protocol/SmbiosGetFlashDataProtocol.h @@ -0,0 +1,93 @@ +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2010, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// + +//**********************************************************************// +// $Header: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SmbiosGetFlashDataProtocol.h 7 5/18/10 5:15p Davidd $ +// +// $Revision: 7 $ +// +// $Date: 5/18/10 5:15p $ +//**********************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SmbiosGetFlashDataProtocol.h $ +// +// 7 5/18/10 5:15p Davidd +// Added PnP function 52h commands 3 and 4 support - EIP 38010. +// +// 6 6/02/09 3:53p Davidd +// Updated AMI headers (EIP 22180) +// +// 5 11/14/08 4:42p Davidd +// +// 4 3/28/07 7:46p Davidd +// Updated the year on the AMI banner +// +// 3 12/15/06 1:15p Davidd +// Code cleanup and reformatted to coding standard. +// +// 2 8/10/05 11:12a Davidd +// Added EFI_SMBIOS_PROTOCOL_GUID. +// +// 1 5/02/05 3:23p Davidd +// Initial Check-in. +// +// 1 4/29/05 2:12p Davidd +// Initial checkin. +// +//**********************************************************************// + +#ifndef _EFI_SMBOS_GET_FLASH_DATA_PROTOCOL_H_ +#define _EFI_SMBOS_GET_FLASH_DATA_PROTOCOL_H_ + +#include <token.h> + +#define EFI_SMBIOS_FLASH_DATA_PROTOCOL_GUID \ + {0xddfb5557,0x3e2e,0x4569,0xb4,0x59,0xbe,0xff,0xe1,0x89,0xb8,0xb0} + +typedef struct _EFI_SMBIOS_FLASH_DATA_PROTOCOL EFI_SMBIOS_FLASH_DATA_PROTOCOL; + +typedef EFI_STATUS (*GET_FLASH_TABLE_INFO)( + IN EFI_SMBIOS_FLASH_DATA_PROTOCOL *This, + OUT VOID **Location, + OUT UINT32 *Size +); + +typedef EFI_STATUS (*GET_FIELD) ( + IN EFI_SMBIOS_FLASH_DATA_PROTOCOL *This, + IN UINT8 Table, + IN UINT8 Offset, + OUT VOID **String +); + +struct _EFI_SMBIOS_FLASH_DATA_PROTOCOL { + GET_FLASH_TABLE_INFO GetFlashTableInfo; + GET_FIELD GetField; +}; + +#endif + +//**********************************************************************// +//**********************************************************************// +//** **// +//** (C)Copyright 1985-2010, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **// +//** **// +//** Phone: (770)-246-8600 **// +//** **// +//**********************************************************************// +//**********************************************************************// diff --git a/Include/Protocol/SmmAccess.h b/Include/Protocol/SmmAccess.h new file mode 100644 index 0000000..d324595 --- /dev/null +++ b/Include/Protocol/SmmAccess.h @@ -0,0 +1,170 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmAccess.h 3 2/07/11 3:37p Markw $ +// +// $Revision: 3 $ +// +// $Date: 2/07/11 3:37p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmAccess.h $ +// +// 3 2/07/11 3:37p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] Smm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +// 2 7/08/09 8:01p Markw +// Update headers. +// +// 1 3/18/07 1:54p Markw +// +// 2 3/13/06 1:40a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 1/30/04 10:26a Markw +// +// 1 1/26/04 3:25p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SmmAccess_h +// +// Description: This provides north bridge functions to open, close, lock, +// and describe SMM space. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SMM_ACCESS_PROTOCOL_H__ +#define __SMM_ACCESS_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_ACCESS_PROTOCOL_GUID \ + {0x3792095a,0xe309,0x4c1e,0xaa,0x01,0x85,0xf5,0x65,0x5a,0x17,0xf1} + +GUID_VARIABLE_DECLARATION(gEfiSmmAccessProtocolGuid,EFI_SMM_ACCESS_PROTOCOL_GUID); + +//Forward Declaration +typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL; + +#ifndef SMM_ACCESS_DEF +#define SMM_ACCESS_DEF + +//******************************************************* +//EFI_SMRAM_STATE +//******************************************************* +#define EFI_SMRAM_OPEN 0x00000001 +#define EFI_SMRAM_CLOSED 0x00000002 +#define EFI_SMRAM_LOCKED 0x00000004 +#define EFI_CACHEABLE 0x00000008 +#define EFI_ALLOCATED 0x00000010 +#define EFI_NEEDS_TESTING 0x00000020 +#define EFI_NEEDS_ECC_INITIALIZATION 0x00000040 + +typedef struct _EFI_SMRAM_DESCRIPTOR { + EFI_PHYSICAL_ADDRESS PhysicalStart; + EFI_PHYSICAL_ADDRESS CpuStart; + UINT64 PhysicalSize; + UINT64 RegionState; +} EFI_SMRAM_DESCRIPTOR; + +#endif + + +typedef EFI_STATUS (EFIAPI *EFI_SMM_OPEN) ( + IN EFI_SMM_ACCESS_PROTOCOL *This, + IN UINTN DescriptorIndex +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_CLOSE) ( + IN EFI_SMM_ACCESS_PROTOCOL *This, + IN UINTN DescriptorIndex +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_LOCK) ( + IN EFI_SMM_ACCESS_PROTOCOL *This, + IN UINTN DescriptorIndex +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_CAPABILITIES) ( + IN EFI_SMM_ACCESS_PROTOCOL *This, + IN OUT UINTN *SmramMapSize, + IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap +); + +//********************************************************************** +//<AMI_THDR_START> +// +// Name: EFI_SMM_ACCESS_PROTOCOL +// +// Description: This provides north bridge functions to open, close, lock, +// and describe SMM space. +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// Open EFI_SMM_OPEN Access SMM space when in non-SMM mode. +// Close EFI_SMM_CLOSE Close SMM space when in non-SMM mode. +// Lock EFI_SMM_LOCK Do not allow access to SMM when in non-SMM Mode. +// GetCapabilities EFI_SMM_CAPABILITIES Provide information for SMM memory areas. +// LockState BOOLEAN TRUE if SMM memory is locked. +// OpenState BOOLEAN TRUE if any SMM memory is opened. +// +//<AMI_THDR_END> +//********************************************************************** +struct _EFI_SMM_ACCESS_PROTOCOL { + EFI_SMM_OPEN Open; + EFI_SMM_CLOSE Close; + EFI_SMM_LOCK Lock; + EFI_SMM_CAPABILITIES GetCapabilities; + BOOLEAN LockState; + BOOLEAN OpenState; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmAccess2.h b/Include/Protocol/SmmAccess2.h new file mode 100644 index 0000000..daa5d75 --- /dev/null +++ b/Include/Protocol/SmmAccess2.h @@ -0,0 +1,136 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmAccess2.h 2 3/04/11 3:35p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:35p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmAccess2.h $ +// +// 2 3/04/11 3:35p Markw +// Update headers. +// +// 1 2/07/11 4:03p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmAccess2.h +// +// Description: +// This provides north bridge functions to open, close, lock, and describe SMM space. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_ACCESS2_PROTOCOL_H__ +#define __SMM_ACCESS2_PROTOCOL_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_ACCESS2_PROTOCOL_GUID \ + {0xc2702b74,0x800c,0x4131,0x87,0x46,0x8f,0xb5,0xb8,0x9c,0xe4,0xac} + +GUID_VARIABLE_DECLARATION(gEfiSmmAccess2ProtocolGuid,EFI_SMM_ACCESS2_PROTOCOL_GUID); + +//Forward Declaration +typedef struct _EFI_SMM_ACCESS2_PROTOCOL EFI_SMM_ACCESS2_PROTOCOL; + +#ifndef SMM_ACCESS_DEF +#define SMM_ACCESS_DEF + +#define EFI_SMRAM_OPEN 0x00000001 +#define EFI_SMRAM_CLOSED 0x00000002 +#define EFI_SMRAM_LOCKED 0x00000004 +#define EFI_CACHEABLE 0x00000008 +#define EFI_ALLOCATED 0x00000010 +#define EFI_NEEDS_TESTING 0x00000020 +#define EFI_NEEDS_ECC_INITIALIZATION 0x00000040 + +typedef struct _EFI_SMRAM_DESCRIPTOR { + EFI_PHYSICAL_ADDRESS PhysicalStart; + EFI_PHYSICAL_ADDRESS CpuStart; + UINT64 PhysicalSize; + UINT64 RegionState; +} EFI_SMRAM_DESCRIPTOR; + +#endif + +typedef EFI_STATUS (EFIAPI *EFI_SMM_OPEN2)( + IN EFI_SMM_ACCESS2_PROTOCOL *This +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_CLOSE2)( + IN EFI_SMM_ACCESS2_PROTOCOL *This +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_LOCK2)( + IN EFI_SMM_ACCESS2_PROTOCOL *This +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_CAPABILITIES2)( + IN CONST EFI_SMM_ACCESS2_PROTOCOL *This, + IN OUT UINTN *SmramMapSize, + IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap +); + +struct _EFI_SMM_ACCESS2_PROTOCOL { + EFI_SMM_OPEN2 Open; + EFI_SMM_CLOSE2 Close; + EFI_SMM_LOCK2 Lock; + EFI_SMM_CAPABILITIES2 GetCapabilities; //Current state of the SMRAM. TRUE if locked. + BOOLEAN LockState; //Current state of the SMRAM. TRUE if open. + BOOLEAN OpenState; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmBase.h b/Include/Protocol/SmmBase.h new file mode 100644 index 0000000..f15b829 --- /dev/null +++ b/Include/Protocol/SmmBase.h @@ -0,0 +1,183 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmBase.h 4 4/15/11 4:41p Markw $ +// +// $Revision: 4 $ +// +// $Date: 4/15/11 4:41p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmBase.h $ +// +// 4 4/15/11 4:41p Markw +// [TAG] EIP57440 +// [Category] New Feature +// [Description] Update from previous check-in. Add inclusion Guards. +// [Files] SmmBase.h +// +// 3 7/08/09 8:00p Markw +// Update headers. +// +// 2 3/28/07 2:48p Markw +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmBase.h +// +// Description: Smm Base Protocol header file. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_BASE_PROTOCOL_H__ +#define __SMM_BASE_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> +#include <SMM.h> + +#define EFI_SMM_BASE_PROTOCOL_GUID \ + {0x1390954D,0xda95,0x4227,0x93,0x28,0x72,0x82,0xc2,0x17,0xda,0xa8} + +GUID_VARIABLE_DECLARATION(gEfiSmmBaseProtocolGuid,EFI_SMM_BASE_PROTOCOL_GUID); + +//******************************************************* +//EFI SMM Handler Return Code +//******************************************************* +#define EFI_HANDLER_SUCCESS 0x0000 +#define EFI_HANDLER_CRITICAL_EXIT 0x0001 +#define EFI_HANDLER_SOURCE_QUIESCED 0x0002 +#define EFI_HANDLER_SOURCE_PENDING 0x0003 + +#define SMM_COMMUNICATE_HEADER_GUID \ + {0xF328E36C,0x23B6,0x4a95,0x85,0x4B,0x32,0xE1,0x95,0x34,0xCD,0x75} + + +//****************************************************** +// EFI_SMM_COMMUNICATE_HEADER +//****************************************************** + +#ifndef EFI_SMM_COMM_HDR_DEF +#define EFI_SMM_COMM_HDR_DEF + + +typedef struct { + EFI_GUID HeaderGuid; + UINTN MessageLength; + UINT8 Data[1]; +} EFI_SMM_COMMUNICATE_HEADER; + +#endif + +//*********************************************** +// EFI_SMM_CALLBACK_ENTRY_POINT +//*********************************************** +typedef EFI_STATUS (EFIAPI *EFI_SMM_CALLBACK_ENTRY_POINT) ( + IN EFI_HANDLE SmmImageHandle, + IN OUT VOID *CommunicationBuffer OPTIONAL, + IN OUT UINTN *SourceSize OPTIONAL +); + + +typedef struct _EFI_SMM_BASE_PROTOCOL EFI_SMM_BASE_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_REGISTER_HANDLER) ( + IN EFI_SMM_BASE_PROTOCOL *This, + IN EFI_DEVICE_PATH_PROTOCOL *FilePath, + IN VOID *SourceBuffer OPTIONAL, + IN UINTN SourceSize, + OUT EFI_HANDLE *ImageHandle, + IN BOOLEAN LegacyIA32Binary OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_UNREGISTER_HANDLER) ( + IN EFI_SMM_BASE_PROTOCOL *This, + IN EFI_HANDLE ImageHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_COMMUNICATE) ( + IN EFI_SMM_BASE_PROTOCOL *This, + IN EFI_HANDLE ImageHandle, + IN OUT VOID *CommunicationBuffer, + IN OUT UINTN *SourceSize +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_CALLBACK_SERVICE) ( + IN EFI_SMM_BASE_PROTOCOL *This, + IN EFI_HANDLE SmmImageHandle, + IN EFI_SMM_CALLBACK_ENTRY_POINT CallbackAddress, + IN BOOLEAN MakeLast OPTIONAL, + IN BOOLEAN FloatingPointSave OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_INSIDE_OUT) ( + IN EFI_SMM_BASE_PROTOCOL *This, + OUT BOOLEAN *InSmm +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_ALLOCATE_POOL) ( + IN EFI_SMM_BASE_PROTOCOL *This, + IN EFI_MEMORY_TYPE PoolType, + IN UINTN Size, + OUT VOID **Buffer +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_FREE_POOL) ( + IN EFI_SMM_BASE_PROTOCOL *This, + IN VOID *Buffer +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_GET_SMST_LOCATION) ( + IN EFI_SMM_BASE_PROTOCOL *This, + IN OUT EFI_SMM_SYSTEM_TABLE **Smst +); + + +struct _EFI_SMM_BASE_PROTOCOL { + EFI_SMM_REGISTER_HANDLER Register; + EFI_SMM_UNREGISTER_HANDLER UnRegister; + EFI_SMM_COMMUNICATE Communicate; + EFI_SMM_CALLBACK_SERVICE RegisterCallback; + EFI_SMM_INSIDE_OUT InSmm; + EFI_SMM_ALLOCATE_POOL SmmAllocatePool; + EFI_SMM_FREE_POOL SmmFreePool; + EFI_SMM_GET_SMST_LOCATION GetSmstLocation; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmBase2.h b/Include/Protocol/SmmBase2.h new file mode 100644 index 0000000..4eb23e9 --- /dev/null +++ b/Include/Protocol/SmmBase2.h @@ -0,0 +1,102 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmBase2.h 2 3/04/11 3:35p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:35p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmBase2.h $ +// +// 2 3/04/11 3:35p Markw +// Update headers. +// +// 1 2/07/11 4:03p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmBase2.h +// +// Description: PI Smm Base Protocol header file. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_BASE2_PROTOCOL_H__ +#define __SMM_BASE2_PROTOCOL_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> +#include <SmmPi.h> + +#define EFI_SMM_BASE2_PROTOCOL_GUID \ + {0xf4ccbfb7,0xf6e0,0x47fd,0x9d,0xd4,0x10,0xa8,0xf1,0x50,0xc1,0x91} + +GUID_VARIABLE_DECLARATION(gEfiSmmBase2ProtocolGuid,EFI_SMM_BASE2_PROTOCOL_GUID); + +typedef struct _EFI_SMM_BASE2_PROTOCOL EFI_SMM_BASE2_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_INSIDE_OUT2)( + IN CONST EFI_SMM_BASE2_PROTOCOL *This, + OUT BOOLEAN *InSmram +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_GET_SMST_LOCATION2)( + IN CONST EFI_SMM_BASE2_PROTOCOL *This, + IN OUT EFI_SMM_SYSTEM_TABLE2 **Smst +); + +struct _EFI_SMM_BASE2_PROTOCOL { + EFI_SMM_INSIDE_OUT2 InSmm; + EFI_SMM_GET_SMST_LOCATION2 GetSmstLocation; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmBiosWriteDispatch.h b/Include/Protocol/SmmBiosWriteDispatch.h new file mode 100644 index 0000000..6ac88e7 --- /dev/null +++ b/Include/Protocol/SmmBiosWriteDispatch.h @@ -0,0 +1,101 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SmmBiosWriteDispatch.h 1 2/08/12 8:26a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/08/12 8:26a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SmmBiosWriteDispatch.h $ +// +// 1 2/08/12 8:26a Yurenlai +// Intel Lynx Point/SB eChipset initially releases. +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: SmmBiosWriteDispatch.h +// +// Description: SMM BIOS Write Dispatch Protocol header. +// +//<AMI_FHDR_END> +//************************************************************************* + +#ifndef __SMM_BIOS_WRITE_DISPATCH_PROTOCOL_H__ +#define __SMM_BIOS_WRITE_DISPATCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// {E512DFE4-BF44-480d-9B7A-777B0BE32775} +#define EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL_GUID \ + {0xe512dfe4, 0xbf44, 0x480d, 0x9b, 0x7a, 0x77, 0x7b, 0xb, 0xe3, 0x27, 0x75} + +GUID_VARIABLE_DECLARATION( gEfiSmmBiosWriteDispatchProtocolGuid, \ + EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL_GUID); + +typedef struct _EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL \ + EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL; + +//****************************************************** +// EFI_SMM_BIOS_WRITE_DISPATCH +//****************************************************** +typedef VOID (EFIAPI *EFI_SMM_BIOS_WRITE_DISPATCH) ( + IN EFI_HANDLE DispatchHandle, + IN VOID *DispatchContext +); + + +typedef EFI_STATUS (EFIAPI *EFI_SMM_BIOS_WRITE_REGISTER) ( + IN EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL *This, + IN EFI_SMM_BIOS_WRITE_DISPATCH DispatchFunction, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_BIOS_WRITE_UNREGISTER) ( + IN EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + + +struct _EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL { + EFI_SMM_BIOS_WRITE_REGISTER Register; + EFI_SMM_BIOS_WRITE_UNREGISTER UnRegister; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmCommunication.h b/Include/Protocol/SmmCommunication.h new file mode 100644 index 0000000..e4517bd --- /dev/null +++ b/Include/Protocol/SmmCommunication.h @@ -0,0 +1,111 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmCommunication.h 3 4/15/11 4:44p Markw $ +// +// $Revision: 3 $ +// +// $Date: 4/15/11 4:44p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmCommunication.h $ +// +// 3 4/15/11 4:44p Markw +// Add Inclusion Guards. +// +// 2 3/04/11 3:35p Markw +// Update headers. +// +// 1 2/07/11 4:03p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmCommunicate.h +// +// Description: PI Smm Base Protocol header file. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_COMMUNICATE_PROTOCOL_H__ +#define __SMM_COMMUNICATE_PROTOCOL_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_COMMUNICATION_PROTOCOL_GUID \ + {0xc68ed8e2, 0x9dc6, 0x4cbd, 0x9d, 0x94, 0xdb, 0x65, 0xac, 0xc5, 0xc3, 0x32} + +GUID_VARIABLE_DECLARATION(gEfiSmmCommunicationProtocolGuid,EFI_SMM_COMMUNICATION_PROTOCOL_GUID); + + +#ifndef EFI_SMM_COMM_HDR_DEF +#define EFI_SMM_COMM_HDR_DEF + +typedef struct { + EFI_GUID HeaderGuid; + UINTN MessageLength; + UINT8 Data[1]; +} EFI_SMM_COMMUNICATE_HEADER; + +#endif + +typedef struct _EFI_SMM_COMMUNICATION_PROTOCOL EFI_SMM_COMMUNICATION_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_COMMUNICATE2) ( + IN CONST EFI_SMM_COMMUNICATION_PROTOCOL *This, + IN OUT VOID *CommBuffer, + IN OUT UINTN *CommSize +); + +struct _EFI_SMM_COMMUNICATION_PROTOCOL { + EFI_SMM_COMMUNICATE2 Communicate; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmControl.h b/Include/Protocol/SmmControl.h new file mode 100644 index 0000000..154e6c9 --- /dev/null +++ b/Include/Protocol/SmmControl.h @@ -0,0 +1,147 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmControl.h 2 7/08/09 8:01p Markw $ +// +// $Revision: 2 $ +// +// $Date: 7/08/09 8:01p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmControl.h $ +// +// 2 7/08/09 8:01p Markw +// Update headers. +// +// 1 3/18/07 1:54p Markw +// +// 4 12/19/06 12:42p Felixp +// AMI_SMM_SW_SMI_16_BITS switch removed. Header is reverted to the +// previous version. +// +// 2 3/13/06 1:40a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 2 2/09/04 2:43p Markw +// Fixed header info. +// +// 1 1/30/04 10:26a Markw +// +// 1 1/26/04 3:25p Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SmmControl.h +// +// Description: Provides south bridge functions for triggering and clearing SMIs. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SMM_CONTROL_PROTOCOL_H__ +#define __SMM_CONTROL_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_CONTROL_PROTOCOL_GUID \ + {0x8d12e231,0xc667,0x4fd1,0x98,0xf2,0x24,0x49,0xa7,0xe7,0xb2,0xe5} + +GUID_VARIABLE_DECLARATION(gEfiSmmControlProtocolGuid,EFI_SMM_CONTROL_PROTOCOL_GUID); + +//************************************************ +// EFI_SMM_PERIOD +//************************************************ +typedef UINTN EFI_SMM_PERIOD; + +//********************************************* +// EFI_SMM_CONTROL_REGISTER +//********************************************* +typedef struct { + UINT8 SmiTriggerRegister; + UINT8 SmiDataRegister; +} EFI_SMM_CONTROL_REGISTER; + + +typedef struct _EFI_SMM_CONTROL_PROTOCOL EFI_SMM_CONTROL_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_ACTIVATE) ( + IN EFI_SMM_CONTROL_PROTOCOL *This, + IN OUT INT8 *ArgumentBuffer OPTIONAL, + IN OUT UINTN *ArgumentBufferSize OPTIONAL, + IN BOOLEAN Periodic OPTIONAL, + IN UINTN ActivationInterval OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_DEACTIVATE) ( + IN EFI_SMM_CONTROL_PROTOCOL *This, + IN BOOLEAN Periodic OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_GET_REGISTER_INFO) ( + IN EFI_SMM_CONTROL_PROTOCOL *This, + IN OUT EFI_SMM_CONTROL_REGISTER *SmiRegister +); + +//********************************************************************** +//<AMI_THDR_START> +// +// Name: EFI_SMM_CONTROL_PROTOCOL +// +// Description: Provides south bridge functions for triggering and clearing SMIs. +// +// Fields: Name Type Description +// ------------------------------------------------------------ +// Trigger EFI_SMM_ACTIVATE Trigger SMI and provide it with a byte code. +// Clear EFI_SMM_DEACTIVATE Clear all SMI sources. +// GetRegisterInfo EFI_SMM_GET_REGISTER_INFO Get SMI Trigger information. +// MinimumTriggerPeriod UINTN 0 in IA32. SMI period is not supported. +// +//<AMI_THDR_END> +//********************************************************************** +struct _EFI_SMM_CONTROL_PROTOCOL { + EFI_SMM_ACTIVATE Trigger; + EFI_SMM_DEACTIVATE Clear; + EFI_SMM_GET_REGISTER_INFO GetRegisterInfo; + UINTN MinimumTriggerPeriod; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmControl2.h b/Include/Protocol/SmmControl2.h new file mode 100644 index 0000000..c025756 --- /dev/null +++ b/Include/Protocol/SmmControl2.h @@ -0,0 +1,108 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmControl2.h 2 3/04/11 3:35p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:35p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmControl2.h $ +// +// 2 3/04/11 3:35p Markw +// Update headers. +// +// 1 2/07/11 4:03p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SmmControl2.h +// +// Description: Provides south bridge functions for triggering and clearing SMIs. +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef __SMM_CONTROL2_PROTOCOL_H__ +#define __SMM_CONTROL2_PROTOCOL_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +//************************************************ +// EFI_SMM_PERIOD +//************************************************ +typedef UINTN EFI_SMM_PERIOD; + +#define EFI_SMM_CONTROL2_PROTOCOL_GUID \ + {0x843dc720,0xab1e,0x42cb,0x93,0x57,0x8a,0x0,0x78,0xf3,0x56,0x1b} + +GUID_VARIABLE_DECLARATION(gEfiSmmControl2ProtocolGuid,EFI_SMM_CONTROL2_PROTOCOL_GUID); + +typedef struct _EFI_SMM_CONTROL2_PROTOCOL EFI_SMM_CONTROL2_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_ACTIVATE2)( + IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, + IN OUT UINT8 *CommandPort OPTIONAL, + IN OUT UINT8 *DataPort OPTIONAL, + IN BOOLEAN Periodic OPTIONAL, + IN UINTN ActivationInterval OPTIONAL +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_DEACTIVATE2)( + IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, + IN BOOLEAN Periodic OPTIONAL +); + +struct _EFI_SMM_CONTROL2_PROTOCOL { + EFI_SMM_ACTIVATE2 Trigger; + EFI_SMM_DEACTIVATE2 Clear; + EFI_SMM_PERIOD MinimumTriggerPeriod; /// Minimum interval at which the platform can set the period. +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmCpu.h b/Include/Protocol/SmmCpu.h new file mode 100644 index 0000000..c662dbb --- /dev/null +++ b/Include/Protocol/SmmCpu.h @@ -0,0 +1,211 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmCpu.h 2 3/04/11 3:35p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:35p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmCpu.h $ +// +// 2 3/04/11 3:35p Markw +// Update headers. +// +// 1 2/07/11 4:03p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmCpu.h +// +// Description: Smm CPU Protocol +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_CPU_PROTOCOL_H__ +#define __SMM_CPU_PROTOCOL_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_CPU_PROTOCOL_GUID \ + {0xeb346b97, 0x975f, 0x4a9f, 0x8b, 0x22, 0xf8, 0xe9, 0x2b, 0xb3, 0xd5, 0x69} + +GUID_VARIABLE_DECLARATION(gEfiCpuProtocolGuid, EFI_SMM_CPU_PROTOCOL_GUID); + +//Forward Declaration +typedef struct _EFI_SMM_CPU_PROTOCOL EFI_SMM_CPU_PROTOCOL; + +#define EFI_SMM_SAVE_STATE_REGISTER_LMA_32BIT 32 +#define EFI_SMM_SAVE_STATE_REGISTER_LMA_64BIT 64 + +typedef enum { + EFI_SMM_SAVE_STATE_REGISTER_GDTBASE = 4, + EFI_SMM_SAVE_STATE_REGISTER_IDTBASE = 5, + EFI_SMM_SAVE_STATE_REGISTER_LDTBASE = 6, + EFI_SMM_SAVE_STATE_REGISTER_GDTLIMIT = 7, + EFI_SMM_SAVE_STATE_REGISTER_IDTLIMIT = 8, + EFI_SMM_SAVE_STATE_REGISTER_LDTLIMIT = 9, + EFI_SMM_SAVE_STATE_REGISTER_LDTINFO = 10, + EFI_SMM_SAVE_STATE_REGISTER_ES = 20, + EFI_SMM_SAVE_STATE_REGISTER_CS = 21, + EFI_SMM_SAVE_STATE_REGISTER_SS = 22, + EFI_SMM_SAVE_STATE_REGISTER_DS = 23, + EFI_SMM_SAVE_STATE_REGISTER_FS = 24, + EFI_SMM_SAVE_STATE_REGISTER_GS = 25, + EFI_SMM_SAVE_STATE_REGISTER_LDTR_SEL = 26, + EFI_SMM_SAVE_STATE_REGISTER_TR_SEL = 27, + EFI_SMM_SAVE_STATE_REGISTER_DR7 = 28, + EFI_SMM_SAVE_STATE_REGISTER_DR6 = 29, + EFI_SMM_SAVE_STATE_REGISTER_R8 = 30, + EFI_SMM_SAVE_STATE_REGISTER_R9 = 31, + EFI_SMM_SAVE_STATE_REGISTER_R10 = 32, + EFI_SMM_SAVE_STATE_REGISTER_R11 = 33, + EFI_SMM_SAVE_STATE_REGISTER_R12 = 34, + EFI_SMM_SAVE_STATE_REGISTER_R13 = 35, + EFI_SMM_SAVE_STATE_REGISTER_R14 = 36, + EFI_SMM_SAVE_STATE_REGISTER_R15 = 37, + EFI_SMM_SAVE_STATE_REGISTER_RAX = 38, + EFI_SMM_SAVE_STATE_REGISTER_RBX = 39, + EFI_SMM_SAVE_STATE_REGISTER_RCX = 40, + EFI_SMM_SAVE_STATE_REGISTER_RDX = 41, + EFI_SMM_SAVE_STATE_REGISTER_RSP = 42, + EFI_SMM_SAVE_STATE_REGISTER_RBP = 43, + EFI_SMM_SAVE_STATE_REGISTER_RSI = 44, + EFI_SMM_SAVE_STATE_REGISTER_RDI = 45, + EFI_SMM_SAVE_STATE_REGISTER_RIP = 46, + EFI_SMM_SAVE_STATE_REGISTER_RFLAGS = 51, + EFI_SMM_SAVE_STATE_REGISTER_CR0 = 52, + EFI_SMM_SAVE_STATE_REGISTER_CR3 = 53, + EFI_SMM_SAVE_STATE_REGISTER_CR4 = 54, + EFI_SMM_SAVE_STATE_REGISTER_FCW = 256, + EFI_SMM_SAVE_STATE_REGISTER_FSW = 257, + EFI_SMM_SAVE_STATE_REGISTER_FTW = 258, + EFI_SMM_SAVE_STATE_REGISTER_OPCODE = 259, + EFI_SMM_SAVE_STATE_REGISTER_FP_EIP = 260, + EFI_SMM_SAVE_STATE_REGISTER_FP_CS = 261, + EFI_SMM_SAVE_STATE_REGISTER_DATAOFFSET = 262, + EFI_SMM_SAVE_STATE_REGISTER_FP_DS = 263, + EFI_SMM_SAVE_STATE_REGISTER_MM0 = 264, + EFI_SMM_SAVE_STATE_REGISTER_MM1 = 265, + EFI_SMM_SAVE_STATE_REGISTER_MM2 = 266, + EFI_SMM_SAVE_STATE_REGISTER_MM3 = 267, + EFI_SMM_SAVE_STATE_REGISTER_MM4 = 268, + EFI_SMM_SAVE_STATE_REGISTER_MM5 = 269, + EFI_SMM_SAVE_STATE_REGISTER_MM6 = 270, + EFI_SMM_SAVE_STATE_REGISTER_MM7 = 271, + EFI_SMM_SAVE_STATE_REGISTER_XMM0 = 272, + EFI_SMM_SAVE_STATE_REGISTER_XMM1 = 273, + EFI_SMM_SAVE_STATE_REGISTER_XMM2 = 274, + EFI_SMM_SAVE_STATE_REGISTER_XMM3 = 275, + EFI_SMM_SAVE_STATE_REGISTER_XMM4 = 276, + EFI_SMM_SAVE_STATE_REGISTER_XMM5 = 277, + EFI_SMM_SAVE_STATE_REGISTER_XMM6 = 278, + EFI_SMM_SAVE_STATE_REGISTER_XMM7 = 279, + EFI_SMM_SAVE_STATE_REGISTER_XMM8 = 280, + EFI_SMM_SAVE_STATE_REGISTER_XMM9 = 281, + EFI_SMM_SAVE_STATE_REGISTER_XMM10 = 282, + EFI_SMM_SAVE_STATE_REGISTER_XMM11 = 283, + EFI_SMM_SAVE_STATE_REGISTER_XMM12 = 284, + EFI_SMM_SAVE_STATE_REGISTER_XMM13 = 285, + EFI_SMM_SAVE_STATE_REGISTER_XMM14 = 286, + EFI_SMM_SAVE_STATE_REGISTER_XMM15 = 287, + // + // Pseudo-Registers + // + EFI_SMM_SAVE_STATE_REGISTER_IO = 512, + EFI_SMM_SAVE_STATE_REGISTER_LMA = 513 +} EFI_SMM_SAVE_STATE_REGISTER; + +typedef enum { + EFI_SMM_SAVE_STATE_IO_WIDTH_UINT8 = 0, + EFI_SMM_SAVE_STATE_IO_WIDTH_UINT16 = 1, + EFI_SMM_SAVE_STATE_IO_WIDTH_UINT32 = 2, + EFI_SMM_SAVE_STATE_IO_WIDTH_UINT64 = 3 +} EFI_SMM_SAVE_STATE_IO_WIDTH; + +typedef enum { + EFI_SMM_SAVE_STATE_IO_TYPE_INPUT = 1, + EFI_SMM_SAVE_STATE_IO_TYPE_OUTPUT = 2, + EFI_SMM_SAVE_STATE_IO_TYPE_STRING = 4, + EFI_SMM_SAVE_STATE_IO_TYPE_REP_PREFIX = 8 +} EFI_SMM_SAVE_STATE_IO_TYPE; + + +typedef struct _EFI_SMM_SAVE_STATE_IO_INFO { + UINT64 IoData; + UINT16 IoPort; + EFI_SMM_SAVE_STATE_IO_WIDTH IoWidth; + EFI_SMM_SAVE_STATE_IO_TYPE IoType; +} EFI_SMM_SAVE_STATE_IO_INFO; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_READ_SAVE_STATE) ( + IN CONST EFI_SMM_CPU_PROTOCOL *This, + IN UINTN Width, + IN EFI_SMM_SAVE_STATE_REGISTER Register, + IN UINTN CpuIndex, + OUT VOID *Buffer +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_WRITE_SAVE_STATE) ( + IN CONST EFI_SMM_CPU_PROTOCOL *This, + IN UINTN Width, + IN EFI_SMM_SAVE_STATE_REGISTER Register, + IN UINTN CpuIndex, + IN CONST VOID *Buffer +); + +typedef struct _EFI_SMM_CPU_PROTOCOL { + EFI_SMM_READ_SAVE_STATE ReadSaveState; + EFI_SMM_WRITE_SAVE_STATE WriteSaveState; +} EFI_SMM_CPU_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmCpuIo2.h b/Include/Protocol/SmmCpuIo2.h new file mode 100644 index 0000000..b51c330 --- /dev/null +++ b/Include/Protocol/SmmCpuIo2.h @@ -0,0 +1,114 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmCpuIo2.h 2 3/04/11 3:36p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:36p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmCpuIo2.h $ +// +// 2 3/04/11 3:36p Markw +// Update headers. +// +// 1 2/07/11 4:04p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmCpuIo2.h +// +// Description: Smm CPU IO Protocol +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef _SMM_CPU_IO2_H_ +#define _SMM_CPU_IO2_H_ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_CPU_IO2_PROTOCOL_GUID \ + { 0x3242A9D8, 0xCE70, 0x4AA0, 0x95, 0x5D, 0x5E, 0x7B, 0x14, 0x0D, 0xE4, 0xD2 } + +GUID_VARIABLE_DECLARATION(gEfiSmmCpuIo2ProtocolGuid, EFI_SMM_CPU_IO2_PROTOCOL_GUID); + +typedef struct _EFI_SMM_CPU_IO2_PROTOCOL EFI_SMM_CPU_IO2_PROTOCOL; + +#ifndef EFI_SMM_IO_WIDTH_DEF +#define EFI_SMM_IO_WIDTH_DEF +typedef enum { + SMM_IO_UINT8 = 0, + SMM_IO_UINT16 = 1, + SMM_IO_UINT32 = 2, + SMM_IO_UINT64 = 3 +} EFI_SMM_IO_WIDTH; +#endif + +typedef EFI_STATUS (EFIAPI *EFI_SMM_CPU_IO2)( + IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, + IN EFI_SMM_IO_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ); + +typedef struct { + EFI_SMM_CPU_IO2 Read; + EFI_SMM_CPU_IO2 Write; +} EFI_SMM_IO_ACCESS2; + +struct _EFI_SMM_CPU_IO2_PROTOCOL { + EFI_SMM_IO_ACCESS2 Mem; + EFI_SMM_IO_ACCESS2 Io; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmCpuState.h b/Include/Protocol/SmmCpuState.h new file mode 100644 index 0000000..1d6ab88 --- /dev/null +++ b/Include/Protocol/SmmCpuState.h @@ -0,0 +1,181 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmCpuState.h 2 7/08/09 8:01p Markw $ +// +// $Revision: 2 $ +// +// $Date: 7/08/09 8:01p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmCpuState.h $ +// +// 2 7/08/09 8:01p Markw +// Update headers. +// +// 1 2/07/07 11:00a Markw +// +// 1 2/07/07 10:59a Markw +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SmmCpuSaveState.h +// +// Description: This provides the SMM Cpu Save State protocol. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SMM_CPU_SAVE_STATE_PROTOCOL_H__ +#define __SMM_CPU_SAVE_STATE_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_CPU_SAVE_STATE_PROTOCOL_GUID \ + {0x21f302ad,0x6e94,0x471b,0x84,0xbc,0xb1,0x48,0x0,0x40,0x3a,0x1d} + +GUID_VARIABLE_DECLARATION(gEfiSmmCpuSaveStateProtocolGuid,EFI_SMM_CPU_SAVE_STATE_PROTOCOL_GUID); + +typedef struct _EFI_SMM_CPU_SAVE_STATE_PROTOCOL EFI_SMM_CPU_SAVE_STATE_PROTOCOL; + +typedef struct _EFI_SMM_CPU_STATE32 { + UINT8 Reserved1[0xf8]; // fe00h + UINT32 SMBASE; // fef8h + UINT32 SMMRevId; // fefch + UINT16 IORestart; // ff00h + UINT16 AutoHALTRestart; // ff02h + UINT32 IEDBASE; // ff04h + UINT8 Reserved2[0x98]; // ff08h + UINT32 IOMemAddr; // ffa0h + UINT32 IOMisc; // ffa4h + UINT32 _ES; + UINT32 _CS; + UINT32 _SS; + UINT32 _DS; + UINT32 _FS; + UINT32 _GS; + UINT32 _LDTBase; + UINT32 _TR; + UINT32 _DR7; + UINT32 _DR6; + UINT32 _EAX; + UINT32 _ECX; + UINT32 _EDX; + UINT32 _EBX; + UINT32 _ESP; + UINT32 _EBP; + UINT32 _ESI; + UINT32 _EDI; + UINT32 _EIP; + UINT32 _EFLAGS; + UINT32 _CR3; + UINT32 _CR0; +} EFI_SMM_CPU_STATE32; + +typedef struct _EFI_SMM_CPU_STATE64 { + UINT8 Reserved1[0x1d0]; // fc00h + UINT32 GdtBaseHiDword; // fdd0h + UINT32 LdtBaseHiDword; // fdd4h + UINT32 IdtBaseHiDword; // fdd8h + UINT8 Reserved2[0xc]; // fddch + UINT64 IO_EIP; // fde8h + UINT8 Reserved3[0x50]; // fdf0h + UINT32 _CR4; // fe40h + UINT8 Reserved4[0x48]; // fe44h + UINT32 GdtBaseLoDword; // fe8ch + UINT32 GdtLimit; // fe90h + UINT32 IdtBaseLoDword; // fe94h + UINT32 IdtLimit; // fe98h + UINT32 LdtBaseLoDword; // fe9ch + UINT32 LdtLimit; // fea0h + UINT32 LdtInfo; // fea4h + UINT8 Reserved5[0x50]; // fea8h + UINT32 SMBASE; // fef8h + UINT32 SMMRevId; // fefch + UINT16 AutoHALTRestart; // ff00h + UINT16 IORestart; // ff02h + UINT32 IEDBASE; // ff04h + UINT8 Reserved6[0x14]; // ff08h + UINT64 _R15; // ff1ch + UINT64 _R14; + UINT64 _R13; + UINT64 _R12; + UINT64 _R11; + UINT64 _R10; + UINT64 _R9; + UINT64 _R8; + UINT64 _RAX; // ff5ch + UINT64 _RCX; + UINT64 _RDX; + UINT64 _RBX; + UINT64 _RSP; + UINT64 _RBP; + UINT64 _RSI; + UINT64 _RDI; + UINT64 IOMemAddr; // ff9ch + UINT32 IOMisc; // ffa4h + UINT32 _ES; // ffa8h + UINT32 _CS; + UINT32 _SS; + UINT32 _DS; + UINT32 _FS; + UINT32 _GS; + UINT32 _LDTR; // ffc0h + UINT32 _TR; + UINT64 _DR7; // ffc8h + UINT64 _DR6; + UINT64 _RIP; // ffd8h + UINT64 IA32_EFER; // ffe0h + UINT64 _RFLAGS; // ffe8h + UINT64 _CR3; // fff0h + UINT64 _CR0; // fff8h +} EFI_SMM_CPU_STATE64; + +typedef union _EFI_SMM_CPU_STATE { + struct { + UINT8 Reserved[0x200]; + EFI_SMM_CPU_STATE32 x86; + }; + EFI_SMM_CPU_STATE64 x64; +} EFI_SMM_CPU_STATE; + +#define EFI_SMM_MIN_REV_ID_x64 0x30006 + +typedef struct _EFI_SMM_CPU_SAVE_STATE_PROTOCOL { + EFI_SMM_CPU_STATE **CpuSaveState; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmGpiDispatch.h b/Include/Protocol/SmmGpiDispatch.h new file mode 100644 index 0000000..e75e082 --- /dev/null +++ b/Include/Protocol/SmmGpiDispatch.h @@ -0,0 +1,106 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmGpiDispatch.h 3 7/08/09 8:02p Markw $ +// +// $Revision: 3 $ +// +// $Date: 7/08/09 8:02p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmGpiDispatch.h $ +// +// 3 7/08/09 8:02p Markw +// Update headers. +// +// 2 3/28/07 2:41p Markw +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmGpiDispatch.h +// +// Description: SMM GPI Dispatch Protocol header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_GPI_DISPATCH_PROTOCOL_H__ +#define __SMM_GPI_DISPATCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_GPI_DISPATCH_PROTOCOL_GUID \ + {0xe0744b81, 0x9513, 0x49cd, 0x8c, 0xea, 0xe9, 0x24, 0x5e, 0x70, 0x39, 0xda} + +GUID_VARIABLE_DECLARATION(gEfiSmmGpiDispatchProtocolGuid,EFI_SMM_GPI_DISPATCH_PROTOCOL_GUID); + +typedef struct _EFI_SMM_GPI_DISPATCH_PROTOCOL EFI_SMM_GPI_DISPATCH_PROTOCOL; + +typedef struct { + UINTN GpiNum; +} EFI_SMM_GPI_DISPATCH_CONTEXT; + +//********************************************** +// EFI_SMM_GPI_DISPATCH +//********************************************** +typedef VOID (EFIAPI *EFI_SMM_GPI_DISPATCH) ( + IN EFI_HANDLE DispatchHandle, + IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_GPI_REGISTER) ( + IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This, + IN EFI_SMM_GPI_DISPATCH DispatchFunction, + IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_GPI_UNREGISTER) ( + IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +struct _EFI_SMM_GPI_DISPATCH_PROTOCOL { + EFI_SMM_GPI_REGISTER Register; + EFI_SMM_GPI_UNREGISTER UnRegister; + UINTN NumSupportedGpis; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmGpiDispatch2.h b/Include/Protocol/SmmGpiDispatch2.h new file mode 100644 index 0000000..8bf8327 --- /dev/null +++ b/Include/Protocol/SmmGpiDispatch2.h @@ -0,0 +1,114 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmGpiDispatch2.h 2 3/04/11 3:36p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:36p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmGpiDispatch2.h $ +// +// 2 3/04/11 3:36p Markw +// Update headers. +// +// 1 2/07/11 4:03p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmGpiDispatch2.h +// +// Description: SMM GPI Dispatch Protocol header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_GPI_DISPATCH2_PROTOCOL_H__ +#define __SMM_GPI_DISPATCH2_PROTOCOL_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> +#include <SmmPi.h> + +#define EFI_SMM_GPI_DISPATCH2_PROTOCOL_GUID \ + {0x25566b03, 0xb577, 0x4cbf, 0x95, 0x8c, 0xed, 0x66, 0x3e, 0xa2, 0x43, 0x80} + +GUID_VARIABLE_DECLARATION(gEfiSmmGpiDispatch2ProtocolGuid,EFI_SMM_GPI_DISPATCH2_PROTOCOL_GUID); + +typedef struct _EFI_SMM_GPI_DISPATCH_PROTOCOL EFI_SMM_GPI_DISPATCH_PROTOCOL; + +typedef struct { + //A bit mask of 64 possible GPIs that can generate an SMI. Bit 0 corresponds to logical + //GPI[0], 1 corresponds to logical GPI[1], and so on. + UINT64 GpiNum; +} EFI_SMM_GPI_REGISTER_CONTEXT; + +typedef struct _EFI_SMM_GPI_DISPATCH2_PROTOCOL EFI_SMM_GPI_DISPATCH2_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_GPI_REGISTER2)( + IN CONST EFI_SMM_GPI_DISPATCH2_PROTOCOL *This, + IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, + IN CONST EFI_SMM_GPI_REGISTER_CONTEXT *RegisterContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_GPI_UNREGISTER2)( + IN CONST EFI_SMM_GPI_DISPATCH2_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +struct _EFI_SMM_GPI_DISPATCH2_PROTOCOL { + EFI_SMM_GPI_REGISTER2 Register; + EFI_SMM_GPI_UNREGISTER2 UnRegister; + UINTN NumSupportedGpis; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmIoTrapDispatch.h b/Include/Protocol/SmmIoTrapDispatch.h new file mode 100644 index 0000000..ad045bf --- /dev/null +++ b/Include/Protocol/SmmIoTrapDispatch.h @@ -0,0 +1,129 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SmmIoTrapDispatch.h 1 2/08/12 8:26a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/08/12 8:26a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SmmIoTrapDispatch.h $ +// +// 1 2/08/12 8:26a Yurenlai +// Intel Lynx Point/SB eChipset initially releases. +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: SmmIoTrapDispatch.h +// +// Description: The header file for I/O Trap SMM Dispatch Protocol. +// +//<AMI_FHDR_END> +//************************************************************************* + +#ifndef __SMM_IO_TRAP_DISPATCH_PROTOCOL_H__ +#define __SMM_IO_TRAP_DISPATCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +//follow Intel ref code IO TRAP GUID +//#define EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL_GUID \ +// { 0x58dc368d, 0x7bfa, 0x4e77, {0xab, 0xbc, 0xe, 0x29, 0x41, 0x8d, 0xf9, 0x30}} + +// {BD18369D-C242-45ca-82AD-138AC2E29BAB} +//#define EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL_GUID \ +// {0xbd18369d, 0xc242, 0x45ca, 0x82, 0xad, 0x13, 0x8a, 0xc2, 0xe2, 0x9b, 0xab} + +//GUID_VARIABLE_DECLARATION( gEfiSmmIoTrapDispatchProtocolGuid, \ +// EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL_GUID ); + +typedef enum { + ReadIoCycle = 0, + WriteIoCycle, + ReadWriteIoCycle +} EFI_SMM_IOTRAP_OP_TYPE; + +typedef enum { + AccessAny = 0, + AccessByte, + AccessWord, + AccessDWord +} EFI_SMM_ACCESS_WIDTH; + +typedef struct { + UINT16 Address; + UINT16 Length; + EFI_SMM_IOTRAP_OP_TYPE TrapOpType; + EFI_SMM_ACCESS_WIDTH TrapWidth; + UINT32 TrapAddress; + UINTN TrapData; + UINT32 TrapRegIndex; +} EFI_SMM_IO_TRAP_DISPATCH_CONTEXT; + +typedef struct _EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL \ + EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL; + +//****************************************************** +// EFI_SMM_IO_TRAP_DISPATCH +//****************************************************** +typedef VOID (EFIAPI *EFI_SMM_IO_TRAP_DISPATCH) ( + IN EFI_HANDLE DispatchHandle, + IN EFI_SMM_IO_TRAP_DISPATCH_CONTEXT *Context +); + + +typedef EFI_STATUS (EFIAPI *EFI_SMM_IO_TRAP_REGISTER) ( + IN EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL *This, + IN EFI_SMM_IO_TRAP_DISPATCH DispatchFunction, + IN EFI_SMM_IO_TRAP_DISPATCH_CONTEXT *DispatchContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_IO_TRAP_UNREGISTER) ( + IN EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + + +struct _EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL { + EFI_SMM_IO_TRAP_REGISTER Register; + EFI_SMM_IO_TRAP_UNREGISTER UnRegister; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmIoTrapDispatch2.h b/Include/Protocol/SmmIoTrapDispatch2.h new file mode 100644 index 0000000..42941f6 --- /dev/null +++ b/Include/Protocol/SmmIoTrapDispatch2.h @@ -0,0 +1,122 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmIoTrapDispatch2.h 2 3/04/11 3:36p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:36p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmIoTrapDispatch2.h $ +// +// 2 3/04/11 3:36p Markw +// Update headers. +// +// 1 2/07/11 4:03p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmBiosWriteDispatch2.h +// +// Description: SMM BIOS write Dispatch Protocol header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_IO_TRAP_DISPATCH_PROTOCOL2_H__ +#define __SMM_IO_TRAP_DISPATCH_PROTOCOL2_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif +#include <Efi.h> +#include <SmmPi.h> + +#define EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID \ + {0x58dc368d, 0x7bfa, 0x4e77, 0xab, 0xbc, 0xe, 0x29, 0x41, 0x8d, 0xf9, 0x30 } + +GUID_VARIABLE_DECLARATION(gEfiSmmIoTrapDispatch2ProtocolGuid, EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID); + +typedef enum { + WriteTrap, + ReadTrap, + ReadWriteTrap, + IoTrapTypeMaximum +} EFI_SMM_IO_TRAP_DISPATCH_TYPE; + +typedef struct { + UINT16 Address; + UINT16 Length; + EFI_SMM_IO_TRAP_DISPATCH_TYPE Type; +} EFI_SMM_IO_TRAP_REGISTER_CONTEXT; + +typedef struct { + UINT32 WriteData; +} EFI_SMM_IO_TRAP_CONTEXT; + +typedef struct _EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_IO_TRAP_DISPATCH2_REGISTER) ( + IN CONST EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL *This, + IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, + IN OUT EFI_SMM_IO_TRAP_REGISTER_CONTEXT *RegisterContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_IO_TRAP_DISPATCH2_UNREGISTER) ( + IN CONST EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +struct _EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL { + EFI_SMM_IO_TRAP_DISPATCH2_REGISTER Register; + EFI_SMM_IO_TRAP_DISPATCH2_UNREGISTER UnRegister; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmPchIoTrapDispatch2.h b/Include/Protocol/SmmPchIoTrapDispatch2.h new file mode 100644 index 0000000..b2c4b7c --- /dev/null +++ b/Include/Protocol/SmmPchIoTrapDispatch2.h @@ -0,0 +1,134 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SmmPchIoTrapDispatch2.h 1 2/08/12 8:26a Yurenlai $ +// +// $Revision: 1 $ +// +// $Date: 2/08/12 8:26a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SmmPchIoTrapDispatch2.h $ +// +// 1 2/08/12 8:26a Yurenlai +// Intel Lynx Point/SB eChipset initially releases. +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: SmmIoTrap2Dispatch.h +// +// Description: The header file for I/O Trap # 2 SMM Dispatch Protocol. +// +// Note: This GUID & Contexts are followed Platform Initialization +// specification 1.2 +// +//<AMI_FHDR_END> +//************************************************************************* + +#ifndef __SMM_IO_TRAP_DISPATCH2_PROTOCOL_H__ +#define __SMM_IO_TRAP_DISPATCH2_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +//#### {58DC368D-7BFA-4E77-ABBC-0E29418DF930} +//#####define EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID \ +//#### {0x58dc368d, 0x7bfa, 0x4e77, 0xab, 0xbc, 0x0e, 0x29, 0x41, 0x8d, 0xf9, 0x30} +// For avoid conflicting with Intel RC's "EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL_GUID", +// therefore AMI modifies the IO trap #2 GUID. +#define EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID \ + {0xf1507845, 0x6494, 0x4377, 0xa1, 0x15, 0x45, 0xdf, 0xe6, 0x5f, 0x5d, 0x71} + +GUID_VARIABLE_DECLARATION( gEfiSmmIoTrapDispatch2ProtocolGuid, \ + EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID ); + +// I/O Trap valid types + +typedef enum { + WriteTrap = 0, + ReadTrap, + ReadWriteTrap, + IoTrapTypeMaximum +} EFI_SMM_IO_TRAP_DISPATCH_TYPE; + +// I/O Trap #2 context structure containing information about the I/O Trap +// event that should invoke the handler + +typedef struct { + UINT16 Address; + UINT16 Length; + EFI_SMM_IO_TRAP_DISPATCH_TYPE Type; +} EFI_SMM_IO_TRAP_REGISTER_CONTEXT; + +// I/O Trap #2 context structure containing information about the I/O Trap +// that occurred. + +typedef struct { + UINT32 WriteData; +} EFI_SMM_IO_TRAP_CONTEXT; + +typedef struct _EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL \ + EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL; + +//****************************************************** +// EFI_SMM_IO_TRAP_DISPATCH2 +//****************************************************** +typedef VOID (EFIAPI *EFI_SMM_IO_TRAP_DISPATCH2) ( + IN EFI_HANDLE DispatchHandle, + IN EFI_SMM_IO_TRAP_CONTEXT *Context +); + + +typedef EFI_STATUS (EFIAPI *EFI_SMM_IO_TRAP_DISPATCH2_REGISTER) ( + IN EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL *This, + IN EFI_SMM_IO_TRAP_DISPATCH2 DispatchFunction, + IN OUT EFI_SMM_IO_TRAP_REGISTER_CONTEXT *DispatchContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_IO_TRAP_DISPATCH2_UNREGISTER) ( + IN EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + + +struct _EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL { + EFI_SMM_IO_TRAP_DISPATCH2_REGISTER Register; + EFI_SMM_IO_TRAP_DISPATCH2_UNREGISTER UnRegister; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmPciRootBridgeIo.h b/Include/Protocol/SmmPciRootBridgeIo.h new file mode 100644 index 0000000..f11eca9 --- /dev/null +++ b/Include/Protocol/SmmPciRootBridgeIo.h @@ -0,0 +1,78 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmPciRootBridgeIo.h 3 4/15/11 4:32p Markw $ +// +// $Revision: 3 $ +// +// $Date: 4/15/11 4:32p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmPciRootBridgeIo.h $ +// +// 3 4/15/11 4:32p Markw +// Header Update. +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmPciRootBridgeIo.h +// +// Description: +// Smm Pci Root Bridge Io Protocol +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef _SMM_PCI_ROOT_BRIDGE_IO_H_ +#define _SMM_PCI_ROOT_BRIDGE_IO_H_ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif + +#include <Protocol/PciRootBridgeIo.h> + +#define EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \ + {0x8bc1714d, 0xffcb, 0x41c3, 0x89, 0xdc, 0x6c, 0x74, 0xd0, 0x6d, 0x98, 0xea} + +typedef EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL; + +GUID_VARIABLE_DECLARATION(gEfiSmmPciRootBridgeIoProtocolGuid, EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID); + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmPeriodicTimerDispatch.h b/Include/Protocol/SmmPeriodicTimerDispatch.h new file mode 100644 index 0000000..989e829 --- /dev/null +++ b/Include/Protocol/SmmPeriodicTimerDispatch.h @@ -0,0 +1,118 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmPeriodicTimerDispatch.h 3 7/08/09 8:02p Markw $ +// +// $Revision: 3 $ +// +// $Date: 7/08/09 8:02p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmPeriodicTimerDispatch.h $ +// +// 3 7/08/09 8:02p Markw +// Update headers. +// +// 2 3/28/07 2:41p Markw +// +//********************************************************************** + +//---------------------------------------------------------------------------- +//<AMI_FHDR_START> +// +// Name: SmmPeriodicTimerDispatch.h +// +// Description: Smm Periodic Timer Dispatch Protocol header. +// +//<AMI_FHDR_END> +//---------------------------------------------------------------------------- +#ifndef __SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_H__ +#define __SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID \ + {0x9cca03fc, 0x4c9e, 0x4a19, 0x9b, 0x6, 0xed, 0x7b, 0x47, 0x9b, 0xde, 0x55} + +GUID_VARIABLE_DECLARATION(gEfiSmmPeriodicTimerDispatchProtocolGuid,EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID); + +typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL; + + +//******************************************************* +// EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT +//******************************************************* +typedef struct { + UINT64 Period; + UINT64 SmiTickInterval; + UINT64 ElapsedTime; +} EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT; + +//******************************************************* +// EFI_SMM_PERIODIC_TIMER_DISPATCH +//******************************************************* +typedef VOID (EFIAPI *EFI_SMM_PERIODIC_TIMER_DISPATCH) ( + IN EFI_HANDLE DispatchHandle, + IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT *DispatchContext +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER) ( + IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This, + IN EFI_SMM_PERIODIC_TIMER_DISPATCH DispatchFunction, + IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT *DispatchContext, + OUT EFI_HANDLE *DispatchHandle +); + + +typedef EFI_STATUS (EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER) ( + IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_PERIODIC_TIMER_INTERVAL) ( + IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This, + IN OUT UINT64 **SmiTickInterval +); + + +struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL { + EFI_SMM_PERIODIC_TIMER_REGISTER Register; + EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister; + EFI_SMM_PERIODIC_TIMER_INTERVAL GetNextShorterInterval; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmPeriodicTimerDispatch2.h b/Include/Protocol/SmmPeriodicTimerDispatch2.h new file mode 100644 index 0000000..d636d15 --- /dev/null +++ b/Include/Protocol/SmmPeriodicTimerDispatch2.h @@ -0,0 +1,121 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmPeriodicTimerDispatch2.h 2 3/04/11 3:36p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:36p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmPeriodicTimerDispatch2.h $ +// +// 2 3/04/11 3:36p Markw +// Update headers. +// +// 1 2/07/11 4:03p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +// 3 7/08/09 8:02p Markw +// Update headers. +// +// 2 3/28/07 2:41p Markw +// +//********************************************************************** + +//---------------------------------------------------------------------------- +//<AMI_FHDR_START> +// +// Name: SmmPeriodicTimerDispatch2.h +// +// Description: Smm Periodic Timer Dispatch Protocol header. +// +//<AMI_FHDR_END> +//---------------------------------------------------------------------------- + +#ifndef __SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL_H__ +#define __SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> +#include <SmmPi.h> + + +#define EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL_GUID \ + {0x4cec368e, 0x8e8e, 0x4d71, 0x8b, 0xe1, 0x95, 0x8c, 0x45, 0xfc, 0x8a, 0x53} + +GUID_VARIABLE_DECLARATION(gEfiSmmPeriodicTimerDispatch2ProtocolGuid,EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL_GUID); + +typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL; + +typedef struct { + UINT64 Period; + UINT64 SmiTickInterval; +} EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER2) ( + IN CONST EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL *This, + IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, + IN CONST EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT *RegisterContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER2) ( + IN CONST EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_PERIODIC_TIMER_INTERVAL2) ( + IN CONST EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL *This, + IN OUT UINT64 **SmiTickInterval +); + +typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL { + EFI_SMM_PERIODIC_TIMER_REGISTER2 Register; + EFI_SMM_PERIODIC_TIMER_UNREGISTER2 UnRegister; + EFI_SMM_PERIODIC_TIMER_INTERVAL2 GetNextShorterInterval; +} EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmPiProtocols.cif b/Include/Protocol/SmmPiProtocols.cif new file mode 100644 index 0000000..837ec37 --- /dev/null +++ b/Include/Protocol/SmmPiProtocols.cif @@ -0,0 +1,27 @@ +<component> + name = "SmmPiProtocols" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "SmmPiProtocols" +[files] +"SmmPiProtocols.sdl" +"SmmBase2.h" +"SmmAccess2.h" +"SmmControl2.h" +"SmmCommunication.h" +"SmmCpu.h" +"SmmCpuIo2.h" +"SmmPciRootBridgeIo.h" +"SmmReadyToLock.h" +"DxeSmmReadyToLock.h" +"SmmStatusCode.h" +"SmmSwDispatch2.h" +"SmmSxDispatch2.h" +"SmmPowerButtonDispatch2.h" +"SmmStandbyButtonDispatch2.h" +"SmmUsbDispatch2.h" +"SmmGpiDispatch2.h" +"SmmPeriodicTimerDispatch2.h" +"SmmIoTrapDispatch2.h" +"AmiInternalSmmComm.h" +<endComponent> diff --git a/Include/Protocol/SmmPiProtocols.sdl b/Include/Protocol/SmmPiProtocols.sdl new file mode 100644 index 0000000..a2fc051 --- /dev/null +++ b/Include/Protocol/SmmPiProtocols.sdl @@ -0,0 +1,11 @@ +TOKEN + Name = "SMM_PI_PROTOCOLS_SUPPORT" + Value = "1" + Help = "Main switch to enable SMM PI Protocols in Project" + TokenType = Boolean + TargetEQU = Yes + TargetMAK = Yes + TargetH = Yes + Master = Yes + Token = "PI_SPECIFICATION_VERSION" ">=" "0x1000A" +End diff --git a/Include/Protocol/SmmPowerButtonDispatch.h b/Include/Protocol/SmmPowerButtonDispatch.h new file mode 100644 index 0000000..9086cb8 --- /dev/null +++ b/Include/Protocol/SmmPowerButtonDispatch.h @@ -0,0 +1,132 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmPowerButtonDispatch.h 3 7/08/09 8:02p Markw $ +// +// $Revision: 3 $ +// +// $Date: 7/08/09 8:02p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmPowerButtonDispatch.h $ +// +// 3 7/08/09 8:02p Markw +// Update headers. +// +// 2 3/28/07 2:45p Markw +// +// 1 3/18/07 1:54p Markw +// +// 2 3/13/06 1:40a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 2/17/04 5:15p Markw +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: PowerButtonDispatch.h +// +// Description: Power Button Dispatch Protocol Header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_POWER_BUTTON_DISPATCH_PROTOCOL_H__ +#define __SMM_POWER_BUTTON_DISPATCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID \ + {0xb709efa0, 0x47a6, 0x4b41, 0xb9, 0x31, 0x12, 0xec, 0xe7, 0xa8, 0xee, 0x56 } + +GUID_VARIABLE_DECLARATION(gEfiSmmPowerButtonDispatchProtocolGuid,EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID); + +typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL; + +//****************************************************** +// EFI_POWER_BUTTON_PHASE +//****************************************************** +typedef enum { + PowerButtonEntry, PowerButtonExit +} EFI_POWER_BUTTON_PHASE; +// Power Button. Example, Use for changing LEDs before ACPI OS is +// on. +// - DXE/BDS Phase +// - OS Install Phase + +//****************************************************** +// EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT +//****************************************************** +typedef struct { + EFI_POWER_BUTTON_PHASE Phase; +} EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT; + +//****************************************************** +// EFI_SMM_POWER_BUTTON_DISPATCH +//****************************************************** +typedef VOID (EFIAPI *EFI_SMM_POWER_BUTTON_DISPATCH) ( + IN EFI_HANDLE DispatchHandle, + IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER) ( + IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This, + IN EFI_SMM_POWER_BUTTON_DISPATCH DispatchFunction, + IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER) ( + IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL { + EFI_SMM_POWER_BUTTON_REGISTER Register; + EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmPowerButtonDispatch2.h b/Include/Protocol/SmmPowerButtonDispatch2.h new file mode 100644 index 0000000..870cecd --- /dev/null +++ b/Include/Protocol/SmmPowerButtonDispatch2.h @@ -0,0 +1,119 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmPowerButtonDispatch2.h 2 3/04/11 3:36p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:36p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmPowerButtonDispatch2.h $ +// +// 2 3/04/11 3:36p Markw +// Update headers. +// +// 1 2/07/11 4:03p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: PowerButtonDispatch2.h +// +// Description: Power Button Dispatch Protocol Header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_H__ +#define __SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif +#include <Efi.h> +#include <SmmPi.h> + + +#define EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_GUID \ + {0x1b1183fa, 0x1823, 0x46a7, 0x88, 0x72, 0x9c, 0x57, 0x87, 0x55, 0x40, 0x9d } + +GUID_VARIABLE_DECLARATION(gEfiSmmPowerButtonDispatch2ProtocolGuid,EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_GUID); + +typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL; + +typedef enum { + EfiPowerButtonEntry, + EfiPowerButtonExit, + EfiPowerButtonMax +} EFI_POWER_BUTTON_PHASE; + +typedef struct { + EFI_POWER_BUTTON_PHASE Phase; +} EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT; + + +typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER2)( + IN CONST EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL *This, + IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, + IN EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT *RegisterContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER2)( + IN CONST EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +// This protocol provides the parent dispatch service for the power button SMI source generator. +struct _EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL { + EFI_SMM_POWER_BUTTON_REGISTER2 Register; + EFI_SMM_POWER_BUTTON_UNREGISTER2 UnRegister; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmProtocols.cif b/Include/Protocol/SmmProtocols.cif new file mode 100644 index 0000000..89457cc --- /dev/null +++ b/Include/Protocol/SmmProtocols.cif @@ -0,0 +1,22 @@ +<component> + name = "SmmProtocols" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "SmmProtocols" +[files] +"SmmBase.h" +"SmmAccess.h" +"SmmControl.h" +"SmmCpuState.h" +"SmmThunk.h" +"SmmStatusCode.h" +"SmmSwDispatch.h" +"SmmSxDispatch.h" +"SmmPowerButtonDispatch.h" +"SmmStandbyButtonDispatch.h" +"SmmUsbDispatch.h" +"SmmGpiDispatch.h" +"SmmPeriodicTimerDispatch.h" +"SmmTcoDispatch.h" +"AmiSmmInfo.h" +<endComponent> diff --git a/Include/Protocol/SmmReadyToLock.h b/Include/Protocol/SmmReadyToLock.h new file mode 100644 index 0000000..b48ab50 --- /dev/null +++ b/Include/Protocol/SmmReadyToLock.h @@ -0,0 +1,73 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmReadyToLock.h 3 6/24/11 2:11p Felixp $ +// +// $Revision: 3 $ +// +// $Date: 6/24/11 2:11p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmReadyToLock.h $ +// +// 3 6/24/11 2:11p Felixp +// DxeSmmReadyToLock protocol definitions are moved to DxeSmmReadyToLock.h +// +// 6 1/13/10 2:13p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SmmReadyToLock.h +// +// Description: SmmReadyToLock protocol definition +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SMM_READY_TO_LOCK__H__ +#define __SMM_READY_TO_LOCK__H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_SMM_READY_TO_LOCK_PROTOCOL_GUID \ + {0x47b7fa8c, 0xf4bd, 0x4af6, 0x82, 0x00, 0x33, 0x30, 0x86, 0xf0, 0xd2, 0xc8 } + +GUID_VARIABLE_DECLARATION(gEfiSmmReadyToLockProtocolGuid,EFI_SMM_READY_TO_LOCK_PROTOCOL_GUID); + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmReportStatusCodeHandler.h b/Include/Protocol/SmmReportStatusCodeHandler.h new file mode 100644 index 0000000..862d0cd --- /dev/null +++ b/Include/Protocol/SmmReportStatusCodeHandler.h @@ -0,0 +1,93 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/SmmReportStatusCodeHandler.h 1 6/16/11 9:48a Felixp $ +// +// $Revision: 1 $ +// +// $Date: 6/16/11 9:48a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/SmmReportStatusCodeHandler.h $ +// +// 1 6/16/11 9:48a Felixp +// +// 6 1/13/10 2:13p Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SmmReportStatusCodeHandler.h +// +// Description: Smm Report Status Code Handler Protocol definitions header. +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__ +#define __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_SMM_RSC_HANDLER_PROTOCOL_GUID \ + {0x2ff29fa7, 0x5e80, 0x4ed9, 0xb3, 0x80, 0x1, 0x7d, 0x3c, 0x55, 0x4f, 0xf4} + +GUID_VARIABLE_DECLARATION(gEfiSmmRscHandlerProtocolGuid, EFI_SMM_RSC_HANDLER_PROTOCOL_GUID); + +typedef EFI_STATUS +(EFIAPI *EFI_SMM_RSC_HANDLER_CALLBACK) ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data +); + +typedef EFI_STATUS +(EFIAPI *EFI_SMM_RSC_HANDLER_REGISTER) ( + IN EFI_SMM_RSC_HANDLER_CALLBACK Callback //A pointer to a function of type EFI_SMM_RSC_HANDLER_CALLBACK that is + //called when call to ReportStatusCode() occurs. +); + +typedef EFI_STATUS +(EFIAPI *EFI_SMM_RSC_HANDLER_UNREGISTER) ( + IN EFI_SMM_RSC_HANDLER_CALLBACK Callback //A pointer to a function of type EFI_SMM_RSC_HANDLER_CALLBACK that is + //to be unregistered. +); + +typedef struct _EFI_SMM_RSC_HANDLER_PROTOCOL { + EFI_SMM_RSC_HANDLER_REGISTER Register; //Register the callback for notification of status code messages. + EFI_SMM_RSC_HANDLER_UNREGISTER Unregister; //Unregister the callback. +} EFI_SMM_RSC_HANDLER_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif // __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/SmmStandbyButtonDispatch.h b/Include/Protocol/SmmStandbyButtonDispatch.h new file mode 100644 index 0000000..50060c3 --- /dev/null +++ b/Include/Protocol/SmmStandbyButtonDispatch.h @@ -0,0 +1,123 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmStandbyButtonDispatch.h 3 7/08/09 8:02p Markw $ +// +// $Revision: 3 $ +// +// $Date: 7/08/09 8:02p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmStandbyButtonDispatch.h $ +// +// 3 7/08/09 8:02p Markw +// Update headers. +// +// 2 3/28/07 2:44p Markw +// +//********************************************************************** + +//<AMI_FHDR_START> +//----------------------------------------------------------------------------// +// Name: StandbyButtonDispatch.h +// +// Description: Standby Button Dispatch Protocol Header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_H__ +#define __SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID \ + {0x78965b98, 0xb0bf, 0x449e, 0x8b, 0x22, 0xd2, 0x91, 0x4e, 0x49, 0x8a, 0x98} + +GUID_VARIABLE_DECLARATION(gEfiSmmStandbyButtonDispatchProtocolGuid,EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID); + +typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL; + + +//***************************************************** +// EFI_STANDBY_BUTTON_PHASE; +//***************************************************** +typedef enum { + Entry, Exit +} EFI_STANDBY_BUTTON_PHASE; + +// +// Standby Button. Example, Use for changing LEDs before ACPI OS +// is on. +// - DXE/BDS Phase +// - OS Install Phase +// + + +//***************************************************** +// EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT +//***************************************************** +typedef struct { + EFI_STANDBY_BUTTON_PHASE Phase; +} EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT; + +//***************************************************** +// EFI_SMM_STANDBY_BUTTON_DISPATCH +//***************************************************** +typedef VOID (EFIAPI *EFI_SMM_STANDBY_BUTTON_DISPATCH) ( + IN EFI_HANDLE DispatchHandle, + IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER) ( + IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This, + IN EFI_SMM_STANDBY_BUTTON_DISPATCH DispatchFunction, + IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER) ( + IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL { + EFI_SMM_STANDBY_BUTTON_REGISTER Register; + EFI_SMM_STANDBY_BUTTON_UNREGISTER UnRegister; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmStandbyButtonDispatch2.h b/Include/Protocol/SmmStandbyButtonDispatch2.h new file mode 100644 index 0000000..e05f5d9 --- /dev/null +++ b/Include/Protocol/SmmStandbyButtonDispatch2.h @@ -0,0 +1,124 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmStandbyButtonDispatch2.h 2 3/04/11 3:36p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:36p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmStandbyButtonDispatch2.h $ +// +// 2 3/04/11 3:36p Markw +// Update headers. +// +// 1 2/07/11 4:03p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +//********************************************************************** + +//<AMI_FHDR_START> +//----------------------------------------------------------------------------// +// Name: StandbyButtonDispatch2.h +// +// Description: Standby Button Dispatch Protocol Header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_H__ +#define __SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif + +#include <Efi.h> +#include <SmmPi.h> + + +///////////////////////////////////////////////////// +// PI 1.1 Definitions +//////////////////////////////////////////////////// +#define EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_GUID \ + {0x7300c4a1, 0x43f2, 0x4017, 0xa5, 0x1b, 0xc8, 0x1a, 0x7f, 0x40, 0x58, 0x5b} + +GUID_VARIABLE_DECLARATION(gEfiSmmStandbyButtonDispatch2ProtocolGuid,EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_GUID); + +typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL; + + +typedef enum { + EfiStandbyButtonEntry, + EfiStandbyButtonExit, + EfiStandbyButtonMax +} EFI_STANDBY_BUTTON_PHASE; + +typedef struct { + //Describes whether the child handler should be invoked upon the entry to the button, activation, or exit. + EFI_STANDBY_BUTTON_PHASE Phase; +} EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER2)( + IN CONST EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL *This, + IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, + IN EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT *RegisterContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER2)( + IN CONST EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +/// +/// This protocol provides the parent dispatch service for the standby +/// button SMI source generator. +/// +struct _EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL { + EFI_SMM_STANDBY_BUTTON_REGISTER2 Register; + EFI_SMM_STANDBY_BUTTON_UNREGISTER2 UnRegister; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmStatusCode.h b/Include/Protocol/SmmStatusCode.h new file mode 100644 index 0000000..c5d3e96 --- /dev/null +++ b/Include/Protocol/SmmStatusCode.h @@ -0,0 +1,106 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmStatusCode.h 4 4/18/11 5:11p Markw $ +// +// $Revision: 4 $ +// +// $Date: 4/18/11 5:11p $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmStatusCode.h $ +// +// 4 4/18/11 5:11p Markw +// Revert back to Rev 1. +// +// 3 3/04/11 3:36p Markw +// Update headers. +// +// 2 7/08/09 8:02p Markw +// Update headers. +// +// 1 3/18/07 1:54p Markw +// +// 2 3/13/06 1:40a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 3 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 2 3/30/04 3:16p Markw +// Removed duplicate definition. +// +// 1 2/17/04 2:09p Markw +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: SmmStatusCode_h +// +// Description: This file is an include file used to define the Protocol for the +// Firmware Volume Block Protocol. +// +//<AMI_FHDR_END> +//***************************************************************************** +#ifndef __SMM_STATUS_CODE_PROTOCOL_H__ +#define __SMM_STATUS_CODE_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_STATUS_CODE_PROTOCOL_GUID \ + {0x6afd2b77,0x98c1,0x4acd,0xa6,0xf9,0x8a,0x94,0x39,0xde,0xf,0xb1} + +GUID_VARIABLE_DECLARATION(gEfiSmmStatusCodeProtocolGuid,EFI_SMM_STATUS_CODE_PROTOCOL_GUID); + +typedef struct _EFI_SMM_STATUS_CODE_PROTOCOL EFI_SMM_STATUS_CODE_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_REPORT_STATUS_CODE) ( + IN EFI_SMM_STATUS_CODE_PROTOCOL *This, + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID *CallerId, + IN EFI_STATUS_CODE_DATA *Data OPTIONAL +); + +struct _EFI_SMM_STATUS_CODE_PROTOCOL { + EFI_SMM_REPORT_STATUS_CODE ReportStatusCode; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmSwDispatch.h b/Include/Protocol/SmmSwDispatch.h new file mode 100644 index 0000000..988c08d --- /dev/null +++ b/Include/Protocol/SmmSwDispatch.h @@ -0,0 +1,121 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmSwDispatch.h 3 7/08/09 8:02p Markw $ +// +// $Revision: 3 $ +// +// $Date: 7/08/09 8:02p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmSwDispatch.h $ +// +// 3 7/08/09 8:02p Markw +// Update headers. +// +// 2 3/28/07 2:48p Markw +// +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmSwDispatch.h +// +// Description: SMM SW Dispatch Protocol header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_SW_DISPATCH_PROTOCOL_H__ +#define __SMM_SW_DISPATCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_SW_DISPATCH_PROTOCOL_GUID \ + {0xe541b773, 0xdd11, 0x420c, 0xb0, 0x26, 0xdf, 0x99, 0x36, 0x53, 0xf8, 0xbf} + +GUID_VARIABLE_DECLARATION(gEfiSmmSwDispatchProtocolGuid,EFI_SMM_SW_DISPATCH_PROTOCOL_GUID); + +typedef struct _EFI_SMM_SW_DISPATCH_PROTOCOL EFI_SMM_SW_DISPATCH_PROTOCOL; + + + +//****************************************************** +// EFI_SMM_SW_DISPATCH_CONTEXT +//****************************************************** +// +// A particular chipset may not support all possible software SMI +// input values. For example, the ICH supports only values 00h to +// 0FFh. The parent only allows a single child registration for +// each SwSmiInputValue. +// +typedef struct { + UINTN SwSmiInputValue; +} EFI_SMM_SW_DISPATCH_CONTEXT; + + +//****************************************************** +// EFI_SMM_SW_DISPATCH +//****************************************************** +typedef VOID (EFIAPI *EFI_SMM_SW_DISPATCH) ( + IN EFI_HANDLE DispatchHandle, + IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext +); + + +typedef EFI_STATUS (EFIAPI *EFI_SMM_SW_REGISTER) ( + IN EFI_SMM_SW_DISPATCH_PROTOCOL *This, + IN EFI_SMM_SW_DISPATCH DispatchFunction, + IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_SW_UNREGISTER) ( +IN EFI_SMM_SW_DISPATCH_PROTOCOL *This, +IN EFI_HANDLE DispatchHandle +); + + +struct _EFI_SMM_SW_DISPATCH_PROTOCOL { + EFI_SMM_SW_REGISTER Register; + EFI_SMM_SW_UNREGISTER UnRegister; + UINTN MaximumSwiValue; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmSwDispatch2.h b/Include/Protocol/SmmSwDispatch2.h new file mode 100644 index 0000000..cac7825 --- /dev/null +++ b/Include/Protocol/SmmSwDispatch2.h @@ -0,0 +1,133 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmSwDispatch2.h 2 3/04/11 3:36p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:36p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmSwDispatch2.h $ +// +// 2 3/04/11 3:36p Markw +// Update headers. +// +// 1 2/07/11 4:03p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmSwDispatch2.h +// +// Description: SMM SW Dispatch Protocol header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_SW_DISPATCH2_PROTOCOL_H__ +#define __SMM_SW_DISPATCH2_PROTOCOL_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif + +#include <Efi.h> +#include <SmmPi.h> + +#define EFI_SMM_SW_DISPATCH2_PROTOCOL_GUID \ + {0x18a3c6dc, 0x5eea, 0x48c8, 0xa1, 0xc1, 0xb5, 0x33, 0x89, 0xf9, 0x89, 0x99} + +GUID_VARIABLE_DECLARATION(gEfiSmmSwDispatch2ProtocolGuid,EFI_SMM_SW_DISPATCH2_PROTOCOL_GUID); + +typedef struct _EFI_SMM_SW_DISPATCH2_PROTOCOL EFI_SMM_SW_DISPATCH2_PROTOCOL; + +// +// A particular chipset may not support all possible software SMI input values. +// For example, the ICH supports only values 00h to 0FFh. The parent only allows a single +// child registration for each SwSmiInputValue. +// +typedef struct { + UINTN SwSmiInputValue; +} EFI_SMM_SW_REGISTER_CONTEXT; + +// +// The DispatchFunction will be called with Context set to the same value as was passed into +// this function in RegisterContext and with CommBuffer (and CommBufferSize) pointing +// to an instance of EFI_SMM_SW_CONTEXT indicating the index of the CPU which generated the +// software SMI. +// +typedef struct { + UINTN SwSmiCpuIndex;//The 0-based index of the CPU which generated the software SMI. + UINT8 CommandPort; //This value corresponds directly to the CommandPort parameter used in the call to Trigger(). + UINT8 DataPort; //This value corresponds directly to the DataPort parameter used in the call to Trigger(). +} EFI_SMM_SW_CONTEXT; + +typedef struct _EFI_SMM_SW_DISPATCH2_PROTOCOL EFI_SMM_SW_DISPATCH2_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_SW_REGISTER2)( + IN CONST EFI_SMM_SW_DISPATCH2_PROTOCOL *This, + IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, + IN CONST EFI_SMM_SW_REGISTER_CONTEXT *RegisterContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_SW_UNREGISTER2)( + IN CONST EFI_SMM_SW_DISPATCH2_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +// +// The EFI_SMM_SW_DISPATCH2_PROTOCOL provides the ability to install child handlers for the +// given software. These handlers will respond to software interrupts. +// +struct _EFI_SMM_SW_DISPATCH2_PROTOCOL { + EFI_SMM_SW_REGISTER2 Register; + EFI_SMM_SW_UNREGISTER2 UnRegister; + UINTN MaximumSwiValue; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmSxDispatch.h b/Include/Protocol/SmmSxDispatch.h new file mode 100644 index 0000000..f788f14 --- /dev/null +++ b/Include/Protocol/SmmSxDispatch.h @@ -0,0 +1,142 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmSxDispatch.h 4 2/07/11 3:38p Markw $ +// +// $Revision: 4 $ +// +// $Date: 2/07/11 3:38p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmSxDispatch.h $ +// +// 4 2/07/11 3:38p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] Smm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +// 3 7/08/09 8:02p Markw +// Update headers. +// +// 2 3/28/07 2:47p Markw +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmSxDispatch.h +// +// Description: SMM SX Dispatch Protocol Header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_SX_DISPATCH_PROTOCOL_H__ +#define __SMM_SX_DISPATCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_SX_DISPATCH_PROTOCOL_GUID \ + {0x14fc52be, 0x1dc, 0x426c, 0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0xa, 0xe8} + +GUID_VARIABLE_DECLARATION(gEfiSmmSxDispatchProtocolGuid,EFI_SMM_SX_DISPATCH_PROTOCOL_GUID); + +typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL EFI_SMM_SX_DISPATCH_PROTOCOL; + +#ifndef SMM_SX_DEF +#define SMM_SX_DEF + +//**************************************************** +// EFI_SLEEP_TYPE +//**************************************************** +typedef enum { + SxS0, SxS1, SxS2, SxS3, SxS4, SxS5, + EfiMaximumSleepType +} EFI_SLEEP_TYPE; + +//**************************************************** +// EFI_SLEEP_PHASE +//**************************************************** +typedef enum { + SxEntry, SxExit, + EfiMaximumPhase +} EFI_SLEEP_PHASE; + +#endif + + +//**************************************************** +// EFI_SMM_SX_DISPATCH_CONTEXT +//**************************************************** +typedef struct { + EFI_SLEEP_TYPE Type; + EFI_SLEEP_PHASE Phase; +} EFI_SMM_SX_DISPATCH_CONTEXT; + +//**************************************************** +// EFI_SMM_SX_DISPATCH +//**************************************************** +typedef VOID (EFIAPI *EFI_SMM_SX_DISPATCH) ( + IN EFI_HANDLE DispatchHandle, + IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_SX_REGISTER) ( + IN EFI_SMM_SX_DISPATCH_PROTOCOL *This, + IN EFI_SMM_SX_DISPATCH DispatchFunction, + IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext, + OUT EFI_HANDLE *DispatchHandle +); + + +typedef EFI_STATUS (EFIAPI *EFI_SMM_SX_UNREGISTER) ( + IN EFI_SMM_SX_DISPATCH_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + + +struct _EFI_SMM_SX_DISPATCH_PROTOCOL { + EFI_SMM_SX_REGISTER Register; + EFI_SMM_SX_UNREGISTER UnRegister; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmSxDispatch2.h b/Include/Protocol/SmmSxDispatch2.h new file mode 100644 index 0000000..9e028e6 --- /dev/null +++ b/Include/Protocol/SmmSxDispatch2.h @@ -0,0 +1,127 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmSxDispatch2.h 2 3/04/11 3:36p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:36p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmSxDispatch2.h $ +// +// 2 3/04/11 3:36p Markw +// Update headers. +// +// 1 2/07/11 4:03p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmSxDispatch2.h +// +// Description: SMM SX Dispatch Protocol Header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_SX_DISPATCH2_PROTOCOL_H__ +#define __SMM_SX_DISPATCH2_PROTOCOL_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif + +#include <Efi.h> +#include <SmmPi.h> + +#define EFI_SMM_SX_DISPATCH2_PROTOCOL_GUID \ + {0x456d2859, 0xa84b, 0x4e47, 0xa2, 0xee, 0x32, 0x76, 0xd8, 0x86, 0x99, 0x7d } + +GUID_VARIABLE_DECLARATION(gEfiSmmSxDispatch2ProtocolGuid,EFI_SMM_SX_DISPATCH2_PROTOCOL_GUID); + +typedef struct _EFI_SMM_SX_DISPATCH2_PROTOCOL EFI_SMM_SX_DISPATCH2_PROTOCOL; + +#ifndef SMM_SX_DEF +#define SMM_SX_DEF + +typedef enum { + SxS0, SxS1, SxS2, SxS3, SxS4, SxS5, + EfiMaximumSleepType +} EFI_SLEEP_TYPE; + +typedef enum { + SxEntry, SxExit, + EfiMaximumPhase +} EFI_SLEEP_PHASE; +#endif + + +typedef struct { + EFI_SLEEP_TYPE Type; + EFI_SLEEP_PHASE Phase; +} EFI_SMM_SX_REGISTER_CONTEXT; + +typedef struct _EFI_SMM_SX_DISPATCH2_PROTOCOL EFI_SMM_SX_DISPATCH2_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_SMM_SX_REGISTER2)( + IN CONST EFI_SMM_SX_DISPATCH2_PROTOCOL *This, + IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, + IN CONST EFI_SMM_SX_REGISTER_CONTEXT *RegisterContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_SX_UNREGISTER2)( + IN CONST EFI_SMM_SX_DISPATCH2_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +struct _EFI_SMM_SX_DISPATCH2_PROTOCOL { + EFI_SMM_SX_REGISTER2 Register; + EFI_SMM_SX_UNREGISTER2 UnRegister; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmTcoDispatch.h b/Include/Protocol/SmmTcoDispatch.h new file mode 100644 index 0000000..7fd907b --- /dev/null +++ b/Include/Protocol/SmmTcoDispatch.h @@ -0,0 +1,114 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2008, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmTcoDispatch.h 1 11/21/08 4:39p Yul $ +// +// $Revision: 1 $ +// +// $Date: 11/21/08 4:39p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmTcoDispatch.h $ +// +// 1 11/21/08 4:39p Yul +// +// 2 8/01/08 2:49p Yul +// Update for code review +// +// 1 12/14/07 12:42p Alexp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SmmTCODispatch_h +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __SMM_TCO_DISPATCH_PROTOCOL_H__ +#define __SMM_TCO_DISPATCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_TCO_DISPATCH_PROTOCOL_GUID \ +{0xe2d6bb1, 0xc624, 0x446d, 0x99, 0x82, 0x69, 0x3c, 0xd1, 0x81, 0xa6, 0x7} + +GUID_VARIABLE_DECLARATION(gEfiSmmTcoDispatchProtocolGuid, \ + EFI_SMM_TCO_DISPATCH_PROTOCOL_GUID); + +typedef struct _EFI_SMM_TCO_DISPATCH_PROTOCOL \ + EFI_SMM_TCO_DISPATCH_PROTOCOL; + + + +//****************************************************** +// EFI_SMM_TCO_DISPATCH_CONTEXT +//****************************************************** +typedef struct { + UINTN TcoBitOffset; +} EFI_SMM_TCO_DISPATCH_CONTEXT; + + +//****************************************************** +// EFI_SMM_TCO_DISPATCH +//****************************************************** +typedef VOID (EFIAPI *EFI_SMM_TCO_DISPATCH) ( + IN EFI_HANDLE DispatchHandle, + IN EFI_SMM_TCO_DISPATCH_CONTEXT *DispatchContext +); + + +typedef EFI_STATUS (EFIAPI *EFI_SMM_TCO_REGISTER) ( + IN EFI_SMM_TCO_DISPATCH_PROTOCOL *This, + IN EFI_SMM_TCO_DISPATCH DispatchFunction, + IN EFI_SMM_TCO_DISPATCH_CONTEXT *DispatchContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_TCO_UNREGISTER) ( +IN EFI_SMM_TCO_DISPATCH_PROTOCOL *This, +IN EFI_HANDLE DispatchHandle +); + + +struct _EFI_SMM_TCO_DISPATCH_PROTOCOL { + EFI_SMM_TCO_REGISTER Register; + EFI_SMM_TCO_UNREGISTER UnRegister; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2008, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/SmmThunk.h b/Include/Protocol/SmmThunk.h new file mode 100644 index 0000000..d52782e --- /dev/null +++ b/Include/Protocol/SmmThunk.h @@ -0,0 +1,252 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmThunk.h 5 7/08/09 8:02p Markw $ +// +// $Revision: 5 $ +// +// $Date: 7/08/09 8:02p $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmThunk.h $ +// +// 5 7/08/09 8:02p Markw +// Update headers. +// +// 4 5/21/09 9:52a Markw +// Added comments for the FarCall86 and FarCall86Ex may be used to do INT +// XX calls. +// +// 3 3/03/08 6:35p Markw +// Added 32-bit register for smm thunk. +// +// 2 10/29/07 11:00a Markw +// Update register name. It was the same as CSM, which caused a symbol +// redefintion when CSM headers are used with this header. +// +// 1 3/18/07 1:54p Markw +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: SmmThunk.h +// +// Description: This file is an include file used to define the Protocol for the +// SMM Thunk Protocol. +// +//<AMI_FHDR_END> +//***************************************************************************** +#ifndef __SMM_THUNK_PROTOCOL_H__ +#define __SMM_THUNK_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_THUNK_PROTOCOL_GUID \ + {0x2a82fce6,0x8bb6,0x413e,0xb9,0xeb,0x45,0xdf,0xc0,0x52,0x2d,0xf3} + +GUID_VARIABLE_DECLARATION(gEfiSmmThunkProtocolGuid,EFI_SMM_THUNK_PROTOCOL_GUID); + +typedef struct _EFI_SMM_THUNK_PROTOCOL EFI_SMM_THUNK_PROTOCOL; + +// +// SMM Thunk specification constant and types +// + +typedef struct { + UINT16 CF:1; + UINT16 Reserved1:1; + UINT16 PF:1; + UINT16 Reserved2:1; + UINT16 AF:1; + UINT16 Reserved3:1; + UINT16 ZF:1; + UINT16 SF:1; + UINT16 TF:1; + UINT16 IF:1; + UINT16 DF:1; + UINT16 OF:1; + UINT16 IOPL:2; + UINT16 NT:1; + UINT16 Reserved4:1; +} SMM_THUNK_FLAGS_REG; + +typedef struct { + UINT16 AX; + UINT16 BX; + UINT16 CX; + UINT16 DX; + UINT16 SI; + UINT16 DI; + SMM_THUNK_FLAGS_REG Flags; + UINT16 ES; + UINT16 CS; + UINT16 SS; + UINT16 DS; + UINT16 BP; +} SMM_THUNK_WORD_REGS; + +typedef struct { + UINT8 AL, AH; + UINT8 BL, BH; + UINT8 CL, CH; + UINT8 DL, DH; +} SMM_THUNK_BYTE_REGS; + +typedef union { + SMM_THUNK_WORD_REGS X; + SMM_THUNK_BYTE_REGS H; +} SMM_THUNK_IA32_REGISTER_SET; + +typedef struct { + UINT32 CF:1; + UINT32 Reserved1:1; + UINT32 PF:1; + UINT32 Reserved2:1; + UINT32 AF:1; + UINT32 Reserved3:1; + UINT32 ZF:1; + UINT32 SF:1; + UINT32 TF:1; + UINT32 IF:1; + UINT32 DF:1; + UINT32 OF:1; + UINT32 IOPL:2; + UINT32 NT:1; + UINT32 Reserved4:1; + UINT32 RF:1; + UINT32 VM:1; + UINT32 AC:1; + UINT32 VIF:1; + UINT32 VIP:1; + UINT32 ID:1; + UINT32 Reserved5:10; +} SMM_THUNK_FLAGS_REG_EX; + +typedef struct { + UINT32 EAX; + UINT32 EBX; + UINT32 ECX; + UINT32 EDX; + UINT32 ESI; + UINT32 EDI; + SMM_THUNK_FLAGS_REG_EX Flags; + UINT16 ES; + UINT16 CS; + UINT16 SS; + UINT16 DS; + UINT16 FS; + UINT16 GS; + UINT32 EBP; +} SMM_THUNK_DWORD_REGS_EX; + +typedef struct { + UINT16 AX; + UINT16 Reserved1; + UINT16 BX; + UINT16 Reserved2; + UINT16 CX; + UINT16 Reserved3; + UINT16 DX; + UINT16 Reserved4; + UINT16 SI; + UINT16 Reserved5; + UINT16 DI; + UINT16 Reserved6; + SMM_THUNK_FLAGS_REG Flags; + UINT16 Reserved7; + UINT16 ES; + UINT16 CS; + UINT16 SS; + UINT16 DS; + UINT16 FS; + UINT16 GS; + UINT16 BP; + UINT16 Reserved8; +} SMM_THUNK_WORD_REGS_EX; + +typedef struct { + UINT8 AL; + UINT8 AH; + UINT16 Reserved1; + UINT8 BL; + UINT8 BH; + UINT16 Reserved2; + UINT8 CL; + UINT8 CH; + UINT16 Reserved3; + UINT8 DL; + UINT8 DH; + UINT16 Reserved4; +} SMM_THUNK_BYTE_REGS_EX; + +typedef union { + SMM_THUNK_DWORD_REGS_EX E; + SMM_THUNK_WORD_REGS_EX X; + SMM_THUNK_BYTE_REGS_EX H; +} SMM_THUNK_IA32_REGISTER_SET_EX; + +typedef BOOLEAN (EFIAPI *EFI_SMM_FARCALL86) ( + IN EFI_SMM_THUNK_PROTOCOL *This, + IN UINT16 Segment, + IN UINT16 Offset, + IN SMM_THUNK_IA32_REGISTER_SET *Regs, + IN VOID *Stack, + IN UINTN StackSize +); + +typedef BOOLEAN (EFIAPI *EFI_SMM_FARCALL86_EX) ( + IN EFI_SMM_THUNK_PROTOCOL *This, + IN UINT16 Segment, + IN UINT16 Offset, + IN SMM_THUNK_IA32_REGISTER_SET_EX *Regs, + IN VOID *Stack, + IN UINTN StackSize +); + +//The FarCall86 and FarCall86Ex may be used to do INT XX calls. +//INT XX call: +// Stack = NULL +// StackSize = 0, +// Segment = Segment of INT xx. +// Offset = Offset of INT xx. + +typedef struct _EFI_SMM_THUNK_PROTOCOL { + EFI_SMM_FARCALL86 FarCall86; + EFI_SMM_FARCALL86_EX FarCall86Ex; +} EFI_SMM_THUNK_PROTOCOL; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmUsbDispatch.h b/Include/Protocol/SmmUsbDispatch.h new file mode 100644 index 0000000..b2c8e97 --- /dev/null +++ b/Include/Protocol/SmmUsbDispatch.h @@ -0,0 +1,135 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmUsbDispatch.h 5 4/06/11 5:55p Markw $ +// +// $Revision: 5 $ +// +// $Date: 4/06/11 5:55p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmUsbDispatch.h $ +// +// 5 4/06/11 5:55p Markw +// Remove Smm.h include. +// +// 4 2/07/11 3:38p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support. +// Small header update. +// [Files] Smm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +// 3 7/08/09 8:02p Markw +// Update headers. +// +// 2 3/28/07 2:43p Markw +// +//********************************************************************** + + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmUsbDispatch.h +// +// Description: Smm Usb Dispatch Protocol header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_USB_DISPATCH_PROTOCOL_H__ +#define __SMM_USB_DISPATCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_SMM_USB_DISPATCH_PROTOCOL_GUID \ + {0xa05b6ffd, 0x87af, 0x4e42, 0x95, 0xc9, 0x62, 0x28, 0xb6, 0x3c, 0xf3, 0xf3} + +GUID_VARIABLE_DECLARATION(gEfiSmmUsbDispatchProtocolGuid,EFI_SMM_USB_DISPATCH_PROTOCOL_GUID); + +typedef struct _EFI_SMM_USB_DISPATCH_PROTOCOL EFI_SMM_USB_DISPATCH_PROTOCOL; + +#ifndef SMM_USB_DEF +#define SMM_USB_DEF + +//******************************************************** +// EFI_USB_SMI_TYPE +//******************************************************** +typedef enum { + UsbLegacy, UsbWake +} EFI_USB_SMI_TYPE; + +//******************************************************** +// EFI_SMM_USB_DISPATCH_CONTEXT +//******************************************************** +typedef struct { + EFI_USB_SMI_TYPE Type; + EFI_DEVICE_PATH_PROTOCOL *Device; +} EFI_SMM_USB_DISPATCH_CONTEXT; + +#endif + +//******************************************************** +// EFI_SMM_USB_DISPATCH +//******************************************************** +typedef VOID (EFIAPI *EFI_SMM_USB_DISPATCH) ( + IN EFI_HANDLE DispatchHandle, + IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_USB_REGISTER) ( + IN EFI_SMM_USB_DISPATCH_PROTOCOL *This, + IN EFI_SMM_USB_DISPATCH DispatchFunction, + IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext, + OUT EFI_HANDLE *DispatchHandle +); + +typedef EFI_STATUS (EFIAPI *EFI_SMM_USB_UNREGISTER) ( + IN EFI_SMM_USB_DISPATCH_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle +); + +struct _EFI_SMM_USB_DISPATCH_PROTOCOL { + EFI_SMM_USB_REGISTER Register; + EFI_SMM_USB_UNREGISTER UnRegister; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SmmUsbDispatch2.h b/Include/Protocol/SmmUsbDispatch2.h new file mode 100644 index 0000000..bfc9c73 --- /dev/null +++ b/Include/Protocol/SmmUsbDispatch2.h @@ -0,0 +1,205 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMM/SmmUsbDispatch2.h 2 3/04/11 3:36p Markw $ +// +// $Revision: 2 $ +// +// $Date: 3/04/11 3:36p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMM/SmmUsbDispatch2.h $ +// +// 2 3/04/11 3:36p Markw +// Update headers. +// +// 1 2/07/11 4:04p Markw +// [TAG] EIP53481 +// [Category] New Feature +// [Description] Add PIWG 1.1 SMM support +// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, +// SmmDispatcher.h, SmmDispatcher.c, +// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c, +// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h, +// Smm Pi Protocol files, SmmPciRbio files +// +// 3 7/08/09 8:02p Markw +// Update headers. +// +// 2 3/28/07 2:43p Markw +// +//********************************************************************** + + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: SmmUsbDispatch.h +// +// Description: Smm Usb Dispatch Protocol header. +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef __SMM_USB_DISPATCH_PROTOCOL2_H__ +#define __SMM_USB_DISPATCH_PROTOCOL2_H__ +#if PI_SPECIFICATION_VERSION >= 0x0001000A + +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> +#include <SmmPi.h> + + +#ifndef SMM_USB_DEF +#define SMM_USB_DEF + +//******************************************************** +// EFI_USB_SMI_TYPE +//******************************************************** +typedef enum { + UsbLegacy, UsbWake +} EFI_USB_SMI_TYPE; + +//******************************************************** +// EFI_SMM_USB_DISPATCH_CONTEXT +//******************************************************** +typedef struct { + EFI_USB_SMI_TYPE Type; + EFI_DEVICE_PATH_PROTOCOL *Device; +} EFI_SMM_USB_DISPATCH_CONTEXT; + +#endif + +///////////////////////////////////////////////////// +// PI 1.1 Definitions +//////////////////////////////////////////////////// + +#define EFI_SMM_USB_DISPATCH2_PROTOCOL_GUID \ + {0xee9b8d90, 0xc5a6, 0x40a2, 0xbd, 0xe2, 0x52, 0x55, 0x8d, 0x33, 0xcc, 0xa1} + +GUID_VARIABLE_DECLARATION(gEfiSmmUsbDispatch2ProtocolGuid,EFI_SMM_USB_DISPATCH2_PROTOCOL_GUID); + +typedef struct _EFI_SMM_USB_DISPATCH2_PROTOCOL EFI_SMM_USB_DISPATCH2_PROTOCOL; + +/// +/// The dispatch function's context. +/// +typedef struct { + /// + /// Describes whether this child handler will be invoked in response to a USB legacy + /// emulation event, such as port-trap on the PS/2* keyboard control registers, or to a + /// USB wake event, such as resumption from a sleep state. + /// + EFI_USB_SMI_TYPE Type; + /// + /// The device path is part of the context structure and describes the location of the + /// particular USB host controller in the system for which this register event will occur. + /// This location is important because of the possible integration of several USB host + /// controllers in a system. + /// + EFI_DEVICE_PATH_PROTOCOL *Device; +} EFI_SMM_USB_REGISTER_CONTEXT; + + +/** + Provides the parent dispatch service for the USB SMI source generator. + + This service registers a function (DispatchFunction) which will be called when the USB- + related SMI specified by RegisterContext has occurred. On return, DispatchHandle + contains a unique handle which may be used later to unregister the function using UnRegister(). + The DispatchFunction will be called with Context set to the same value as was passed into + this function in RegisterContext and with CommBuffer containing NULL and + CommBufferSize containing zero. + + @param[in] This Pointer to the EFI_SMM_USB_DISPATCH2_PROTOCOL instance. + @param[in] DispatchFunction Function to register for handler when a USB-related SMI occurs. + @param[in] RegisterContext Pointer to the dispatch function's context. + The caller fills this context in before calling + the register function to indicate to the register + function the USB SMI types for which the dispatch + function should be invoked. + @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance. + + @retval EFI_SUCCESS The dispatch function has been successfully + registered and the SMI source has been enabled. + @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source. + @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The USB SMI type + is not within valid range. + @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this child. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SMM_USB_REGISTER2)( + IN CONST EFI_SMM_USB_DISPATCH2_PROTOCOL *This, + IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, + IN CONST EFI_SMM_USB_REGISTER_CONTEXT *RegisterContext, + OUT EFI_HANDLE *DispatchHandle + ); + +/** + Unregisters a USB service. + + This service removes the handler associated with DispatchHandle so that it will no longer be + called when the USB event occurs. + + @param[in] This Pointer to the EFI_SMM_USB_DISPATCH2_PROTOCOL instance. + @param[in] DispatchHandle Handle of the service to remove. + + @retval EFI_SUCCESS The dispatch function has been successfully + unregistered and the SMI source has been disabled + if there are no other registered child dispatch + functions for this SMI source. + @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SMM_USB_UNREGISTER2)( + IN CONST EFI_SMM_USB_DISPATCH2_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle + ); + +/// +/// Interface structure for the SMM USB SMI Dispatch2 Protocol +/// +/// This protocol provides the parent dispatch service for the USB SMI source generator. +/// +struct _EFI_SMM_USB_DISPATCH2_PROTOCOL { + EFI_SMM_USB_REGISTER2 Register; + EFI_SMM_USB_UNREGISTER2 UnRegister; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +#endif + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/StatusCode.h b/Include/Protocol/StatusCode.h new file mode 100644 index 0000000..cf539d8 --- /dev/null +++ b/Include/Protocol/StatusCode.h @@ -0,0 +1,94 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/StatusCode.h 2 10/07/06 10:17a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 10/07/06 10:17a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/StatusCode.h $ +// +// 2 10/07/06 10:17a Felixp +// UEFI 2.0 definitions added +// +// 1 3/13/06 1:45a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:42a Felixp +// +// 1 12/23/04 9:29a Felixp +// +// 1 4/07/04 5:19p Robert +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: StatusCode.h +// +// Description: This file is an include file used to define the Architectural +// Protocol for the Status Code Reporting. For questions about the +// specification refer to the DXE CIS, The Status Code Spec, +// and the EFI SPEC +// +//<AMI_FHDR_END> +//***************************************************************************** +#ifndef __STATUS_CODE_ARCH_PROTOCOL_H__ +#define __STATUS_CODE_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// GUID for the Status Code Architectural Protocol +#define EFI_STATUS_CODE_ARCH_PROTOCOL_GUID \ + { 0xd98e3ea3, 0x6f39, 0x4be4, 0x82, 0xce, 0x5a, 0x89, 0x0c, 0xcb, 0x2c, 0x95 } + +GUID_VARIABLE_DECLARATION(gEfiStatusCodeArchProtocolGuid, EFI_STATUS_CODE_ARCH_PROTOCOL_GUID); + +// UEFI 2.0 Status Code Runtime Protocol +#define EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID \ + { 0xd2b2b828, 0x826, 0x48a7, 0xb3, 0xdf, 0x98, 0x3c, 0x0, 0x60, 0x24, 0xf0} + +// Interface stucture for the STATUS CODE Runtime Protocol +typedef struct _EFI_STATUS_CODE_PROTOCOL { + EFI_REPORT_STATUS_CODE ReportStatusCode; +} EFI_STATUS_CODE_PROTOCOL; + +GUID_VARIABLE_DECLARATION(gEfiStatusCodeRuntimeProtocolGuid, EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID); +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/StorageSecurityCommand.h b/Include/Protocol/StorageSecurityCommand.h new file mode 100644 index 0000000..4a63cd9 --- /dev/null +++ b/Include/Protocol/StorageSecurityCommand.h @@ -0,0 +1,97 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Include/Protocol/StorageSecurityCommand.h 1 6/09/11 2:28p Artems $ +// +// $Revision: 1 $ +// +// $Date: 6/09/11 2:28p $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/StorageSecurityCommand.h $ +// +// 1 6/09/11 2:28p Artems +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: StorageSecurityCommand.h +// +// Description: +// EFI_DRIVER_HEALTH_PROTOCOL definition file +// +//<AMI_FHDR_END> +//************************************************************************* +#ifndef __STORAGE_SECURITY_COMMAND_PROTOCOL__H__ +#define __STORAGE_SECURITY_COMMAND_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <EFI.h> + +#define EFI_STORAGE_SECURITY_COMMAND_PROTOCOL_GUID \ + { 0xc88b0b6d, 0x0dfc, 0x49a7, 0x9c, 0xb4, 0x49, 0x7, 0x4b, 0x4c, 0x3a, 0x78 } + +GUID_VARIABLE_DECLARATION(gEfiStorageSecurityCommandProtocolGuid, EFI_STORAGE_SECURITY_COMMAND_PROTOCOL_GUID); + + +typedef struct _EFI_STORAGE_SECURITY_COMMAND_PROTOCOL EFI_STORAGE_SECURITY_COMMAND_PROTOCOL; + +typedef EFI_STATUS (EFIAPI *EFI_STORAGE_SECURITY_RECEIVE_DATA)( + IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This, + IN UINT32 MediaId, + IN UINT64 Timeout, + IN UINT8 SecurityProtocol, + IN UINT16 SecurityProtocolSpecificData, + IN UINTN PayloadBufferSize, + OUT VOID *PayloadBuffer, + OUT UINTN *PayloadTransferSize +); + +typedef EFI_STATUS (EFIAPI *EFI_STORAGE_SECURITY_SEND_DATA)( + IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This, + IN UINT32 MediaId, + IN UINT64 Timeout, + IN UINT8 SecurityProtocolId, + IN UINT16 SecurityProtocolSpecificData, + IN UINTN PayloadBufferSize, + IN VOID *PayloadBuffer +); + +struct _EFI_STORAGE_SECURITY_COMMAND_PROTOCOL { + EFI_STORAGE_SECURITY_RECEIVE_DATA ReceiveData; + EFI_STORAGE_SECURITY_SEND_DATA SendData; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/SuperIo.h b/Include/Protocol/SuperIo.h new file mode 100644 index 0000000..85bbfb0 --- /dev/null +++ b/Include/Protocol/SuperIo.h @@ -0,0 +1,286 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/SuperIo.h 2 5/06/11 12:09p Yakovlevs $ +// +// $Revision: 2 $ +// +// $Date: 5/06/11 12:09p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/SuperIo.h $ +// +// 2 5/06/11 12:09p Yakovlevs +// AMI Function Headers added. +// +// 1 5/04/11 5:55p Yakovlevs +// Initial Checkin. +// + +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: SuperIo.h +// +// Description: EFI SuperIO Protocol Definitions. +// +//<AMI_FHDR_END> +//********************************************************************** + +#ifndef __EFI_SUPER_IO_PROTOCOL_H__ +#define __EFI_SUPER_IO_PROTOCOL_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <Efi.h> + +#define EFI_SIO_PROTOCOL_GUID \ + { 0x215fdd18, 0xbd50, 0x4feb, 0x89, 0xb, 0x58, 0xca, 0xb, 0x47, 0x39, 0xe9 } + +GUID_VARIABLE_DECLARATION(gEfiSioProtocolGuid, EFI_SIO_PROTOCOL_GUID); + +//Small resource common header +typedef union _ACPI_SMALL_RESOURCE_HEADER { + UINT8 HDR; + struct{ + UINT8 Length : 3; + UINT8 Name : 4; + UINT8 Type : 1; + }; +}ACPI_SMALL_RESOURCE_HEADER; + +//Large resource common header +typedef struct _ACPI_LARGE_RESOURCE_HEADER { + union { + UINT8 HDR; + struct { + UINT8 Name : 7; + UINT8 Type : 1; + }; + }; + UINT16 Length; +} ACPI_LARGE_RESOURCE_HEADER; + +typedef union { + ACPI_SMALL_RESOURCE_HEADER *SmallHeader; + ACPI_LARGE_RESOURCE_HEADER *LargeHeader; +} ACPI_RESOURCE_HEADER_PTR; + +typedef struct { + UINT8 Register; ///< Register number. + UINT8 AndMask; ///< Bitwise AND mask. + UINT8 OrMask; ///< Bitwise OR mask. +} EFI_SIO_REGISTER_MODIFY; + +typedef struct _EFI_SIO_PROTOCOL EFI_SIO_PROTOCOL; + + +//********************************************************************** +//<AMI_SHDR_START> +// +// Name: EFI_SIO_REGISTER_ACCESS +// +// Description: Provides a low level access to the registers for the Super I/O. +// +// Input: +// This Indicates a pointer to the calling context. +// Write Specifies the type of the register operation. If this parameter is TRUE, Value is +// interpreted as an input parameter and the operation is a register write. If this parameter +// is FALSE, Value is interpreted as an output parameter and the operation is a register +// read. +// ExitCfgMode Exit Configuration Mode Indicator. If this parameter is set to TRUE, the Super I/O +// driver will turn off configuration mode of the Super I/O prior to returning from this +// function. If this parameter is set to FALSE, the Super I/O driver will leave Super I/O +// in the configuration mode. +// The Super I/O driver must track the current state of the Super I/O and enable the +// configuration mode of Super I/O if necessary prior to register access. +// Register Register number. +// Value If Write is TRUE, Value is a pointer to the buffer containing the byte of data to be +// written to the Super I/O register. If Write is FALSE, Value is a pointer to the +// destination buffer for the byte of data to be read from the Super I/O register. +// +// Output: +// EFI_SUCCESS The operation completed successfully +// EFI_INVALID_PARAMETER The Value is NULL +// EFI_INVALID_PARAMETER Invalid Register number +// +// Notes: +// +//<AMI_SHDR_END> +//********************************************************************** +typedef +EFI_STATUS +(EFIAPI *EFI_SIO_REGISTER_ACCESS)( + IN CONST EFI_SIO_PROTOCOL *This, + IN BOOLEAN Write, + IN BOOLEAN ExitCfgMode, + IN UINT8 Register, + IN OUT UINT8 *Value +); + +//********************************************************************** +//<AMI_SHDR_START> +// +// Name: EFI_SIO_GET_RESOURCES +// +// Description: +// Provides an interface to get a list of the current resources consumed by the device in the ACPI +// Resource Descriptor format. +// +// Input: +// This Indicates a pointer to the calling context. +// ResourceList A pointer to an ACPI resource descriptor list that defines the current resources used by +// the device. Type ACPI_RESOURCE_HEADER_PTR is defined in the below. +// +// Output: +// EFI_SUCCESS The operation completed successfully +// EFI_INVALID_PARAMETER The Value is NULL +// +// Notes: +// +//<AMI_SHDR_END> +//********************************************************************** +typedef +EFI_STATUS +(EFIAPI *EFI_SIO_GET_RESOURCES)( + IN CONST EFI_SIO_PROTOCOL *This, + OUT ACPI_RESOURCE_HEADER_PTR *ResourceList +); + +//********************************************************************** +//<AMI_SHDR_START> +// +// Name: EFI_SIO_SET_RESOURCES +// +// Description: Sets the resources for the device. +// +// Input: +// This Indicates a pointer to the calling context. +// ResourceList A pointer to an ACPI resource descriptor list that defines the current resources used by +// the device. Type ACPI_RESOURCE_HEADER_PTR is defined in the below. +// +// Output: +// EFI_SUCCESS The operation completed successfully +// EFI_INVALID_PARAMETER The Value is NULL +// +// Notes: +// +//<AMI_SHDR_END> +//********************************************************************** +typedef +EFI_STATUS +(EFIAPI *EFI_SIO_SET_RESOURCES)( + IN CONST EFI_SIO_PROTOCOL *This, + IN ACPI_RESOURCE_HEADER_PTR ResourceList +); + +//********************************************************************** +//<AMI_SHDR_START> +// +// Name: EFI_SIO_POSSIBLE_RESOURCES +// +// Description: +// Provides a collection of resource descriptor lists. Each resource descriptor list in the collection +// defines a combination of resources that can potentially be used by the device. +// +// Input: +// This Indicates a pointer to the calling context. +// ResourceCollection Collection of the resource descriptor lists. +// +// Output: +// EFI_SUCCESS The operation completed successfully +// EFI_INVALID_PARAMETER The Value is NULL +// +// Notes: +// +//<AMI_SHDR_END> +//********************************************************************** +typedef +EFI_STATUS +(EFIAPI *EFI_SIO_POSSIBLE_RESOURCES)( + IN CONST EFI_SIO_PROTOCOL *This, + OUT ACPI_RESOURCE_HEADER_PTR *ResourceCollection +); + +//********************************************************************** +//<AMI_SHDR_START> +// +// Name: EFI_SIO_MODIFY +// +// Description: +// Provides an interface for a table based programming of the Super I/O registers. +// +// The Modify() function provides an interface for table based programming of the Super I/O +// registers. This function can be used to perform programming of multiple Super I/O registers with a +// single function call. For each table entry, the Register is read, its content is bitwise ANDed with +// AndMask, and then ORed with OrMask before being written back to the Register. The Super +// I/O driver must track the current state of the Super I/O and enable the configuration mode of Super I/ +// O if necessary prior to table processing. Once the table is processed, the Super I/O device has to be +// returned to the original state. +// +// Input: +// This Indicates a pointer to the calling context. +// Command A pointer to an array of NumberOfCommands EFI_SIO_REGISTER_MODIFY +// structures. Each structure specifies a single Super I/O register modify operation. Type +// EFI_SIO_REGISTER_MODIFY is defined in the "Related Definitions" below. +// NumberOfCommands Number of elements in the Command array. +// +// Output: +// EFI_SUCCESS The operation completed successfully +// EFI_INVALID_PARAMETER The Value is NULL +// +// Notes: +// +//<AMI_SHDR_END> +//********************************************************************** +typedef +EFI_STATUS +(EFIAPI *EFI_SIO_MODIFY)( + IN CONST EFI_SIO_PROTOCOL *This, + IN CONST EFI_SIO_REGISTER_MODIFY *Command, + IN UINTN NumberOfCommands +); + +typedef struct _EFI_SIO_PROTOCOL { + EFI_SIO_REGISTER_ACCESS RegisterAccess; + EFI_SIO_GET_RESOURCES GetResources; + EFI_SIO_SET_RESOURCES SetResources; + EFI_SIO_POSSIBLE_RESOURCES PossibleResources; + EFI_SIO_MODIFY Modify; +}EFI_SIO_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif + +#endif // __EFI_SUPER_IO_PROTOCOL_H__ + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Include/Protocol/TcgService.h b/Include/Protocol/TcgService.h new file mode 100644 index 0000000..2c1cc4c --- /dev/null +++ b/Include/Protocol/TcgService.h @@ -0,0 +1,209 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/TcgService.h 1 11/19/09 12:51p Felixp $ +// +// $Revision: 1 $ +// +// $Date: 11/19/09 12:51p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/TcgService.h $ +// +// 1 11/19/09 12:51p Felixp +// EFI TCG Protocol +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: TcgService.c +// +// Description: TCG Service Protocol as defined in TCG_EFI_Protocol_1_20_Final +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __TCG_SERVICE_PROTOCOL__H__ +#define __TCG_SERVICE_PROTOCOL__H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <TcgTpm.h> + +#define EFI_TCG_PROTOCOL_GUID \ + {0xf541796d, 0xa62e, 0x4954, 0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd} + +#define EFI_TCG_PLATFORM_PROTOCOL_GUID \ + { 0x8c4c9a41, 0xbf56, 0x4627, 0x9e, 0xa, 0xc8, 0x38, 0x6d, 0x66, 0x11, 0x5c } + +GUID_VARIABLE_DECLARATION(gEfiTcgProtocolGuid,EFI_TCG_PROTOCOL_GUID); +GUID_VARIABLE_DECLARATION(gEfiTcgPlatformProtocolGuid,EFI_TCG_PLATFORM_PROTOCOL_GUID); + +#define TSS_EVENT_DATA_MAX_SIZE 256 + +#define EFI_CALLING_EFI_APPLICATION \ + "Calling EFI Application from Boot Option" +#define EFI_RETURNING_FROM_EFI_APPLICATOIN \ + "Returning from EFI Application from Boot Option" +#define EFI_EXIT_BOOT_SERVICES_INVOCATION \ + "Exit Boot Services Invocation" +#define EFI_EXIT_BOOT_SERVICES_FAILED \ + "Exit Boot Services Returned with Failure" +#define EFI_EXIT_BOOT_SERVICES_SUCCEEDED \ + "Exit Boot Services Returned with Success" + +EFI_FORWARD_DECLARATION (EFI_TCG_PROTOCOL); + +// +// Set structure alignment to 1-byte +// +#pragma pack (push, 1) + +typedef struct { + UINT8 Major; + UINT8 Minor; + UINT8 RevMajor; + UINT8 RevMinor; +} TCG_VERSION; + +typedef struct _TCG_EFI_BOOT_SERVICE_CAPABILITY { + UINT8 Size; // Size of this structure + TCG_VERSION StructureVersion; + TCG_VERSION ProtocolSpecVersion; + UINT8 HashAlgorithmBitmap; // Hash algorithms + // this protocol is capable of : 01=SHA-1 + BOOLEAN TPMPresentFlag; // 00h = TPM not present + BOOLEAN TPMDeactivatedFlag; // 01h = TPM currently deactivated +} TCG_EFI_BOOT_SERVICE_CAPABILITY; + +typedef UINT32 TCG_ALGORITHM_ID; + +// +// Restore original structure alignment +// +#pragma pack (pop) + +typedef +EFI_STATUS +(EFIAPI *EFI_TCG_STATUS_CHECK) ( + IN EFI_TCG_PROTOCOL *This, + OUT TCG_EFI_BOOT_SERVICE_CAPABILITY + *ProtocolCapability, + OUT UINT32 *TCGFeatureFlags, + OUT EFI_PHYSICAL_ADDRESS *EventLogLocation, + OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_TCG_HASH_ALL) ( + IN EFI_TCG_PROTOCOL *This, + IN UINT8 *HashData, + IN UINT64 HashDataLen, + IN TCG_ALGORITHM_ID AlgorithmId, + IN OUT UINT64 *HashedDataLen, + IN OUT UINT8 **HashedDataResult + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_TCG_LOG_EVENT) ( + IN EFI_TCG_PROTOCOL *This, + IN TCG_PCR_EVENT *TCGLogData, + IN OUT UINT32 *EventNumber, + IN UINT32 Flags + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_TCG_PASS_THROUGH_TO_TPM) ( + IN EFI_TCG_PROTOCOL *This, + IN UINT32 TpmInputParameterBlockSize, + IN UINT8 *TpmInputParameterBlock, + IN UINT32 TpmOutputParameterBlockSize, + IN UINT8 *TpmOutputParameterBlock + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_TCG_HASH_LOG_EXTEND_EVENT) ( + IN EFI_TCG_PROTOCOL *This, + IN EFI_PHYSICAL_ADDRESS HashData, + IN UINT64 HashDataLen, + IN TCG_ALGORITHM_ID AlgorithmId, + IN OUT TCG_PCR_EVENT *TCGLogData, + IN OUT UINT32 *EventNumber, + OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry + ); + +typedef struct _EFI_TCG_PROTOCOL { + EFI_TCG_STATUS_CHECK StatusCheck; + EFI_TCG_HASH_ALL HashAll; + EFI_TCG_LOG_EVENT LogEvent; + EFI_TCG_PASS_THROUGH_TO_TPM PassThroughToTpm; + EFI_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent; +} EFI_TCG_PROTOCOL; + +// +// EFI TCG Platform Protocol +// +typedef +EFI_STATUS +(EFIAPI *EFI_TCG_MEASURE_PE_IMAGE) ( + IN BOOLEAN BootPolicy, + IN EFI_PHYSICAL_ADDRESS ImageAddress, + IN UINTN ImageSize, + IN UINTN LinkTimeBase, + IN UINT16 ImageType, + IN EFI_HANDLE DeviceHandle, + IN EFI_DEVICE_PATH_PROTOCOL *FilePath + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_TCG_MEASURE_ACTION) ( + IN CHAR8 *ActionString + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_TCG_MEASURE_GPT_TABLE) ( + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath + ); + +typedef struct _EFI_TCG_PLATFORM_PROTOCOL { + EFI_TCG_MEASURE_PE_IMAGE MeasurePeImage; + EFI_TCG_MEASURE_ACTION MeasureAction; + EFI_TCG_MEASURE_GPT_TABLE MeasureGptTable; +} EFI_TCG_PLATFORM_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/TerminalAmiSerial Protocol.cif b/Include/Protocol/TerminalAmiSerial Protocol.cif new file mode 100644 index 0000000..44a1ef5 --- /dev/null +++ b/Include/Protocol/TerminalAmiSerial Protocol.cif @@ -0,0 +1,8 @@ +<component> + name = "TerminalAmiSerial Protocol" + category = ModulePart + LocalRoot = "Include\Protocol\" + RefName = "TerminalAmiSerial Protocol" +[files] +"TerminalAmiSerial.h" +<endComponent> diff --git a/Include/Protocol/TerminalAmiSerial.h b/Include/Protocol/TerminalAmiSerial.h new file mode 100644 index 0000000..c67be86 --- /dev/null +++ b/Include/Protocol/TerminalAmiSerial.h @@ -0,0 +1,122 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/BIN/Modules/Terminal/TerminalAmiSerial.h 1 12/12/11 8:37a Rajeshms $ +// +// $Revision: 1 $ +// +// $Date: 12/12/11 8:37a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Modules/Terminal/TerminalAmiSerial.h $ +// +// 1 12/12/11 8:37a Rajeshms +// [TAG] EIP71636 +// [Category] New Feature +// [Description] Implement the AMI_SERIAL_PROTOCOL for non-generic PCI +// Serial Device. +// [Files] AmiSerial.c, AmiSerial.sdl, AmiSerial.mak, AmiSerial.chm, +// AmiSerial.dxs, AmiSerial.cif, Terminal.c, SerialIo.c, TerminalSetup.c, +// InitTerminalStrings.c, TerminalSetupVar.h, Terminal.cif, +// TerminalAmiSerial.h, LegacySredir_Setup.c +// +// +// +//********************************************************************** + +//<AMI_FHDR_START> +//-------------------------------------------------------------------------- +// +// Name: TerminalAmiSerial.h +// +// Description: AMI Serial Protocol Definiton. +// +//-------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef _AMI_SERIAL_H_ +#define _AMI_SERIAL_H_ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> +#include <Protocol\DevicePath.h> + +#define AMI_SERIAL_VENDOR_DEVICE_PATH_GUID \ + {0x32d1497b,0x288c,0x440a,0x9f,0xc3,0x65,0x1a,0x14,0xef,0xc7,0xb4} + +#define AMI_SERIAL_PROTOCOL_GUID \ + {0x50dc5c90,0x1d33,0x4fd6,0x87,0xe5,0x06,0x3b,0x1d,0xfa,0x21,0x70} + +GUID_VARIABLE_DECLARATION(gAmiSerialProtocolGuid,AMI_SERIAL_PROTOCOL_GUID); + +typedef struct _AMI_SERIAL_PROTOCOL AMI_SERIAL_PROTOCOL; + +typedef VOID (EFIAPI *EFI_SERIAL_GET_BASE_ADDRESS) ( + IN AMI_SERIAL_PROTOCOL *This, + OUT UINT64 *BaseAddress +); + +typedef VOID (EFIAPI *EFI_CHECK_PCI_MMIO) ( + IN AMI_SERIAL_PROTOCOL *This, + OUT BOOLEAN *Pci, + OUT BOOLEAN *Mmio +); + +typedef VOID (EFIAPI *EFI_GET_PCI_LOCATION) ( + IN AMI_SERIAL_PROTOCOL *This, + OUT UINTN *Bus, + OUT UINTN *Dev, + OUT UINTN *Func, + OUT UINT8 *Port +); + +typedef VOID (EFIAPI *EFI_GET_SERIAL_IRQ) ( + IN AMI_SERIAL_PROTOCOL *This, + OUT UINT8 *SerialIRQ +); + +struct _AMI_SERIAL_PROTOCOL { + EFI_SERIAL_GET_BASE_ADDRESS GetBaseAddress; + EFI_CHECK_PCI_MMIO CheckPciMmio; + EFI_GET_PCI_LOCATION GetPciLocation; + EFI_GET_SERIAL_IRQ GetSerialIRQ; +}; + +typedef struct { + VENDOR_DEVICE_PATH VendorDevicePath; + UINT8 Bus; + UINT8 Device; + UINT8 Function; + UINT8 Port; +}AMI_SERIAL_VENDOR_DEVICE_PATH; + +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/Timer.h b/Include/Protocol/Timer.h new file mode 100644 index 0000000..d51986f --- /dev/null +++ b/Include/Protocol/Timer.h @@ -0,0 +1,222 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Timer.h 2 3/13/06 1:45a Felixp $ +// +// $Revision: 2 $ +// +// $Date: 3/13/06 1:45a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Timer.h $ +// +// 2 3/13/06 1:45a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:42a Felixp +// +// 1 12/23/04 9:29a Felixp +// +// 2 3/17/04 11:11a Robert +// +// 1 12/31/03 11:05a Robert +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: Timer.h +// +// Description: This file contains Data structures and support values for the +// Timer Architectural Protocol +// +//<AMI_FHDR_END> +//***************************************************************************** +#ifndef __TIMER_ARCH_PROTOCOL_H__ +#define __TIMER_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// GUID for the Timer Architectural Protocol +#define EFI_TIMER_ARCH_PROTOCOL_GUID \ + { 0x26baccb3, 0x6f42, 0x11d4, 0xbc, 0xe7, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81 } + +GUID_VARIABLE_DECLARATION(gEfiTimerArchProtocolGuid, EFI_TIMER_ARCH_PROTOCOL_GUID); + +// Declare an empty structure for the Timer Architectural Protocol +typedef struct _EFI_TIMER_ARCH_PROTOCOL EFI_TIMER_ARCH_PROTOCOL; + + +//<AMI_PHDR_START> +//============================================================================ +// Procedure Type: EFI_TIMER_NOTIFY +// +// Description: The function of this type is called when a timer interrupt +// fires. This function executes at TPL_HIGH_LEVEL. +// +// Input: +// Time - Time since the last timer interrupt in 100 ns units. +// +// Output: None +// +// Referrals: +// +//============================================================================ +//<AMI_PHDR_END> +typedef +VOID +(EFIAPI *EFI_TIMER_NOTIFY) ( + IN UINT64 Time + ); + + +//<AMI_PHDR_START> +//============================================================================ +// Procedure Type: EFI_TIMER_REGISTER_HANDLER +// +// Description: The function of this type registers the notify function +// that will be called if the timer interrupt fires +// +// Input: +// This - The instance of the EFI_TIMER_ARCH_PROTOCOL +// +// NotifyFunction - The function to call when a timer interrupt fires +// +// Output: EFI_SUCCESS - The timer handler was registered. +// +// Referrals: +// +//============================================================================ +//<AMI_PHDR_END> +typedef +EFI_STATUS +(EFIAPI *EFI_TIMER_REGISTER_HANDLER) ( + IN EFI_TIMER_ARCH_PROTOCOL *This, + IN EFI_TIMER_NOTIFY NotifyFunction +); + + +//<AMI_PHDR_START> +//============================================================================ +// Procedure Type: EFI_TIMER_SET_TIMER_PERIOD +// +// Description: The function of this type sets the timer interrupt interval +// based on the input value in TimerPeriod +// +// Input: +// This - The instance of the EFI_TIMER_ARCH_PROTOCOL +// +// TimerPeriod - The rate to program the timer interrupt in 100 nS units. +// +// Output: EFI_SUCCESS - The timer handler was registered. +// +// Referrals: +// +//============================================================================ +//<AMI_PHDR_END> +typedef +EFI_STATUS +(EFIAPI *EFI_TIMER_SET_TIMER_PERIOD) ( + IN EFI_TIMER_ARCH_PROTOCOL *This, + IN UINT64 TimerPeriod + ); + + +//<AMI_PHDR_START> +//============================================================================ +// Procedure Type: EFI_TIMER_GET_TIMER_PERIOD +// +// Description: The function of this type gets the timer interrupt in +// 100ns increments +// +// Input: +// This - The instance of the EFI_TIMER_ARCH_PROTOCOL +// +// TimerPeriod - Pointer to the timer period in 100 nS units. +// +// Output: +// EFI_SUCCESS - The timer period was returned in TimerPeriod. +// EFI_INVALID_PARAMETER - TimerPeriod is NULL. +// +// Referrals: +// +//============================================================================ +//<AMI_PHDR_END> +typedef +EFI_STATUS +(EFIAPI *EFI_TIMER_GET_TIMER_PERIOD) ( + IN EFI_TIMER_ARCH_PROTOCOL *This, + IN UINT64 *TimerPeriod + ); + + +//<AMI_PHDR_START> +//============================================================================ +// Procedure Type: EFI_TIMER_GENERATE_SOFT_INTERRUPT +// +// Description: The function of this type generates a soft timer interrupt +// +// Input: +// This - The instance of the EFI_TIMER_ARCH_PROTOCOL +// +// Output: +// EFI_SUCCESS - The timer period was returned in TimerPeriod. +// +// Referrals: +// +//============================================================================ +//<AMI_PHDR_END> +typedef +EFI_STATUS +(EFIAPI *EFI_TIMER_GENERATE_SOFT_INTERRUPT) ( + IN EFI_TIMER_ARCH_PROTOCOL *This + ); + + + + + +// Interface for the Timer Architectural Protocol +typedef struct _EFI_TIMER_ARCH_PROTOCOL { + EFI_TIMER_REGISTER_HANDLER RegisterHandler; + EFI_TIMER_SET_TIMER_PERIOD SetTimerPeriod; + EFI_TIMER_GET_TIMER_PERIOD GetTimerPeriod; + EFI_TIMER_GENERATE_SOFT_INTERRUPT GenerateSoftInterrupt; +} EFI_TIMER_ARCH_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/UgaDraw.h b/Include/Protocol/UgaDraw.h new file mode 100644 index 0000000..5a046aa --- /dev/null +++ b/Include/Protocol/UgaDraw.h @@ -0,0 +1,145 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/UgaDraw.h 3 12/20/06 1:46p Felixp $ +// +// $Revision: 3 $ +// +// $Date: 12/20/06 1:46p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/UgaDraw.h $ +// +// 3 12/20/06 1:46p Felixp +// Updated to co-exist with Graphics Output Protocol header +// +// 2 3/13/06 1:40a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 1 11/08/04 1:41p Felixp +// +// 3 11/05/04 6:02p Robert +// +// 2 11/05/04 5:40p Robert +// +// 1 11/05/04 5:34p Robert +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: UgaDraw_h +// +// Description: +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __UGA_DRAW_PROTOCOL_H__ +#define __UGA_DRAW_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_UGA_DRAW_PROTOCOL_GUID \ + { 0x982c298b, 0xf4fa, 0x41cb, 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } + +GUID_VARIABLE_DECLARATION(gEfiUgaDrawProtocolGuid,EFI_UGA_DRAW_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION +#include <Protocol/GraphicsOutput.h> + +typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL; + + +//============================================================================= +// Structure Definitions + +typedef EFI_GRAPHICS_OUTPUT_BLT_PIXEL EFI_UGA_PIXEL; + +typedef enum { + EfiUgaVideoFill, + EfiUgaVideoToBltBuffer, + EfiUgaBltBufferToVideo, + EfiUgaVideoToVideo, + EfiUgaBltMax + } EFI_UGA_BLT_OPERATION; + +//============================================================================= +// Protocol typedefs + +typedef EFI_STATUS (EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) ( + IN EFI_UGA_DRAW_PROTOCOL *This, + OUT UINT32 *HorizontalResolution, + OUT UINT32 *VerticalResolution, + OUT UINT32 *ColorDepth, + OUT UINT32 *RefreshRate + ); + + +typedef EFI_STATUS (EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) ( + IN EFI_UGA_DRAW_PROTOCOL *This, + IN UINT32 HorizontalResolution, + IN UINT32 VerticalResolution, + IN UINT32 ColorDepth, + IN UINT32 RefreshRate + ); + + +typedef EFI_STATUS (EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) ( + IN EFI_UGA_DRAW_PROTOCOL *This, + IN OUT EFI_UGA_PIXEL *BltBuffer, OPTIONAL + IN EFI_UGA_BLT_OPERATION BltOperation, + IN UINTN SourceX, + IN UINTN SourceY, + IN UINTN DestinationX, + IN UINTN DestinationY, + IN UINTN Width, + IN UINTN Height, + IN UINTN Delta OPTIONAL + ); + +typedef struct _EFI_UGA_DRAW_PROTOCOL { + EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode; + EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode; + EFI_UGA_DRAW_PROTOCOL_BLT Blt; + } EFI_UGA_DRAW_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#endif // #ifndef GUID_VARIABLE_DEFINITION +#ifdef __cplusplus +} +#endif +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/UnicodeCollation.h b/Include/Protocol/UnicodeCollation.h new file mode 100644 index 0000000..8db47b8 --- /dev/null +++ b/Include/Protocol/UnicodeCollation.h @@ -0,0 +1,173 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/UnicodeCollation.h 6 6/16/11 3:22p Felixp $ +// +// $Revision: 6 $ +// +// $Date: 6/16/11 3:22p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/UnicodeCollation.h $ +// +// 6 6/16/11 3:22p Felixp +// Surround backward compatibility definitions with #if +// BACKWARD_COMPATIBLE_MODE +// +// 5 5/27/11 5:53p Felixp +// Headers are updated to improve separation of the Framework and PI +// interfaces. +// The definitions that will be removed in the future versions are marked +// with the comments. +// +// 4 8/28/09 12:22p Felixp +// Support for both UnicodeCollation and UnicodeCollation2 protocols +// (based on value of the EFI_SPECIFICATION_VERSION SDL token). +// +// 3 3/13/06 1:40a Felixp +// +// 2 2/15/05 5:01p Felixp +// SpecialChars array definition removed +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:22p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:41a Felixp +// +// 2 12/22/04 4:50p Radhikav +// removed unwanted comments. +// +// 1 10/05/04 2:50p Radhikav +// Initial check in. +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: UnicodeCollation.h +// +// Description: UnicodeCollation Protocol Definition. +// +//<AMI_FHDR_END> +//*********************************************************************** +#ifndef __UNICODE_COLLATION_PROTOCOL_H__ +#define __UNICODE_COLLATION_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_UNICODE_COLLATION_PROTOCOL_GUID \ + { 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + +GUID_VARIABLE_DECLARATION(gEfiUnicodeCollationProtocolGuid,EFI_UNICODE_COLLATION_PROTOCOL_GUID); + +typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL; + +// Protocol member functions +typedef +INTN +(EFIAPI *EFI_UNICODE_COLLATION_STRICOLL) ( + IN EFI_UNICODE_COLLATION_PROTOCOL *This, + IN CHAR16 *S1, + IN CHAR16 *S2 + ); + +typedef +BOOLEAN +(EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH) ( + IN EFI_UNICODE_COLLATION_PROTOCOL *This, + IN CHAR16 *String, + IN CHAR16 *Pattern + ); + +typedef +VOID +(EFIAPI *EFI_UNICODE_COLLATION_STRLWR) ( + IN EFI_UNICODE_COLLATION_PROTOCOL *This, + IN OUT CHAR16 *String + ); + +typedef +VOID +(EFIAPI *EFI_UNICODE_COLLATION_STRUPR) ( + IN EFI_UNICODE_COLLATION_PROTOCOL *This, + IN OUT CHAR16 *String + ); + +typedef +VOID +(EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR) ( + IN EFI_UNICODE_COLLATION_PROTOCOL *This, + IN UINTN FatSize, + IN CHAR8 *Fat, + OUT CHAR16 *String + ); + +typedef +BOOLEAN +(EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT) ( + IN EFI_UNICODE_COLLATION_PROTOCOL *This, + IN CHAR16 *String, + IN UINTN FatSize, + OUT CHAR8 *Fat + ); + +struct _EFI_UNICODE_COLLATION_PROTOCOL { + EFI_UNICODE_COLLATION_STRICOLL StriColl; + EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch; + EFI_UNICODE_COLLATION_STRLWR StrLwr; + EFI_UNICODE_COLLATION_STRUPR StrUpr; + EFI_UNICODE_COLLATION_FATTOSTR FatToStr; + EFI_UNICODE_COLLATION_STRTOFAT StrToFat; + CHAR8 *SupportedLanguages; +}; + +//********************* Unicode Collation 2 Protocol ******************/ +#if EFI_SPECIFICATION_VERSION<=0x20000 +#define EFI_UNICODE_COLLATION_PROTOCOL2_GUID EFI_UNICODE_COLLATION_PROTOCOL_GUID +#else //if EFI_SPECIFICATION_VERSION +#define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \ + {0xa4c751fc, 0x23ae, 0x4c3e, 0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49} +#endif //if EFI_SPECIFICATION_VERSION +GUID_VARIABLE_DECLARATION(gEfiUnicodeCollation2ProtocolGuid,EFI_UNICODE_COLLATION_PROTOCOL2_GUID); + +#if BACKWARD_COMPATIBLE_MODE +//UEFI 2.3 uses GUID identifier EFI_UNICODE_COLLATION_PROTOCOL2_GUID. +//According to UEFI naming convension it should be EFI_UNICODE_COLLATION2_PROTOCOL_GUID +#define EFI_UNICODE_COLLATION2_PROTOCOL_GUID EFI_UNICODE_COLLATION_PROTOCOL2_GUID +typedef EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION2_PROTOCOL; +#endif + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/UsbHC.h b/Include/Protocol/UsbHC.h new file mode 100644 index 0000000..6dce813 --- /dev/null +++ b/Include/Protocol/UsbHC.h @@ -0,0 +1,468 @@ +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2015, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** + +//**************************************************************************** +// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/UsbHC.h 14 1/27/15 3:46a Wilsonlee $ +// +// $Revision: 14 $ +// +// $Date: 1/27/15 3:46a $ +// +//**************************************************************************** + +#ifndef _USBHC_INC_ +#define _USBHC_INC_ + +#include <Protocol\usbIo.h> + +typedef enum { + EfiUsbPortEnable = 1, + EfiUsbPortSuspend = 2, + EfiUsbPortReset = 4, + EfiUsbPortPower = 8, + EfiUsbPortOwner = 13, //(EIP57663+) + EfiUsbPortConnectChange = 16, + EfiUsbPortEnableChange = 17, + EfiUsbPortSuspendChange = 18, + EfiUsbPortOverCurrentChange = 19, + EfiUsbPortResetChange = 20 +} EFI_USB_PORT_FEATURE; + +typedef struct{ + UINT16 PortStatus; + UINT16 PortChangeStatus; +} EFI_USB_PORT_STATUS; + +//************************************************** +// EFI_USB_PORT_STATUS.PortStatus bit definition +//************************************************** +#define USB_PORT_STAT_CONNECTION 0x0001 +#define USB_PORT_STAT_ENABLE 0x0002 +#define USB_PORT_STAT_SUSPEND 0x0004 +#define USB_PORT_STAT_OVERCURRENT 0x0008 +#define USB_PORT_STAT_RESET 0x0010 +#define USB_PORT_STAT_POWER 0x0100 +#define USB_PORT_STAT_LOW_SPEED 0x0200 +#define USB_PORT_STAT_HIGH_SPEED 0x0400 +#define USB_PORT_STAT_SUPER_SPEED 0x0800 +#define USB_PORT_STAT_SUPER_SPEED_PLUS 0x1000 +#define USB_PORT_STAT_OWNER 0x2000 +//************************************************** +// EFI_USB_PORT_STATUS.PortChangeStatus bit definition +//************************************************** +#define USB_PORT_STAT_C_CONNECTION 0x0001 +#define USB_PORT_STAT_C_ENABLE 0x0002 +#define USB_PORT_STAT_C_SUSPEND 0x0004 +#define USB_PORT_STAT_C_OVERCURRENT 0x0008 +#define USB_PORT_STAT_C_RESET 0x0010 + + +#define EFI_USB_HC_PROTOCOL_GUID \ + { \ + 0xf5089266, 0x1aa0, 0x4953, 0x97, 0xd8, 0x56, 0x2f, 0x8a, 0x73, 0xb5, 0x19 \ + } +GUID_VARIABLE_DECLARATION(gEfiUsbHcProtocolGuid, EFI_USB_HC_PROTOCOL_GUID); + +#define EFI_USB2_HC_PROTOCOL_GUID \ + { \ + 0x3e745226, 0x9818, 0x45b6, 0xa2, 0xac, 0xd7, 0xcd, 0xe, 0x8b, 0xa2, 0xbc \ + } +GUID_VARIABLE_DECLARATION(gEfiUsb2HcProtocolGuid, EFI_USB2_HC_PROTOCOL_GUID); + +#ifndef GUID_VARIABLE_DEFINITION + +typedef struct _EFI_USB_HC_PROTOCOL EFI_USB_HC_PROTOCOL; +typedef struct _EFI_USB2_HC_PROTOCOL EFI_USB2_HC_PROTOCOL; + +typedef enum { + EfiUsbHcStateHalt, + EfiUsbHcStateOperational, + EfiUsbHcStateSuspend, + EfiUsbHcStateMaximum +} EFI_USB_HC_STATE; + +#define EFI_USB_HC_RESET_GLOBAL 0x0001 +#define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002 + +// +// Protocol definitions +// +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_RESET) ( + IN EFI_USB_HC_PROTOCOL *This, + IN UINT16 Attributes + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_GET_STATE) ( + IN EFI_USB_HC_PROTOCOL *This, + OUT EFI_USB_HC_STATE *State + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_SET_STATE) ( + IN EFI_USB_HC_PROTOCOL *This, + IN EFI_USB_HC_STATE State + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER) ( + IN EFI_USB_HC_PROTOCOL *This, + IN UINT8 DeviceAddress, + IN UINT8 IsSlowDevice, + IN UINT8 MaximumPacketLength, + IN EFI_USB_DEVICE_REQUEST *Request, + IN EFI_USB_DATA_DIRECTION TransferDirection, + IN OUT VOID *Data OPTIONAL, + IN OUT UINTN *DataLength OPTIONAL, + IN UINTN TimeOut, + OUT UINT32 *TransferResult + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_BULK_TRANSFER) ( + IN EFI_USB_HC_PROTOCOL *This, + IN UINT8 DeviceAddress, + IN UINT8 EndPointAddress, + IN UINT8 MaximumPacketLength, + IN OUT VOID *Data, + IN OUT UINTN *DataLength, + IN OUT UINT8 *DataToggle, + IN UINTN TimeOut, + OUT UINT32 *TransferResult + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER) ( + IN EFI_USB_HC_PROTOCOL *This, + IN UINT8 DeviceAddress, + IN UINT8 EndPointAddress, + IN UINT8 IsSlowDevice, + IN UINT8 MaxiumPacketLength, + IN BOOLEAN IsNewTransfer, + IN OUT UINT8 *DataToggle OPTIONAL, + IN UINTN PollingInterval OPTIONAL, + IN UINTN DataLength OPTIONAL, + IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL, + IN VOID *Context OPTIONAL + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER) ( + IN EFI_USB_HC_PROTOCOL *This, + IN UINT8 DeviceAddress, + IN UINT8 EndPointAddress, + IN UINT8 IsSlowDevice, + IN UINT8 MaximumPacketLength, + IN OUT VOID *Data, + IN OUT UINTN *DataLength, + IN OUT UINT8 *DataToggle, + IN UINTN TimeOut, + OUT UINT32 *TransferResult + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER) ( + IN EFI_USB_HC_PROTOCOL *This, + IN UINT8 DeviceAddress, + IN UINT8 EndPointAddress, + IN UINT8 MaximumPacketLength, + IN OUT VOID *Data, + IN OUT UINTN DataLength, + OUT UINT32 *TransferResult + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER) ( + IN EFI_USB_HC_PROTOCOL *This, + IN UINT8 DeviceAddress, + IN UINT8 EndPointAddress, + IN UINT8 MaximumPacketLength, + IN OUT VOID *Data, + IN UINTN DataLength, + IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack, + IN VOID *Context OPTIONAL + ); + + +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER) ( + IN EFI_USB_HC_PROTOCOL *This, + OUT UINT8 *PortNumber + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS) ( + IN EFI_USB_HC_PROTOCOL *This, + IN UINT8 PortNumber, + OUT EFI_USB_PORT_STATUS *PortStatus + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE) ( + IN EFI_USB_HC_PROTOCOL *This, + IN UINT8 PortNumber, + IN EFI_USB_PORT_FEATURE PortFeature + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE) ( + IN EFI_USB_HC_PROTOCOL *This, + IN UINT8 PortNumber, + IN EFI_USB_PORT_FEATURE PortFeature + ); + +typedef struct _EFI_USB_HC_PROTOCOL { + EFI_USB_HC_PROTOCOL_RESET Reset; + EFI_USB_HC_PROTOCOL_GET_STATE GetState; + EFI_USB_HC_PROTOCOL_SET_STATE SetState; + EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer; + EFI_USB_HC_PROTOCOL_BULK_TRANSFER BulkTransfer; + EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer; + EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer; + EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer; + EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer; + EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER GetRootHubPortNumber; + EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus; + EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature; + EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature; + UINT16 MajorRevision; + UINT16 MinorRevision; + } EFI_USB_HC_PROTOCOL; + +// +// Forward reference for pure ANSI compatability +// +//EFI_FORWARD_DECLARATION (EFI_USB2_HC_PROTOCOL); + +#define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004 +#define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008 + +typedef struct { + UINT8 TranslatorHubAddress; + UINT8 TranslatorPortNumber; +} EFI_USB2_HC_TRANSACTION_TRANSLATOR; + +// +// Protocol definitions +// +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_CAPABILITY) ( + IN EFI_USB2_HC_PROTOCOL *This, + OUT UINT8 *MaxSpeed, + OUT UINT8 *PortNumber, + OUT UINT8 *Is64BitCapable + ); + +#define EFI_USB_SPEED_FULL 0x0000 +#define EFI_USB_SPEED_LOW 0x0001 +#define EFI_USB_SPEED_HIGH 0x0002 +#define EFI_USB_SPEED_SUPER 0x0003 +#define EFI_USB_SPEED_SUPER_PLUS 0x0004 + +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_RESET) ( + IN EFI_USB2_HC_PROTOCOL *This, + IN UINT16 Attributes + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE) ( + IN EFI_USB2_HC_PROTOCOL *This, + OUT EFI_USB_HC_STATE *State + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE) ( + IN EFI_USB2_HC_PROTOCOL *This, + IN EFI_USB_HC_STATE State + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER) ( + IN EFI_USB2_HC_PROTOCOL *This, + IN UINT8 DeviceAddress, + IN UINT8 DeviceSpeed, + IN UINTN MaximumPacketLength, + IN EFI_USB_DEVICE_REQUEST *Request, + IN EFI_USB_DATA_DIRECTION TransferDirection, + IN OUT VOID *Data OPTIONAL, + IN OUT UINTN *DataLength OPTIONAL, + IN UINTN TimeOut, + IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, + OUT UINT32 *TransferResult + ); + +#define EFI_USB_MAX_BULK_BUFFER_NUM 10 + +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER) ( + IN EFI_USB2_HC_PROTOCOL *This, + IN UINT8 DeviceAddress, + IN UINT8 EndPointAddress, + IN UINT8 DeviceSpeed, + IN UINTN MaximumPacketLength, + IN UINT8 DataBuffersNumber, + IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM], + IN OUT UINTN *DataLength, + IN OUT UINT8 *DataToggle, + IN UINTN TimeOut, + IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, + OUT UINT32 *TransferResult + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER) ( + IN EFI_USB2_HC_PROTOCOL *This, + IN UINT8 DeviceAddress, + IN UINT8 EndPointAddress, + IN UINT8 DeviceSpeed, + IN UINTN MaxiumPacketLength, + IN BOOLEAN IsNewTransfer, + IN OUT UINT8 *DataToggle, + IN UINTN PollingInterval OPTIONAL, + IN UINTN DataLength OPTIONAL, + IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, + IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL, + IN VOID *Context OPTIONAL + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER) ( + IN EFI_USB2_HC_PROTOCOL *This, + IN UINT8 DeviceAddress, + IN UINT8 EndPointAddress, + IN UINT8 DeviceSpeed, + IN UINTN MaximumPacketLength, + IN OUT VOID *Data, + IN OUT UINTN *DataLength, + IN OUT UINT8 *DataToggle, + IN UINTN TimeOut, + IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, + OUT UINT32 *TransferResult + ); + +#define EFI_USB_MAX_ISO_BUFFER_NUM 7 +#define EFI_USB_MAX_ISO_BUFFER_NUM1 2 + +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER) ( + IN EFI_USB2_HC_PROTOCOL *This, + IN UINT8 DeviceAddress, + IN UINT8 EndPointAddress, + IN UINT8 DeviceSpeed, + IN UINTN MaximumPacketLength, + IN UINT8 DataBuffersNumber, + IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM], + IN UINTN DataLength, + IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, + OUT UINT32 *TransferResult + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER) ( + IN EFI_USB2_HC_PROTOCOL *This, + IN UINT8 DeviceAddress, + IN UINT8 EndPointAddress, + IN UINT8 DeviceSpeed, + IN UINTN MaximumPacketLength, + IN UINT8 DataBuffersNumber, + IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM], + IN UINTN DataLength, + IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, + IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack, + IN VOID *Context OPTIONAL + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS) ( + IN EFI_USB2_HC_PROTOCOL *This, + IN UINT8 PortNumber, + OUT EFI_USB_PORT_STATUS *PortStatus + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE) ( + IN EFI_USB2_HC_PROTOCOL *This, + IN UINT8 PortNumber, + IN EFI_USB_PORT_FEATURE PortFeature + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE) ( + IN EFI_USB2_HC_PROTOCOL *This, + IN UINT8 PortNumber, + IN EFI_USB_PORT_FEATURE PortFeature + ); + +typedef struct _EFI_USB2_HC_PROTOCOL { + EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability; + EFI_USB2_HC_PROTOCOL_RESET Reset; + EFI_USB2_HC_PROTOCOL_GET_STATE GetState; + EFI_USB2_HC_PROTOCOL_SET_STATE SetState; + EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer; + EFI_USB2_HC_PROTOCOL_BULK_TRANSFER BulkTransfer; + EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer; + EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer; + EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer; + EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer; + EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus; + EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature; + EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature; + UINT16 MajorRevision; + UINT16 MinorRevision; +} EFI_USB2_HC_PROTOCOL; + +#endif // GUID_VARIABLE_DEFINITION +#endif // _USBHC_INC_ + +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2015, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** diff --git a/Include/Protocol/UsbIo.h b/Include/Protocol/UsbIo.h new file mode 100644 index 0000000..9f9378c --- /dev/null +++ b/Include/Protocol/UsbIo.h @@ -0,0 +1,278 @@ +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** + +//**************************************************************************** +// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/UsbIo.h 9 5/04/12 5:35a Wilsonlee $ +// +// $Revision: 9 $ +// +// $Date: 5/04/12 5:35a $ +// +//**************************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: UsbIo.h +// +// Description: AMI USB IO interface header file +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + + +#ifndef _USBIO_INC_ +#define _USBIO_INC_ + +#define EFI_USB_IO_PROTOCOL_GUID \ + { 0x2B2F68D6, 0x0CD2, 0x44cf, 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } + +GUID_VARIABLE_DECLARATION(gEfiUsbIoProtocolGuid,EFI_USB_IO_PROTOCOL_GUID); + +typedef struct _EFI_USB_IO_PROTOCOL EFI_USB_IO_PROTOCOL; + +#pragma pack(push, 1) + +// +// See USB1.1 for detail descrption. +// +typedef struct { + UINT8 Length; + UINT8 DescriptorType; + UINT16 BcdUSB; + UINT8 DeviceClass; + UINT8 DeviceSubClass; + UINT8 DeviceProtocol; + UINT8 MaxPacketSize0; + UINT16 IdVendor; + UINT16 IdProduct; + UINT16 BcdDevice; + UINT8 StrManufacturer; + UINT8 StrProduct; + UINT8 StrSerialNumber; + UINT8 NumConfigurations; +} EFI_USB_DEVICE_DESCRIPTOR; + +typedef struct { + UINT8 Length; + UINT8 DescriptorType; + UINT16 TotalLength; + UINT8 NumInterfaces; + UINT8 ConfigurationValue; + UINT8 Configuration; + UINT8 Attributes; + UINT8 MaxPower; +} EFI_USB_CONFIG_DESCRIPTOR; + +typedef struct { + UINT8 Length; + UINT8 DescriptorType; + UINT8 InterfaceNumber; + UINT8 AlternateSetting; + UINT8 NumEndpoints; + UINT8 InterfaceClass; + UINT8 InterfaceSubClass; + UINT8 InterfaceProtocol; + UINT8 Interface; +} EFI_USB_INTERFACE_DESCRIPTOR; + + +// EFI_USB_ENDPOINT_DESCRIPTOR's EndPointAttributes +// must mask the returned attributes before checking +#define USB_ENDPOINT_TYPE_MASK 3 + +#define USB_ENDPOINT_TYPE_CONTROL 0 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 +#define USB_ENDPOINT_TYPE_BULK 2 +#define USB_ENDPOINT_TYPE_INTERRUPT 3 + +typedef struct { + UINT8 Length; + UINT8 DescriptorType; + UINT8 EndpointAddress; + UINT8 Attributes; + UINT16 MaxPacketSize; + UINT8 Interval; +} EFI_USB_ENDPOINT_DESCRIPTOR; + +typedef struct { + UINT8 Length; + UINT8 DescriptorType; + CHAR16 String[1]; +} EFI_USB_STRING_DESCRIPTOR; + +typedef enum { + EfiUsbDataIn, + EfiUsbDataOut, + EfiUsbNoData +} EFI_USB_DATA_DIRECTION; + +// +// Error code for USB Transfer Results +// +#define EFI_USB_NOERROR 0x0000 +#define EFI_USB_ERR_NOTEXECUTE 0x0001 +#define EFI_USB_ERR_STALL 0x0002 +#define EFI_USB_ERR_BUFFER 0x0004 +#define EFI_USB_ERR_BABBLE 0x0008 +#define EFI_USB_ERR_NAK 0x0010 +#define EFI_USB_ERR_CRC 0x0020 +#define EFI_USB_ERR_TIMEOUT 0x0040 +#define EFI_USB_ERR_BITSTUFF 0x0080 +#define EFI_USB_ERR_SYSTEM 0x0100 + + + +typedef struct { + UINT8 RequestType; + UINT8 Request; + UINT16 Value; + UINT16 Index; + UINT16 Length; +} EFI_USB_DEVICE_REQUEST; + +#pragma pack(pop) + +typedef EFI_STATUS (EFIAPI *EFI_ASYNC_USB_TRANSFER_CALLBACK) ( + IN void *Data, + IN UINTN DataLength, + IN void *Context, + IN UINT32 Status); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_CONTROL_TRANSFER) ( + IN EFI_USB_IO_PROTOCOL *This, + IN EFI_USB_DEVICE_REQUEST *Request, + IN EFI_USB_DATA_DIRECTION Direction, + IN UINT32 Timeout, + IN OUT void *Data OPTIONAL, + IN UINTN DataLength OPTIONAL, + OUT UINT32 *Status ); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_BULK_TRANSFER) ( + IN EFI_USB_IO_PROTOCOL *This, + IN UINT8 DeviceEndpoint, + IN OUT void *Data, + IN OUT UINTN *DataLength, + IN UINTN Timeout, + OUT UINT32 *Status ); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER) ( + IN EFI_USB_IO_PROTOCOL *This, + IN UINT8 DeviceEndpoint, + IN BOOLEAN IsNewTransfer, + IN UINTN PollingInterval OPTIONAL, + IN UINTN DataLength OPTIONAL, + IN EFI_ASYNC_USB_TRANSFER_CALLBACK InterruptCallBack OPTIONAL, + IN void *Context OPTIONAL ); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_SYNC_INTERRUPT_TRANSFER) ( + IN EFI_USB_IO_PROTOCOL *This, + IN UINT8 DeviceEndpoint, + IN OUT void *Data, + IN OUT UINTN *DataLength, + IN UINTN Timeout, + OUT UINT32 *Status ); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_ISOCHRONOUS_TRANSFER) ( + IN EFI_USB_IO_PROTOCOL *This, + IN UINT8 DeviceEndpoint, + IN OUT void *Data, + IN UINTN DataLength, + OUT UINT32 *Status ); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER) ( + IN EFI_USB_IO_PROTOCOL *This, + IN UINT8 DeviceEndpoint, + IN OUT void *Data, + IN UINTN DataLength, + IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack, + IN void *Context OPTIONAL ); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_PORT_RESET) ( IN EFI_USB_IO_PROTOCOL *This ); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_GET_DEVICE_DESCRIPTOR) ( + IN EFI_USB_IO_PROTOCOL *This, + OUT EFI_USB_DEVICE_DESCRIPTOR *DeviceDescriptor ); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_GET_CONFIG_DESCRIPTOR) ( + IN EFI_USB_IO_PROTOCOL *This, + OUT EFI_USB_CONFIG_DESCRIPTOR *ConfigurationDescriptor ); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_GET_INTERFACE_DESCRIPTOR) ( + IN EFI_USB_IO_PROTOCOL *This, + OUT EFI_USB_INTERFACE_DESCRIPTOR *InterfaceDescriptor ); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR) ( + IN EFI_USB_IO_PROTOCOL *This, + IN UINT8 EndpointIndex, + OUT EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDescriptor ); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_GET_STRING_DESCRIPTOR) ( + IN EFI_USB_IO_PROTOCOL *This, + IN UINT16 LangID, + IN UINT8 StringID, + OUT CHAR16 **String ); + +typedef EFI_STATUS (EFIAPI *EFI_USB_IO_GET_SUPPORTED_LANGUAGE) ( + IN EFI_USB_IO_PROTOCOL *This, + OUT UINT16 **LangIDTable, + OUT UINT16 *TableSize ); + + + +// +// _EFI_USB_IO_PROTOCOL +// +typedef struct _EFI_USB_IO_PROTOCOL { + // + // IO transfer + // + EFI_USB_IO_CONTROL_TRANSFER UsbControlTransfer; + EFI_USB_IO_BULK_TRANSFER UsbBulkTransfer; + EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER UsbAsyncInterruptTransfer; + EFI_USB_IO_SYNC_INTERRUPT_TRANSFER UsbSyncInterruptTransfer; + EFI_USB_IO_ISOCHRONOUS_TRANSFER UsbIsochronousTransfer; + EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER UsbAsyncIsochronousTransfer; + + // + // Common device request + // + EFI_USB_IO_GET_DEVICE_DESCRIPTOR UsbGetDeviceDescriptor; + EFI_USB_IO_GET_CONFIG_DESCRIPTOR UsbGetConfigDescriptor; + EFI_USB_IO_GET_INTERFACE_DESCRIPTOR UsbGetInterfaceDescriptor; + EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR UsbGetEndpointDescriptor; + EFI_USB_IO_GET_STRING_DESCRIPTOR UsbGetStringDescriptor; + EFI_USB_IO_GET_SUPPORTED_LANGUAGE UsbGetSupportedLanguages; + + // + // Reset controller's parent port + // + EFI_USB_IO_PORT_RESET UsbPortReset; +} EFI_USB_IO_PROTOCOL; + +#endif //_USBIO_INC_ + +//**************************************************************************** +//**************************************************************************** +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 ** +//** ** +//** Phone (770)-246-8600 ** +//** ** +//**************************************************************************** +//**************************************************************************** diff --git a/Include/Protocol/UsbPolicy.h b/Include/Protocol/UsbPolicy.h new file mode 100644 index 0000000..1a326d3 --- /dev/null +++ b/Include/Protocol/UsbPolicy.h @@ -0,0 +1,233 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2014, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/UsbPolicy.h 22 12/24/14 10:43p Wilsonlee $ +// +// $Revision: 22 $ +// +// $Date: 12/24/14 10:43p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/UsbPolicy.h $ +// +// 22 12/24/14 10:43p Wilsonlee +// [TAG] EIP196287 +// [Category] Improvement +// [Description] Display info of connected usb controllers and remove or +// grayed-out some item according the connected usb controller number. +// [Files] uhcd.c, usbport.c, usb.uni, usb.sd, usbsetup.c, +// AmiUsbController.h, UsbPolicy.h +// +// 21 12/21/12 5:03a Ryanchou +// [TAG] EIP71730 +// [Category] New Feature +// [Description] Added OHCI handoff support. +// [Files] usb.sdl, usbport.c, amiusb.c, usbdef.h, UsbPolicy.h, usb.sd, +// usb.uni +// +// 20 9/04/12 8:01a Wilsonlee +// [TAG] EIP99882 +// [Category] New Feature +// [Description] Add the usb setup item and usbpolicyprotocol to enable +// or disable the usb mass storage driver. +// [Files] UsbPolicy.h, usb.uni, usb.sd, usbmass.c, usbdef.h, +// efiusbmass.c, usbport.c, uhcd.c +// +// 19 5/03/12 5:11a Ryanchou +// [TAG] EIP83361 +// [Category] New Feature +// [Description] Added "USB 2.0 Controller Mode" setup item. +// [Files] ehci.c, usb.sd, usb.sdl, usb.uni, usbdef.h, UsbPolicy.h, +// usbport.c +// +// 18 8/08/11 5:26a Ryanchou +// [TAG] EIP60561 +// [Category] New Feature +// [Description] Add USB timing policy protocol for timing override. +// [Files] ehci.c, guids.c, ohci.c, uhcd.c, uhci.c usb.c, usbdef.h, +// usbhub.c, usbmass.c, UsbPolicy.h, usbport.c usbsrc.sdl +// +// 17 2/18/11 1:15a Ryanchou +// [TAG] EIP48184 +// [Category] Improvement +// [Description] Update files according to the new Setup Customization +// guidelines. +// [Files] usb.sd, UsbPolicy.h +// +// 16 10/12/10 2:45a Rameshr +// [TAG]- EIP 44585 +// [Category]-IMPROVEMENT +// [Description]- Number of maximum supported USB Mass Storage device +// increased from 8 to 16. +// [Files]- Uin13.bin, UsbPort.c, UsbInt13.h, Usb.c, Usbdef.h, Uasbmass.c, +// Usb.sd, usb.uni, UsbSetup.c, UsbSrc.sdl, UsbPolicy.h +// +//********************************************************************** + +//<AMI_FHDR_START> +//---------------------------------------------------------------------------- +// +// Name: UsbPolicy.h +// +// Description: Protocol used for USB policy definitions +// +//---------------------------------------------------------------------------- +//<AMI_FHDR_END> + +#ifndef _AMIUSB_POLICY_PROTOCOL_H_ +#define _AMIUSB_POLICY_PROTOCOL_H_ + +#define EFI_USB_POLICY_PROTOCOL_GUID \ + { 0x5859cb76, 0x6bef, 0x468a, 0xbe, 0x2d, 0xb3, 0xdd, 0x1a, 0x27, 0xf0, 0x12 } +#define USB_TIMING_POLICY_PROTOCOL_GUID \ + { 0x89e3c1dc, 0xb5e3, 0x4d34, 0xae, 0xad, 0xdd, 0x7e, 0xb2, 0x82, 0x8c, 0x18 } + +#ifndef VFRCOMPILE +typedef enum { + USBMASS_EMU_AUTO, + USBMASS_EMU_FDD, + USBMASS_EMU_FORCED_FDD, + USBMASS_EMU_HDD, + USBMASS_EMU_CD +} USBMASS_EMU_TYPE; +#endif + +#define USB_DEVPLCY_STATUS_PRESENT 1 + +#ifndef TYPEDEF_USB_SUPPORT_SETUP +#define TYPEDEF_USB_SUPPORT_SETUP +typedef struct { + UINT8 UsbMainSupport; + UINT8 UsbLegacySupport; + UINT8 UsbEhciHandoff; + UINT8 UsbOhciHandoff; + UINT8 UsbHotplugFddSupport; + UINT8 UsbHotplugHddSupport; + UINT8 UsbHotplugCdromSupport; + UINT8 UsbEmul6064; + UINT8 UsbMassResetDelay; + UINT8 UsbControlTimeOut; //(EIP30079+) + UINT8 UsbEmu1; + UINT8 UsbEmu2; + UINT8 UsbEmu3; + UINT8 UsbEmu4; + UINT8 UsbEmu5; + UINT8 UsbEmu6; + UINT8 UsbEmu7; + UINT8 UsbEmu8; + UINT8 UsbEmu9; + UINT8 UsbEmu10; + UINT8 UsbEmu11; + UINT8 UsbEmu12; + UINT8 UsbEmu13; + UINT8 UsbEmu14; + UINT8 UsbEmu15; + UINT8 UsbEmu16; + UINT8 UsbXhciSupport; + UINT8 UsbXhciHandoff; + UINT8 PowerGoodDeviceDelay; + UINT8 PowerGoodDeviceNumDelay; + UINT8 UsbHiSpeedSupport; + UINT8 UsbMassDriverSupport; //(EIP99882+) +} USB_SUPPORT_SETUP; +#endif + +#ifndef TYPEDEF_USB_MASS_DEV_VALID +#define TYPEDEF_USB_MASS_DEV_VALID +typedef struct{ + UINT8 UsbEmu1Valid; + UINT8 UsbEmu2Valid; + UINT8 UsbEmu3Valid; + UINT8 UsbEmu4Valid; + UINT8 UsbEmu5Valid; + UINT8 UsbEmu6Valid; + UINT8 UsbEmu7Valid; + UINT8 UsbEmu8Valid; + UINT8 UsbEmu9Valid; + UINT8 UsbEmu10Valid; + UINT8 UsbEmu11Valid; + UINT8 UsbEmu12Valid; + UINT8 UsbEmu13Valid; + UINT8 UsbEmu14Valid; + UINT8 UsbEmu15Valid; + UINT8 UsbEmu16Valid; +} USB_MASS_DEV_VALID; +#endif + +#define MAX_USB_MASS 8 +#define SETUP_DATA_HOTPLUG_ENABLED 1 +#define SETUP_DATA_HOTPLUG_DISABLED 2 +#define SETUP_DATA_HOTPLUG_AUTO 3 +#define SETUP_DATA_RESETDELAY_20S 1 + +#ifndef VFRCOMPILE +typedef struct _USB_POLICY_PROTOCOL { + USB_SUPPORT_SETUP *UsbDevPlcy; +} EFI_USB_POLICY_PROTOCOL; +#endif + +#define EMULATION_FAKE_INTERFACE 1 + +#ifndef TYPEDEF_USB_MASS_DEV_NUM +#define TYPEDEF_USB_MASS_DEV_NUM +typedef struct { + UINT8 UsbMassDevNum; + UINT8 IsInteractionAllowed; +} USB_MASS_DEV_NUM; +#endif + +#ifndef TYPEDEF_USB_CONTROLLER_NUM +#define TYPEDEF_USB_CONTROLLER_NUM +typedef struct { + UINT8 UhciNum; + UINT8 OhciNum; + UINT8 EhciNum; + UINT8 XhciNum; +} USB_CONTROLLER_NUM; +#endif + +typedef struct { + UINT16 UsbTimingPolicyRevision; + UINT16 UsbTimingPolicyLength; + UINT16 EhciPortPowerOnDelay; + UINT16 EhciPortConnect; + UINT16 EhciPortReset; + UINT16 OhciHcResetDelay; + UINT16 OhciPortEnable; + UINT16 OhciHcReset; + UINT16 UhciGlobalReset; + UINT16 UhciPortEnable; + UINT16 HubPortConnect; + UINT16 HubPortEnable; + UINT16 MassDeviceComeUp; + UINT16 RmhPowerOnDelay; +} USB_TIMING_POLICY; + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2014, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/UserCredential.h b/Include/Protocol/UserCredential.h new file mode 100644 index 0000000..2a324cf --- /dev/null +++ b/Include/Protocol/UserCredential.h @@ -0,0 +1,183 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/UserCredential.h 1 5/13/11 4:37p Artems $ +// +// $Revision: 1 $ +// +// $Date: 5/13/11 4:37p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/UserCredential.h $ +// +// 1 5/13/11 4:37p Artems +// +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: <UserCredential.h> +// +// Description: User credential protocol header file +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __USER_CREDENTIAL__H__ +#define __USER_CREDENTIAL__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#include <UefiHii.h> +#include <Protocol/UserManager.h> + +#define EFI_USER_CREDENTIAL_PROTOCOL_GUID \ + { 0x71ee5e94, 0x65b9, 0x45d5, 0x82, 0x1a, 0x3a, 0x4d, 0x86, 0xcf, 0xe6, 0xbe } + +#define EFI_USER_CREDENTIAL_CLASS_UNKNOWN \ + { 0x5cf32e68, 0x7660, 0x449b, 0x80, 0xe6, 0x7e, 0xa3, 0x6e, 0x03, 0xf6, 0xa8 } + +#define EFI_USER_CREDENTIAL_CLASS_PASSWORD \ + { 0xf8e5058c, 0xccb6, 0x4714, 0xb2, 0x20, 0x3f, 0x7e, 0x3a, 0x64, 0x0b, 0xd1 } + +#define EFI_USER_CREDENTIAL_CLASS_SMART_CARD \ + { 0x5f03ba33, 0x8c6b, 0x4c24, 0xaa, 0x2e, 0x14, 0xa2, 0x65, 0x7b, 0xd4, 0x54 } + +#define EFI_USER_CREDENTIAL_CLASS_FINGERPRINT \ + { 0x32cba21f, 0xf308, 0x4cbc, 0x9a, 0xb5, 0xf5, 0xa3, 0x69, 0x9f, 0x04, 0x4a } + +#define EFI_USER_CREDENTIAL_CLASS_HANDPRINT \ + { 0x5917ef16, 0xf723, 0x4bb9, 0xa6, 0x4b, 0xd8, 0xc5, 0x32, 0xf4, 0xd8, 0xb5 } + +#define EFI_USER_CREDENTIAL_CLASS_SECURE_CARD \ + { 0x8a6b4a83, 0x42fe, 0x45d2, 0xa2, 0xef, 0x46, 0xf0, 0x6c, 0x7d, 0x98, 0x52 } + + +#define EFI_CREDENTIAL_CAPABILITIES_ENROLL 0x0000000000000001 + +#define EFI_CREDENTIAL_LOGON_FLAG_AUTO 0x00000001 +#define EFI_CREDENTIAL_LOGON_FLAG_DEFAULT 0x00000002 + +GUID_VARIABLE_DECLARATION(gEfiUserCredentialProtocolGuid, EFI_USER_CREDENTIAL_PROTOCOL_GUID); +GUID_VARIABLE_DECLARATION(gEfiUserCredentialClassPasswordGuid, EFI_USER_CREDENTIAL_CLASS_PASSWORD); + +typedef struct _EFI_USER_CREDENTIAL_PROTOCOL EFI_USER_CREDENTIAL_PROTOCOL; + +typedef UINT64 EFI_CREDENTIAL_CAPABILITIES; +typedef UINT32 EFI_CREDENTIAL_LOGON_FLAGS; + +typedef EFI_STATUS +(EFIAPI *EFI_CREDENTIAL_ENROLL)( + IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This, + IN EFI_USER_PROFILE_HANDLE User +); + +typedef EFI_STATUS +(EFIAPI *EFI_CREDENTIAL_FORM)( + IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This, + OUT EFI_HII_HANDLE *Hii, + OUT EFI_GUID *FormSetId, + OUT EFI_FORM_ID *FormId +); + +typedef EFI_STATUS +(EFIAPI *EFI_CREDENTIAL_TILE)( + IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This, + IN OUT UINTN *Width, + IN OUT UINTN *Height, + OUT EFI_HII_HANDLE *Hii, + OUT EFI_IMAGE_ID *Image +); + +typedef EFI_STATUS +(EFIAPI *EFI_CREDENTIAL_TITLE)( + IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This, + OUT EFI_HII_HANDLE *Hii, + OUT EFI_STRING_ID *String +); + +typedef EFI_STATUS +(EFIAPI *EFI_CREDENTIAL_USER)( + IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This, + IN EFI_USER_PROFILE_HANDLE User, + OUT EFI_USER_INFO_IDENTIFIER *Identifier +); + +typedef EFI_STATUS +(EFIAPI *EFI_CREDENTIAL_SELECT)( + IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This, + OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon +); + +typedef +EFI_STATUS (EFIAPI *EFI_CREDENTIAL_DESELECT)( + IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This +); + +typedef EFI_STATUS +(EFIAPI *EFI_CREDENTIAL_DEFAULT)( + IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This, + OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon +); + +typedef EFI_STATUS +(EFIAPI *EFI_CREDENTIAL_GET_INFO)( + IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This, + IN EFI_USER_INFO_HANDLE UserInfo, + OUT EFI_USER_INFO *Info, + IN OUT UINTN *InfoSize +); + +typedef EFI_STATUS +(EFIAPI *EFI_CREDENTIAL_GET_NEXT_INFO)( + IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This, + IN OUT EFI_USER_INFO_HANDLE *UserInfo +); + +struct _EFI_USER_CREDENTIAL_PROTOCOL { + EFI_GUID Identifier; + EFI_GUID Type; + EFI_CREDENTIAL_ENROLL Enroll; + EFI_CREDENTIAL_FORM Form; + EFI_CREDENTIAL_TILE Tile; + EFI_CREDENTIAL_TITLE Title; + EFI_CREDENTIAL_USER User; + EFI_CREDENTIAL_SELECT Select; + EFI_CREDENTIAL_DESELECT Deselect; + EFI_CREDENTIAL_DEFAULT Default; + EFI_CREDENTIAL_GET_INFO GetInfo; + EFI_CREDENTIAL_GET_NEXT_INFO GetNextInfo; + EFI_CREDENTIAL_CAPABILITIES Capabilities; +}; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/UserManager.h b/Include/Protocol/UserManager.h new file mode 100644 index 0000000..870727a --- /dev/null +++ b/Include/Protocol/UserManager.h @@ -0,0 +1,281 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/Include/Protocol/UserManager.h 1 5/13/11 4:36p Artems $ +// +// $Revision: 1 $ +// +// $Date: 5/13/11 4:36p $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Include/Protocol/UserManager.h $ +// +// 1 5/13/11 4:36p Artems +// +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: <UserManager.h> +// +// Description: User manager protocol header file +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __USER_MANAGER__H__ +#define __USER_MANAGER__H__ +#ifdef __cplusplus +extern "C" { +#endif + +#define EFI_USER_MANAGER_PROTOCOL_GUID \ + { 0x6fd5b00c, 0xd426, 0x4283, 0x98, 0x87, 0x6c, 0xf5, 0xcf, 0x1c, 0xb1, 0xfe } + +#define EFI_EVENT_GROUP_USER_PROFILE_CHANGED \ + { 0xbaf1e6de, 0x209e, 0x4adb, 0x8d, 0x96, 0xfd, 0x8b, 0x71, 0xf3, 0xf6, 0x83 } + +#define EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID \ + { 0x85b75607, 0xf7ce, 0x471e, 0xb7, 0xe4, 0x2a, 0xea, 0x5f, 0x72, 0x32, 0xee } + +#define EFI_USER_INFO_ACCESS_SETUP_NORMAL_GUID \ + { 0x1db29ae0, 0x9dcb, 0x43bc, 0x8d, 0x87, 0x5d, 0xa1, 0x49, 0x64, 0xdd, 0xe2 } + +#define EFI_USER_INFO_ACCESS_SETUP_RESTRICTED_GUID \ + { 0xbdb38125, 0x4d63, 0x49f4, 0x82, 0x12, 0x61, 0xcf, 0x5a, 0x19, 0x0a, 0xf8 } + +GUID_VARIABLE_DECLARATION(gEfiUserManagerProtocolGuid, EFI_USER_MANAGER_PROTOCOL_GUID); +GUID_VARIABLE_DECLARATION(gEfiEventUserProfileChangedGuid, EFI_EVENT_GROUP_USER_PROFILE_CHANGED); +GUID_VARIABLE_DECLARATION(gEfiUserInfoAccessSetupAdminGuid, EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID); +GUID_VARIABLE_DECLARATION(gEfiUserInfoAccessSetupNormalGuid, EFI_USER_INFO_ACCESS_SETUP_NORMAL_GUID); +GUID_VARIABLE_DECLARATION(gEfiUserInfoAccessSetupRestrictedGuid, EFI_USER_INFO_ACCESS_SETUP_RESTRICTED_GUID); + +typedef struct _EFI_USER_MANAGER_PROTOCOL EFI_USER_MANAGER_PROTOCOL; + +typedef VOID *EFI_USER_PROFILE_HANDLE; +typedef VOID *EFI_USER_INFO_HANDLE; +typedef UINT16 EFI_USER_INFO_ATTRIBS; + +#define EFI_USER_INFO_STORAGE 0x000F +#define EFI_USER_INFO_STORAGE_VOLATILE 0x0000 +#define EFI_USER_INFO_STORAGE_CREDENTIAL_NV 0x0001 +#define EFI_USER_INFO_STORAGE_PLATFORM_NV 0x0002 + +#define EFI_USER_INFO_ACCESS 0x0070 +#define EFI_USER_INFO_PUBLIC 0x0010 +#define EFI_USER_INFO_PRIVATE 0x0020 +#define EFI_USER_INFO_PROTECTED 0x0030 +#define EFI_USER_INFO_EXCLUSIVE 0x0080 + +#define EFI_USER_INFO_ACCESS_POLICY_RECORD 0x0E +typedef struct { + UINT32 Type; + UINT32 Size; +} EFI_USER_INFO_ACCESS_CONTROL; +typedef EFI_USER_INFO_ACCESS_CONTROL EFI_USER_INFO_ACCESS_POLICY; + +#define EFI_USER_INFO_ACCESS_FORBID_LOAD 0x00000001 +#define EFI_USER_INFO_ACCESS_PERMIT_LOAD 0x00000002 +#define EFI_USER_INFO_ACCESS_ENROLL_SELF 0x00000003 +#define EFI_USER_INFO_ACCESS_ENROLL_OTHERS 0x00000004 +#define EFI_USER_INFO_ACCESS_MANAGE 0x00000005 +#define EFI_USER_INFO_ACCESS_SETUP 0x00000006 +#define EFI_USER_INFO_ACCESS_FORBID_CONNECT 0x00000007 +#define EFI_USER_INFO_ACCESS_PERMIT_CONNECT 0x00000008 +#define EFI_USER_INFO_ACCESS_BOOT_ORDER 0x00000009 + typedef UINT32 EFI_USER_INFO_ACCESS_BOOT_ORDER_HDR; + #define EFI_USER_INFO_ACCESS_BOOT_ORDER_MASK 0x000F + #define EFI_USER_INFO_ACCESS_BOOT_ORDER_INSERT 0x0000 + #define EFI_USER_INFO_ACCESS_BOOT_ORDER_APPEND 0x0001 + #define EFI_USER_INFO_ACCESS_BOOT_ORDER_REPLACE 0x0002 + #define EFI_USER_INFO_ACCESS_BOOT_ORDER_NODEFAULT 0x0010 + +#define EFI_USER_INFO_CBEFF_RECORD 0x0B +typedef VOID *EFI_USER_INFO_CBEFF; + +#define EFI_USER_INFO_CREATE_DATE_RECORD 0x02 +typedef EFI_TIME EFI_USER_INFO_CREATE_DATE; + +#define EFI_USER_INFO_CREDENTIAL_PROVIDER_RECORD 0x08 +typedef EFI_GUID EFI_USER_INFO_CREDENTIAL_PROVIDER; + +#define EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD 0x09 +typedef CHAR16 *EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME; + +#define EFI_USER_INFO_CREDENTIAL_TYPE_RECORD 0x06 +typedef EFI_GUID EFI_USER_INFO_CREDENTIAL_TYPE; + +#define EFI_USER_INFO_CREDENTIAL_TYPE_NAME_RECORD 0x07 +typedef CHAR16 *EFI_USER_INFO_CREDENTIAL_TYPE_NAME; + +#define EFI_USER_INFO_GUID_RECORD 0xFF +typedef EFI_GUID EFI_USER_INFO_GUID; + +#define EFI_USER_INFO_FAR_RECORD 0x0C +typedef UINT8 EFI_USER_INFO_FAR; + +#define EFI_USER_INFO_IDENTIFIER_RECORD 0x05 +typedef UINT8 EFI_USER_INFO_IDENTIFIER[16]; + +#define EFI_USER_INFO_IDENTITY_POLICY_RECORD 0x0F +typedef struct { + UINT32 Type; + UINT32 Length; +} EFI_USER_INFO_IDENTITY_POLICY; +#define EFI_USER_INFO_IDENTITY_FALSE 0x00 +#define EFI_USER_INFO_IDENTITY_TRUE 0x01 +#define EFI_USER_INFO_IDENTITY_CREDENTIAL_TYPE 0x02 +#define EFI_USER_INFO_IDENTITY_CREDENTIAL_PROVIDER 0x03 +#define EFI_USER_INFO_IDENTITY_NOT 0x10 +#define EFI_USER_INFO_IDENTITY_AND 0x11 +#define EFI_USER_INFO_IDENTITY_OR 0x12 + +#define EFI_USER_INFO_NAME_RECORD 0x01 +typedef CHAR16 *EFI_USER_INFO_NAME; + +#define EFI_USER_INFO_PKCS11_RECORD 0x0A +#define EFI_USER_INFO_RETRY_RECORD 0x0D +typedef UINT8 EFI_USER_INFO_RETRY; + +#define EFI_USER_INFO_USAGE_DATE_RECORD 0x03 +typedef EFI_TIME EFI_USER_INFO_USAGE_DATE; + +#define EFI_USER_INFO_USAGE_COUNT_RECORD 0x04 +typedef UINT64 EFI_USER_INFO_USAGE_COUNT; + +#define EFI_USER_INFO_EMPTY_RECORD 0x00 + +typedef struct { + UINT64 Size; +} EFI_USER_INFO_TABLE; + +typedef struct { + EFI_GUID Credential; + UINT8 InfoType; + UINT8 Reserved1; + EFI_USER_INFO_ATTRIBS InfoAttribs; + UINT32 InfoSize; +} EFI_USER_INFO; + +typedef EFI_STATUS +(EFIAPI *EFI_USER_PROFILE_CREATE) ( + IN CONST EFI_USER_MANAGER_PROTOCOL *This, + OUT EFI_USER_PROFILE_HANDLE *User +); + +typedef EFI_STATUS +(EFIAPI *EFI_USER_PROFILE_DELETE) ( + IN CONST EFI_USER_MANAGER_PROTOCOL *This, + IN EFI_USER_PROFILE_HANDLE User +); + +typedef EFI_STATUS +(EFIAPI *EFI_USER_PROFILE_GET_NEXT)( + IN CONST EFI_USER_MANAGER_PROTOCOL *This, + IN OUT EFI_USER_PROFILE_HANDLE *User +); + +typedef EFI_STATUS +(EFIAPI *EFI_USER_PROFILE_CURRENT)( + IN CONST EFI_USER_MANAGER_PROTOCOL *This, + OUT EFI_USER_PROFILE_HANDLE *CurrentUser +); + +typedef EFI_STATUS +(EFIAPI *EFI_USER_PROFILE_IDENTIFY) ( + IN CONST EFI_USER_MANAGER_PROTOCOL *This, + OUT EFI_USER_PROFILE_HANDLE *User +); + +typedef EFI_STATUS +(EFIAPI *EFI_USER_PROFILE_FIND)( + IN CONST EFI_USER_MANAGER_PROTOCOL *This, + IN OUT EFI_USER_PROFILE_HANDLE *User, + IN OUT EFI_USER_INFO_HANDLE *UserInfo OPTIONAL, + IN CONST EFI_USER_INFO *Info, + IN UINTN InfoSize +); + +typedef EFI_STATUS +(EFIAPI *EFI_USER_PROFILE_NOTIFY)( + IN CONST EFI_USER_MANAGER_PROTOCOL *This, + IN EFI_HANDLE Changed +); + +typedef EFI_STATUS +(EFIAPI *EFI_USER_PROFILE_GET_INFO)( + IN CONST EFI_USER_MANAGER_PROTOCOL *This, + IN EFI_USER_PROFILE_HANDLE User, + IN EFI_USER_INFO_HANDLE UserInfo, + OUT EFI_USER_INFO *Info, + IN OUT UINTN *InfoSize +); + +typedef EFI_STATUS +(EFIAPI *EFI_USER_PROFILE_SET_INFO) ( + IN CONST EFI_USER_MANAGER_PROTOCOL *This, + IN EFI_USER_PROFILE_HANDLE User, + IN OUT EFI_USER_INFO_HANDLE *UserInfo, + IN CONST EFI_USER_INFO *Info, + IN UINTN InfoSize +); + +typedef EFI_STATUS +(EFIAPI *EFI_USER_PROFILE_DELETE_INFO) ( + IN CONST EFI_USER_MANAGER_PROTOCOL *This, + IN EFI_USER_PROFILE_HANDLE User, + IN EFI_USER_INFO_HANDLE UserInfo +); + +typedef EFI_STATUS +(EFIAPI *EFI_USER_PROFILE_GET_NEXT_INFO)( + IN CONST EFI_USER_MANAGER_PROTOCOL *This, + IN EFI_USER_PROFILE_HANDLE User, + IN OUT EFI_USER_INFO_HANDLE *UserInfo +); + +struct _EFI_USER_MANAGER_PROTOCOL { + EFI_USER_PROFILE_CREATE Create; + EFI_USER_PROFILE_DELETE Delete; + EFI_USER_PROFILE_GET_NEXT GetNext; + EFI_USER_PROFILE_CURRENT Current; + EFI_USER_PROFILE_IDENTIFY Identify; + EFI_USER_PROFILE_FIND Find; + EFI_USER_PROFILE_NOTIFY Notify; + EFI_USER_PROFILE_GET_INFO GetInfo; + EFI_USER_PROFILE_SET_INFO SetInfo; + EFI_USER_PROFILE_DELETE_INFO DeleteInfo; + EFI_USER_PROFILE_GET_NEXT_INFO GetNextInfo; +}; + + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2011, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//**********************************************************************
\ No newline at end of file diff --git a/Include/Protocol/Variable.h b/Include/Protocol/Variable.h new file mode 100644 index 0000000..7e5ee35 --- /dev/null +++ b/Include/Protocol/Variable.h @@ -0,0 +1,80 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Variable.h 3 3/13/06 1:45a Felixp $ +// +// $Revision: 3 $ +// +// $Date: 3/13/06 1:45a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Variable.h $ +// +// 3 3/13/06 1:45a Felixp +// +// 2 3/04/05 10:43a Mandal +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:42a Felixp +// +// 1 12/23/04 9:29a Felixp +// +// 1 3/30/04 2:24a Felixp +// +//********************************************************************** +//<AMI_FHDR_START> +// +// Name: Variable.h +// +// Description: Variable Architectural Protocol Definitions +// +//<AMI_FHDR_END> +//********************************************************************** +#ifndef __VARIABLE_ARCH_PROTOCOL_H__ +#define __VARIABLE_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +#define EFI_VARIABLE_ARCH_PROTOCOL_GUID \ + {0x1e5668e2,0x8481,0x11d4,0xbc,0xf1,0x0,0x80,0xc7,0x3c,0x88,0x81} + +#define EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID \ + {0x6441f818,0x6362,0x4e44,0xb5,0x70,0x7d,0xba,0x31,0xdd,0x24,0x53} + +GUID_VARIABLE_DECLARATION(gEfiVariableArchProtocolGuid, EFI_VARIABLE_ARCH_PROTOCOL_GUID); +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/WatchdogTimer.h b/Include/Protocol/WatchdogTimer.h new file mode 100644 index 0000000..4b10e1b --- /dev/null +++ b/Include/Protocol/WatchdogTimer.h @@ -0,0 +1,224 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** +//********************************************************************** +// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/WatchdogTimer.h 1 3/13/06 1:45a Felixp $ +// +// $Revision: 1 $ +// +// $Date: 3/13/06 1:45a $ +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/WatchdogTimer.h $ +// +// 1 3/13/06 1:45a Felixp +// +// 1 1/28/05 12:44p Felixp +// +// 2 1/18/05 3:21p Felixp +// PrintDebugMessage renamed to Trace +// +// 1 12/23/04 9:42a Felixp +// +// 1 12/23/04 9:29a Felixp +// +// 3 3/29/04 5:16p Felixp +// +// 2 3/25/04 5:09p Robert +// Updated the watchdog protocols with correct values from the +// specification +// +// 1 12/31/03 11:05a Robert +// +//***************************************************************************** +//<AMI_FHDR_START> +// +// Name: WatchdogTimer.h +// +// Description: This file contains Data structures and support values for the +// Watchdog Timer Architectural Protocol +// +//<AMI_FHDR_END> +//***************************************************************************** +#ifndef __WATCHDOG_TIMER_ARCH_PROTOCOL_H__ +#define __WATCHDOG_TIMER_ARCH_PROTOCOL_H__ +#ifdef __cplusplus +extern "C" { +#endif +#include <EFI.h> + +// GUID for the Timer Architectural Protocol +#define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \ + { 0x665E3FF5, 0x46CC, 0x11D4, 0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } + +GUID_VARIABLE_DECLARATION(gEfiWatchdogTimerArchProtocolGuid, EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID); + +// Declare an empty structure for the Timer Architectural Protocol +typedef struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL EFI_WATCHDOG_TIMER_ARCH_PROTOCOL; + + +//<AMI_PHDR_START> +//============================================================================ +// Procedure Type: EFI_WATCHDOG_TIMER_NOTIFY +// +// Description: The function of this type is called from the Watchdog Notify +// function. This is the type defnition of the Registered Handler. +// +// Input: +// Time - Time since the last timer interrupt in 100 ns units. +// +// Output: None +// +// Referrals: +// +//============================================================================ +//<AMI_PHDR_END> +typedef +VOID +(EFIAPI *EFI_WATCHDOG_TIMER_NOTIFY) ( + IN UINT64 Timer + ); + + +//<AMI_PHDR_START> +//============================================================================ +// Procedure Type: EFI_WATCHDOG_NOTIFY +// +// Description: The function of this type is called when the watchdog Event +// is signalled +// +// Input: +// Time - Time since the last timer interrupt in 100 ns units. +// +// Output: None +// +// Referrals: +// +//============================================================================ +//<AMI_PHDR_END> +typedef +VOID +(EFIAPI *EFI_WATCHDOG_NOTIFY) ( + IN EFI_EVENT Event, + IN VOID *Context + ); + + +//<AMI_PHDR_START> +//============================================================================ +// Procedure Type: EFI_WATCHDOG_TIMER_REGISTER_HANDLER +// +// Description: The function of this type registers the notify function +// that will be called if the timer interrupt fires +// +// Input: +// This - The instance of the EFI_WATCHDOG_TIMER_ARCH_PROTOCOL +// +// NotifyFunction - The function to call when a timer interrupt fires +// +// Output: EFI_SUCCESS - The timer handler was registered. +// +// Referrals: +// +//============================================================================ +//<AMI_PHDR_END> +typedef +EFI_STATUS +(EFIAPI *EFI_WATCHDOG_TIMER_REGISTER_HANDLER) ( + IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This, + IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction +); + + +//<AMI_PHDR_START> +//============================================================================ +// Procedure Type: EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD +// +// Description: The function of this type sets the timer interrupt interval +// based on the input value in TimerPeriod +// +// Input: +// This - The instance of the EFI_WATCHDOG_TIMER_ARCH_PROTOCOL +// +// TimerPeriod - The rate to program the timer interrupt in 100 nS units. +// +// Output: EFI_SUCCESS - The timer handler was registered. +// +// Referrals: +// +//============================================================================ +//<AMI_PHDR_END> +typedef +EFI_STATUS +(EFIAPI *EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD) ( + IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This, + IN UINT64 TimerPeriod + ); + + +//<AMI_PHDR_START> +//============================================================================ +// Procedure Type: EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD +// +// Description: The function of this type gets the timer interrupt in +// 100ns increments +// +// Input: +// This - The instance of the EFI_WATCHDOG_TIMER_ARCH_PROTOCOL +// +// *TimerPeriod - Pointer to the timer period in 100 nS units. +// +// Output: +// EFI_SUCCESS - The timer period was returned in TimerPeriod. +// EFI_INVALID_PARAMETER - TimerPeriod is NULL. +// +// Referrals: +// +//============================================================================ +//<AMI_PHDR_END> +typedef +EFI_STATUS +(EFIAPI *EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD) ( + IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This, + IN UINT64 *TimerPeriod + ); + + + + +// Interface for the Timer Architectural Protocol +typedef struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL { + EFI_WATCHDOG_TIMER_REGISTER_HANDLER RegisterHandler; + EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD SetTimerPeriod; + EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD GetTimerPeriod; +} EFI_WATCHDOG_TIMER_ARCH_PROTOCOL; + +/****** DO NOT WRITE BELOW THIS LINE *******/ +#ifdef __cplusplus +} +#endif +#endif +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2005, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 6145-F Northbelt Pkwy, Norcross, GA 30071 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** diff --git a/Include/Protocol/sbProtocols.CIF b/Include/Protocol/sbProtocols.CIF new file mode 100644 index 0000000..77e8de5 --- /dev/null +++ b/Include/Protocol/sbProtocols.CIF @@ -0,0 +1,14 @@ +<component> + name = "SB Protocols" + category = ModulePart + LocalRoot = "INCLUDE\Protocol" + RefName = "SB Protocols" +[files] +"PIDEController.h" +"SmmBiosWriteDispatch.h" +"SBSmiProtocol.h" +"SmmIoTrapDispatch.h" +"SmmPchIoTrapDispatch2.h" +"SBPlatformData.h" +"SbHpet.h" +<endComponent> diff --git a/Include/Protocol/smiflash.h b/Include/Protocol/smiflash.h new file mode 100644 index 0000000..2484469 --- /dev/null +++ b/Include/Protocol/smiflash.h @@ -0,0 +1,173 @@ +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** + +//********************************************************************** +// $Header: /Alaska/SOURCE/Modules/SMIFlash/smiflash.h 9 3/06/12 1:43a Klzhan $ +// +// $Revision: 9 $ +// +// $Date: 3/06/12 1:43a $ +//********************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SMIFlash/smiflash.h $ +// +// 9 3/06/12 1:43a Klzhan +// Don't update another NVRam region. +// +// 8 8/29/11 7:10a Klzhan +// +// 7 5/16/11 4:39a Klzhan +// [TAG] EIP58139 +// [Category] Improvement +// [Description] Support OA3.0. +// [Files] SMIFlash.h +// +// 6 12/21/09 4:40a Klzhan +// Improvement : Updated for Aptio Source Enhancement. +// +// 5 7/02/09 8:34a Klzhan +// Improvement: Add a parameter for ME FW Update. +// +// 4 3/05/09 1:17p Felixp +// - Bug fix. EIP 17632. +// Flash Blocks that do not belong to FV_BB, FV_MAIN, and FV_NVRAM +// have been reported as boot block. +// The SmiFlash.c is updated to report these blocks as non critical +// blocks. +// The SmiFlash.h header is updated to define non critical block type +// (NC_BLOCK ). +// - Headers updated. +// +// 3 12/29/06 3:11p Felixp +// Embedded Controller support added +// +// 2 3/02/06 10:31a Davidd +// Updated BLOCK_DESC array in INFO_BLOCK structure to correct the +// data corruption problem when calling GetFlashInfo. +// +// 1 4/05/05 3:48p Sivagarn +// Initial Checkin +// +//********************************************************************** + +#ifndef _EFI_SMI_FLASH_H_ +#define _EFI_SMI_FLASH_H_ + +#include <token.h> + +// {6F2C06A8-D4B4-4a93-9F78-2B480BE80E0F} +#define EFI_SMI_FLASH_GUID \ + {0x6f2c06a8,0xd4b4,0x4a93,0x9f,0x78,0x2b,0x48,0xb,0xe8,0xe,0xf} + +#define NUMBER_OF_BLOCKS (FLASH_SIZE/FLASH_BLOCK_SIZE) + +#define SMIFLASH_ENABLE_FLASH 0x20 +#define SMIFLASH_READ_FLASH 0x21 +#define SMIFLASH_ERASE_FLASH 0x22 +#define SMIFLASH_WRITE_FLASH 0x23 +#define SMIFLASH_DISABLE_FLASH 0x24 +#define SMIFLASH_GET_FLASH_INFO 0x25 + +#pragma pack(1) +typedef struct { + UINT64 BufAddr; + UINT32 BlockAddr; //0 starts at 0xfff0_0000 + UINT32 BlockSize; + UINT8 ErrorCode; +} FUNC_BLOCK; + +typedef struct { + UINT32 StartAddress; + UINT32 BlockSize; + UINT8 Type; +} BLOCK_DESC; + +typedef enum { + BOOT_BLOCK + ,MAIN_BLOCK + ,NV_BLOCK +#if SMI_FLASH_INTERFACE_VERSION > 10 + ,EC_BLOCK +#endif + ,NVB_BLOCK + ,OA3_FLASH_BLOCK_DESC_TYPE = 0x4A + ,NC_BLOCK = 0x80 //Types from NC_BLOCK to 0xFF are reserved for non critical blocks +} FLASH_BLOCK_TYPE; + +typedef struct { + UINT32 Length; + UINT8 Implemented; + UINT8 Version; + UINT16 TotalBlocks; +#if SMI_FLASH_INTERFACE_VERSION > 10 + UINT32 ECVersionOffset; + UINT32 ECVersionMask; +#endif + BLOCK_DESC Blocks[NUMBER_OF_BLOCKS]; +} INFO_BLOCK; +#pragma pack() + +typedef struct _EFI_SMI_FLASH_PROTOCOL EFI_SMI_FLASH_PROTOCOL; + +typedef EFI_STATUS (*GET_FLASH_INFO) ( + IN OUT INFO_BLOCK *InfoBlock +); + +typedef EFI_STATUS (*ENABLE_FLASH) ( + IN OUT FUNC_BLOCK *FuncBlock +); + +typedef EFI_STATUS (*DISABLE_FLASH) ( + IN OUT FUNC_BLOCK *FuncBlock +); + +typedef EFI_STATUS (*READ_FLASH) ( + IN OUT FUNC_BLOCK *FuncBlock +); + +typedef EFI_STATUS (*WRITE_FLASH) ( + IN OUT FUNC_BLOCK *FuncBlock +); + +typedef EFI_STATUS (*ERASE_FLASH) ( + IN OUT FUNC_BLOCK *FuncBlock +); + +struct _EFI_SMI_FLASH_PROTOCOL { + GET_FLASH_INFO GetFlashInfo; + ENABLE_FLASH EnableFlashWrite; + DISABLE_FLASH DisableFlashWrite; + READ_FLASH ReadFlash; + WRITE_FLASH WriteFlash; + ERASE_FLASH EraseFlash; + UINT32 FlashCapacity; +}; + + +#endif + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2009, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** |