2 Source file for FSP notify phase PEI module
4 Copyright (c) 2016, Intel Corporation. All rights reserved.
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.
14 #include "FspNotifyPhasePeim.h"
18 This function waits for FSP notify.
20 @param This Entry point for DXE IPL PPI.
21 @param PeiServices General purpose services available to every PEIM.
22 @param HobList Address to the Pei HOB list.
24 @return EFI_SUCCESS This function never returns.
30 IN CONST EFI_DXE_IPL_PPI
*This
,
31 IN EFI_PEI_SERVICES
**PeiServices
,
32 IN EFI_PEI_HOB_POINTERS HobList
35 CONST EFI_DXE_IPL_PPI mDxeIplPpi
= {
39 CONST EFI_PEI_PPI_DESCRIPTOR mInstallDxeIplPpi
= {
40 EFI_PEI_PPI_DESCRIPTOR_PPI
,
45 CONST EFI_PEI_PPI_DESCRIPTOR gEndOfPeiSignalPpi
= {
46 (EFI_PEI_PPI_DESCRIPTOR_PPI
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
),
47 &gEfiEndOfPeiSignalPpiGuid
,
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
92 // Should not come here
95 DEBUG ((DEBUG_ERROR
, "No FSP API should be called after FSP is DONE!\n"));
96 SetFspApiReturnStatus (EFI_UNSUPPORTED
);
97 Pei2LoaderSwitchStack ();
104 FSP notify phase PEI module entry point
106 @param[in] FileHandle Not used.
107 @param[in] PeiServices General purpose services available to every PEIM.
109 @retval EFI_SUCCESS The function completes successfully
110 @retval EFI_OUT_OF_RESOURCES Insufficient resources to create database
113 FspNotifyPhasePeimEntryPoint (
114 IN EFI_PEI_FILE_HANDLE FileHandle
,
115 IN CONST EFI_PEI_SERVICES
**PeiServices
120 EFI_PEI_PPI_DESCRIPTOR
*OldDescriptor
;
122 DEBUG ((DEBUG_INFO
| DEBUG_INIT
, "The entry of FspNotificationPeim\n"));
125 // Locate old DXE IPL PPI
127 Status
= PeiServicesLocatePpi (
133 ASSERT_EFI_ERROR (Status
);
136 // Re-install the DXE IPL PPI to wait for notify
138 Status
= PeiServicesReInstallPpi (OldDescriptor
, &mInstallDxeIplPpi
);
139 ASSERT_EFI_ERROR (Status
);