2 Source file for FSP notify phase PEI module
4 Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
8 #include "FspNotifyPhasePeim.h"
12 This function waits for FSP notify.
14 @param This Entry point for DXE IPL PPI.
15 @param PeiServices General purpose services available to every PEIM.
16 @param HobList Address to the Pei HOB list.
18 @return EFI_SUCCESS This function never returns.
24 IN CONST EFI_DXE_IPL_PPI
*This
,
25 IN EFI_PEI_SERVICES
**PeiServices
,
26 IN EFI_PEI_HOB_POINTERS HobList
29 CONST EFI_DXE_IPL_PPI mDxeIplPpi
= {
33 CONST EFI_PEI_PPI_DESCRIPTOR mInstallDxeIplPpi
= {
34 EFI_PEI_PPI_DESCRIPTOR_PPI
,
39 CONST EFI_PEI_PPI_DESCRIPTOR gEndOfPeiSignalPpi
= {
40 (EFI_PEI_PPI_DESCRIPTOR_PPI
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
),
41 &gEfiEndOfPeiSignalPpiGuid
,
45 CONST EFI_PEI_PPI_DESCRIPTOR gFspReadyForNotifyPhasePpi
= {
46 (EFI_PEI_PPI_DESCRIPTOR_PPI
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
),
47 &gFspReadyForNotifyPhasePpiGuid
,
53 This function waits for FSP notify.
55 @param This Entry point for DXE IPL PPI.
56 @param PeiServices General purpose services available to every PEIM.
57 @param HobList Address to the Pei HOB list.
59 @return EFI_SUCCESS This function never returns.
65 IN CONST EFI_DXE_IPL_PPI
*This
,
66 IN EFI_PEI_SERVICES
**PeiServices
,
67 IN EFI_PEI_HOB_POINTERS HobList
72 DEBUG ((DEBUG_INFO
| DEBUG_INIT
, "FSP HOB is located at 0x%08X\n", HobList
));
75 // End of PEI phase signal
77 Status
= PeiServicesInstallPpi (&gEndOfPeiSignalPpi
);
78 ASSERT_EFI_ERROR (Status
);
81 // Give control back to BootLoader after FspSiliconInit
83 DEBUG ((DEBUG_INFO
| DEBUG_INIT
, "FSP is waiting for NOTIFY\n"));
84 FspSiliconInitDone2 (EFI_SUCCESS
);
87 // BootLoader called FSP again through NotifyPhase
91 if (GetFspGlobalDataPointer ()->FspMode
== FSP_IN_API_MODE
) {
93 // Should not come here
96 DEBUG ((DEBUG_ERROR
, "No FSP API should be called after FSP is DONE!\n"));
97 SetFspApiReturnStatus (EFI_UNSUPPORTED
);
98 Pei2LoaderSwitchStack ();
106 FSP notify phase PEI module entry point
108 @param[in] FileHandle Not used.
109 @param[in] PeiServices General purpose services available to every PEIM.
111 @retval EFI_SUCCESS The function completes successfully
112 @retval EFI_OUT_OF_RESOURCES Insufficient resources to create database
116 FspNotifyPhasePeimEntryPoint (
117 IN EFI_PEI_FILE_HANDLE FileHandle
,
118 IN CONST EFI_PEI_SERVICES
**PeiServices
123 EFI_PEI_PPI_DESCRIPTOR
*OldDescriptor
;
125 DEBUG ((DEBUG_INFO
| DEBUG_INIT
, "The entry of FspNotificationPeim\n"));
127 if (GetFspGlobalDataPointer ()->FspMode
== FSP_IN_API_MODE
) {
129 // Locate old DXE IPL PPI
131 Status
= PeiServicesLocatePpi (
137 ASSERT_EFI_ERROR (Status
);
140 // Re-install the DXE IPL PPI to wait for notify
142 Status
= PeiServicesReInstallPpi (OldDescriptor
, &mInstallDxeIplPpi
);
143 ASSERT_EFI_ERROR (Status
);
145 Status
= PeiServicesInstallPpi (&gFspReadyForNotifyPhasePpi
);
146 ASSERT_EFI_ERROR (Status
);