2 This PEIM initialize FSP.
4 Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "FspInitPei.h"
13 This is the entrypoint of PEIM
15 @param[in] FileHandle Handle of the file being invoked.
16 @param[in] PeiServices Describes the list of possible PEI Services.
18 @retval EFI_SUCCESS if it completed successfully.
23 IN EFI_PEI_FILE_HANDLE FileHandle
,
24 IN CONST EFI_PEI_SERVICES
**PeiServices
27 FSP_INFO_HEADER
*FspHeader
;
28 UINT8 PcdFspApiVersion
;
30 DEBUG ((DEBUG_INFO
, "FspPeiEntryPoint\n"));
33 FspHeader
= FspFindFspHeader (PcdGet32 (PcdFlashFvFspBase
));
34 DEBUG ((DEBUG_INFO
, "FspHeader - 0x%x\n", FspHeader
));
35 if (FspHeader
== NULL
) {
36 return EFI_DEVICE_ERROR
;
39 ASSERT (FspHeader
->TempRamInitEntryOffset
!= 0);
40 ASSERT (FspHeader
->FspInitEntryOffset
!= 0);
41 ASSERT (FspHeader
->NotifyPhaseEntryOffset
!= 0);
43 if ((PcdGet8 (PcdFspApiVersion
) >= 2) &&
44 (FspHeader
->HeaderRevision
>= FSP_HEADER_REVISION_2
) &&
45 (FspHeader
->ApiEntryNum
>= 6) ) {
46 ASSERT (FspHeader
->FspMemoryInitEntryOffset
!= 0);
47 ASSERT (FspHeader
->TempRamExitEntryOffset
!= 0);
48 ASSERT (FspHeader
->FspSiliconInitEntryOffset
!= 0);
49 PcdFspApiVersion
= PcdGet8 (PcdFspApiVersion
);
51 DEBUG ((DEBUG_INFO
, "PcdFspApiVersion - 0x%x\n", PcdFspApiVersion
));
53 if (PcdFspApiVersion
== 1) {
54 PeiFspInitV1 (FspHeader
);
56 PeiFspInitV2 (FspHeader
);