3 Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php.
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 This function check the FSP API calling condition.
20 @param[in] ApiIdx Internal index of the FSP API.
21 @param[in] ApiParam Parameter of the FSP API.
32 FSP_GLOBAL_DATA
*FspData
;
35 FspData
= GetFspGlobalDataPointer ();
37 if (ApiIdx
== NotifyPhaseApiIndex
) {
41 if ((FspData
== NULL
) || ((UINT32
)FspData
== 0xFFFFFFFF)) {
42 Status
= EFI_UNSUPPORTED
;
44 if (FspData
->Signature
!= FSP_GLOBAL_DATA_SIGNATURE
) {
45 Status
= EFI_UNSUPPORTED
;
48 } else if (ApiIdx
== FspMemoryInitApiIndex
) {
50 // FspMemoryInit check
52 if ((UINT32
)FspData
!= 0xFFFFFFFF) {
53 Status
= EFI_UNSUPPORTED
;
54 } else if (EFI_ERROR (FspUpdSignatureCheck (ApiIdx
, ApiParam
))) {
55 Status
= EFI_INVALID_PARAMETER
;
57 } else if (ApiIdx
== TempRamExitApiIndex
) {
61 if ((FspData
== NULL
) || ((UINT32
)FspData
== 0xFFFFFFFF)) {
62 Status
= EFI_UNSUPPORTED
;
64 if (FspData
->Signature
!= FSP_GLOBAL_DATA_SIGNATURE
) {
65 Status
= EFI_UNSUPPORTED
;
68 } else if (ApiIdx
== FspSiliconInitApiIndex
) {
70 // FspSiliconInit check
72 if ((FspData
== NULL
) || ((UINT32
)FspData
== 0xFFFFFFFF)) {
73 Status
= EFI_UNSUPPORTED
;
75 if (FspData
->Signature
!= FSP_GLOBAL_DATA_SIGNATURE
) {
76 Status
= EFI_UNSUPPORTED
;
77 } else if (EFI_ERROR (FspUpdSignatureCheck (ApiIdx
, ApiParam
))) {
78 Status
= EFI_INVALID_PARAMETER
;
82 Status
= EFI_UNSUPPORTED
;
85 if (!EFI_ERROR (Status
)) {
86 if ((ApiIdx
!= FspMemoryInitApiIndex
)) {
88 // For FspMemoryInit, the global data is not valid yet
89 // The API index will be updated by SecCore after the global data
92 SetFspApiCallingIndex (ApiIdx
);