From 113fab9781a75fea449e4fc248492d37c3d2b01a Mon Sep 17 00:00:00 2001 From: vit9696 Date: Sat, 25 Jan 2020 11:15:52 +0300 Subject: [PATCH] Protocol: Move Heci, FirmwareVolume, and LegacyRegion protocols --- Include/IndustryStandard/HeciClientMsg.h | 127 --------- Include/IndustryStandard/HeciMsg.h | 277 ------------------ Include/Protocol/FirmwareVolume.h | 346 ----------------------- Include/Protocol/Heci.h | 96 ------- Include/Protocol/Heci2.h | 100 ------- Include/Protocol/LegacyRegion.h | 125 -------- OcSupportPkg.dec | 12 - 7 files changed, 1083 deletions(-) delete mode 100644 Include/IndustryStandard/HeciClientMsg.h delete mode 100644 Include/IndustryStandard/HeciMsg.h delete mode 100644 Include/Protocol/FirmwareVolume.h delete mode 100644 Include/Protocol/Heci.h delete mode 100644 Include/Protocol/Heci2.h delete mode 100644 Include/Protocol/LegacyRegion.h diff --git a/Include/IndustryStandard/HeciClientMsg.h b/Include/IndustryStandard/HeciClientMsg.h deleted file mode 100644 index 85f497d7..00000000 --- a/Include/IndustryStandard/HeciClientMsg.h +++ /dev/null @@ -1,127 +0,0 @@ -/** @file - This header provides message definitions for select ME client communucation. - This header is based on various sources: - - - Platform Embedded Security Technology Revealed - https://link.springer.com/content/pdf/10.1007%2F978-1-4302-6572-6.pdf - - EPID SDK - https://github.com/Intel-EPID-SDK/epid-sdk - - Android source code for x86 - https://github.com/shreekantsingh/uefi/tree/master/drivers/misc/mei - - Copyright (c) 2019, vit9696. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause -**/ - -#ifndef HECI_CLIENT_MSG_H -#define HECI_CLIENT_MSG_H - -#include - -// -// Select known clients -// - -#pragma pack(1) - -// -// Generic EPID SDK structures. -// - -#define EPID_STATUS_PROVISIONED 0x00 -#define EPID_STATUS_CAN_PROVISION 0x02 -#define EPID_STATUS_FAIL_PROVISION 0x03 - -#define EPID_CERTIFICATE_SIZE 876U -#define EPID_GROUP_PUBLIC_KEY_SIZE 392U - -typedef struct { - UINT8 Data[EPID_CERTIFICATE_SIZE]; -} EPID_CERTIFICATE; - -typedef struct { - UINT16 Version; ///< EpidVersion - UINT16 FileType; ///< EpidFileType - UINT32 GroupId; ///< Epid11GroupId - UINT8 Data[EPID_GROUP_PUBLIC_KEY_SIZE - sizeof (UINT16) * 2 - sizeof (UINT32)]; -} EPID_GROUP_PUBLIC_KEY; - -STATIC_ASSERT (sizeof (EPID_GROUP_PUBLIC_KEY) == EPID_GROUP_PUBLIC_KEY_SIZE, "Invalid GPK size"); - -// -// FBF6FCF1-96CF-4E2E-A6A6-1BAB8CBE36B1 -// -#define ME_PAVP_PROTOCOL_GUID \ - { 0xFBF6FCF1, 0x96CF, 0x4E2E, { 0xA6, 0xA6, 0x1B, 0xAB, 0x8C, 0xBE, 0x36, 0xB1 } } - -extern EFI_GUID gMePavpProtocolGuid; - -#define ME_PAVP_PROTOCOL_VERSION 0x10005U - -#define ME_PAVP_PROVISION_REQUEST_COMMAND 0x00000000 -#define ME_PAVP_PROVISION_PERFORM_COMMAND 0x00000001 -#define ME_PAVP_INITIALIZE_DMA_COMMAND 0x000A0002 -#define ME_PAVP_DEINITIALIZE_DMA_COMMAND 0x000A000B - -// -// Common header for all commands -// - -typedef struct { - UINT32 Version; - UINT32 Command; - UINT32 Status; - UINT32 PayloadSize; -} ME_PAVP_COMMAND_HEADER; - -// -// ME_PAVP_PROVISION_REQUEST_COMMAND -// - -typedef struct { - ME_PAVP_COMMAND_HEADER Header; -} ME_PAVP_PROVISION_REQUEST_REQUEST; - -typedef struct { - ME_PAVP_COMMAND_HEADER Header; - UINT32 Status; - UINT32 GroupId; -} ME_PAVP_PROVISION_REQUEST_RESPONSE; - -typedef union { - ME_PAVP_PROVISION_REQUEST_REQUEST Request; - ME_PAVP_PROVISION_REQUEST_RESPONSE Response; -} ME_PAVP_PROVISION_REQUEST_BUFFER; - -// -// ME_PAVP_PROVISION_PERFORM_COMMAND -// - -typedef struct { - ME_PAVP_COMMAND_HEADER Header; - UINT8 Certificate[EPID_CERTIFICATE_SIZE]; - UINT8 PublicKey[EPID_GROUP_PUBLIC_KEY_SIZE]; -} ME_PAVP_PROVISION_PERFORM_REQUEST; - -typedef struct { - ME_PAVP_COMMAND_HEADER Header; -} ME_PAVP_PROVISION_PERFORM_RESPONSE; - -typedef union { - ME_PAVP_PROVISION_PERFORM_REQUEST Request; - ME_PAVP_PROVISION_PERFORM_RESPONSE Response; -} ME_PAVP_PROVISION_PERFORM_BUFFER; - -#define ME_PAVP_PROVISION_PERFORM_PAYLOAD_SIZE (EPID_CERTIFICATE_SIZE + EPID_GROUP_PUBLIC_KEY_SIZE) - -// -// 3893448C-EAB6-4F4C-B23C-57C2C4658DFC -// -#define ME_FPF_PROTOCOL_GUID \ - { 0x3893448C, 0xEAB6, 0x4F4C, { 0xB2, 0x3C, 0x57, 0xC2, 0xC4, 0x65, 0x8D, 0xFC } } - -extern EFI_GUID gMeFpfProtocolGuid; - -#pragma pack() - -#endif // HECI_MSG_H diff --git a/Include/IndustryStandard/HeciMsg.h b/Include/IndustryStandard/HeciMsg.h deleted file mode 100644 index f0523212..00000000 --- a/Include/IndustryStandard/HeciMsg.h +++ /dev/null @@ -1,277 +0,0 @@ -/** @file - This header provides message definitions for HECI communucation. - This header is based on DCMI-HI: DCMI Host Interface Specification: - https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/dcmi-hi-1-0-spec.pdf - - Copyright (c) 2019, vit9696. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause -**/ - -#ifndef HECI_MSG_H -#define HECI_MSG_H - -// -// All HECI bus messages are implemented using the HECI message format described in -// section 6.1; The HostAddress and MEAddress fields in the HECI_MESSAGE_HEADER -// will be 0x0 and 0x0, respectively. -// -#define HBM_HOST_ADDRESS 0x00 -#define HBM_ME_ADDRESS 0x00 -#define HBM_CLIENT_ADDRESS 0x01 - -// -// See: Table 9-2 - HECI Bus Message Command Summary, HECI Version 0x0001 -// Page 76 -// -#define HOST_VERSION_REQUEST 0x01 -#define HOST_STOP_REQUEST 0x02 -#define ME_STOP_REQUEST 0x03 -#define HOST_ENUMERATION_REQUEST 0x04 -#define HOST_CLIENT_PROPERTIES_REQUEST 0x05 -#define CLIENT_CONNECT_REQUEST 0x06 -#define CLIENT_DISCONNECT_REQUEST 0x07 -#define FLOW_CONTROL 0x08 -#define CLIENT_CONNECTION_RESET_REQUEST 0x09 - -#pragma pack(1) - -// -// See: 7.2 General Format of HECI Bus Messages -// Page 44 -// - -typedef union { - UINT8 Data; - struct { - UINT8 Command : 7; - UINT8 IsResponse : 1; - } Fields; -} HBM_COMMAND; - -typedef struct { - HBM_COMMAND Command; - UINT8 CommandSpecificData[]; -} HECI_BUS_MESSAGE; - -// -// HOST_VERSION_REQUEST -// See: 7.6 Host Version Request -// Page 45 -// - -typedef struct { - UINT8 MinorVersion; - UINT8 MajorVersion; -} HBM_VERSION; - -typedef struct { - HBM_COMMAND Command; - UINT8 Reserved; - HBM_VERSION HostVersion; -} HBM_HOST_VERSION_REQUEST; - -typedef struct { - HBM_COMMAND Command; - UINT8 HostVersionSupported; - HBM_VERSION MeMaxVersion; -} HBM_HOST_VERSION_RESPONSE; - -typedef union { - HBM_HOST_VERSION_REQUEST Request; - HBM_HOST_VERSION_RESPONSE Response; -} HBM_HOST_VERSION_BUFFER; - -// -// HOST_STOP_REQUEST -// See: 7.8 Host Stop Request -// Page 48 -// - -typedef struct { - HBM_COMMAND Command; - UINT8 Reason; - UINT8 Reserved[2]; -} HBM_HOST_STOP_REQUEST; - -typedef struct { - HBM_COMMAND Command; - UINT8 Reserved[3]; -} HBM_HOST_STOP_RESPONSE; - -typedef union { - HBM_HOST_STOP_REQUEST Request; - HBM_HOST_STOP_RESPONSE Response; -} HBM_HOST_STOP_BUFFER; - -// -// ME_STOP_REQUEST -// See: 7.10 ME Stop Request -// Page 49 -// - -typedef struct { - HBM_COMMAND Command; - UINT8 Reason; - UINT8 Reserved[2]; -} HBM_ME_STOP_REQUEST; - -// -// HOST_ENUMERATION_REQUEST -// See: 7.11 Host Enumeration Request -// Page 49 -// - -typedef struct { - HBM_COMMAND Command; - UINT8 Reserved[3]; -} HBM_HOST_ENUMERATION_REQUEST; - -typedef struct { - HBM_COMMAND Command; - UINT8 Reserved[3]; - UINT8 ValidAddresses[32]; -} HBM_HOST_ENUMERATION_RESPONSE; - -#define HBM_ME_CLIENT_MAX 256 - -typedef union { - HBM_HOST_ENUMERATION_REQUEST Request; - HBM_HOST_ENUMERATION_RESPONSE Response; -} HBM_HOST_ENUMERATION_BUFFER; - -// -// HOST_CLIENT_PROPERTIES_REQUEST -// See: 7.13 Host Client Properties Request -// Page 52 -// - -typedef struct { - HBM_COMMAND Command; - UINT8 Address; - UINT8 Reserved[2]; -} HBM_HOST_CLIENT_PROPERTIES_REQUEST; - -typedef struct { - EFI_GUID ProtocolName; - UINT8 ProtocolVersion; - UINT8 MaxNumberOfConnections; - UINT8 FixedAddress; - UINT8 SingleReceiveBuffer; - UINT32 MaxMessageLength; -} HECI_CLIENT_PROPERTIES; - -typedef struct { - HBM_COMMAND Command; - UINT8 Address; - UINT8 Status; - UINT8 Reserved; - HECI_CLIENT_PROPERTIES ClientProperties; -} HBM_HOST_CLIENT_PROPERTIES_RESPONSE; - -typedef union { - HBM_HOST_CLIENT_PROPERTIES_REQUEST Request; - HBM_HOST_CLIENT_PROPERTIES_RESPONSE Response; -} HBM_HOST_CLIENT_PROPERTIES_BUFFER; - -// -// CLIENT_CONNECT_REQUEST -// See: 7.15 Client Connect Request -// Page 54 -// - -typedef struct { - HBM_COMMAND Command; - UINT8 MeAddress; - UINT8 HostAddress; - UINT8 Reserved; -} HBM_CLIENT_CONNECT_REQUEST; - -typedef struct { - HBM_COMMAND Command; - UINT8 MeAddress; - UINT8 HostAddress; - UINT8 Status; -} HBM_CLIENT_CONNECT_RESPONSE; - -typedef union { - HBM_CLIENT_CONNECT_REQUEST Request; - HBM_CLIENT_CONNECT_RESPONSE Response; -} HBM_CLIENT_CONNECT_BUFFER; - -#define HBM_CLIENT_CONNECT_SUCCESS 0x00 -#define HBM_CLIENT_CONNECT_NOT_FOUND 0x01 -#define HBM_CLIENT_CONNECT_ALREADY_CONNECTED 0x02 -#define HBM_CLIENT_CONNECT_OUT_OF_RESOURCES 0x03 -#define HBM_CLIENT_CONNECT_INVALID_PARAMETER 0x04 - -// -// CLIENT_DISCONNECT_REQUEST -// See: 7.17 Client Disconnect Request -// Page 56 -// - -typedef struct { - HBM_COMMAND Command; - UINT8 MeAddress; - UINT8 HostAddress; - UINT8 Reserved; -} HBM_CLIENT_DISCONNECT_REQUEST; - -typedef struct { - HBM_COMMAND Command; - UINT8 MeAddress; - UINT8 HostAddress; - UINT8 Status; - // - // This field is added only for HECI 2. - // It is not clear whether it is valid to pass it to HECI 1. - // - UINT32 Reserved; -} HBM_CLIENT_DISCONNECT_RESPONSE; - -typedef union { - HBM_CLIENT_DISCONNECT_REQUEST Request; - HBM_CLIENT_DISCONNECT_RESPONSE Response; -} HBM_CLIENT_DISCONNECT_BUFFER; - -// -// FLOW_CONTROL -// See: 7.19 Flow Control -// Page 57 -// - -typedef struct { - HBM_COMMAND Command; - UINT8 MeAddress; - UINT8 HostAddress; - UINT8 Reserved[5]; -} HBM_FLOW_CONTROL; - -// -// HBM_CLIENT_CONNECTION_RESET_REQUEST -// See: 7.20 Client Connection Reset Request -// Page 58 -// - -typedef struct { - HBM_COMMAND Command; - UINT8 MEAddress; - UINT8 HostAddress; - UINT8 Reserved; -} HBM_CLIENT_CONNECTION_RESET_REQUEST; - -typedef struct { - HBM_COMMAND Command; - UINT8 MEAddress; - UINT8 HostAddress; - UINT8 Status; -} HBM_CLIENT_CONNECTION_RESET_RESPONSE; - -typedef union { - HBM_CLIENT_CONNECTION_RESET_REQUEST Request; - HBM_CLIENT_CONNECTION_RESET_RESPONSE Response; -} HBM_CLIENT_CONNECTION_RESET_BUFFER; - -#pragma pack() - -#endif // HECI_MSG_H diff --git a/Include/Protocol/FirmwareVolume.h b/Include/Protocol/FirmwareVolume.h deleted file mode 100644 index 48d53953..00000000 --- a/Include/Protocol/FirmwareVolume.h +++ /dev/null @@ -1,346 +0,0 @@ -/** @file - This file declares the Firmware Volume Protocol. - - The Firmware Volume Protocol provides file-level access to the firmware volume. - Each firmware volume driver must produce an instance of the Firmware Volume - Protocol if the firmware volume is to be visible to the system. The Firmware - Volume Protocol also provides mechanisms for determining and modifying some - attributes of the firmware volume. - -Copyright (c) 2007 - 2018, 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 that 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 protocol is defined in Firmware Volume specification. - Version 0.9. - -**/ - -#ifndef _FIRMWARE_VOLUME_H_ -#define _FIRMWARE_VOLUME_H_ - - -// -// Firmware Volume Protocol GUID definition -// -#define EFI_FIRMWARE_VOLUME_PROTOCOL_GUID \ - { \ - 0x389F751F, 0x1838, 0x4388, {0x83, 0x90, 0xCD, 0x81, 0x54, 0xBD, 0x27, 0xF8 } \ - } - -#define FV_DEVICE_SIGNATURE SIGNATURE_32 ('_', 'F', 'V', '_') - -typedef struct _EFI_FIRMWARE_VOLUME_PROTOCOL EFI_FIRMWARE_VOLUME_PROTOCOL; - -// -// FRAMEWORK_EFI_FV_ATTRIBUTES bit definitions -// -typedef UINT64 FRAMEWORK_EFI_FV_ATTRIBUTES; - -// -// ************************************************************ -// FRAMEWORK_EFI_FV_ATTRIBUTES bit definitions -// ************************************************************ -// -#define EFI_FV_READ_DISABLE_CAP 0x0000000000000001ULL -#define EFI_FV_READ_ENABLE_CAP 0x0000000000000002ULL -#define EFI_FV_READ_STATUS 0x0000000000000004ULL - -#define EFI_FV_WRITE_DISABLE_CAP 0x0000000000000008ULL -#define EFI_FV_WRITE_ENABLE_CAP 0x0000000000000010ULL -#define EFI_FV_WRITE_STATUS 0x0000000000000020ULL - -#define EFI_FV_LOCK_CAP 0x0000000000000040ULL -#define EFI_FV_LOCK_STATUS 0x0000000000000080ULL -#define EFI_FV_WRITE_POLICY_RELIABLE 0x0000000000000100ULL - -#define EFI_FV_ALIGNMENT_CAP 0x0000000000008000ULL -#define EFI_FV_ALIGNMENT_2 0x0000000000010000ULL -#define EFI_FV_ALIGNMENT_4 0x0000000000020000ULL -#define EFI_FV_ALIGNMENT_8 0x0000000000040000ULL -#define EFI_FV_ALIGNMENT_16 0x0000000000080000ULL -#define EFI_FV_ALIGNMENT_32 0x0000000000100000ULL -#define EFI_FV_ALIGNMENT_64 0x0000000000200000ULL -#define EFI_FV_ALIGNMENT_128 0x0000000000400000ULL -#define EFI_FV_ALIGNMENT_256 0x0000000000800000ULL -#define EFI_FV_ALIGNMENT_512 0x0000000001000000ULL -#define EFI_FV_ALIGNMENT_1K 0x0000000002000000ULL -#define EFI_FV_ALIGNMENT_2K 0x0000000004000000ULL -#define EFI_FV_ALIGNMENT_4K 0x0000000008000000ULL -#define EFI_FV_ALIGNMENT_8K 0x0000000010000000ULL -#define EFI_FV_ALIGNMENT_16K 0x0000000020000000ULL -#define EFI_FV_ALIGNMENT_32K 0x0000000040000000ULL -#define EFI_FV_ALIGNMENT_64K 0x0000000080000000ULL - -// -// Protocol API definitions -// - -/** - Retrieves attributes, insures positive polarity of attribute bits, and returns - resulting attributes in an output parameter. - - @param This Indicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance. - @param Attributes Output buffer containing attributes. - - @retval EFI_SUCCESS The firmware volume attributes were returned. -**/ -typedef -EFI_STATUS -(EFIAPI *FRAMEWORK_EFI_FV_GET_ATTRIBUTES)( - IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, - OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes - ); - -/** - Sets volume attributes - - @param This Indicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance. - @param Attributes On input, Attributes is a pointer to an - EFI_FV_ATTRIBUTES containing the desired firmware - volume settings. On successful return, it contains - the new settings of the firmware volume. On - unsuccessful return, Attributes is not modified - and the firmware volume settings are not changed. - - @retval EFI_INVALID_PARAMETER A bit in Attributes was invalid. - @retval EFI_SUCCESS The requested firmware volume attributes were set - and the resulting EFI_FV_ATTRIBUTES is returned in - Attributes. - @retval EFI_ACCESS_DENIED The Device is locked and does not permit modification. - -**/ -typedef -EFI_STATUS -(EFIAPI *FRAMEWORK_EFI_FV_SET_ATTRIBUTES)( - IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, - IN OUT FRAMEWORK_EFI_FV_ATTRIBUTES *Attributes - ); - -/** - Read the requested file (NameGuid) or file information from the firmware volume - and returns data in Buffer. - - @param This The EFI_FIRMWARE_VOLUME_PROTOCOL instance. - @param NameGuid The pointer to EFI_GUID, which is the filename of - the file to read. - @param Buffer The pointer to pointer to buffer in which contents of file are returned. -
- If Buffer is NULL, only type, attributes, and size - are returned as there is no output buffer. -
- If Buffer != NULL and *Buffer == NULL, the output - buffer is allocated from BS pool by ReadFile. -
- If Buffer != NULL and *Buffer != NULL, the output - buffer has been allocated by the caller and is being - passed in. - @param BufferSize On input: The buffer size. On output: The size - required to complete the read. - @param FoundType The pointer to the type of the file whose data - is returned. - @param FileAttributes The pointer to attributes of the file whose data - is returned. - @param AuthenticationStatus The pointer to the authentication status of the data. - - @retval EFI_SUCCESS The call completed successfully. - @retval EFI_WARN_BUFFER_TOO_SMALL The buffer is too small to contain the requested output. - The buffer filled, and the output is truncated. - @retval EFI_NOT_FOUND NameGuid was not found in the firmware volume. - @retval EFI_DEVICE_ERROR A hardware error occurred when attempting to - access the firmware volume. - @retval EFI_ACCESS_DENIED The firmware volume is configured to disallow reads. - @retval EFI_OUT_OF_RESOURCES An allocation failure occurred. - -**/ -typedef -EFI_STATUS -(EFIAPI *FRAMEWORK_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 - ); - -/** - Read the requested section from the specified file and returns data in Buffer. - - @param This Indicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance. - @param NameGuid Filename identifying the file from which to read. - @param SectionType The section type to retrieve. - @param SectionInstance The instance of SectionType to retrieve. - @param Buffer Pointer to pointer to buffer in which contents of - a file are returned. -
- If Buffer is NULL, only type, attributes, and size - are returned as there is no output buffer. -
- If Buffer != NULL and *Buffer == NULL, the output - buffer is allocated from BS pool by ReadFile. -
- If Buffer != NULL and *Buffer != NULL, the output - buffer has been allocated by the caller and is being - passed in. - @param BufferSize The pointer to the buffer size passed in, and on - output the size required to complete the read. - @param AuthenticationStatus The pointer to the authentication status of the data. - - @retval EFI_SUCCESS The call completed successfully. - @retval EFI_WARN_BUFFER_TOO_SMALL The buffer is too small to contain the requested output. - The buffer is filled and the output is truncated. - @retval EFI_OUT_OF_RESOURCES An allocation failure occurred. - @retval EFI_NOT_FOUND The name was not found in the firmware volume. - @retval EFI_DEVICE_ERROR A hardware error occurred when attempting to - access the firmware volume. - @retval EFI_ACCESS_DENIED The firmware volume is configured to disallow reads. - -**/ -typedef -EFI_STATUS -(EFIAPI *FRAMEWORK_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 - ); - -typedef UINT32 FRAMEWORK_EFI_FV_WRITE_POLICY; - -#define FRAMEWORK_EFI_FV_UNRELIABLE_WRITE 0x00000000 -#define FRAMEWORK_EFI_FV_RELIABLE_WRITE 0x00000001 - -typedef struct { - EFI_GUID *NameGuid; - EFI_FV_FILETYPE Type; - EFI_FV_FILE_ATTRIBUTES FileAttributes; - VOID *Buffer; - UINT32 BufferSize; -} FRAMEWORK_EFI_FV_WRITE_FILE_DATA; - -/** - Write the supplied file (NameGuid) to the FV. - - @param This Indicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance. - @param NumberOfFiles Indicates the number of file records pointed to - by FileData. - @param WritePolicy Indicates the level of reliability of the write - with respect to things like power failure events. - @param FileData A pointer to an array of EFI_FV_WRITE_FILE_DATA - structures. Each element in the array indicates - a file to write, and there are NumberOfFiles - elements in the input array. - - @retval EFI_SUCCESS The write completed successfully. - @retval EFI_OUT_OF_RESOURCES The firmware volume does not have enough free - space to store file(s). - @retval EFI_DEVICE_ERROR A hardware error occurred when attempting to - access the firmware volume. - @retval EFI_WRITE_PROTECTED The firmware volume is configured to disallow writes. - @retval EFI_NOT_FOUND A delete was requested, but the requested file was - not found in the firmware volume. - @retval EFI_INVALID_PARAMETER A delete was requested with a multiple file write. - An unsupported WritePolicy was requested. - An unknown file type was specified. - A file system specific error has occurred. -**/ -typedef -EFI_STATUS -(EFIAPI *FRAMEWORK_EFI_FV_WRITE_FILE)( - IN EFI_FIRMWARE_VOLUME_PROTOCOL *This, - IN UINT32 NumberOfFiles, - IN FRAMEWORK_EFI_FV_WRITE_POLICY WritePolicy, - IN FRAMEWORK_EFI_FV_WRITE_FILE_DATA *FileData - ); - -/** - Given the input key, search for the next matching file in the volume. - - @param This Indicates the EFI_FIRMWARE_VOLUME_PROTOCOL instance. - @param Key Pointer to a caller allocated buffer that contains - an implementation-specific key that is used to track - where to begin searching on successive calls. - @param FileType The pointer to the file type to filter for. - @param NameGuid The pointer to Guid filename of the file found. - @param Attributes The pointer to Attributes of the file found. - @param Size The pointer to Size in bytes of the file found. - - @retval EFI_SUCCESS The output parameters are filled with data obtained from - the first matching file that was found. - @retval EFI_NOT_FOUND No files of type FileType were found. - @retval EFI_DEVICE_ERROR A hardware error occurred when attempting to access - the firmware volume. - @retval EFI_ACCESS_DENIED The firmware volume is configured to disallow reads. - -**/ -typedef -EFI_STATUS -(EFIAPI *FRAMEWORK_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 - ); - -// -// Protocol interface structure -// -struct _EFI_FIRMWARE_VOLUME_PROTOCOL { - /// - /// Retrieves volume capabilities and current settings. - /// - FRAMEWORK_EFI_FV_GET_ATTRIBUTES GetVolumeAttributes; - - /// - /// Modifies the current settings of the firmware volume. - /// - FRAMEWORK_EFI_FV_SET_ATTRIBUTES SetVolumeAttributes; - - /// - /// Reads an entire file from the firmware volume. - /// - FRAMEWORK_EFI_FV_READ_FILE ReadFile; - - /// - /// Reads a single section from a file into a buffer. - /// - FRAMEWORK_EFI_FV_READ_SECTION ReadSection; - - /// - /// Writes an entire file into the firmware volume. - /// - FRAMEWORK_EFI_FV_WRITE_FILE WriteFile; - - /// - /// Provides service to allow searching the firmware volume. - /// - FRAMEWORK_EFI_FV_GET_NEXT_FILE GetNextFile; - - /// - /// Data field that indicates the size in bytes of the Key input buffer for - /// the GetNextFile() API. - /// - UINT32 KeySize; - - /// - /// Handle of the parent firmware volume. - /// - EFI_HANDLE ParentHandle; -}; - -extern EFI_GUID gEfiFirmwareVolumeProtocolGuid; - -#endif diff --git a/Include/Protocol/Heci.h b/Include/Protocol/Heci.h deleted file mode 100644 index 41cd79d0..00000000 --- a/Include/Protocol/Heci.h +++ /dev/null @@ -1,96 +0,0 @@ -/** @file - This protocol provides services for HECI communucation. - See more details in https://github.com/intel/efiwrapper. - - Copyright (c) 2019, vit9696. All rights reserved.
- Portions copyright 1999 - 2017 Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause -**/ - -#ifndef EFI_HECI_H -#define EFI_HECI_H - -#define EFI_HECI_PROTOCOL_GUID \ - { 0xCFB33810, 0x6E87, 0x4284, { 0xB2, 0x03, 0xA6, 0x6A, 0xbE, 0x07, 0xF6, 0xE8 } } - -#define NON_BLOCKING 0 -#define BLOCKING 1 - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI_SENDWACK) ( - IN OUT UINT32 *Message, - IN OUT UINT32 Length, - IN OUT UINT32 *RecLength, - IN UINT8 HostAddress, - IN UINT8 MEAddress - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI_READ_MESSAGE) ( - IN UINT32 Blocking, - IN UINT32 *MessageBody, - IN OUT UINT32 *Length - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI_SEND_MESSAGE) ( - IN UINT32 *Message, - IN UINT32 Length, - IN UINT8 HostAddress, - IN UINT8 MEAddress - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI_RESET) ( - VOID - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI_INIT) ( - VOID - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI_REINIT) ( - VOID - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI_RESET_WAIT) ( - IN UINT32 Delay - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI_GET_ME_STATUS) ( - OUT UINT32 *Status - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI_GET_ME_MODE) ( - OUT UINT32 *Mode - ); - -typedef struct EFI_HECI_PROTOCOL_ { - EFI_HECI_SENDWACK SendwACK; - EFI_HECI_READ_MESSAGE ReadMsg; - EFI_HECI_SEND_MESSAGE SendMsg; - EFI_HECI_RESET ResetHeci; - EFI_HECI_INIT InitHeci; - EFI_HECI_RESET_WAIT MeResetWait; - EFI_HECI_REINIT ReInitHeci; - EFI_HECI_GET_ME_STATUS GetMeStatus; - EFI_HECI_GET_ME_MODE GetMeMode; -} EFI_HECI_PROTOCOL; - -extern EFI_GUID gEfiHeciProtocolGuid; - -#endif // EFI_HECI_H diff --git a/Include/Protocol/Heci2.h b/Include/Protocol/Heci2.h deleted file mode 100644 index a3d477b8..00000000 --- a/Include/Protocol/Heci2.h +++ /dev/null @@ -1,100 +0,0 @@ -/** @file - This protocol provides services for HECI communucation. - See more details in https://github.com/intel/efiwrapper. - - Copyright (c) 2019, vit9696. All rights reserved.
- Portions copyright 1999 - 2017 Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause -**/ - -#ifndef EFI_HECI2_H -#define EFI_HECI2_H - -#define EFI_HECI2_PROTOCOL_GUID \ - { 0x3C7BC880, 0x41F8, 0x4869, { 0xAE, 0xFC, 0x87, 0x0A, 0x3E, 0xD2, 0x82, 0x99 } } - -typedef UINT32 HECI2_DEVICE; -#define HECI_DEFAULT_DEVICE (0) - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI2_SENDWACK) ( - IN HECI2_DEVICE HeciDev, - IN OUT UINT32 *Message, - IN OUT UINT32 Length, - IN OUT UINT32 *RecLength, - IN UINT8 HostAddress, - IN UINT8 MEAddress - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI2_READ_MESSAGE) ( - IN HECI2_DEVICE HeciDev, - IN UINT32 Blocking, - IN UINT32 *MessageBody, - IN OUT UINT32 *Length - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI2_SEND_MESSAGE) ( - IN HECI2_DEVICE HeciDev, - IN UINT32 *Message, - IN UINT32 Length, - IN UINT8 HostAddress, - IN UINT8 MEAddress - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI2_RESET) ( - IN HECI2_DEVICE HeciDev - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI2_INIT) ( - IN HECI2_DEVICE HeciDev - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI2_REINIT) ( - IN HECI2_DEVICE HeciDev - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI2_RESET_WAIT) ( - IN HECI2_DEVICE HeciDev, - IN UINT32 Delay - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI2_GET_ME_STATUS) ( - OUT UINT32 *Status - ); - -typedef -EFI_STATUS -(EFIAPI *EFI_HECI2_GET_ME_MODE) ( - OUT UINT32 *Mode - ); - -typedef struct EFI_HECI2_PROTOCOL_ { - EFI_HECI2_SENDWACK SendwACK; - EFI_HECI2_READ_MESSAGE ReadMsg; - EFI_HECI2_SEND_MESSAGE SendMsg; - EFI_HECI2_RESET ResetHeci; - EFI_HECI2_INIT InitHeci; - EFI_HECI2_RESET_WAIT MeResetWait; - EFI_HECI2_REINIT ReInitHeci; - EFI_HECI2_GET_ME_STATUS GetMeStatus; - EFI_HECI2_GET_ME_MODE GetMeMode; -} EFI_HECI2_PROTOCOL; - -extern EFI_GUID gEfiHeci2ProtocolGuid; - -#endif // EFI_HECI2_H diff --git a/Include/Protocol/LegacyRegion.h b/Include/Protocol/LegacyRegion.h deleted file mode 100644 index 68d4cfd0..00000000 --- a/Include/Protocol/LegacyRegion.h +++ /dev/null @@ -1,125 +0,0 @@ -/** @file - This protocol manages the legacy memory regions between 0xc0000 - 0xfffff. - -Copyright (c) 2007 - 2018, 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 that 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 protocol is defined in Framework for EFI Compatibility Support Module spec - Version 0.97. - -**/ - -#ifndef _EFI_LEGACY_REGION_H_ -#define _EFI_LEGACY_REGION_H_ - - -#define EFI_LEGACY_REGION_PROTOCOL_GUID \ - { \ - 0xfc9013a, 0x568, 0x4ba9, {0x9b, 0x7e, 0xc9, 0xc3, 0x90, 0xa6, 0x60, 0x9b } \ - } - -typedef struct _EFI_LEGACY_REGION_PROTOCOL EFI_LEGACY_REGION_PROTOCOL; - -/** - Sets hardware to decode or not decode a region. - - @param This Indicates the EFI_LEGACY_REGION_PROTOCOL instance - @param Start The start of the region to decode. - @param Length The size in bytes of the region. - @param On The decode/nondecode flag. - - @retval EFI_SUCCESS The decode range successfully changed. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_LEGACY_REGION_DECODE)( - IN EFI_LEGACY_REGION_PROTOCOL *This, - IN UINT32 Start, - IN UINT32 Length, - IN BOOLEAN *On - ); - -/** - Sets a region to read only. - - @param This Indicates the EFI_LEGACY_REGION_PROTOCOL instance. - @param Start The start of region to lock. - @param Length The size in bytes of the region. - @param Granularity Lock attribute affects this granularity in bytes. - - @retval EFI_SUCCESS The region was made read only. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_LEGACY_REGION_LOCK)( - IN EFI_LEGACY_REGION_PROTOCOL *This, - IN UINT32 Start, - IN UINT32 Length, - OUT UINT32 *Granularity OPTIONAL - ); - -/** - Sets a region to read only and ensures that flash is locked from being - inadvertently modified. - - @param This Indicates the EFI_LEGACY_REGION_PROTOCOL instance - @param Start The start of region to lock. - @param Length The size in bytes of the region. - @param Granularity Lock attribute affects this granularity in bytes. - - @retval EFI_SUCCESS The region was made read only and flash is locked. - -**/ -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 - ); - -/** - Sets a region to read-write. - - @param This Indicates the EFI_LEGACY_REGION_PROTOCOL instance - @param Start The start of region to lock. - @param Length The size in bytes of the region. - @param Granularity Lock attribute affects this granularity in bytes. - - @retval EFI_SUCCESS The region was successfully made read-write. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_LEGACY_REGION_UNLOCK)( - IN EFI_LEGACY_REGION_PROTOCOL *This, - IN UINT32 Start, - IN UINT32 Length, - OUT UINT32 *Granularity OPTIONAL - ); - -/** - Abstracts the hardware control of the physical address region 0xC0000-C0xFFFFF - for the traditional BIOS. -**/ -struct _EFI_LEGACY_REGION_PROTOCOL { - EFI_LEGACY_REGION_DECODE Decode; ///< Specifies a region for the chipset to decode. - EFI_LEGACY_REGION_LOCK Lock; ///< Makes the specified OpROM region read only or locked. - EFI_LEGACY_REGION_BOOT_LOCK BootLock; ///< Sets a region to read only and ensures tat flash is locked from. - ///< inadvertent modification. - EFI_LEGACY_REGION_UNLOCK UnLock; ///< Makes the specified OpROM region read-write or unlocked. -}; - -extern EFI_GUID gEfiLegacyRegionProtocolGuid; - -#endif diff --git a/OcSupportPkg.dec b/OcSupportPkg.dec index 4b7a8a1d..f9771c65 100644 --- a/OcSupportPkg.dec +++ b/OcSupportPkg.dec @@ -54,24 +54,12 @@ ## Include/Protocol/OcFirmwareRuntime.h gOcFirmwareRuntimeProtocolGuid = { 0x570332E4, 0xFC50, 0x4B21, { 0xAB, 0xE8, 0xAE, 0x72, 0xF0, 0x5B, 0x4F, 0xF7 }} - ## Include/Protocol/LegacyRegion.h - gEfiLegacyRegionProtocolGuid = { 0x0fc9013a, 0x0568, 0x4ba9, { 0x9b, 0x7e, 0xc9, 0xc3, 0x90, 0xa6, 0x60, 0x9b }} - - ## Include/Protocol/FirmwareVolume.h - gEfiFirmwareVolumeProtocolGuid = { 0x389F751F, 0x1838, 0x4388, { 0x83, 0x90, 0xcd, 0x81, 0x54, 0xbd, 0x27, 0xf8 }} - ## Include/Protocol/AmiPointer.h gAmiEfiPointerProtocolGuid = { 0x15A10CE7, 0xEAB5, 0x43BF, { 0x90, 0x42, 0x74, 0x43, 0x2E, 0x69, 0x63, 0x77 }} ## Include/Protocol/AmiKeycode.h gAmiEfiKeycodeProtocolGuid = { 0x0ADFB62D, 0xFF74, 0x484C, { 0x89, 0x44, 0xF8, 0x5C, 0x4B, 0xEA, 0x87, 0xA8 }} - ## Include/Protocol/Heci.h - gEfiHeciProtocolGuid = { 0xCFB33810, 0x6E87, 0x4284, { 0xB2, 0x03, 0xA6, 0x6A, 0xBE, 0x07, 0xF6, 0xE8 }} - - ## Include/Protocol/Heci2.h - gEfiHeci2ProtocolGuid = { 0x3C7BC880, 0x41F8, 0x4869, { 0xAE, 0xFC, 0x87, 0x0A, 0x3E, 0xD2, 0x82, 0x99 }} - [PcdsFeatureFlag] ## Indicates if Apple Thunderbolt NHI protocol is called during device property export.

# TRUE - Apple Thunderbolt NHI protocol will be called.