]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/ArmSmcPsciResetSystemLib: remove EnterS3WithImmediateWake ()
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 6 Jan 2020 17:16:14 +0000 (18:16 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 14 Jan 2020 22:12:17 +0000 (22:12 +0000)
EnterS3WithImmediateWake () no longer has any callers, so remove it
from ResetSystemLib. Note that this means the hack to support warm
reboot by jumping to the SEC entry point with the MMU and caches off
is also no longer used, and can be removed as well, along with the PCD
PcdArmReenterPeiForCapsuleWarmReboot that was introduced for this
purpose.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPkg/ArmPkg.dec
ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S [deleted file]
ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm [deleted file]
ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S [deleted file]
ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.asm [deleted file]
ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c
ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf

index 39ff339c956d97a7d2fd9e01f00a24dcc5c15f3e..eaf1072d9ef31fc003455cced39e3f2ce4f4b0c3 100644 (file)
   # Define if the GICv3 controller should use the GICv2 legacy\r
   gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|FALSE|BOOLEAN|0x00000042\r
 \r
-  # Whether to implement warm reboot for capsule update using a jump back to the\r
-  # PEI entry point with caches and interrupts disabled.\r
-  gArmTokenSpaceGuid.PcdArmReenterPeiForCapsuleWarmReboot|FALSE|BOOLEAN|0x0000001F\r
-\r
 [PcdsFeatureFlag.ARM]\r
   # Whether to map normal memory as non-shareable. FALSE is the safe choice, but\r
   # TRUE may be appropriate to fix performance problems if you don't care about\r
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S
deleted file mode 100644 (file)
index d0d908b..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/** @file
-  ResetSystemLib implementation using PSCI calls
-
-  Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <AsmMacroIoLibV8.h>
-
-ASM_FUNC(DisableMmuAndReenterPei)
-  stp   x29, x30, [sp, #-16]!
-  mov   x29, sp
-
-  bl    ArmDisableMmu
-
-  // no memory accesses after MMU and caches have been disabled
-
-  MOV64 (x0, FixedPcdGet64 (PcdFvBaseAddress))
-  blr   x0
-
-  // never returns
-  nop
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm
deleted file mode 100644 (file)
index 752df07..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-;/** @file
-;  ResetSystemLib implementation using PSCI calls
-;
-;  Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
-;
-;  SPDX-License-Identifier: BSD-2-Clause-Patent
-;
-;**/
-
-  AREA Reset, CODE, READONLY
-
-  EXPORT DisableMmuAndReenterPei
-  IMPORT ArmDisableMmu
-
-DisableMmuAndReenterPei
-  stp   x29, x30, [sp, #-16]!
-  mov   x29, sp
-
-  bl    ArmDisableMmu
-
-  ; no memory accesses after MMU and caches have been disabled
-
-  movl  x0, FixedPcdGet64 (PcdFvBaseAddress)
-  blr   x0
-
-  ; never returns
-  nop
-
-  END
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S
deleted file mode 100644 (file)
index c0c5bcf..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/** @file
-  ResetSystemLib implementation using PSCI calls
-
-  Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(DisableMmuAndReenterPei)
-  push  {lr}
-
-  bl    ArmDisableMmu
-
-  // no memory accesses after MMU and caches have been disabled
-
-  MOV32 (r0, FixedPcdGet64 (PcdFvBaseAddress))
-  blx   r0
-
-  // never returns
-  nop
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.asm b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.asm
deleted file mode 100644 (file)
index ab7519a..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-;/** @file
-;  ResetSystemLib implementation using PSCI calls
-;
-;  Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
-;
-;  SPDX-License-Identifier: BSD-2-Clause-Patent
-;
-;**/
-
-  INCLUDE AsmMacroExport.inc
-  PRESERVE8
-
-  IMPORT ArmDisableMmu
-
-RVCT_ASM_EXPORT DisableMmuAndReenterPei
-  push  {lr}
-
-  bl    ArmDisableMmu
-
-  ; no memory accesses after MMU and caches have been disabled
-
-  mov32 r0, FixedPcdGet64 (PcdFvBaseAddress)
-  blx   r0
-
-  ; never returns
-  nop
-
-  END
index b2dde9bfc13a880e8670eb883ef7a4ff687c11e7..8b5ff5c27e441f7746da87b3f95aa90c69336ee6 100644 (file)
 \r
 #include <PiDxe.h>\r
 \r
-#include <Library/ArmMmuLib.h>\r
 #include <Library/ArmSmcLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/ResetSystemLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiRuntimeLib.h>\r
 \r
 #include <IndustryStandard/ArmStdSmc.h>\r
 \r
@@ -76,79 +73,6 @@ ResetShutdown (
   ArmCallSmc (&ArmSmcArgs);\r
 }\r
 \r
-VOID DisableMmuAndReenterPei (VOID);\r
-\r
-/**\r
-  This function causes the system to enter S3 and then wake up immediately.\r
-\r
-  If this function returns, it means that the system does not support S3 feature.\r
-**/\r
-VOID\r
-EFIAPI\r
-EnterS3WithImmediateWake (\r
-  VOID\r
-  )\r
-{\r
-  EFI_PHYSICAL_ADDRESS        Alloc;\r
-  EFI_MEMORY_DESCRIPTOR       *MemMap;\r
-  UINTN                       MemMapSize;\r
-  UINTN                       MapKey, DescriptorSize;\r
-  UINT32                      DescriptorVersion;\r
-  EFI_STATUS                  Status;\r
-\r
-  if (FeaturePcdGet (PcdArmReenterPeiForCapsuleWarmReboot) &&\r
-      !EfiAtRuntime ()) {\r
-    //\r
-    // At boot time, we are the only core running, so we can implement the\r
-    // immediate wake (which is used by capsule update) by disabling the MMU\r
-    // and interrupts, and jumping to the PEI entry point.\r
-    //\r
-\r
-    //\r
-    // Obtain the size of the memory map\r
-    //\r
-    MemMapSize = 0;\r
-    MemMap = NULL;\r
-    Status = gBS->GetMemoryMap (&MemMapSize, MemMap, &MapKey, &DescriptorSize,\r
-                    &DescriptorVersion);\r
-    ASSERT (Status == EFI_BUFFER_TOO_SMALL);\r
-\r
-    //\r
-    // Add some slack to the allocation to cater for changes in the memory\r
-    // map if ExitBootServices () fails the first time around.\r
-    //\r
-    MemMapSize += SIZE_4KB;\r
-    Status = gBS->AllocatePages (AllocateAnyPages, EfiBootServicesData,\r
-                    EFI_SIZE_TO_PAGES (MemMapSize), &Alloc);\r
-    ASSERT_EFI_ERROR (Status);\r
-\r
-    MemMap = (EFI_MEMORY_DESCRIPTOR *)(UINTN)Alloc;\r
-\r
-    Status = gBS->GetMemoryMap (&MemMapSize, MemMap, &MapKey, &DescriptorSize,\r
-                    &DescriptorVersion);\r
-    ASSERT_EFI_ERROR (Status);\r
-\r
-    Status = gBS->ExitBootServices (gImageHandle, MapKey);\r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // ExitBootServices () may fail the first time around if an event fired\r
-      // right after the call to GetMemoryMap() which allocated or freed memory.\r
-      // Since that first call to ExitBootServices () will disarm the timer,\r
-      // this is guaranteed not to happen again, so one additional attempt\r
-      // should suffice.\r
-      //\r
-      Status = gBS->GetMemoryMap (&MemMapSize, MemMap, &MapKey, &DescriptorSize,\r
-                      &DescriptorVersion);\r
-      ASSERT_EFI_ERROR (Status);\r
-\r
-      Status = gBS->ExitBootServices (gImageHandle, MapKey);\r
-      ASSERT_EFI_ERROR (Status);\r
-    }\r
-\r
-    DisableMmuAndReenterPei ();\r
-  }\r
-}\r
-\r
 /**\r
   This function causes a systemwide reset. The exact type of the reset is\r
   defined by the EFI_GUID that follows the Null-terminated Unicode string passed\r
index fa19bf649131a67abc33492193c40ba21436430a..c17b28cfac7965a0e86b16753106466e07e187d5 100644 (file)
   VERSION_STRING                 = 1.0\r
   LIBRARY_CLASS                  = ResetSystemLib\r
 \r
-[Sources.AARCH64]\r
-  AArch64/Reset.S   | GCC\r
-  AArch64/Reset.asm | MSFT\r
-\r
-[Sources.ARM]\r
-  Arm/Reset.S       | GCC\r
-  Arm/Reset.asm     | RVCT\r
-\r
 [Sources]\r
   ArmSmcPsciResetSystemLib.c\r
 \r
   MdePkg/MdePkg.dec\r
 \r
 [LibraryClasses]\r
-  ArmMmuLib\r
   ArmSmcLib\r
   BaseLib\r
   DebugLib\r
-  UefiBootServicesTableLib\r
-  UefiRuntimeLib\r
-\r
-[FeaturePcd]\r
-  gArmTokenSpaceGuid.PcdArmReenterPeiForCapsuleWarmReboot\r
-\r
-[FixedPcd]\r
-  gArmTokenSpaceGuid.PcdFvBaseAddress\r