From 4135253bde4f1bb0004844f3ab1112882c76072e Mon Sep 17 00:00:00 2001 From: xli24 Date: Mon, 20 Oct 2008 15:16:32 +0000 Subject: [PATCH] Update IndustryStandard according to code review comments. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6155 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/IndustryStandard/Sal.h | 508 +++++-- MdePkg/Include/IndustryStandard/Scsi.h | 94 +- MdePkg/Include/IndustryStandard/SdramSpd.h | 26 +- .../SerialPortConsoleRedirectionTable.h | 31 +- MdePkg/Include/IndustryStandard/SmBios.h | 152 ++- MdePkg/Include/IndustryStandard/SmBus.h | 13 +- MdePkg/Include/IndustryStandard/Tpm12.h | 1209 +++++++++-------- MdePkg/Include/IndustryStandard/Usb.h | 38 +- .../IndustryStandard/WatchdogActionTable.h | 13 +- .../IndustryStandard/WatchdogResourceTable.h | 65 +- 10 files changed, 1285 insertions(+), 864 deletions(-) diff --git a/MdePkg/Include/IndustryStandard/Sal.h b/MdePkg/Include/IndustryStandard/Sal.h index 77518321ad..18225ba7b8 100644 --- a/MdePkg/Include/IndustryStandard/Sal.h +++ b/MdePkg/Include/IndustryStandard/Sal.h @@ -1,7 +1,8 @@ /** @file - Main SAL API's defined in SAL 3.0 specification. + Main SAL API's defined in Intel Itanium Processor Family System Abstraction + Layer Specification Revision 3.2 (December 2003) - Copyright (c) 2006, Intel Corporation + Copyright (c) 2006 - 2008, 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 @@ -16,89 +17,170 @@ #define __SAL_API_H__ /// -/// FIT Types -/// Table 2-2 of Intel Itanium Processor Family System Abstraction Layer Specification December 2003 +/// SAL return status type /// -#define EFI_SAL_FIT_FIT_HEADER_TYPE 0x00 -#define EFI_SAL_FIT_PAL_B_TYPE 0x01 +typedef UINTN EFI_SAL_STATUS; /// -/// type from 0x02 to 0x0E is reserved. +/// Call completed without error. /// -#define EFI_SAL_FIT_PAL_A_TYPE 0x0F - +#define EFI_SAL_SUCCESS ((EFI_SAL_STATUS) 0) /// -/// OEM-defined type range is from 0x10 to 0x7E. Here we defined the PEI_CORE type as 0x10 +/// Call completed without error but some information was lost due to overflow. /// -#define EFI_SAL_FIT_PEI_CORE_TYPE 0x10 -#define EFI_SAL_FIT_UNUSED_TYPE 0x7F - +#define EFI_SAL_OVERFLOW ((EFI_SAL_STATUS) 1) /// -/// EFI_SAL_STATUS +/// Call completed without error; effect a warm boot of the system to complete the update. +/// +#define EFI_SAL_WARM_BOOT_NEEDED ((EFI_SAL_STATUS) 2) +/// +/// More information is available for retrieval. /// -typedef UINTN EFI_SAL_STATUS; - -#define EFI_SAL_SUCCESS ((EFI_SAL_STATUS) 0) #define EFI_SAL_MORE_RECORDS ((EFI_SAL_STATUS) 3) +/// +/// Not implemented. +/// #define EFI_SAL_NOT_IMPLEMENTED ((EFI_SAL_STATUS) - 1) +/// +/// Invalid Argument. +/// #define EFI_SAL_INVALID_ARGUMENT ((EFI_SAL_STATUS) - 2) +/// +/// Call completed without error. +/// #define EFI_SAL_ERROR ((EFI_SAL_STATUS) - 3) +/// +/// Virtual address not registered. +/// #define EFI_SAL_VIRTUAL_ADDRESS_ERROR ((EFI_SAL_STATUS) - 4) +/// +/// No information available. +/// #define EFI_SAL_NO_INFORMATION ((EFI_SAL_STATUS) - 5) +/// +/// Scratch buffer required. +/// #define EFI_SAL_NOT_ENOUGH_SCRATCH ((EFI_SAL_STATUS) - 9) -// -// Return values from SAL -// +/// +/// Return registers from SAL +/// typedef struct { - EFI_SAL_STATUS Status; // register r8 + /// + /// SAL return status value in r8 + /// + EFI_SAL_STATUS Status; + /// + /// SAL returned value in r9 + /// UINTN r9; + /// + /// SAL returned value in r10 + /// UINTN r10; + /// + /// SAL returned value in r11 + /// UINTN r11; } SAL_RETURN_REGS; -/// -/// Delivery Mode of IPF CPU. -/// -typedef enum { - EFI_DELIVERY_MODE_INT, - EFI_DELIVERY_MODE_MPreserved1, - EFI_DELIVERY_MODE_PMI, - EFI_DELIVERY_MODE_MPreserved2, - EFI_DELIVERY_MODE_NMI, - EFI_DELIVERY_MODE_INIT, - EFI_DELIVERY_MODE_MPreserved3, - EFI_DELIVERY_MODE_ExtINT -} EFI_DELIVERY_MODE; - -typedef SAL_RETURN_REGS (EFIAPI *SAL_PROC) - ( - IN UINT64 FunctionId, - IN UINT64 Arg2, - IN UINT64 Arg3, - IN UINT64 Arg4, - IN UINT64 Arg5, - IN UINT64 Arg6, - IN UINT64 Arg7, - IN UINT64 Arg8 +/** + Prototype of SAL procedures. + + @param Arg0 Functional identifier. + The upper 32 bits are ignored and only the lower 32 bits + are used. The following functional identifiers are defined: + 0x01XXXXXX – Architected SAL functional group. + 0x02XXXXXX to 0x03XXXXXX – OEM SAL functional group. Each OEM is + allowed to use the entire range in the 0x02XXXXXX to 0x03XXXXXX range. + 0x04XXXXXX to 0xFFFFFFFF – Reserved. + @param Arg1 The first parameter of the architected/OEM specific SAL functions. + @param Arg2 The second parameter of the architected/OEM specific SAL functions. + @param Arg3 The third parameter passed to the ESAL function based + @param Arg4 The fourth parameter passed to the ESAL function based + @param Arg5 The fifth parameter passed to the ESAL function based + @param Arg6 The sixth parameter passed to the ESAL function + @param Arg7 The seventh parameter passed to the ESAL function based + + @return r8 Return status: positive number indicates successful, + negative number indicates failure. + r9 Other return parameter in r9. + r10 Other return parameter in r10. + r11 Other return parameter in r11. + +**/ +typedef +SAL_RETURN_REGS +(EFIAPI *SAL_PROC) ( + IN UINT64 FunctionId, + IN UINT64 Arg2, + IN UINT64 Arg3, + IN UINT64 Arg4, + IN UINT64 Arg5, + IN UINT64 Arg6, + IN UINT64 Arg7, + IN UINT64 Arg8 ); // // SAL Procedure FunctionId definition // + +/// +/// Register software code locations with SAL. +/// #define EFI_SAL_SET_VECTORS 0x01000000 +/// +/// Return Machine State information obtained by SAL. +/// #define EFI_SAL_GET_STATE_INFO 0x01000001 +/// +/// Obtain size of Machine State information. +/// #define EFI_SAL_GET_STATE_INFO_SIZE 0x01000002 +/// +/// Clear Machine State information. +/// #define EFI_SAL_CLEAR_STATE_INFO 0x01000003 +/// +/// Cause the processor to go into a spin loop within SAL. +/// #define EFI_SAL_MC_RENDEZ 0x01000004 +/// +/// Register the machine check interface layer with SAL. +/// #define EFI_SAL_MC_SET_PARAMS 0x01000005 +/// +/// Register the physical addresses of locations needed by SAL. +/// #define EFI_SAL_REGISTER_PHYSICAL_ADDR 0x01000006 +/// +/// Flush the instruction or data caches. +/// #define EFI_SAL_CACHE_FLUSH 0x01000008 +/// +/// Initialize the instruction and data caches. +/// #define EFI_SAL_CACHE_INIT 0x01000009 +/// +/// Read from the PCI configuration space. +/// #define EFI_SAL_PCI_CONFIG_READ 0x01000010 +/// +/// Write to the PCI configuration space. +/// #define EFI_SAL_PCI_CONFIG_WRITE 0x01000011 +/// +/// Return the base frequency of the platform. +/// #define EFI_SAL_FREQ_BASE 0x01000012 +/// +/// Returns information on the physical processor mapping within the platform. +/// #define EFI_SAL_PHYSICAL_ID_INFO 0x01000013 +/// +/// Update the contents of firmware blocks. +/// #define EFI_SAL_UPDATE_PAL 0x01000020 #define EFI_SAL_FUNCTION_ID_MASK 0x0000ffff @@ -109,12 +191,18 @@ typedef SAL_RETURN_REGS (EFIAPI *SAL_PROC) // Not much point in using typedefs or enums because all params // are UINT64 and the entry point is common // -// EFI_SAL_SET_VECTORS + +// +// Parameter of EFI_SAL_SET_VECTORS +// +// Vector type // #define EFI_SAL_SET_MCA_VECTOR 0x0 #define EFI_SAL_SET_INIT_VECTOR 0x1 #define EFI_SAL_SET_BOOT_RENDEZ_VECTOR 0x2 - +/// +/// Format of length_cs_n argument. +/// typedef struct { UINT64 Length : 32; UINT64 ChecksumValid : 1; @@ -124,8 +212,9 @@ typedef struct { } SAL_SET_VECTORS_CS_N; // -// EFI_SAL_GET_STATE_INFO, EFI_SAL_GET_STATE_INFO_SIZE, -// EFI_SAL_CLEAR_STATE_INFO +// Parameter of EFI_SAL_GET_STATE_INFO, EFI_SAL_GET_STATE_INFO_SIZE, and EFI_SAL_CLEAR_STATE_INFO +// +// Type of information // #define EFI_SAL_MCA_STATE_INFO 0x0 #define EFI_SAL_INIT_STATE_INFO 0x1 @@ -133,22 +222,31 @@ typedef struct { #define EFI_SAL_CP_STATE_INFO 0x3 // -// EFI_SAL_MC_SET_PARAMS +// Parameter of EFI_SAL_MC_SET_PARAMS +// +// Unsigned 64-bit integer value for the parameter type of the machine check interface // #define EFI_SAL_MC_SET_RENDEZ_PARAM 0x1 #define EFI_SAL_MC_SET_WAKEUP_PARAM 0x2 #define EFI_SAL_MC_SET_CPE_PARAM 0x3 - +// +// Unsigned 64-bit integer value indicating whether interrupt vector or +// memory address is specified +// #define EFI_SAL_MC_SET_INTR_PARAM 0x1 #define EFI_SAL_MC_SET_MEM_PARAM 0x2 // -// EFI_SAL_REGISTER_PAL_PHYSICAL_ADDR +// Parameter of EFI_SAL_REGISTER_PAL_PHYSICAL_ADDR +// +// The encoded value of the entity whose physical address is registered // #define EFI_SAL_REGISTER_PAL_ADDR 0x0 // -// EFI_SAL_CACHE_FLUSH +// Parameter of EFI_SAL_CACHE_FLUSH +// +// Unsigned 64-bit integer denoting type of cache flush operation // #define EFI_SAL_FLUSH_I_CACHE 0x01 #define EFI_SAL_FLUSH_D_CACHE 0x02 @@ -156,12 +254,21 @@ typedef struct { #define EFI_SAL_FLUSH_MAKE_COHERENT 0x04 // -// EFI_SAL_PCI_CONFIG_READ, EFI_SAL_PCI_CONFIG_WRITE +// Parameter of EFI_SAL_PCI_CONFIG_READ and EFI_SAL_PCI_CONFIG_WRITE +// +// PCI config size // #define EFI_SAL_PCI_CONFIG_ONE_BYTE 0x1 #define EFI_SAL_PCI_CONFIG_TWO_BYTES 0x2 #define EFI_SAL_PCI_CONFIG_FOUR_BYTES 0x4 - +// +// The type of PCI configuration address +// +#define EFI_SAL_PCI_COMPATIBLE_ADDRESS 0x0 +#define EFI_SAL_PCI_EXTENDED_REGISTER_ADDRESS 0x1 +/// +/// Format of PCI Compatible Address +/// typedef struct { UINT64 Register : 8; UINT64 Function : 3; @@ -170,16 +277,34 @@ typedef struct { UINT64 Segment : 8; UINT64 Reserved : 32; } SAL_PCI_ADDRESS; +/// +/// Format of Extended Register Address +/// +typedef struct { + UINT64 Register : 8; + UINT64 ExtendedRegister : 4; + UINT64 Function : 3; + UINT64 Device : 5; + UINT64 Bus : 8; + UINT64 Segment : 16; + UINT64 Reserved : 20; +} SAL_PCI_EXTENDED_REGISTER_ADDRESS; // -// EFI_SAL_FREQ_BASE +// Parameter of EFI_SAL_FREQ_BASE +// +// Unsigned 64-bit integer specifying the type of clock source // #define EFI_SAL_CPU_INPUT_FREQ_BASE 0x0 #define EFI_SAL_PLATFORM_IT_FREQ_BASE 0x1 #define EFI_SAL_PLATFORM_RTC_FREQ_BASE 0x2 // -// EFI_SAL_UPDATE_PAL +// Parameter and return value of EFI_SAL_UPDATE_PAL +// +// Return parameter provides additional information on the +// failure when the status field contains a value of –3, +// returned in r9. // #define EFI_SAL_UPDATE_BAD_PAL_VERSION ((UINT64) -1) #define EFI_SAL_UPDATE_PAL_AUTH_FAIL ((UINT64) -2) @@ -189,7 +314,9 @@ typedef struct { #define EFI_SAL_UPDATE_PAL_ERASE_FAIL ((UINT64) -11) #define EFI_SAL_UPDATE_PAL_READ_FAIL ((UINT64) -12) #define EFI_SAL_UPDATE_PAL_CANT_FIT ((UINT64) -13) - +/// +/// 64-byte header of update data block. +/// typedef struct { UINT32 Size; UINT32 MmddyyyyDate; @@ -198,7 +325,12 @@ typedef struct { UINT8 Reserved[5]; UINT64 FwVendorId; } SAL_UPDATE_PAL_DATA_BLOCK; - +/// +/// Data structure pointed by parameter param_buf. +/// It is a 16-byte aligned data structure in memory with a length of 32 bytes +/// that describes the new firmware. This information is organized in the form +/// of a linked list with each element describing one firmware component. +/// typedef struct _SAL_UPDATE_PAL_INFO_BLOCK { struct _SAL_UPDATE_PAL_INFO_BLOCK *Next; struct SAL_UPDATE_PAL_DATA_BLOCK *DataBlock; @@ -206,27 +338,64 @@ typedef struct _SAL_UPDATE_PAL_INFO_BLOCK { UINT8 Reserved[15]; } SAL_UPDATE_PAL_INFO_BLOCK; -// -// SAL System Table Definitions -// +/// +/// SAL System Table Definitions +/// #pragma pack(1) typedef struct { + /// + /// The ASCII string representation of “SST_”, which confirms the presence of the table. + /// UINT32 Signature; + /// + /// The length of the entire table in bytes, starting from offset zero and including the + /// header and all entries indicated by the EntryCount field. + /// UINT32 Length; + /// + /// The revision number of the Itanium Processor Family System Abstraction Layer + /// Specification supported by the SAL implementation in binary coded decimal (BCD) format. + /// UINT16 SalRevision; + /// + /// The number of entries in the variable portion of the table. + /// UINT16 EntryCount; + /// + /// A modulo checksum of the entire table and the entries following this table. + /// UINT8 CheckSum; + /// + /// Unused, must be zero. + /// UINT8 Reserved[7]; + /// + /// Version Number of the SAL_A firmware implementation in BCD format. + /// UINT16 SalAVersion; + /// + /// Version Number of the SAL_B firmware implementation in BCD format. + /// UINT16 SalBVersion; + /// + /// An ASCII identification string which uniquely identifies the manufacturer + /// of the system hardware. + /// UINT8 OemId[32]; + /// + /// An ASCII identification string which uniquely identifies a family of + /// compatible products from the manufacturer. + /// UINT8 ProductId[32]; + /// + /// Unused, must be zero. + /// UINT8 Reserved2[8]; } SAL_SYSTEM_TABLE_HEADER; #pragma pack() #define EFI_SAL_ST_HEADER_SIGNATURE "SST_" -#define EFI_SAL_REVISION 0x0300 +#define EFI_SAL_REVISION 0x0320 // // SAL System Types // @@ -248,8 +417,11 @@ typedef struct { #define EFI_SAL_ST_AP_WAKEUP_SIZE 16 #pragma pack(1) +/// +/// Format Entrypoint Descriptor Entry +/// typedef struct { - UINT8 Type; // Type == 0 + UINT8 Type; ///< Type here should be 0 UINT8 Reserved[7]; UINT64 PalProcEntry; UINT64 SalProcEntry; @@ -258,20 +430,28 @@ typedef struct { } SAL_ST_ENTRY_POINT_DESCRIPTOR; #pragma pack(1) +/// +/// Format Platform Features Descriptor Entry +/// typedef struct { - UINT8 Type; // Type == 2 + UINT8 Type; ///< Type here should be 2 UINT8 PlatformFeatures; UINT8 Reserved[14]; } SAL_ST_PLATFORM_FEATURES; #pragma pack() - +// +// Value of Platform Feature List +// #define SAL_PLAT_FEAT_BUS_LOCK 0x01 #define SAL_PLAT_FEAT_PLAT_IPI_HINT 0x02 #define SAL_PLAT_FEAT_PROC_IPI_HINT 0x04 #pragma pack(1) +/// +/// Format of Translation Register Descriptor Entry +/// typedef struct { - UINT8 Type; // Type == 3 + UINT8 Type; ///< Type here should be 3 UINT8 TRType; UINT8 TRNumber; UINT8 Reserved[5]; @@ -280,11 +460,16 @@ typedef struct { UINT64 Reserved1; } SAL_ST_TR_DECRIPTOR; #pragma pack() - +// +// Type of Translation Register +// #define EFI_SAL_ST_TR_USAGE_INSTRUCTION 00 #define EFI_SAL_ST_TR_USAGE_DATA 01 #pragma pack(1) +/// +/// Definition of Coherence Domain Information +/// typedef struct { UINT64 NumberOfProcessors; UINT64 LocalIDRegister; @@ -292,8 +477,11 @@ typedef struct { #pragma pack() #pragma pack(1) +/// +/// Format of Purge Translation Cache Coherence Domain Entry +/// typedef struct { - UINT8 Type; // Type == 4 + UINT8 Type; ///< Type here should be 4 UINT8 Reserved[3]; UINT32 NumberOfDomains; SAL_COHERENCE_DOMAIN_INFO *DomainInformation; @@ -301,20 +489,20 @@ typedef struct { #pragma pack() #pragma pack(1) +/// +/// Format of Application Processor Wake-Up Descriptor Entry +/// typedef struct { - UINT8 Type; // Type == 5 + UINT8 Type; ///< Type here should be 5 UINT8 WakeUpType; UINT8 Reserved[6]; UINT64 ExternalInterruptVector; } SAL_ST_AP_WAKEUP_DECRIPTOR; #pragma pack() -// -// FIT Entry -// -#define EFI_SAL_FIT_ENTRY_PTR (0x100000000 - 32) // 4GB - 24 -#define EFI_SAL_FIT_PALA_ENTRY (0x100000000 - 48) // 4GB - 32 -#define EFI_SAL_FIT_PALB_TYPE 01 +/// +/// Format of Firmware Interface Table (FIT) Entry +/// typedef struct { UINT64 Address; UINT8 Size[3]; @@ -324,15 +512,37 @@ typedef struct { UINT8 CheckSumValid : 1; UINT8 CheckSum; } EFI_SAL_FIT_ENTRY; +// +// FIT Types +// +#define EFI_SAL_FIT_FIT_HEADER_TYPE 0x00 +#define EFI_SAL_FIT_PAL_B_TYPE 0x01 +// +// Type from 0x02 to 0x0D is reserved. +// +#define EFI_SAL_FIT_PROCESSOR_SPECIFIC_PAL_A_TYPE 0x0E +#define EFI_SAL_FIT_PAL_A_TYPE 0x0F +// +// OEM-defined type range is from 0x10 to 0x7E. +// Here we defined the PEI_CORE type as 0x10 +// +#define EFI_SAL_FIT_PEI_CORE_TYPE 0x10 +#define EFI_SAL_FIT_UNUSED_TYPE 0x7F // -// SAL Common Record Header +// FIT Entry // -typedef struct { - UINT16 Length; - UINT8 Data[1024]; -} SAL_OEM_DATA; +#define EFI_SAL_FIT_ENTRY_PTR (0x100000000 - 32) // 4GB - 24 +#define EFI_SAL_FIT_PALA_ENTRY (0x100000000 - 48) // 4GB - 32 +#define EFI_SAL_FIT_PALB_TYPE 01 +// +// Following definitions are for Error Record Structure +// + +/// +/// Format of TimeStamp field in Record Header +/// typedef struct { UINT8 Seconds; UINT8 Minutes; @@ -343,7 +553,9 @@ typedef struct { UINT8 Year; UINT8 Century; } SAL_TIME_STAMP; - +/// +/// Definition of Record Header +/// typedef struct { UINT64 RecordId; UINT16 Revision; @@ -353,29 +565,35 @@ typedef struct { SAL_TIME_STAMP TimeStamp; UINT8 OemPlatformId[16]; } SAL_RECORD_HEADER; - +/// +/// Definition of Section Header +/// typedef struct { - GUID Guid; + GUID Guid; UINT16 Revision; UINT8 ErrorRecoveryInfo; UINT8 Reserved; UINT32 SectionLength; } SAL_SEC_HEADER; -// -// SAL Processor Record -// +/// +/// GUID of Processor Machine Check Errors +/// #define SAL_PROCESSOR_ERROR_RECORD_INFO \ { \ 0xe429faf1, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ } - +// +// Bit masks for valid bits of MOD_ERROR_INFO +// #define CHECK_INFO_VALID_BIT_MASK 0x1 #define REQUESTOR_ID_VALID_BIT_MASK 0x2 #define RESPONDER_ID_VALID_BIT_MASK 0x4 #define TARGER_ID_VALID_BIT_MASK 0x8 #define PRECISE_IP_VALID_BIT_MASK 0x10 - +/// +/// Definition of MOD_ERROR_INFO_STRUCT +/// typedef struct { UINT64 InfoValid : 1; UINT64 ReqValid : 1; @@ -389,7 +607,9 @@ typedef struct { UINT64 Target; UINT64 Ip; } MOD_ERROR_INFO; - +/// +/// Definition of CPUID_INFO_STRUCT +/// typedef struct { UINT8 CpuidInfo[40]; UINT8 Reserved; @@ -399,14 +619,18 @@ typedef struct { UINT64 FrLow; UINT64 FrHigh; } FR_STRUCT; - +// +// Bit masks for PSI_STATIC_STRUCT.ValidFieldBits +// #define MIN_STATE_VALID_BIT_MASK 0x1 #define BR_VALID_BIT_MASK 0x2 #define CR_VALID_BIT_MASK 0x4 #define AR_VALID_BIT_MASK 0x8 #define RR_VALID_BIT_MASK 0x10 #define FR_VALID_BIT_MASK 0x20 - +/// +/// Definition of PSI_STATIC_STRUCT +/// typedef struct { UINT64 ValidFieldBits; UINT8 MinStateInfo[1024]; @@ -416,13 +640,17 @@ typedef struct { UINT64 Rr[8]; FR_STRUCT Fr[128]; } PSI_STATIC_STRUCT; - +// +// Bit masks for SAL_PROCESSOR_ERROR_RECORD.ValidationBits +// #define PROC_ERROR_MAP_VALID_BIT_MASK 0x1 #define PROC_STATE_PARAMETER_VALID_BIT_MASK 0x2 #define PROC_CR_LID_VALID_BIT_MASK 0x4 #define PROC_STATIC_STRUCT_VALID_BIT_MASK 0x8 #define CPU_INFO_VALID_BIT_MASK 0x1000000 - +/// +/// Definition of Processor Machine Check Error Record +/// typedef struct { SAL_SEC_HEADER SectionHeader; UINT64 ValidationBits; @@ -438,14 +666,16 @@ typedef struct { PSI_STATIC_STRUCT PsiValidData; } SAL_PROCESSOR_ERROR_RECORD; -// -// Sal Platform memory Error Record -// +/// +/// GUID of Platform Memory Device Error Info +/// #define SAL_MEMORY_ERROR_RECORD_INFO \ { \ 0xe429faf2, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ } - +// +// Bit masks for SAL_MEMORY_ERROR_RECORD.ValidationBits +// #define MEMORY_ERROR_STATUS_VALID_BIT_MASK 0x1 #define MEMORY_PHYSICAL_ADDRESS_VALID_BIT_MASK 0x2 #define MEMORY_ADDR_BIT_MASK 0x4 @@ -463,7 +693,9 @@ typedef struct { #define MEMORY_PLATFORM_BUS_SPECIFIC_DATA_VALID_BIT_MASK 0x4000 #define MEMORY_PLATFORM_OEM_ID_VALID_BIT_MASK 0x8000 #define MEMORY_PLATFORM_OEM_DATA_STRUCT_VALID_BIT_MASK 0x10000 - +/// +/// Definition of Platform Memory Device Error Info Record +/// typedef struct { SAL_SEC_HEADER SectionHeader; UINT64 ValidationBits; @@ -485,14 +717,16 @@ typedef struct { UINT8 MemPlatformOemId[16]; } SAL_MEMORY_ERROR_RECORD; -// -// PCI BUS Errors -// +/// +/// GUID of Platform PCI Bus Error Info +/// #define SAL_PCI_BUS_ERROR_RECORD_INFO \ { \ 0xe429faf4, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ } - +// +// Bit masks for SAL_PCI_BUS_ERROR_RECORD.ValidationBits +// #define PCI_BUS_ERROR_STATUS_VALID_BIT_MASK 0x1 #define PCI_BUS_ERROR_TYPE_VALID_BIT_MASK 0x2 #define PCI_BUS_ID_VALID_BIT_MASK 0x4 @@ -509,7 +743,9 @@ typedef struct { UINT8 BusNumber; UINT8 SegmentNumber; } PCI_BUS_ID; - +/// +/// Definition of Platform PCI Bus Error Info Record +/// typedef struct { SAL_SEC_HEADER SectionHeader; UINT64 ValidationBits; @@ -526,21 +762,25 @@ typedef struct { UINT8 PciBusOemId[16]; } SAL_PCI_BUS_ERROR_RECORD; -// -// PCI Component Errors -// +/// +/// GUID of Platform PCI Component Error Info +/// #define SAL_PCI_COMP_ERROR_RECORD_INFO \ { \ 0xe429faf6, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ } - +// +// Bit masks for SAL_PCI_COMPONENT_ERROR_RECORD.ValidationBits +// #define PCI_COMP_ERROR_STATUS_VALID_BIT_MASK 0x1 #define PCI_COMP_INFO_VALID_BIT_MASK 0x2 #define PCI_COMP_MEM_NUM_VALID_BIT_MASK 0x4 #define PCI_COMP_IO_NUM_VALID_BIT_MASK 0x8 #define PCI_COMP_REG_DATA_PAIR_VALID_BIT_MASK 0x10 #define PCI_COMP_OEM_DATA_STRUCT_VALID_BIT_MASK 0x20 - +/// +/// Format of PCI Component Information to identify the device +/// typedef struct { UINT16 VendorId; UINT16 DeviceId; @@ -551,7 +791,9 @@ typedef struct { UINT8 SegmentNumber; UINT8 Reserved[5]; } PCI_COMP_INFO; - +/// +/// Definition of Platform PCI Component Error Info +/// typedef struct { SAL_SEC_HEADER SectionHeader; UINT64 ValidationBits; @@ -562,14 +804,16 @@ typedef struct { UINT8 PciBusOemId[16]; } SAL_PCI_COMPONENT_ERROR_RECORD; -// -// Sal Device Errors Info. -// -#define SAL_DEVICE_ERROR_RECORD_INFO \ +/// +/// Platform SEL Device Error Info +/// +#define SAL_SEL_DEVICE_ERROR_RECORD_INFO \ { \ 0xe429faf3, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ } - +// +// Bit masks for SAL_SEL_DEVICE_ERROR_RECORD.ValidationBits +// #define SEL_RECORD_ID_VALID_BIT_MASK 0x1; #define SEL_RECORD_TYPE_VALID_BIT_MASK 0x2; #define SEL_GENERATOR_ID_VALID_BIT_MASK 0x4; @@ -580,7 +824,9 @@ typedef struct { #define SEL_EVENT_DATA1_VALID_BIT_MASK 0x80; #define SEL_EVENT_DATA2_VALID_BIT_MASK 0x100; #define SEL_EVENT_DATA3_VALID_BIT_MASK 0x200; - +/// +/// Definition of Platform SEL Device Error Info Record +/// typedef struct { SAL_SEC_HEADER SectionHeader; UINT64 ValidationBits; @@ -595,21 +841,25 @@ typedef struct { UINT8 Data1; UINT8 Data2; UINT8 Data3; -} SAL_DEVICE_ERROR_RECORD; +} SAL_SEL_DEVICE_ERROR_RECORD; -// -// Sal SMBIOS Device Errors Info. -// +/// +/// GUID of Platform SMBIOS Device Error Info +/// #define SAL_SMBIOS_ERROR_RECORD_INFO \ { \ 0xe429faf5, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ } - +// +// Bit masks for SAL_SMBIOS_DEVICE_ERROR_RECORD.ValidationBits +// #define SMBIOS_EVENT_TYPE_VALID_BIT_MASK 0x1 #define SMBIOS_LENGTH_VALID_BIT_MASK 0x2 #define SMBIOS_TIME_STAMP_VALID_BIT_MASK 0x4 #define SMBIOS_DATA_VALID_BIT_MASK 0x8 - +/// +/// Definition of Platform SMBIOS Device Error Info Record +/// typedef struct { SAL_SEC_HEADER SectionHeader; UINT64 ValidationBits; @@ -619,13 +869,15 @@ typedef struct { } SAL_SMBIOS_DEVICE_ERROR_RECORD; /// -/// Sal Platform Specific Errors Info. +/// GUID of Platform Specific Error Info /// #define SAL_PLATFORM_ERROR_RECORD_INFO \ { \ 0xe429faf7, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ } - +// +// Bit masks for SAL_PLATFORM_SPECIFIC_ERROR_RECORD.ValidationBits +// #define PLATFORM_ERROR_STATUS_VALID_BIT_MASK 0x1 #define PLATFORM_REQUESTOR_ID_VALID_BIT_MASK 0x2 #define PLATFORM_RESPONDER_ID_VALID_BIT_MASK 0x4 @@ -634,7 +886,9 @@ typedef struct { #define PLATFORM_OEM_ID_VALID_BIT_MASK 0x20 #define PLATFORM_OEM_DATA_STRUCT_VALID_BIT_MASK 0x40 #define PLATFORM_OEM_DEVICE_PATH_VALID_BIT_MASK 0x80 - +/// +/// Definition of Platform Specific Error Info Record +/// typedef struct { SAL_SEC_HEADER SectionHeader; UINT64 ValidationBits; @@ -647,14 +901,14 @@ typedef struct { } SAL_PLATFORM_SPECIFIC_ERROR_RECORD; /// -/// Union of all the possible Sal Record Types +/// Union of all the possible SAL Error Record Types /// typedef union { SAL_RECORD_HEADER *RecordHeader; SAL_PROCESSOR_ERROR_RECORD *SalProcessorRecord; SAL_PCI_BUS_ERROR_RECORD *SalPciBusRecord; SAL_PCI_COMPONENT_ERROR_RECORD *SalPciComponentRecord; - SAL_DEVICE_ERROR_RECORD *ImpiRecord; + SAL_SEL_DEVICE_ERROR_RECORD *ImpiRecord; SAL_SMBIOS_DEVICE_ERROR_RECORD *SmbiosRecord; SAL_PLATFORM_SPECIFIC_ERROR_RECORD *PlatformRecord; SAL_MEMORY_ERROR_RECORD *MemoryRecord; diff --git a/MdePkg/Include/IndustryStandard/Scsi.h b/MdePkg/Include/IndustryStandard/Scsi.h index 04bd3b4fb0..ccb3590bdf 100644 --- a/MdePkg/Include/IndustryStandard/Scsi.h +++ b/MdePkg/Include/IndustryStandard/Scsi.h @@ -1,7 +1,7 @@ /** @file - support for SCSI-2 standard + Support for SCSI-2 standard - Copyright (c) 2006, Intel Corporation + Copyright (c) 2006 - 2008, 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 @@ -33,15 +33,15 @@ #define EFI_SCSI_OP_MODE_SEN6 0x1a #define EFI_SCSI_OP_MODE_SEN10 0x5a #define EFI_SCSI_OP_READ_BUFFER 0x3c +#define EFI_SCSI_OP_RECEIVE_DIAG 0x1c #define EFI_SCSI_OP_REQUEST_SENSE 0x03 #define EFI_SCSI_OP_SEND_DIAG 0x1d #define EFI_SCSI_OP_TEST_UNIT_READY 0x00 #define EFI_SCSI_OP_WRITE_BUFF 0x3b // -// Commands unique to Direct Access Devices +// Additional commands for Direct Access Devices // -#define EFI_SCSI_OP_COMPARE 0x39 #define EFI_SCSI_OP_FORMAT 0x04 #define EFI_SCSI_OP_LOCK_UN_CACHE 0x36 #define EFI_SCSI_OP_PREFETCH 0x34 @@ -52,7 +52,6 @@ #define EFI_SCSI_OP_READ_DEFECT 0x37 #define EFI_SCSI_OP_READ_LONG 0x3e #define EFI_SCSI_OP_REASSIGN_BLK 0x07 -#define EFI_SCSI_OP_RECEIVE_DIAG 0x1c #define EFI_SCSI_OP_RELEASE 0x17 #define EFI_SCSI_OP_REZERO 0x01 #define EFI_SCSI_OP_SEARCH_DATA_E 0x31 @@ -72,7 +71,7 @@ #define EFI_SCSI_OP_WRITE_SAME 0x41 // -// Commands unique to Sequential Access Devices +// Additional commands for Sequential Access Devices // #define EFI_SCSI_OP_ERASE 0x19 #define EFI_SCSI_OP_LOAD_UNLOAD 0x1b @@ -88,7 +87,7 @@ #define EFI_SCSI_OP_WRITE_FILEMARK 0x10 // -// Commands unique to Printer Devices +// Additional commands for Printer Devices // #define EFI_SCSI_OP_PRINT 0x0a #define EFI_SCSI_OP_SLEW_PRINT 0x0b @@ -96,13 +95,13 @@ #define EFI_SCSI_OP_SYNC_BUFF 0x10 // -// Commands unique to Processor Devices +// Additional commands for Processor Devices // #define EFI_SCSI_OP_RECEIVE 0x08 #define EFI_SCSI_OP_SEND 0x0a // -// Commands unique to Write-Once Devices +// Additional commands for Write-Once Devices // #define EFI_SCSI_OP_MEDIUM_SCAN 0x38 #define EFI_SCSI_OP_SEARCH_DAT_E10 0x31 @@ -120,7 +119,7 @@ #define EFI_SCSI_OP_WRITE_VERIFY12 0xae // -// Commands unique to CD-ROM Devices +// Additional commands for CD-ROM Devices // #define EFI_SCSI_OP_PLAY_AUD_10 0x45 #define EFI_SCSI_OP_PLAY_AUD_12 0xa5 @@ -134,7 +133,7 @@ #define EFI_SCSI_OP_READ_TOC 0x43 // -// Commands unique to Scanner Devices +// Additional commands for Scanner Devices // #define EFI_SCSI_OP_GET_DATABUFF_STAT 0x34 #define EFI_SCSI_OP_GET_WINDOW 0x25 @@ -143,12 +142,12 @@ #define EFI_SCSI_OP_SET_WINDOW 0x24 // -// Commands unique to Optical Memory Devices +// Additional commands for Optical Memory Devices // #define EFI_SCSI_OP_UPDATE_BLOCK 0x3d // -// Commands unique to Medium Changer Devices +// Additional commands for Medium Changer Devices // #define EFI_SCSI_OP_EXCHANGE_MEDIUM 0xa6 #define EFI_SCSI_OP_INIT_ELEMENT_STAT 0x07 @@ -157,7 +156,7 @@ #define EFI_SCSI_OP_SEND_VOL_TAG 0xb6 // -// Commands unique to Communition Devices +// Additional commands for Communition Devices // #define EFI_SCSI_OP_GET_MESSAGE6 0x08 #define EFI_SCSI_OP_GET_MESSAGE10 0x28 @@ -175,23 +174,27 @@ // // Peripheral Device Type Definitions // -#define EFI_SCSI_TYPE_DISK 0x00 // Disk device -#define EFI_SCSI_TYPE_TAPE 0x01 // Tape device -#define EFI_SCSI_TYPE_PRINTER 0x02 // Printer -#define EFI_SCSI_TYPE_PROCESSOR 0x03 // Processor -#define EFI_SCSI_TYPE_WORM 0x04 // Write-once read-multiple -#define EFI_SCSI_TYPE_CDROM 0x05 // CD-ROM device -#define EFI_SCSI_TYPE_SCANNER 0x06 // Scanner device -#define EFI_SCSI_TYPE_OPTICAL 0x07 // Optical memory device -#define EFI_SCSI_TYPE_MEDIUMCHANGER 0x08 // Medium Changer device -#define EFI_SCSI_TYPE_COMMUNICATION 0x09 // Communications device -#define EFI_SCSI_TYPE_RESERVED_LOW 0x0A // Reserved (low) -#define EFI_SCSI_TYPE_RESERVED_HIGH 0x1E // Reserved (high) -#define EFI_SCSI_TYPE_UNKNOWN 0x1F // Unknown or no device type +#define EFI_SCSI_TYPE_DISK 0x00 ///< Direct-access device (e.g. magnetic disk) +#define EFI_SCSI_TYPE_TAPE 0x01 ///< Sequential-access device (e.g. magnetic tape) +#define EFI_SCSI_TYPE_PRINTER 0x02 ///< Printer device +#define EFI_SCSI_TYPE_PROCESSOR 0x03 ///< Processor device +#define EFI_SCSI_TYPE_WORM 0x04 ///< Write-once device (e.g. some optical disks) +#define EFI_SCSI_TYPE_CDROM 0x05 ///< CD-ROM device +#define EFI_SCSI_TYPE_SCANNER 0x06 ///< Scanner device +#define EFI_SCSI_TYPE_OPTICAL 0x07 ///< Optical memory device (e.g. some optical disks) +#define EFI_SCSI_TYPE_MEDIUMCHANGER 0x08 ///< Medium changer device (e.g. jukeboxes) +#define EFI_SCSI_TYPE_COMMUNICATION 0x09 ///< Communications device +#define EFI_SCSI_TYPE_ASCIT8_1 0x0A ///< Defined by ASC IT8 (Graphic arts pre-press devices) +#define EFI_SCSI_TYPE_ASCIT8_2 0x0B ///< Defined by ASC IT8 (Graphic arts pre-press devices) +// +// 0Ch - 1Eh are reserved +// +#define EFI_SCSI_TYPE_UNKNOWN 0x1F ///< Unknown or no device type + #pragma pack(1) -// -// Data structures for scsi command use -// +/// +/// Standard INQUIRY data format +/// typedef struct { UINT8 Peripheral_Type : 5; UINT8 Peripheral_Qualifier : 3; @@ -203,6 +206,9 @@ typedef struct { UINT8 Reserved_5_95[95 - 5 + 1]; } EFI_SCSI_INQUIRY_DATA; +/// +/// Error codes 70h and 71h sense data format +/// typedef struct { UINT8 Error_Code : 7; UINT8 Valid : 1; @@ -212,11 +218,11 @@ typedef struct { UINT8 ILI : 1; UINT8 Reserved_22 : 2; UINT8 Information_3_6[4]; - UINT8 Addnl_Sense_Length; // n - 7 + UINT8 Addnl_Sense_Length; ///< Additional sense length (n-7) UINT8 Vendor_Specific_8_11[4]; - UINT8 Addnl_Sense_Code; // mandatory - UINT8 Addnl_Sense_Code_Qualifier; // mandatory - UINT8 Field_Replaceable_Unit_Code; // optional + UINT8 Addnl_Sense_Code; ///< Additional sense code + UINT8 Addnl_Sense_Code_Qualifier; ///< Additional sense code qualifier + UINT8 Field_Replaceable_Unit_Code; ///< Field replaceable unit code UINT8 Reserved_15_17[3]; } EFI_SCSI_SENSE_DATA; @@ -232,10 +238,10 @@ typedef struct { } EFI_SCSI_DISK_CAPACITY_DATA; #pragma pack() + // // Sense Key // -#define EFI_SCSI_REQUEST_SENSE_ERROR (0x70) #define EFI_SCSI_SK_NO_SENSE (0x0) #define EFI_SCSI_SK_RECOVERY_ERROR (0x1) #define EFI_SCSI_SK_NOT_READY (0x2) @@ -254,9 +260,13 @@ typedef struct { #define EFI_SCSI_SK_RESERVED_F (0xF) // -// Additional Sense Codes +// Additional Sense Codes and Sense Code Qualifiers. +// Only some frequently used additional sense codes and qualifiers are +// defined here. Please refer to SCSI standard for full value definition. // #define EFI_SCSI_ASC_NOT_READY (0x04) +#define EFI_SCSI_ASCQ_IN_PROGRESS (0x01) + #define EFI_SCSI_ASC_MEDIA_ERR1 (0x10) #define EFI_SCSI_ASC_MEDIA_ERR2 (0x11) #define EFI_SCSI_ASC_MEDIA_ERR3 (0x14) @@ -267,19 +277,9 @@ typedef struct { #define EFI_SCSI_ASC_INVALID_FIELD (0x24) #define EFI_SCSI_ASC_WRITE_PROTECTED (0x27) #define EFI_SCSI_ASC_MEDIA_CHANGE (0x28) -#define EFI_SCSI_ASC_RESET (0x29) /* Power On Reset or Bus Reset occurred */ +#define EFI_SCSI_ASC_RESET (0x29) ///