]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspWrapperPkg/Include/Library/FspPlatformInfoLib.h
Add IntelFspWrapper to support boot EDKII on FSP bin.
[mirror_edk2.git] / IntelFspWrapperPkg / Include / Library / FspPlatformInfoLib.h
diff --git a/IntelFspWrapperPkg/Include/Library/FspPlatformInfoLib.h b/IntelFspWrapperPkg/Include/Library/FspPlatformInfoLib.h
new file mode 100644 (file)
index 0000000..ebbe9a7
--- /dev/null
@@ -0,0 +1,116 @@
+/** @file\r
+  Provide FSP platform information related function.\r
+\r
+  Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php.\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __FSP_PLATFORM_INFO_LIB_H__\r
+#define __FSP_PLATFORM_INFO_LIB_H__\r
+\r
+/**\r
+  Get current boot mode.\r
+\r
+  @note At this point, memory is ready, PeiServices are NOT available to use.\r
+  Platform can get some data from chipset register.\r
+\r
+  @return BootMode current boot mode.\r
+**/\r
+UINT32\r
+EFIAPI\r
+GetBootMode (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Get NVS buffer parameter.\r
+\r
+  @note At this point, memory is NOT ready, PeiServices are available to use.\r
+\r
+  @return NvsBuffer NVS buffer parameter.\r
+**/\r
+VOID *\r
+EFIAPI\r
+GetNvsBuffer (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Get UPD region size.\r
+\r
+  @note At this point, memory is NOT ready, PeiServices are available to use.\r
+\r
+  @return UPD region size.\r
+**/\r
+UINT32\r
+EFIAPI\r
+GetUpdRegionSize (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  This function overrides the default configurations in the UPD data region.\r
+\r
+  @param[in,out] FspUpdRgnPtr   A pointer to the UPD data region data strcture.\r
+\r
+  @return  FspUpdRgnPtr   A pointer to the UPD data region data strcture.\r
+**/\r
+VOID *\r
+EFIAPI\r
+UpdateFspUpdConfigs (\r
+  IN OUT VOID        *FspUpdRgnPtr\r
+  );\r
+\r
+/**\r
+  Get S3 PEI memory information.\r
+\r
+  @note At this point, memory is ready, and PeiServices are available to use.\r
+  Platform can get some data from SMRAM directly.\r
+\r
+  @param[out] S3PeiMemSize  PEI memory size to be installed in S3 phase.\r
+  @param[out] S3PeiMemBase  PEI memory base to be installed in S3 phase.\r
+\r
+  @return If S3 PEI memory information is got successfully.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetS3MemoryInfo (\r
+  OUT UINT64               *S3PeiMemSize,\r
+  OUT EFI_PHYSICAL_ADDRESS *S3PeiMemBase\r
+  );\r
+\r
+/**\r
+  Get stack information according to boot mode.\r
+\r
+  @note If BootMode is BOOT_ON_S3_RESUME or BOOT_ON_FLASH_UPDATE,\r
+  this stack should be in some reserved memory space.\r
+\r
+  @note If FspInitDone is TRUE, memory is ready, but no PeiServices there.\r
+  Platform can get some data from SMRAM directly.\r
+  @note If FspInitDone is FALSE, memory is NOT ready, but PeiServices are available to use.\r
+  Platform can get some data from variable via VariablePpi.\r
+\r
+  @param[in]  BootMode     Current boot mode.\r
+  @param[in]  FspInitDone  If FspInit is called.\r
+  @param[out] StackSize    Stack size to be used in PEI phase.\r
+  @param[out] StackBase    Stack base to be used in PEI phase.\r
+\r
+  @return If Stack information is got successfully.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetStackInfo (\r
+  IN  UINT32               BootMode,\r
+  IN  BOOLEAN              FspInitDone,\r
+  OUT UINT64               *StackSize,\r
+  OUT EFI_PHYSICAL_ADDRESS *StackBase\r
+  );\r
+\r
+#endif\r