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