]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFspWrapperPkg/FspInitPei/FspNotifyS3.c
DynamicTablesPkg: GTDT updates for ACPI 6.3
[mirror_edk2.git] / IntelFspWrapperPkg / FspInitPei / FspNotifyS3.c
1 /** @file
2 In EndOfPei notify, it will call FspNotifyPhase API.
3
4 Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9
10 #include "FspInitPei.h"
11
12 /**
13 This function handles S3 resume task at the end of PEI
14
15 @param[in] PeiServices Pointer to PEI Services Table.
16 @param[in] NotifyDesc Pointer to the descriptor for the Notification event that
17 caused this function to execute.
18 @param[in] Ppi Pointer to the PPI data associated with this function.
19
20 @retval EFI_STATUS Always return EFI_SUCCESS
21 **/
22 EFI_STATUS
23 EFIAPI
24 S3EndOfPeiNotify (
25 IN EFI_PEI_SERVICES **PeiServices,
26 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
27 IN VOID *Ppi
28 );
29
30 EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc = {
31 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
32 &gEfiEndOfPeiSignalPpiGuid,
33 S3EndOfPeiNotify
34 };
35
36 /**
37 This function handles S3 resume task at the end of PEI
38
39 @param[in] PeiServices Pointer to PEI Services Table.
40 @param[in] NotifyDesc Pointer to the descriptor for the Notification event that
41 caused this function to execute.
42 @param[in] Ppi Pointer to the PPI data associated with this function.
43
44 @retval EFI_STATUS Always return EFI_SUCCESS
45 **/
46 EFI_STATUS
47 EFIAPI
48 S3EndOfPeiNotify (
49 IN EFI_PEI_SERVICES **PeiServices,
50 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
51 IN VOID *Ppi
52 )
53 {
54 NOTIFY_PHASE_PARAMS NotifyPhaseParams;
55 EFI_STATUS Status;
56 FSP_INFO_HEADER *FspHeader;
57
58 FspHeader = FspFindFspHeader (PcdGet32 (PcdFlashFvFspBase));
59 if (FspHeader == NULL) {
60 return EFI_DEVICE_ERROR;
61 }
62
63 DEBUG ((DEBUG_INFO, "S3EndOfPeiNotify enter\n"));
64
65 NotifyPhaseParams.Phase = EnumInitPhaseAfterPciEnumeration;
66 Status = CallFspNotifyPhase (FspHeader, &NotifyPhaseParams);
67 DEBUG((DEBUG_INFO, "FSP S3NotifyPhase AfterPciEnumeration status: 0x%x\n", Status));
68
69 NotifyPhaseParams.Phase = EnumInitPhaseReadyToBoot;
70 Status = CallFspNotifyPhase (FspHeader, &NotifyPhaseParams);
71 DEBUG((DEBUG_INFO, "FSP S3NotifyPhase ReadyToBoot status: 0x%x\n", Status));
72
73 return EFI_SUCCESS;
74 }