]> git.proxmox.com Git - mirror_edk2.git/blobdiff - QuarkPlatformPkg/Library/PlatformHelperLib/PlatformHelperPei.c
edk2: Remove packages moved to edk2-platforms
[mirror_edk2.git] / QuarkPlatformPkg / Library / PlatformHelperLib / PlatformHelperPei.c
diff --git a/QuarkPlatformPkg/Library/PlatformHelperLib/PlatformHelperPei.c b/QuarkPlatformPkg/Library/PlatformHelperLib/PlatformHelperPei.c
deleted file mode 100644 (file)
index 9de3f61..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/** @file\r
-Implementation of Helper routines for PEI enviroment.\r
-\r
-Copyright (c) 2013-2016 Intel Corporation.\r
-\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include <PiPei.h>\r
-\r
-#include <Library/PeiServicesTablePointerLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Library/I2cLib.h>\r
-\r
-#include "CommonHeader.h"\r
-\r
-//\r
-// Routines defined in other source modules of this component.\r
-//\r
-\r
-//\r
-// Routines local to this source module.\r
-//\r
-\r
-//\r
-// Routines exported by this source module.\r
-//\r
-\r
-/**\r
-  Find pointer to RAW data in Firmware volume file.\r
-\r
-  @param   FvNameGuid       Firmware volume to search. If == NULL search all.\r
-  @param   FileNameGuid     Firmware volume file to search for.\r
-  @param   SectionData      Pointer to RAW data section of found file.\r
-  @param   SectionDataSize  Pointer to UNITN to get size of RAW data.\r
-\r
-  @retval  EFI_SUCCESS            Raw Data found.\r
-  @retval  EFI_INVALID_PARAMETER  FileNameGuid == NULL.\r
-  @retval  EFI_NOT_FOUND          Firmware volume file not found.\r
-  @retval  EFI_UNSUPPORTED        Unsupported in current enviroment (PEI or DXE).\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PlatformFindFvFileRawDataSection (\r
-  IN CONST EFI_GUID                 *FvNameGuid OPTIONAL,\r
-  IN CONST EFI_GUID                 *FileNameGuid,\r
-  OUT VOID                          **SectionData,\r
-  OUT UINTN                         *SectionDataSize\r
-  )\r
-{\r
-  EFI_STATUS                        Status;\r
-  UINTN                             Instance;\r
-  EFI_PEI_FV_HANDLE                 VolumeHandle;\r
-  EFI_PEI_FILE_HANDLE               FileHandle;\r
-  EFI_SECTION_TYPE                  SearchType;\r
-  EFI_FV_INFO                       VolumeInfo;\r
-  EFI_FV_FILE_INFO                  FileInfo;\r
-\r
-  if (FileNameGuid == NULL || SectionData == NULL || SectionDataSize == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  *SectionData = NULL;\r
-  *SectionDataSize = 0;\r
-\r
-  SearchType = EFI_SECTION_RAW;\r
-  for (Instance = 0; !EFI_ERROR((PeiServicesFfsFindNextVolume (Instance, &VolumeHandle))); Instance++) {\r
-    if (FvNameGuid != NULL) {\r
-      Status = PeiServicesFfsGetVolumeInfo (VolumeHandle, &VolumeInfo);\r
-      if (EFI_ERROR (Status)) {\r
-        continue;\r
-      }\r
-      if (!CompareGuid (FvNameGuid, &VolumeInfo.FvName)) {\r
-        continue;\r
-      }\r
-    }\r
-    Status = PeiServicesFfsFindFileByName (FileNameGuid, VolumeHandle, &FileHandle);\r
-    if (!EFI_ERROR (Status)) {\r
-      Status = PeiServicesFfsGetFileInfo (FileHandle, &FileInfo);\r
-      if (EFI_ERROR (Status)) {\r
-        continue;\r
-      }\r
-      if (IS_SECTION2(FileInfo.Buffer)) {\r
-        *SectionDataSize = SECTION2_SIZE(FileInfo.Buffer) - sizeof(EFI_COMMON_SECTION_HEADER2);\r
-      } else {\r
-        *SectionDataSize = SECTION_SIZE(FileInfo.Buffer) - sizeof(EFI_COMMON_SECTION_HEADER);\r
-      }\r
-      Status = PeiServicesFfsFindSectionData (SearchType, FileHandle, SectionData);\r
-      if (!EFI_ERROR (Status)) {\r
-        return Status;\r
-      }\r
-    }\r
-  }\r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
-/**\r
-  Find free spi protect register and write to it to protect a flash region.\r
-\r
-  @param   DirectValue      Value to directly write to register.\r
-                            if DirectValue == 0 the use Base & Length below.\r
-  @param   BaseAddress      Base address of region in Flash Memory Map.\r
-  @param   Length           Length of region to protect.\r
-\r
-  @retval  EFI_SUCCESS      Free spi protect register found & written.\r
-  @retval  EFI_NOT_FOUND    Free Spi protect register not found.\r
-  @retval  EFI_DEVICE_ERROR Unable to write to spi protect register.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PlatformWriteFirstFreeSpiProtect (\r
-  IN CONST UINT32                         DirectValue,\r
-  IN CONST UINT32                         BaseAddress,\r
-  IN CONST UINT32                         Length\r
-  )\r
-{\r
-  return WriteFirstFreeSpiProtect (\r
-           QNC_RCRB_BASE,\r
-           DirectValue,\r
-           BaseAddress,\r
-           Length,\r
-           NULL\r
-           );\r
-}\r
-\r
-/** Check if System booted with recovery Boot Stage1 image.\r
-\r
-  @retval  TRUE    If system booted with recovery Boot Stage1 image.\r
-  @retval  FALSE   If system booted with normal stage1 image.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-PlatformIsBootWithRecoveryStage1 (\r
-  VOID\r
-  )\r
-{\r
-  BOOLEAN                           IsRecoveryBoot;\r
-  QUARK_EDKII_STAGE1_HEADER         *Edk2ImageHeader;\r
-\r
-  Edk2ImageHeader = (QUARK_EDKII_STAGE1_HEADER *) PcdGet32 (PcdEsramStage1Base);\r
-  switch ((UINT8)Edk2ImageHeader->ImageIndex & QUARK_STAGE1_IMAGE_TYPE_MASK) {\r
-  case QUARK_STAGE1_RECOVERY_IMAGE_TYPE:\r
-    //\r
-    // Recovery Boot\r
-    //\r
-    IsRecoveryBoot = TRUE;\r
-    break;\r
-  default:\r
-    //\r
-    // Normal Boot\r
-    //\r
-    IsRecoveryBoot = FALSE;\r
-    break;\r
-  }\r
-\r
-  return IsRecoveryBoot;\r
-}\r