]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFsp2Pkg/Include/Library/FspSecPlatformLib.h
c91ea4a78ff1ebb17252430319dc64fce3153add
[mirror_edk2.git] / IntelFsp2Pkg / Include / Library / FspSecPlatformLib.h
1 /** @file
2
3 Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
5
6 **/
7
8 #ifndef _FSP_SEC_PLATFORM_LIB_H_
9 #define _FSP_SEC_PLATFORM_LIB_H_
10
11 /**
12 This function performs platform level initialization.
13
14 This function must be in ASM file, because stack is not established yet.
15 This function is optional. If a library instance does not provide this function, the default empty one will be used.
16
17 The callee should not use XMM6/XMM7.
18 The return address is saved in MM7.
19
20 @retval in saved in EAX - 0 means platform initialization success.
21 other means platform initialization fail.
22 **/
23 UINT32
24 EFIAPI
25 SecPlatformInit (
26 VOID
27 );
28
29 /**
30 This function loads Microcode.
31
32 This function must be in ASM file, because stack is not established yet.
33 This function is optional. If a library instance does not provide this function, the default one will be used.
34
35 The callee should not use XMM6/XMM7.
36 The return address is saved in MM7.
37
38 @param[in] FsptUpdDataPtr Address pointer to the FSPT_UPD data structure. It is saved in ESP.
39
40 @retval in saved in EAX - 0 means Microcode is loaded successfully.
41 other means Microcode is not loaded successfully.
42 **/
43 UINT32
44 EFIAPI
45 LoadMicrocode (
46 IN VOID *FsptUpdDataPtr
47 );
48
49 /**
50 This function initializes the CAR.
51
52 This function must be in ASM file, because stack is not established yet.
53
54 The callee should not use XMM6/XMM7.
55 The return address is saved in MM7.
56
57 @param[in] FsptUpdDataPtr Address pointer to the FSPT_UPD data structure. It is saved in ESP.
58
59 @retval in saved in EAX - 0 means CAR initialization success.
60 other means CAR initialization fail.
61 **/
62 UINT32
63 EFIAPI
64 SecCarInit (
65 IN VOID *FsptUpdDataPtr
66 );
67
68 /**
69 This function check the signature of UPD.
70
71 @param[in] ApiIdx Internal index of the FSP API.
72 @param[in] ApiParam Parameter of the FSP API.
73
74 **/
75 EFI_STATUS
76 EFIAPI
77 FspUpdSignatureCheck (
78 IN UINT32 ApiIdx,
79 IN VOID *ApiParam
80 );
81
82 /**
83 This function handles FspMultiPhaseSiInitApi.
84 Starting from FSP 2.4 this function is obsolete and FspMultiPhaseSiInitApiHandlerV2 is the replacement.
85
86 @param[in] ApiIdx Internal index of the FSP API.
87 @param[in] ApiParam Parameter of the FSP API.
88
89 **/
90 EFI_STATUS
91 EFIAPI
92 FspMultiPhaseSiInitApiHandler (
93 IN UINT32 ApiIdx,
94 IN VOID *ApiParam
95 );
96
97 /**
98 FSP MultiPhase Platform Get Number Of Phases Function.
99
100 Allows an FSP binary to dynamically update the number of phases at runtime.
101 For example, UPD settings could negate the need to enter the multi-phase flow
102 in certain scenarios. If this function returns FALSE, the default number of phases
103 provided by PcdMultiPhaseNumberOfPhases will be returned to the bootloader instead.
104
105 @param[in] ApiIdx - Internal index of the FSP API.
106 @param[in] NumberOfPhasesSupported - How many phases are supported by current FSP Component.
107
108 @retval TRUE - NumberOfPhases are modified by Platform during runtime.
109 @retval FALSE - The Default build time NumberOfPhases should be used.
110
111 **/
112 BOOLEAN
113 EFIAPI
114 FspMultiPhasePlatformGetNumberOfPhases (
115 IN UINTN ApiIdx,
116 IN OUT UINT32 *NumberOfPhasesSupported
117 );
118
119 #endif