]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFspWrapperPkg/Library/BaseFspPlatformInfoLibSample/FspPlatformInfoLibSample.c
IntelFspWrapperPkg update for FSP1.1
[mirror_edk2.git] / IntelFspWrapperPkg / Library / BaseFspPlatformInfoLibSample / FspPlatformInfoLibSample.c
CommitLineData
a33a2f62
JY
1/** @file\r
2 Sample to provide FSP platform information related function.\r
3\r
4 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php.\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include <PiPei.h>\r
16#include <Library/PcdLib.h>\r
17\r
18/**\r
19 Get current boot mode.\r
20\r
21 @note At this point, memory is ready, PeiServices are NOT available to use.\r
22 Platform can get some data from chipset register.\r
23\r
24 @return BootMode current boot mode.\r
25**/\r
26UINT32\r
27EFIAPI\r
28GetBootMode (\r
29 VOID\r
30 )\r
31{\r
32 return BOOT_WITH_FULL_CONFIGURATION;\r
33}\r
34\r
35/**\r
36 Get NVS buffer parameter.\r
37\r
38 @note At this point, memory is NOT ready, PeiServices are available to use.\r
39\r
40 @return NvsBuffer NVS buffer parameter.\r
41**/\r
42VOID *\r
43EFIAPI\r
44GetNvsBuffer (\r
45 VOID\r
46 )\r
47{\r
48 return NULL;\r
49}\r
50\r
51/**\r
52 Get UPD region size.\r
53\r
54 @note At this point, memory is NOT ready, PeiServices are available to use.\r
55\r
56 @return UPD region size.\r
57**/\r
58UINT32\r
59EFIAPI\r
60GetUpdRegionSize (\r
61 VOID\r
62 )\r
63{\r
64 return 0;\r
65}\r
66\r
67/**\r
68 This function overrides the default configurations in the UPD data region.\r
69\r
70 @note At this point, memory is NOT ready, PeiServices are available to use.\r
71\r
72 @param[in,out] FspUpdRgnPtr A pointer to the UPD data region data strcture.\r
73\r
74 @return FspUpdRgnPtr A pointer to the UPD data region data strcture.\r
75**/\r
76VOID *\r
77EFIAPI\r
78UpdateFspUpdConfigs (\r
79 IN OUT VOID *FspUpdRgnPtr\r
80 )\r
81{\r
82 return NULL;\r
83}\r
84\r
88a539ca
JY
85/**\r
86 Get BootLoader Tolum size.\r
87\r
88 @note At this point, memory is NOT ready, PeiServices are available to use.\r
89\r
90 @return BootLoader Tolum size.\r
91**/\r
92UINT32\r
93EFIAPI\r
94GetBootLoaderTolumSize (\r
95 VOID\r
96 )\r
97{\r
98 return 0;\r
99}\r
100\r
d8043ce9
JY
101/**\r
102 Get TempRamExit parameter.\r
103\r
104 @note At this point, memory is ready, PeiServices are available to use.\r
105\r
106 @return TempRamExit parameter.\r
107**/\r
108VOID *\r
109EFIAPI\r
110GetTempRamExitParam (\r
111 VOID\r
112 )\r
113{\r
114 return NULL;\r
115}\r
116\r
117/**\r
118 Get FspSiliconInit parameter.\r
119\r
120 @note At this point, memory is ready, PeiServices are available to use.\r
121\r
122 @return FspSiliconInit parameter.\r
123**/\r
124VOID *\r
125EFIAPI\r
126GetFspSiliconInitParam (\r
127 VOID\r
128 )\r
129{\r
130 return NULL;\r
131}\r
132\r
a33a2f62
JY
133/**\r
134 Get S3 PEI memory information.\r
135\r
136 @note At this point, memory is ready, and PeiServices are available to use.\r
137 Platform can get some data from SMRAM directly.\r
138\r
139 @param[out] S3PeiMemSize PEI memory size to be installed in S3 phase.\r
140 @param[out] S3PeiMemBase PEI memory base to be installed in S3 phase.\r
141\r
142 @return If S3 PEI memory information is got successfully.\r
143**/\r
144EFI_STATUS\r
145EFIAPI\r
146GetS3MemoryInfo (\r
147 OUT UINT64 *S3PeiMemSize,\r
148 OUT EFI_PHYSICAL_ADDRESS *S3PeiMemBase\r
149 )\r
150{\r
151 return EFI_UNSUPPORTED;\r
152}\r
153\r
154/**\r
155 Get stack information according to boot mode.\r
156\r
157 @note If BootMode is BOOT_ON_S3_RESUME or BOOT_ON_FLASH_UPDATE,\r
158 this stack should be in some reserved memory space.\r
159\r
160 @note If FspInitDone is TRUE, memory is ready, but no PeiServices there.\r
161 Platform can get some data from SMRAM directly.\r
162 @note If FspInitDone is FALSE, memory is NOT ready, but PeiServices are available to use.\r
163 Platform can get some data from variable via VariablePpi.\r
164\r
165 @param[in] BootMode Current boot mode.\r
166 @param[in] FspInitDone If FspInit is called.\r
167 @param[out] StackSize Stack size to be used in PEI phase.\r
168 @param[out] StackBase Stack base to be used in PEI phase.\r
169\r
170 @return If Stack information is got successfully.\r
171**/\r
172EFI_STATUS\r
173EFIAPI\r
174GetStackInfo (\r
175 IN UINT32 BootMode,\r
176 IN BOOLEAN FspInitDone,\r
177 OUT UINT64 *StackSize,\r
178 OUT EFI_PHYSICAL_ADDRESS *StackBase\r
179 )\r
180{\r
181 *StackBase = PcdGet32 (PcdTemporaryRamBase);\r
182 *StackSize = PcdGet32 (PcdTemporaryRamSize);\r
183\r
184 if (BootMode == BOOT_ON_S3_RESUME) {\r
185 if (!FspInitDone) {\r
186 } else {\r
187 }\r
188 } else if (BootMode == BOOT_ON_FLASH_UPDATE) {\r
189 if (!FspInitDone) {\r
190 } else {\r
191 }\r
192 }\r
193\r
194 return EFI_SUCCESS;\r
195}\r