]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / IntelFsp2WrapperPkg / FspsWrapperPeim / FspsWrapperPeim.c
1 /** @file
2 This will be invoked only once. It will call FspMemoryInit API,
3 register TemporaryRamDonePpi to call TempRamExit API, and register MemoryDiscoveredPpi
4 notify to call FspSiliconInit API.
5
6 Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #include <PiPei.h>
12
13 #include <Library/PeimEntryPoint.h>
14 #include <Library/PeiServicesLib.h>
15 #include <Library/PeiServicesTablePointerLib.h>
16 #include <Library/BaseLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/BaseMemoryLib.h>
19 #include <Library/HobLib.h>
20 #include <Library/PcdLib.h>
21 #include <Library/MemoryAllocationLib.h>
22 #include <Library/FspWrapperPlatformLib.h>
23 #include <Library/FspWrapperHobProcessLib.h>
24 #include <Library/FspWrapperMultiPhaseProcessLib.h>
25 #include <Library/TimerLib.h>
26 #include <Library/PerformanceLib.h>
27 #include <Library/FspWrapperApiLib.h>
28 #include <Library/FspMeasurementLib.h>
29
30 #include <Ppi/FspSiliconInitDone.h>
31 #include <Ppi/EndOfPeiPhase.h>
32 #include <Ppi/MemoryDiscovered.h>
33 #include <Ppi/TemporaryRamDone.h>
34 #include <Ppi/SecPlatformInformation.h>
35 #include <Ppi/Tcg.h>
36 #include <Ppi/FirmwareVolumeInfoMeasurementExcluded.h>
37 #include <Library/FspWrapperApiTestLib.h>
38 #include <FspEas.h>
39 #include <FspStatusCode.h>
40 #include <FspGlobalData.h>
41
42 extern EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc;
43 extern EFI_GUID gFspHobGuid;
44
45 /**
46 This function handles S3 resume task at the end of PEI.
47
48 @param[in] PeiServices Pointer to PEI Services Table.
49 @param[in] NotifyDesc Pointer to the descriptor for the Notification event that
50 caused this function to execute.
51 @param[in] Ppi Pointer to the PPI data associated with this function.
52
53 @retval EFI_STATUS Always return EFI_SUCCESS
54 **/
55 EFI_STATUS
56 EFIAPI
57 S3EndOfPeiNotify (
58 IN EFI_PEI_SERVICES **PeiServices,
59 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
60 IN VOID *Ppi
61 );
62
63 EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc = {
64 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
65 &gEfiEndOfPeiSignalPpiGuid,
66 S3EndOfPeiNotify
67 };
68
69 /**
70 This function handles S3 resume task at the end of PEI.
71
72 @param[in] PeiServices Pointer to PEI Services Table.
73 @param[in] NotifyDesc Pointer to the descriptor for the Notification event that
74 caused this function to execute.
75 @param[in] Ppi Pointer to the PPI data associated with this function.
76
77 @retval EFI_STATUS Always return EFI_SUCCESS
78 **/
79 EFI_STATUS
80 EFIAPI
81 S3EndOfPeiNotify (
82 IN EFI_PEI_SERVICES **PeiServices,
83 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
84 IN VOID *Ppi
85 )
86 {
87 NOTIFY_PHASE_PARAMS NotifyPhaseParams;
88 EFI_STATUS Status;
89
90 DEBUG ((DEBUG_INFO, "S3EndOfPeiNotify enter\n"));
91
92 NotifyPhaseParams.Phase = EnumInitPhaseAfterPciEnumeration;
93 Status = CallFspNotifyPhase (&NotifyPhaseParams);
94 DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase AfterPciEnumeration status: 0x%x\n", Status));
95
96 //
97 // Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
98 //
99 if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
100 DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase AfterPciEnumeration requested reset 0x%x\n", Status));
101 CallFspWrapperResetSystem (Status);
102 }
103
104 NotifyPhaseParams.Phase = EnumInitPhaseReadyToBoot;
105 Status = CallFspNotifyPhase (&NotifyPhaseParams);
106 DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase ReadyToBoot status: 0x%x\n", Status));
107
108 //
109 // Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
110 //
111 if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
112 DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase ReadyToBoot requested reset 0x%x\n", Status));
113 CallFspWrapperResetSystem (Status);
114 }
115
116 NotifyPhaseParams.Phase = EnumInitPhaseEndOfFirmware;
117 Status = CallFspNotifyPhase (&NotifyPhaseParams);
118 DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase EndOfFirmware status: 0x%x\n", Status));
119
120 //
121 // Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
122 //
123 if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
124 DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase EndOfFirmware requested reset 0x%x\n", Status));
125 CallFspWrapperResetSystem (Status);
126 }
127
128 return EFI_SUCCESS;
129 }
130
131 /**
132 Return Hob list produced by FSP.
133
134 @param[in] PeiServices The pointer to the PEI Services Table.
135 @param[in] This The pointer to this instance of this PPI.
136 @param[out] FspHobList The pointer to Hob list produced by FSP.
137
138 @return EFI_SUCCESS Return Hob list produced by FSP successfully.
139 **/
140 EFI_STATUS
141 EFIAPI
142 FspSiliconInitDoneGetFspHobList (
143 IN CONST EFI_PEI_SERVICES **PeiServices,
144 IN FSP_SILICON_INIT_DONE_PPI *This,
145 OUT VOID **FspHobList
146 );
147
148 FSP_SILICON_INIT_DONE_PPI mFspSiliconInitDonePpi = {
149 FspSiliconInitDoneGetFspHobList
150 };
151
152 EFI_PEI_PPI_DESCRIPTOR mPeiFspSiliconInitDonePpi = {
153 EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
154 &gFspSiliconInitDonePpiGuid,
155 &mFspSiliconInitDonePpi
156 };
157
158 /**
159 Return Hob list produced by FSP.
160
161 @param[in] PeiServices The pointer to the PEI Services Table.
162 @param[in] This The pointer to this instance of this PPI.
163 @param[out] FspHobList The pointer to Hob list produced by FSP.
164
165 @return EFI_SUCCESS Return Hob list produced by FSP successfully.
166 **/
167 EFI_STATUS
168 EFIAPI
169 FspSiliconInitDoneGetFspHobList (
170 IN CONST EFI_PEI_SERVICES **PeiServices,
171 IN FSP_SILICON_INIT_DONE_PPI *This,
172 OUT VOID **FspHobList
173 )
174 {
175 EFI_HOB_GUID_TYPE *GuidHob;
176
177 GuidHob = GetFirstGuidHob (&gFspHobGuid);
178 if (GuidHob != NULL) {
179 *FspHobList = *(VOID **)GET_GUID_HOB_DATA (GuidHob);
180 return EFI_SUCCESS;
181 } else {
182 return EFI_NOT_FOUND;
183 }
184 }
185
186 /**
187 Get the FSP S UPD Data address
188
189 @return FSP-S UPD Data Address
190 **/
191 UINTN
192 GetFspsUpdDataAddress (
193 VOID
194 )
195 {
196 if (PcdGet64 (PcdFspsUpdDataAddress64) != 0) {
197 return (UINTN)PcdGet64 (PcdFspsUpdDataAddress64);
198 } else {
199 return (UINTN)PcdGet32 (PcdFspsUpdDataAddress);
200 }
201 }
202
203 /**
204 This function is for FSP dispatch mode to perform post FSP-S process.
205
206 @param[in] PeiServices Pointer to PEI Services Table.
207 @param[in] NotifyDesc Pointer to the descriptor for the Notification event that
208 caused this function to execute.
209 @param[in] Ppi Pointer to the PPI data associated with this function.
210
211 @retval EFI_STATUS Status returned by PeiServicesInstallPpi ()
212 **/
213 EFI_STATUS
214 EFIAPI
215 FspsWrapperEndOfPeiNotify (
216 IN EFI_PEI_SERVICES **PeiServices,
217 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
218 IN VOID *Ppi
219 )
220 {
221 EFI_STATUS Status;
222
223 //
224 // This step may include platform specific process in some boot loaders so
225 // aligning the same behavior between API and Dispatch modes.
226 // Note: In Dispatch mode no FspHobList so passing NULL to function and
227 // expecting function will handle it.
228 //
229 PostFspsHobProcess (NULL);
230
231 //
232 // Install FspSiliconInitDonePpi so that any other driver can consume this info.
233 //
234 Status = PeiServicesInstallPpi (&mPeiFspSiliconInitDonePpi);
235 ASSERT_EFI_ERROR (Status);
236
237 return Status;
238 }
239
240 EFI_PEI_NOTIFY_DESCRIPTOR mFspsWrapperEndOfPeiNotifyDesc = {
241 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
242 &gEfiEndOfPeiSignalPpiGuid,
243 FspsWrapperEndOfPeiNotify
244 };
245
246 /**
247 This function is called after PEI core discover memory and finish migration.
248
249 @param[in] PeiServices Pointer to PEI Services Table.
250 @param[in] NotifyDesc Pointer to the descriptor for the Notification event that
251 caused this function to execute.
252 @param[in] Ppi Pointer to the PPI data associated with this function.
253
254 @retval EFI_STATUS Always return EFI_SUCCESS
255 **/
256 EFI_STATUS
257 EFIAPI
258 PeiMemoryDiscoveredNotify (
259 IN EFI_PEI_SERVICES **PeiServices,
260 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
261 IN VOID *Ppi
262 );
263
264 EFI_PEI_NOTIFY_DESCRIPTOR mPeiMemoryDiscoveredNotifyDesc = {
265 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
266 &gEfiPeiMemoryDiscoveredPpiGuid,
267 PeiMemoryDiscoveredNotify
268 };
269
270 /**
271 This function is called after PEI core discover memory and finish migration.
272
273 @param[in] PeiServices Pointer to PEI Services Table.
274 @param[in] NotifyDesc Pointer to the descriptor for the Notification event that
275 caused this function to execute.
276 @param[in] Ppi Pointer to the PPI data associated with this function.
277
278 @retval EFI_STATUS Always return EFI_SUCCESS
279 **/
280 EFI_STATUS
281 EFIAPI
282 PeiMemoryDiscoveredNotify (
283 IN EFI_PEI_SERVICES **PeiServices,
284 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
285 IN VOID *Ppi
286 )
287 {
288 FSP_INFO_HEADER *FspsHeaderPtr;
289 UINT64 TimeStampCounterStart;
290 EFI_STATUS Status;
291 VOID *FspHobListPtr;
292 EFI_HOB_GUID_TYPE *GuidHob;
293 FSPS_UPD_COMMON *FspsUpdDataPtr;
294 UINTN *SourceData;
295
296 DEBUG ((DEBUG_INFO, "PeiMemoryDiscoveredNotify enter\n"));
297 FspsUpdDataPtr = NULL;
298
299 FspsHeaderPtr = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspsBaseAddress));
300 DEBUG ((DEBUG_INFO, "FspsHeaderPtr - 0x%x\n", FspsHeaderPtr));
301 if (FspsHeaderPtr == NULL) {
302 return EFI_DEVICE_ERROR;
303 }
304
305 if ((GetFspsUpdDataAddress () == 0) && (FspsHeaderPtr->CfgRegionSize != 0) && (FspsHeaderPtr->CfgRegionOffset != 0)) {
306 //
307 // Copy default FSP-S UPD data from Flash
308 //
309 FspsUpdDataPtr = (FSPS_UPD_COMMON *)AllocateZeroPool ((UINTN)FspsHeaderPtr->CfgRegionSize);
310 ASSERT (FspsUpdDataPtr != NULL);
311 SourceData = (UINTN *)((UINTN)FspsHeaderPtr->ImageBase + (UINTN)FspsHeaderPtr->CfgRegionOffset);
312 CopyMem (FspsUpdDataPtr, SourceData, (UINTN)FspsHeaderPtr->CfgRegionSize);
313 } else {
314 FspsUpdDataPtr = (FSPS_UPD_COMMON *)GetFspsUpdDataAddress ();
315 ASSERT (FspsUpdDataPtr != NULL);
316 }
317
318 UpdateFspsUpdData ((VOID *)FspsUpdDataPtr);
319
320 TimeStampCounterStart = AsmReadTsc ();
321 PERF_START_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_SILICON_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
322 Status = CallFspSiliconInit ((VOID *)FspsUpdDataPtr);
323
324 //
325 // Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
326 //
327 if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
328 DEBUG ((DEBUG_INFO, "FspSiliconInitApi requested reset %r\n", Status));
329 CallFspWrapperResetSystem (Status);
330 }
331
332 if ((Status != FSP_STATUS_VARIABLE_REQUEST) && EFI_ERROR (Status)) {
333 DEBUG ((DEBUG_ERROR, "ERROR - Failed to execute FspSiliconInitApi(), Status = %r\n", Status));
334 ASSERT_EFI_ERROR (Status);
335 }
336
337 DEBUG ((DEBUG_INFO, "FspSiliconInit status: %r\n", Status));
338
339 if (Status == FSP_STATUS_VARIABLE_REQUEST) {
340 //
341 // call to Variable request handler
342 //
343 FspWrapperVariableRequestHandler (&FspHobListPtr, FspMultiPhaseSiInitApiIndex);
344 }
345
346 //
347 // See if MultiPhase process is required or not
348 //
349 FspWrapperMultiPhaseHandler (&FspHobListPtr, FspMultiPhaseSiInitApiIndex); // FspS MultiPhase
350
351 PERF_END_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_SILICON_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
352 DEBUG ((DEBUG_INFO, "Total time spent executing FspSiliconInitApi: %d millisecond\n", DivU64x32 (GetTimeInNanoSecond (AsmReadTsc () - TimeStampCounterStart), 1000000)));
353
354 Status = TestFspSiliconInitApiOutput ((VOID *)NULL);
355 if (RETURN_ERROR (Status)) {
356 DEBUG ((DEBUG_ERROR, "ERROR - TestFspSiliconInitApiOutput () fail, Status = %r\n", Status));
357 }
358
359 //
360 // Now FspHobList complete, process it
361 //
362 GuidHob = GetFirstGuidHob (&gFspHobGuid);
363 ASSERT (GuidHob != NULL);
364 FspHobListPtr = *(VOID **)GET_GUID_HOB_DATA (GuidHob);
365 DEBUG ((DEBUG_INFO, "FspHobListPtr - 0x%x\n", FspHobListPtr));
366 PostFspsHobProcess (FspHobListPtr);
367
368 //
369 // Install FspSiliconInitDonePpi so that any other driver can consume this info.
370 //
371 Status = PeiServicesInstallPpi (&mPeiFspSiliconInitDonePpi);
372 ASSERT_EFI_ERROR (Status);
373
374 return Status;
375 }
376
377 /**
378 Do FSP initialization in API mode.
379
380 @retval EFI_STATUS Always return EFI_SUCCESS
381 **/
382 EFI_STATUS
383 FspsWrapperInitApiMode (
384 VOID
385 )
386 {
387 EFI_STATUS Status;
388 EFI_BOOT_MODE BootMode;
389
390 //
391 // Register MemoryDiscovered Notify to run FspSiliconInit
392 //
393 Status = PeiServicesNotifyPpi (&mPeiMemoryDiscoveredNotifyDesc);
394 ASSERT_EFI_ERROR (Status);
395
396 //
397 // Register EndOfPei Notify for S3 to run FSP NotifyPhase
398 //
399 PeiServicesGetBootMode (&BootMode);
400 if (BootMode == BOOT_ON_S3_RESUME) {
401 Status = PeiServicesNotifyPpi (&mS3EndOfPeiNotifyDesc);
402 ASSERT_EFI_ERROR (Status);
403 }
404
405 return EFI_SUCCESS;
406 }
407
408 /**
409 Do FSP initialization in Dispatch mode.
410
411 @retval FSP initialization status.
412 **/
413 EFI_STATUS
414 FspsWrapperInitDispatchMode (
415 VOID
416 )
417 {
418 EFI_STATUS Status;
419 EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI *MeasurementExcludedFvPpi;
420 EFI_PEI_PPI_DESCRIPTOR *MeasurementExcludedPpiList;
421
422 MeasurementExcludedFvPpi = AllocatePool (sizeof (*MeasurementExcludedFvPpi));
423 ASSERT (MeasurementExcludedFvPpi != NULL);
424 MeasurementExcludedFvPpi->Count = 1;
425 MeasurementExcludedFvPpi->Fv[0].FvBase = PcdGet32 (PcdFspsBaseAddress);
426 MeasurementExcludedFvPpi->Fv[0].FvLength = ((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspsBaseAddress))->FvLength;
427
428 MeasurementExcludedPpiList = AllocatePool (sizeof (*MeasurementExcludedPpiList));
429 ASSERT (MeasurementExcludedPpiList != NULL);
430 MeasurementExcludedPpiList->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
431 MeasurementExcludedPpiList->Guid = &gEfiPeiFirmwareVolumeInfoMeasurementExcludedPpiGuid;
432 MeasurementExcludedPpiList->Ppi = MeasurementExcludedFvPpi;
433
434 Status = PeiServicesInstallPpi (MeasurementExcludedPpiList);
435 ASSERT_EFI_ERROR (Status);
436
437 //
438 // FSP-S Wrapper running in Dispatch mode and reports FSP-S FV to PEI dispatcher.
439 //
440 PeiServicesInstallFvInfoPpi (
441 NULL,
442 (VOID *)(UINTN)PcdGet32 (PcdFspsBaseAddress),
443 (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspsBaseAddress))->FvLength,
444 NULL,
445 NULL
446 );
447 //
448 // Register EndOfPei Nofity to run post FSP-S process.
449 //
450 Status = PeiServicesNotifyPpi (&mFspsWrapperEndOfPeiNotifyDesc);
451 ASSERT_EFI_ERROR (Status);
452 return Status;
453 }
454
455 /**
456 This function is called after TCG installed PPI.
457
458 @param[in] PeiServices Pointer to PEI Services Table.
459 @param[in] NotifyDesc Pointer to the descriptor for the Notification event that
460 caused this function to execute.
461 @param[in] Ppi Pointer to the PPI data associated with this function.
462
463 @retval EFI_STATUS Always return EFI_SUCCESS
464 **/
465 EFI_STATUS
466 EFIAPI
467 TcgPpiNotify (
468 IN EFI_PEI_SERVICES **PeiServices,
469 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
470 IN VOID *Ppi
471 );
472
473 EFI_PEI_NOTIFY_DESCRIPTOR mTcgPpiNotifyDesc = {
474 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
475 &gEdkiiTcgPpiGuid,
476 TcgPpiNotify
477 };
478
479 /**
480 This function is called after TCG installed PPI.
481
482 @param[in] PeiServices Pointer to PEI Services Table.
483 @param[in] NotifyDesc Pointer to the descriptor for the Notification event that
484 caused this function to execute.
485 @param[in] Ppi Pointer to the PPI data associated with this function.
486
487 @retval EFI_STATUS Always return EFI_SUCCESS
488 **/
489 EFI_STATUS
490 EFIAPI
491 TcgPpiNotify (
492 IN EFI_PEI_SERVICES **PeiServices,
493 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
494 IN VOID *Ppi
495 )
496 {
497 UINT32 FspMeasureMask;
498
499 DEBUG ((DEBUG_INFO, "TcgPpiNotify FSPS\n"));
500
501 FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig);
502
503 if ((FspMeasureMask & FSP_MEASURE_FSPS) != 0) {
504 MeasureFspFirmwareBlob (
505 0,
506 "FSPS",
507 PcdGet32 (PcdFspsBaseAddress),
508 (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspsBaseAddress))->FvLength
509 );
510 }
511
512 return EFI_SUCCESS;
513 }
514
515 /**
516 This is the entrypoint of PEIM.
517
518 @param[in] FileHandle Handle of the file being invoked.
519 @param[in] PeiServices Describes the list of possible PEI Services.
520
521 @retval EFI_SUCCESS if it completed successfully.
522 **/
523 EFI_STATUS
524 EFIAPI
525 FspsWrapperPeimEntryPoint (
526 IN EFI_PEI_FILE_HANDLE FileHandle,
527 IN CONST EFI_PEI_SERVICES **PeiServices
528 )
529 {
530 EFI_STATUS Status;
531
532 DEBUG ((DEBUG_INFO, "FspsWrapperPeimEntryPoint\n"));
533
534 Status = PeiServicesNotifyPpi (&mTcgPpiNotifyDesc);
535 ASSERT_EFI_ERROR (Status);
536
537 if (PcdGet8 (PcdFspModeSelection) == 1) {
538 FspsWrapperInitApiMode ();
539 } else {
540 FspsWrapperInitDispatchMode ();
541 }
542
543 return EFI_SUCCESS;
544 }