TianoCore EDK2 master
Loading...
Searching...
No Matches
FspApi.h
Go to the documentation of this file.
1
10#ifndef _FSP_API_H_
11#define _FSP_API_H_
12
13#include <Pi/PiStatusCode.h>
14#include <Base.h>
15
20
21#define ENCODE_RESET_REQUEST(ResetType) \
22 ((EFI_STATUS)((MAX_BIT >> 1) | (ResetType)))
23#define FSP_STATUS_RESET_REQUIRED_COLD ENCODE_RESET_REQUEST(1)
24#define FSP_STATUS_RESET_REQUIRED_WARM ENCODE_RESET_REQUEST(2)
25#define FSP_STATUS_RESET_REQUIRED_3 ENCODE_RESET_REQUEST(3)
26#define FSP_STATUS_RESET_REQUIRED_4 ENCODE_RESET_REQUEST(4)
27#define FSP_STATUS_RESET_REQUIRED_5 ENCODE_RESET_REQUEST(5)
28#define FSP_STATUS_RESET_REQUIRED_6 ENCODE_RESET_REQUEST(6)
29#define FSP_STATUS_RESET_REQUIRED_7 ENCODE_RESET_REQUEST(7)
30#define FSP_STATUS_RESET_REQUIRED_8 ENCODE_RESET_REQUEST(8)
31#define FSP_STATUS_VARIABLE_REQUEST ENCODE_RESET_REQUEST(10)
33
37#define FSP_EVENT_CODE 0xF5000000
38#define FSP_POST_CODE (FSP_EVENT_CODE | 0x00F80000)
39
40/*
41 FSP may optionally include the capability of generating events messages to aid in the debugging of firmware issues.
42 These events fall under three catagories: Error, Progress, and Debug. The event reporting mechanism follows the
43 status code services described in section 6 and 7 of the PI Specification v1.7 Volume 3.
44
45 @param[in] Type Indicates the type of event being reported.
46 See MdePkg/Include/Pi/PiStatusCode.h for the definition of EFI_STATUS_CODE_TYPE.
47 @param[in] Value Describes the current status of a hardware or software entity.
48 This includes information about the class and subclass that is used to classify the entity as well as an operation.
49 For progress events, the operation is the current activity. For error events, it is the exception.
50 For debug events, it is not defined at this time.
51 See MdePkg/Include/Pi/PiStatusCode.h for the definition of EFI_STATUS_CODE_VALUE.
52 @param[in] Instance The enumeration of a hardware or software entity within the system.
53 A system may contain multiple entities that match a class/subclass pairing. The instance differentiates between them.
54 An instance of 0 indicates that instance information is unavailable, not meaningful, or not relevant.
55 Valid instance numbers start with 1.
56 @param[in] *CallerId This parameter can be used to identify the sub-module within the FSP generating the event.
57 This parameter may be NULL.
58 @param[in] *Data This optional parameter may be used to pass additional data. The contents can have event-specific data.
59 For example, the FSP provides a EFI_STATUS_CODE_STRING_DATA instance to this parameter when sending debug messages.
60 This parameter is NULL when no additional data is provided.
61
62 @retval EFI_SUCCESS The event was handled successfully.
63 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
64 @retval EFI_DEVICE_ERROR The event handler failed.
65*/
66typedef
68(EFIAPI *FSP_EVENT_HANDLER)(
71 IN UINT32 Instance,
72 IN OPTIONAL EFI_GUID *CallerId,
73 IN OPTIONAL EFI_STATUS_CODE_DATA *Data
74 );
75
76/*
77 Handler for FSP-T debug log messages, provided by the bootloader.
78
79 @param[in] DebugMessage A pointer to the debug message to be written to the log.
80 @param[in] MessageLength Number of bytes to written to the debug log.
81
82 @retval UINT32 The return value indicates the number of bytes actually written to
83 the debug log. If the return value is less than MessageLength,
84 an error occurred.
85*/
86typedef
87UINT32
88(EFIAPI *FSP_DEBUG_HANDLER)(
89 IN CHAR8 *DebugMessage,
90 IN UINT32 MessageLength
91 );
92
93#pragma pack(1)
97typedef struct {
106 UINT64 Signature;
112 UINT8 Revision;
113 UINT8 Reserved[23];
115
119typedef struct {
123 UINT8 Revision;
124 UINT8 Reserved[3];
128 UINT32 Length;
133 FSP_DEBUG_HANDLER FspDebugHandler;
134 UINT8 Reserved1[20];
136
140typedef struct {
144 UINT8 Revision;
145 UINT8 Reserved[3];
149 UINT32 Length;
163 UINT8 Reserved1[12];
165
169typedef struct {
173 UINT8 Revision;
174 UINT8 Reserved[3];
189 UINT32 StackSize;
198 UINT32 BootMode;
203 FSP_EVENT_HANDLER *FspEventHandler;
204 UINT8 Reserved1[4];
206
210typedef struct {
214 UINT8 Revision;
215 UINT8 Reserved[3];
219 UINT32 Length;
236 UINT64 StackSize;
245 UINT32 BootMode;
251 UINT8 Reserved1[16];
253
257typedef struct {
261 UINT8 Revision;
262 UINT8 Reserved[3];
266 UINT32 Length;
271 FSP_EVENT_HANDLER FspEventHandler;
280 UINT8 Reserved1[19];
282
286typedef struct {
290 UINT8 Revision;
291 UINT8 Reserved[3];
295 UINT32 Length;
301 UINT8 Reserved1[16];
303
307typedef struct {
311 UINT8 Revision;
312 UINT8 Reserved[3];
316 UINT32 Length;
335 UINT8 Reserved1[30];
337
341typedef struct {
347
351typedef struct {
356
362
366typedef struct {
371
377
381typedef struct {
391
395typedef struct {
405
409typedef struct {
415
419typedef struct {
424
430
434typedef struct {
439
445
449typedef struct {
454
460
464typedef enum {
483
487typedef struct {
493
497typedef enum {
498 EnumMultiPhaseGetNumberOfPhases = 0x0,
499 EnumMultiPhaseExecutePhase = 0x1,
500 EnumMultiPhaseGetVariableRequestInfo = 0x2,
501 EnumMultiPhaseCompleteVariableRequest = 0x3
503
504typedef enum {
505 EnumFspVariableRequestGetVariable = 0x0,
506 EnumFspVariableRequestGetNextVariableName = 0x1,
507 EnumFspVariableRequestSetVariable = 0x2,
508 EnumFspVariableRequestQueryVariableInfo = 0x3
509} FSP_VARIABLE_REQUEST_TYPE;
510
511#pragma pack(16)
512typedef struct {
513 IN FSP_VARIABLE_REQUEST_TYPE VariableRequest;
514 IN OUT CHAR16 *VariableName;
515 IN OUT UINT64 *VariableNameSize;
516 IN OUT EFI_GUID *VariableGuid;
517 IN OUT UINT32 *Attributes;
518 IN OUT UINT64 *DataSize;
519 IN OUT VOID *Data;
520 OUT UINT64 *MaximumVariableStorageSize;
521 OUT UINT64 *RemainingVariableStorageSize;
522 OUT UINT64 *MaximumVariableSize;
524
525typedef struct {
526 EFI_STATUS VariableRequestStatus;
528#pragma pack()
529
534typedef struct {
535 UINT32 NumberOfPhases;
536 UINT32 PhasesExecuted;
538
550typedef struct {
551 IN FSP_MULTI_PHASE_ACTION MultiPhaseAction;
552 IN UINT32 PhaseIndex;
553 IN OUT VOID *MultiPhaseParamPtr;
555
556#pragma pack()
557
587typedef
589(EFIAPI *FSP_TEMP_RAM_INIT)(
590 IN VOID *FsptUpdDataPtr
591 );
592
607typedef
609(EFIAPI *FSP_NOTIFY_PHASE)(
610 IN NOTIFY_PHASE_PARAMS *NotifyPhaseParamPtr
611 );
612
635typedef
637(EFIAPI *FSP_MEMORY_INIT)(
638 IN VOID *FspmUpdDataPtr,
639 OUT VOID **HobListPtr
640 );
641
660typedef
662(EFIAPI *FSP_TEMP_RAM_EXIT)(
663 IN VOID *TempRamExitParamPtr
664 );
665
680typedef
682(EFIAPI *FSP_SILICON_INIT)(
683 IN VOID *FspsUpdDataPtr
684 );
685
704typedef
707 IN FSP_MULTI_PHASE_PARAMS *MultiPhaseSiInitParamPtr
708 );
709
723typedef
725(EFIAPI *FSP_SMM_INIT)(
726 IN VOID *FspiUpdDataPtr
727 );
728
753typedef
755(EFIAPI *FSP_MULTI_PHASE_INIT)(
756 IN FSP_MULTI_PHASE_PARAMS *MultiPhaseInitParamPtr
757 );
758
759#endif
EFI_STATUS(EFIAPI * FSP_MULTI_PHASE_SI_INIT)(IN FSP_MULTI_PHASE_PARAMS *MultiPhaseSiInitParamPtr)
Definition: FspApi.h:706
FSP_INIT_PHASE
Definition: FspApi.h:464
@ EnumInitPhaseAfterPciEnumeration
Definition: FspApi.h:470
@ EnumInitPhaseReadyToBoot
Definition: FspApi.h:475
@ EnumInitPhaseEndOfFirmware
Definition: FspApi.h:481
EFI_STATUS(EFIAPI * FSP_SMM_INIT)(IN VOID *FspiUpdDataPtr)
Definition: FspApi.h:725
EFI_STATUS(EFIAPI * FSP_NOTIFY_PHASE)(IN NOTIFY_PHASE_PARAMS *NotifyPhaseParamPtr)
Definition: FspApi.h:609
EFI_STATUS(EFIAPI * FSP_TEMP_RAM_INIT)(IN VOID *FsptUpdDataPtr)
Definition: FspApi.h:589
EFI_STATUS(EFIAPI * FSP_MULTI_PHASE_INIT)(IN FSP_MULTI_PHASE_PARAMS *MultiPhaseInitParamPtr)
Definition: FspApi.h:755
EFI_STATUS(EFIAPI * FSP_MEMORY_INIT)(IN VOID *FspmUpdDataPtr, OUT VOID **HobListPtr)
Definition: FspApi.h:637
EFI_STATUS(EFIAPI * FSP_TEMP_RAM_EXIT)(IN VOID *TempRamExitParamPtr)
Definition: FspApi.h:662
EFI_STATUS(EFIAPI * FSP_SILICON_INIT)(IN VOID *FspsUpdDataPtr)
Definition: FspApi.h:682
FSP_MULTI_PHASE_ACTION
Definition: FspApi.h:497
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT32 EFI_STATUS_CODE_VALUE
Definition: PiStatusCode.h:67
UINT32 EFI_STATUS_CODE_TYPE
Definition: PiStatusCode.h:24
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
UINT64 Signature
Definition: FspApi.h:106
UINT8 Revision
Definition: FspApi.h:112
EFI_PHYSICAL_ADDRESS BootloaderSmmFvContextData
Definition: FspApi.h:329
UINT16 BootloaderSmmFvContextDataLength
Definition: FspApi.h:334
UINT32 Length
Definition: FspApi.h:316
EFI_PHYSICAL_ADDRESS BootloaderSmmFvBaseAddress
Definition: FspApi.h:320
UINT64 BootloaderSmmFvLength
Definition: FspApi.h:324
UINT8 Revision
Definition: FspApi.h:311
FSP_UPD_HEADER FspUpdHeader
Definition: FspApi.h:453
FSPI_ARCH_UPD FspiArchUpd
Definition: FspApi.h:458
UINT8 Revision
Definition: FspApi.h:214
UINT32 BootLoaderTolumSize
Definition: FspApi.h:241
EFI_PHYSICAL_ADDRESS NvsBufferPtr
Definition: FspApi.h:226
UINT32 BootMode
Definition: FspApi.h:245
UINT64 StackSize
Definition: FspApi.h:236
EFI_PHYSICAL_ADDRESS FspEventHandler
Definition: FspApi.h:250
EFI_PHYSICAL_ADDRESS StackBase
Definition: FspApi.h:231
UINT32 Length
Definition: FspApi.h:219
UINT32 StackSize
Definition: FspApi.h:189
FSP_EVENT_HANDLER * FspEventHandler
Definition: FspApi.h:203
VOID * NvsBufferPtr
Definition: FspApi.h:179
UINT8 Revision
Definition: FspApi.h:173
VOID * StackBase
Definition: FspApi.h:184
UINT32 BootMode
Definition: FspApi.h:198
UINT32 BootLoaderTolumSize
Definition: FspApi.h:194
FSPM_ARCH2_UPD FspmArchUpd
Definition: FspApi.h:403
FSP_UPD_HEADER FspUpdHeader
Definition: FspApi.h:399
FSPM_ARCH_UPD FspmArchUpd
Definition: FspApi.h:389
FSP_UPD_HEADER FspUpdHeader
Definition: FspApi.h:385
UINT8 Revision
Definition: FspApi.h:290
EFI_PHYSICAL_ADDRESS FspEventHandler
Definition: FspApi.h:300
UINT32 Length
Definition: FspApi.h:295
UINT8 EnableMultiPhaseSiliconInit
Definition: FspApi.h:279
UINT32 Length
Definition: FspApi.h:266
UINT8 Revision
Definition: FspApi.h:261
FSP_EVENT_HANDLER FspEventHandler
Definition: FspApi.h:271
FSPS_ARCH_UPD FspsArchUpd
Definition: FspApi.h:428
FSP_UPD_HEADER FspUpdHeader
Definition: FspApi.h:423
FSPS_ARCH2_UPD FspsArchUpd
Definition: FspApi.h:443
FSP_UPD_HEADER FspUpdHeader
Definition: FspApi.h:438
FSP_UPD_HEADER FspUpdHeader
Definition: FspApi.h:413
EFI_PHYSICAL_ADDRESS FspDebugHandler
Definition: FspApi.h:154
UINT32 FspTemporaryRamSize
Definition: FspApi.h:162
UINT8 Revision
Definition: FspApi.h:144
UINT32 Length
Definition: FspApi.h:149
UINT32 Length
Definition: FspApi.h:128
FSP_DEBUG_HANDLER FspDebugHandler
Definition: FspApi.h:133
UINT8 Revision
Definition: FspApi.h:123
FSPT_ARCH_UPD FsptArchUpd
Definition: FspApi.h:360
FSP_UPD_HEADER FspUpdHeader
Definition: FspApi.h:355
FSPT_ARCH2_UPD FsptArchUpd
Definition: FspApi.h:375
FSP_UPD_HEADER FspUpdHeader
Definition: FspApi.h:370
FSP_UPD_HEADER FspUpdHeader
Definition: FspApi.h:345
Definition: Base.h:213
FSP_INIT_PHASE Phase
Definition: FspApi.h:491