]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/FspWrapperApiTest.c
IntelFsp2WrapperPkg: Support FSP Dispatch mode
[mirror_edk2.git] / IntelFsp2WrapperPkg / Library / PeiFspWrapperApiTestLib / FspWrapperApiTest.c
1 /** @file
2 Provide FSP wrapper API test related function.
3
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. 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 #include <PiPei.h>
16 #include <Library/BaseMemoryLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/HobLib.h>
19 #include <Guid/GuidHobFspEas.h>
20
21 /**
22 Test the output of FSP API - FspMemoryInit.
23
24 @param[in] FspmUpdDataPtr Address pointer to the FSP_MEMORY_INIT_PARAMS structure.
25 @param[in] HobListPtr Address of the HobList pointer.
26
27 @return test result on output of FspMemoryInit API.
28 **/
29 EFI_STATUS
30 EFIAPI
31 TestFspMemoryInitApiOutput (
32 IN VOID *FspmUpdDataPtr,
33 IN VOID **HobListPtr
34 )
35 {
36 DEBUG_CODE_BEGIN ();
37 EFI_PEI_HOB_POINTERS Hob;
38
39 Hob.Raw = (UINT8 *)(*(HobListPtr));
40 while (TRUE) {
41 if (END_OF_HOB_LIST(Hob) == TRUE) {
42 DEBUG((DEBUG_INFO, "gFspBootLoaderTolumHobGuid not Found\n"));
43 break;
44 }
45 if ((CompareGuid (&Hob.ResourceDescriptor->Owner, &gFspBootLoaderTolumHobGuid))) {
46 DEBUG ((DEBUG_INFO, "gFspBootLoaderTolumHobGuid Found\n"));
47 DEBUG ((DEBUG_INFO, "Fill Boot Loader reserved memory range with 0x5A for testing purpose\n"));
48 SetMem ((VOID *)(UINTN)Hob.ResourceDescriptor->PhysicalStart, (UINTN)Hob.ResourceDescriptor->ResourceLength, 0x5A);
49 break;
50 }
51 Hob.Raw = GET_NEXT_HOB (Hob);
52 }
53 DEBUG_CODE_END ();
54
55 return RETURN_SUCCESS;
56 }
57
58 /**
59 Test the output of FSP API - TempRamExit.
60
61 @param[in] TempRamExitParam Address pointer to the TempRamExit parameters structure.
62
63 @return test result on output of TempRamExit API.
64 **/
65 EFI_STATUS
66 EFIAPI
67 TestFspTempRamExitApiOutput (
68 IN VOID *TempRamExitParam
69 )
70 {
71 return RETURN_SUCCESS;
72 }
73
74 /**
75 Test the output of FSP API - FspSiliconInit.
76
77 @param[in] FspsUpdDataPtr Address pointer to the Silicon Init parameters structure.
78
79 @return test result on output of FspSiliconInit API.
80 **/
81 EFI_STATUS
82 EFIAPI
83 TestFspSiliconInitApiOutput (
84 IN VOID *FspsUpdDataPtr
85 )
86 {
87 return RETURN_SUCCESS;
88 }