]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | The header file of Platform PEIM.\r | |
3 | \r | |
4 | Copyright (c) 2013 Intel Corporation.\r | |
5 | \r | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | \r | |
17 | #ifndef __PLATFORM_EARLY_INIT_H__\r | |
18 | #define __PLATFORM_EARLY_INIT_H__\r | |
19 | \r | |
20 | #define PEI_STALL_RESOLUTION 1\r | |
21 | #define STALL_PEIM_SIGNATURE SIGNATURE_32('p','p','u','s')\r | |
22 | \r | |
23 | typedef struct {\r | |
24 | UINT32 Signature;\r | |
25 | EFI_FFS_FILE_HEADER *FfsHeader;\r | |
26 | EFI_PEI_NOTIFY_DESCRIPTOR StallNotify;\r | |
27 | } STALL_CALLBACK_STATE_INFORMATION;\r | |
28 | \r | |
29 | #define STALL_PEIM_FROM_THIS(a) CR (a, STALL_CALLBACK_STATE_INFORMATION, StallNotify, STALL_PEIM_SIGNATURE)\r | |
30 | \r | |
31 | //\r | |
32 | // USB Phy Registers\r | |
33 | //\r | |
34 | #define USB2_GLOBAL_PORT 0x4001\r | |
35 | #define USB2_PLL1 0x7F02\r | |
36 | #define USB2_PLL2 0x7F03\r | |
37 | #define USB2_COMPBG 0x7F04\r | |
38 | \r | |
39 | /**\r | |
40 | Peform the boot mode determination logic\r | |
41 | If the box is closed, then\r | |
42 | 1. If it's first time to boot, it's boot with full config .\r | |
43 | 2. If the ChassisIntrution is selected, force to be a boot with full config\r | |
44 | 3. Otherwise it's boot with no change.\r | |
45 | \r | |
46 | @param PeiServices General purpose services available to every PEIM.\r | |
47 | \r | |
48 | @param BootMode The detected boot mode.\r | |
49 | \r | |
50 | @retval EFI_SUCCESS if the boot mode could be set\r | |
51 | **/\r | |
52 | EFI_STATUS\r | |
53 | UpdateBootMode (\r | |
54 | IN EFI_PEI_SERVICES **PeiServices,\r | |
55 | OUT EFI_BOOT_MODE *BootMode\r | |
56 | );\r | |
57 | \r | |
58 | /**\r | |
59 | This function reset the entire platform, including all processor and devices, and\r | |
60 | reboots the system.\r | |
61 | \r | |
62 | @param PeiServices General purpose services available to every PEIM.\r | |
63 | \r | |
64 | @retval EFI_SUCCESS if it completed successfully.\r | |
65 | **/\r | |
66 | EFI_STATUS\r | |
67 | EFIAPI\r | |
68 | ResetSystem (\r | |
69 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
70 | );\r | |
71 | \r | |
72 | /**\r | |
73 | This function will be called when MRC is done.\r | |
74 | \r | |
75 | @param PeiServices General purpose services available to every PEIM.\r | |
76 | \r | |
77 | @param NotifyDescriptor Information about the notify event..\r | |
78 | \r | |
79 | @param Ppi The notify context.\r | |
80 | \r | |
81 | @retval EFI_SUCCESS If the function completed successfully.\r | |
82 | **/\r | |
83 | EFI_STATUS\r | |
84 | EFIAPI\r | |
85 | MemoryDiscoveredPpiNotifyCallback (\r | |
86 | IN EFI_PEI_SERVICES **PeiServices,\r | |
87 | IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r | |
88 | IN VOID *Ppi\r | |
89 | );\r | |
90 | \r | |
91 | /**\r | |
92 | This is the callback function notified by FvFileLoader PPI, it depends on FvFileLoader PPI to load\r | |
93 | the PEIM into memory.\r | |
94 | \r | |
95 | @param PeiServices General purpose services available to every PEIM.\r | |
96 | @param NotifyDescriptor The context of notification.\r | |
97 | @param Ppi The notify PPI.\r | |
98 | \r | |
99 | @retval EFI_SUCCESS if it completed successfully.\r | |
100 | **/\r | |
101 | EFI_STATUS\r | |
102 | EFIAPI\r | |
103 | FvFileLoaderPpiNotifyCallback (\r | |
104 | IN EFI_PEI_SERVICES **PeiServices,\r | |
105 | IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r | |
106 | IN VOID *Ppi\r | |
107 | );\r | |
108 | \r | |
109 | /**\r | |
110 | This function provides a blocking stall for reset at least the given number of microseconds\r | |
111 | stipulated in the final argument.\r | |
112 | \r | |
113 | @param PeiServices General purpose services available to every PEIM.\r | |
114 | \r | |
115 | @param this Pointer to the local data for the interface.\r | |
116 | \r | |
117 | @param Microseconds number of microseconds for which to stall.\r | |
118 | \r | |
119 | @retval EFI_SUCCESS the function provided at least the required stall.\r | |
120 | **/\r | |
121 | EFI_STATUS\r | |
122 | EFIAPI\r | |
123 | Stall (\r | |
124 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
125 | IN CONST EFI_PEI_STALL_PPI *This,\r | |
126 | IN UINTN Microseconds\r | |
127 | );\r | |
128 | \r | |
129 | /**\r | |
130 | This function initialize recovery functionality by installing the recovery PPI.\r | |
131 | \r | |
132 | @param PeiServices General purpose services available to every PEIM.\r | |
133 | \r | |
134 | @retval EFI_SUCCESS if the interface could be successfully installed.\r | |
135 | **/\r | |
136 | EFI_STATUS\r | |
137 | EFIAPI\r | |
138 | PeimInitializeRecovery (\r | |
139 | IN EFI_PEI_SERVICES **PeiServices\r | |
140 | );\r | |
141 | \r | |
142 | /**\r | |
143 | This function\r | |
144 | 1. Calling MRC to initialize memory.\r | |
145 | 2. Install EFI Memory.\r | |
146 | 3. Create HOB of system memory.\r | |
147 | \r | |
148 | @param PeiServices Pointer to the PEI Service Table\r | |
149 | \r | |
150 | @retval EFI_SUCCESS If it completes successfully.\r | |
151 | \r | |
152 | **/\r | |
153 | EFI_STATUS\r | |
154 | MemoryInit (\r | |
155 | IN EFI_PEI_SERVICES **PeiServices\r | |
156 | );\r | |
157 | \r | |
158 | /** Return info derived from Installing Memory by MemoryInit.\r | |
159 | \r | |
160 | @param[out] RmuMainBaseAddressPtr Return RmuMainBaseAddress to this location.\r | |
161 | @param[out] SmramDescriptorPtr Return start of Smram descriptor list to this location.\r | |
162 | @param[out] NumSmramRegionsPtr Return numbers of Smram regions to this location.\r | |
163 | \r | |
164 | @return Address of RMU shadow region at the top of available memory.\r | |
165 | @return List of Smram descriptors for each Smram region.\r | |
166 | @return Numbers of Smram regions.\r | |
167 | **/\r | |
168 | VOID\r | |
169 | EFIAPI\r | |
170 | InfoPostInstallMemory (\r | |
171 | OUT UINT32 *RmuMainBaseAddressPtr OPTIONAL,\r | |
172 | OUT EFI_SMRAM_DESCRIPTOR **SmramDescriptorPtr OPTIONAL,\r | |
173 | OUT UINTN *NumSmramRegionsPtr OPTIONAL\r | |
174 | );\r | |
175 | \r | |
176 | /**\r | |
177 | This function provides the implementation of AtaController PPI Enable Channel function.\r | |
178 | \r | |
179 | @param PeiServices General purpose services available to every PEIM.\r | |
180 | @param this Pointer to the local data for the interface.\r | |
181 | @param ChannelMask This parameter is used to specify primary or slavery IDE channel.\r | |
182 | \r | |
183 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
184 | **/\r | |
185 | \r | |
186 | EFI_STATUS\r | |
187 | EnableAtaChannel (\r | |
188 | IN EFI_PEI_SERVICES **PeiServices,\r | |
189 | IN PEI_ATA_CONTROLLER_PPI *This,\r | |
190 | IN UINT8 ChannelMask\r | |
191 | );\r | |
192 | \r | |
193 | /**\r | |
194 | This function provides the implementation of AtaController PPI Get IDE channel Register Base Address\r | |
195 | \r | |
196 | @param PeiServices General purpose services available to every PEIM.\r | |
197 | @param this Pointer to the local data for the interface.\r | |
198 | @param IdeRegsBaseAddr Pointer to IDE_REGS_BASE_ADDR struct, which is used to record\r | |
199 | IDE Command and Control regeisters Base Address.\r | |
200 | \r | |
201 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
202 | **/\r | |
203 | \r | |
204 | EFI_STATUS\r | |
205 | GetIdeRegsBaseAddr (\r | |
206 | IN EFI_PEI_SERVICES **PeiServices,\r | |
207 | IN PEI_ATA_CONTROLLER_PPI *This,\r | |
208 | IN IDE_REGS_BASE_ADDR *IdeRegsBaseAddr\r | |
209 | );\r | |
210 | \r | |
211 | VOID\r | |
212 | EFIAPI\r | |
213 | InitializeUSBPhy (\r | |
214 | VOID\r | |
215 | );\r | |
216 | \r | |
217 | /**\r | |
218 | This function provides early platform initialisation.\r | |
219 | \r | |
220 | @param PlatformInfo Pointer to platform Info structure.\r | |
221 | \r | |
222 | **/\r | |
223 | VOID\r | |
224 | EFIAPI\r | |
225 | EarlyPlatformInit (\r | |
226 | VOID\r | |
227 | );\r | |
228 | \r | |
229 | /**\r | |
230 | This function provides early platform GPIO initialisation.\r | |
231 | \r | |
232 | @param PlatformType Platform type for GPIO init.\r | |
233 | \r | |
234 | **/\r | |
235 | VOID\r | |
236 | EFIAPI\r | |
237 | EarlyPlatformLegacyGpioInit (\r | |
238 | IN CONST EFI_PLATFORM_TYPE PlatformType\r | |
239 | );\r | |
240 | \r | |
241 | /**\r | |
242 | Performs any early platform specific GPIO manipulation.\r | |
243 | \r | |
244 | @param PlatformType Platform type GPIO manipulation.\r | |
245 | \r | |
246 | **/\r | |
247 | VOID\r | |
248 | EFIAPI\r | |
249 | EarlyPlatformLegacyGpioManipulation (\r | |
250 | IN CONST EFI_PLATFORM_TYPE PlatformType\r | |
251 | );\r | |
252 | \r | |
253 | /**\r | |
254 | Performs any early platform specific GPIO Controller init & manipulation.\r | |
255 | \r | |
256 | @param PlatformType Platform type for GPIO init & manipulation.\r | |
257 | \r | |
258 | **/\r | |
259 | VOID\r | |
260 | EFIAPI\r | |
261 | EarlyPlatformGpioCtrlerInitAndManipulation (\r | |
262 | IN CONST EFI_PLATFORM_TYPE PlatformType\r | |
263 | );\r | |
264 | \r | |
265 | /**\r | |
266 | Performs any early platform init of SoC Ethernet Mac devices.\r | |
267 | \r | |
268 | @param IohMac0Address Mac address to program into Mac0 device.\r | |
269 | @param IohMac1Address Mac address to program into Mac1 device.\r | |
270 | \r | |
271 | **/\r | |
272 | VOID\r | |
273 | EFIAPI\r | |
274 | EarlyPlatformMacInit (\r | |
275 | IN CONST UINT8 *IohMac0Address,\r | |
276 | IN CONST UINT8 *IohMac1Address\r | |
277 | );\r | |
278 | \r | |
279 | /**\r | |
280 | Find security headers using EFI_CAPSULE_VARIABLE_NAME variables and build Hobs.\r | |
281 | \r | |
282 | @param PeiServices General purpose services available to every PEIM.\r | |
283 | \r | |
284 | @retval 0 if no security headers found.\r | |
285 | @return number of security header hobs built.\r | |
286 | **/\r | |
287 | UINTN\r | |
288 | EFIAPI\r | |
289 | FindCapsuleSecurityHeadersAndBuildHobs (\r | |
290 | IN EFI_PEI_SERVICES **PeiServices\r | |
291 | );\r | |
292 | \r | |
293 | /**\r | |
294 | Build capsule security header hob.\r | |
295 | \r | |
296 | @param SecHdr Pointer to security header.\r | |
297 | \r | |
298 | @retval NULL if failure to build HOB.\r | |
299 | @return pointer to built hob.\r | |
300 | **/\r | |
301 | VOID *\r | |
302 | EFIAPI\r | |
303 | BuildCapsuleSecurityHeaderHob (\r | |
304 | IN VOID *SecHdr\r | |
305 | );\r | |
306 | \r | |
307 | #endif\r |