]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/IndustryStandard/Sal.h
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Sal.h
CommitLineData
540dfc26 1/** @file\r
4135253b 2 Main SAL API's defined in Intel Itanium Processor Family System Abstraction\r
3 Layer Specification Revision 3.2 (December 2003)\r
540dfc26 4\r
9095d37b
LG
5Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
6This program and the accompanying materials are licensed and made available under\r
7the terms and conditions of the BSD License that accompanies this distribution.\r
af2dc6a7 8The full text of the license may be found at\r
9095d37b
LG
9http://opensource.org/licenses/bsd-license.php.\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
540dfc26 13\r
540dfc26 14**/\r
15\r
16#ifndef __SAL_API_H__\r
17#define __SAL_API_H__\r
18\r
1bc5d021 19///\r
9095d37b 20/// SAL return status type\r
1bc5d021 21///\r
13f0a970 22typedef INTN EFI_SAL_STATUS;\r
1bc5d021 23\r
24///\r
9095d37b 25/// Call completed without error.\r
1bc5d021 26///\r
4135253b 27#define EFI_SAL_SUCCESS ((EFI_SAL_STATUS) 0)\r
1bc5d021 28///\r
9095d37b 29/// Call completed without error, but some information was lost due to overflow.\r
1bc5d021 30///\r
4135253b 31#define EFI_SAL_OVERFLOW ((EFI_SAL_STATUS) 1)\r
1bc5d021 32///\r
4135253b 33/// Call completed without error; effect a warm boot of the system to complete the update.\r
34///\r
35#define EFI_SAL_WARM_BOOT_NEEDED ((EFI_SAL_STATUS) 2)\r
36///\r
9095d37b 37/// More information is available for retrieval.\r
1bc5d021 38///\r
540dfc26 39#define EFI_SAL_MORE_RECORDS ((EFI_SAL_STATUS) 3)\r
4135253b 40///\r
41/// Not implemented.\r
42///\r
540dfc26 43#define EFI_SAL_NOT_IMPLEMENTED ((EFI_SAL_STATUS) - 1)\r
4135253b 44///\r
45/// Invalid Argument.\r
46///\r
540dfc26 47#define EFI_SAL_INVALID_ARGUMENT ((EFI_SAL_STATUS) - 2)\r
4135253b 48///\r
9095d37b 49/// Call completed without error.\r
4135253b 50///\r
540dfc26 51#define EFI_SAL_ERROR ((EFI_SAL_STATUS) - 3)\r
4135253b 52///\r
9095d37b 53/// Virtual address not registered.\r
4135253b 54///\r
540dfc26 55#define EFI_SAL_VIRTUAL_ADDRESS_ERROR ((EFI_SAL_STATUS) - 4)\r
4135253b 56///\r
9095d37b 57/// No information available.\r
4135253b 58///\r
540dfc26 59#define EFI_SAL_NO_INFORMATION ((EFI_SAL_STATUS) - 5)\r
4135253b 60///\r
61/// Scratch buffer required.\r
62///\r
540dfc26 63#define EFI_SAL_NOT_ENOUGH_SCRATCH ((EFI_SAL_STATUS) - 9)\r
64\r
4135253b 65///\r
af2dc6a7 66/// Return registers from SAL.\r
4135253b 67///\r
540dfc26 68typedef struct {\r
4135253b 69 ///\r
af2dc6a7 70 /// SAL return status value in r8.\r
4135253b 71 ///\r
72 EFI_SAL_STATUS Status;\r
73 ///\r
af2dc6a7 74 /// SAL returned value in r9.\r
4135253b 75 ///\r
540dfc26 76 UINTN r9;\r
4135253b 77 ///\r
af2dc6a7 78 /// SAL returned value in r10.\r
4135253b 79 ///\r
540dfc26 80 UINTN r10;\r
4135253b 81 ///\r
af2dc6a7 82 /// SAL returned value in r11.\r
4135253b 83 ///\r
540dfc26 84 UINTN r11;\r
85} SAL_RETURN_REGS;\r
86\r
4135253b 87/**\r
88 Prototype of SAL procedures.\r
89\r
14996c96 90 @param FunctionId Functional identifier.\r
4135253b 91 The upper 32 bits are ignored and only the lower 32 bits\r
92 are used. The following functional identifiers are defined:\r
f7763aa4 93 0x01XXXXXX - Architected SAL functional group.\r
94 0x02XXXXXX to 0x03XXXXXX - OEM SAL functional group. Each OEM is\r
4135253b 95 allowed to use the entire range in the 0x02XXXXXX to 0x03XXXXXX range.\r
f7763aa4 96 0x04XXXXXX to 0xFFFFFFFF - Reserved.\r
4135253b 97 @param Arg1 The first parameter of the architected/OEM specific SAL functions.\r
98 @param Arg2 The second parameter of the architected/OEM specific SAL functions.\r
af2dc6a7 99 @param Arg3 The third parameter passed to the ESAL function based.\r
100 @param Arg4 The fourth parameter passed to the ESAL function based.\r
101 @param Arg5 The fifth parameter passed to the ESAL function based.\r
102 @param Arg6 The sixth parameter passed to the ESAL function.\r
103 @param Arg7 The seventh parameter passed to the ESAL function based.\r
4135253b 104\r
105 @return r8 Return status: positive number indicates successful,\r
106 negative number indicates failure.\r
107 r9 Other return parameter in r9.\r
108 r10 Other return parameter in r10.\r
109 r11 Other return parameter in r11.\r
110\r
111**/\r
112typedef\r
113SAL_RETURN_REGS\r
d1c810fc 114(EFIAPI *SAL_PROC)(\r
4135253b 115 IN UINT64 FunctionId,\r
14996c96 116 IN UINT64 Arg1,\r
4135253b 117 IN UINT64 Arg2,\r
118 IN UINT64 Arg3,\r
119 IN UINT64 Arg4,\r
120 IN UINT64 Arg5,\r
121 IN UINT64 Arg6,\r
14996c96 122 IN UINT64 Arg7\r
540dfc26 123 );\r
124\r
125//\r
126// SAL Procedure FunctionId definition\r
127//\r
4135253b 128\r
129///\r
130/// Register software code locations with SAL.\r
131///\r
540dfc26 132#define EFI_SAL_SET_VECTORS 0x01000000\r
4135253b 133///\r
134/// Return Machine State information obtained by SAL.\r
135///\r
540dfc26 136#define EFI_SAL_GET_STATE_INFO 0x01000001\r
4135253b 137///\r
138/// Obtain size of Machine State information.\r
139///\r
540dfc26 140#define EFI_SAL_GET_STATE_INFO_SIZE 0x01000002\r
4135253b 141///\r
142/// Clear Machine State information.\r
143///\r
540dfc26 144#define EFI_SAL_CLEAR_STATE_INFO 0x01000003\r
4135253b 145///\r
146/// Cause the processor to go into a spin loop within SAL.\r
147///\r
540dfc26 148#define EFI_SAL_MC_RENDEZ 0x01000004\r
4135253b 149///\r
150/// Register the machine check interface layer with SAL.\r
151///\r
540dfc26 152#define EFI_SAL_MC_SET_PARAMS 0x01000005\r
4135253b 153///\r
154/// Register the physical addresses of locations needed by SAL.\r
155///\r
540dfc26 156#define EFI_SAL_REGISTER_PHYSICAL_ADDR 0x01000006\r
4135253b 157///\r
158/// Flush the instruction or data caches.\r
159///\r
540dfc26 160#define EFI_SAL_CACHE_FLUSH 0x01000008\r
4135253b 161///\r
162/// Initialize the instruction and data caches.\r
163///\r
540dfc26 164#define EFI_SAL_CACHE_INIT 0x01000009\r
4135253b 165///\r
166/// Read from the PCI configuration space.\r
167///\r
540dfc26 168#define EFI_SAL_PCI_CONFIG_READ 0x01000010\r
4135253b 169///\r
170/// Write to the PCI configuration space.\r
171///\r
540dfc26 172#define EFI_SAL_PCI_CONFIG_WRITE 0x01000011\r
4135253b 173///\r
174/// Return the base frequency of the platform.\r
175///\r
540dfc26 176#define EFI_SAL_FREQ_BASE 0x01000012\r
4135253b 177///\r
178/// Returns information on the physical processor mapping within the platform.\r
179///\r
9c8403b3 180#define EFI_SAL_PHYSICAL_ID_INFO 0x01000013\r
4135253b 181///\r
182/// Update the contents of firmware blocks.\r
183///\r
540dfc26 184#define EFI_SAL_UPDATE_PAL 0x01000020\r
185\r
186#define EFI_SAL_FUNCTION_ID_MASK 0x0000ffff\r
187#define EFI_SAL_MAX_SAL_FUNCTION_ID 0x00000021\r
188\r
189//\r
190// SAL Procedure parameter definitions\r
191// Not much point in using typedefs or enums because all params\r
192// are UINT64 and the entry point is common\r
193//\r
4135253b 194\r
195//\r
196// Parameter of EFI_SAL_SET_VECTORS\r
197//\r
198// Vector type\r
540dfc26 199//\r
200#define EFI_SAL_SET_MCA_VECTOR 0x0\r
201#define EFI_SAL_SET_INIT_VECTOR 0x1\r
202#define EFI_SAL_SET_BOOT_RENDEZ_VECTOR 0x2\r
4135253b 203///\r
af2dc6a7 204/// The format of a length_cs_n argument.\r
4135253b 205///\r
540dfc26 206typedef struct {\r
207 UINT64 Length : 32;\r
208 UINT64 ChecksumValid : 1;\r
209 UINT64 Reserved1 : 7;\r
210 UINT64 ByteChecksum : 8;\r
211 UINT64 Reserved2 : 16;\r
212} SAL_SET_VECTORS_CS_N;\r
213\r
214//\r
4135253b 215// Parameter of EFI_SAL_GET_STATE_INFO, EFI_SAL_GET_STATE_INFO_SIZE, and EFI_SAL_CLEAR_STATE_INFO\r
9095d37b 216//\r
4135253b 217// Type of information\r
540dfc26 218//\r
219#define EFI_SAL_MCA_STATE_INFO 0x0\r
220#define EFI_SAL_INIT_STATE_INFO 0x1\r
221#define EFI_SAL_CMC_STATE_INFO 0x2\r
222#define EFI_SAL_CP_STATE_INFO 0x3\r
223\r
224//\r
4135253b 225// Parameter of EFI_SAL_MC_SET_PARAMS\r
226//\r
227// Unsigned 64-bit integer value for the parameter type of the machine check interface\r
540dfc26 228//\r
229#define EFI_SAL_MC_SET_RENDEZ_PARAM 0x1\r
230#define EFI_SAL_MC_SET_WAKEUP_PARAM 0x2\r
231#define EFI_SAL_MC_SET_CPE_PARAM 0x3\r
4135253b 232//\r
233// Unsigned 64-bit integer value indicating whether interrupt vector or\r
234// memory address is specified\r
235//\r
540dfc26 236#define EFI_SAL_MC_SET_INTR_PARAM 0x1\r
237#define EFI_SAL_MC_SET_MEM_PARAM 0x2\r
238\r
239//\r
4135253b 240// Parameter of EFI_SAL_REGISTER_PAL_PHYSICAL_ADDR\r
241//\r
242// The encoded value of the entity whose physical address is registered\r
540dfc26 243//\r
244#define EFI_SAL_REGISTER_PAL_ADDR 0x0\r
245\r
246//\r
4135253b 247// Parameter of EFI_SAL_CACHE_FLUSH\r
248//\r
249// Unsigned 64-bit integer denoting type of cache flush operation\r
540dfc26 250//\r
251#define EFI_SAL_FLUSH_I_CACHE 0x01\r
252#define EFI_SAL_FLUSH_D_CACHE 0x02\r
253#define EFI_SAL_FLUSH_BOTH_CACHE 0x03\r
254#define EFI_SAL_FLUSH_MAKE_COHERENT 0x04\r
255\r
256//\r
4135253b 257// Parameter of EFI_SAL_PCI_CONFIG_READ and EFI_SAL_PCI_CONFIG_WRITE\r
258//\r
259// PCI config size\r
540dfc26 260//\r
261#define EFI_SAL_PCI_CONFIG_ONE_BYTE 0x1\r
262#define EFI_SAL_PCI_CONFIG_TWO_BYTES 0x2\r
263#define EFI_SAL_PCI_CONFIG_FOUR_BYTES 0x4\r
4135253b 264//\r
265// The type of PCI configuration address\r
266//\r
267#define EFI_SAL_PCI_COMPATIBLE_ADDRESS 0x0\r
268#define EFI_SAL_PCI_EXTENDED_REGISTER_ADDRESS 0x1\r
269///\r
af2dc6a7 270/// The format of PCI Compatible Address.\r
4135253b 271///\r
540dfc26 272typedef struct {\r
273 UINT64 Register : 8;\r
274 UINT64 Function : 3;\r
275 UINT64 Device : 5;\r
276 UINT64 Bus : 8;\r
277 UINT64 Segment : 8;\r
278 UINT64 Reserved : 32;\r
279} SAL_PCI_ADDRESS;\r
4135253b 280///\r
af2dc6a7 281/// The format of Extended Register Address.\r
4135253b 282///\r
283typedef struct {\r
284 UINT64 Register : 8;\r
285 UINT64 ExtendedRegister : 4;\r
286 UINT64 Function : 3;\r
287 UINT64 Device : 5;\r
288 UINT64 Bus : 8;\r
289 UINT64 Segment : 16;\r
290 UINT64 Reserved : 20;\r
291} SAL_PCI_EXTENDED_REGISTER_ADDRESS;\r
540dfc26 292\r
293//\r
4135253b 294// Parameter of EFI_SAL_FREQ_BASE\r
295//\r
296// Unsigned 64-bit integer specifying the type of clock source\r
540dfc26 297//\r
298#define EFI_SAL_CPU_INPUT_FREQ_BASE 0x0\r
299#define EFI_SAL_PLATFORM_IT_FREQ_BASE 0x1\r
300#define EFI_SAL_PLATFORM_RTC_FREQ_BASE 0x2\r
301\r
302//\r
4135253b 303// Parameter and return value of EFI_SAL_UPDATE_PAL\r
304//\r
305// Return parameter provides additional information on the\r
f7763aa4 306// failure when the status field contains a value of -3,\r
4135253b 307// returned in r9.\r
540dfc26 308//\r
309#define EFI_SAL_UPDATE_BAD_PAL_VERSION ((UINT64) -1)\r
310#define EFI_SAL_UPDATE_PAL_AUTH_FAIL ((UINT64) -2)\r
311#define EFI_SAL_UPDATE_PAL_BAD_TYPE ((UINT64) -3)\r
312#define EFI_SAL_UPDATE_PAL_READONLY ((UINT64) -4)\r
313#define EFI_SAL_UPDATE_PAL_WRITE_FAIL ((UINT64) -10)\r
314#define EFI_SAL_UPDATE_PAL_ERASE_FAIL ((UINT64) -11)\r
315#define EFI_SAL_UPDATE_PAL_READ_FAIL ((UINT64) -12)\r
316#define EFI_SAL_UPDATE_PAL_CANT_FIT ((UINT64) -13)\r
4135253b 317///\r
318/// 64-byte header of update data block.\r
319///\r
540dfc26 320typedef struct {\r
321 UINT32 Size;\r
322 UINT32 MmddyyyyDate;\r
323 UINT16 Version;\r
324 UINT8 Type;\r
325 UINT8 Reserved[5];\r
326 UINT64 FwVendorId;\r
e1da91ad 327 UINT8 Reserved2[40];\r
540dfc26 328} SAL_UPDATE_PAL_DATA_BLOCK;\r
4135253b 329///\r
af2dc6a7 330/// Data structure pointed by the parameter param_buf.\r
4135253b 331/// It is a 16-byte aligned data structure in memory with a length of 32 bytes\r
332/// that describes the new firmware. This information is organized in the form\r
333/// of a linked list with each element describing one firmware component.\r
334///\r
540dfc26 335typedef struct _SAL_UPDATE_PAL_INFO_BLOCK {\r
336 struct _SAL_UPDATE_PAL_INFO_BLOCK *Next;\r
337 struct SAL_UPDATE_PAL_DATA_BLOCK *DataBlock;\r
338 UINT8 StoreChecksum;\r
339 UINT8 Reserved[15];\r
340} SAL_UPDATE_PAL_INFO_BLOCK;\r
341\r
4135253b 342///\r
af2dc6a7 343/// SAL System Table Definitions.\r
4135253b 344///\r
766f4bc1 345#pragma pack(1)\r
540dfc26 346typedef struct {\r
4135253b 347 ///\r
9095d37b
LG
348 /// The ASCII string representation of "SST_" that confirms the presence of the table.\r
349 ///\r
540dfc26 350 UINT32 Signature;\r
4135253b 351 ///\r
352 /// The length of the entire table in bytes, starting from offset zero and including the\r
353 /// header and all entries indicated by the EntryCount field.\r
354 ///\r
540dfc26 355 UINT32 Length;\r
4135253b 356 ///\r
357 /// The revision number of the Itanium Processor Family System Abstraction Layer\r
af2dc6a7 358 /// Specification supported by the SAL implementation, in binary coded decimal (BCD) format.\r
4135253b 359 ///\r
540dfc26 360 UINT16 SalRevision;\r
4135253b 361 ///\r
362 /// The number of entries in the variable portion of the table.\r
363 ///\r
540dfc26 364 UINT16 EntryCount;\r
4135253b 365 ///\r
366 /// A modulo checksum of the entire table and the entries following this table.\r
367 ///\r
540dfc26 368 UINT8 CheckSum;\r
4135253b 369 ///\r
370 /// Unused, must be zero.\r
371 ///\r
540dfc26 372 UINT8 Reserved[7];\r
4135253b 373 ///\r
374 /// Version Number of the SAL_A firmware implementation in BCD format.\r
375 ///\r
540dfc26 376 UINT16 SalAVersion;\r
4135253b 377 ///\r
378 /// Version Number of the SAL_B firmware implementation in BCD format.\r
379 ///\r
540dfc26 380 UINT16 SalBVersion;\r
4135253b 381 ///\r
382 /// An ASCII identification string which uniquely identifies the manufacturer\r
383 /// of the system hardware.\r
384 ///\r
540dfc26 385 UINT8 OemId[32];\r
4135253b 386 ///\r
387 /// An ASCII identification string which uniquely identifies a family of\r
388 /// compatible products from the manufacturer.\r
389 ///\r
540dfc26 390 UINT8 ProductId[32];\r
4135253b 391 ///\r
392 /// Unused, must be zero.\r
393 ///\r
540dfc26 394 UINT8 Reserved2[8];\r
395} SAL_SYSTEM_TABLE_HEADER;\r
540dfc26 396\r
397#define EFI_SAL_ST_HEADER_SIGNATURE "SST_"\r
4135253b 398#define EFI_SAL_REVISION 0x0320\r
540dfc26 399//\r
400// SAL System Types\r
401//\r
402#define EFI_SAL_ST_ENTRY_POINT 0\r
403#define EFI_SAL_ST_MEMORY_DESCRIPTOR 1\r
404#define EFI_SAL_ST_PLATFORM_FEATURES 2\r
405#define EFI_SAL_ST_TR_USAGE 3\r
406#define EFI_SAL_ST_PTC 4\r
407#define EFI_SAL_ST_AP_WAKEUP 5\r
408\r
809177f5 409//\r
410// SAL System Type Sizes\r
411//\r
412#define EFI_SAL_ST_ENTRY_POINT_SIZE 48\r
413#define EFI_SAL_ST_MEMORY_DESCRIPTOR_SIZE 32\r
414#define EFI_SAL_ST_PLATFORM_FEATURES_SIZE 16\r
415#define EFI_SAL_ST_TR_USAGE_SIZE 32\r
416#define EFI_SAL_ST_PTC_SIZE 16\r
417#define EFI_SAL_ST_AP_WAKEUP_SIZE 16\r
418\r
4135253b 419///\r
af2dc6a7 420/// Format of Entrypoint Descriptor Entry.\r
4135253b 421///\r
540dfc26 422typedef struct {\r
af2dc6a7 423 UINT8 Type; ///< Type here should be 0.\r
540dfc26 424 UINT8 Reserved[7];\r
425 UINT64 PalProcEntry;\r
426 UINT64 SalProcEntry;\r
427 UINT64 SalGlobalDataPointer;\r
428 UINT64 Reserved2[2];\r
429} SAL_ST_ENTRY_POINT_DESCRIPTOR;\r
430\r
4135253b 431///\r
af2dc6a7 432/// Format of Platform Features Descriptor Entry.\r
4135253b 433///\r
540dfc26 434typedef struct {\r
af2dc6a7 435 UINT8 Type; ///< Type here should be 2.\r
540dfc26 436 UINT8 PlatformFeatures;\r
437 UINT8 Reserved[14];\r
438} SAL_ST_PLATFORM_FEATURES;\r
1fc0ee17 439\r
4135253b 440//\r
441// Value of Platform Feature List\r
442//\r
540dfc26 443#define SAL_PLAT_FEAT_BUS_LOCK 0x01\r
444#define SAL_PLAT_FEAT_PLAT_IPI_HINT 0x02\r
445#define SAL_PLAT_FEAT_PROC_IPI_HINT 0x04\r
446\r
4135253b 447///\r
af2dc6a7 448/// Format of Translation Register Descriptor Entry.\r
4135253b 449///\r
540dfc26 450typedef struct {\r
af2dc6a7 451 UINT8 Type; ///< Type here should be 3.\r
540dfc26 452 UINT8 TRType;\r
453 UINT8 TRNumber;\r
454 UINT8 Reserved[5];\r
455 UINT64 VirtualAddress;\r
456 UINT64 EncodedPageSize;\r
457 UINT64 Reserved1;\r
458} SAL_ST_TR_DECRIPTOR;\r
1fc0ee17 459\r
4135253b 460//\r
461// Type of Translation Register\r
462//\r
540dfc26 463#define EFI_SAL_ST_TR_USAGE_INSTRUCTION 00\r
464#define EFI_SAL_ST_TR_USAGE_DATA 01\r
465\r
4135253b 466///\r
af2dc6a7 467/// Definition of Coherence Domain Information.\r
4135253b 468///\r
540dfc26 469typedef struct {\r
470 UINT64 NumberOfProcessors;\r
471 UINT64 LocalIDRegister;\r
472} SAL_COHERENCE_DOMAIN_INFO;\r
9095d37b 473\r
4135253b 474///\r
af2dc6a7 475/// Format of Purge Translation Cache Coherence Domain Entry.\r
4135253b 476///\r
540dfc26 477typedef struct {\r
af2dc6a7 478 UINT8 Type; ///< Type here should be 4.\r
540dfc26 479 UINT8 Reserved[3];\r
480 UINT32 NumberOfDomains;\r
481 SAL_COHERENCE_DOMAIN_INFO *DomainInformation;\r
482} SAL_ST_CACHE_COHERENCE_DECRIPTOR;\r
540dfc26 483\r
4135253b 484///\r
af2dc6a7 485/// Format of Application Processor Wake-Up Descriptor Entry.\r
4135253b 486///\r
540dfc26 487typedef struct {\r
af2dc6a7 488 UINT8 Type; ///< Type here should be 5.\r
540dfc26 489 UINT8 WakeUpType;\r
490 UINT8 Reserved[6];\r
491 UINT64 ExternalInterruptVector;\r
492} SAL_ST_AP_WAKEUP_DECRIPTOR;\r
540dfc26 493\r
4135253b 494///\r
af2dc6a7 495/// Format of Firmware Interface Table (FIT) Entry.\r
4135253b 496///\r
540dfc26 497typedef struct {\r
498 UINT64 Address;\r
499 UINT8 Size[3];\r
500 UINT8 Reserved;\r
501 UINT16 Revision;\r
502 UINT8 Type : 7;\r
503 UINT8 CheckSumValid : 1;\r
504 UINT8 CheckSum;\r
505} EFI_SAL_FIT_ENTRY;\r
4135253b 506//\r
9095d37b 507// FIT Types\r
4135253b 508//\r
509#define EFI_SAL_FIT_FIT_HEADER_TYPE 0x00\r
510#define EFI_SAL_FIT_PAL_B_TYPE 0x01\r
511//\r
512// Type from 0x02 to 0x0D is reserved.\r
513//\r
514#define EFI_SAL_FIT_PROCESSOR_SPECIFIC_PAL_A_TYPE 0x0E\r
515#define EFI_SAL_FIT_PAL_A_TYPE 0x0F\r
516//\r
517// OEM-defined type range is from 0x10 to 0x7E.\r
518// Here we defined the PEI_CORE type as 0x10\r
519//\r
520#define EFI_SAL_FIT_PEI_CORE_TYPE 0x10\r
521#define EFI_SAL_FIT_UNUSED_TYPE 0x7F\r
540dfc26 522\r
523//\r
4135253b 524// FIT Entry\r
540dfc26 525//\r
4135253b 526#define EFI_SAL_FIT_ENTRY_PTR (0x100000000 - 32) // 4GB - 24\r
527#define EFI_SAL_FIT_PALA_ENTRY (0x100000000 - 48) // 4GB - 32\r
528#define EFI_SAL_FIT_PALB_TYPE 01\r
540dfc26 529\r
4135253b 530//\r
531// Following definitions are for Error Record Structure\r
532//\r
533\r
534///\r
af2dc6a7 535/// Format of TimeStamp field in Record Header.\r
4135253b 536///\r
540dfc26 537typedef struct {\r
538 UINT8 Seconds;\r
539 UINT8 Minutes;\r
540 UINT8 Hours;\r
541 UINT8 Reserved;\r
542 UINT8 Day;\r
543 UINT8 Month;\r
544 UINT8 Year;\r
545 UINT8 Century;\r
546} SAL_TIME_STAMP;\r
4135253b 547///\r
af2dc6a7 548/// Definition of Record Header.\r
4135253b 549///\r
540dfc26 550typedef struct {\r
551 UINT64 RecordId;\r
552 UINT16 Revision;\r
553 UINT8 ErrorSeverity;\r
554 UINT8 ValidationBits;\r
555 UINT32 RecordLength;\r
556 SAL_TIME_STAMP TimeStamp;\r
557 UINT8 OemPlatformId[16];\r
558} SAL_RECORD_HEADER;\r
4135253b 559///\r
af2dc6a7 560/// Definition of Section Header.\r
4135253b 561///\r
540dfc26 562typedef struct {\r
4135253b 563 GUID Guid;\r
540dfc26 564 UINT16 Revision;\r
565 UINT8 ErrorRecoveryInfo;\r
566 UINT8 Reserved;\r
567 UINT32 SectionLength;\r
568} SAL_SEC_HEADER;\r
569\r
4135253b 570///\r
af2dc6a7 571/// GUID of Processor Machine Check Errors.\r
4135253b 572///\r
540dfc26 573#define SAL_PROCESSOR_ERROR_RECORD_INFO \\r
574 { \\r
575 0xe429faf1, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
576 }\r
4135253b 577//\r
578// Bit masks for valid bits of MOD_ERROR_INFO\r
579//\r
540dfc26 580#define CHECK_INFO_VALID_BIT_MASK 0x1\r
581#define REQUESTOR_ID_VALID_BIT_MASK 0x2\r
582#define RESPONDER_ID_VALID_BIT_MASK 0x4\r
583#define TARGER_ID_VALID_BIT_MASK 0x8\r
584#define PRECISE_IP_VALID_BIT_MASK 0x10\r
4135253b 585///\r
af2dc6a7 586/// Definition of MOD_ERROR_INFO_STRUCT.\r
4135253b 587///\r
540dfc26 588typedef struct {\r
589 UINT64 InfoValid : 1;\r
590 UINT64 ReqValid : 1;\r
591 UINT64 RespValid : 1;\r
592 UINT64 TargetValid : 1;\r
593 UINT64 IpValid : 1;\r
594 UINT64 Reserved : 59;\r
595 UINT64 Info;\r
596 UINT64 Req;\r
597 UINT64 Resp;\r
598 UINT64 Target;\r
599 UINT64 Ip;\r
600} MOD_ERROR_INFO;\r
4135253b 601///\r
af2dc6a7 602/// Definition of CPUID_INFO_STRUCT.\r
4135253b 603///\r
540dfc26 604typedef struct {\r
605 UINT8 CpuidInfo[40];\r
606 UINT8 Reserved;\r
607} CPUID_INFO;\r
608\r
609typedef struct {\r
610 UINT64 FrLow;\r
611 UINT64 FrHigh;\r
612} FR_STRUCT;\r
4135253b 613//\r
614// Bit masks for PSI_STATIC_STRUCT.ValidFieldBits\r
615//\r
540dfc26 616#define MIN_STATE_VALID_BIT_MASK 0x1\r
617#define BR_VALID_BIT_MASK 0x2\r
618#define CR_VALID_BIT_MASK 0x4\r
619#define AR_VALID_BIT_MASK 0x8\r
620#define RR_VALID_BIT_MASK 0x10\r
621#define FR_VALID_BIT_MASK 0x20\r
4135253b 622///\r
af2dc6a7 623/// Definition of PSI_STATIC_STRUCT.\r
4135253b 624///\r
540dfc26 625typedef struct {\r
626 UINT64 ValidFieldBits;\r
627 UINT8 MinStateInfo[1024];\r
628 UINT64 Br[8];\r
629 UINT64 Cr[128];\r
630 UINT64 Ar[128];\r
631 UINT64 Rr[8];\r
632 FR_STRUCT Fr[128];\r
633} PSI_STATIC_STRUCT;\r
4135253b 634//\r
635// Bit masks for SAL_PROCESSOR_ERROR_RECORD.ValidationBits\r
636//\r
540dfc26 637#define PROC_ERROR_MAP_VALID_BIT_MASK 0x1\r
638#define PROC_STATE_PARAMETER_VALID_BIT_MASK 0x2\r
639#define PROC_CR_LID_VALID_BIT_MASK 0x4\r
640#define PROC_STATIC_STRUCT_VALID_BIT_MASK 0x8\r
641#define CPU_INFO_VALID_BIT_MASK 0x1000000\r
4135253b 642///\r
af2dc6a7 643/// Definition of Processor Machine Check Error Record.\r
4135253b 644///\r
540dfc26 645typedef struct {\r
646 SAL_SEC_HEADER SectionHeader;\r
647 UINT64 ValidationBits;\r
648 UINT64 ProcErrorMap;\r
649 UINT64 ProcStateParameter;\r
650 UINT64 ProcCrLid;\r
651 MOD_ERROR_INFO CacheError[15];\r
652 MOD_ERROR_INFO TlbError[15];\r
653 MOD_ERROR_INFO BusError[15];\r
654 MOD_ERROR_INFO RegFileCheck[15];\r
655 MOD_ERROR_INFO MsCheck[15];\r
656 CPUID_INFO CpuInfo;\r
657 PSI_STATIC_STRUCT PsiValidData;\r
658} SAL_PROCESSOR_ERROR_RECORD;\r
659\r
4135253b 660///\r
af2dc6a7 661/// GUID of Platform Memory Device Error Info.\r
4135253b 662///\r
540dfc26 663#define SAL_MEMORY_ERROR_RECORD_INFO \\r
664 { \\r
665 0xe429faf2, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
666 }\r
4135253b 667//\r
668// Bit masks for SAL_MEMORY_ERROR_RECORD.ValidationBits\r
669//\r
540dfc26 670#define MEMORY_ERROR_STATUS_VALID_BIT_MASK 0x1\r
671#define MEMORY_PHYSICAL_ADDRESS_VALID_BIT_MASK 0x2\r
672#define MEMORY_ADDR_BIT_MASK 0x4\r
673#define MEMORY_NODE_VALID_BIT_MASK 0x8\r
674#define MEMORY_CARD_VALID_BIT_MASK 0x10\r
675#define MEMORY_MODULE_VALID_BIT_MASK 0x20\r
676#define MEMORY_BANK_VALID_BIT_MASK 0x40\r
677#define MEMORY_DEVICE_VALID_BIT_MASK 0x80\r
678#define MEMORY_ROW_VALID_BIT_MASK 0x100\r
679#define MEMORY_COLUMN_VALID_BIT_MASK 0x200\r
680#define MEMORY_BIT_POSITION_VALID_BIT_MASK 0x400\r
681#define MEMORY_PLATFORM_REQUESTOR_ID_VALID_BIT_MASK 0x800\r
682#define MEMORY_PLATFORM_RESPONDER_ID_VALID_BIT_MASK 0x1000\r
683#define MEMORY_PLATFORM_TARGET_VALID_BIT_MASK 0x2000\r
684#define MEMORY_PLATFORM_BUS_SPECIFIC_DATA_VALID_BIT_MASK 0x4000\r
685#define MEMORY_PLATFORM_OEM_ID_VALID_BIT_MASK 0x8000\r
686#define MEMORY_PLATFORM_OEM_DATA_STRUCT_VALID_BIT_MASK 0x10000\r
4135253b 687///\r
af2dc6a7 688/// Definition of Platform Memory Device Error Info Record.\r
4135253b 689///\r
540dfc26 690typedef struct {\r
691 SAL_SEC_HEADER SectionHeader;\r
692 UINT64 ValidationBits;\r
693 UINT64 MemErrorStatus;\r
694 UINT64 MemPhysicalAddress;\r
695 UINT64 MemPhysicalAddressMask;\r
696 UINT16 MemNode;\r
697 UINT16 MemCard;\r
698 UINT16 MemModule;\r
699 UINT16 MemBank;\r
700 UINT16 MemDevice;\r
701 UINT16 MemRow;\r
702 UINT16 MemColumn;\r
703 UINT16 MemBitPosition;\r
704 UINT64 ModRequestorId;\r
705 UINT64 ModResponderId;\r
706 UINT64 ModTargetId;\r
707 UINT64 BusSpecificData;\r
708 UINT8 MemPlatformOemId[16];\r
709} SAL_MEMORY_ERROR_RECORD;\r
710\r
4135253b 711///\r
af2dc6a7 712/// GUID of Platform PCI Bus Error Info.\r
4135253b 713///\r
540dfc26 714#define SAL_PCI_BUS_ERROR_RECORD_INFO \\r
715 { \\r
716 0xe429faf4, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
717 }\r
4135253b 718//\r
719// Bit masks for SAL_PCI_BUS_ERROR_RECORD.ValidationBits\r
720//\r
540dfc26 721#define PCI_BUS_ERROR_STATUS_VALID_BIT_MASK 0x1\r
722#define PCI_BUS_ERROR_TYPE_VALID_BIT_MASK 0x2\r
723#define PCI_BUS_ID_VALID_BIT_MASK 0x4\r
724#define PCI_BUS_ADDRESS_VALID_BIT_MASK 0x8\r
725#define PCI_BUS_DATA_VALID_BIT_MASK 0x10\r
726#define PCI_BUS_CMD_VALID_BIT_MASK 0x20\r
727#define PCI_BUS_REQUESTOR_ID_VALID_BIT_MASK 0x40\r
728#define PCI_BUS_RESPONDER_ID_VALID_BIT_MASK 0x80\r
729#define PCI_BUS_TARGET_VALID_BIT_MASK 0x100\r
730#define PCI_BUS_OEM_ID_VALID_BIT_MASK 0x200\r
731#define PCI_BUS_OEM_DATA_STRUCT_VALID_BIT_MASK 0x400\r
732\r
bf7ea009 733///\r
af2dc6a7 734/// Designated PCI Bus identifier.\r
bf7ea009 735///\r
540dfc26 736typedef struct {\r
737 UINT8 BusNumber;\r
738 UINT8 SegmentNumber;\r
739} PCI_BUS_ID;\r
bf7ea009 740\r
4135253b 741///\r
af2dc6a7 742/// Definition of Platform PCI Bus Error Info Record.\r
4135253b 743///\r
540dfc26 744typedef struct {\r
745 SAL_SEC_HEADER SectionHeader;\r
746 UINT64 ValidationBits;\r
747 UINT64 PciBusErrorStatus;\r
748 UINT16 PciBusErrorType;\r
749 PCI_BUS_ID PciBusId;\r
750 UINT32 Reserved;\r
751 UINT64 PciBusAddress;\r
752 UINT64 PciBusData;\r
753 UINT64 PciBusCommand;\r
754 UINT64 PciBusRequestorId;\r
755 UINT64 PciBusResponderId;\r
756 UINT64 PciBusTargetId;\r
757 UINT8 PciBusOemId[16];\r
758} SAL_PCI_BUS_ERROR_RECORD;\r
759\r
4135253b 760///\r
af2dc6a7 761/// GUID of Platform PCI Component Error Info.\r
4135253b 762///\r
540dfc26 763#define SAL_PCI_COMP_ERROR_RECORD_INFO \\r
764 { \\r
765 0xe429faf6, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
766 }\r
4135253b 767//\r
768// Bit masks for SAL_PCI_COMPONENT_ERROR_RECORD.ValidationBits\r
769//\r
540dfc26 770#define PCI_COMP_ERROR_STATUS_VALID_BIT_MASK 0x1\r
771#define PCI_COMP_INFO_VALID_BIT_MASK 0x2\r
772#define PCI_COMP_MEM_NUM_VALID_BIT_MASK 0x4\r
773#define PCI_COMP_IO_NUM_VALID_BIT_MASK 0x8\r
774#define PCI_COMP_REG_DATA_PAIR_VALID_BIT_MASK 0x10\r
775#define PCI_COMP_OEM_DATA_STRUCT_VALID_BIT_MASK 0x20\r
4135253b 776///\r
af2dc6a7 777/// Format of PCI Component Information to identify the device.\r
4135253b 778///\r
540dfc26 779typedef struct {\r
780 UINT16 VendorId;\r
781 UINT16 DeviceId;\r
782 UINT8 ClassCode[3];\r
783 UINT8 FunctionNumber;\r
784 UINT8 DeviceNumber;\r
785 UINT8 BusNumber;\r
786 UINT8 SegmentNumber;\r
787 UINT8 Reserved[5];\r
788} PCI_COMP_INFO;\r
4135253b 789///\r
af2dc6a7 790/// Definition of Platform PCI Component Error Info.\r
4135253b 791///\r
540dfc26 792typedef struct {\r
793 SAL_SEC_HEADER SectionHeader;\r
794 UINT64 ValidationBits;\r
795 UINT64 PciComponentErrorStatus;\r
796 PCI_COMP_INFO PciComponentInfo;\r
797 UINT32 PciComponentMemNum;\r
798 UINT32 PciComponentIoNum;\r
799 UINT8 PciBusOemId[16];\r
800} SAL_PCI_COMPONENT_ERROR_RECORD;\r
801\r
4135253b 802///\r
af2dc6a7 803/// Platform SEL Device Error Info.\r
4135253b 804///\r
805#define SAL_SEL_DEVICE_ERROR_RECORD_INFO \\r
540dfc26 806 { \\r
807 0xe429faf3, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
808 }\r
4135253b 809//\r
810// Bit masks for SAL_SEL_DEVICE_ERROR_RECORD.ValidationBits\r
811//\r
540dfc26 812#define SEL_RECORD_ID_VALID_BIT_MASK 0x1;\r
813#define SEL_RECORD_TYPE_VALID_BIT_MASK 0x2;\r
814#define SEL_GENERATOR_ID_VALID_BIT_MASK 0x4;\r
815#define SEL_EVM_REV_VALID_BIT_MASK 0x8;\r
816#define SEL_SENSOR_TYPE_VALID_BIT_MASK 0x10;\r
817#define SEL_SENSOR_NUM_VALID_BIT_MASK 0x20;\r
818#define SEL_EVENT_DIR_TYPE_VALID_BIT_MASK 0x40;\r
819#define SEL_EVENT_DATA1_VALID_BIT_MASK 0x80;\r
820#define SEL_EVENT_DATA2_VALID_BIT_MASK 0x100;\r
821#define SEL_EVENT_DATA3_VALID_BIT_MASK 0x200;\r
4135253b 822///\r
af2dc6a7 823/// Definition of Platform SEL Device Error Info Record.\r
4135253b 824///\r
540dfc26 825typedef struct {\r
826 SAL_SEC_HEADER SectionHeader;\r
827 UINT64 ValidationBits;\r
828 UINT16 SelRecordId;\r
829 UINT8 SelRecordType;\r
830 UINT32 TimeStamp;\r
831 UINT16 GeneratorId;\r
832 UINT8 EvmRevision;\r
833 UINT8 SensorType;\r
834 UINT8 SensorNum;\r
835 UINT8 EventDirType;\r
836 UINT8 Data1;\r
837 UINT8 Data2;\r
838 UINT8 Data3;\r
4135253b 839} SAL_SEL_DEVICE_ERROR_RECORD;\r
540dfc26 840\r
4135253b 841///\r
af2dc6a7 842/// GUID of Platform SMBIOS Device Error Info.\r
4135253b 843///\r
540dfc26 844#define SAL_SMBIOS_ERROR_RECORD_INFO \\r
845 { \\r
846 0xe429faf5, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
847 }\r
4135253b 848//\r
849// Bit masks for SAL_SMBIOS_DEVICE_ERROR_RECORD.ValidationBits\r
850//\r
540dfc26 851#define SMBIOS_EVENT_TYPE_VALID_BIT_MASK 0x1\r
852#define SMBIOS_LENGTH_VALID_BIT_MASK 0x2\r
853#define SMBIOS_TIME_STAMP_VALID_BIT_MASK 0x4\r
854#define SMBIOS_DATA_VALID_BIT_MASK 0x8\r
4135253b 855///\r
af2dc6a7 856/// Definition of Platform SMBIOS Device Error Info Record.\r
4135253b 857///\r
540dfc26 858typedef struct {\r
859 SAL_SEC_HEADER SectionHeader;\r
860 UINT64 ValidationBits;\r
861 UINT8 SmbiosEventType;\r
862 UINT8 SmbiosLength;\r
863 UINT8 SmbiosBcdTimeStamp[6];\r
864} SAL_SMBIOS_DEVICE_ERROR_RECORD;\r
865\r
1bc5d021 866///\r
af2dc6a7 867/// GUID of Platform Specific Error Info.\r
1bc5d021 868///\r
540dfc26 869#define SAL_PLATFORM_ERROR_RECORD_INFO \\r
870 { \\r
871 0xe429faf7, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
872 }\r
4135253b 873//\r
874// Bit masks for SAL_PLATFORM_SPECIFIC_ERROR_RECORD.ValidationBits\r
875//\r
540dfc26 876#define PLATFORM_ERROR_STATUS_VALID_BIT_MASK 0x1\r
877#define PLATFORM_REQUESTOR_ID_VALID_BIT_MASK 0x2\r
878#define PLATFORM_RESPONDER_ID_VALID_BIT_MASK 0x4\r
879#define PLATFORM_TARGET_VALID_BIT_MASK 0x8\r
880#define PLATFORM_SPECIFIC_DATA_VALID_BIT_MASK 0x10\r
881#define PLATFORM_OEM_ID_VALID_BIT_MASK 0x20\r
882#define PLATFORM_OEM_DATA_STRUCT_VALID_BIT_MASK 0x40\r
883#define PLATFORM_OEM_DEVICE_PATH_VALID_BIT_MASK 0x80\r
4135253b 884///\r
af2dc6a7 885/// Definition of Platform Specific Error Info Record.\r
4135253b 886///\r
540dfc26 887typedef struct {\r
888 SAL_SEC_HEADER SectionHeader;\r
889 UINT64 ValidationBits;\r
890 UINT64 PlatformErrorStatus;\r
891 UINT64 PlatformRequestorId;\r
892 UINT64 PlatformResponderId;\r
893 UINT64 PlatformTargetId;\r
894 UINT64 PlatformBusSpecificData;\r
895 UINT8 OemComponentId[16];\r
896} SAL_PLATFORM_SPECIFIC_ERROR_RECORD;\r
897\r
1bc5d021 898///\r
af2dc6a7 899/// Union of all the possible SAL Error Record Types.\r
1bc5d021 900///\r
540dfc26 901typedef union {\r
902 SAL_RECORD_HEADER *RecordHeader;\r
903 SAL_PROCESSOR_ERROR_RECORD *SalProcessorRecord;\r
904 SAL_PCI_BUS_ERROR_RECORD *SalPciBusRecord;\r
905 SAL_PCI_COMPONENT_ERROR_RECORD *SalPciComponentRecord;\r
4135253b 906 SAL_SEL_DEVICE_ERROR_RECORD *ImpiRecord;\r
540dfc26 907 SAL_SMBIOS_DEVICE_ERROR_RECORD *SmbiosRecord;\r
908 SAL_PLATFORM_SPECIFIC_ERROR_RECORD *PlatformRecord;\r
909 SAL_MEMORY_ERROR_RECORD *MemoryRecord;\r
910 UINT8 *Raw;\r
911} SAL_ERROR_RECORDS_POINTERS;\r
912\r
766f4bc1 913#pragma pack()\r
914\r
540dfc26 915#endif\r