2 This PEIM initialize FSP.
4 Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include "FspInitPei.h"
19 This is the entrypoint of PEIM
21 @param[in] FileHandle Handle of the file being invoked.
22 @param[in] PeiServices Describes the list of possible PEI Services.
24 @retval EFI_SUCCESS if it completed successfully.
29 IN EFI_PEI_FILE_HANDLE FileHandle
,
30 IN CONST EFI_PEI_SERVICES
**PeiServices
33 FSP_INFO_HEADER
*FspHeader
;
34 UINT8 PcdFspApiVersion
;
36 DEBUG ((DEBUG_INFO
, "FspPeiEntryPoint\n"));
39 FspHeader
= FspFindFspHeader (PcdGet32 (PcdFlashFvFspBase
));
40 DEBUG ((DEBUG_INFO
, "FspHeader - 0x%x\n", FspHeader
));
41 if (FspHeader
== NULL
) {
42 return EFI_DEVICE_ERROR
;
45 ASSERT (FspHeader
->TempRamInitEntryOffset
!= 0);
46 ASSERT (FspHeader
->FspInitEntryOffset
!= 0);
47 ASSERT (FspHeader
->NotifyPhaseEntryOffset
!= 0);
49 if ((PcdGet8 (PcdFspApiVersion
) >= 2) &&
50 (FspHeader
->HeaderRevision
>= FSP_HEADER_REVISION_2
) &&
51 (FspHeader
->ApiEntryNum
>= 6) ) {
52 ASSERT (FspHeader
->FspMemoryInitEntryOffset
!= 0);
53 ASSERT (FspHeader
->TempRamExitEntryOffset
!= 0);
54 ASSERT (FspHeader
->FspSiliconInitEntryOffset
!= 0);
55 PcdFspApiVersion
= PcdGet8 (PcdFspApiVersion
);
57 DEBUG ((DEBUG_INFO
, "PcdFspApiVersion - 0x%x\n", PcdFspApiVersion
));
59 if (PcdFspApiVersion
== 1) {
60 PeiFspInitV1 (FspHeader
);
62 PeiFspInitV2 (FspHeader
);