]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/PlatformPei/Platform.h
e1817b28c6e13b8c0b8a043566c5ee172c4b91ac
[mirror_edk2.git] / Vlv2TbltDevicePkg / PlatformPei / Platform.h
1 /*++
2
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8
9
10 **/
11
12
13 #ifndef __PEI_PLATFORM_H__
14 #define __PEI_PLATFORM_H__
15
16 #define PEI_STALL_RESOLUTION 1
17 #define STALL_PEIM_SIGNATURE SIGNATURE_32('p','p','u','s')
18
19 typedef struct {
20 UINT32 Signature;
21 EFI_FFS_FILE_HEADER *FfsHeader;
22 EFI_PEI_NOTIFY_DESCRIPTOR StallNotify;
23 } STALL_CALLBACK_STATE_INFORMATION;
24
25 #define STALL_PEIM_FROM_THIS(a) CR (a, STALL_CALLBACK_STATE_INFORMATION, StallNotify, STALL_PEIM_SIGNATURE)
26
27 #ifdef NOCS_S3_SUPPORT
28
29 /**
30 Peform the boot mode determination logic
31 If the box is closed, then
32 1. If it's first time to boot, it's boot with full config .
33 2. If the ChassisIntrution is selected, force to be a boot with full config
34 3. Otherwise it's boot with no change.
35
36 @param PeiServices General purpose services available to every PEIM.
37 @param BootMode The detected boot mode.
38
39 @retval EFI_SUCCESS if the boot mode could be set
40 **/
41 EFI_STATUS
42 UpdateBootMode (
43 IN CONST EFI_PEI_SERVICES **PeiServices
44 );
45 #endif
46
47 /**
48 This function reset the entire platform, including all processor and devices, and
49 reboots the system.
50
51 Declaration of this function goes to MdeModulePkg/Include/Library/ResetSystemLib.h
52
53 @param PeiServices General purpose services available to every PEIM.
54
55 @retval EFI_SUCCESS if it completed successfully.
56 **/
57 // EFI_STATUS
58 // EFIAPI
59 // ResetSystem (
60 // IN CONST EFI_PEI_SERVICES **PeiServices
61 // );
62
63 /**
64 This function will be called when MRC is done.
65
66 @param PeiServices General purpose services available to every PEIM.
67 @param NotifyDescriptor Information about the notify event..
68 @param Ppi The notify context.
69
70 @retval EFI_SUCCESS If the function completed successfully.
71 **/
72 EFI_STATUS
73 EFIAPI
74 MemoryDiscoveredPpiNotifyCallback (
75 IN EFI_PEI_SERVICES **PeiServices,
76 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
77 IN VOID *Ppi
78 );
79
80 /**
81 This is the callback function notified by FvFileLoader PPI, it depends on FvFileLoader PPI to load
82 the PEIM into memory.
83
84 @param PeiServices General purpose services available to every PEIM.
85 @param NotifyDescriptor The context of notification.
86 @param Ppi The notify PPI.
87
88 @retval EFI_SUCCESS if it completed successfully.
89 **/
90 EFI_STATUS
91 EFIAPI
92 FvFileLoaderPpiNotifyCallback (
93 IN EFI_PEI_SERVICES **PeiServices,
94 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
95 IN VOID *Ppi
96 );
97
98 /**
99 This function provides a blocking stall for reset at least the given number of microseconds
100 stipulated in the final argument.
101
102 @param PeiServices General purpose services available to every PEIM.
103 @param this Pointer to the local data for the interface.
104 @param Microseconds number of microseconds for which to stall.
105
106 @retval EFI_SUCCESS the function provided at least the required stall.
107 **/
108 EFI_STATUS
109 EFIAPI
110 Stall (
111 IN CONST EFI_PEI_SERVICES **PeiServices,
112 IN CONST EFI_PEI_STALL_PPI *This,
113 IN UINTN Microseconds
114 );
115
116 /**
117 This function initialize recovery functionality by installing the recovery PPI.
118
119 @param PeiServices General purpose services available to every PEIM.
120
121 @retval EFI_SUCCESS If the interface could be successfully installed.
122 **/
123 EFI_STATUS
124 EFIAPI
125 InitializeRecovery (
126 IN EFI_PEI_SERVICES **PeiServices
127 );
128
129 /**
130 This function
131 1. Calling MRC to initialize memory.
132 2. Install EFI Memory.
133 3. Capsule coalesce if capsule boot mode.
134 4. Create HOB of system memory.
135
136 @param PeiServices Pointer to the PEI Service Table
137
138 @retval EFI_SUCCESS If it completes successfully.
139
140 **/
141 EFI_STATUS
142 MemoryInit (
143 IN EFI_PEI_SERVICES **PeiServices
144 );
145
146 /**
147 This function provides the implementation of AtaController PPI Enable Channel function.
148
149 @param PeiServices General purpose services available to every PEIM.
150 @param this Pointer to the local data for the interface.
151 @param ChannelMask This parameter is used to specify primary or slavery IDE channel.
152
153 @retval EFI_SUCCESS Procedure returned successfully.
154 **/
155 EFI_STATUS
156 EnableAtaChannel (
157 IN EFI_PEI_SERVICES **PeiServices,
158 IN PEI_ATA_CONTROLLER_PPI *This,
159 IN UINT8 ChannelMask
160 );
161
162 /**
163 This function provides the implementation of AtaController PPI Get IDE channel Register Base Address
164
165 @param PeiServices General purpose services available to every PEIM.
166 @param this Pointer to the local data for the interface.
167 @param IdeRegsBaseAddr Pointer to IDE_REGS_BASE_ADDR struct, which is used to record
168 IDE Command and Control regeisters Base Address.
169
170 @retval EFI_SUCCESS Procedure returned successfully.
171 **/
172 EFI_STATUS
173 GetIdeRegsBaseAddr (
174 IN EFI_PEI_SERVICES **PeiServices,
175 IN PEI_ATA_CONTROLLER_PPI *This,
176 IN IDE_REGS_BASE_ADDR *IdeRegsBaseAddr
177 );
178
179 /**
180 This function provides the implementation to properly setup both LM & PDM functionality.
181
182 @param PeiServices General purpose services available to every PEIM.
183
184 @retval EFI_SUCCESS Procedure returned successfully.
185
186 **/
187 EFI_STATUS
188 ConfigureLM(
189 IN EFI_PEI_SERVICES **PeiServices
190 );
191
192 #include <Ppi/VlvMmioPolicy.h>
193
194 BOOLEAN
195 EFIAPI
196 IsFastBootEnabled (
197 IN CONST EFI_PEI_SERVICES **PeiServices
198 );
199
200 EFI_STATUS
201 PrioritizeBootMode (
202 IN OUT EFI_BOOT_MODE *CurrentBootMode,
203 IN EFI_BOOT_MODE NewBootMode
204 );
205
206 EFI_STATUS
207 EFIAPI
208 CapsulePpiNotifyCallback (
209 IN EFI_PEI_SERVICES **PeiServices,
210 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
211 IN VOID *Ppi
212 );
213 #endif