]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c
ArmPkg/ArmPsciResetSystemLib: Made the library only using SMC
[mirror_edk2.git] / ArmPkg / Library / ArmPsciResetSystemLib / ArmPsciResetSystemLib.c
index 286d37fb47b1bf5cf2e999443dd1ecd1968e98b8..df4e113c0e09f8b55e703937b55cd519dde8d462 100644 (file)
@@ -1,8 +1,12 @@
 /** @file\r
   Support ResetSystem Runtime call using PSCI calls\r
 \r
+  Note: A similar library is implemented in\r
+  ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPsciResetSystemLib\r
+  So similar issues might exist in this implementation too.\r
+\r
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-  Copyright (c) 2013, ARM Ltd. All rights reserved.<BR>\r
+  Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>\r
   Copyright (c) 2014, Linaro Ltd. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
 #include <Library/DebugLib.h>\r
 #include <Library/EfiResetSystemLib.h>\r
 #include <Library/ArmSmcLib.h>\r
-#include <Library/ArmHvcLib.h>\r
 \r
 #include <IndustryStandard/ArmStdSmc.h>\r
 \r
-STATIC UINT32 mArmPsciMethod;\r
-\r
-RETURN_STATUS\r
-EFIAPI\r
-ArmPsciResetSystemLibConstructor (\r
-  VOID\r
-  )\r
-{\r
-  mArmPsciMethod = PcdGet32 (PcdArmPsciMethod);\r
-  return RETURN_SUCCESS;\r
-}\r
-\r
 /**\r
   Resets the entire platform.\r
 \r
@@ -58,10 +49,8 @@ LibResetSystem (
   )\r
 {\r
   ARM_SMC_ARGS ArmSmcArgs;\r
-  ARM_HVC_ARGS ArmHvcArgs;\r
 \r
   switch (ResetType) {\r
-\r
   case EfiResetPlatformSpecific:\r
     // Map the platform specific reset as reboot\r
   case EfiResetWarm:\r
@@ -69,31 +58,17 @@ LibResetSystem (
   case EfiResetCold:\r
     // Send a PSCI 0.2 SYSTEM_RESET command\r
     ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET;\r
-    ArmHvcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET;\r
     break;\r
   case EfiResetShutdown:\r
     // Send a PSCI 0.2 SYSTEM_OFF command\r
     ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_OFF;\r
-    ArmHvcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_OFF;\r
     break;\r
   default:\r
     ASSERT (FALSE);\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  switch (mArmPsciMethod) {\r
-  case 1:\r
-    ArmCallHvc (&ArmHvcArgs);\r
-    break;\r
-\r
-  case 2:\r
-    ArmCallSmc (&ArmSmcArgs);\r
-    break;\r
-\r
-  default:\r
-    DEBUG ((EFI_D_ERROR, "%a: no PSCI method defined\n", __FUNCTION__));\r
-    return EFI_UNSUPPORTED;\r
-  }\r
+  ArmCallSmc (&ArmSmcArgs);\r
 \r
   // We should never be here\r
   DEBUG ((EFI_D_ERROR, "%a: PSCI Reset failed\n", __FUNCTION__));\r