]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CorebootPayloadPkg/PlatformHelperLib: Remove unreferenced function
authorLeahy, Leroy P <leroy.p.leahy@intel.com>
Thu, 5 May 2016 00:37:26 +0000 (17:37 -0700)
committerPrince Agyeman <prince.agyeman@intel.com>
Thu, 5 May 2016 23:08:42 +0000 (16:08 -0700)
Remove the PlatformFlashEraseWrite function which is not used within
CorebootPayloadPkg.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
QuarkPlatformPkg/Include/Library/PlatformHelperLib.h
QuarkPlatformPkg/Library/PlatformHelperLib/PlatformHelperDxe.c

index a6cc8633cb03558d63a1a0d5c5cedd962f7bdb92..7b4119deb990187b93c431310000c1a53fcf9cbb 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 PlatformHelperLib function prototype definitions.\r
 \r
-Copyright (c) 2013 Intel Corporation.\r
+Copyright (c) 2013 - 2016 Intel Corporation.
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -106,42 +106,6 @@ PlatformFlashLockPolicy (
   IN CONST BOOLEAN                        PreBootPolicy\r
   );\r
 \r
-/**\r
-  Erase and Write to platform flash.\r
-\r
-  Routine accesses one flash block at a time, each access consists\r
-  of an erase followed by a write of FLASH_BLOCK_SIZE. One or both\r
-  of DoErase & DoWrite params must be TRUE.\r
-\r
-  Limitations:-\r
-    CpuWriteAddress must be aligned to FLASH_BLOCK_SIZE.\r
-    DataSize must be a multiple of FLASH_BLOCK_SIZE.\r
-\r
-  @param   Smst                   If != NULL then InSmm and use to locate\r
-                                  SpiProtocol.\r
-  @param   CpuWriteAddress        Address in CPU memory map of flash region.\r
-  @param   Data                   The buffer containing the data to be written.\r
-  @param   DataSize               Amount of data to write.\r
-  @param   DoErase                Earse each block.\r
-  @param   DoWrite                Write to each block.\r
-\r
-  @retval  EFI_SUCCESS            Operation successful.\r
-  @retval  EFI_NOT_READY          Required resources not setup.\r
-  @retval  EFI_INVALID_PARAMETER  Invalid parameter.\r
-  @retval  Others                 Unexpected error happened.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PlatformFlashEraseWrite (\r
-  IN  VOID                              *Smst,\r
-  IN  UINTN                             CpuWriteAddress,\r
-  IN  UINT8                             *Data,\r
-  IN  UINTN                             DataSize,\r
-  IN  BOOLEAN                           DoErase,\r
-  IN  BOOLEAN                           DoWrite\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
index 18dbd8b89e7e46eadf0aa2103017168d62239f01..441f7609a536462e41c6c9c869d6c877e4d72a91 100644 (file)
@@ -325,147 +325,6 @@ PlatformFlashLockPolicy (
   }\r
 }\r
 \r
-/**\r
-  Erase and Write to platform flash.\r
-\r
-  Routine accesses one flash block at a time, each access consists\r
-  of an erase followed by a write of FLASH_BLOCK_SIZE. One or both\r
-  of DoErase & DoWrite params must be TRUE.\r
-\r
-  Limitations:-\r
-    CpuWriteAddress must be aligned to FLASH_BLOCK_SIZE.\r
-    DataSize must be a multiple of FLASH_BLOCK_SIZE.\r
-\r
-  @param   Smst                   If != NULL then InSmm and use to locate\r
-                                  SpiProtocol.\r
-  @param   CpuWriteAddress        Address in CPU memory map of flash region.\r
-  @param   Data                   The buffer containing the data to be written.\r
-  @param   DataSize               Amount of data to write.\r
-  @param   DoErase                Earse each block.\r
-  @param   DoWrite                Write to each block.\r
-\r
-  @retval  EFI_SUCCESS            Operation successful.\r
-  @retval  EFI_NOT_READY          Required resources not setup.\r
-  @retval  EFI_INVALID_PARAMETER  Invalid parameter.\r
-  @retval  Others                 Unexpected error happened.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PlatformFlashEraseWrite (\r
-  IN  VOID                              *Smst,\r
-  IN  UINTN                             CpuWriteAddress,\r
-  IN  UINT8                             *Data,\r
-  IN  UINTN                             DataSize,\r
-  IN  BOOLEAN                           DoErase,\r
-  IN  BOOLEAN                           DoWrite\r
-  )\r
-{\r
-  EFI_STATUS                        Status;\r
-  UINT64                            CpuBaseAddress;\r
-  SPI_INIT_INFO                     *SpiInfo;\r
-  UINT8                             *WriteBuf;\r
-  UINTN                             Index;\r
-  UINTN                             SpiWriteAddress;\r
-  EFI_SPI_PROTOCOL                  *SpiProtocol;\r
-\r
-  if (!DoErase && !DoWrite) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  if (DoWrite && Data == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  if ((CpuWriteAddress % FLASH_BLOCK_SIZE) != 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  if ((DataSize % FLASH_BLOCK_SIZE) != 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  SpiProtocol = LocateSpiProtocol ((EFI_SMM_SYSTEM_TABLE2 *)Smst);\r
-  if (SpiProtocol == NULL) {\r
-    return EFI_NOT_READY;\r
-  }\r
-\r
-  //\r
-  // Find info to allow usage of SpiProtocol->Execute.\r
-  //\r
-  Status = SpiProtocol->Info (\r
-             SpiProtocol,\r
-             &SpiInfo\r
-             );\r
-  if (EFI_ERROR(Status)) {\r
-    return Status;\r
-  }\r
-  ASSERT (SpiInfo->InitTable != NULL);\r
-  ASSERT (SpiInfo->EraseOpcodeIndex < SPI_NUM_OPCODE);\r
-  ASSERT (SpiInfo->ProgramOpcodeIndex < SPI_NUM_OPCODE);\r
-\r
-  CpuBaseAddress = PcdGet32 (PcdFlashAreaBaseAddress) - (UINT32)SpiInfo->InitTable->BiosStartOffset;\r
-  ASSERT(CpuBaseAddress >= (SIZE_4GB - SIZE_8MB));\r
-  if (CpuWriteAddress < CpuBaseAddress) {\r
-    return (EFI_INVALID_PARAMETER);\r
-  }\r
-\r
-  SpiWriteAddress = CpuWriteAddress - ((UINTN) CpuBaseAddress);\r
-  WriteBuf = Data;\r
-  DEBUG (\r
-    (EFI_D_INFO, "PlatformFlashWrite:SpiWriteAddress=%08x EraseIndex=%d WriteIndex=%d\n",\r
-    SpiWriteAddress,\r
-    (UINTN) SpiInfo->EraseOpcodeIndex,\r
-    (UINTN) SpiInfo->ProgramOpcodeIndex\r
-    ));\r
-  for (Index =0; Index < DataSize / FLASH_BLOCK_SIZE; Index++) {\r
-    if (DoErase) {\r
-      DEBUG (\r
-        (EFI_D_INFO, "PlatformFlashWrite:Erase[%04x] SpiWriteAddress=%08x\n",\r
-        Index,\r
-        SpiWriteAddress\r
-        ));\r
-      Status = SpiProtocol->Execute (\r
-                              SpiProtocol,\r
-                              SpiInfo->EraseOpcodeIndex,// OpcodeIndex\r
-                              0,                        // PrefixOpcodeIndex\r
-                              FALSE,                    // DataCycle\r
-                              TRUE,                     // Atomic\r
-                              FALSE,                    // ShiftOut\r
-                              SpiWriteAddress,          // Address\r
-                              0,                        // Data Number\r
-                              NULL,\r
-                              EnumSpiRegionAll          // SPI_REGION_TYPE\r
-                              );\r
-      if (EFI_ERROR(Status)) {\r
-        return Status;\r
-      }\r
-    }\r
-\r
-    if (DoWrite) {\r
-      DEBUG (\r
-        (EFI_D_INFO, "PlatformFlashWrite:Write[%04x] SpiWriteAddress=%08x\n",\r
-        Index,\r
-        SpiWriteAddress\r
-        ));\r
-      Status = SpiProtocol->Execute (\r
-                              SpiProtocol,\r
-                              SpiInfo->ProgramOpcodeIndex,   // OpcodeIndex\r
-                              0,                             // PrefixOpcodeIndex\r
-                              TRUE,                          // DataCycle\r
-                              TRUE,                          // Atomic\r
-                              TRUE,                          // ShiftOut\r
-                              SpiWriteAddress,               // Address\r
-                              FLASH_BLOCK_SIZE,              // Data Number\r
-                              WriteBuf,\r
-                              EnumSpiRegionAll\r
-                              );\r
-      if (EFI_ERROR(Status)) {\r
-        return Status;\r
-      }\r
-      WriteBuf+=FLASH_BLOCK_SIZE;\r
-    }\r
-    SpiWriteAddress+=FLASH_BLOCK_SIZE;\r
-  }\r
-  return EFI_SUCCESS;\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