2 Sample to provide FSP platform information related function.
4 Copyright (c) 2014, 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.
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.
16 #include <Library/PcdLib.h>
19 Get current boot mode.
21 @note At this point, memory is ready, PeiServices are NOT available to use.
22 Platform can get some data from chipset register.
24 @return BootMode current boot mode.
32 return BOOT_WITH_FULL_CONFIGURATION
;
36 Get NVS buffer parameter.
38 @note At this point, memory is NOT ready, PeiServices are available to use.
40 @return NvsBuffer NVS buffer parameter.
54 @note At this point, memory is NOT ready, PeiServices are available to use.
56 @return UPD region size.
68 This function overrides the default configurations in the UPD data region.
70 @note At this point, memory is NOT ready, PeiServices are available to use.
72 @param[in,out] FspUpdRgnPtr A pointer to the UPD data region data strcture.
74 @return FspUpdRgnPtr A pointer to the UPD data region data strcture.
79 IN OUT VOID
*FspUpdRgnPtr
86 Get TempRamExit parameter.
88 @note At this point, memory is ready, PeiServices are available to use.
90 @return TempRamExit parameter.
102 Get FspSiliconInit parameter.
104 @note At this point, memory is ready, PeiServices are available to use.
106 @return FspSiliconInit parameter.
110 GetFspSiliconInitParam (
118 Get S3 PEI memory information.
120 @note At this point, memory is ready, and PeiServices are available to use.
121 Platform can get some data from SMRAM directly.
123 @param[out] S3PeiMemSize PEI memory size to be installed in S3 phase.
124 @param[out] S3PeiMemBase PEI memory base to be installed in S3 phase.
126 @return If S3 PEI memory information is got successfully.
131 OUT UINT64
*S3PeiMemSize
,
132 OUT EFI_PHYSICAL_ADDRESS
*S3PeiMemBase
135 return EFI_UNSUPPORTED
;
139 Get stack information according to boot mode.
141 @note If BootMode is BOOT_ON_S3_RESUME or BOOT_ON_FLASH_UPDATE,
142 this stack should be in some reserved memory space.
144 @note If FspInitDone is TRUE, memory is ready, but no PeiServices there.
145 Platform can get some data from SMRAM directly.
146 @note If FspInitDone is FALSE, memory is NOT ready, but PeiServices are available to use.
147 Platform can get some data from variable via VariablePpi.
149 @param[in] BootMode Current boot mode.
150 @param[in] FspInitDone If FspInit is called.
151 @param[out] StackSize Stack size to be used in PEI phase.
152 @param[out] StackBase Stack base to be used in PEI phase.
154 @return If Stack information is got successfully.
160 IN BOOLEAN FspInitDone
,
161 OUT UINT64
*StackSize
,
162 OUT EFI_PHYSICAL_ADDRESS
*StackBase
165 *StackBase
= PcdGet32 (PcdTemporaryRamBase
);
166 *StackSize
= PcdGet32 (PcdTemporaryRamSize
);
168 if (BootMode
== BOOT_ON_S3_RESUME
) {
172 } else if (BootMode
== BOOT_ON_FLASH_UPDATE
) {