From 9180ab73e6d4a72c420292c1454f94d391737fa1 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Fri, 10 Oct 2014 11:22:50 +0000 Subject: ArmPkg/ArmPsciResetSystemLib: Made the library only using SMC Only ArmVirtualizationPkg based platforms are expected to use the dynamic method to choose between SMC and HVC to invoke PSCI. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16204 6f19259b-4bc3-4df7-8a09-765794883524 --- .../ArmPsciResetSystemLib/ArmPsciResetSystemLib.c | 37 ++++------------------ .../ArmPsciResetSystemLib.inf | 6 +--- 2 files changed, 7 insertions(+), 36 deletions(-) (limited to 'ArmPkg/Library') diff --git a/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c b/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c index 286d37fb47..df4e113c0e 100644 --- a/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c +++ b/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c @@ -1,8 +1,12 @@ /** @file Support ResetSystem Runtime call using PSCI calls + Note: A similar library is implemented in + ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPsciResetSystemLib + So similar issues might exist in this implementation too. + Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- Copyright (c) 2013, ARM Ltd. All rights reserved.
+ Copyright (c) 2013-2014, ARM Ltd. All rights reserved.
Copyright (c) 2014, Linaro Ltd. All rights reserved.
This program and the accompanying materials @@ -21,22 +25,9 @@ #include #include #include -#include #include -STATIC UINT32 mArmPsciMethod; - -RETURN_STATUS -EFIAPI -ArmPsciResetSystemLibConstructor ( - VOID - ) -{ - mArmPsciMethod = PcdGet32 (PcdArmPsciMethod); - return RETURN_SUCCESS; -} - /** Resets the entire platform. @@ -58,10 +49,8 @@ LibResetSystem ( ) { ARM_SMC_ARGS ArmSmcArgs; - ARM_HVC_ARGS ArmHvcArgs; switch (ResetType) { - case EfiResetPlatformSpecific: // Map the platform specific reset as reboot case EfiResetWarm: @@ -69,31 +58,17 @@ LibResetSystem ( case EfiResetCold: // Send a PSCI 0.2 SYSTEM_RESET command ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET; - ArmHvcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET; break; case EfiResetShutdown: // Send a PSCI 0.2 SYSTEM_OFF command ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_OFF; - ArmHvcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_OFF; break; default: ASSERT (FALSE); return EFI_UNSUPPORTED; } - switch (mArmPsciMethod) { - case 1: - ArmCallHvc (&ArmHvcArgs); - break; - - case 2: - ArmCallSmc (&ArmSmcArgs); - break; - - default: - DEBUG ((EFI_D_ERROR, "%a: no PSCI method defined\n", __FUNCTION__)); - return EFI_UNSUPPORTED; - } + ArmCallSmc (&ArmSmcArgs); // We should never be here DEBUG ((EFI_D_ERROR, "%a: PSCI Reset failed\n", __FUNCTION__)); diff --git a/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf b/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf index 1a5bb6d10d..9cdde1f154 100644 --- a/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf +++ b/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf @@ -3,6 +3,7 @@ # # Copyright (c) 2008, Apple Inc. All rights reserved.
# Copyright (c) 2014, Linaro Ltd. All rights reserved.
+# Copyright (c) 2014, ARM Ltd. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -21,7 +22,6 @@ MODULE_TYPE = BASE VERSION_STRING = 1.0 LIBRARY_CLASS = EfiResetSystemLib - CONSTRUCTOR = ArmPsciResetSystemLibConstructor [Sources] ArmPsciResetSystemLib.c @@ -35,7 +35,3 @@ DebugLib BaseLib ArmSmcLib - ArmHvcLib - -[Pcd] - gArmTokenSpaceGuid.PcdArmPsciMethod -- cgit v1.2.3