diff options
author | Pranav Madhu <pranav.madhu@arm.com> | 2022-08-24 22:14:21 +0530 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-09-05 13:52:51 +0000 |
commit | 52bf4eba454ea0f9d7502a92191eb0ab7778ba00 (patch) | |
tree | 4a938a3ce1c903210f75be7ea402c89be2c9561a /ArmPkg/Library | |
parent | aefcc91805fd69e4aad4bc08a9f708db11cae5f0 (diff) | |
download | edk2-52bf4eba454ea0f9d7502a92191eb0ab7778ba00.tar.gz |
ArmPkg: Handle warm reboot request correctly
The warm reboot requests from OSPM are mapped to cold reboot. To handle
the warm reboot separately from a cold reboot, update
ArmSmcPsciResetSystemLib and to invoke the PSCI call with parameters
for warm reboot.
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'ArmPkg/Library')
-rw-r--r-- | ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c b/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c index af6738459e..dc7b9fd019 100644 --- a/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c +++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c @@ -3,6 +3,7 @@ Copyright (c) 2017 - 2018, Linaro Ltd. All rights reserved.<BR>
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -47,8 +48,24 @@ ResetWarm ( VOID
)
{
- // Map a warm reset into a cold reset
- ResetCold ();
+ UINTN Arg1;
+ UINTN Ret;
+
+ Arg1 = ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64;
+
+ // Is SYSTEM_RESET2 supported?
+ Ret = ArmCallSmc0 (ARM_SMC_ID_PSCI_FEATURES, &Arg1, NULL, NULL);
+ if (Ret == ARM_SMC_PSCI_RET_SUCCESS) {
+ // Send PSCI SYSTEM_RESET2 command
+ ArmCallSmc0 (Arg1, NULL, NULL, NULL);
+ } else {
+ // Map a warm reset into a cold reset
+ DEBUG ((
+ DEBUG_INFO,
+ "Warm reboot not supported by platform, issuing cold reboot\n"
+ ));
+ ResetCold ();
+ }
}
/**
|