2 Sample to provide FSP platform information related function.
4 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Library/PcdLib.h>
13 Get current boot mode.
15 @note At this point, memory is ready, PeiServices are NOT available to use.
16 Platform can get some data from chipset register.
18 @return BootMode current boot mode.
26 return BOOT_WITH_FULL_CONFIGURATION
;
30 Get NVS buffer parameter.
32 @note At this point, memory is NOT ready, PeiServices are available to use.
34 @return NvsBuffer NVS buffer parameter.
48 @note At this point, memory is NOT ready, PeiServices are available to use.
50 @return UPD region size.
62 This function overrides the default configurations in the UPD data region.
64 @note At this point, memory is NOT ready, PeiServices are available to use.
66 @param[in,out] FspUpdRgnPtr A pointer to the UPD data region data strcture.
68 @return FspUpdRgnPtr A pointer to the UPD data region data strcture.
73 IN OUT VOID
*FspUpdRgnPtr
80 Get BootLoader Tolum size.
82 @note At this point, memory is NOT ready, PeiServices are available to use.
84 @return BootLoader Tolum size.
88 GetBootLoaderTolumSize (
96 Get TempRamExit parameter.
98 @note At this point, memory is ready, PeiServices are available to use.
100 @return TempRamExit parameter.
104 GetTempRamExitParam (
112 Get FspSiliconInit parameter.
114 @note At this point, memory is ready, PeiServices are available to use.
116 @return FspSiliconInit parameter.
120 GetFspSiliconInitParam (
128 Get S3 PEI memory information.
130 @note At this point, memory is ready, and PeiServices are available to use.
131 Platform can get some data from SMRAM directly.
133 @param[out] S3PeiMemSize PEI memory size to be installed in S3 phase.
134 @param[out] S3PeiMemBase PEI memory base to be installed in S3 phase.
136 @return If S3 PEI memory information is got successfully.
141 OUT UINT64
*S3PeiMemSize
,
142 OUT EFI_PHYSICAL_ADDRESS
*S3PeiMemBase
145 return EFI_UNSUPPORTED
;
149 Get stack information according to boot mode.
151 @note If BootMode is BOOT_ON_S3_RESUME or BOOT_ON_FLASH_UPDATE,
152 this stack should be in some reserved memory space.
154 @note If FspInitDone is TRUE, memory is ready, but no PeiServices there.
155 Platform can get some data from SMRAM directly.
156 @note If FspInitDone is FALSE, memory is NOT ready, but PeiServices are available to use.
157 Platform can get some data from variable via VariablePpi.
159 @param[in] BootMode Current boot mode.
160 @param[in] FspInitDone If FspInit is called.
161 @param[out] StackSize Stack size to be used in PEI phase.
162 @param[out] StackBase Stack base to be used in PEI phase.
164 @return If Stack information is got successfully.
170 IN BOOLEAN FspInitDone
,
171 OUT UINT64
*StackSize
,
172 OUT EFI_PHYSICAL_ADDRESS
*StackBase
175 *StackBase
= PcdGet32 (PcdTemporaryRamBase
);
176 *StackSize
= PcdGet32 (PcdTemporaryRamSize
);
178 if (BootMode
== BOOT_ON_S3_RESUME
) {
182 } else if (BootMode
== BOOT_ON_FLASH_UPDATE
) {