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