/** @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
)\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
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